From 8375c364339c6af97979532c7ace3098be477512 Mon Sep 17 00:00:00 2001 From: onpon4 Date: Sun, 5 Jul 2015 00:31:36 -0400 Subject: [PATCH] Added a patch by Guus Sliepen fixing mouse cursor position. --- src/player.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/player.cpp b/src/player.cpp index 188cbe1..fd483fa 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -270,8 +270,11 @@ void getPlayerInput() { // Get the current mouse position static int px = -1, py = -1; - int x, y; + int x, y, w, h; SDL_GetMouseState(&x, &y); + SDL_GetWindowSize(window, &w, &h); + x = screenWidth * x / w; + y = screenHeight * y / h; if (px == x && py == y) { if(engine.keyState[KEY_UP] && engine.cursor_y > 0) engine.cursor_y -= 4;