diff options
-rw-r--r-- | engines/touche/resource.cpp | 20 | ||||
-rw-r--r-- | engines/touche/touche.cpp | 66 | ||||
-rw-r--r-- | engines/touche/touche.h | 3 |
3 files changed, 55 insertions, 34 deletions
diff --git a/engines/touche/resource.cpp b/engines/touche/resource.cpp index 16a95d307f..467d2bed90 100644 --- a/engines/touche/resource.cpp +++ b/engines/touche/resource.cpp @@ -150,38 +150,38 @@ void ToucheEngine::res_allocateTables() { void ToucheEngine::res_deallocateTables() { free(_textData); - _textData = 0; + _textData = nullptr; free(_backdropBuffer); - _backdropBuffer = 0; + _backdropBuffer = nullptr; free(_menuKitData); - _menuKitData = 0; + _menuKitData = nullptr; free(_convKitData); - _convKitData = 0; + _convKitData = nullptr; for (int i = 0; i < NUM_SEQUENCES; ++i) { free(_sequenceDataTable[i]); - _sequenceDataTable[i] = 0; + _sequenceDataTable[i] = nullptr; } free(_programData); - _programData = 0; + _programData = nullptr; free(_mouseData); - _mouseData = 0; + _mouseData = nullptr; free(_iconData); - _iconData = 0; + _iconData = nullptr; for (int i = 0; i < NUM_SPRITES; ++i) { free(_spritesTable[i].ptr); - _spritesTable[i].ptr = 0; + _spritesTable[i].ptr = nullptr; } free(_offscreenBuffer); - _offscreenBuffer = 0; + _offscreenBuffer = nullptr; } uint32 ToucheEngine::res_getDataOffset(ResourceType type, int num, uint32 *size) { diff --git a/engines/touche/touche.cpp b/engines/touche/touche.cpp index 09697d0e4a..7b70b4a9ee 100644 --- a/engines/touche/touche.cpp +++ b/engines/touche/touche.cpp @@ -46,32 +46,32 @@ namespace Touche { ToucheEngine::ToucheEngine(OSystem *system, Common::Language language) - : Engine(system), _midiPlayer(0), _language(language), _rnd("touche") { + : Engine(system), _midiPlayer(nullptr), _language(language), _rnd("touche") { _saveLoadCurrentPage = 0; _saveLoadCurrentSlot = 0; _hideInventoryTexts = false; _numOpcodes = 0; _compressedSpeechData = 0; - _textData = 0; - _backdropBuffer = 0; - _menuKitData = 0; - _convKitData = 0; + _textData = nullptr; + _backdropBuffer = nullptr; + _menuKitData = nullptr; + _convKitData = nullptr; for (int i = 0; i < NUM_SEQUENCES; i++) - _sequenceDataTable[i] = 0; + _sequenceDataTable[i] = nullptr; - _programData = 0; + _programData = nullptr; _programDataSize = 0; - _mouseData = 0; - _iconData = 0; + _mouseData = nullptr; + _iconData = nullptr; _currentBitmapWidth = 0; _currentBitmapHeight = 0; _currentImageWidth = 0; _currentImageHeight = 0; _roomWidth = 0; - _programTextDataPtr = 0; - _offscreenBuffer = 0; + _programTextDataPtr = nullptr; + _offscreenBuffer = nullptr; _screenRect = Common::Rect(kScreenWidth, kScreenHeight); _roomAreaRect = Common::Rect(kScreenWidth, kRoomHeight); @@ -124,11 +124,11 @@ ToucheEngine::ToucheEngine(OSystem *system, Common::Language language) _script.opcodeNum = 0; _script.dataOffset = 0; _script.keyCharNum = 0; - _script.dataPtr = 0; - _script.stackDataPtr = 0; - _script.stackDataBasePtr = 0; + _script.dataPtr = nullptr; + _script.stackDataPtr = nullptr; + _script.stackDataBasePtr = nullptr; _script.quitFlag = 0; - _opcodesTable = 0; + _opcodesTable = nullptr; for (uint i = 0; i < NUM_SPRITES; i++) memset(&_spritesTable[i], 0, sizeof(SpriteData)); @@ -138,10 +138,10 @@ ToucheEngine::ToucheEngine(OSystem *system, Common::Language language) _talkListEnd = 0; _talkListCurrent = 0; - _talkTextRectDefined = 0; - _talkTextDisplayed = 0; - _talkTextInitialized = 0; - _skipTalkText = 0; + _talkTextRectDefined = false; + _talkTextDisplayed = false; + _talkTextInitialized = false; + _skipTalkText = false; _talkTextSpeed = 0; _keyCharTalkCounter = 0; _talkTableLastTalkingKeyChar = 0; @@ -151,14 +151,14 @@ ToucheEngine::ToucheEngine(OSystem *system, Common::Language language) for (uint i = 0; i < NUM_TALK_ENTRIES; i++) memset(&_talkTable[i], 0, sizeof(TalkEntry)); - _conversationChoicesUpdated = 0; + _conversationChoicesUpdated = false; _conversationReplyNum = 0; - _conversationEnded = 0; + _conversationEnded = false; _conversationNum = 0; _scrollConversationChoiceOffset = 0; _currentConversation = 0; - _disableConversationScript = 0; - _conversationAreaCleared = 0; + _disableConversationScript = false; + _conversationAreaCleared = false; for (uint i = 0; i < NUM_CONVERSATION_CHOICES; i++) memset(&_conversationChoicesTable[i], 0, sizeof(ConversationChoice)); @@ -167,6 +167,26 @@ ToucheEngine::ToucheEngine(OSystem *system, Common::Language language) _sortedKeyCharsTable[i] = 0; _currentKeyCharNum = 0; + _inp_leftMouseButtonPressed = false; + _inp_rightMouseButtonPressed = false; + _disabledInputCounter = 0; + _gameState = kGameStateNone; + _displayQuitDialog = false; + _newMusicNum = 0; + _currentMusicNum = 0; + _newSoundNum = 0; + _newSoundDelay = 0; + _newSoundPriority = 0; + for (int i = 0; i < 3; ++i) { + _inventoryStateTable[i].displayOffset = 0; + _inventoryStateTable[i].lastItem = 0; + _inventoryStateTable[i].itemsPerLine = 0; + _inventoryStateTable[i].itemsList = nullptr; + } + _inventoryVar1 = nullptr; + _inventoryVar2 = nullptr; + _currentCursorObject = 0; + _talkTextMode = 0; } ToucheEngine::~ToucheEngine() { diff --git a/engines/touche/touche.h b/engines/touche/touche.h index 3da33f593b..ee6dffefdc 100644 --- a/engines/touche/touche.h +++ b/engines/touche/touche.h @@ -353,7 +353,8 @@ int getGameStateFileSlot(const char *filename); enum GameState { kGameStateGameLoop, kGameStateOptionsDialog, - kGameStateQuitDialog + kGameStateQuitDialog, + kGameStateNone }; class MidiPlayer; |