aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorEugene Sandulenko2005-03-20 16:16:09 +0000
committerEugene Sandulenko2005-03-20 16:16:09 +0000
commit9880288669414537d290aef70199e213fe868df1 (patch)
treecee26933923715ef665542f1eafa94acfb777719 /backends
parent91c666ebf94a96a4a3d8063fedf5a50bf944f95d (diff)
downloadscummvm-rg350-9880288669414537d290aef70199e213fe868df1.tar.gz
scummvm-rg350-9880288669414537d290aef70199e213fe868df1.tar.bz2
scummvm-rg350-9880288669414537d290aef70199e213fe868df1.zip
Fix bug #1166279 "BS1 & BS2: Launching game problems".
svn-id: r17187
Diffstat (limited to 'backends')
-rw-r--r--backends/sdl/graphics.cpp14
-rw-r--r--backends/sdl/sdl-common.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/backends/sdl/graphics.cpp b/backends/sdl/graphics.cpp
index 23b84460c6..f97e489e64 100644
--- a/backends/sdl/graphics.cpp
+++ b/backends/sdl/graphics.cpp
@@ -73,9 +73,21 @@ void OSystem_SDL::beginGFXTransaction(void) {
_transactionDetails.needHotswap = false;
_transactionDetails.needUpdatescreen = false;
_transactionDetails.needUnload = false;
+
+ _transactionDetails.normal1xScaler = false;
}
void OSystem_SDL::endGFXTransaction(void) {
+ // for each engine we run initCommonGFX() as first thing in the transaction
+ // and initSize() is called later. If user runs launcher at 320x200 with
+ // 2x overlay, setting to Nomral1x sclaler in that case will be suppressed
+ // and backend is forced to 2x
+ //
+ // This leads to bad results such as 1280x960 window for 640x480 engines.
+ // To prevent that we rerun setGraphicsMode() if there was 1x scaler request
+ if (_transactionDetails.normal1xScaler)
+ setGraphicsMode(GFX_NORMAL);
+
assert (_transactionMode == kTransactionActive);
_transactionMode = kTransactionCommit;
@@ -169,6 +181,8 @@ bool OSystem_SDL::setGraphicsMode(int mode) {
return false;
}
+ _transactionDetails.normal1xScaler = (mode == GFX_NORMAL);
+
// Do not let switch to lesser than overlay size resolutions
if (_screenWidth * newScaleFactor < _overlayWidth) {
if (_scaleFactor == 1) { // Force 2x mode
diff --git a/backends/sdl/sdl-common.h b/backends/sdl/sdl-common.h
index 51bde1c457..57e7625b93 100644
--- a/backends/sdl/sdl-common.h
+++ b/backends/sdl/sdl-common.h
@@ -237,6 +237,7 @@ protected:
bool needUpdatescreen;
bool needUnload;
bool needToggle;
+ bool normal1xScaler;
};
TransactionDetails _transactionDetails;