Devices were not properly reset at each frame, which caused button_pressed() and other functions to fail.legacy
@@ -363,6 +363,8 @@ void lol::AndroidApp::Tick() | |||||
int events; | int events; | ||||
struct android_poll_source* source; | struct android_poll_source* source; | ||||
input::mouse()->internal_begin_frame(); | |||||
/* Loop until all events are read, then continue to draw the next | /* Loop until all events are read, then continue to draw the next | ||||
* frame of animation. */ | * frame of animation. */ | ||||
while ((ident = ALooper_pollAll(0, nullptr, &events, | while ((ident = ALooper_pollAll(0, nullptr, &events, | ||||
@@ -13,6 +13,7 @@ | |||||
#if HAVE_CONFIG_H | #if HAVE_CONFIG_H | ||||
# include "config.h" | # include "config.h" | ||||
#endif | #endif | ||||
#if defined LOL_USE_XINPUT | #if defined LOL_USE_XINPUT | ||||
# include <d3d9.h> | # include <d3d9.h> | ||||
# include <xinput.h> | # include <xinput.h> | ||||
@@ -97,6 +98,7 @@ void D3d9Input::tick_game(float seconds) | |||||
continue; | continue; | ||||
auto stick = m_data->m_joysticks[i].m2; | auto stick = m_data->m_joysticks[i].m2; | ||||
stick->internal_begin_frame(); | |||||
stick->internal_set_axis(input::axis::LeftX, state.Gamepad.sThumbLX / 32768.f); | stick->internal_set_axis(input::axis::LeftX, state.Gamepad.sThumbLX / 32768.f); | ||||
stick->internal_set_axis(input::axis::LeftY, -state.Gamepad.sThumbLY / 32768.f); | stick->internal_set_axis(input::axis::LeftY, -state.Gamepad.sThumbLY / 32768.f); | ||||
stick->internal_set_axis(input::axis::RightX, state.Gamepad.sThumbRX / 32768.f); | stick->internal_set_axis(input::axis::RightX, state.Gamepad.sThumbRX / 32768.f); | ||||
@@ -133,6 +133,11 @@ void SdlInput::tick(float seconds) | |||||
auto keyboard = input::keyboard(); | auto keyboard = input::keyboard(); | ||||
auto mouse = input::mouse(); | auto mouse = input::mouse(); | ||||
keyboard->internal_begin_frame(); | |||||
mouse->internal_begin_frame(); | |||||
for (int j = 0; j < m_joysticks.count(); j++) | |||||
m_joysticks[j].m2->internal_begin_frame(); | |||||
/* Pump all joystick events because no event is coming to us. */ | /* Pump all joystick events because no event is coming to us. */ | ||||
# if SDL_FORCE_POLL_JOYSTICK && !__EMSCRIPTEN__ | # if SDL_FORCE_POLL_JOYSTICK && !__EMSCRIPTEN__ | ||||
SDL_JoystickUpdate(); | SDL_JoystickUpdate(); | ||||
@@ -145,7 +150,6 @@ void SdlInput::tick(float seconds) | |||||
} | } | ||||
# endif | # endif | ||||
keyboard->internal_begin_frame(); | |||||
float mouse_wheel = 0.f; | float mouse_wheel = 0.f; | ||||
if (keyboard->capture_text()) | if (keyboard->capture_text()) | ||||