diff options
author | Strangerke | 2016-04-15 07:27:13 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-05-10 09:54:21 +0200 |
commit | d6e4b67dca52c4cf7aae156ba5cb7523a60a0595 (patch) | |
tree | f3fd029af59b385332b2fea058656ae52ca702dc /engines | |
parent | d90b948b22bb1c46e2ae1c807b17f5d07744cd6e (diff) | |
download | scummvm-rg350-d6e4b67dca52c4cf7aae156ba5cb7523a60a0595.tar.gz scummvm-rg350-d6e4b67dca52c4cf7aae156ba5cb7523a60a0595.tar.bz2 scummvm-rg350-d6e4b67dca52c4cf7aae156ba5cb7523a60a0595.zip |
GNAP: Add load from launcher
Diffstat (limited to 'engines')
-rw-r--r-- | engines/gnap/gnap.cpp | 18 | ||||
-rw-r--r-- | engines/gnap/gnap.h | 2 | ||||
-rw-r--r-- | engines/gnap/menu.cpp | 10 |
3 files changed, 21 insertions, 9 deletions
diff --git a/engines/gnap/gnap.cpp b/engines/gnap/gnap.cpp index bfb4978e94..b9519110ac 100644 --- a/engines/gnap/gnap.cpp +++ b/engines/gnap/gnap.cpp @@ -118,8 +118,14 @@ Common::Error GnapEngine::run() { // >>>>> Variable initialization _cursorIndex = -1; _verbCursor = 1; + + _loadGameSlot = -1; + if (ConfMan.hasKey("save_slot")) + _loadGameSlot = ConfMan.getInt("save_slot"); + invClear(); clearFlags(); + _grabCursorSprite = nullptr; _newGrabCursorSpriteIndex = -1; _backgroundSurface = nullptr; @@ -737,7 +743,6 @@ void GnapEngine::loadStockDat() { } void GnapEngine::mainLoop() { - _newCursorValue = 1; _cursorValue = -1; _newSceneNum = 0; @@ -748,14 +753,25 @@ void GnapEngine::mainLoop() { _grabCursorSpriteIndex = -1; _grabCursorSprite = nullptr; +#if 0 // > DEBUG BEGIN _currentSceneNum = 0; _newSceneNum = 1; _newCursorValue = 1; // < DEBUG END +#endif loadStockDat(); + if (_loadGameSlot != -1) { + // Load a savegame + int slot = _loadGameSlot; + _loadGameSlot = -1; + loadGameState(slot); + + showCursor(); + } + while (!_gameDone) { debugC(kDebugBasic, "New scene: %d", _newSceneNum); diff --git a/engines/gnap/gnap.h b/engines/gnap/gnap.h index 5b183cbc83..5318e3fa7d 100644 --- a/engines/gnap/gnap.h +++ b/engines/gnap/gnap.h @@ -298,6 +298,8 @@ public: private: const ADGameDescription *_gameDescription; Graphics::PixelFormat _pixelFormat; + int _loadGameSlot; + public: Common::RandomSource *_random; diff --git a/engines/gnap/menu.cpp b/engines/gnap/menu.cpp index 82e45dedbe..d1701d7d0e 100644 --- a/engines/gnap/menu.cpp +++ b/engines/gnap/menu.cpp @@ -233,7 +233,6 @@ void GnapEngine::drawInventoryFrames() { } void GnapEngine::insertInventorySprites() { - for (int i = 0; i < 9; ++i) { _menuInventoryIndices[i] = -1; _gameSys->removeSpriteDrawItem(_menuInventorySprites[_sceneClickedHotspot], 261); @@ -258,7 +257,6 @@ void GnapEngine::insertInventorySprites() { ++_menuSpritesIndex; } } - } void GnapEngine::removeInventorySprites() { @@ -313,7 +311,6 @@ void GnapEngine::runMenu() { _timers[2] = 10; while (!isKeyStatus1(8) && !isKeyStatus1(28) && !_sceneDone && !_menuDone) { - updateCursorByHotspot(); switch (_menuStatus) { @@ -335,7 +332,6 @@ void GnapEngine::runMenu() { } gameUpdateTick(); - } removeInventorySprites(); @@ -385,7 +381,6 @@ void GnapEngine::runMenu() { } void GnapEngine::updateMenuStatusInventory() { - static const struct { int item1, item2, resultItem; } kCombineItems[] = { @@ -727,6 +722,7 @@ Common::Error GnapEngine::loadGameState(int slot) { synchronize(s); delete saveFile; + _loadGameSlot = slot; return Common::kNoError; } @@ -735,7 +731,7 @@ Common::String GnapEngine::generateSaveName(int slot) { } void GnapEngine::updateMenuStatusSaveGame() { -#if 1 // TODO +#if 0 // TODO char v43[30]; int v46; v43[0] = '\0'; @@ -925,7 +921,6 @@ void GnapEngine::updateMenuStatusLoadGame() { } void GnapEngine::updateMenuStatusQueryQuit() { - _hotspots[0]._x1 = 311; _hotspots[0]._y1 = 197; _hotspots[0]._x2 = 377; @@ -964,7 +959,6 @@ void GnapEngine::updateMenuStatusQueryQuit() { initMenuHotspots2(); _gameSys->insertSpriteDrawItem(_menuSprite1, 288, 79, 262); } - } } // End of namespace Gnap |