diff options
-rw-r--r-- | backends/platform/sdl/events.cpp | 1 | ||||
-rw-r--r-- | backends/platform/sdl/graphics.cpp | 12 |
2 files changed, 12 insertions, 1 deletions
diff --git a/backends/platform/sdl/events.cpp b/backends/platform/sdl/events.cpp index bcaa0e5a0a..fbb7beb95a 100644 --- a/backends/platform/sdl/events.cpp +++ b/backends/platform/sdl/events.cpp @@ -183,7 +183,6 @@ bool OSystem_SDL::pollEvent(Common::Event &event) { if (_modeChanged) { _modeChanged = false; event.type = Common::EVENT_SCREEN_CHANGED; - _screenChangeCount++; return true; } diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp index 40af643a1b..cda14a24ad 100644 --- a/backends/platform/sdl/graphics.cpp +++ b/backends/platform/sdl/graphics.cpp @@ -155,6 +155,12 @@ OSystem::TransactionError OSystem_SDL::endGFXTransaction(void) { _videoMode.setup = true; _modeChanged = true; + // OSystem_SDL::pollEvent used to update the screen change count, + // but actually it gives problems when a video mode was changed + // but OSystem_SDL::pollEvent was not called. This for example + // caused a crash under certain circumstances when doing an RTL. + // To fix this issue we update the screen change count right here. + _screenChangeCount++; } } else if (_transactionDetails.needHotswap) { setGraphicsModeIntern(); @@ -166,6 +172,12 @@ OSystem::TransactionError OSystem_SDL::endGFXTransaction(void) { } else { _videoMode.setup = true; _modeChanged = true; + // OSystem_SDL::pollEvent used to update the screen change count, + // but actually it gives problems when a video mode was changed + // but OSystem_SDL::pollEvent was not called. This for example + // caused a crash under certain circumstances when doing an RTL. + // To fix this issue we update the screen change count right here. + _screenChangeCount++; if (_transactionDetails.needUpdatescreen) internUpdateScreen(); |