aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2006-12-27 00:47:57 +0000
committerEugene Sandulenko2006-12-27 00:47:57 +0000
commit4e52f4438f9ced523441e7bda2e168ac77688a2e (patch)
tree9f49abab27bdfb42483014f945d342962e3cbafb
parenta0f5e6f0b17367ae80dfc0e95c24c96bd9caf3bd (diff)
downloadscummvm-rg350-4e52f4438f9ced523441e7bda2e168ac77688a2e.tar.gz
scummvm-rg350-4e52f4438f9ced523441e7bda2e168ac77688a2e.tar.bz2
scummvm-rg350-4e52f4438f9ced523441e7bda2e168ac77688a2e.zip
Fix bug #1595627: "SCUMM: F5 crashes game (640x480)". This partially
reverts commit r24656 for fixing bug #1590596 and effectively fixes both. svn-id: r24933
-rw-r--r--engines/scumm/scumm.cpp10
-rw-r--r--gui/dialog.cpp12
-rw-r--r--gui/theme.h4
3 files changed, 16 insertions, 10 deletions
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 96675fa9f0..7e43fbfeb0 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1025,16 +1025,6 @@ int ScummEngine::init() {
initCommonGFX(defaultTo1XScaler);
_system->endGFXTransaction();
- // It may happen that we have 3x scaler in launcher (960xY) and then 640x480
- // game will be forced to 1x. At this stage GUI will not be aware of
- // resolution change, so widgets will be off screen. This forces it to
- // recompute
- //
- // Fixes bug #1590596: "HE: When 3x graphics are choosen, F5 crashes game"
- if (defaultTo1XScaler) {
- g_gui.screenChange();
- }
-
setupScumm();
readIndexFile();
diff --git a/gui/dialog.cpp b/gui/dialog.cpp
index 11001a42e9..1fdf872665 100644
--- a/gui/dialog.cpp
+++ b/gui/dialog.cpp
@@ -51,6 +51,18 @@ Dialog::Dialog(const Common::String &name, bool dimsInactive_)
_mouseWidget(0), _focusedWidget(0), _dragWidget(0), _visible(false), _drawingHints(0),
_dimsInactive(dimsInactive_) {
_drawingHints = THEME_HINT_FIRST_DRAW | THEME_HINT_SAVE_BACKGROUND;
+
+ // It may happen that we have 3x scaler in launcher (960xY) and then 640x480
+ // game will be forced to 1x. At this stage GUI will not be aware of
+ // resolution change, so widgets will be off screen. This forces it to
+ // recompute
+ //
+ // Fixes bug #1590596: "HE: When 3x graphics are choosen, F5 crashes game"
+ // and bug #1595627: "SCUMM: F5 crashes game (640x480)"
+ if (g_gui.theme()->needThemeReload()) {
+ debug(2, "Theme forced to reload");
+ g_gui.screenChange();
+ }
}
Dialog::~Dialog() {
diff --git a/gui/theme.h b/gui/theme.h
index 237404435d..a20fea335d 100644
--- a/gui/theme.h
+++ b/gui/theme.h
@@ -240,6 +240,10 @@ protected:
Common::ConfigFile _configFile;
Common::ConfigFile _defaultConfig;
+public:
+ bool needThemeReload() { return ((_loadedThemeX != g_system->getOverlayWidth()) ||
+ (_loadedThemeY != g_system->getOverlayHeight())); }
+
private:
static const char *_defaultConfigINI;
int _loadedThemeX, _loadedThemeY;