mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-10 07:38:56 +02:00
[input_common/mouse, sdl_driver] increase latency of mouse and SDL_vibration threads to 4 "evals" per sec (#2982)
No need to have those nano-sleeps for these threads... Signed-off-by: lizzie lizzie@eden-emu.dev Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2982 Reviewed-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
8d3b33c3aa
commit
0eed5100f9
3 changed files with 13 additions and 16 deletions
|
|
@ -14,7 +14,7 @@
|
|||
#include "input_common/drivers/mouse.h"
|
||||
|
||||
namespace InputCommon {
|
||||
constexpr int update_time = 10;
|
||||
constexpr int update_time = 250; // 4 TPS
|
||||
constexpr float default_panning_sensitivity = 0.0010f;
|
||||
constexpr float default_stick_sensitivity = 0.0006f;
|
||||
constexpr float default_deadzone_counterweight = 0.01f;
|
||||
|
|
@ -73,18 +73,14 @@ Mouse::Mouse(std::string input_engine_) : InputEngine(std::move(input_engine_))
|
|||
last_mouse_change = {};
|
||||
last_motion_change = {};
|
||||
|
||||
update_thread = std::jthread([this](std::stop_token stop_token) { UpdateThread(stop_token); });
|
||||
}
|
||||
|
||||
void Mouse::UpdateThread(std::stop_token stop_token) {
|
||||
Common::SetCurrentThreadName("Mouse");
|
||||
|
||||
while (!stop_token.stop_requested()) {
|
||||
UpdateStickInput();
|
||||
UpdateMotionInput();
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(update_time));
|
||||
}
|
||||
update_thread = std::jthread([this](std::stop_token stop_token) {
|
||||
Common::SetCurrentThreadName("Mouse");
|
||||
while (!stop_token.stop_requested()) {
|
||||
UpdateStickInput();
|
||||
UpdateMotionInput();
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(update_time));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void Mouse::UpdateStickInput() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue