From 1a64e9c528b11eea31021d92e1d7baaa7defa11d Mon Sep 17 00:00:00 2001 From: Misa Date: Tue, 4 Aug 2020 18:16:50 -0700 Subject: [PATCH] Remove unnecessary cursor toggling when toggling fullscreen For some reason, the cursor would be either disabled and re-enabled if you switched to windowed mode, or it would be always enabled if you switched to fullscreen mode. This only happened when you toggled fullscreen using the Alt+Enter, Alt+F, or F11 keybinds, and the fullscreen option in graphic options doesn't have this problem. This cursor toggling business seems like an arcane incantation back in the days of SDL1.2, now since no longer necessary with SDL2. However, after some testing, it seems like removing these indecipherable runes don't cause any harm, so I'm going to remove them. Fixes #371. --- desktop_version/src/main.cpp | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/desktop_version/src/main.cpp b/desktop_version/src/main.cpp index fec3f28b..37d08558 100644 --- a/desktop_version/src/main.cpp +++ b/desktop_version/src/main.cpp @@ -466,22 +466,6 @@ void inline fixedloop() key.Poll(); if(key.toggleFullscreen) { - if(!gameScreen.isWindowed) - { - SDL_ShowCursor(SDL_DISABLE); - SDL_ShowCursor(SDL_ENABLE); - } - else - { - SDL_ShowCursor(SDL_ENABLE); - } - - - if(game.gamestate == EDITORMODE) - { - SDL_ShowCursor(SDL_ENABLE); - } - gameScreen.toggleFullScreen(); game.fullscreen = !game.fullscreen; key.toggleFullscreen = false;