Skip to content

Commit

Permalink
Fix issues with gamepad timestamps (WINDOWS ONLY)
Browse files Browse the repository at this point in the history
  • Loading branch information
EliteMasterEric committed Jan 10, 2024
1 parent 737b86f commit 17086ec
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
Binary file modified ndll/Windows/lime-debug.ndll
Binary file not shown.
Binary file modified ndll/Windows/lime.ndll
Binary file not shown.
2 changes: 1 addition & 1 deletion ndll/Windows/lime.ndll.hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dceb90ca49181d24f28d7e90cdd45b53
8b6727c0ea9f63970c34a22225811451
Binary file modified ndll/Windows64/lime-debug.ndll
Binary file not shown.
Binary file modified ndll/Windows64/lime.ndll
Binary file not shown.
2 changes: 1 addition & 1 deletion ndll/Windows64/lime.ndll.hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c6f83aa48f7c1e0f3a9e7b140c9a0baf
57d22dc0628463cad9056145c99249ec
12 changes: 6 additions & 6 deletions project/src/backend/sdl/SDLApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ namespace lime {

gamepadsAxisMap[event->caxis.which][event->caxis.axis] = event->caxis.value;
gamepadEvent.axisValue = event->caxis.value / (event->caxis.value > 0 ? 32767.0 : 32768.0);
gamepadEvent.timestamp = event->caxis.timestamp;
gamepadEvent.timestamp = event->common.timestamp;

GamepadEvent::Dispatch (&gamepadEvent);
break;
Expand All @@ -411,7 +411,7 @@ namespace lime {
gamepadEvent.type = GAMEPAD_BUTTON_DOWN;
gamepadEvent.button = event->cbutton.button;
gamepadEvent.id = event->cbutton.which;
gamepadEvent.timestamp = event->cbutton.timestamp;
gamepadEvent.timestamp = event->common.timestamp;

GamepadEvent::Dispatch (&gamepadEvent);
break;
Expand All @@ -421,7 +421,7 @@ namespace lime {
gamepadEvent.type = GAMEPAD_BUTTON_UP;
gamepadEvent.button = event->cbutton.button;
gamepadEvent.id = event->cbutton.which;
gamepadEvent.timestamp = event->cbutton.timestamp;
gamepadEvent.timestamp = event->common.timestamp;

GamepadEvent::Dispatch (&gamepadEvent);
break;
Expand All @@ -432,7 +432,7 @@ namespace lime {

gamepadEvent.type = GAMEPAD_CONNECT;
gamepadEvent.id = SDLGamepad::GetInstanceID (event->cdevice.which);
gamepadEvent.timestamp = event->cdevice.timestamp;
gamepadEvent.timestamp = event->common.timestamp;

GamepadEvent::Dispatch (&gamepadEvent);

Expand All @@ -444,7 +444,7 @@ namespace lime {

gamepadEvent.type = GAMEPAD_DISCONNECT;
gamepadEvent.id = event->cdevice.which;
gamepadEvent.timestamp = event->cdevice.timestamp;
gamepadEvent.timestamp = event->common.timestamp;

GamepadEvent::Dispatch (&gamepadEvent);
SDLGamepad::Disconnect (event->cdevice.which);
Expand Down Expand Up @@ -580,7 +580,7 @@ namespace lime {
keyEvent.keyCode = event->key.keysym.sym;
keyEvent.modifier = event->key.keysym.mod;
keyEvent.windowID = event->key.windowID;
keyEvent.timestamp = event->key.timestamp;
keyEvent.timestamp = event->common.timestamp;

if (keyEvent.type == KEY_DOWN) {

Expand Down

0 comments on commit 17086ec

Please sign in to comment.