aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2009-01-02 21:52:32 +0000
committerJohannes Schickel2009-01-02 21:52:32 +0000
commita33a5d0f146709fb4d20bc49abac3b81da73cc59 (patch)
tree354d255ed03d57954c503909cb4caa8af7147e03
parent1d2c446395abe6c8e4bc5639259204701a42b4d9 (diff)
downloadscummvm-rg350-a33a5d0f146709fb4d20bc49abac3b81da73cc59.tar.gz
scummvm-rg350-a33a5d0f146709fb4d20bc49abac3b81da73cc59.tar.bz2
scummvm-rg350-a33a5d0f146709fb4d20bc49abac3b81da73cc59.zip
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
-rw-r--r--backends/platform/sdl/events.cpp1
-rw-r--r--backends/platform/sdl/graphics.cpp12
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();