diff options
author | Torbjörn Andersson | 2016-03-14 06:49:26 +0100 |
---|---|---|
committer | Torbjörn Andersson | 2016-03-14 06:49:26 +0100 |
commit | ebad422f2f6a7e0deca3f9baf6f663d07d80ff96 (patch) | |
tree | 9838cbda265eb04744f35e4d2d745a80ee083ffe | |
parent | 3f2469c33ed6017d3c385fbbfd01a4e690987fbc (diff) | |
download | scummvm-rg350-ebad422f2f6a7e0deca3f9baf6f663d07d80ff96.tar.gz scummvm-rg350-ebad422f2f6a7e0deca3f9baf6f663d07d80ff96.tar.bz2 scummvm-rg350-ebad422f2f6a7e0deca3f9baf6f663d07d80ff96.zip |
BBVS: Move much of engine initialization to newGame()
This should fix bug #7057 ("BBVS: No clean-up when restarting").
-rw-r--r-- | engines/bbvs/bbvs.cpp | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/engines/bbvs/bbvs.cpp b/engines/bbvs/bbvs.cpp index d40d5e482f..6ae663479d 100644 --- a/engines/bbvs/bbvs.cpp +++ b/engines/bbvs/bbvs.cpp @@ -137,6 +137,21 @@ BbvsEngine::~BbvsEngine() { } void BbvsEngine::newGame() { + memset(_easterEggInput, 0, sizeof(_easterEggInput)); + _gameTicks = 0; + _playVideoNumber = 0; + memset(_inventoryItemStatus, 0, sizeof(_inventoryItemStatus)); + memset(_gameVars, 0, sizeof(_gameVars)); + memset(_sceneVisited, 0, sizeof(_sceneVisited)); + + _mouseX = 160; + _mouseY = 120; + _mouseButtons = 0; + + _currVerbNum = kVerbLook; + _currTalkObjectIndex = -1; + _currSceneNum = 0; + _currInventoryItem = -1; _newSceneNum = 32; } @@ -162,24 +177,10 @@ Common::Error BbvsEngine::run() { _sound = new SoundMan(); allocSnapshot(); - memset(_easterEggInput, 0, sizeof(_easterEggInput)); - _gameTicks = 0; - _playVideoNumber = 0; - _bootSaveSlot = -1; - - memset(_inventoryItemStatus, 0, sizeof(_inventoryItemStatus)); - memset(_gameVars, 0, sizeof(_gameVars)); - memset(_sceneVisited, 0, sizeof(_sceneVisited)); - - _mouseX = 160; - _mouseY = 120; - _mouseButtons = 0; + newGame(); - _currVerbNum = kVerbLook; - _currInventoryItem = -1; - _currTalkObjectIndex = -1; - _currSceneNum = 0; + _bootSaveSlot = -1; _newSceneNum = 31; if (ConfMan.hasKey("save_slot")) |