From d34df6cf15443c27c870c910d49f81d8b0bc9e9d Mon Sep 17 00:00:00 2001 From: Son Phan Trung Date: Tue, 28 Jan 2025 09:39:22 +0700 Subject: [PATCH] maybe that will fix the error --- src/sdltiles.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/sdltiles.cpp b/src/sdltiles.cpp index 7eacbc4f2faf6..b9abb4fd7c014 100644 --- a/src/sdltiles.cpp +++ b/src/sdltiles.cpp @@ -3344,7 +3344,7 @@ static void CheckMessages() dbg( D_INFO ) << "Fingermotion triggered."; dbg( D_INFO ) << "ev.tfinger.fingerId: " << ev.tfinger.fingerId; dbg( D_INFO ) << "ev.tfinger.touchId: " << ev.tfinger.touchId; - if( SDL_GetNumTouchFingers() == 1 ) { + if( SDL_GetNumTouchFingers(ev.tfinger.touchId) == 1 ) { if( !is_quick_shortcut_touch ) { dbg( D_INFO ) << "Not quick shortcut touch"; update_finger_repeat_delay(); @@ -3369,10 +3369,10 @@ static void CheckMessages() } } - } else if( SDL_GetNumTouchFingers() == 2 ) { + } else if( SDL_GetNumTouchFingers(ev.tfinger.touchId) == 2 ) { second_finger_curr_x = ev.tfinger.x * WindowWidth; second_finger_curr_y = ev.tfinger.y * WindowHeight; - } else if( SDL_GetNumTouchFingers() == 3 ) { + } else if( SDL_GetNumTouchFingers(ev.tfinger.touchId) == 3 ) { third_finger_curr_x = ev.tfinger.x * WindowWidth; third_finger_curr_y = ev.tfinger.y * WindowHeight; } @@ -3381,7 +3381,7 @@ static void CheckMessages() dbg( D_INFO ) << "Fingerdown triggered."; dbg( D_INFO ) << "ev.tfinger.fingerId: " << ev.tfinger.fingerId; dbg( D_INFO ) << "ev.tfinger.touchId: " << ev.tfinger.touchId; - if( SDL_GetNumTouchFingers() == 1 ) { + if( SDL_GetNumTouchFingers(ev.tfinger.touchId) == 1 ) { finger_down_x = finger_curr_x = ev.tfinger.x * WindowWidth; finger_down_y = finger_curr_y = ev.tfinger.y * WindowHeight; finger_down_time = ticks; @@ -3395,7 +3395,7 @@ static void CheckMessages() } ui_manager::redraw_invalidated(); needupdate = true; // ensure virtual joystick and quick shortcuts redraw as we interact - } else if( SDL_GetNumTouchFingers() == 2 ) { + } else if( SDL_GetNumTouchFingers(ev.tfinger.touchId) == 2 ) { if( !is_quick_shortcut_touch ) { second_finger_down_x = second_finger_curr_x = ev.tfinger.x * WindowWidth; second_finger_down_y = second_finger_curr_y = ev.tfinger.y * WindowHeight; @@ -3403,7 +3403,7 @@ static void CheckMessages() DebugLog( D_INFO, DC_ALL ) << "second_finger_curr_y: " << second_finger_curr_y; is_two_finger_touch = true; } - } else if( SDL_GetNumTouchFingers() == 3 ) { + } else if( SDL_GetNumTouchFingers(ev.tfinger.touchId) == 3 ) { if( !is_quick_shortcut_touch ) { third_finger_down_x = third_finger_curr_x = ev.tfinger.x * WindowWidth; third_finger_down_y = third_finger_curr_y = ev.tfinger.y * WindowHeight; @@ -3416,7 +3416,7 @@ static void CheckMessages() dbg( D_INFO ) << "Fingerup triggered."; dbg( D_INFO ) << "ev.tfinger.fingerId: " << ev.tfinger.fingerId; dbg( D_INFO ) << "ev.tfinger.touchId: " << ev.tfinger.touchId; - if( SDL_GetNumTouchFingers() == 1 ) { + if( SDL_GetNumTouchFingers(ev.tfinger.touchId) == 1 ) { finger_curr_x = ev.tfinger.x * WindowWidth; finger_curr_y = ev.tfinger.y * WindowHeight; DebugLog( D_INFO, DC_ALL ) << "finger_curr_x: " << finger_curr_x; @@ -3589,14 +3589,14 @@ static void CheckMessages() needupdate = true; // ensure virtual joystick and quick shortcuts are updated properly ui_manager::redraw_invalidated(); refresh_display(); // as above, but actually redraw it now as well - } else if( SDL_GetNumTouchFingers() == 2 ) { + } else if( SDL_GetNumTouchFingers(ev.tfinger.touchId) == 2 ) { if( is_two_finger_touch ) { // on second finger release, just remember the x/y position so we can calculate delta once first finger is done // is_two_finger_touch will be reset when first finger lifts (see above) second_finger_curr_x = ev.tfinger.x * WindowWidth; second_finger_curr_y = ev.tfinger.y * WindowHeight; } - } else if( SDL_GetNumTouchFingers() == 3 ) { + } else if( SDL_GetNumTouchFingers(ev.tfinger.touchId) == 3 ) { if( is_three_finger_touch ) { // on third finger release, just remember the x/y position so we can calculate delta once first finger is done // is_three_finger_touch will be reset when first finger lifts (see above)