Skip to content

Commit

Permalink
Fix compilation with latest Kinc
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Dec 17, 2023
1 parent fed9fd3 commit f186efe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/Kore/Input/Gamepad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ namespace {
bool padInitialized[maxGamepads] = {0};
bool callbacksInitialized = false;

void axisCallback(int gamepad, int axis, float value) {
void axisCallback(int gamepad, int axis, float value, void *data) {
if (gamepad < maxGamepads && padInitialized[gamepad] && pads[gamepad].Axis != nullptr) {
pads[gamepad].Axis(axis, value);
}
}

void buttonCallback(int gamepad, int button, float value) {
void buttonCallback(int gamepad, int button, float value, void *data) {
if (gamepad < maxGamepads && padInitialized[gamepad] && pads[gamepad].Button != nullptr) {
pads[gamepad].Button(button, value);
}
Expand All @@ -28,8 +28,8 @@ Gamepad *Gamepad::get(int num) {
return nullptr;
}
if (!callbacksInitialized) {
kinc_gamepad_set_axis_callback(axisCallback);
kinc_gamepad_set_button_callback(buttonCallback);
kinc_gamepad_set_axis_callback(axisCallback, nullptr);
kinc_gamepad_set_button_callback(buttonCallback, nullptr);
}
if (!padInitialized[num]) {
pads[num].vendor = kinc_gamepad_vendor(num);
Expand Down

0 comments on commit f186efe

Please sign in to comment.