From a33a5d0f146709fb4d20bc49abac3b81da73cc59 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Fri, 2 Jan 2009 21:52:32 +0000 Subject: Fixed the way how screen changes are tracked. This should fix a crash when doing an RTL from COMI when a 3x scaler is enabled. svn-id: r35685 --- backends/platform/sdl/events.cpp | 1 - backends/platform/sdl/graphics.cpp | 12 ++++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'backends/platform/sdl') 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(); -- cgit v1.2.3