From bda5e3c67e91565031902d7c99f14e9cd1d9ee07 Mon Sep 17 00:00:00 2001 From: doyle Date: Tue, 24 Mar 2020 17:38:10 +1100 Subject: [PATCH] RPI: Include index check for RPI in GetTouchPosition() --- src/core.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/core.c b/src/core.c index e9ecf37d0..44b7125d2 100644 --- a/src/core.c +++ b/src/core.c @@ -2648,7 +2648,7 @@ Vector2 GetTouchPosition(int index) { Vector2 position = { -1.0f, -1.0f }; -#if defined(PLATFORM_ANDROID) || defined(PLATFORM_WEB) +#if defined(PLATFORM_ANDROID) || defined(PLATFORM_WEB) || defined(PLATFORM_RPI) if (index < MAX_TOUCH_POINTS) position = CORE.Input.Touch.position[index]; else TRACELOG(LOG_WARNING, "Required touch point out of range (Max touch points: %i)", MAX_TOUCH_POINTS); @@ -2664,11 +2664,7 @@ Vector2 GetTouchPosition(int index) position.y = position.y*((float)CORE.Window.render.height/(float)CORE.Window.display.height) - CORE.Window.renderOffset.y/2; } #endif -#endif -#if defined(PLATFORM_RPI) - position = CORE.Input.Touch.position[index]; -#endif -#if defined(PLATFORM_DESKTOP) +#elif defined(PLATFORM_DESKTOP) // TODO: GLFW is not supporting multi-touch input just yet // https://www.codeproject.com/Articles/668404/Programming-for-Multi-Touch // https://docs.microsoft.com/en-us/windows/win32/wintouch/getting-started-with-multi-touch-messages