aboutsummaryrefslogtreecommitdiff
path: root/engines/gnap
diff options
context:
space:
mode:
authorStrangerke2016-06-06 07:20:30 +0200
committerStrangerke2016-06-06 07:22:14 +0200
commit2473348cf05db29ce4d1d1da48cb199199cdc554 (patch)
tree37bd4ad6d66893de2efe669859ac6d8c9153e12b /engines/gnap
parent503188593afd3d69ee0cfb33d0f4a074ddffa7cc (diff)
downloadscummvm-rg350-2473348cf05db29ce4d1d1da48cb199199cdc554.tar.gz
scummvm-rg350-2473348cf05db29ce4d1d1da48cb199199cdc554.tar.bz2
scummvm-rg350-2473348cf05db29ce4d1d1da48cb199199cdc554.zip
GNAP: Initialize some more variables, reorder initialization
Diffstat (limited to 'engines/gnap')
-rw-r--r--engines/gnap/gnap.cpp52
1 files changed, 36 insertions, 16 deletions
diff --git a/engines/gnap/gnap.cpp b/engines/gnap/gnap.cpp
index 76818181a5..780955b9ae 100644
--- a/engines/gnap/gnap.cpp
+++ b/engines/gnap/gnap.cpp
@@ -95,16 +95,45 @@ GnapEngine::GnapEngine(OSystem *syst, const ADGameDescription *gd) :
DebugMan.addDebugChannel(kDebugBasic, "basic", "Basic debug level");
Engine::syncSoundSettings();
+
+ _exe = nullptr;
+ _dat = nullptr;
+ _spriteCache = nullptr;
+ _soundCache = nullptr;
+ _sequenceCache = nullptr;
+ _gameSys = nullptr;
+ _soundMan = nullptr;
+ _debugger = nullptr;
+ _gnap = nullptr;
+ _plat = nullptr;
+ _font = nullptr;
_scene = nullptr;
_music = nullptr;
_tempThumbnail = nullptr;
+ _menuBackgroundSurface = nullptr;
+ _menuQuitQuerySprite = nullptr;
+ _largeSprite = nullptr;
+ _menuSaveLoadSprite = nullptr;
+ _menuSprite2 = nullptr;
+ _menuSprite1 = nullptr;
+ _spriteHandle = nullptr;
+ _cursorSprite = nullptr;
+ _pauseSprite = nullptr;
+ _backgroundSurface = nullptr;
_wasSavegameLoaded = false;
- for (int i = 0; i < kMaxTimers; ++i)
- _savedTimers[i] = _timers[i] = 0;
-
_isWaiting = false;
_sceneWaiting = false;
+ _menuDone = false;
+ _sceneDone = false;
+ _isLeavingScene = false;
+ _isStockDatLoaded = false;
+ _gameDone = false;
+ _isPaused = false;
+ _sceneSavegameLoaded = false;
+
+ for (int i = 0; i < kMaxTimers; ++i)
+ _savedTimers[i] = _timers[i] = 0;
_mousePos = Common::Point(0, 0);
_currGrabCursorX = _currGrabCursorY = 0;
@@ -112,15 +141,6 @@ GnapEngine::GnapEngine(OSystem *syst, const ADGameDescription *gd) :
_idleTimerIndex = -1;
_menuStatus = 0;
_menuSpritesIndex = -1;
- _menuDone = false;
- _menuBackgroundSurface = nullptr;
- _menuQuitQuerySprite = nullptr;
- _largeSprite = nullptr;
- _menuSaveLoadSprite = nullptr;
- _menuSprite2 = nullptr;
- _menuSprite1 = nullptr;
- _spriteHandle = nullptr;
- _cursorSprite = nullptr;
_savegameIndex = -1;
_gridMinX = 0;
_gridMinY = 0;
@@ -140,13 +160,10 @@ GnapEngine::GnapEngine(OSystem *syst, const ADGameDescription *gd) :
_menuInventorySprites[i] = nullptr;
_newSceneNum = 0;
- _sceneDone = false;
_inventory = 0;
_gameFlags = 0;
_hotspotsCount = 0;
_sceneClickedHotspot = -1;
- _isLeavingScene = false;
- _isStockDatLoaded = false;
_newCursorValue = 0;
_cursorValue = 0;
_verbCursor = 0;
@@ -163,6 +180,10 @@ GnapEngine::GnapEngine(OSystem *syst, const ADGameDescription *gd) :
_soundTimerIndexA = 0;
_soundTimerIndexB = 0;
_soundTimerIndexC = 0;
+ _loadGameSlot = -1;
+ _lastUpdateClock = 0;
+ _prevSceneNum = -1;
+ _currentSceneNum = -1;
}
GnapEngine::~GnapEngine() {
@@ -190,7 +211,6 @@ Common::Error GnapEngine::run() {
_cursorIndex = -1;
_verbCursor = 1;
- _loadGameSlot = -1;
if (ConfMan.hasKey("save_slot"))
_loadGameSlot = ConfMan.getInt("save_slot");