From c7ad2155fc9153b700d55aea08eafa03d7343fc8 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 1 Jun 2016 12:10:33 +0200 Subject: [PATCH] GUI: More object initialization cleanup --- gui/ThemeEngine.cpp | 6 ++++++ gui/Tooltip.cpp | 2 +- gui/dialog.cpp | 4 ++++ gui/launcher.cpp | 2 ++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp index c2deb8c61e9..aec5c79dabb 100644 --- a/gui/ThemeEngine.cpp +++ b/gui/ThemeEngine.cpp @@ -311,6 +311,12 @@ ThemeEngine::ThemeEngine(Common::String id, GraphicsMode mode) : _themeArchive = 0; _initOk = false; + _cursorHotspotX = _cursorHotspotY = 0; + _cursorWidth = _cursorHeight = 0; + _cursorPalSize = 0; + + _needPaletteUpdates = false; + // We prefer files in archive bundles over the common search paths. _themeFiles.add("default", &SearchMan, 0, false); } diff --git a/gui/Tooltip.cpp b/gui/Tooltip.cpp index ba313ee34fd..09ad7ce5ca6 100644 --- a/gui/Tooltip.cpp +++ b/gui/Tooltip.cpp @@ -32,7 +32,7 @@ namespace GUI { Tooltip::Tooltip() : - Dialog(-1, -1, -1, -1), _maxWidth(-1) { + Dialog(-1, -1, -1, -1), _maxWidth(-1), _parent(NULL), _xdelta(0), _ydelta(0) { _backgroundType = GUI::ThemeEngine::kDialogBackgroundTooltip; } diff --git a/gui/dialog.cpp b/gui/dialog.cpp index 075a3bb5338..50b7755bb3f 100644 --- a/gui/dialog.cpp +++ b/gui/dialog.cpp @@ -51,6 +51,8 @@ Dialog::Dialog(int x, int y, int w, int h) // will for example crash after returning to the launcher when the user // started a 640x480 game with a non 1x scaler. g_gui.checkScreenChange(); + + _result = -1; } Dialog::Dialog(const Common::String &name) @@ -66,6 +68,8 @@ Dialog::Dialog(const Common::String &name) // Fixes bug #1590596: "HE: When 3x graphics are choosen, F5 crashes game" // and bug #1595627: "SCUMM: F5 crashes game (640x480)" g_gui.checkScreenChange(); + + _result = -1; } int Dialog::runModal() { diff --git a/gui/launcher.cpp b/gui/launcher.cpp index bae894cba1b..7a1e368f36f 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -282,6 +282,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc) // // 6) The MIDI tab // + _globalMIDIOverride = false; if (!_guioptions.contains(GUIO_NOMIDI)) { tab->addTab(_("MIDI")); @@ -296,6 +297,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc) // // 7) The MT-32 tab // + _globalMT32Override = false; if (!_guioptions.contains(GUIO_NOMIDI)) { tab->addTab(_("MT-32"));