Added a patch by Guus Sliepen fixing mouse cursor position.

This commit is contained in:
onpon4 2015-07-05 00:31:36 -04:00
parent 7f59c1f4ee
commit 8375c36433
1 changed files with 4 additions and 1 deletions

View File

@ -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;