[FIX] If mouse outside window or in border, mouse_x & mouse_y no longer update
This commit is contained in:
@@ -229,9 +229,12 @@ int main(int argc,char*argv[]) {
|
||||
}
|
||||
}
|
||||
keys = SDL_GetKeyboardState(NULL);
|
||||
mouse_buttons = SDL_GetMouseState(&mouse_x, &mouse_y);
|
||||
mouse_x = (mouse_x-40) / (640/screen_width);
|
||||
mouse_y = (mouse_y-40) / (480/screen_height);
|
||||
int mx, my;
|
||||
mouse_buttons = SDL_GetMouseState(&mx, &my);
|
||||
if (mx>=40 && my>=40 && mx<680 && my<520) {
|
||||
mouse_x = (mx-40) / (640/screen_width);
|
||||
mouse_y = (my-40) / (480/screen_height);
|
||||
}
|
||||
|
||||
if (lua_is_playing()) {
|
||||
lua_call_update();
|
||||
|
||||
Reference in New Issue
Block a user