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/game-manager.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/game-manager.cpp')
-rw-r--r-- | engines/supernova/game-manager.cpp | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/engines/supernova/game-manager.cpp b/engines/supernova/game-manager.cpp index 2d003741b2..5cf54d4b09 100644 --- a/engines/supernova/game-manager.cpp +++ b/engines/supernova/game-manager.cpp @@ -165,6 +165,35 @@ void GameManager::destroyRooms() { } void GameManager::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; + _oldTime = g_system->getMillis(); + _timerPaused = 0; + _timePaused = false; + _messageDuration = 0; + _animationTimer = 0; + _currentSentence = -1; + for (int i = 0 ; i < 6 ; ++i) { + _sentenceNumber[i] = -1; + _texts[i] = kNoString; + _rows[i] = 0; + _rowsStart[i] = 0; + } + + _prevImgId = 0; + _dead = false; } void GameManager::initRooms() { @@ -926,10 +955,10 @@ void GameManager::dead(int messageId) { } int GameManager::invertSection(int section) { - if (section < 128) - section += 128; + if (section < kSectionInvert) + section += kSectionInvert; else - section -= 128; + section -= kSectionInvert; return section; } |