diff options
author | Jaromir Wysoglad | 2019-07-02 09:06:47 +0200 |
---|---|---|
committer | Thierry Crozat | 2019-07-28 15:09:14 +0100 |
commit | bcd62c06699f3240aaa79eeb4bb31f23dbe2bd56 (patch) | |
tree | 7edab9c1423b204f4af761f3403ae52a6f400dbd /engines/supernova/supernova2/state.cpp | |
parent | 7ea4d0359704998ebb7e8dbe1fbf4a838c902023 (diff) | |
download | scummvm-rg350-bcd62c06699f3240aaa79eeb4bb31f23dbe2bd56.tar.gz scummvm-rg350-bcd62c06699f3240aaa79eeb4bb31f23dbe2bd56.tar.bz2 scummvm-rg350-bcd62c06699f3240aaa79eeb4bb31f23dbe2bd56.zip |
SUPERNOVA: Code refactoring
Add constant for inverting sections (number 128)
Move some initialization in initState from derived classes to
base class.
Simpilfy AxacussCorridor4::onEntrance
Diffstat (limited to 'engines/supernova/supernova2/state.cpp')
-rw-r--r-- | engines/supernova/supernova2/state.cpp | 39 |
1 files changed, 6 insertions, 33 deletions
diff --git a/engines/supernova/supernova2/state.cpp b/engines/supernova/supernova2/state.cpp index 2b227dcee7..8f6b8d6c41 100644 --- a/engines/supernova/supernova2/state.cpp +++ b/engines/supernova/supernova2/state.cpp @@ -230,26 +230,7 @@ void GameManager2::destroyRooms() { } void GameManager2::initState() { - _currentInputObject = &_nullObject; - _inputObject[0] = &_nullObject; - _inputObject[1] = &_nullObject; - _inputVerb = ACTION_WALK; - _processInput = false; - _guiEnabled = true; - _animationEnabled = true; - _roomBrightness = 255; - _mouseClicked = false; - _keyPressed = false; - _mouseX = -1; - _mouseY = -1; - _mouseField = -1; - _inventoryScroll = 0; - _restTime = 0; - _oldTime = g_system->getMillis(); - _timerPaused = 0; - _timePaused = false; - _messageDuration = 0; - _animationTimer = 0; + GameManager::initState(); _mapOn = false; _steps = false; _cracking = false; @@ -258,17 +239,6 @@ void GameManager2::initState() { for (int i = 0; i < 10; i++) _securityTab[i] = startSecurityTab[i]; - _currentSentence = -1; - for (int i = 0 ; i < 6 ; ++i) { - _sentenceNumber[i] = -1; - _texts[i] = kNoString; - _rows[i] = 0; - _rowsStart[i] = 0; - _dials[i] = 1; - } - - _prevImgId = 0; - _state._money = 20; _state._startTime = 0; _state._addressKnown = false; @@ -296,7 +266,10 @@ void GameManager2::initState() { int16 startPuzzleTab[15] = {12, 3, 14, 1, 11, 0, 2, 13, 9, 5, 4, 10, 7, 6, 8}; for (int i = 0; i < 15; i++) _state._puzzleTab[i] = startPuzzleTab[i]; - _dead = false; + + for (int i = 0 ; i < 6 ; ++i) { + _dials[i] = 1; + } } void GameManager2::initRooms() { @@ -542,7 +515,7 @@ bool GameManager2::genericInteract(Action verb, Object &obj1, Object &obj2) { if (!(o1->_type & CARRIED)) { _vm->renderImage(1); - _vm->renderImage(2 + 128); + _vm->renderImage(2 + kSectionInvert); _currentRoom->getObject(0)->_click = 255; } else _inventory.remove(*o1); |