diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hopkins/anim.cpp | 118 | ||||
-rw-r--r-- | engines/hopkins/computer.cpp | 54 | ||||
-rw-r--r-- | engines/hopkins/dialogs.cpp | 138 | ||||
-rw-r--r-- | engines/hopkins/events.cpp | 36 | ||||
-rw-r--r-- | engines/hopkins/files.cpp | 24 | ||||
-rw-r--r-- | engines/hopkins/font.cpp | 52 | ||||
-rw-r--r-- | engines/hopkins/globals.cpp | 8 | ||||
-rw-r--r-- | engines/hopkins/globals.h | 3 | ||||
-rw-r--r-- | engines/hopkins/graphics.cpp | 44 | ||||
-rw-r--r-- | engines/hopkins/hopkins.cpp | 919 | ||||
-rw-r--r-- | engines/hopkins/hopkins.h | 2 | ||||
-rw-r--r-- | engines/hopkins/lines.cpp | 130 | ||||
-rw-r--r-- | engines/hopkins/menu.cpp | 32 | ||||
-rw-r--r-- | engines/hopkins/objects.cpp | 1008 | ||||
-rw-r--r-- | engines/hopkins/saveload.cpp | 38 | ||||
-rw-r--r-- | engines/hopkins/script.cpp | 716 | ||||
-rw-r--r-- | engines/hopkins/sound.cpp | 32 | ||||
-rw-r--r-- | engines/hopkins/talk.cpp | 160 |
18 files changed, 1756 insertions, 1758 deletions
diff --git a/engines/hopkins/anim.cpp b/engines/hopkins/anim.cpp index 2d66aeeaa9..8f0ce672c6 100644 --- a/engines/hopkins/anim.cpp +++ b/engines/hopkins/anim.cpp @@ -86,7 +86,7 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui } if (_vm->_graphicsManager.WinScan / 2 > SCREEN_WIDTH) { hasScreenCopy = true; - screenCopy = _vm->_globals.allocMemory(307200); + screenCopy = _vm->_globals->allocMemory(307200); memcpy(screenCopy, screenP, 307200); } if (NO_SEQ) { @@ -109,7 +109,7 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui _vm->_eventsManager->_escKeyFl = false; _vm->_soundManager.loadAnimSound(); - if (_vm->_globals.iRegul == 1) { + if (_vm->_globals->iRegul == 1) { // Do pre-animation delay do { if (_vm->_eventsManager->_escKeyFl) @@ -136,7 +136,7 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui f.read(screenP, READ_LE_UINT32(imageStr + 8)); - if (_vm->_globals.iRegul == 1) { + if (_vm->_globals->iRegul == 1) { do { if (_vm->_eventsManager->_escKeyFl) break; @@ -166,7 +166,7 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui } } - if (_vm->_globals.iRegul == 1 && !_vm->_eventsManager->_escKeyFl) { + if (_vm->_globals->iRegul == 1 && !_vm->_eventsManager->_escKeyFl) { // Do post-animation delay do { if (_vm->_eventsManager->_escKeyFl) @@ -183,7 +183,7 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui } if (_vm->_graphicsManager.FADE_LINUX == 2 && !hasScreenCopy) { - screenCopy = _vm->_globals.allocMemory(307200); + screenCopy = _vm->_globals->allocMemory(307200); f.seek(6); f.read(_vm->_graphicsManager._palette, 800); @@ -208,12 +208,12 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui _vm->_graphicsManager.copyWinscanVbe3(screenP, screenCopy); } _vm->_graphicsManager.fadeOutDefaultLength(screenCopy); - screenCopy = _vm->_globals.freeMemory(screenCopy); + screenCopy = _vm->_globals->freeMemory(screenCopy); } if (hasScreenCopy) { if (_vm->_graphicsManager.FADE_LINUX == 2) _vm->_graphicsManager.fadeOutDefaultLength(screenCopy); - screenCopy = _vm->_globals.freeMemory(screenCopy); + screenCopy = _vm->_globals->freeMemory(screenCopy); } _vm->_graphicsManager.FADE_LINUX = 0; @@ -272,7 +272,7 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 rate1, u _vm->_graphicsManager._maxX = SCREEN_WIDTH; if (_vm->_graphicsManager.WinScan / 2 > SCREEN_WIDTH) { hasScreenCopy = true; - screenCopy = _vm->_globals.allocMemory(307200); + screenCopy = _vm->_globals->allocMemory(307200); memcpy(screenCopy, screenP, 307200); } if (NO_SEQ) { @@ -295,7 +295,7 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 rate1, u _vm->_eventsManager->_rateCounter = 0; _vm->_eventsManager->_escKeyFl = false; _vm->_soundManager.loadAnimSound(); - if (_vm->_globals.iRegul == 1) { + if (_vm->_globals->iRegul == 1) { while (!_vm->_eventsManager->_escKeyFl && _vm->_eventsManager->_rateCounter < rate1) { _vm->_eventsManager->refreshEvents(); } @@ -320,7 +320,7 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 rate1, u break; f.read(screenP, READ_LE_UINT32(imageStr + 8)); - if (_vm->_globals.iRegul == 1) { + if (_vm->_globals->iRegul == 1) { while (!_vm->_eventsManager->_escKeyFl && _vm->_eventsManager->_rateCounter < rate2) { _vm->_eventsManager->refreshEvents(); _vm->_soundManager.checkSoundEnd(); @@ -344,7 +344,7 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 rate1, u _vm->_soundManager.checkSoundEnd(); } - if (_vm->_globals.iRegul == 1) { + if (_vm->_globals->iRegul == 1) { while (!_vm->_eventsManager->_escKeyFl && _vm->_eventsManager->_rateCounter < rate3) { _vm->_eventsManager->refreshEvents(); _vm->_soundManager.checkSoundEnd(); @@ -362,7 +362,7 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 rate1, u size_t nbytes = f.readUint32LE(); f.skip(14); f.read(screenP, nbytes); - byte *ptra = _vm->_globals.allocMemory(307200); + byte *ptra = _vm->_globals->allocMemory(307200); memcpy(ptra, screenP, 307200); for (;;) { @@ -379,12 +379,12 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 rate1, u _vm->_graphicsManager.copyWinscanVbe3(screenP, ptra); } _vm->_graphicsManager.fadeOutDefaultLength(ptra); - ptra = _vm->_globals.freeMemory(ptra); + ptra = _vm->_globals->freeMemory(ptra); } if (hasScreenCopy) { if (_vm->_graphicsManager.FADE_LINUX == 2) _vm->_graphicsManager.fadeOutDefaultLength(screenCopy); - _vm->_globals.freeMemory(screenCopy); + _vm->_globals->freeMemory(screenCopy); } _vm->_graphicsManager.FADE_LINUX = 0; @@ -467,14 +467,14 @@ void AnimationManager::loadAnim(const Common::String &animName) { } } - byte *data = _vm->_globals.allocMemory(nbytes + 1); + byte *data = _vm->_globals->allocMemory(nbytes + 1); f.read(data, nbytes); f.close(); for (int idx = 1; idx <= 20; ++idx) searchAnim(data, idx, nbytes); - _vm->_globals.freeMemory(data); + _vm->_globals->freeMemory(data); } /** @@ -482,15 +482,15 @@ void AnimationManager::loadAnim(const Common::String &animName) { */ void AnimationManager::clearAnim() { for (int idx = 0; idx < 35; ++idx) { - _vm->_globals._animBqe[idx]._data = _vm->_globals.freeMemory(_vm->_globals._animBqe[idx]._data); - _vm->_globals._animBqe[idx]._enabledFl = false; + _vm->_globals->_animBqe[idx]._data = _vm->_globals->freeMemory(_vm->_globals->_animBqe[idx]._data); + _vm->_globals->_animBqe[idx]._enabledFl = false; } for (int idx = 0; idx < 8; ++idx) { - _vm->_globals.Bank[idx]._data = _vm->_globals.freeMemory(_vm->_globals.Bank[idx]._data); - _vm->_globals.Bank[idx]._loadedFl = false; - _vm->_globals.Bank[idx]._filename = ""; - _vm->_globals.Bank[idx]._fileHeader = 0; + _vm->_globals->Bank[idx]._data = _vm->_globals->freeMemory(_vm->_globals->Bank[idx]._data); + _vm->_globals->Bank[idx]._loadedFl = false; + _vm->_globals->Bank[idx]._filename = ""; + _vm->_globals->Bank[idx]._fileHeader = 0; } } @@ -499,24 +499,24 @@ void AnimationManager::clearAnim() { */ int AnimationManager::loadSpriteBank(int idx, const Common::String &filename) { int result = 0; - _vm->_globals.Bank[idx]._loadedFl = true; - _vm->_globals.Bank[idx]._filename = filename; + _vm->_globals->Bank[idx]._loadedFl = true; + _vm->_globals->Bank[idx]._filename = filename; byte *fileDataPtr = _vm->_fileManager->loadFile(filename); - _vm->_globals.Bank[idx]._fileHeader = 0; + _vm->_globals->Bank[idx]._fileHeader = 0; if (fileDataPtr[1] == 'L' && fileDataPtr[2] == 'E') - _vm->_globals.Bank[idx]._fileHeader = 1; + _vm->_globals->Bank[idx]._fileHeader = 1; else if (fileDataPtr[1] == 'O' && fileDataPtr[2] == 'R') - _vm->_globals.Bank[idx]._fileHeader = 2; + _vm->_globals->Bank[idx]._fileHeader = 2; - if (!_vm->_globals.Bank[idx]._fileHeader) { - _vm->_globals.freeMemory(fileDataPtr); - _vm->_globals.Bank[idx]._loadedFl = false; + if (!_vm->_globals->Bank[idx]._fileHeader) { + _vm->_globals->freeMemory(fileDataPtr); + _vm->_globals->Bank[idx]._loadedFl = false; result = -1; } - _vm->_globals.Bank[idx]._data = fileDataPtr; + _vm->_globals->Bank[idx]._data = fileDataPtr; int objectDataIdx = 0; for(objectDataIdx = 0; objectDataIdx <= 249; objectDataIdx++) { @@ -527,13 +527,13 @@ int AnimationManager::loadSpriteBank(int idx, const Common::String &filename) { } if (objectDataIdx > 249) { - _vm->_globals.freeMemory(fileDataPtr); - _vm->_globals.Bank[idx]._loadedFl = false; + _vm->_globals->freeMemory(fileDataPtr); + _vm->_globals->Bank[idx]._loadedFl = false; result = -2; } - _vm->_globals.Bank[idx]._objDataIdx = objectDataIdx; + _vm->_globals->Bank[idx]._objDataIdx = objectDataIdx; - Common::String ofsFilename = _vm->_globals.Bank[idx]._filename; + Common::String ofsFilename = _vm->_globals->Bank[idx]._filename; char ch; do { ch = ofsFilename.lastChar(); @@ -545,18 +545,18 @@ int AnimationManager::loadSpriteBank(int idx, const Common::String &filename) { if (f.exists(ofsFilename)) { byte *ofsData = _vm->_fileManager->loadFile(ofsFilename); byte *curOfsData = ofsData; - for (int objIdx = 0; objIdx < _vm->_globals.Bank[idx]._objDataIdx; ++objIdx, curOfsData += 8) { + for (int objIdx = 0; objIdx < _vm->_globals->Bank[idx]._objDataIdx; ++objIdx, curOfsData += 8) { int x1 = READ_LE_INT16(curOfsData); int y1 = READ_LE_INT16(curOfsData + 2); int x2 = READ_LE_INT16(curOfsData + 4); int y2 = READ_LE_INT16(curOfsData + 6); - _vm->_objectsManager.setOffsetXY(_vm->_globals.Bank[idx]._data, objIdx, x1, y1, 0); - if (_vm->_globals.Bank[idx]._fileHeader == 2) - _vm->_objectsManager.setOffsetXY(_vm->_globals.Bank[idx]._data, objIdx, x2, y2, 1); + _vm->_objectsManager.setOffsetXY(_vm->_globals->Bank[idx]._data, objIdx, x1, y1, 0); + if (_vm->_globals->Bank[idx]._fileHeader == 2) + _vm->_objectsManager.setOffsetXY(_vm->_globals->Bank[idx]._data, objIdx, x2, y2, 1); } - _vm->_globals.freeMemory(ofsData); + _vm->_globals->freeMemory(ofsData); result = 0; } @@ -578,18 +578,18 @@ void AnimationManager::searchAnim(const byte *data, int animIndex, int bufSize) if (READ_BE_UINT32(&data[curBufferPos]) == MKTAG('A', 'N', 'I', 'M') || READ_BE_UINT24(&data[curBufferPos]) == MKTAG24('F', 'I', 'N')) innerLoopCond = true; if (bufSize < curBufferPos) { - _vm->_globals._animBqe[animIndex]._enabledFl = false; - _vm->_globals._animBqe[animIndex]._data = g_PTRNUL; + _vm->_globals->_animBqe[animIndex]._enabledFl = false; + _vm->_globals->_animBqe[animIndex]._data = g_PTRNUL; return; } ++curBufferPos; ++count; } while (!innerLoopCond); - _vm->_globals._animBqe[animIndex]._data = _vm->_globals.allocMemory(count + 50); - _vm->_globals._animBqe[animIndex]._enabledFl = true; - memcpy(_vm->_globals._animBqe[animIndex]._data, data + dataIdx + 5, 20); + _vm->_globals->_animBqe[animIndex]._data = _vm->_globals->allocMemory(count + 50); + _vm->_globals->_animBqe[animIndex]._enabledFl = true; + memcpy(_vm->_globals->_animBqe[animIndex]._data, data + dataIdx + 5, 20); - byte *dataP = _vm->_globals._animBqe[animIndex]._data; + byte *dataP = _vm->_globals->_animBqe[animIndex]._data; int curDestDataIndx = 20; int curSrcDataIndx = dataIdx + 25; @@ -642,7 +642,7 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui byte *screenCopy = NULL; if (_vm->_graphicsManager.WinScan / 2 > SCREEN_WIDTH) { hasScreenCopy = true; - screenCopy = _vm->_globals.allocMemory(307200); + screenCopy = _vm->_globals->allocMemory(307200); memcpy(screenCopy, screenP, 307200); } if (NO_SEQ) { @@ -671,7 +671,7 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui _vm->_eventsManager->_rateCounter = 0; _vm->_eventsManager->_escKeyFl = false; _vm->_soundManager.loadAnimSound(); - if (_vm->_globals.iRegul == 1) { + if (_vm->_globals->iRegul == 1) { do { if (_vm->shouldQuit() || (_vm->_eventsManager->_escKeyFl && !skipEscFl)) { skipFl = true; @@ -689,7 +689,7 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui _vm->_eventsManager->_rateCounter = 0; _vm->_eventsManager->_escKeyFl = false; _vm->_soundManager.loadAnimSound(); - if (_vm->_globals.iRegul == 1) { + if (_vm->_globals->iRegul == 1) { do { if (_vm->shouldQuit() || (_vm->_eventsManager->_escKeyFl && !skipEscFl)) { skipFl = true; @@ -717,7 +717,7 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui break; f.read(screenP, READ_LE_UINT32(imageStr + 8)); - if (_vm->_globals.iRegul == 1) { + if (_vm->_globals->iRegul == 1) { do { if (_vm->shouldQuit() || (_vm->_eventsManager->_escKeyFl && !skipEscFl)) { skipFl = true; @@ -751,7 +751,7 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui } } - if (_vm->_globals.iRegul == 1 && !skipFl) { + if (_vm->_globals->iRegul == 1 && !skipFl) { do { if (_vm->shouldQuit() || (_vm->_eventsManager->_escKeyFl && !skipEscFl)) { skipFl = true; @@ -777,7 +777,7 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui _vm->_eventsManager->_mouseFl = true; } if (hasScreenCopy) - _vm->_globals.freeMemory(screenCopy); + _vm->_globals->freeMemory(screenCopy); } /** @@ -809,7 +809,7 @@ void AnimationManager::playSequence2(const Common::String &file, uint32 rate1, u if (_vm->_graphicsManager.WinScan / 2 > SCREEN_WIDTH) { multiScreenFl = true; - screenCopy = _vm->_globals.allocMemory(307200); + screenCopy = _vm->_globals->allocMemory(307200); memcpy((void *)screenCopy, screenP, 307200); } if (NO_SEQ) { @@ -833,7 +833,7 @@ void AnimationManager::playSequence2(const Common::String &file, uint32 rate1, u _vm->_eventsManager->_rateCounter = 0; _vm->_eventsManager->_escKeyFl = false; _vm->_soundManager.loadAnimSound(); - if (_vm->_globals.iRegul == 1) { + if (_vm->_globals->iRegul == 1) { do { _vm->_eventsManager->refreshEvents(); _vm->_soundManager.checkSoundEnd(); @@ -857,7 +857,7 @@ void AnimationManager::playSequence2(const Common::String &file, uint32 rate1, u break; f.read(screenP, READ_LE_UINT32(imageStr + 8)); - if (_vm->_globals.iRegul == 1) { + if (_vm->_globals->iRegul == 1) { do { _vm->_eventsManager->refreshEvents(); } while (!_vm->shouldQuit() && !_vm->_eventsManager->_escKeyFl && _vm->_eventsManager->_rateCounter < rate2); @@ -881,7 +881,7 @@ void AnimationManager::playSequence2(const Common::String &file, uint32 rate1, u } } - if (_vm->_globals.iRegul == 1) { + if (_vm->_globals->iRegul == 1) { // Wait for third rate delay do { _vm->_eventsManager->refreshEvents(); @@ -892,7 +892,7 @@ void AnimationManager::playSequence2(const Common::String &file, uint32 rate1, u _vm->_eventsManager->_rateCounter = 0; if (_vm->_graphicsManager.FADE_LINUX == 2 && !multiScreenFl) { - byte *ptra = _vm->_globals.allocMemory(307200); + byte *ptra = _vm->_globals->allocMemory(307200); f.seek(6); f.read(_vm->_graphicsManager._palette, 800); @@ -916,12 +916,12 @@ void AnimationManager::playSequence2(const Common::String &file, uint32 rate1, u _vm->_graphicsManager.copyWinscanVbe(screenP, ptra); } _vm->_graphicsManager.fadeOutDefaultLength(ptra); - ptra = _vm->_globals.freeMemory(ptra); + ptra = _vm->_globals->freeMemory(ptra); } if (multiScreenFl) { if (_vm->_graphicsManager.FADE_LINUX == 2) _vm->_graphicsManager.fadeOutDefaultLength(screenCopy); - _vm->_globals.freeMemory(screenCopy); + _vm->_globals->freeMemory(screenCopy); } _vm->_graphicsManager.FADE_LINUX = 0; diff --git a/engines/hopkins/computer.cpp b/engines/hopkins/computer.cpp index d273050833..f9b33258e5 100644 --- a/engines/hopkins/computer.cpp +++ b/engines/hopkins/computer.cpp @@ -77,7 +77,7 @@ void ComputerManager::setTextMode() { _vm->_graphicsManager.unlockScreen(); _vm->_graphicsManager._lineNbr = SCREEN_WIDTH; - _vm->_fontManager->_font = _vm->_globals.freeMemory(_vm->_fontManager->_font); + _vm->_fontManager->_font = _vm->_globals->freeMemory(_vm->_fontManager->_font); Common::String filename = "STFONT.SPR"; Common::File f; @@ -253,7 +253,7 @@ void ComputerManager::showComputer(ComputerEnum mode) { break; case '6': readText(10); - _vm->_globals._saveData->_data[svField270] = 4; + _vm->_globals->_saveData->_data[svField270] = 4; break; } } @@ -281,9 +281,9 @@ void ComputerManager::showComputer(ComputerEnum mode) { } if (mode == COMPUTER_HOPKINS) - _vm->_globals._exitId = 13; + _vm->_globals->_exitId = 13; else // Free access or Samantha - _vm->_globals._exitId = 14; + _vm->_globals->_exitId = 14; _vm->_graphicsManager.resetDirtyRects(); } @@ -354,14 +354,14 @@ void ComputerManager::loadMenu() { char *ptr; if (_vm->_fileManager->fileExists("COMPUTAN.TXT")) { ptr = (char *)_vm->_fileManager->loadFile("COMPUTAN.TXT"); - } else if (_vm->_globals._language == LANG_FR) { - ptr = (char *)_vm->_globals.allocMemory(sizeof(_frenchText)); + } else if (_vm->_globals->_language == LANG_FR) { + ptr = (char *)_vm->_globals->allocMemory(sizeof(_frenchText)); strcpy(ptr, _frenchText); - } else if (_vm->_globals._language == LANG_SP) { - ptr = (char *)_vm->_globals.allocMemory(sizeof(_spanishText)); + } else if (_vm->_globals->_language == LANG_SP) { + ptr = (char *)_vm->_globals->allocMemory(sizeof(_spanishText)); strcpy(ptr, _spanishText); } else { - ptr = (char *)_vm->_globals.allocMemory(sizeof(_englishText)); + ptr = (char *)_vm->_globals->allocMemory(sizeof(_englishText)); strcpy(ptr, _englishText); } @@ -392,7 +392,7 @@ void ComputerManager::loadMenu() { } ++tmpPtr; } while (!loopCond); - _vm->_globals.freeMemory((byte *)ptr); + _vm->_globals->freeMemory((byte *)ptr); } void ComputerManager::displayMessage(int xp, int yp, int textIdx) { @@ -467,7 +467,7 @@ void ComputerManager::outText2(const Common::String &msg) { * Restores the scene for the FBI headquarters room */ void ComputerManager::restoreFBIRoom() { - _vm->_globals.freeMemory(_vm->_fontManager->_font); + _vm->_globals->freeMemory(_vm->_fontManager->_font); _vm->_fontManager->_font = _vm->_fileManager->loadFile("FONTE3.SPR"); _vm->_fontManager->_fontFixedWidth = 12; _vm->_fontManager->_fontFixedHeight = 21; @@ -482,11 +482,11 @@ void ComputerManager::readText(int idx) { _vm->_eventsManager->_escKeyFl = false; Common::String filename; - if (_vm->_globals._language == LANG_EN) + if (_vm->_globals->_language == LANG_EN) filename = "THOPKAN.TXT"; - else if (_vm->_globals._language == LANG_FR) + else if (_vm->_globals->_language == LANG_FR) filename = "THOPK.TXT"; - else if (_vm->_globals._language == LANG_SP) + else if (_vm->_globals->_language == LANG_SP) filename = "THOPKES.TXT"; byte *ptr = _vm->_fileManager->loadFile(filename); @@ -523,7 +523,7 @@ void ComputerManager::readText(int idx) { } while (curChar != '%'); _vm->_eventsManager->waitKeyPress(); - ptr = _vm->_globals.freeMemory(ptr); + ptr = _vm->_globals->freeMemory(ptr); } /** @@ -531,9 +531,9 @@ void ComputerManager::readText(int idx) { */ void ComputerManager::displayGamesSubMenu() { const byte *oldSpriteData = _vm->_objectsManager._sprite[0]._spriteData; - uint oldSpeed = _vm->_globals._speed; + uint oldSpeed = _vm->_globals->_speed; - _vm->_globals._speed = 1; + _vm->_globals->_speed = 1; _vm->_eventsManager->changeMouseCursor(0); _breakoutSpr = g_PTRNUL; _vm->_eventsManager->_breakoutFl = true; @@ -560,14 +560,14 @@ void ComputerManager::displayGamesSubMenu() { playBreakout(); _vm->_graphicsManager.resetDirtyRects(); - _breakoutSpr = _vm->_globals.freeMemory(_breakoutSpr); - _breakoutLevel = (int16 *)_vm->_globals.freeMemory((byte *)_breakoutLevel); + _breakoutSpr = _vm->_globals->freeMemory(_breakoutSpr); + _breakoutLevel = (int16 *)_vm->_globals->freeMemory((byte *)_breakoutLevel); _vm->_objectsManager._sprite[0]._spriteData = oldSpriteData; _vm->_soundManager.removeSample(1); _vm->_soundManager.removeSample(2); _vm->_soundManager.removeSample(3); - _vm->_globals._speed = oldSpeed; + _vm->_globals->_speed = oldSpeed; _vm->_eventsManager->_breakoutFl = false; setVideoMode(); setTextColor(15); @@ -581,7 +581,7 @@ void ComputerManager::displayGamesSubMenu() { * Load Highscore from file */ void ComputerManager::loadHiscore() { - byte *ptr = _vm->_globals.allocMemory(100); + byte *ptr = _vm->_globals->allocMemory(100); _vm->_saveLoadManager.load("HISCORE.DAT", ptr); for (int scoreIndex = 0; scoreIndex < 6; ++scoreIndex) { @@ -600,7 +600,7 @@ void ComputerManager::loadHiscore() { } } - _vm->_globals.freeMemory(ptr); + _vm->_globals->freeMemory(ptr); _breakoutHiscore = atol(_score[5]._score.c_str()); } @@ -626,7 +626,7 @@ void ComputerManager::newLevel() { _breakoutLives = 11; _vm->_graphicsManager.loadVgaImage("CASSEF.PCX"); displayLives(); - _breakoutLevel = (int16 *)_vm->_globals.freeMemory((byte *)_breakoutLevel); + _breakoutLevel = (int16 *)_vm->_globals->freeMemory((byte *)_breakoutLevel); ++_breakoutLevelNbr; Common::String file; @@ -850,7 +850,7 @@ int ComputerManager::displayHiscores() { _vm->_eventsManager->mouseOff(); _vm->_graphicsManager.fadeOutBreakout(); - _vm->_globals.freeMemory(ptr); + _vm->_globals->freeMemory(ptr); return buttonIndex; } @@ -893,7 +893,7 @@ void ComputerManager::getScoreName() { _score[5]._score.setChar(score[i], scorePos--); } _vm->_graphicsManager.fadeOutBreakout(); - _vm->_globals.freeMemory(ptr); + _vm->_globals->freeMemory(ptr); saveScore(); } @@ -970,7 +970,7 @@ void ComputerManager::saveScore() { } } - byte *ptr = _vm->_globals.allocMemory(100); + byte *ptr = _vm->_globals->allocMemory(100); memset(ptr, 0, 99); for (int scorePlaceIdx = 0; scorePlaceIdx <= 5; scorePlaceIdx++) { int curBufPtr = 16 * scorePlaceIdx; @@ -993,7 +993,7 @@ void ComputerManager::saveScore() { } _vm->_saveLoadManager.saveFile("HISCORE.DAT", ptr, 100); - _vm->_globals.freeMemory(ptr); + _vm->_globals->freeMemory(ptr); } /** diff --git a/engines/hopkins/dialogs.cpp b/engines/hopkins/dialogs.cpp index 7e3281e080..2474aace54 100644 --- a/engines/hopkins/dialogs.cpp +++ b/engines/hopkins/dialogs.cpp @@ -50,8 +50,8 @@ DialogsManager::DialogsManager(HopkinsEngine *vm) { } DialogsManager::~DialogsManager() { - _vm->_globals.freeMemory(_inventWin1); - _vm->_globals.freeMemory(_inventoryIcons); + _vm->_globals->freeMemory(_inventWin1); + _vm->_globals->freeMemory(_inventoryIcons); } void DialogsManager::showOptionsDialog() { @@ -61,16 +61,16 @@ void DialogsManager::showOptionsDialog() { if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS) filename = "OPTION.SPR"; else { - if (_vm->_globals._language == LANG_FR) + if (_vm->_globals->_language == LANG_FR) filename = "OPTIFR.SPR"; - else if (_vm->_globals._language == LANG_EN) + else if (_vm->_globals->_language == LANG_EN) filename = "OPTIAN.SPR"; - else if (_vm->_globals._language == LANG_SP) + else if (_vm->_globals->_language == LANG_SP) filename = "OPTIES.SPR"; } - _vm->_globals._optionDialogSpr = _vm->_fileManager->loadFile(filename); - _vm->_globals._optionDialogFl = true; + _vm->_globals->_optionDialogSpr = _vm->_fileManager->loadFile(filename); + _vm->_globals->_optionDialogFl = true; int scrollOffset = _vm->_graphicsManager._scrollOffset; bool doneFlag = false; @@ -190,7 +190,7 @@ void DialogsManager::showOptionsDialog() { } if (mousePos.x >= scrollOffset + 175 && mousePos.y > 285 && mousePos.x <= scrollOffset + 281 && mousePos.y <= 310) { - _vm->_globals._exitId = 300; + _vm->_globals->_exitId = 300; doneFlag = true; } if (mousePos.x >= scrollOffset + 355 && mousePos.y > 285 && mousePos.x <= scrollOffset + 490 && mousePos.y <= 310) @@ -235,63 +235,63 @@ void DialogsManager::showOptionsDialog() { // Values are blocked, thus handling the zone is useless //if (mousePos.x >= _vm->_graphicsManager.ofscroll + 348 && mousePos.y > 248 && mousePos.x <= _vm->_graphicsManager.ofscroll + 394 && mousePos.y <= 273) - // _vm->_globals._speed = 2; + // _vm->_globals->_speed = 2; if ( mousePos.x < scrollOffset + 165 || mousePos.x > scrollOffset + 496 || mousePos.y < 107 || mousePos.y > 318) doneFlag = true; } - if (_vm->_globals._speed == 1) - _vm->_globals._menuSpeed = 6; - else if (_vm->_globals._speed == 2) - _vm->_globals._menuSpeed = 5; - else if (_vm->_globals._speed == 3) - _vm->_globals._menuSpeed = 4; + if (_vm->_globals->_speed == 1) + _vm->_globals->_menuSpeed = 6; + else if (_vm->_globals->_speed == 2) + _vm->_globals->_menuSpeed = 5; + else if (_vm->_globals->_speed == 3) + _vm->_globals->_menuSpeed = 4; - _vm->_globals._menuTextOff = !_vm->_soundManager._textOffFl ? 7 : 8; - _vm->_globals._menuVoiceOff = !_vm->_soundManager._voiceOffFl ? 7 : 8; - _vm->_globals._menuSoundOff = !_vm->_soundManager._soundOffFl ? 7 : 8; - _vm->_globals._menuMusicOff = !_vm->_soundManager._musicOffFl ? 7 : 8; + _vm->_globals->_menuTextOff = !_vm->_soundManager._textOffFl ? 7 : 8; + _vm->_globals->_menuVoiceOff = !_vm->_soundManager._voiceOffFl ? 7 : 8; + _vm->_globals->_menuSoundOff = !_vm->_soundManager._soundOffFl ? 7 : 8; + _vm->_globals->_menuMusicOff = !_vm->_soundManager._musicOffFl ? 7 : 8; - _vm->_globals._menuDisplayType = 9; + _vm->_globals->_menuDisplayType = 9; switch (_vm->_graphicsManager._scrollSpeed) { case 1: - _vm->_globals._menuScrollSpeed = 12; + _vm->_globals->_menuScrollSpeed = 12; break; case 2: - _vm->_globals._menuScrollSpeed = 13; + _vm->_globals->_menuScrollSpeed = 13; break; case 4: - _vm->_globals._menuScrollSpeed = 14; + _vm->_globals->_menuScrollSpeed = 14; break; case 8: - _vm->_globals._menuScrollSpeed = 15; + _vm->_globals->_menuScrollSpeed = 15; break; case 16: - _vm->_globals._menuScrollSpeed = 16; + _vm->_globals->_menuScrollSpeed = 16; break; case 32: - _vm->_globals._menuScrollSpeed = 17; + _vm->_globals->_menuScrollSpeed = 17; break; case 48: - _vm->_globals._menuScrollSpeed = 18; + _vm->_globals->_menuScrollSpeed = 18; break; case 64: - _vm->_globals._menuScrollSpeed = 19; + _vm->_globals->_menuScrollSpeed = 19; break; case 128: - _vm->_globals._menuScrollSpeed = 20; + _vm->_globals->_menuScrollSpeed = 20; break; case 160: - _vm->_globals._menuScrollSpeed = 21; + _vm->_globals->_menuScrollSpeed = 21; break; case 320: - _vm->_globals._menuScrollSpeed = 22; + _vm->_globals->_menuScrollSpeed = 22; break; case 640: - _vm->_globals._menuScrollSpeed = 23; + _vm->_globals->_menuScrollSpeed = 23; break; } @@ -302,12 +302,12 @@ void DialogsManager::showOptionsDialog() { 107, 335, 215, _vm->_graphicsManager._vesaBuffer, scrollOffset + 164, 107); _vm->_graphicsManager.addDirtyRect(scrollOffset + 164, 107, scrollOffset + 498, 320); - _vm->_globals._optionDialogSpr = _vm->_globals.freeMemory(_vm->_globals._optionDialogSpr); - _vm->_globals._optionDialogFl = false; + _vm->_globals->_optionDialogSpr = _vm->_globals->freeMemory(_vm->_globals->_optionDialogSpr); + _vm->_globals->_optionDialogFl = false; } void DialogsManager::showInventory() { - if (_removeInventFl || _inventDisplayedFl || _vm->_globals._disableInventFl) + if (_removeInventFl || _inventDisplayedFl || _vm->_globals->_disableInventFl) return; _vm->_graphicsManager._scrollStatus = 1; @@ -326,14 +326,14 @@ void DialogsManager::showInventory() { loopFl = false; _vm->_eventsManager->_curMouseButton = 0; _vm->_eventsManager->_mouseButton = 0; - _vm->_globals._disableInventFl = true; + _vm->_globals->_disableInventFl = true; _vm->_graphicsManager.SETCOLOR4(251, 100, 100, 100); Common::String filename; if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS) filename = "INVENT.SPR"; else { - switch (_vm->_globals._language) { + switch (_vm->_globals->_language) { case LANG_EN: filename = "INVENTAN.SPR"; break; @@ -351,7 +351,7 @@ void DialogsManager::showInventory() { error("Error opening file - %s", filename.c_str()); size_t filesize = f.size(); - _inventWin1 = _vm->_globals.allocMemory(filesize); + _inventWin1 = _vm->_globals->allocMemory(filesize); _vm->_fileManager->readStream(f, _inventWin1, filesize); f.close(); @@ -369,13 +369,13 @@ void DialogsManager::showInventory() { int curPosX = 0; for (int inventCol = 1; inventCol <= 6; inventCol++) { ++inventCount; - int inventIdx = _vm->_globals._inventory[inventCount]; + int inventIdx = _vm->_globals->_inventory[inventCount]; // The last two zones are not reserved for the inventory: Options and Save/Load if (inventIdx && inventCount <= 29) { byte *obj = _vm->_objectsManager.loadObjectFromFile(inventIdx, false); _vm->_graphicsManager.restoreSurfaceRect(_vm->_graphicsManager._vesaBuffer, obj, _inventX + curPosX + 6, - curPosY + 120, _vm->_globals._objectWidth, _vm->_globals._objectHeight); - _vm->_globals.freeMemory(obj); + curPosY + 120, _vm->_globals->_objectWidth, _vm->_globals->_objectHeight); + _vm->_globals->freeMemory(obj); } curPosX += 54; }; @@ -407,32 +407,32 @@ void DialogsManager::showInventory() { if (mouseButton == 1) { if (_vm->_eventsManager->_mouseCursorId == 1 || _vm->_eventsManager->_mouseCursorId == 2 || _vm->_eventsManager->_mouseCursorId == 3 || _vm->_eventsManager->_mouseCursorId == 16 || !_vm->_eventsManager->_mouseCursorId) break; - _vm->_objectsManager.takeInventoryObject(_vm->_globals._inventory[newInventoryItem]); + _vm->_objectsManager.takeInventoryObject(_vm->_globals->_inventory[newInventoryItem]); if (_vm->_eventsManager->_mouseCursorId == 8) break; _vm->_scriptManager._tempObjectFl = true; - _vm->_globals._saveData->_data[svLastObjectIndex] = _vm->_objectsManager._curObjectIndex; - _vm->_globals._saveData->_data[svLastInventoryItem] = _vm->_globals._inventory[newInventoryItem]; - _vm->_globals._saveData->_data[svLastInvMouseCursor] = _vm->_eventsManager->_mouseCursorId; + _vm->_globals->_saveData->_data[svLastObjectIndex] = _vm->_objectsManager._curObjectIndex; + _vm->_globals->_saveData->_data[svLastInventoryItem] = _vm->_globals->_inventory[newInventoryItem]; + _vm->_globals->_saveData->_data[svLastInvMouseCursor] = _vm->_eventsManager->_mouseCursorId; _vm->_objectsManager.OPTI_OBJET(); _vm->_scriptManager._tempObjectFl = false; if (_vm->_soundManager._voiceOffFl) { do _vm->_eventsManager->refreshScreenAndEvents(); - while (!_vm->_globals._exitId && _vm->_eventsManager->getMouseButton() != 1); + while (!_vm->_globals->_exitId && _vm->_eventsManager->getMouseButton() != 1); _vm->_fontManager->hideText(9); } - if (_vm->_globals._exitId) { - if (_vm->_globals._exitId == 2) { - _vm->_globals._exitId = 0; + if (_vm->_globals->_exitId) { + if (_vm->_globals->_exitId == 2) { + _vm->_globals->_exitId = 0; break; } - _vm->_globals._exitId = 0; - _inventBuf2 = _vm->_globals.freeMemory(_inventBuf2); - _inventWin1 = _vm->_globals.freeMemory(_inventWin1); + _vm->_globals->_exitId = 0; + _inventBuf2 = _vm->_globals->freeMemory(_inventBuf2); + _inventWin1 = _vm->_globals->freeMemory(_inventWin1); loopFl = true; break; } else @@ -441,7 +441,7 @@ void DialogsManager::showInventory() { if (_removeInventFl) break; _vm->_eventsManager->refreshScreenAndEvents(); - if (_vm->_globals._screenId >= 35 && _vm->_globals._screenId <= 40) + if (_vm->_globals->_screenId >= 35 && _vm->_globals->_screenId <= 40) _vm->_objectsManager.handleSpecialGames(); } } while (loopFl); @@ -454,8 +454,8 @@ void DialogsManager::showInventory() { _vm->_objectsManager.BOBTOUS = true; } - _inventWin1 = _vm->_globals.freeMemory(_inventWin1); - _inventBuf2 = _vm->_globals.freeMemory(_inventBuf2); + _inventWin1 = _vm->_globals->freeMemory(_inventWin1); + _inventBuf2 = _vm->_globals->freeMemory(_inventBuf2); if (_vm->_eventsManager->_mouseCursorId == 1) showOptionsDialog(); @@ -468,7 +468,7 @@ void DialogsManager::showInventory() { _vm->_eventsManager->changeMouseCursor(4); _vm->_objectsManager._oldBorderPos = Common::Point(0, 0); _vm->_objectsManager._borderPos = Common::Point(0, 0); - _vm->_globals._disableInventFl = false; + _vm->_globals->_disableInventFl = false; _vm->_graphicsManager._scrollStatus = 0; } @@ -476,7 +476,7 @@ void DialogsManager::showInventory() { * Inventory Animations */ void DialogsManager::inventAnim() { - if (_vm->_globals._disableInventFl) + if (_vm->_globals->_disableInventFl) return; if (_vm->_objectsManager._eraseVisibleCounter && !_vm->_objectsManager._visibleFl) { @@ -499,20 +499,20 @@ void DialogsManager::inventAnim() { _vm->_objectsManager._oldInventoryPosX = newOffset; } - if (_vm->_globals._saveData->_data[svField357] == 1) { - if (_vm->_globals._saveData->_data[svField353] == 1) + if (_vm->_globals->_saveData->_data[svField357] == 1) { + if (_vm->_globals->_saveData->_data[svField353] == 1) _vm->_graphicsManager.Affiche_Perfect(_vm->_graphicsManager._vesaBuffer, _vm->_objectsManager._headSprites, 832, 325, 0, 0, 0, false); - if (_vm->_globals._saveData->_data[svField355] == 1) + if (_vm->_globals->_saveData->_data[svField355] == 1) _vm->_graphicsManager.Affiche_Perfect(_vm->_graphicsManager._vesaBuffer, _vm->_objectsManager._headSprites, 866, 325, 1, 0, 0, false); _vm->_graphicsManager.addDirtyRect(532, 25, 560, 60); _vm->_graphicsManager.addDirtyRect(566, 25, 594, 60); } - if (_vm->_globals._saveData->_data[svField356] == 1) { + if (_vm->_globals->_saveData->_data[svField356] == 1) { _vm->_graphicsManager.Affiche_Perfect(_vm->_graphicsManager._vesaBuffer, _vm->_objectsManager._headSprites, 832, 325, 0, 0, 0, false); _vm->_graphicsManager.addDirtyRect(532, 25, 560, 60); } - if (_vm->_globals._saveData->_data[svField354] == 1) { + if (_vm->_globals->_saveData->_data[svField354] == 1) { _vm->_graphicsManager.Affiche_Perfect(_vm->_graphicsManager._vesaBuffer, _vm->_objectsManager._headSprites, 832, 325, 0, 0, 0, false); _vm->_graphicsManager.addDirtyRect(532, 25, 560, 60); } @@ -522,7 +522,7 @@ void DialogsManager::inventAnim() { * Test dialog opening */ void DialogsManager::testDialogOpening() { - if (_vm->_globals._cityMapEnabledFl) + if (_vm->_globals->_cityMapEnabledFl) _vm->_eventsManager->_gameKey = KEY_NONE; if ((_vm->_eventsManager->_gameKey == KEY_NONE) || _inventFl) @@ -575,8 +575,8 @@ void DialogsManager::showLoadGame() { _vm->_graphicsManager.copySurface(_vm->_graphicsManager._vesaScreen, _vm->_eventsManager->_startPos.x + 183, 60, 274, 353, _vm->_graphicsManager._vesaBuffer, _vm->_eventsManager->_startPos.x + 183, 60); _vm->_graphicsManager.addDirtyRect(_vm->_eventsManager->_startPos.x + 183, 60, 457, 413); _vm->_objectsManager.BOBTOUS = true; - _vm->_objectsManager._saveLoadSprite = _vm->_globals.freeMemory(_vm->_objectsManager._saveLoadSprite); - _vm->_objectsManager._saveLoadSprite2 = _vm->_globals.freeMemory(_vm->_objectsManager._saveLoadSprite2); + _vm->_objectsManager._saveLoadSprite = _vm->_globals->freeMemory(_vm->_objectsManager._saveLoadSprite); + _vm->_objectsManager._saveLoadSprite2 = _vm->_globals->freeMemory(_vm->_objectsManager._saveLoadSprite2); _vm->_objectsManager._saveLoadX = 0; _vm->_objectsManager._saveLoadY = 0; @@ -604,8 +604,8 @@ void DialogsManager::showSaveGame() { _vm->_graphicsManager.copySurface(_vm->_graphicsManager._vesaScreen, _vm->_eventsManager->_startPos.x + 183, 60, 274, 353, _vm->_graphicsManager._vesaBuffer, _vm->_eventsManager->_startPos.x + 183, 60); _vm->_graphicsManager.addDirtyRect(_vm->_eventsManager->_startPos.x + 183, 60, _vm->_eventsManager->_startPos.x + 457, 413); _vm->_objectsManager.BOBTOUS = true; - _vm->_objectsManager._saveLoadSprite = _vm->_globals.freeMemory(_vm->_objectsManager._saveLoadSprite); - _vm->_objectsManager._saveLoadSprite2 = _vm->_globals.freeMemory(_vm->_objectsManager._saveLoadSprite2); + _vm->_objectsManager._saveLoadSprite = _vm->_globals->freeMemory(_vm->_objectsManager._saveLoadSprite); + _vm->_objectsManager._saveLoadSprite2 = _vm->_globals->freeMemory(_vm->_objectsManager._saveLoadSprite2); _vm->_objectsManager._saveLoadX = 0; _vm->_objectsManager._saveLoadY = 0; @@ -627,7 +627,7 @@ void DialogsManager::showSaveLoad(SaveLoadMode mode) { if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS) filename = "SAVE.SPR"; else { - switch (_vm->_globals._language) { + switch (_vm->_globals->_language) { case LANG_EN: filename = "SAVEAN.SPR"; break; @@ -644,7 +644,7 @@ void DialogsManager::showSaveLoad(SaveLoadMode mode) { _vm->_objectsManager._saveLoadSprite2 = _vm->_objectsManager.loadSprite("SAVE2.SPR"); _vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, _vm->_objectsManager._saveLoadSprite, _vm->_eventsManager->_startPos.x + 483, 360, 0); - if (_vm->_globals._language == LANG_FR) { + if (_vm->_globals->_language == LANG_FR) { if (mode == MODE_SAVE) _vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, _vm->_objectsManager._saveLoadSprite, _vm->_eventsManager->_startPos.x + 525, 375, 1); else if (mode == MODE_LOAD) diff --git a/engines/hopkins/events.cpp b/engines/hopkins/events.cpp index 0f5135b6d1..1e1ebd58f9 100644 --- a/engines/hopkins/events.cpp +++ b/engines/hopkins/events.cpp @@ -59,8 +59,8 @@ EventsManager::EventsManager(HopkinsEngine *vm) { } EventsManager::~EventsManager() { - _vm->_globals.freeMemory(_objectBuf); - _vm->_globals.freeMemory(_mouseCursor); + _vm->_globals->freeMemory(_objectBuf); + _vm->_globals->freeMemory(_mouseCursor); } void EventsManager::initMouseData() { @@ -77,7 +77,7 @@ void EventsManager::initMouseData() { _mouseSizeY = 20; } - switch (_vm->_globals._language) { + switch (_vm->_globals->_language) { case LANG_EN: if (!_mouseLinuxFl) _mouseCursor = _vm->_fileManager->loadFile("SOUAN.SPR"); @@ -185,7 +185,7 @@ void EventsManager::changeMouseCursor(int id) { if (_mouseCursorId == 23) return; - if (id == 4 && _mouseCursorId == 4 && _vm->_globals._freezeCharacterFl) + if (id == 4 && _mouseCursorId == 4 && _vm->_globals->_freezeCharacterFl) cursorId = 0; if (cursorId == 25) cursorId = 5; @@ -364,8 +364,8 @@ void EventsManager::refreshScreenAndEvents() { width = _mouseSizeX; height = _mouseSizeY; if (_mouseCursorId == 23) { - width = _vm->_globals._objectWidth; - height = _vm->_globals._objectHeight; + width = _vm->_globals->_objectWidth; + height = _vm->_globals->_objectHeight; } else { if (_breakoutFl) { if (xp < _vm->_graphicsManager._minX) @@ -392,7 +392,7 @@ void EventsManager::refreshScreenAndEvents() { } } - if (!_vm->_globals._linuxEndDemoFl) + if (!_vm->_globals->_linuxEndDemoFl) _vm->_objectsManager.displaySprite(); if (!_mouseFl) { updateCursor(); @@ -411,14 +411,14 @@ void EventsManager::refreshScreenAndEvents() { _vm->_graphicsManager.addDirtyRect(xp, yp, right, bottom); } - _vm->_globals._speed = 2; + _vm->_globals->_speed = 2; bool externalLoopFl = false; do { while (!_vm->shouldQuit()) { checkForNextFrameCounter(); bool innerLoopFl = false; - while (_breakoutFl || _vm->_globals.iRegul != 1) { + while (_breakoutFl || _vm->_globals->iRegul != 1) { checkForNextFrameCounter(); if (!_breakoutFl) { @@ -430,7 +430,7 @@ void EventsManager::refreshScreenAndEvents() { break; } } - if (innerLoopFl || _vm->_globals._speed != 2) + if (innerLoopFl || _vm->_globals->_speed != 2) break; if (externalLoopFl ||_rateCounter > 9) { externalLoopFl = true; @@ -439,8 +439,8 @@ void EventsManager::refreshScreenAndEvents() { } if (externalLoopFl) break; - } while (!_vm->shouldQuit() && _vm->_globals.iRegul == 3 && _rateCounter <= 15); - _vm->_globals._speed = 2; + } while (!_vm->shouldQuit() && _vm->_globals->iRegul == 3 && _rateCounter <= 15); + _vm->_globals->_speed = 2; _rateCounter = 0; if (!_vm->_graphicsManager._largeScreenFl || _vm->_graphicsManager._scrollStatus == 1) { _vm->_graphicsManager.displayDirtyRects(); @@ -487,14 +487,14 @@ void EventsManager::updateCursor() { Common::Rect clipBounds(_vm->_graphicsManager._minX, _vm->_graphicsManager._minY, _vm->_graphicsManager._maxX, _vm->_graphicsManager._maxY); _vm->_graphicsManager._minX = _vm->_graphicsManager._minY = 0; - _vm->_graphicsManager._maxX = _vm->_globals._objectWidth; - _vm->_graphicsManager._maxY = _vm->_globals._objectHeight; + _vm->_graphicsManager._maxX = _vm->_globals->_objectWidth; + _vm->_graphicsManager._maxY = _vm->_globals->_objectHeight; int pitch = _vm->_graphicsManager._lineNbr2; - _vm->_graphicsManager._lineNbr2 = _vm->_globals._objectWidth; + _vm->_graphicsManager._lineNbr2 = _vm->_globals->_objectWidth; // Create the temporary cursor surface - byte *cursorSurface = new byte[_vm->_globals._objectHeight * _vm->_globals._objectWidth]; - Common::fill(cursorSurface, cursorSurface + _vm->_globals._objectHeight * _vm->_globals._objectWidth, 0); + byte *cursorSurface = new byte[_vm->_globals->_objectHeight * _vm->_globals->_objectWidth]; + Common::fill(cursorSurface, cursorSurface + _vm->_globals->_objectHeight * _vm->_globals->_objectWidth, 0); if (_mouseCursorId != 23) { // Draw standard cursor @@ -530,7 +530,7 @@ void EventsManager::updateCursor() { // Set the ScummVM cursor from the surface CursorMan.replaceCursorPalette(cursorPalette, 0, PALETTE_SIZE - 1); - CursorMan.replaceCursor(cursorSurface, _vm->_globals._objectWidth, _vm->_globals._objectHeight, + CursorMan.replaceCursor(cursorSurface, _vm->_globals->_objectWidth, _vm->_globals->_objectHeight, xOffset, 0, 0, true); // Delete the cursor surface and palette diff --git a/engines/hopkins/files.cpp b/engines/hopkins/files.cpp index 1d63d16bd6..42521bdb6b 100644 --- a/engines/hopkins/files.cpp +++ b/engines/hopkins/files.cpp @@ -47,7 +47,7 @@ byte *FileManager::loadFile(const Common::String &file) { // Allocate space for the file contents size_t filesize = f.size(); - byte *data = _vm->_globals.allocMemory(filesize); + byte *data = _vm->_globals->allocMemory(filesize); if (!data) error("Error allocating space for file being loaded - %s", file.c_str()); @@ -68,16 +68,16 @@ int FileManager::readStream(Common::ReadStream &stream, void *buf, size_t nbytes * Initialize censorship based on blood.dat file */ void FileManager::initCensorship() { - _vm->_globals._censorshipFl = false; + _vm->_globals->_censorshipFl = false; // If file doesn't exist, fallback to uncensored if (fileExists("BLOOD.DAT")) { char *data = (char *)loadFile("BLOOD.DAT"); if ((data[6] == 'u' && data[7] == 'k') || (data[6] == 'U' && data[7] == 'K')) - _vm->_globals._censorshipFl = true; + _vm->_globals->_censorshipFl = true; - _vm->_globals.freeMemory((byte *)data); + _vm->_globals->freeMemory((byte *)data); } } @@ -169,7 +169,7 @@ byte *FileManager::searchCat(const Common::String &file, CatMode mode) { tmpFilename = "ENG_VOI.CAT"; // Win95 and Linux versions uses another set of names else { - switch (_vm->_globals._language) { + switch (_vm->_globals->_language) { case LANG_EN: tmpFilename = "RES_VAN.CAT"; break; @@ -204,32 +204,32 @@ byte *FileManager::searchCat(const Common::String &file, CatMode mode) { if (name == filename) { // Found entry for file, so get it's details from the catalogue entry const byte *pData = ptr + offsetVal; - _vm->_globals._catalogPos = READ_LE_UINT32(pData + 15); - _vm->_globals._catalogSize = READ_LE_UINT32(pData + 19); + _vm->_globals->_catalogPos = READ_LE_UINT32(pData + 15); + _vm->_globals->_catalogSize = READ_LE_UINT32(pData + 19); matchFlag = true; } if (name == "FINIS") { - _vm->_globals.freeMemory(ptr); + _vm->_globals->freeMemory(ptr); return g_PTRNUL; } offsetVal += 23; } - _vm->_globals.freeMemory(ptr); + _vm->_globals->freeMemory(ptr); if (secondaryFilename != "") { if (!f.open(secondaryFilename)) error("CHARGE_FICHIER"); - f.seek(_vm->_globals._catalogPos); + f.seek(_vm->_globals->_catalogPos); - byte *catData = _vm->_globals.allocMemory(_vm->_globals._catalogSize); + byte *catData = _vm->_globals->allocMemory(_vm->_globals->_catalogSize); if (catData == g_PTRNUL) error("CHARGE_FICHIER"); - readStream(f, catData, _vm->_globals._catalogSize); + readStream(f, catData, _vm->_globals->_catalogSize); f.close(); result = catData; } else { diff --git a/engines/hopkins/font.cpp b/engines/hopkins/font.cpp index 7985597f22..4885ccd46e 100644 --- a/engines/hopkins/font.cpp +++ b/engines/hopkins/font.cpp @@ -40,12 +40,12 @@ FontManager::FontManager(HopkinsEngine *vm) { } FontManager::~FontManager() { - _vm->_globals.freeMemory(_font); - _vm->_globals.freeMemory(_zoneText); + _vm->_globals->freeMemory(_font); + _vm->_globals->freeMemory(_zoneText); } void FontManager::loadZoneText() { - switch (_vm->_globals._language) { + switch (_vm->_globals->_language) { case LANG_EN: _zoneText = _vm->_fileManager->loadFile("ZONEAN.TXT"); break; @@ -103,7 +103,7 @@ void FontManager::showText(int idx) { txt._textOnFl = true; txt._textLoadedFl = false; - txt._textBlock = _vm->_globals.freeMemory(txt._textBlock); + txt._textBlock = _vm->_globals->freeMemory(txt._textBlock); } /** @@ -116,7 +116,7 @@ void FontManager::hideText(int idx) { TxtItem &txt = _text[idx - 5]; txt._textOnFl = false; txt._textLoadedFl = false; - txt._textBlock = _vm->_globals.freeMemory(txt._textBlock); + txt._textBlock = _vm->_globals->freeMemory(txt._textBlock); } /** @@ -160,7 +160,7 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in error("Bad number for text"); _fontFixedWidth = 11; - _vm->_globals._boxWidth = 11 * _text[idx]._length; + _vm->_globals->_boxWidth = 11 * _text[idx]._length; if (_text[idx]._textLoadedFl) { int textType = _text[idx]._textType; if (textType != 6 && textType != 1 && textType != 3 && textType != 5) { @@ -211,7 +211,7 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in bufSize = 2048; f.seek(_index[messageId]); - _tempText = _vm->_globals.allocMemory(2058); + _tempText = _vm->_globals->allocMemory(2058); if (_tempText == g_PTRNUL) error("Error allocating text"); @@ -220,7 +220,7 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in f.close(); } else { bufSize = 100; - _tempText = _vm->_globals.allocMemory(110); + _tempText = _vm->_globals->allocMemory(110); Common::fill(&_tempText[0], &_tempText[110], 0); memcpy(_tempText, _zoneText + _index[messageId], 96); WRITE_LE_UINT16((uint16 *)_tempText + 48, READ_LE_INT16(_zoneText + _index[messageId] + 96)); @@ -254,29 +254,29 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in if (bufSize && bufSize > textLength) { _text[idx]._length = textLength; - _vm->_globals._boxWidth = 0; + _vm->_globals->_boxWidth = 0; for (int curStrIdx = 0; curStrIdx < textLength + 1; curStrIdx++) { byte curChar = _tempText[curStrIdx]; if (curChar <= 31) curChar = ' '; - _vm->_globals._boxWidth += _vm->_objectsManager.getWidth(_font, curChar - 32); + _vm->_globals->_boxWidth += _vm->_objectsManager.getWidth(_font, curChar - 32); } - _vm->_globals._boxWidth += 2; - _text[idx]._pos.x = 320 - abs(_vm->_globals._boxWidth / 2); + _vm->_globals->_boxWidth += 2; + _text[idx]._pos.x = 320 - abs(_vm->_globals->_boxWidth / 2); textPosX = _vm->_eventsManager->_startPos.x + _text[idx]._pos.x; lineCount = 1; _text[idx]._lines[0] = Common::String((const char *)_tempText, textLength); } else { - if (!_vm->_globals._boxWidth) - _vm->_globals._boxWidth = 240; + if (!_vm->_globals->_boxWidth) + _vm->_globals->_boxWidth = 240; int tempTextIdx = 0; int lineSize; byte curChar; do { int curLineSize = 0; - int ptrb = _vm->_globals._boxWidth - 4; + int ptrb = _vm->_globals->_boxWidth - 4; for (;;) { lineSize = curLineSize; do @@ -330,12 +330,12 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in for (int i = 0; i <= 19; i++) { if (_textSortArray[i]) - _vm->_globals._boxWidth = _textSortArray[i]; + _vm->_globals->_boxWidth = _textSortArray[i]; } if ((_text[idx]._textType < 2) || (_text[idx]._textType > 3)) { int i; - for (i = xp - _vm->_eventsManager->_startPos.x; _vm->_globals._boxWidth + i > 638 && i > -2 && _text[idx]._textType; i -= 2) + for (i = xp - _vm->_eventsManager->_startPos.x; _vm->_globals->_boxWidth + i > 638 && i > -2 && _text[idx]._textType; i -= 2) ; _text[idx]._pos.x = i; textPosX = _vm->_eventsManager->_startPos.x + i; @@ -345,7 +345,7 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in } int posX = textPosX; int posY = yp; - int saveWidth = _vm->_globals._boxWidth + 10; + int saveWidth = _vm->_globals->_boxWidth + 10; int saveHeight = (_fontFixedHeight + 1) * lineCount + 12; if (_text[idx]._textType == 6) { _text[idx]._pos.x = 315 - abs(saveWidth / 2); @@ -355,14 +355,14 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in int textType = _text[idx]._textType; if (textType == 1 || textType == 3 || textType == 5 || textType == 6) { int size = saveHeight * saveWidth; - byte *ptrd = _vm->_globals.allocMemory(size); + byte *ptrd = _vm->_globals->allocMemory(size); if (ptrd == g_PTRNUL) error("Cutting a block for text box (%d)", size); _vm->_graphicsManager.copySurfaceRect(_vm->_graphicsManager._vesaBuffer, ptrd, posX, posY, saveWidth, saveHeight); _vm->_graphicsManager.Trans_bloc2(ptrd, _vm->_graphicsManager._colorTable, size); _vm->_graphicsManager.restoreSurfaceRect(_vm->_graphicsManager._vesaBuffer, ptrd, posX, posY, saveWidth, saveHeight); - _vm->_globals.freeMemory(ptrd); + _vm->_globals->freeMemory(ptrd); _vm->_graphicsManager.drawHorizontalLine(_vm->_graphicsManager._vesaBuffer, posX, posY, saveWidth, (byte)-2); _vm->_graphicsManager.drawHorizontalLine(_vm->_graphicsManager._vesaBuffer, posX, saveHeight + posY, saveWidth, (byte)-2); @@ -384,9 +384,9 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in _text[idx]._height = blockHeight; textType = _text[idx]._textType; if (textType == 6 || textType == 1 || textType == 3 || textType == 5) { - _text[idx]._textBlock = _vm->_globals.freeMemory(_text[idx]._textBlock); + _text[idx]._textBlock = _vm->_globals->freeMemory(_text[idx]._textBlock); int blockSize = blockHeight * blockWidth; - byte *ptre = _vm->_globals.allocMemory(blockSize + 20); + byte *ptre = _vm->_globals->allocMemory(blockSize + 20); if (ptre == g_PTRNUL) error("Cutting a block for text box (%d)", blockSize); @@ -395,7 +395,7 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in _text[idx]._height = blockHeight; _vm->_graphicsManager.copySurfaceRect(_vm->_graphicsManager._vesaBuffer, _text[idx]._textBlock, posX, posY, _text[idx]._width, blockHeight); } - _tempText = _vm->_globals.freeMemory(_tempText); + _tempText = _vm->_globals->freeMemory(_tempText); } } @@ -478,12 +478,12 @@ void FontManager::renderTextDisplay(int xp, int yp, const Common::String &msg, i charEndPosX += charWidth; _vm->_graphicsManager.addDirtyRect(charStartPosX, yp, charEndPosX, yp + 12); if (_vm->_eventsManager->_escKeyFl) { - _vm->_globals.iRegul = 1; + _vm->_globals->iRegul = 1; _vm->_eventsManager->refreshScreenAndEvents(); } else { - _vm->_globals.iRegul = 4; + _vm->_globals->iRegul = 4; _vm->_eventsManager->refreshScreenAndEvents(); - _vm->_globals.iRegul = 1; + _vm->_globals->iRegul = 1; } } curChar = *srcP++; diff --git a/engines/hopkins/globals.cpp b/engines/hopkins/globals.cpp index 6c10807d8e..fb0dbf36c4 100644 --- a/engines/hopkins/globals.cpp +++ b/engines/hopkins/globals.cpp @@ -62,7 +62,9 @@ const int HOPKINS_PERSO_2[] = { 0, 2, 0, 2, 0, 2, 0, 1, 0, 2, 0, 2 }; -Globals::Globals() { +Globals::Globals(HopkinsEngine *vm) { + _vm = vm; + // Set up the special g_PTRNUL variable g_PTRNUL = (byte *)malloc(16); strcpy((char *)g_PTRNUL, "POINTERNULL"); @@ -187,10 +189,6 @@ Globals::~Globals() { free(g_PTRNUL); } -void Globals::setParent(HopkinsEngine *vm) { - _vm = vm; -} - void Globals::setConfig() { // CHECKME: Should be in Globals() but it doesn't work // The Polish version is a translation of the English version. The filenames are the same. diff --git a/engines/hopkins/globals.h b/engines/hopkins/globals.h index c0b71303eb..026b85caa3 100644 --- a/engines/hopkins/globals.h +++ b/engines/hopkins/globals.h @@ -314,9 +314,8 @@ public: int Compteur; int compteur_71; - Globals(); + Globals(HopkinsEngine *vm); ~Globals(); - void setParent(HopkinsEngine *vm); byte *allocMemory(int count); byte *freeMemory(byte *p); void setConfig(); diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp index 870599d164..4ae251fd49 100644 --- a/engines/hopkins/graphics.cpp +++ b/engines/hopkins/graphics.cpp @@ -78,9 +78,9 @@ GraphicsManager::GraphicsManager() { } GraphicsManager::~GraphicsManager() { - _vm->_globals.freeMemory(_vesaScreen); - _vm->_globals.freeMemory(_vesaBuffer); - _vm->_globals.freeMemory(_screenBuffer); + _vm->_globals->freeMemory(_vesaScreen); + _vm->_globals->freeMemory(_vesaBuffer); + _vm->_globals->freeMemory(_screenBuffer); } void GraphicsManager::setParent(HopkinsEngine *vm) { @@ -105,9 +105,9 @@ void GraphicsManager::setGraphicalMode(int width, int height) { initGraphics(width, height, true, &pixelFormat16); // Init surfaces - _vesaScreen = _vm->_globals.allocMemory(SCREEN_WIDTH * 2 * SCREEN_HEIGHT); - _vesaBuffer = _vm->_globals.allocMemory(SCREEN_WIDTH * 2 * SCREEN_HEIGHT); - _screenBuffer = _vm->_globals.allocMemory(SCREEN_WIDTH * 2 * SCREEN_HEIGHT); + _vesaScreen = _vm->_globals->allocMemory(SCREEN_WIDTH * 2 * SCREEN_HEIGHT); + _vesaBuffer = _vm->_globals->allocMemory(SCREEN_WIDTH * 2 * SCREEN_HEIGHT); + _screenBuffer = _vm->_globals->allocMemory(SCREEN_WIDTH * 2 * SCREEN_HEIGHT); _videoPtr = NULL; _screenWidth = width; @@ -312,7 +312,7 @@ void GraphicsManager::loadPCX640(byte *surface, const Common::String &file, byte // Load PCX from within the PIC resource if (!f.open("PIC.RES")) error("Error opening PIC.RES."); - f.seek(_vm->_globals._catalogPos); + f.seek(_vm->_globals->_catalogPos); } else { // Load stand alone PCX file if (!f.open(file)) @@ -345,7 +345,7 @@ void GraphicsManager::loadPCX320(byte *surface, const Common::String &file, byte f.read(surface, 128); int imageSize = filesize - 896; - byte *ptr = _vm->_globals.allocMemory(65024); + byte *ptr = _vm->_globals->allocMemory(65024); size_t curBufSize; int imageNumb; int imageDataSize; @@ -396,7 +396,7 @@ void GraphicsManager::loadPCX320(byte *surface, const Common::String &file, byte f.read(palette, 768); f.close(); - _vm->_globals.freeMemory(ptr); + _vm->_globals->freeMemory(ptr); } // Clear Palette @@ -1063,7 +1063,7 @@ void GraphicsManager::Sprite_Vesa(byte *surface, const byte *spriteData, int xp, void GraphicsManager::endDisplayBob() { for (int idx = 1; idx <= 20; ++idx) { - if (_vm->_globals._animBqe[idx]._enabledFl) + if (_vm->_globals->_animBqe[idx]._enabledFl) _vm->_objectsManager.hideBob(idx); } @@ -1071,22 +1071,22 @@ void GraphicsManager::endDisplayBob() { _vm->_eventsManager->refreshScreenAndEvents(); for (int idx = 1; idx <= 20; ++idx) { - if (_vm->_globals._animBqe[idx]._enabledFl) + if (_vm->_globals->_animBqe[idx]._enabledFl) _vm->_objectsManager.resetBob(idx); } for (int idx = 1; idx <= 29; ++idx) { - _vm->_globals._lockedAnims[idx]._enableFl = false; + _vm->_globals->_lockedAnims[idx]._enableFl = false; } for (int idx = 1; idx <= 20; ++idx) { - _vm->_globals._animBqe[idx]._enabledFl = false; + _vm->_globals->_animBqe[idx]._enabledFl = false; } } void GraphicsManager::displayAllBob() { for (int idx = 1; idx <= 20; ++idx) { - if (_vm->_globals._animBqe[idx]._enabledFl) + if (_vm->_globals->_animBqe[idx]._enabledFl) _vm->_objectsManager.displayBob(idx); } } @@ -1747,13 +1747,13 @@ void GraphicsManager::initScreen(const Common::String &file, int mode, bool init } if (!mode) { filename = file + ".spr"; - _vm->_globals.SPRITE_ECRAN = _vm->_globals.freeMemory(_vm->_globals.SPRITE_ECRAN); + _vm->_globals->SPRITE_ECRAN = _vm->_globals->freeMemory(_vm->_globals->SPRITE_ECRAN); if (initializeScreen) { - _vm->_globals.SPRITE_ECRAN = _vm->_fileManager->searchCat(filename, RES_SLI); - if (_vm->_globals.SPRITE_ECRAN) { - _vm->_globals.SPRITE_ECRAN = _vm->_fileManager->loadFile(filename); + _vm->_globals->SPRITE_ECRAN = _vm->_fileManager->searchCat(filename, RES_SLI); + if (_vm->_globals->SPRITE_ECRAN) { + _vm->_globals->SPRITE_ECRAN = _vm->_fileManager->loadFile(filename); } else { - _vm->_globals.SPRITE_ECRAN = _vm->_fileManager->loadFile("RES_SLI.RES"); + _vm->_globals->SPRITE_ECRAN = _vm->_fileManager->loadFile("RES_SLI.RES"); } } } @@ -1780,15 +1780,15 @@ void GraphicsManager::initScreen(const Common::String &file, int mode, bool init doneFlag = true; } while (!doneFlag); } - _vm->_globals.freeMemory(ptr); - _vm->_globals._answerBuffer = _vm->_globals.freeMemory(_vm->_globals._answerBuffer); + _vm->_globals->freeMemory(ptr); + _vm->_globals->_answerBuffer = _vm->_globals->freeMemory(_vm->_globals->_answerBuffer); filename = file + ".rep"; byte *dataP = _vm->_fileManager->searchCat(filename, RES_REP); if (dataP == g_PTRNUL) dataP = _vm->_fileManager->loadFile(filename); - _vm->_globals._answerBuffer = dataP; + _vm->_globals->_answerBuffer = dataP; _vm->_objectsManager._forceZoneFl = true; _vm->_objectsManager._changeVerbFl = false; } diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp index 1742294cdb..01c67f6430 100644 --- a/engines/hopkins/hopkins.cpp +++ b/engines/hopkins/hopkins.cpp @@ -47,8 +47,8 @@ HopkinsEngine::HopkinsEngine(OSystem *syst, const HopkinsGameDescription *gameDe _eventsManager = new EventsManager(this); _fileManager = new FileManager(this); _fontManager = new FontManager(this); + _globals = new Globals(this); - _globals.setParent(this); _graphicsManager.setParent(this); _linesManager.setParent(this); _menuManager.setParent(this); @@ -60,6 +60,7 @@ HopkinsEngine::HopkinsEngine(OSystem *syst, const HopkinsGameDescription *gameDe } HopkinsEngine::~HopkinsEngine() { + delete _globals; delete _fontManager; delete _fileManager; delete _eventsManager; @@ -77,14 +78,14 @@ Common::String HopkinsEngine::generateSaveName(int slot) { * Returns true if it is currently okay to restore a game */ bool HopkinsEngine::canLoadGameStateCurrently() { - return !_globals._exitId && !_globals._cityMapEnabledFl && _eventsManager->_mouseFl; + return !_globals->_exitId && !_globals->_cityMapEnabledFl && _eventsManager->_mouseFl; } /** * Returns true if it is currently okay to save the game */ bool HopkinsEngine::canSaveGameStateCurrently() { - return !_globals._exitId && !_globals._cityMapEnabledFl && _eventsManager->_mouseFl; + return !_globals->_exitId && !_globals->_cityMapEnabledFl && _eventsManager->_mouseFl; } /** @@ -104,7 +105,7 @@ Common::Error HopkinsEngine::saveGameState(int slot, const Common::String &desc) Common::Error HopkinsEngine::run() { _saveLoadManager.initSaves(); - _globals.setConfig(); + _globals->setConfig(); _fileManager->initCensorship(); initializeSystem(); @@ -123,12 +124,12 @@ Common::Error HopkinsEngine::run() { } bool HopkinsEngine::runWin95Demo() { - _globals.loadObjects(); + _globals->loadObjects(); _objectsManager.changeObject(14); _objectsManager.addObject(14); _objectsManager._helicopterFl = false; - _globals.iRegul = 1; + _globals->iRegul = 1; _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -142,39 +143,39 @@ bool HopkinsEngine::runWin95Demo() { playIntro(); _eventsManager->_rateCounter = 0; - _globals.iRegul = 1; - _globals._speed = 1; + _globals->iRegul = 1; + _globals->_speed = 1; for (int i = 1; i < 50; i++) { _graphicsManager.copySurface(_graphicsManager._vesaScreen, 0, 0, 640, 440, _graphicsManager._vesaBuffer, 0, 0); _eventsManager->refreshScreenAndEvents(); } - _globals.iRegul = 0; + _globals->iRegul = 0; if (_eventsManager->_rateCounter > 475) - _globals._speed = 2; + _globals->_speed = 2; if (_eventsManager->_rateCounter > 700) - _globals._speed = 3; + _globals->_speed = 3; _graphicsManager.fadeOutLong(); - _globals.iRegul = 1; - _globals.PERSO = _fileManager->loadFile("PERSO.SPR"); - _globals._characterType = 0; + _globals->iRegul = 1; + _globals->PERSO = _fileManager->loadFile("PERSO.SPR"); + _globals->_characterType = 0; _objectsManager._mapCarPosX = _objectsManager._mapCarPosY = 0; - memset(_globals._saveData, 0, 2000); - _globals._exitId = 0; + memset(_globals->_saveData, 0, 2000); + _globals->_exitId = 0; if (getLanguage() != Common::PL_POL) if (!displayAdultDisclaimer()) return Common::kNoError; for (;;) { - if (_globals._exitId == 300) - _globals._exitId = 0; + if (_globals->_exitId == 300) + _globals->_exitId = 0; - if (!_globals._exitId) { - _globals._exitId = _menuManager.menu(); - if (_globals._exitId == -1) { - _globals.PERSO = _globals.freeMemory(_globals.PERSO); + if (!_globals->_exitId) { + _globals->_exitId = _menuManager.menu(); + if (_globals->_exitId == -1) { + _globals->PERSO = _globals->freeMemory(_globals->PERSO); restoreSystem(); return false; } @@ -183,36 +184,36 @@ bool HopkinsEngine::runWin95Demo() { if (shouldQuit()) return false; - switch (_globals._exitId) { + switch (_globals->_exitId) { case 1: _linesManager.setMaxLineIdx(40); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM01", "IM01", "ANIM01", "IM01", 2, true); break; case 3: - if (!_globals._saveData->_data[svBankAttackAnimPlayedFl]) { + if (!_globals->_saveData->_data[svBankAttackAnimPlayedFl]) { _soundManager.playSound(3); if (getPlatform() == Common::kPlatformOS2 || getPlatform() == Common::kPlatformBeOS) _graphicsManager.loadImage("fond"); else { - if (_globals._language == LANG_FR) + if (_globals->_language == LANG_FR) _graphicsManager.loadImage("fondfr"); - else if (_globals._language == LANG_EN) + else if (_globals->_language == LANG_EN) _graphicsManager.loadImage("fondan"); - else if (_globals._language == LANG_SP) + else if (_globals->_language == LANG_SP) _graphicsManager.loadImage("fondes"); } _graphicsManager.fadeInLong(); _eventsManager->delay(500); _graphicsManager.fadeOutLong(); - _globals.iRegul = 1; + _globals->iRegul = 1; _soundManager._specialSoundNum = 2; _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); _graphicsManager.unlockScreen(); _graphicsManager.clearPalette(); - if (!_globals._censorshipFl) + if (!_globals->_censorshipFl) _animationManager->playAnim("BANQUE.ANM", 200, 28, 200); else _animationManager->playAnim("BANKUK.ANM", 200, 28, 200); @@ -222,25 +223,25 @@ bool HopkinsEngine::runWin95Demo() { _soundManager.removeSample(3); _soundManager.removeSample(4); _graphicsManager.fadeOutLong(); - _globals._saveData->_data[svBankAttackAnimPlayedFl] = 1; + _globals->_saveData->_data[svBankAttackAnimPlayedFl] = 1; } _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 450; + _globals->_characterMaxPosY = 450; _objectsManager.PERSONAGE2("IM03", "IM03", "ANIM03", "IM03", 2, false); break; case 4: - _globals._disableInventFl = true; + _globals->_disableInventFl = true; _objectsManager.handleCityMap(); - _globals._disableInventFl = false; + _globals->_disableInventFl = false; break; case 5: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 455; + _globals->_characterMaxPosY = 455; - if (_globals._saveData->_data[svFreedHostageFl]) { - if (_globals._saveData->_data[svFreedHostageFl] == 1) + if (_globals->_saveData->_data[svFreedHostageFl]) { + if (_globals->_saveData->_data[svFreedHostageFl] == 1) _objectsManager.PERSONAGE2("IM05", "IM05A", "ANIM05B", "IM05", 3, false); } else { _objectsManager.PERSONAGE2("IM05", "IM05", "ANIM05", "IM05", 3, false); @@ -249,12 +250,12 @@ bool HopkinsEngine::runWin95Demo() { case 6: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 460; + _globals->_characterMaxPosY = 460; _objectsManager.PERSONAGE2("IM06", "IM06", "ANIM06", "IM06", 2, true); break; case 7: - if (_globals._saveData->_data[svBombBoxOpenedFl]) + if (_globals->_saveData->_data[svBombBoxOpenedFl]) _objectsManager.PERSONAGE("BOMBEB", "BOMBE", "BOMBE", "BOMBE", 2, true); else _objectsManager.PERSONAGE("BOMBEA", "BOMBE", "BOMBE", "BOMBE", 2, true); @@ -262,14 +263,14 @@ bool HopkinsEngine::runWin95Demo() { case 8: _linesManager.setMaxLineIdx(15); - _globals._characterMaxPosY = 450; + _globals->_characterMaxPosY = 450; _objectsManager.PERSONAGE2("IM08", "IM08", "ANIM08", "IM08", 2, true); break; case 9: - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _linesManager.setMaxLineIdx(20); - if (_globals._saveData->_data[svBombDisarmedFl]) + if (_globals->_saveData->_data[svBombDisarmedFl]) _objectsManager.PERSONAGE2("IM09", "IM09", "ANIM09", "IM09", 10, true); else bombExplosion(); @@ -281,15 +282,15 @@ bool HopkinsEngine::runWin95Demo() { case 11: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 450; + _globals->_characterMaxPosY = 450; _objectsManager.PERSONAGE2("IM11", "IM11", "ANIM11", "IM11", 2, false); break; case 12: - _globals._characterMaxPosY = 450; + _globals->_characterMaxPosY = 450; _linesManager.setMaxLineIdx(20); - if (_globals._saveData->_data[svBombDisarmedFl]) { - if (_globals._language == LANG_FR) + if (_globals->_saveData->_data[svBombDisarmedFl]) { + if (_globals->_language == LANG_FR) _graphicsManager.loadImage("ENDFR"); else _graphicsManager.loadImage("ENDUK"); @@ -338,11 +339,11 @@ bool HopkinsEngine::runWin95Demo() { break; case 113: - _globals._exitId = 0; - _globals._prevScreenId = _globals._screenId; - _globals._saveData->_data[svLastPrevScreenId] = _globals._screenId; - _globals._screenId = 113; - _globals._saveData->_data[svLastScreenId] = _globals._screenId; + _globals->_exitId = 0; + _globals->_prevScreenId = _globals->_screenId; + _globals->_saveData->_data[svLastPrevScreenId] = _globals->_screenId; + _globals->_screenId = 113; + _globals->_saveData->_data[svLastScreenId] = _globals->_screenId; _computerManager->showComputer(COMPUTER_HOPKINS); _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -355,11 +356,11 @@ bool HopkinsEngine::runWin95Demo() { break; case 114: - _globals._prevScreenId = _globals._screenId; - _globals._saveData->_data[svLastPrevScreenId] = _globals._screenId; - _globals._screenId = 114; - _globals._saveData->_data[svLastScreenId] = _globals._screenId; - _globals._exitId = 0; + _globals->_prevScreenId = _globals->_screenId; + _globals->_saveData->_data[svLastPrevScreenId] = _globals->_screenId; + _globals->_screenId = 114; + _globals->_saveData->_data[svLastScreenId] = _globals->_screenId; + _globals->_exitId = 0; _computerManager->showComputer(COMPUTER_SAMANTHA); _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -367,11 +368,11 @@ bool HopkinsEngine::runWin95Demo() { break; case 115: - _globals._exitId = 0; - _globals._prevScreenId = _globals._screenId; - _globals._saveData->_data[svLastPrevScreenId] = _globals._screenId; - _globals._screenId = 115; - _globals._saveData->_data[svLastScreenId] = _globals._screenId; + _globals->_exitId = 0; + _globals->_prevScreenId = _globals->_screenId; + _globals->_saveData->_data[svLastPrevScreenId] = _globals->_screenId; + _globals->_screenId = 115; + _globals->_saveData->_data[svLastScreenId] = _globals->_screenId; _computerManager->showComputer(COMPUTER_PUBLIC); _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -380,19 +381,19 @@ bool HopkinsEngine::runWin95Demo() { case 150: _soundManager.playSound(28); - _globals.iRegul = 4; // CHECKME! + _globals->iRegul = 4; // CHECKME! _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); _graphicsManager.unlockScreen(); _graphicsManager.clearPalette(); _animationManager->playAnim("JOUR1A.anm", 12, 12, 2000); - _globals.iRegul = 0; - _globals._exitId = 300; + _globals->iRegul = 0; + _globals->_exitId = 300; break; case 151: _soundManager.playSound(28); - _globals.iRegul = 4; // CHECKME! + _globals->iRegul = 4; // CHECKME! _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); _graphicsManager.unlockScreen(); @@ -401,20 +402,20 @@ bool HopkinsEngine::runWin95Demo() { _graphicsManager.fadeInLong(); _eventsManager->delay(5000); _graphicsManager.fadeOutLong(); - _globals._exitId = 300; - _globals.iRegul = 0; + _globals->_exitId = 300; + _globals->iRegul = 0; break; case 152: _soundManager.playSound(28); - _globals.iRegul = 4; // CHECKME! + _globals->iRegul = 4; // CHECKME! _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); _graphicsManager.unlockScreen(); _graphicsManager.clearPalette(); _animationManager->playAnim("JOUR4A.anm", 12, 12, 2000); - _globals.iRegul = 0; - _globals._exitId = 300; + _globals->iRegul = 0; + _globals->_exitId = 300; break; } } @@ -422,7 +423,7 @@ bool HopkinsEngine::runWin95Demo() { } bool HopkinsEngine::runLinuxDemo() { - _globals.loadObjects(); + _globals->loadObjects(); _objectsManager.changeObject(14); _objectsManager.addObject(14); _objectsManager._helicopterFl = false; @@ -446,23 +447,23 @@ bool HopkinsEngine::runLinuxDemo() { if (!_eventsManager->_escKeyFl) playIntro(); - _globals.iRegul = 0; - _globals.PERSO = _fileManager->loadFile("PERSO.SPR"); - _globals._characterType = 0; + _globals->iRegul = 0; + _globals->PERSO = _fileManager->loadFile("PERSO.SPR"); + _globals->_characterType = 0; _objectsManager._mapCarPosX = _objectsManager._mapCarPosY = 0; - memset(_globals._saveData, 0, 2000); - _globals._exitId = 0; + memset(_globals->_saveData, 0, 2000); + _globals->_exitId = 0; for (;;) { - if (_globals._exitId == 300) - _globals._exitId = 0; + if (_globals->_exitId == 300) + _globals->_exitId = 0; - if (!_globals._exitId) { - _globals._exitId = _menuManager.menu(); - if (_globals._exitId == -1) { + if (!_globals->_exitId) { + _globals->_exitId = _menuManager.menu(); + if (_globals->_exitId == -1) { if (!shouldQuit()) endLinuxDemo(); - _globals.PERSO = _globals.freeMemory(_globals.PERSO); + _globals->PERSO = _globals->freeMemory(_globals->PERSO); restoreSystem(); } } @@ -470,7 +471,7 @@ bool HopkinsEngine::runLinuxDemo() { if (shouldQuit()) return false; - switch (_globals._exitId) { + switch (_globals->_exitId) { case 17: case 18: case 19: @@ -491,27 +492,27 @@ bool HopkinsEngine::runLinuxDemo() { case 1: _linesManager.setMaxLineIdx(40); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM01", "IM01", "ANIM01", "IM01", 1, true); break; case 3: - if (!_globals._saveData->_data[svBankAttackAnimPlayedFl]) { + if (!_globals->_saveData->_data[svBankAttackAnimPlayedFl]) { _soundManager.playSound(3); if (getPlatform() == Common::kPlatformOS2 || getPlatform() == Common::kPlatformBeOS) _graphicsManager.loadImage("fond"); else { - if (_globals._language == LANG_FR) + if (_globals->_language == LANG_FR) _graphicsManager.loadImage("fondfr"); - else if (_globals._language == LANG_EN) + else if (_globals->_language == LANG_EN) _graphicsManager.loadImage("fondan"); - else if (_globals._language == LANG_SP) + else if (_globals->_language == LANG_SP) _graphicsManager.loadImage("fondes"); } _graphicsManager.fadeInLong(); _eventsManager->delay(500); _graphicsManager.fadeOutLong(); - _globals.iRegul = 1; + _globals->iRegul = 1; _soundManager._specialSoundNum = 2; _graphicsManager.lockScreen(); @@ -520,7 +521,7 @@ bool HopkinsEngine::runLinuxDemo() { _graphicsManager.clearPalette(); _graphicsManager.FADE_LINUX = 2; - if (!_globals._censorshipFl) + if (!_globals->_censorshipFl) _animationManager->playAnim("BANQUE.ANM", 200, 28, 200); else _animationManager->playAnim("BANKUK.ANM", 200, 28, 200); @@ -529,24 +530,24 @@ bool HopkinsEngine::runLinuxDemo() { _soundManager.removeSample(2); _soundManager.removeSample(3); _soundManager.removeSample(4); - _globals._saveData->_data[svBankAttackAnimPlayedFl] = 1; + _globals->_saveData->_data[svBankAttackAnimPlayedFl] = 1; } _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 450; + _globals->_characterMaxPosY = 450; _objectsManager.PERSONAGE2("IM03", "IM03", "ANIM03", "IM03", 2, false); break; case 4: - _globals._disableInventFl = true; + _globals->_disableInventFl = true; _objectsManager.handleCityMap(); - _globals._disableInventFl = false; + _globals->_disableInventFl = false; break; case 5: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 455; - if (_globals._saveData->_data[svFreedHostageFl] == 1) + _globals->_characterMaxPosY = 455; + if (_globals->_saveData->_data[svFreedHostageFl] == 1) _objectsManager.PERSONAGE2("IM05", "IM05A", "ANIM05B", "IM05", 3, false); else _objectsManager.PERSONAGE2("IM05", "IM05", "ANIM05", "IM05", 3, false); @@ -554,12 +555,12 @@ bool HopkinsEngine::runLinuxDemo() { case 6: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 460; + _globals->_characterMaxPosY = 460; _objectsManager.PERSONAGE2("IM06", "IM06", "ANIM06", "IM06", 2, true); break; case 7: - if (_globals._saveData->_data[svBombBoxOpenedFl]) + if (_globals->_saveData->_data[svBombBoxOpenedFl]) _objectsManager.PERSONAGE("BOMBEB", "BOMBE", "BOMBE", "BOMBE", 2, true); else _objectsManager.PERSONAGE("BOMBEA", "BOMBE", "BOMBE", "BOMBE", 2, true); @@ -567,15 +568,15 @@ bool HopkinsEngine::runLinuxDemo() { case 8: _linesManager.setMaxLineIdx(15); - _globals._characterMaxPosY = 450; + _globals->_characterMaxPosY = 450; _objectsManager.PERSONAGE2("IM08", "IM08", "ANIM08", "IM08", 2, true); break; case 9: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; - if (!_globals._saveData->_data[svBombDisarmedFl]) + if (!_globals->_saveData->_data[svBombDisarmedFl]) bombExplosion(); else _objectsManager.PERSONAGE2("IM09", "IM09", "ANIM09", "IM09", 10, true); @@ -587,14 +588,14 @@ bool HopkinsEngine::runLinuxDemo() { case 11: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 450; + _globals->_characterMaxPosY = 450; _objectsManager.PERSONAGE2("IM11", "IM11", "ANIM11", "IM11", 2, false); break; case 12: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 450; - if (_globals._saveData->_data[svBombDisarmedFl]) + _globals->_characterMaxPosY = 450; + if (_globals->_saveData->_data[svBombDisarmedFl]) _objectsManager.PERSONAGE2("IM12", "IM12", "ANIM12", "IM12", 1, false); else bombExplosion(); @@ -602,13 +603,13 @@ bool HopkinsEngine::runLinuxDemo() { case 13: _linesManager.setMaxLineIdx(40); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM13", "IM13", "ANIM13", "IM13", 1, true); break; case 14: _linesManager.setMaxLineIdx(40); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM14", "IM14", "ANIM14", "IM14", 1, true); break; @@ -618,24 +619,24 @@ bool HopkinsEngine::runLinuxDemo() { case 16: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 450; + _globals->_characterMaxPosY = 450; - if (_globals._saveData->_data[svForestAvailableFl] == 1) { + if (_globals->_saveData->_data[svForestAvailableFl] == 1) { _objectsManager.PERSONAGE2("IM16", "IM16A", "ANIM16", "IM16", 7, true); - } else if (!_globals._saveData->_data[svForestAvailableFl]) { + } else if (!_globals->_saveData->_data[svForestAvailableFl]) { _objectsManager.PERSONAGE2("IM16", "IM16", "ANIM16", "IM16", 7, true); } break; case 25: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 445; + _globals->_characterMaxPosY = 445; _objectsManager.PERSONAGE2("IM25", "IM25", "ANIM25", "IM25", 30, true); break; case 26: _linesManager.setMaxLineIdx(40); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM26", "IM26", "ANIM26", "IM26", 30, true); case 33: @@ -655,11 +656,11 @@ bool HopkinsEngine::runLinuxDemo() { break; case 113: - _globals._exitId = 0; - _globals._prevScreenId = _globals._screenId; - _globals._saveData->_data[svLastPrevScreenId] = _globals._screenId; - _globals._screenId = 113; - _globals._saveData->_data[svLastScreenId] = 113; + _globals->_exitId = 0; + _globals->_prevScreenId = _globals->_screenId; + _globals->_saveData->_data[svLastPrevScreenId] = _globals->_screenId; + _globals->_screenId = 113; + _globals->_saveData->_data[svLastScreenId] = 113; _computerManager->showComputer(COMPUTER_HOPKINS); _graphicsManager.lockScreen(); @@ -673,11 +674,11 @@ bool HopkinsEngine::runLinuxDemo() { break; case 114: - _globals._exitId = 0; - _globals._prevScreenId = _globals._screenId; - _globals._saveData->_data[svLastPrevScreenId] = _globals._screenId; - _globals._screenId = 114; - _globals._saveData->_data[svLastScreenId] = 114; + _globals->_exitId = 0; + _globals->_prevScreenId = _globals->_screenId; + _globals->_saveData->_data[svLastPrevScreenId] = _globals->_screenId; + _globals->_screenId = 114; + _globals->_saveData->_data[svLastScreenId] = 114; _computerManager->showComputer(COMPUTER_SAMANTHA); _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -685,11 +686,11 @@ bool HopkinsEngine::runLinuxDemo() { break; case 115: - _globals._exitId = 0; - _globals._prevScreenId = _globals._screenId; - _globals._saveData->_data[svLastPrevScreenId] = _globals._screenId; - _globals._screenId = 115; - _globals._saveData->_data[svLastScreenId] = 115; + _globals->_exitId = 0; + _globals->_prevScreenId = _globals->_screenId; + _globals->_saveData->_data[svLastPrevScreenId] = _globals->_screenId; + _globals->_screenId = 115; + _globals->_saveData->_data[svLastScreenId] = 115; _computerManager->showComputer(COMPUTER_PUBLIC); _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -698,7 +699,7 @@ bool HopkinsEngine::runLinuxDemo() { case 150: _soundManager.playSound(16); - _globals.iRegul = 1; + _globals->iRegul = 1; _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -706,13 +707,13 @@ bool HopkinsEngine::runLinuxDemo() { _graphicsManager.clearPalette(); _graphicsManager.FADE_LINUX = 2; _animationManager->playAnim("JOUR1A.anm", 12, 12, 2000); - _globals.iRegul = 0; - _globals._exitId = 300; + _globals->iRegul = 0; + _globals->_exitId = 300; break; case 151: _soundManager.playSound(16); - _globals.iRegul = 1; + _globals->iRegul = 1; _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -720,13 +721,13 @@ bool HopkinsEngine::runLinuxDemo() { _graphicsManager.clearPalette(); _graphicsManager.FADE_LINUX = 2; _animationManager->playAnim("JOUR3A.anm", 12, 12, 2000); - _globals.iRegul = 0; - _globals._exitId = 300; + _globals->iRegul = 0; + _globals->_exitId = 300; break; case 152: _soundManager.playSound(16); - _globals.iRegul = 1; + _globals->iRegul = 1; _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -734,8 +735,8 @@ bool HopkinsEngine::runLinuxDemo() { _graphicsManager.clearPalette(); _graphicsManager.FADE_LINUX = 2; _animationManager->playAnim("JOUR4A.anm", 12, 12, 2000); - _globals.iRegul = 0; - _globals._exitId = 300; + _globals->iRegul = 0; + _globals->_exitId = 300; break; } } @@ -746,7 +747,7 @@ bool HopkinsEngine::runFull() { if (getPlatform() == Common::kPlatformLinux) _soundManager.playSound(16); - _globals.loadObjects(); + _globals->loadObjects(); _objectsManager.changeObject(14); _objectsManager.addObject(14); @@ -757,7 +758,7 @@ bool HopkinsEngine::runFull() { // in my copy: it mentions a Win95 version v4 using DirectDraw (Strangerke) } else if (getPlatform() == Common::kPlatformWindows) { _objectsManager._helicopterFl = false; - _globals.iRegul = 1; + _globals->iRegul = 1; // This code displays the game version. // It wasn't present in the original and could be put in the debugger // It has been added there for debug purposes @@ -775,7 +776,7 @@ bool HopkinsEngine::runFull() { _graphicsManager.fadeOutLong(); _graphicsManager.clearVesaScreen(); - _globals.iRegul = 1; + _globals->iRegul = 1; } _graphicsManager.lockScreen(); @@ -789,8 +790,8 @@ bool HopkinsEngine::runFull() { _eventsManager->delay(500); _graphicsManager.fadeOutLong(); - _globals._speed = 2; - _globals.iRegul = 1; + _globals->_speed = 2; + _globals->iRegul = 1; _graphicsManager.FADE_LINUX = 2; _animationManager->playAnim("MP.ANM", 10, 16, 200); } else { @@ -810,21 +811,21 @@ bool HopkinsEngine::runFull() { _eventsManager->delay(500); _graphicsManager.fadeOutLong(); } - _globals.iRegul = 0; - _globals.PERSO = _fileManager->loadFile("PERSO.SPR"); - _globals._characterType = 0; + _globals->iRegul = 0; + _globals->PERSO = _fileManager->loadFile("PERSO.SPR"); + _globals->_characterType = 0; _objectsManager._mapCarPosX = _objectsManager._mapCarPosY = 0; - memset(_globals._saveData, 0, 2000); + memset(_globals->_saveData, 0, 2000); - _globals._exitId = 0; + _globals->_exitId = 0; for (;;) { - if (_globals._exitId == 300) - _globals._exitId = 0; - if (!_globals._exitId) { - _globals._exitId = _menuManager.menu(); - if (_globals._exitId == -1) { - _globals.PERSO = _globals.freeMemory(_globals.PERSO); + if (_globals->_exitId == 300) + _globals->_exitId = 0; + if (!_globals->_exitId) { + _globals->_exitId = _menuManager.menu(); + if (_globals->_exitId == -1) { + _globals->PERSO = _globals->freeMemory(_globals->PERSO); restoreSystem(); return false; } @@ -833,31 +834,31 @@ bool HopkinsEngine::runFull() { if (shouldQuit()) return false; - switch (_globals._exitId) { + switch (_globals->_exitId) { case 1: _linesManager.setMaxLineIdx(40); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM01", "IM01", "ANIM01", "IM01", 1, true); break; case 3: - if (!_globals._saveData->_data[svBankAttackAnimPlayedFl]) { + if (!_globals->_saveData->_data[svBankAttackAnimPlayedFl]) { // Play the bank attack animation _soundManager.playSound(3); if (getPlatform() == Common::kPlatformOS2 || getPlatform() == Common::kPlatformBeOS) _graphicsManager.loadImage("fond"); else { - if (_globals._language == LANG_FR) + if (_globals->_language == LANG_FR) _graphicsManager.loadImage("fondfr"); - else if (_globals._language == LANG_EN) + else if (_globals->_language == LANG_EN) _graphicsManager.loadImage("fondan"); - else if (_globals._language == LANG_SP) + else if (_globals->_language == LANG_SP) _graphicsManager.loadImage("fondes"); } _graphicsManager.fadeInLong(); _eventsManager->delay(500); _graphicsManager.fadeOutLong(); - _globals.iRegul = 1; + _globals->iRegul = 1; _soundManager._specialSoundNum = 2; _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -867,7 +868,7 @@ bool HopkinsEngine::runFull() { if (getPlatform() == Common::kPlatformLinux) _graphicsManager.FADE_LINUX = 2; - if (!_globals._censorshipFl) + if (!_globals->_censorshipFl) _animationManager->playAnim("BANQUE.ANM", 200, 28, 200); else _animationManager->playAnim("BANKUK.ANM", 200, 28, 200); @@ -888,23 +889,23 @@ bool HopkinsEngine::runFull() { _graphicsManager.fadeOutLong(); } - _globals._saveData->_data[svBankAttackAnimPlayedFl] = 1; + _globals->_saveData->_data[svBankAttackAnimPlayedFl] = 1; } _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 450; + _globals->_characterMaxPosY = 450; _objectsManager.PERSONAGE2("IM03", "IM03", "ANIM03", "IM03", 2, false); break; case 4: - _globals._disableInventFl = true; + _globals->_disableInventFl = true; _objectsManager.handleCityMap(); - _globals._disableInventFl = false; + _globals->_disableInventFl = false; break; case 5: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 455; - if (_globals._saveData->_data[svFreedHostageFl] == 1) + _globals->_characterMaxPosY = 455; + if (_globals->_saveData->_data[svFreedHostageFl] == 1) _objectsManager.PERSONAGE2("IM05", "IM05A", "ANIM05B", "IM05", 3, false); else _objectsManager.PERSONAGE2("IM05", "IM05", "ANIM05", "IM05", 3, false); @@ -912,12 +913,12 @@ bool HopkinsEngine::runFull() { case 6: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 460; + _globals->_characterMaxPosY = 460; _objectsManager.PERSONAGE2("IM06", "IM06", "ANIM06", "IM06", 2, true); break; case 7: - if (_globals._saveData->_data[svBombBoxOpenedFl]) + if (_globals->_saveData->_data[svBombBoxOpenedFl]) _objectsManager.PERSONAGE("BOMBEB", "BOMBE", "BOMBE", "BOMBE", 2, true); else _objectsManager.PERSONAGE("BOMBEA", "BOMBE", "BOMBE", "BOMBE", 2, true); @@ -925,14 +926,14 @@ bool HopkinsEngine::runFull() { case 8: _linesManager.setMaxLineIdx(15); - _globals._characterMaxPosY = 450; + _globals->_characterMaxPosY = 450; _objectsManager.PERSONAGE2("IM08", "IM08", "ANIM08", "IM08", 2, true); break; case 9: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 440; - if (_globals._saveData->_data[svBombDisarmedFl]) + _globals->_characterMaxPosY = 440; + if (_globals->_saveData->_data[svBombDisarmedFl]) _objectsManager.PERSONAGE2("IM09", "IM09", "ANIM09", "IM09", 10, true); else bombExplosion(); @@ -944,14 +945,14 @@ bool HopkinsEngine::runFull() { case 11: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 450; + _globals->_characterMaxPosY = 450; _objectsManager.PERSONAGE2("IM11", "IM11", "ANIM11", "IM11", 2, false); break; case 12: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 450; - if (_globals._saveData->_data[svBombDisarmedFl]) + _globals->_characterMaxPosY = 450; + if (_globals->_saveData->_data[svBombDisarmedFl]) _objectsManager.PERSONAGE2("IM12", "IM12", "ANIM12", "IM12", 1, false); else bombExplosion(); @@ -959,13 +960,13 @@ bool HopkinsEngine::runFull() { case 13: _linesManager.setMaxLineIdx(40); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM13", "IM13", "ANIM13", "IM13", 1, true); break; case 14: _linesManager.setMaxLineIdx(40); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM14", "IM14", "ANIM14", "IM14", 1, true); break; @@ -978,8 +979,8 @@ bool HopkinsEngine::runFull() { case 16: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 450; - if (_globals._saveData->_data[svForestAvailableFl] == 1) + _globals->_characterMaxPosY = 450; + if (_globals->_saveData->_data[svForestAvailableFl] == 1) _objectsManager.PERSONAGE2("IM16", "IM16A", "ANIM16", "IM16", 7, true); else _objectsManager.PERSONAGE2("IM16", "IM16", "ANIM16", "IM16", 7, true); @@ -987,13 +988,13 @@ bool HopkinsEngine::runFull() { case 17: _linesManager.setMaxLineIdx(40); - _globals._characterMaxPosY = 440; - if (_globals._saveData->_data[svHutBurningFl] == 1) + _globals->_characterMaxPosY = 440; + if (_globals->_saveData->_data[svHutBurningFl] == 1) _objectsManager.PERSONAGE2("IM17", "IM17A", "ANIM17", "IM17", 11, true); - else if (!_globals._saveData->_data[svHutBurningFl]) + else if (!_globals->_saveData->_data[svHutBurningFl]) _objectsManager.PERSONAGE2("IM17", "IM17", "ANIM17", "IM17", 11, true); - if (_globals._exitId == 18) { - _globals.iRegul = 1; + if (_globals->_exitId == 18) { + _globals->iRegul = 1; _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); _graphicsManager.unlockScreen(); @@ -1012,13 +1013,13 @@ bool HopkinsEngine::runFull() { _animationManager->playAnim("PURG1A.ANM", 12, 18, 50); _graphicsManager.fadeOutShort(); } - _globals.iRegul = 0; + _globals->iRegul = 0; } break; case 18: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 450; + _globals->_characterMaxPosY = 450; if (getPlatform() == Common::kPlatformLinux || getPlatform() == Common::kPlatformWindows) _objectsManager.PERSONAGE2("IM18", "IM18", "ANIM18", "IM18", 29, false); else @@ -1027,8 +1028,8 @@ bool HopkinsEngine::runFull() { case 19: _linesManager.setMaxLineIdx(40); - _globals._characterMaxPosY = 440; - if (_globals._saveData->_data[svHeavenGuardGoneFl]) + _globals->_characterMaxPosY = 440; + if (_globals->_saveData->_data[svHeavenGuardGoneFl]) _objectsManager.PERSONAGE2("IM19", "IM19A", "ANIM19", "IM19", 6, true); else _objectsManager.PERSONAGE2("IM19", "IM19", "ANIM19", "IM19", 6, true); @@ -1036,10 +1037,10 @@ bool HopkinsEngine::runFull() { case 20: _linesManager.setMaxLineIdx(10); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM20", "IM20", "ANIM20", "IM20", 6, true); - if (_globals._exitId == 17) { - _globals.iRegul = 1; + if (_globals->_exitId == 17) { + _globals->iRegul = 1; _soundManager.stopSound(); _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -1051,26 +1052,26 @@ bool HopkinsEngine::runFull() { _animationManager->playAnim("PURG2A.ANM", 12, 18, 50); if (getPlatform() != Common::kPlatformLinux) _graphicsManager.fadeOutShort(); - _globals.iRegul = 0; + _globals->iRegul = 0; } break; case 22: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 445; + _globals->_characterMaxPosY = 445; _objectsManager.PERSONAGE2("IM22", "IM22", "ANIM22", "IM22", 6, true); break; case 23: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM23", "IM23", "ANIM23", "IM23", 6, true); break; case 24: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 450; - if (_globals._saveData->_data[svCinemaDogGoneFl] == 1) + _globals->_characterMaxPosY = 450; + if (_globals->_saveData->_data[svCinemaDogGoneFl] == 1) _objectsManager.PERSONAGE2("IM24", "IM24A", "ANIM24", "IM24", 1, true); else _objectsManager.PERSONAGE2("IM24", "IM24", "ANIM24", "IM24", 1, true); @@ -1078,7 +1079,7 @@ bool HopkinsEngine::runFull() { case 25: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 445; + _globals->_characterMaxPosY = 445; if (getPlatform() == Common::kPlatformLinux || getPlatform() == Common::kPlatformWindows) _objectsManager.PERSONAGE2("IM25", "IM25", "ANIM25", "IM25", 30, true); else @@ -1087,7 +1088,7 @@ bool HopkinsEngine::runFull() { case 26: _linesManager.setMaxLineIdx(40); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; if (getPlatform() == Common::kPlatformLinux || getPlatform() == Common::kPlatformWindows) _objectsManager.PERSONAGE2("IM26", "IM26", "ANIM26", "IM26", 30, true); else @@ -1096,8 +1097,8 @@ bool HopkinsEngine::runFull() { case 27: _linesManager.setMaxLineIdx(15); - _globals._characterMaxPosY = 440; - if (_globals._saveData->_data[svPoolDogGoneFl] == 1) + _globals->_characterMaxPosY = 440; + if (_globals->_saveData->_data[svPoolDogGoneFl] == 1) _objectsManager.PERSONAGE2("IM27", "IM27A", "ANIM27", "IM27", 27, true); else _objectsManager.PERSONAGE2("IM27", "IM27", "ANIM27", "IM27", 27, true); @@ -1105,8 +1106,8 @@ bool HopkinsEngine::runFull() { case 28: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 450; - if (_globals._saveData->_data[svCinemaCurtainCond1] != 1 || _globals._saveData->_data[svCinemaCurtainCond2] != 1) + _globals->_characterMaxPosY = 450; + if (_globals->_saveData->_data[svCinemaCurtainCond1] != 1 || _globals->_saveData->_data[svCinemaCurtainCond2] != 1) _objectsManager.PERSONAGE2("IM28", "IM28", "ANIM28", "IM28", 1, false); else _objectsManager.PERSONAGE2("IM28A", "IM28", "ANIM28", "IM28", 1, false); @@ -1114,13 +1115,13 @@ bool HopkinsEngine::runFull() { case 29: _linesManager.setMaxLineIdx(50); - _globals._characterMaxPosY = 445; + _globals->_characterMaxPosY = 445; _objectsManager.PERSONAGE2("IM29", "IM29", "ANIM29", "IM29", 1, true); break; case 30: _linesManager.setMaxLineIdx(15); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM30", "IM30", "ANIM30", "IM30", 24, false); break; @@ -1130,7 +1131,7 @@ bool HopkinsEngine::runFull() { case 32: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 445; + _globals->_characterMaxPosY = 445; _objectsManager.PERSONAGE2("IM32", "IM32", "ANIM32", "IM32", 2, true); break; @@ -1150,18 +1151,18 @@ bool HopkinsEngine::runFull() { case 40: case 41: { _linesManager.setMaxLineIdx(40); - _globals._characterMaxPosY = 435; - _globals._disableInventFl = false; + _globals->_characterMaxPosY = 435; + _globals->_disableInventFl = false; _objectsManager._forestFl = true; - Common::String im = Common::String::format("IM%d", _globals._exitId); + Common::String im = Common::String::format("IM%d", _globals->_exitId); _soundManager.playSound(13); if (_objectsManager._forestSprite == g_PTRNUL) { _objectsManager._forestSprite = _objectsManager.loadSprite("HOPDEG.SPR"); _soundManager.loadSample(1, "SOUND41.WAV"); } _objectsManager.PERSONAGE2(im, im, "BANDIT", im, 13, false); - if (_globals._exitId < 35 || _globals._exitId > 49) { - _objectsManager._forestSprite = _globals.freeMemory(_objectsManager._forestSprite); + if (_globals->_exitId < 35 || _globals->_exitId > 49) { + _objectsManager._forestSprite = _globals->freeMemory(_objectsManager._forestSprite); _objectsManager._forestFl = false; _soundManager.removeSample(1); } @@ -1170,133 +1171,133 @@ bool HopkinsEngine::runFull() { case 50: playPlaneCutscene(); - _globals._exitId = 51; + _globals->_exitId = 51; break; case 51: _linesManager.setMaxLineIdx(10); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM51", "IM51", "ANIM51", "IM51", 14, true); break; case 52: _linesManager.setMaxLineIdx(15); - _globals._characterMaxPosY = 445; + _globals->_characterMaxPosY = 445; _objectsManager.PERSONAGE2("IM52", "IM52", "ANIM52", "IM52", 14, true); break; case 54: _linesManager.setMaxLineIdx(30); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM54", "IM54", "ANIM54", "IM54", 14, true); break; case 55: _linesManager.setMaxLineIdx(30); - _globals._characterMaxPosY = 460; + _globals->_characterMaxPosY = 460; _objectsManager.PERSONAGE2("IM55", "IM55", "ANIM55", "IM55", 14, false); break; case 56: _linesManager.setMaxLineIdx(30); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM56", "IM56", "ANIM56", "IM56", 14, false); break; case 57: _linesManager.setMaxLineIdx(30); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM57", "IM57", "ANIM57", "IM57", 14, true); break; case 58: _linesManager.setMaxLineIdx(30); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM58", "IM58", "ANIM58", "IM58", 14, false); break; case 59: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 445; + _globals->_characterMaxPosY = 445; _objectsManager.PERSONAGE2("IM59", "IM59", "ANIM59", "IM59", 21, false); break; case 60: _linesManager.setMaxLineIdx(30); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM60", "IM60", "ANIM60", "IM60", 21, false); break; case 61: - if (_globals._saveData->_data[svBaseElevatorCond1] == 1 && !_globals._saveData->_data[svBaseFireFl]) + if (_globals->_saveData->_data[svBaseElevatorCond1] == 1 && !_globals->_saveData->_data[svBaseFireFl]) handleConflagration(); _objectsManager.PERSONAGE("IM61", "IM61", "ANIM61", "IM61", 21, false); break; case 62: _linesManager.setMaxLineIdx(8); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM62", "IM62", NULL, "IM62", 21, false); break; case 63: _linesManager.setMaxLineIdx(30); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM63", "IM63", "ANIM63", "IM63", 21, false); break; case 64: _linesManager.setMaxLineIdx(30); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM64", "IM64", "ANIM64", "IM64", 21, true); break; case 65: _linesManager.setMaxLineIdx(30); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM65", "IM65", "ANIM65", "IM65", 21, false); break; case 66: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 445; + _globals->_characterMaxPosY = 445; _objectsManager.PERSONAGE2("IM66", "IM66", "ANIM66", "IM66", 21, false); break; case 67: _linesManager.setMaxLineIdx(8); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM67", "IM67", NULL, "IM67", 21, false); break; case 68: _linesManager.setMaxLineIdx(8); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM68", "IM68", "ANIM68", "IM68", 21, true); break; case 69: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 445; + _globals->_characterMaxPosY = 445; _objectsManager.PERSONAGE2("IM69", "IM69", "ANIM69", "IM69", 21, false); break; case 70: _linesManager.setMaxLineIdx(8); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM70", "IM70", NULL, "IM70", 21, false); break; case 71: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 445; + _globals->_characterMaxPosY = 445; _objectsManager.PERSONAGE2("IM71", "IM71", "ANIM71", "IM71", 21, false); break; case 73: _linesManager.setMaxLineIdx(15); - _globals._characterMaxPosY = 445; - if (_globals._saveData->_data[svSecondElevatorAvailableFl] == 1) + _globals->_characterMaxPosY = 445; + if (_globals->_saveData->_data[svSecondElevatorAvailableFl] == 1) _objectsManager.PERSONAGE2("IM73", "IM73A", "ANIM73", "IM73", 21, true); else _objectsManager.PERSONAGE2("IM73", "IM73", "ANIM73", "IM73", 21, true); @@ -1368,8 +1369,8 @@ bool HopkinsEngine::runFull() { case 93: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 445; - if (_globals._saveData->_data[svEscapeLeftJailFl]) { + _globals->_characterMaxPosY = 445; + if (_globals->_saveData->_data[svEscapeLeftJailFl]) { if (getPlatform() == Common::kPlatformLinux || getPlatform() == Common::kPlatformWindows) _objectsManager.PERSONAGE2("IM93", "IM93C", "ANIM93", "IM93", 29, true); else @@ -1384,28 +1385,28 @@ bool HopkinsEngine::runFull() { case 94: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM94", "IM94", "ANIM94", "IM94", 19, true); break; case 95: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM95", "IM95", "ANIM95", "IM95", 19, false); break; case 96: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM96", "IM96", "ANIM96", "IM96", 19, false); break; case 97: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM97", "IM97", "ANIM97", "IM97", 19, false); - if (_globals._exitId == 18) { - _globals.iRegul = 1; + if (_globals->_exitId == 18) { + _globals->iRegul = 1; _soundManager.stopSound(); _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -1414,19 +1415,19 @@ bool HopkinsEngine::runFull() { _soundManager.playSound(6); _animationManager->playAnim("PURG1A.ANM", 12, 18, 50); _graphicsManager.fadeOutShort(); - _globals.iRegul = 0; + _globals->iRegul = 0; } break; case 98: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM98", "IM98", "ANIM98", "IM98", 19, true); break; case 99: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM99", "IM99", "ANIM99", "IM99", 19, true); break; @@ -1443,11 +1444,11 @@ bool HopkinsEngine::runFull() { break; case 113: - _globals._prevScreenId = _globals._screenId; - _globals._screenId = 113; - _globals._saveData->_data[svLastPrevScreenId] = _globals._prevScreenId; - _globals._saveData->_data[svLastScreenId] = _globals._screenId; - _globals._exitId = 0; + _globals->_prevScreenId = _globals->_screenId; + _globals->_screenId = 113; + _globals->_saveData->_data[svLastPrevScreenId] = _globals->_prevScreenId; + _globals->_saveData->_data[svLastScreenId] = _globals->_screenId; + _globals->_exitId = 0; _computerManager->showComputer(COMPUTER_HOPKINS); _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -1460,11 +1461,11 @@ bool HopkinsEngine::runFull() { break; case 114: - _globals._exitId = 0; - _globals._prevScreenId = _globals._screenId; - _globals._screenId = 114; - _globals._saveData->_data[svLastPrevScreenId] = _globals._prevScreenId; - _globals._saveData->_data[svLastScreenId] = _globals._screenId; + _globals->_exitId = 0; + _globals->_prevScreenId = _globals->_screenId; + _globals->_screenId = 114; + _globals->_saveData->_data[svLastPrevScreenId] = _globals->_prevScreenId; + _globals->_saveData->_data[svLastScreenId] = _globals->_screenId; _computerManager->showComputer(COMPUTER_SAMANTHA); _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -1472,11 +1473,11 @@ bool HopkinsEngine::runFull() { break; case 115: - _globals._prevScreenId = _globals._screenId; - _globals._screenId = 115; - _globals._saveData->_data[svLastPrevScreenId] = _globals._prevScreenId; - _globals._saveData->_data[svLastScreenId] = _globals._screenId; - _globals._exitId = 0; + _globals->_prevScreenId = _globals->_screenId; + _globals->_screenId = 115; + _globals->_saveData->_data[svLastPrevScreenId] = _globals->_prevScreenId; + _globals->_saveData->_data[svLastScreenId] = _globals->_screenId; + _globals->_exitId = 0; _computerManager->showComputer(COMPUTER_PUBLIC); _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -1485,7 +1486,7 @@ bool HopkinsEngine::runFull() { case 150: _soundManager.playSound(16); - _globals.iRegul = 1; + _globals->iRegul = 1; _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); _graphicsManager.unlockScreen(); @@ -1493,13 +1494,13 @@ bool HopkinsEngine::runFull() { if (getPlatform() == Common::kPlatformLinux) _graphicsManager.FADE_LINUX = 2; _animationManager->playAnim("JOUR1A.ANM", 12, 12, 2000); - _globals.iRegul = 0; - _globals._exitId = 300; + _globals->iRegul = 0; + _globals->_exitId = 300; break; case 151: _soundManager.playSound(16); - _globals.iRegul = 1; + _globals->iRegul = 1; _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); _graphicsManager.unlockScreen(); @@ -1507,13 +1508,13 @@ bool HopkinsEngine::runFull() { if (getPlatform() == Common::kPlatformLinux) _graphicsManager.FADE_LINUX = 2; _animationManager->playAnim("JOUR3A.ANM", 12, 12, 2000); - _globals.iRegul = 0; - _globals._exitId = 300; + _globals->iRegul = 0; + _globals->_exitId = 300; break; case 152: _soundManager.playSound(16); - _globals.iRegul = 1; + _globals->iRegul = 1; _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); _graphicsManager.unlockScreen(); @@ -1521,8 +1522,8 @@ bool HopkinsEngine::runFull() { if (getPlatform() == Common::kPlatformLinux) _graphicsManager.FADE_LINUX = 2; _animationManager->playAnim("JOUR4A.ANM", 12, 12, 2000); - _globals.iRegul = 0; - _globals._exitId = 300; + _globals->iRegul = 0; + _globals->_exitId = 300; break; case 194: @@ -1531,21 +1532,21 @@ bool HopkinsEngine::runFull() { case 197: case 198: case 199: - _globals.PERSO = _globals.freeMemory(_globals.PERSO); - _globals.iRegul = 1; + _globals->PERSO = _globals->freeMemory(_globals->PERSO); + _globals->iRegul = 1; _soundManager.stopSound(); _soundManager.playSound(23); - _globals._exitId = handleBaseMap(); // Handles the base map (non-Windows) - //_globals._exitId = WBASE(); // Handles the 3D Doom level (Windows) + _globals->_exitId = handleBaseMap(); // Handles the base map (non-Windows) + //_globals->_exitId = WBASE(); // Handles the 3D Doom level (Windows) _soundManager.stopSound(); - _globals.PERSO = _fileManager->loadFile("PERSO.SPR"); - _globals._characterType = 0; - _globals.iRegul = 0; + _globals->PERSO = _fileManager->loadFile("PERSO.SPR"); + _globals->_characterType = 0; + _globals->iRegul = 0; _graphicsManager._lineNbr = SCREEN_WIDTH; break; } } - _globals.PERSO = _globals.freeMemory(_globals.PERSO); + _globals->PERSO = _globals->freeMemory(_globals->PERSO); restoreSystem(); return true; } @@ -1580,7 +1581,7 @@ void HopkinsEngine::initializeSystem() { SearchMan.addSubDirectoryMatching(gameDataDir, "VOICE"); SearchMan.addSubDirectoryMatching(gameDataDir, "TSVGA"); - _globals.clearAll(); + _globals->clearAll(); _eventsManager->initMouseData(); _fontManager->initData(); @@ -1591,7 +1592,7 @@ void HopkinsEngine::initializeSystem() { _eventsManager->setMouseOn(); _eventsManager->_mouseFl = false; - _globals.loadCharacterData(); + _globals->loadCharacterData(); _eventsManager->_mouseOffset.x = 0; _eventsManager->_mouseOffset.y = 0; @@ -1611,7 +1612,7 @@ void HopkinsEngine::playIntro() { memset(&paletteData, 0, PALETTE_EXT_BLOCK_SIZE); _eventsManager->refreshScreenAndEvents(); _eventsManager->_mouseFl = false; - _globals.iRegul = 1; + _globals->iRegul = 1; _eventsManager->refreshScreenAndEvents(); _soundManager.playSound(16); _animationManager->_clearAnimationFl = true; @@ -1648,7 +1649,7 @@ void HopkinsEngine::playIntro() { for (int i = 0; i <= 4; i++) _eventsManager->refreshScreenAndEvents(); - _globals.iRegul = 1; + _globals->iRegul = 1; _graphicsManager.fadeInLong(); if (_graphicsManager._largeScreenFl) { _graphicsManager._scrollStatus = 2; @@ -1693,9 +1694,9 @@ void HopkinsEngine::playIntro() { for (int i = 0; i <= 4; i++) _eventsManager->refreshScreenAndEvents(); - _globals.iRegul = 1; + _globals->iRegul = 1; _graphicsManager.fadeInLong(); - for (uint i = 0; i < 200 / _globals._speed; ++i) + for (uint i = 0; i < 200 / _globals->_speed; ++i) _eventsManager->refreshScreenAndEvents(); _objectsManager.setBobAnimation(3); @@ -1735,7 +1736,7 @@ void HopkinsEngine::playIntro() { for (int i = 0; i <= 3; i++) _eventsManager->refreshScreenAndEvents(); - _globals.iRegul = 1; + _globals->iRegul = 1; _graphicsManager.setPaletteVGA256WithRefresh(paletteData2, _graphicsManager._vesaBuffer); int introIndex = 0; @@ -1768,24 +1769,24 @@ void HopkinsEngine::playIntro() { introIndex += 2; if (introIndex > 15) { _graphicsManager.setPaletteVGA256WithRefresh(paletteData, _graphicsManager._vesaBuffer); - for (uint j = 1; j < 100 / _globals._speed; ++j) + for (uint j = 1; j < 100 / _globals->_speed; ++j) _eventsManager->refreshScreenAndEvents(); _objectsManager.setBobAnimation(3); _soundManager.mixVoice(7, 3); _objectsManager.stopBobAnimation(3); - for (uint k = 1; k < 60 / _globals._speed; ++k) + for (uint k = 1; k < 60 / _globals->_speed; ++k) _eventsManager->refreshScreenAndEvents(); _objectsManager.setBobAnimation(5); - for (uint l = 0; l < 20 / _globals._speed; ++l) + for (uint l = 0; l < 20 / _globals->_speed; ++l) _eventsManager->refreshScreenAndEvents(); Common::copy(&paletteData2[0], &paletteData2[PALETTE_BLOCK_SIZE], &_graphicsManager._palette[0]); _graphicsManager.setPaletteVGA256WithRefresh(_graphicsManager._palette, _graphicsManager._vesaBuffer); - for (uint m = 0; m < 50 / _globals._speed; ++m) { - if (m == 30 / _globals._speed) { + for (uint m = 0; m < 50 / _globals->_speed; ++m) { + if (m == 30 / _globals->_speed) { _objectsManager.setBobAnimation(3); _soundManager.mixVoice(8, 3); _objectsManager.stopBobAnimation(3); @@ -1829,7 +1830,7 @@ void HopkinsEngine::displayNotAvailable() { if (!getIsDemo()) return; - if (_globals._language == LANG_FR) + if (_globals->_language == LANG_FR) _graphicsManager.loadImage("ndfr"); else _graphicsManager.loadImage("nduk"); @@ -1841,19 +1842,19 @@ void HopkinsEngine::displayNotAvailable() { _soundManager.mixVoice(628, 4); _graphicsManager.fadeOutLong(); - _globals._exitId = 4; + _globals->_exitId = 4; } void HopkinsEngine::handleNotAvailable(int sortie) { // Use the code of the linux demo instead of the code of the Windows demo. // The behavior is somewhat better, and common code is easier to maintain. displayNotAvailable(); - _globals._exitId = sortie; + _globals->_exitId = sortie; } void HopkinsEngine::displayEndDemo() { _soundManager.playSound(28); - if (_globals._language == LANG_FR) + if (_globals->_language == LANG_FR) _graphicsManager.loadImage("endfr"); else _graphicsManager.loadImage("enduk"); @@ -1861,7 +1862,7 @@ void HopkinsEngine::displayEndDemo() { _graphicsManager.fadeInLong(); _eventsManager->delay(1500); _graphicsManager.fadeOutLong(); - _globals._exitId = 0; + _globals->_exitId = 0; } void HopkinsEngine::bombExplosion() { @@ -1872,7 +1873,7 @@ void HopkinsEngine::bombExplosion() { _graphicsManager.unlockScreen(); _graphicsManager.clearPalette(); - _globals.iRegul = 1; + _globals->iRegul = 1; _soundManager._specialSoundNum = 199; _graphicsManager.FADE_LINUX = 2; _animationManager->playAnim("BOMBE2A.ANM", 50, 14, 500); @@ -1893,9 +1894,9 @@ void HopkinsEngine::bombExplosion() { _eventsManager->refreshScreenAndEvents(); } - _globals._introSpeechOffFl = true; + _globals->_introSpeechOffFl = true; _talkManager.startStaticCharacterDialogue("vire.pe2"); - _globals._introSpeechOffFl = false; + _globals->_introSpeechOffFl = false; _objectsManager.setBobAnimation(7); for (int idx = 0; idx < 100; ++idx) { @@ -1904,8 +1905,8 @@ void HopkinsEngine::bombExplosion() { _graphicsManager.fadeOutLong(); _graphicsManager.endDisplayBob(); - _globals.iRegul = 0; - _globals._exitId = 151; + _globals->iRegul = 0; + _globals->_exitId = 151; } void HopkinsEngine::restoreSystem() { @@ -1914,11 +1915,11 @@ void HopkinsEngine::restoreSystem() { } void HopkinsEngine::endLinuxDemo() { - _globals._linuxEndDemoFl = true; + _globals->_linuxEndDemoFl = true; _graphicsManager.resetDirtyRects(); _objectsManager._forestFl = false; _eventsManager->_breakoutFl = false; - _globals._disableInventFl = true; + _globals->_disableInventFl = true; _graphicsManager.loadImage("BOX"); _soundManager.playSound(28); _graphicsManager.fadeInLong(); @@ -1943,8 +1944,8 @@ void HopkinsEngine::endLinuxDemo() { } void HopkinsEngine::handleConflagration() { - _globals._disableInventFl = true; - _globals.iRegul = 1; + _globals->_disableInventFl = true; + _globals->iRegul = 1; _graphicsManager.loadImage("IM71"); _animationManager->loadAnim("ANIM71"); _graphicsManager.SETCOLOR3(252, 100, 100, 100); @@ -1957,26 +1958,26 @@ void HopkinsEngine::handleConflagration() { _eventsManager->refreshScreenAndEvents(); _graphicsManager.fadeInLong(); - _globals.iRegul = 1; + _globals->iRegul = 1; for (int cpt = 0; cpt <= 249; cpt++) _eventsManager->refreshScreenAndEvents(); - _globals._introSpeechOffFl = true; + _globals->_introSpeechOffFl = true; _talkManager.startAnimatedCharacterDialogue("SVGARD1.pe2"); - _globals._introSpeechOffFl = false; + _globals->_introSpeechOffFl = false; for (int cpt = 0; cpt <= 49; cpt++) _eventsManager->refreshScreenAndEvents(); _graphicsManager.fadeOutLong(); _graphicsManager.endDisplayBob(); - _globals._saveData->_data[svBaseFireFl] = 1; - _globals._disableInventFl = false; + _globals->_saveData->_data[svBaseFireFl] = 1; + _globals->_disableInventFl = false; } void HopkinsEngine::playSubmarineCutscene() { - _globals.iRegul = 1; + _globals->iRegul = 1; _graphicsManager._lineNbr = SCREEN_WIDTH; _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -2013,7 +2014,7 @@ void HopkinsEngine::playSubmarineCutscene() { _eventsManager->_escKeyFl = false; _animationManager->_clearAnimationFl = false; - _globals._exitId = 85; + _globals->_exitId = 85; } void HopkinsEngine::playUnderwaterBaseCutscene() { @@ -2023,8 +2024,8 @@ void HopkinsEngine::playUnderwaterBaseCutscene() { _graphicsManager.clearPalette(); _animationManager->NO_SEQ = false; _soundManager.playSound(26); - _globals.iRegul = 1; - _globals._disableInventFl = true; + _globals->iRegul = 1; + _globals->_disableInventFl = true; _animationManager->NO_COUL = true; _graphicsManager.FADE_LINUX = 2; _animationManager->playSequence("abase.seq", 50, 15, 50); @@ -2038,7 +2039,7 @@ void HopkinsEngine::playUnderwaterBaseCutscene() { _eventsManager->refreshScreenAndEvents(); _graphicsManager.fadeInLong(); - _globals.enableHiding(); + _globals->enableHiding(); do _eventsManager->refreshScreenAndEvents(); @@ -2046,23 +2047,23 @@ void HopkinsEngine::playUnderwaterBaseCutscene() { _graphicsManager.fadeOutLong(); _graphicsManager.endDisplayBob(); - _globals.resetHidingItems(); - _globals._disableInventFl = false; - _globals._exitId = 93; - _globals.iRegul = 0; + _globals->resetHidingItems(); + _globals->_disableInventFl = false; + _globals->_exitId = 93; + _globals->iRegul = 0; } void HopkinsEngine::playEnding() { - _globals.PERSO = _globals.freeMemory(_globals.PERSO); + _globals->PERSO = _globals->freeMemory(_globals->PERSO); _dialogsManager->_removeInventFl = true; - _globals._disableInventFl = true; + _globals->_disableInventFl = true; _graphicsManager._scrollOffset = 0; - _globals._cityMapEnabledFl = false; - _globals.iRegul = 1; + _globals->_cityMapEnabledFl = false; + _globals->iRegul = 1; _soundManager.playSound(26); _linesManager._route = (RouteItem *)g_PTRNUL; - _globals._freezeCharacterFl = true; - _globals._exitId = 0; + _globals->_freezeCharacterFl = true; + _globals->_exitId = 0; _soundManager.loadSample(1, "SOUND90.WAV"); _graphicsManager.loadImage("IM100"); _animationManager->loadAnim("ANIM100"); @@ -2081,15 +2082,15 @@ void HopkinsEngine::playEnding() { _eventsManager->refreshScreenAndEvents(); _graphicsManager.fadeInLong(); - _globals.iRegul = 1; + _globals->iRegul = 1; do _eventsManager->refreshScreenAndEvents(); while (_objectsManager.getBobAnimDataIdx(6) != 54); - _globals._introSpeechOffFl = true; + _globals->_introSpeechOffFl = true; _talkManager.startAnimatedCharacterDialogue("GM4.PE2"); - _globals._disableInventFl = true; + _globals->_disableInventFl = true; _objectsManager.stopBobAnimation(6); _objectsManager.stopBobAnimation(10); _objectsManager.setBobAnimation(9); @@ -2105,23 +2106,23 @@ void HopkinsEngine::playEnding() { _eventsManager->refreshScreenAndEvents(); while (_objectsManager.getBobAnimDataIdx(7) != 65); - _globals._introSpeechOffFl = true; + _globals->_introSpeechOffFl = true; _talkManager.startAnimatedCharacterDialogue("DUELB4.PE2"); _eventsManager->mouseOff(); - _globals._disableInventFl = true; + _globals->_disableInventFl = true; do _eventsManager->refreshScreenAndEvents(); while (_objectsManager.getBobAnimDataIdx(7) != 72); - _globals._introSpeechOffFl = true; + _globals->_introSpeechOffFl = true; _talkManager.startAnimatedCharacterDialogue("DUELH1.PE2"); do _eventsManager->refreshScreenAndEvents(); while (_objectsManager.getBobAnimDataIdx(7) != 81); - _globals._introSpeechOffFl = true; + _globals->_introSpeechOffFl = true; _talkManager.startAnimatedCharacterDialogue("DUELB5.PE2"); do @@ -2129,7 +2130,7 @@ void HopkinsEngine::playEnding() { while (_objectsManager.getBobAnimDataIdx(7) != 120); _objectsManager.stopBobAnimation(7); - if (_globals._saveData->_data[svGameWonFl] == 1) { + if (_globals->_saveData->_data[svGameWonFl] == 1) { _soundManager._specialSoundNum = 200; _soundManager._skipRefreshFl = true; _graphicsManager.FADE_LINUX = 2; @@ -2143,11 +2144,11 @@ void HopkinsEngine::playEnding() { if (!_eventsManager->_escKeyFl) { do _eventsManager->refreshEvents(); - while (_eventsManager->_rateCounter < 2000 / _globals._speed && !_eventsManager->_escKeyFl); + while (_eventsManager->_rateCounter < 2000 / _globals->_speed && !_eventsManager->_escKeyFl); } _eventsManager->_escKeyFl = false; _graphicsManager.fadeOutLong(); - _globals.iRegul = 1; + _globals->iRegul = 1; _soundManager._specialSoundNum = 0; _graphicsManager.FADE_LINUX = 2; _animationManager->playAnim("JOUR2A.anm", 12, 12, 1000); @@ -2162,19 +2163,19 @@ void HopkinsEngine::playEnding() { _animationManager->playAnim("FF1a.anm", 9, 18, 9); _animationManager->playAnim("FF2a.anm", 24, 24, 100); displayCredits(); - _globals.iRegul = 0; - _globals._exitId = 300; + _globals->iRegul = 0; + _globals->_exitId = 300; _dialogsManager->_removeInventFl = false; - _globals._disableInventFl = false; + _globals->_disableInventFl = false; } else { _soundManager._specialSoundNum = 200; _soundManager._skipRefreshFl = true; _animationManager->playAnim2("BERM.ANM", 100, 24, 300); _objectsManager.stopBobAnimation(7); _objectsManager.setBobAnimation(8); - _globals._introSpeechOffFl = true; + _globals->_introSpeechOffFl = true; _talkManager.startAnimatedCharacterDialogue("GM5.PE2"); - _globals._disableInventFl = true; + _globals->_disableInventFl = true; do _eventsManager->refreshScreenAndEvents(); @@ -2190,22 +2191,22 @@ void HopkinsEngine::playEnding() { _graphicsManager.endDisplayBob(); _soundManager.removeSample(1); _soundManager.playSound(16); - _globals.iRegul = 1; + _globals->iRegul = 1; _soundManager._specialSoundNum = 0; _dialogsManager->_removeInventFl = false; - _globals._disableInventFl = false; + _globals->_disableInventFl = false; _animationManager->playAnim("JOUR4A.anm", 12, 12, 1000); - _globals.iRegul = 0; - _globals._exitId = 300; + _globals->iRegul = 0; + _globals->_exitId = 300; } - _globals.PERSO = _fileManager->loadFile("PERSO.SPR"); - _globals._characterType = 0; - _globals.iRegul = 0; + _globals->PERSO = _fileManager->loadFile("PERSO.SPR"); + _globals->_characterType = 0; + _globals->iRegul = 0; } void HopkinsEngine::playPlaneCutscene() { _soundManager.playSound(28); - _globals.iRegul = 1; + _globals->iRegul = 1; _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); _graphicsManager.unlockScreen(); @@ -2293,7 +2294,7 @@ void HopkinsEngine::drawBaseMap() { } int HopkinsEngine::handleBaseMap() { - _globals._disableInventFl = true; + _globals->_disableInventFl = true; // Load the map image loadBaseMap(); @@ -2335,10 +2336,10 @@ int HopkinsEngine::handleBaseMap() { zone = 6; if (zone) { _eventsManager->changeMouseCursor(4); - _globals._baseMapColor += 25; - if (_globals._baseMapColor > 100) - _globals._baseMapColor = 0; - _graphicsManager.SETCOLOR4(251, _globals._baseMapColor, _globals._baseMapColor, _globals._baseMapColor); + _globals->_baseMapColor += 25; + if (_globals->_baseMapColor > 100) + _globals->_baseMapColor = 0; + _graphicsManager.SETCOLOR4(251, _globals->_baseMapColor, _globals->_baseMapColor, _globals->_baseMapColor); } else { _eventsManager->changeMouseCursor(0); _graphicsManager.SETCOLOR4(251, 100, 100, 100); @@ -2348,7 +2349,7 @@ int HopkinsEngine::handleBaseMap() { loopCond = true; } while (!loopCond); - _globals._disableInventFl = false; + _globals->_disableInventFl = false; _graphicsManager.fadeOutLong(); int result; @@ -2379,10 +2380,10 @@ int HopkinsEngine::handleBaseMap() { } void HopkinsEngine::loadCredits() { - _globals._creditsPosY = 440; - _globals._creditsStep = 45; + _globals->_creditsPosY = 440; + _globals->_creditsStep = 45; byte *bufPtr; - switch (_globals._language) { + switch (_globals->_language) { case LANG_EN: bufPtr = _fileManager->loadFile("CREAN.TXT"); break; @@ -2406,28 +2407,28 @@ void HopkinsEngine::loadCredits() { loopCond = true; break; } - _globals._creditsItem[idxLines]._color = curPtr[1]; - _globals._creditsItem[idxLines]._actvFl = true; - _globals._creditsItem[idxLines]._linePosY = _globals._creditsPosY + idxLines * _globals._creditsStep; + _globals->_creditsItem[idxLines]._color = curPtr[1]; + _globals->_creditsItem[idxLines]._actvFl = true; + _globals->_creditsItem[idxLines]._linePosY = _globals->_creditsPosY + idxLines * _globals->_creditsStep; int idxBuf = 0; for(; idxBuf < 49; idxBuf++) { byte curChar = curPtr[idxBuf + 3]; if (curChar == '%' || curChar == 10) break; - _globals._creditsItem[idxLines]._line[idxBuf] = curChar; + _globals->_creditsItem[idxLines]._line[idxBuf] = curChar; } - _globals._creditsItem[idxLines]._line[idxBuf] = 0; - _globals._creditsItem[idxLines]._lineSize = idxBuf - 1; + _globals->_creditsItem[idxLines]._line[idxBuf] = 0; + _globals->_creditsItem[idxLines]._lineSize = idxBuf - 1; curPtr = curPtr + idxBuf + 2; ++idxLines; } else { curPtr++; } - _globals._creditsLineNumb = idxLines; + _globals->_creditsLineNumb = idxLines; } while (!loopCond); - _globals.freeMemory(bufPtr); + _globals->freeMemory(bufPtr); } void HopkinsEngine::displayCredits(int startPosY, byte *buffer, char color) { @@ -2444,20 +2445,20 @@ void HopkinsEngine::displayCredits(int startPosY, byte *buffer, char color) { int startPosX = 320 - strWidth / 2; int endPosX = strWidth + startPosX; int endPosY = startPosY + 12; - if ((_globals._creditsStartX == -1) && (_globals._creditsEndX == -1) && (_globals._creditsStartY == -1) && (_globals._creditsEndY == -1)) { - _globals._creditsStartX = startPosX; - _globals._creditsEndX = endPosX; - _globals._creditsStartY = startPosY; - _globals._creditsEndY = endPosY; + if ((_globals->_creditsStartX == -1) && (_globals->_creditsEndX == -1) && (_globals->_creditsStartY == -1) && (_globals->_creditsEndY == -1)) { + _globals->_creditsStartX = startPosX; + _globals->_creditsEndX = endPosX; + _globals->_creditsStartY = startPosY; + _globals->_creditsEndY = endPosY; } - if (startPosX < _globals._creditsStartX) - _globals._creditsStartX = startPosX; - if (endPosX > _globals._creditsEndX) - _globals._creditsEndX = endPosX; - if (_globals._creditsStartY > startPosY) - _globals._creditsStartY = startPosY; - if (endPosY > _globals._creditsEndY) - _globals._creditsEndY = endPosY; + if (startPosX < _globals->_creditsStartX) + _globals->_creditsStartX = startPosX; + if (endPosX > _globals->_creditsEndX) + _globals->_creditsEndX = endPosX; + if (_globals->_creditsStartY > startPosY) + _globals->_creditsStartY = startPosY; + if (endPosY > _globals->_creditsEndY) + _globals->_creditsEndY = endPosY; bufPtr = buffer; for (;;) { @@ -2473,23 +2474,23 @@ void HopkinsEngine::displayCredits(int startPosY, byte *buffer, char color) { void HopkinsEngine::displayCredits() { loadCredits(); - _globals._creditsPosY = 436; + _globals->_creditsPosY = 436; _graphicsManager.loadImage("GENERIC"); _graphicsManager.fadeInLong(); _soundManager.playSound(28); _eventsManager->_mouseFl = false; - _globals.iRegul = 3; - _globals._creditsStartX = _globals._creditsEndX = _globals._creditsStartY = _globals._creditsEndY = -1; + _globals->iRegul = 3; + _globals->_creditsStartX = _globals->_creditsEndX = _globals->_creditsStartY = _globals->_creditsEndY = -1; int soundId = 28; do { - for (int i = 0; i < _globals._creditsLineNumb; ++i) { - if (_globals._creditsItem[i]._actvFl) { - int nextY = _globals._creditsPosY + i * _globals._creditsStep; - _globals._creditsItem[i]._linePosY = nextY; + for (int i = 0; i < _globals->_creditsLineNumb; ++i) { + if (_globals->_creditsItem[i]._actvFl) { + int nextY = _globals->_creditsPosY + i * _globals->_creditsStep; + _globals->_creditsItem[i]._linePosY = nextY; if ((nextY - 21 >= 0) && (nextY - 21 <= 418)) { int col = 0; - switch (_globals._creditsItem[i]._color) { + switch (_globals->_creditsItem[i]._color) { case '1': col = 163; break; @@ -2504,32 +2505,32 @@ void HopkinsEngine::displayCredits() { col = 163; break; } - if (_globals._creditsItem[i]._lineSize != -1) - displayCredits(nextY, _globals._creditsItem[i]._line, col); + if (_globals->_creditsItem[i]._lineSize != -1) + displayCredits(nextY, _globals->_creditsItem[i]._line, col); } } } - --_globals._creditsPosY; - if (_globals._creditsStartX != -1 || _globals._creditsEndX != -1 || _globals._creditsStartY != -1 || _globals._creditsEndY != -1) { + --_globals->_creditsPosY; + if (_globals->_creditsStartX != -1 || _globals->_creditsEndX != -1 || _globals->_creditsStartY != -1 || _globals->_creditsEndY != -1) { _eventsManager->refreshScreenAndEvents(); _graphicsManager.copySurface(_graphicsManager._vesaScreen, 60, 50, 520, 380, _graphicsManager._vesaBuffer, 60, 50); } else { _eventsManager->refreshScreenAndEvents(); } - if (_globals._creditsItem[_globals._creditsLineNumb - 1]._linePosY <= 39) { - _globals._creditsPosY = 440; + if (_globals->_creditsItem[_globals->_creditsLineNumb - 1]._linePosY <= 39) { + _globals->_creditsPosY = 440; ++soundId; if (soundId > 31) soundId = 28; _soundManager.playSound(soundId); } - _globals._creditsStartX = -1; - _globals._creditsEndX = -1; - _globals._creditsStartY = -1; - _globals._creditsEndY = -1; + _globals->_creditsStartX = -1; + _globals->_creditsEndX = -1; + _globals->_creditsStartY = -1; + _globals->_creditsEndY = -1; } while ((_eventsManager->getMouseButton() != 1) && (!shouldQuit())); _graphicsManager.fadeOutLong(); - _globals.iRegul = 1; + _globals->iRegul = 1; _eventsManager->_mouseFl = true; } @@ -2548,29 +2549,29 @@ void HopkinsEngine::handleOceanMouseEvents() { int oldX; switch (_objectsManager._zoneNum) { case 1: - switch (_globals._oceanDirection) { + switch (_globals->_oceanDirection) { case DIR_UP: - _objectsManager.SPACTION(_globals.PERSO, "27,26,25,24,23,22,21,20,19,18,-1,", 6, false); + _objectsManager.SPACTION(_globals->PERSO, "27,26,25,24,23,22,21,20,19,18,-1,", 6, false); break; case DIR_RIGHT: - _objectsManager.SPACTION(_globals.PERSO, "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,-1,", 6, false); + _objectsManager.SPACTION(_globals->PERSO, "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,-1,", 6, false); break; case DIR_DOWN: - _objectsManager.SPACTION(_globals.PERSO, "9,10,11,12,13,14,15,16,17,18,-1,", 6, false); + _objectsManager.SPACTION(_globals->PERSO, "9,10,11,12,13,14,15,16,17,18,-1,", 6, false); break; default: break; } - _globals._oceanDirection = DIR_LEFT; - _globals._exitId = 1; + _globals->_oceanDirection = DIR_LEFT; + _globals->_exitId = 1; oldX = _objectsManager.getSpriteX(0); for (;;) { - if (_globals._speed == 1) + if (_globals->_speed == 1) oldX -= 2; - else if (_globals._speed == 2) + else if (_globals->_speed == 2) oldX -= 4; - else if (_globals._speed == 3) + else if (_globals->_speed == 3) oldX -= 6; _objectsManager.setSpriteX(0, oldX); setSubmarineSprites(); @@ -2585,28 +2586,28 @@ void HopkinsEngine::handleOceanMouseEvents() { } break; case 2: - switch (_globals._oceanDirection) { + switch (_globals->_oceanDirection) { case DIR_UP: - _objectsManager.SPACTION(_globals.PERSO, "27,28,29,30,31,32,33,34,35,36,-1,", 6, false); + _objectsManager.SPACTION(_globals->PERSO, "27,28,29,30,31,32,33,34,35,36,-1,", 6, false); break; case DIR_DOWN: - _objectsManager.SPACTION(_globals.PERSO, "9,8,7,6,5,4,3,2,1,0,-1,", 6, false); + _objectsManager.SPACTION(_globals->PERSO, "9,8,7,6,5,4,3,2,1,0,-1,", 6, false); break; case DIR_LEFT: - _objectsManager.SPACTION(_globals.PERSO, "18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,-1,", 6, false); + _objectsManager.SPACTION(_globals->PERSO, "18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,-1,", 6, false); break; default: break; } - _globals._oceanDirection = DIR_RIGHT; - _globals._exitId = 2; + _globals->_oceanDirection = DIR_RIGHT; + _globals->_exitId = 2; oldX = _objectsManager.getSpriteX(0); for (;;) { - if (_globals._speed == 1) + if (_globals->_speed == 1) oldX += 2; - else if (_globals._speed == 2) + else if (_globals->_speed == 2) oldX += 4; - else if (_globals._speed == 3) + else if (_globals->_speed == 3) oldX += 6; _objectsManager.setSpriteX(0, oldX); setSubmarineSprites(); @@ -2620,15 +2621,15 @@ void HopkinsEngine::handleOceanMouseEvents() { } break; case 3: - switch (_globals._oceanDirection) { + switch (_globals->_oceanDirection) { case DIR_RIGHT: oldX = _objectsManager.getSpriteX(0); do { - if (_globals._speed == 1) + if (_globals->_speed == 1) oldX += 2; - else if (_globals._speed == 2) + else if (_globals->_speed == 2) oldX += 4; - else if (_globals._speed == 3) + else if (_globals->_speed == 3) oldX += 6; _objectsManager.setSpriteX(0, oldX); setSubmarineSprites(); @@ -2639,19 +2640,19 @@ void HopkinsEngine::handleOceanMouseEvents() { } } while (oldX <= 235); if (!displAnim) - _objectsManager.SPACTION(_globals.PERSO, "36,35,34,33,32,31,30,29,28,27,-1,", 6, false); + _objectsManager.SPACTION(_globals->PERSO, "36,35,34,33,32,31,30,29,28,27,-1,", 6, false); break; case DIR_DOWN: - _objectsManager.SPACTION(_globals.PERSO, "9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,-1,", 6, false); + _objectsManager.SPACTION(_globals->PERSO, "9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,-1,", 6, false); break; case DIR_LEFT: oldX = _objectsManager.getSpriteX(0); do { - if (_globals._speed == 1) + if (_globals->_speed == 1) oldX -= 2; - else if (_globals._speed == 2) + else if (_globals->_speed == 2) oldX -= 4; - else if (_globals._speed == 3) + else if (_globals->_speed == 3) oldX -= 6; _objectsManager.setSpriteX(0, oldX); setSubmarineSprites(); @@ -2662,27 +2663,27 @@ void HopkinsEngine::handleOceanMouseEvents() { } } while (oldX > 236); if (!displAnim) - _objectsManager.SPACTION(_globals.PERSO, "18,19,20,21,22,23,24,25,26,27,-1,", 6, false); + _objectsManager.SPACTION(_globals->PERSO, "18,19,20,21,22,23,24,25,26,27,-1,", 6, false); break; default: break; } - _globals._oceanDirection = DIR_UP; - _globals._exitId = 3; + _globals->_oceanDirection = DIR_UP; + _globals->_exitId = 3; break; case 4: - switch (_globals._oceanDirection) { + switch (_globals->_oceanDirection) { case DIR_UP: - _objectsManager.SPACTION(_globals.PERSO, "27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,-1,", 6, false); + _objectsManager.SPACTION(_globals->PERSO, "27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,-1,", 6, false); break; case DIR_RIGHT: oldX = _objectsManager.getSpriteX(0); do { - if (_globals._speed == 1) + if (_globals->_speed == 1) oldX += 2; - else if (_globals._speed == 2) + else if (_globals->_speed == 2) oldX += 4; - else if (_globals._speed == 3) + else if (_globals->_speed == 3) oldX += 6; _objectsManager.setSpriteX(0, oldX); setSubmarineSprites(); @@ -2693,16 +2694,16 @@ void HopkinsEngine::handleOceanMouseEvents() { } } while (oldX <= 235); if (!displAnim) - _objectsManager.SPACTION(_globals.PERSO, "0,1,2,3,4,5,6,7,8,9,-1,", 6, false); + _objectsManager.SPACTION(_globals->PERSO, "0,1,2,3,4,5,6,7,8,9,-1,", 6, false); break; case DIR_LEFT: oldX = _objectsManager.getSpriteX(0); for (;;) { - if (_globals._speed == 1) + if (_globals->_speed == 1) oldX -= 2; - else if (_globals._speed == 2) + else if (_globals->_speed == 2) oldX -= 4; - else if (_globals._speed == 3) + else if (_globals->_speed == 3) oldX -= 6; _objectsManager.setSpriteX(0, oldX); setSubmarineSprites(); @@ -2712,7 +2713,7 @@ void HopkinsEngine::handleOceanMouseEvents() { if (oldX <= 236) { if (!displAnim) - _objectsManager.SPACTION(_globals.PERSO, "18,17,16,15,14,13,12,11,10,9,-1,", 6, false); + _objectsManager.SPACTION(_globals->PERSO, "18,17,16,15,14,13,12,11,10,9,-1,", 6, false); break; } } @@ -2720,14 +2721,14 @@ void HopkinsEngine::handleOceanMouseEvents() { default: break; } - _globals._oceanDirection = DIR_DOWN; - _globals._exitId = 4; + _globals->_oceanDirection = DIR_DOWN; + _globals->_exitId = 4; break; } } void HopkinsEngine::setSubmarineSprites() { - switch (_globals._oceanDirection) { + switch (_globals->_oceanDirection) { case DIR_UP: _objectsManager.setSpriteIndex(0, 27); break; @@ -2746,13 +2747,13 @@ void HopkinsEngine::setSubmarineSprites() { } void HopkinsEngine::handleOceanMaze(int16 curExitId, Common::String backgroundFilename, Directions defaultDirection, int16 exit1, int16 exit2, int16 exit3, int16 exit4, int16 soundId) { - _globals._cityMapEnabledFl = false; + _globals->_cityMapEnabledFl = false; _graphicsManager._noFadingFl = false; - _globals._freezeCharacterFl = false; - _globals._exitId = 0; - _globals._disableInventFl = true; + _globals->_freezeCharacterFl = false; + _globals->_exitId = 0; + _globals->_disableInventFl = true; _soundManager.playSound(soundId); - _globals.PERSO = _fileManager->loadFile("VAISSEAU.SPR"); + _globals->PERSO = _fileManager->loadFile("VAISSEAU.SPR"); if (backgroundFilename.size()) _graphicsManager.loadImage(backgroundFilename); @@ -2774,10 +2775,10 @@ void HopkinsEngine::handleOceanMaze(int16 curExitId, Common::String backgroundFi if (!exit4) _linesManager.disableZone(4); - if (!_globals._oceanDirection) - _globals._oceanDirection = defaultDirection; + if (!_globals->_oceanDirection) + _globals->_oceanDirection = defaultDirection; - switch (_globals._oceanDirection) { + switch (_globals->_oceanDirection) { case DIR_UP: _objectsManager._characterPos.x = 236; _objectsManager._startSpriteIndex = 27; @@ -2798,7 +2799,7 @@ void HopkinsEngine::handleOceanMaze(int16 curExitId, Common::String backgroundFi break; } - _objectsManager.addStaticSprite(_globals.PERSO, Common::Point(_objectsManager._characterPos.x, 110), 0, _objectsManager._startSpriteIndex, 0, false, 0, 0); + _objectsManager.addStaticSprite(_globals->PERSO, Common::Point(_objectsManager._characterPos.x, 110), 0, _objectsManager._startSpriteIndex, 0, false, 0, 0); _graphicsManager.SETCOLOR3(252, 100, 100, 100); _graphicsManager.SETCOLOR3(253, 100, 100, 100); _graphicsManager.SETCOLOR3(251, 100, 100, 100); @@ -2814,7 +2815,7 @@ void HopkinsEngine::handleOceanMaze(int16 curExitId, Common::String backgroundFi if (!_graphicsManager._noFadingFl) _graphicsManager.fadeInLong(); _graphicsManager._noFadingFl = false; - _globals.iRegul = 1; + _globals->iRegul = 1; for (;;) { int mouseButton = _eventsManager->getMouseButton(); @@ -2824,23 +2825,23 @@ void HopkinsEngine::handleOceanMaze(int16 curExitId, Common::String backgroundFi setSubmarineSprites(); _eventsManager->refreshScreenAndEvents(); - if (_globals._exitId || shouldQuit()) + if (_globals->_exitId || shouldQuit()) break; } - if (_globals._exitId == 1) - _globals._exitId = exit1; - else if (_globals._exitId == 2) - _globals._exitId = exit2; - else if (_globals._exitId == 3) - _globals._exitId = exit3; - else if (_globals._exitId == 4) - _globals._exitId = exit4; + if (_globals->_exitId == 1) + _globals->_exitId = exit1; + else if (_globals->_exitId == 2) + _globals->_exitId = exit2; + else if (_globals->_exitId == 3) + _globals->_exitId = exit3; + else if (_globals->_exitId == 4) + _globals->_exitId = exit4; _graphicsManager.fadeOutLong(); _objectsManager.removeSprite(0); _objectsManager.clearScreen(); - _globals.PERSO = _fileManager->loadFile("PERSO.SPR"); - _globals._characterType = 0; + _globals->PERSO = _fileManager->loadFile("PERSO.SPR"); + _globals->_characterType = 0; } void HopkinsEngine::syncSoundSettings() { @@ -2859,8 +2860,8 @@ bool HopkinsEngine::displayAdultDisclaimer() { _graphicsManager._maxY = SCREEN_HEIGHT - 1; _eventsManager->_breakoutFl = false; _objectsManager._forestFl = false; - _globals._disableInventFl = true; - _globals._exitId = 0; + _globals->_disableInventFl = true; + _globals->_exitId = 0; _graphicsManager.loadImage("ADULT"); _graphicsManager.fadeInLong(); @@ -2882,7 +2883,7 @@ bool HopkinsEngine::displayAdultDisclaimer() { _eventsManager->refreshScreenAndEvents(); } while (!shouldQuit() && (buttonIndex == 0 || _eventsManager->getMouseButton() != 1)); - _globals._disableInventFl = false; + _globals->_disableInventFl = false; _graphicsManager.fadeOutLong(); if (buttonIndex != 2) { diff --git a/engines/hopkins/hopkins.h b/engines/hopkins/hopkins.h index c751a666d4..5f8838594f 100644 --- a/engines/hopkins/hopkins.h +++ b/engines/hopkins/hopkins.h @@ -149,8 +149,8 @@ public: EventsManager *_eventsManager; FileManager *_fileManager; FontManager *_fontManager; + Globals *_globals; - Globals _globals; GraphicsManager _graphicsManager; LinesManager _linesManager; MenuManager _menuManager; diff --git a/engines/hopkins/lines.cpp b/engines/hopkins/lines.cpp index 2eaefb1a71..dac2a30ce1 100644 --- a/engines/hopkins/lines.cpp +++ b/engines/hopkins/lines.cpp @@ -94,10 +94,10 @@ LinesManager::LinesManager() { } LinesManager::~LinesManager() { - _vm->_globals.freeMemory(_largeBuf); - _vm->_globals.freeMemory((byte *) _testRoute0); - _vm->_globals.freeMemory((byte *) _testRoute1); - _vm->_globals.freeMemory((byte *) _testRoute2); + _vm->_globals->freeMemory(_largeBuf); + _vm->_globals->freeMemory((byte *) _testRoute0); + _vm->_globals->freeMemory((byte *) _testRoute1); + _vm->_globals->freeMemory((byte *) _testRoute2); } void LinesManager::setParent(HopkinsEngine *vm) { @@ -121,7 +121,7 @@ void LinesManager::loadLines(const Common::String &file) { READ_LE_INT16((uint16 *)ptr + (idx * 5) + 4)); } initRoute(); - _vm->_globals.freeMemory(ptr); + _vm->_globals->freeMemory(ptr); } /** @@ -199,7 +199,7 @@ void LinesManager::addZoneLine(int idx, int fromX, int fromY, int destX, int des BOBZONE[bobZoneIdx] = fromY; } else { assert (idx <= MAX_LINES); - _zoneLine[idx]._zoneData = (int16 *)_vm->_globals.freeMemory((byte *)_zoneLine[idx]._zoneData); + _zoneLine[idx]._zoneData = (int16 *)_vm->_globals->freeMemory((byte *)_zoneLine[idx]._zoneData); int distX = abs(fromX - destX); int distY = abs(fromY - destY); @@ -209,7 +209,7 @@ void LinesManager::addZoneLine(int idx, int fromX, int fromY, int destX, int des else maxDist += distX; - zoneData = (int16 *)_vm->_globals.allocMemory(2 * sizeof(int16) * maxDist + (4 * sizeof(int16))); + zoneData = (int16 *)_vm->_globals->allocMemory(2 * sizeof(int16) * maxDist + (4 * sizeof(int16))); assert(zoneData != (int16 *)g_PTRNUL); _zoneLine[idx]._zoneData = zoneData; @@ -247,14 +247,14 @@ void LinesManager::addLine(int lineIdx, Directions direction, int fromX, int fro if (_linesNumb < lineIdx) _linesNumb = lineIdx; - _lineItem[lineIdx]._lineData = (int16 *)_vm->_globals.freeMemory((byte *)_lineItem[lineIdx]._lineData); + _lineItem[lineIdx]._lineData = (int16 *)_vm->_globals->freeMemory((byte *)_lineItem[lineIdx]._lineData); int distX = abs(fromX - destX) + 1; int distY = abs(fromY - destY) + 1; int maxDist = distY; if (distX > maxDist) maxDist = distX; - byte *zoneData = _vm->_globals.allocMemory(4 * maxDist + 8); + byte *zoneData = _vm->_globals->allocMemory(4 * maxDist + 8); assert (zoneData != g_PTRNUL); Common::fill(zoneData, zoneData + 4 * maxDist + 8, 0); @@ -935,7 +935,7 @@ int LinesManager::GENIAL(int lineIdx, int dataIdx, int fromX, int fromY, int des break; lineIdxDown = foundLineIdx; - if (_vm->_globals._characterMaxPosY <= curY || maxLineY <= curY) + if (_vm->_globals->_characterMaxPosY <= curY || maxLineY <= curY) break; } int curX = destX; @@ -1081,23 +1081,23 @@ RouteItem *LinesManager::PARCOURS2(int fromX, int fromY, int destX, int destY) { Directions newDir = DIR_NONE; if (destY <= 24) clipDestY = 25; - if (!_vm->_globals._checkDistanceFl) { - if (abs(fromX - _vm->_globals._oldRouteFromX) <= 4 && abs(fromY - _vm->_globals._oldRouteFromY) <= 4 && - abs(_vm->_globals._oldRouteDestX - destX) <= 4 && abs(_vm->_globals._oldRouteDestY - clipDestY) <= 4) + if (!_vm->_globals->_checkDistanceFl) { + if (abs(fromX - _vm->_globals->_oldRouteFromX) <= 4 && abs(fromY - _vm->_globals->_oldRouteFromY) <= 4 && + abs(_vm->_globals->_oldRouteDestX - destX) <= 4 && abs(_vm->_globals->_oldRouteDestY - clipDestY) <= 4) return (RouteItem *)g_PTRNUL; if (abs(fromX - destX) <= 4 && abs(fromY - clipDestY) <= 4) return (RouteItem *)g_PTRNUL; - if (_vm->_globals._oldZoneNum > 0 && _vm->_objectsManager._zoneNum > 0 && _vm->_globals._oldZoneNum == _vm->_objectsManager._zoneNum) + if (_vm->_globals->_oldZoneNum > 0 && _vm->_objectsManager._zoneNum > 0 && _vm->_globals->_oldZoneNum == _vm->_objectsManager._zoneNum) return (RouteItem *)g_PTRNUL; } - _vm->_globals._checkDistanceFl = false; - _vm->_globals._oldZoneNum = _vm->_objectsManager._zoneNum; - _vm->_globals._oldRouteFromX = fromX; - _vm->_globals._oldRouteDestX = destX; - _vm->_globals._oldRouteFromY = fromY; - _vm->_globals._oldRouteDestY = clipDestY; + _vm->_globals->_checkDistanceFl = false; + _vm->_globals->_oldZoneNum = _vm->_objectsManager._zoneNum; + _vm->_globals->_oldRouteFromX = fromX; + _vm->_globals->_oldRouteDestX = destX; + _vm->_globals->_oldRouteFromY = fromY; + _vm->_globals->_oldRouteDestY = clipDestY; _pathFindingMaxDepth = 0; int routeIdx = 0; if (destX <= 19) @@ -1106,8 +1106,8 @@ RouteItem *LinesManager::PARCOURS2(int fromX, int fromY, int destX, int destY) { clipDestY = 20; if (clipDestX > _vm->_graphicsManager._maxX - 10) clipDestX = _vm->_graphicsManager._maxX - 10; - if (clipDestY > _vm->_globals._characterMaxPosY) - clipDestY = _vm->_globals._characterMaxPosY; + if (clipDestY > _vm->_globals->_characterMaxPosY) + clipDestY = _vm->_globals->_characterMaxPosY; if (abs(fromX - clipDestX) <= 3 && abs(fromY - clipDestY) <= 3) return (RouteItem *)g_PTRNUL; @@ -2196,9 +2196,9 @@ bool LinesManager::makeSmoothMove(int fromX, int fromY, int destX, int destY) { int smoothIdx = 0; int stepCount = 0; while (curX > destX && destY > curY) { - int realSpeedX = _vm->_globals._hopkinsItem[hopkinsIdx]._speedX; - int realSpeedY = _vm->_globals._hopkinsItem[hopkinsIdx]._speedY; - int spriteSize = _vm->_globals._spriteSize[curY]; + int realSpeedX = _vm->_globals->_hopkinsItem[hopkinsIdx]._speedX; + int realSpeedY = _vm->_globals->_hopkinsItem[hopkinsIdx]._speedY; + int spriteSize = _vm->_globals->_spriteSize[curY]; if (spriteSize < 0) { realSpeedX = _vm->_graphicsManager.zoomOut(realSpeedX, -spriteSize); realSpeedY = _vm->_graphicsManager.zoomOut(realSpeedY, -spriteSize); @@ -2230,9 +2230,9 @@ bool LinesManager::makeSmoothMove(int fromX, int fromY, int destX, int destY) { int smoothIdx = 0; int stepCount = 0; while (curX < destX && destY > curY) { - int realSpeedX = _vm->_globals._hopkinsItem[hopkinsIdx]._speedX; - int realSpeedY = _vm->_globals._hopkinsItem[hopkinsIdx]._speedY; - int spriteSize = _vm->_globals._spriteSize[curY]; + int realSpeedX = _vm->_globals->_hopkinsItem[hopkinsIdx]._speedX; + int realSpeedY = _vm->_globals->_hopkinsItem[hopkinsIdx]._speedY; + int spriteSize = _vm->_globals->_spriteSize[curY]; if (spriteSize < 0) { realSpeedX = _vm->_graphicsManager.zoomOut(realSpeedX, -spriteSize); realSpeedY = _vm->_graphicsManager.zoomOut(realSpeedY, -spriteSize); @@ -2264,8 +2264,8 @@ bool LinesManager::makeSmoothMove(int fromX, int fromY, int destX, int destY) { int smoothIdx = 0; int stepCount = 0; while (curX > destX && destY < curY) { - int realSpeedX = _vm->_graphicsManager.zoomOut(_vm->_globals._hopkinsItem[hopkinsIdx]._speedX, 25); - int realSpeedY = _vm->_graphicsManager.zoomOut(_vm->_globals._hopkinsItem[hopkinsIdx]._speedY, 25); + int realSpeedX = _vm->_graphicsManager.zoomOut(_vm->_globals->_hopkinsItem[hopkinsIdx]._speedX, 25); + int realSpeedY = _vm->_graphicsManager.zoomOut(_vm->_globals->_hopkinsItem[hopkinsIdx]._speedY, 25); int oldY = curY; for (int i = 0; i < realSpeedX; i++) { --curX; @@ -2292,8 +2292,8 @@ bool LinesManager::makeSmoothMove(int fromX, int fromY, int destX, int destY) { int stepCount = 0; while (curX < destX && destY < curY) { int oldY = curY; - int realSpeedX = _vm->_graphicsManager.zoomOut(_vm->_globals._hopkinsItem[hopkinsIdx]._speedX, 25); - int realSpeedY = _vm->_graphicsManager.zoomOut(_vm->_globals._hopkinsItem[hopkinsIdx]._speedY, 25); + int realSpeedX = _vm->_graphicsManager.zoomOut(_vm->_globals->_hopkinsItem[hopkinsIdx]._speedX, 25); + int realSpeedY = _vm->_graphicsManager.zoomOut(_vm->_globals->_hopkinsItem[hopkinsIdx]._speedY, 25); for (int i = 0; i < realSpeedX; i++) { ++curX; _smoothRoute[smoothIdx]._posX = curX; @@ -2460,12 +2460,12 @@ int LinesManager::testLine(int paramX, int paramY, int *a3, int *foundLineIdx, i } int LinesManager::CALC_PROPRE(int idx) { - int size = _vm->_globals._spriteSize[idx]; - if (_vm->_globals._characterType == 1) { + int size = _vm->_globals->_spriteSize[idx]; + if (_vm->_globals->_characterType == 1) { if (size < 0) size = -size; size = 20 * (5 * size - 100) / -80; - } else if (_vm->_globals._characterType == 2) { + } else if (_vm->_globals->_characterType == 2) { if (size < 0) size = -size; size = 20 * (5 * size - 165) / -67; @@ -2748,7 +2748,7 @@ void LinesManager::clearAll() { if (!_testRoute2) _testRoute2 = (RouteItem*)g_PTRNUL; - _largeBuf = _vm->_globals.allocMemory(10000); + _largeBuf = _vm->_globals->allocMemory(10000); _lineBuf = (int16 *)(_largeBuf); } @@ -2765,7 +2765,7 @@ void LinesManager::clearAllZones() { */ void LinesManager::removeZoneLine(int idx) { assert (idx <= MAX_LINES); - _zoneLine[idx]._zoneData = (int16 *)_vm->_globals.freeMemory((byte *)_zoneLine[idx]._zoneData); + _zoneLine[idx]._zoneData = (int16 *)_vm->_globals->freeMemory((byte *)_zoneLine[idx]._zoneData); } void LinesManager::resetLines() { @@ -2780,7 +2780,7 @@ void LinesManager::resetLines() { void LinesManager::removeLine(int idx) { if (idx > MAX_LINES) error("Attempting to add a line obstacle > MAX_LIGNE."); - _lineItem[idx]._lineData = (int16 *)_vm->_globals.freeMemory((byte *)_lineItem[idx]._lineData); + _lineItem[idx]._lineData = (int16 *)_vm->_globals->freeMemory((byte *)_lineItem[idx]._lineData); } void LinesManager::setMaxLineIdx(int idx) { @@ -2815,7 +2815,7 @@ void LinesManager::checkZone() { int mouseX = _vm->_eventsManager->getMouseX(); int mouseY = _vm->_eventsManager->getMouseY(); int oldMouseY = mouseY; - if (_vm->_globals._cityMapEnabledFl + if (_vm->_globals->_cityMapEnabledFl || _vm->_eventsManager->_startPos.x >= mouseX || (mouseY = _vm->_graphicsManager._scrollOffset + 54, mouseX >= mouseY) || (mouseY = oldMouseY - 1, mouseY < 0 || mouseY > 59)) { @@ -2826,32 +2826,32 @@ void LinesManager::checkZone() { _vm->_objectsManager._visibleFl = true; } if (_vm->_objectsManager._forceZoneFl) { - _vm->_globals.compteur_71 = 100; - _vm->_globals._oldMouseZoneId = -1; - _vm->_globals._oldMouseX = -200; - _vm->_globals._oldMouseY = -220; + _vm->_globals->compteur_71 = 100; + _vm->_globals->_oldMouseZoneId = -1; + _vm->_globals->_oldMouseX = -200; + _vm->_globals->_oldMouseY = -220; _vm->_objectsManager._forceZoneFl = false; } - _vm->_globals.compteur_71++; - if (_vm->_globals.compteur_71 <= 1) + _vm->_globals->compteur_71++; + if (_vm->_globals->compteur_71 <= 1) return; - if (_vm->_globals._freezeCharacterFl || (_route == (RouteItem *)g_PTRNUL) || _vm->_globals.compteur_71 > 4) { - _vm->_globals.compteur_71 = 0; + if (_vm->_globals->_freezeCharacterFl || (_route == (RouteItem *)g_PTRNUL) || _vm->_globals->compteur_71 > 4) { + _vm->_globals->compteur_71 = 0; int zoneId; - if (_vm->_globals._oldMouseX != mouseX || _vm->_globals._oldMouseY != oldMouseY) { + if (_vm->_globals->_oldMouseX != mouseX || _vm->_globals->_oldMouseY != oldMouseY) { zoneId = getMouseZone(); } else { - zoneId = _vm->_globals._oldMouseZoneId; + zoneId = _vm->_globals->_oldMouseZoneId; } - if (_vm->_globals._oldMouseZoneId != zoneId) { + if (_vm->_globals->_oldMouseZoneId != zoneId) { _vm->_graphicsManager.SETCOLOR4(251, 100, 100, 100); _vm->_eventsManager->_mouseCursorId = 4; _vm->_eventsManager->changeMouseCursor(4); - if (_vm->_globals._forceHideText) { + if (_vm->_globals->_forceHideText) { _vm->_fontManager->hideText(5); - _vm->_globals._forceHideText = false; + _vm->_globals->_forceHideText = false; return; } } @@ -2861,16 +2861,16 @@ void LinesManager::checkZone() { ZONEP[zoneId]._verbFl5 || ZONEP[zoneId]._verbFl6 || ZONEP[zoneId]._verbFl7 || ZONEP[zoneId]._verbFl8 || ZONEP[zoneId]._verbFl9 || ZONEP[zoneId]._verbFl10) { - if (_vm->_globals._oldMouseZoneId != zoneId) { - _vm->_fontManager->initTextBuffers(5, ZONEP[zoneId]._messageId, _vm->_globals._zoneFilename, 0, 430, 0, 0, 252); + if (_vm->_globals->_oldMouseZoneId != zoneId) { + _vm->_fontManager->initTextBuffers(5, ZONEP[zoneId]._messageId, _vm->_globals->_zoneFilename, 0, 430, 0, 0, 252); _vm->_fontManager->showText(5); - _vm->_globals._forceHideText = true; + _vm->_globals->_forceHideText = true; } - _vm->_globals._hotspotTextColor += 25; - if (_vm->_globals._hotspotTextColor > 100) - _vm->_globals._hotspotTextColor = 0; - _vm->_graphicsManager.SETCOLOR4(251, _vm->_globals._hotspotTextColor, _vm->_globals._hotspotTextColor, - _vm->_globals._hotspotTextColor); + _vm->_globals->_hotspotTextColor += 25; + if (_vm->_globals->_hotspotTextColor > 100) + _vm->_globals->_hotspotTextColor = 0; + _vm->_graphicsManager.SETCOLOR4(251, _vm->_globals->_hotspotTextColor, _vm->_globals->_hotspotTextColor, + _vm->_globals->_hotspotTextColor); if (_vm->_eventsManager->_mouseCursorId == 4) { if (ZONEP[zoneId]._verbFl1 == 2) { _vm->_eventsManager->changeMouseCursor(16); @@ -2885,14 +2885,14 @@ void LinesManager::checkZone() { } } _vm->_objectsManager._zoneNum = zoneId; - _vm->_globals._oldMouseX = mouseX; - _vm->_globals._oldMouseY = oldMouseY; - _vm->_globals._oldMouseZoneId = zoneId; - if (_vm->_globals._freezeCharacterFl && (_vm->_eventsManager->_mouseCursorId == 4)) { + _vm->_globals->_oldMouseX = mouseX; + _vm->_globals->_oldMouseY = oldMouseY; + _vm->_globals->_oldMouseZoneId = zoneId; + if (_vm->_globals->_freezeCharacterFl && (_vm->_eventsManager->_mouseCursorId == 4)) { if (zoneId != -1 && zoneId != 0) _vm->_objectsManager.handleRightButton(); } - if ((_vm->_globals._cityMapEnabledFl && zoneId == -1) || !zoneId) { + if ((_vm->_globals->_cityMapEnabledFl && zoneId == -1) || !zoneId) { _vm->_objectsManager.setVerb(0); _vm->_eventsManager->_mouseCursorId = 0; _vm->_eventsManager->changeMouseCursor(0); diff --git a/engines/hopkins/menu.cpp b/engines/hopkins/menu.cpp index eb3f7ef1db..eca853f799 100644 --- a/engines/hopkins/menu.cpp +++ b/engines/hopkins/menu.cpp @@ -57,34 +57,34 @@ int MenuManager::menu() { while (!g_system->getEventManager()->shouldQuit()) { _vm->_objectsManager._forestFl = false; _vm->_eventsManager->_breakoutFl = false; - _vm->_globals._disableInventFl = true; - _vm->_globals._exitId = 0; + _vm->_globals->_disableInventFl = true; + _vm->_globals->_exitId = 0; for (int idx = 0; idx < 31; ++idx) - _vm->_globals._inventory[idx] = 0; + _vm->_globals->_inventory[idx] = 0; - memset(_vm->_globals._saveData, 0, 2000); + memset(_vm->_globals->_saveData, 0, 2000); _vm->_objectsManager.addObject(14); memset(frameIndex, 0, sizeof(int) * ARRAYSIZE(frameIndex)); if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS) _vm->_graphicsManager.loadImage("MENU"); - else if (_vm->_globals._language == LANG_EN) + else if (_vm->_globals->_language == LANG_EN) _vm->_graphicsManager.loadImage("MENUAN"); - else if (_vm->_globals._language == LANG_FR) + else if (_vm->_globals->_language == LANG_FR) _vm->_graphicsManager.loadImage("MENUFR"); - else if (_vm->_globals._language == LANG_SP) + else if (_vm->_globals->_language == LANG_SP) _vm->_graphicsManager.loadImage("MENUES"); _vm->_graphicsManager.fadeInLong(); if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS) spriteData = _vm->_objectsManager.loadSprite("MENU.SPR"); - else if (_vm->_globals._language == LANG_EN) + else if (_vm->_globals->_language == LANG_EN) spriteData = _vm->_objectsManager.loadSprite("MENUAN.SPR"); - else if (_vm->_globals._language == LANG_FR) + else if (_vm->_globals->_language == LANG_FR) spriteData = _vm->_objectsManager.loadSprite("MENUFR.SPR"); - else if (_vm->_globals._language == LANG_SP) + else if (_vm->_globals->_language == LANG_SP) spriteData = _vm->_objectsManager.loadSprite("MENUES.SPR"); _vm->_eventsManager->mouseOn(); @@ -141,14 +141,14 @@ int MenuManager::menu() { result = 1; break; } else if (menuIndex == LOAD_GAME) { - _vm->_globals._exitId = -1; + _vm->_globals->_exitId = -1; _vm->_dialogsManager->showLoadGame(); - if (_vm->_globals._exitId != -1) { - result = _vm->_globals._exitId; + if (_vm->_globals->_exitId != -1) { + result = _vm->_globals->_exitId; break; } - _vm->_globals._exitId = 0; + _vm->_globals->_exitId = 0; } else if (menuIndex == OPTIONS) { _vm->_dialogsManager->showOptionsDialog(); } else if (menuIndex == INTRODUCTION) { @@ -159,8 +159,8 @@ int MenuManager::menu() { } } - _vm->_globals.freeMemory(spriteData); - _vm->_globals._disableInventFl = false; + _vm->_globals->freeMemory(spriteData); + _vm->_globals->_disableInventFl = false; _vm->_graphicsManager.fadeOutLong(); return result; } diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp index fee2f66b0f..ce4f06e490 100644 --- a/engines/hopkins/objects.cpp +++ b/engines/hopkins/objects.cpp @@ -84,9 +84,9 @@ ObjectsManager::ObjectsManager() { } ObjectsManager::~ObjectsManager() { - _vm->_globals.freeMemory(_forestSprite); - _vm->_globals.freeMemory(_gestureBuf); - _vm->_globals.freeMemory(_headSprites); + _vm->_globals->freeMemory(_forestSprite); + _vm->_globals->freeMemory(_gestureBuf); + _vm->_globals->freeMemory(_headSprites); } void ObjectsManager::setParent(HopkinsEngine *vm) { @@ -95,9 +95,9 @@ void ObjectsManager::setParent(HopkinsEngine *vm) { void ObjectsManager::clearAll() { _forestFl = false; - _forestSprite = _vm->_globals.freeMemory(_forestSprite); + _forestSprite = _vm->_globals->freeMemory(_forestSprite); _curGestureFile = 0; - _gestureBuf = _vm->_globals.freeMemory(_gestureBuf); + _gestureBuf = _vm->_globals->freeMemory(_gestureBuf); } /** @@ -110,35 +110,35 @@ void ObjectsManager::changeObject(int objIndex) { byte *ObjectsManager::loadObjectFromFile(int objIndex, bool mode) { byte *dataP = NULL; - int objectFileNum = _vm->_globals._objectAuthIcons[objIndex]._objectFileNum; - int idx = _vm->_globals._objectAuthIcons[objIndex]._idx; + int objectFileNum = _vm->_globals->_objectAuthIcons[objIndex]._objectFileNum; + int idx = _vm->_globals->_objectAuthIcons[objIndex]._idx; if (mode) ++idx; - if (objectFileNum != _vm->_globals._curObjectFileNum) { - if (_vm->_globals._objectDataBuf != g_PTRNUL) + if (objectFileNum != _vm->_globals->_curObjectFileNum) { + if (_vm->_globals->_objectDataBuf != g_PTRNUL) ObjectsManager::removeObjectDataBuf(); if (objectFileNum == 1) { - _vm->_globals._objectDataBuf = ObjectsManager::loadSprite("OBJET1.SPR"); + _vm->_globals->_objectDataBuf = ObjectsManager::loadSprite("OBJET1.SPR"); } - _vm->_globals._curObjectFileNum = objectFileNum; + _vm->_globals->_curObjectFileNum = objectFileNum; } - int width = ObjectsManager::getWidth(_vm->_globals._objectDataBuf, idx); - int height = ObjectsManager::getHeight(_vm->_globals._objectDataBuf, idx); - _vm->_globals._objectWidth = width; - _vm->_globals._objectHeight = height; + int width = ObjectsManager::getWidth(_vm->_globals->_objectDataBuf, idx); + int height = ObjectsManager::getHeight(_vm->_globals->_objectDataBuf, idx); + _vm->_globals->_objectWidth = width; + _vm->_globals->_objectHeight = height; if (mode) { - sprite_alone(_vm->_globals._objectDataBuf, _vm->_eventsManager->_objectBuf, idx); + sprite_alone(_vm->_globals->_objectDataBuf, _vm->_eventsManager->_objectBuf, idx); dataP = _vm->_eventsManager->_objectBuf; } else { - dataP = _vm->_globals.allocMemory(height * width); + dataP = _vm->_globals->allocMemory(height * width); if (dataP == g_PTRNUL) error("CAPTURE_OBJET"); - capture_mem_sprite(_vm->_globals._objectDataBuf, dataP, idx); + capture_mem_sprite(_vm->_globals->_objectDataBuf, dataP, idx); } return dataP; @@ -150,16 +150,16 @@ byte *ObjectsManager::loadObjectFromFile(int objIndex, bool mode) { void ObjectsManager::removeObject(int objIndex) { int idx; for (idx = 1; idx <= 32; ++idx) { - if (_vm->_globals._inventory[idx] == objIndex) + if (_vm->_globals->_inventory[idx] == objIndex) break; } if (idx <= 32) { if (idx == 32) { - _vm->_globals._inventory[32] = 0; + _vm->_globals->_inventory[32] = 0; } else { for (int i = idx; i < 32; ++i) - _vm->_globals._inventory[i] = _vm->_globals._inventory[i + 1]; + _vm->_globals->_inventory[i] = _vm->_globals->_inventory[i + 1]; } } changeObject(14); @@ -261,8 +261,8 @@ void ObjectsManager::capture_mem_sprite(const byte *objectData, byte *sprite, in } void ObjectsManager::removeObjectDataBuf() { - _vm->_globals._curObjectFileNum = 0; - _vm->_globals._objectDataBuf = _vm->_globals.freeMemory(_vm->_globals._objectDataBuf); + _vm->_globals->_curObjectFileNum = 0; + _vm->_globals->_objectDataBuf = _vm->_globals->freeMemory(_vm->_globals->_objectDataBuf); } /** @@ -279,11 +279,11 @@ void ObjectsManager::addObject(int objIndex) { int arrIndex = 0; for (;;) { ++arrIndex; - if ((!_vm->_globals._inventory[arrIndex]) || (arrIndex == 32)) + if ((!_vm->_globals->_inventory[arrIndex]) || (arrIndex == 32)) break; } - _vm->_globals._inventory[arrIndex] = objIndex; + _vm->_globals->_inventory[arrIndex] = objIndex; } /** @@ -296,7 +296,7 @@ void ObjectsManager::displaySprite() { uint16 arr[50]; // Handle copying any background areas that text are going to be drawn on - _vm->_globals._sortedDisplayCount = 0; + _vm->_globals->_sortedDisplayCount = 0; for (int idx = 0; idx <= 10; ++idx) { if (_vm->_fontManager->_textList[idx]._enabledFl && _vm->_fontManager->_text[idx]._textType != 2) { clipX = _vm->_fontManager->_textList[idx]._pos.x - 2; @@ -317,19 +317,19 @@ void ObjectsManager::displaySprite() { if (!PERSO_ON) { for (int idx = 0; idx < MAX_SPRITE; ++idx) { - if (_vm->_globals.Liste[idx]._visibleFl) { - clipX = _vm->_globals.Liste[idx]._posX - 2; + if (_vm->_globals->Liste[idx]._visibleFl) { + clipX = _vm->_globals->Liste[idx]._posX - 2; if (clipX < _vm->_graphicsManager._minX) clipX = _vm->_graphicsManager._minX; - clipY = _vm->_globals.Liste[idx]._posY - 2; + clipY = _vm->_globals->Liste[idx]._posY - 2; if (clipY < _vm->_graphicsManager._minY) clipY = _vm->_graphicsManager._minY; _vm->_graphicsManager.copySurface(_vm->_graphicsManager._vesaScreen, clipX, clipY, - _vm->_globals.Liste[idx]._width + 4, _vm->_globals.Liste[idx]._height + 4, + _vm->_globals->Liste[idx]._width + 4, _vm->_globals->Liste[idx]._height + 4, _vm->_graphicsManager._vesaBuffer, clipX, clipY); - _vm->_globals.Liste[idx]._visibleFl = false; + _vm->_globals->Liste[idx]._visibleFl = false; } } } @@ -340,7 +340,7 @@ void ObjectsManager::displaySprite() { if (!PERSO_ON) { // Handle drawing characters on the screen for (int idx = 0; idx < MAX_SPRITE; ++idx) { - _vm->_globals.Liste[idx]._visibleFl = false; + _vm->_globals->Liste[idx]._visibleFl = false; if (_sprite[idx]._animationType == 1) { computeSprite(idx); if (_sprite[idx]._activeFl) @@ -348,68 +348,68 @@ void ObjectsManager::displaySprite() { } } - if (_vm->_globals._hidingActiveFl) + if (_vm->_globals->_hidingActiveFl) checkHidingItem(); } - if (_priorityFl && _vm->_globals._sortedDisplayCount) { + if (_priorityFl && _vm->_globals->_sortedDisplayCount) { for (int i = 1; i <= 48; i++) arr[i] = i; do { loopCondFl = false; - for (int sortIdx = 1; sortIdx < _vm->_globals._sortedDisplayCount; sortIdx++) { - if (_vm->_globals._sortedDisplay[arr[sortIdx]]._priority > _vm->_globals._sortedDisplay[arr[sortIdx + 1]]._priority) { + for (int sortIdx = 1; sortIdx < _vm->_globals->_sortedDisplayCount; sortIdx++) { + if (_vm->_globals->_sortedDisplay[arr[sortIdx]]._priority > _vm->_globals->_sortedDisplay[arr[sortIdx + 1]]._priority) { SWAP(arr[sortIdx], arr[sortIdx + 1]); loopCondFl = true; } } } while (loopCondFl); - for (int sortIdx = 1; sortIdx < _vm->_globals._sortedDisplayCount + 1; sortIdx++) { + for (int sortIdx = 1; sortIdx < _vm->_globals->_sortedDisplayCount + 1; sortIdx++) { int idx = arr[sortIdx]; - switch (_vm->_globals._sortedDisplay[idx]._sortMode) { + switch (_vm->_globals->_sortedDisplay[idx]._sortMode) { case SORT_BOB: - setBobInfo(_vm->_globals._sortedDisplay[idx]._index); + setBobInfo(_vm->_globals->_sortedDisplay[idx]._index); break; case SORT_SPRITE: - DEF_SPRITE(_vm->_globals._sortedDisplay[idx]._index); + DEF_SPRITE(_vm->_globals->_sortedDisplay[idx]._index); break; case SORT_HIDING: - displayHiding(_vm->_globals._sortedDisplay[idx]._index); + displayHiding(_vm->_globals->_sortedDisplay[idx]._index); break; default: break; } - _vm->_globals._sortedDisplay[idx]._sortMode = SORT_NONE; + _vm->_globals->_sortedDisplay[idx]._sortMode = SORT_NONE; } } else { - for (int idx = 1; idx < _vm->_globals._sortedDisplayCount + 1; ++idx) { - switch (_vm->_globals._sortedDisplay[idx]._sortMode) { + for (int idx = 1; idx < _vm->_globals->_sortedDisplayCount + 1; ++idx) { + switch (_vm->_globals->_sortedDisplay[idx]._sortMode) { case SORT_BOB: - setBobInfo(_vm->_globals._sortedDisplay[idx]._index); + setBobInfo(_vm->_globals->_sortedDisplay[idx]._index); break; case SORT_SPRITE: - DEF_SPRITE(_vm->_globals._sortedDisplay[idx]._index); + DEF_SPRITE(_vm->_globals->_sortedDisplay[idx]._index); break; case SORT_HIDING: - displayHiding(_vm->_globals._sortedDisplay[idx]._index); + displayHiding(_vm->_globals->_sortedDisplay[idx]._index); break; default: break; } - _vm->_globals._sortedDisplay[idx]._sortMode = SORT_NONE; + _vm->_globals->_sortedDisplay[idx]._sortMode = SORT_NONE; } } // Reset the Sort array for (int idx = 0; idx < 50; ++idx) { - _vm->_globals._sortedDisplay[idx]._sortMode = SORT_NONE; - _vm->_globals._sortedDisplay[idx]._index = 0; - _vm->_globals._sortedDisplay[idx]._priority = 0; + _vm->_globals->_sortedDisplay[idx]._sortMode = SORT_NONE; + _vm->_globals->_sortedDisplay[idx]._index = 0; + _vm->_globals->_sortedDisplay[idx]._priority = 0; } - _vm->_globals._sortedDisplayCount = 0; + _vm->_globals->_sortedDisplayCount = 0; if (_vm->_dialogsManager->_inventDisplayedFl) { _vm->_graphicsManager.restoreSurfaceRect(_vm->_graphicsManager._vesaBuffer, _vm->_dialogsManager->_inventWin1, _vm->_dialogsManager->_inventX, _vm->_dialogsManager->_inventY, _vm->_dialogsManager->_inventWidth, _vm->_dialogsManager->_inventHeight); if (_oldBorderPos.x && _oldBorderPos.y) @@ -428,23 +428,23 @@ void ObjectsManager::displaySprite() { } // If the Options dialog is activated, draw the elements - if (_vm->_globals._optionDialogFl) { - _vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, _vm->_globals._optionDialogSpr, + if (_vm->_globals->_optionDialogFl) { + _vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, _vm->_globals->_optionDialogSpr, _vm->_eventsManager->_startPos.x + 464, 407, 0); - _vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, _vm->_globals._optionDialogSpr, - _vm->_eventsManager->_startPos.x + 657, 556, _vm->_globals._menuSpeed); - _vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, _vm->_globals._optionDialogSpr, - _vm->_eventsManager->_startPos.x + 731, 495, _vm->_globals._menuTextOff); - _vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, _vm->_globals._optionDialogSpr, - _vm->_eventsManager->_startPos.x + 731, 468, _vm->_globals._menuVoiceOff); - _vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, _vm->_globals._optionDialogSpr, - _vm->_eventsManager->_startPos.x + 731, 441, _vm->_globals._menuSoundOff); - _vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, _vm->_globals._optionDialogSpr, - _vm->_eventsManager->_startPos.x + 731, 414, _vm->_globals._menuMusicOff); - _vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, _vm->_globals._optionDialogSpr, - _vm->_eventsManager->_startPos.x + 600, 522, _vm->_globals._menuDisplayType); - _vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, _vm->_globals._optionDialogSpr, - _vm->_eventsManager->_startPos.x + 611, 502, _vm->_globals._menuScrollSpeed); + _vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, _vm->_globals->_optionDialogSpr, + _vm->_eventsManager->_startPos.x + 657, 556, _vm->_globals->_menuSpeed); + _vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, _vm->_globals->_optionDialogSpr, + _vm->_eventsManager->_startPos.x + 731, 495, _vm->_globals->_menuTextOff); + _vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, _vm->_globals->_optionDialogSpr, + _vm->_eventsManager->_startPos.x + 731, 468, _vm->_globals->_menuVoiceOff); + _vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, _vm->_globals->_optionDialogSpr, + _vm->_eventsManager->_startPos.x + 731, 441, _vm->_globals->_menuSoundOff); + _vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, _vm->_globals->_optionDialogSpr, + _vm->_eventsManager->_startPos.x + 731, 414, _vm->_globals->_menuMusicOff); + _vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, _vm->_globals->_optionDialogSpr, + _vm->_eventsManager->_startPos.x + 600, 522, _vm->_globals->_menuDisplayType); + _vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, _vm->_globals->_optionDialogSpr, + _vm->_eventsManager->_startPos.x + 611, 502, _vm->_globals->_menuScrollSpeed); _vm->_graphicsManager.addDirtyRect(_vm->_eventsManager->_startPos.x + 164, 107, _vm->_eventsManager->_startPos.x + 498, 320); } @@ -496,7 +496,7 @@ void ObjectsManager::initBob() { void ObjectsManager::resetBob(int idx) { BobItem &bob = _bob[idx]; - ListeItem &item = _vm->_globals.Liste2[idx]; + ListeItem &item = _vm->_globals->Liste2[idx]; bob._bobMode = 0; bob._spriteData = g_PTRNUL; @@ -540,38 +540,38 @@ void ObjectsManager::setBobInfo(int idx) { _bob[idx]._zoomOutFactor, _bob[idx]._zooInmFactor, _bob[idx]._flipFl); - _vm->_globals.Liste2[idx]._visibleFl = true; - _vm->_globals.Liste2[idx]._posX = xp; - _vm->_globals.Liste2[idx]._posY = yp; + _vm->_globals->Liste2[idx]._visibleFl = true; + _vm->_globals->Liste2[idx]._posX = xp; + _vm->_globals->Liste2[idx]._posY = yp; - _vm->_globals.Liste2[idx]._width = _bob[idx]._oldWidth; - _vm->_globals.Liste2[idx]._height = _bob[idx]._oldHeight; + _vm->_globals->Liste2[idx]._width = _bob[idx]._oldWidth; + _vm->_globals->Liste2[idx]._height = _bob[idx]._oldHeight; - if (_vm->_globals.Liste2[idx]._posX < _vm->_graphicsManager._minX) { - _vm->_globals.Liste2[idx]._width -= _vm->_graphicsManager._minX - _vm->_globals.Liste2[idx]._posX; - _vm->_globals.Liste2[idx]._posX = _vm->_graphicsManager._minX; + if (_vm->_globals->Liste2[idx]._posX < _vm->_graphicsManager._minX) { + _vm->_globals->Liste2[idx]._width -= _vm->_graphicsManager._minX - _vm->_globals->Liste2[idx]._posX; + _vm->_globals->Liste2[idx]._posX = _vm->_graphicsManager._minX; } - if (_vm->_globals.Liste2[idx]._posY < _vm->_graphicsManager._minY) { - _vm->_globals.Liste2[idx]._height -= _vm->_graphicsManager._minY - _vm->_globals.Liste2[idx]._posY; - _vm->_globals.Liste2[idx]._posY = _vm->_graphicsManager._minY; + if (_vm->_globals->Liste2[idx]._posY < _vm->_graphicsManager._minY) { + _vm->_globals->Liste2[idx]._height -= _vm->_graphicsManager._minY - _vm->_globals->Liste2[idx]._posY; + _vm->_globals->Liste2[idx]._posY = _vm->_graphicsManager._minY; } - if (_vm->_globals.Liste2[idx]._width + _vm->_globals.Liste2[idx]._posX > _vm->_graphicsManager._maxX) - _vm->_globals.Liste2[idx]._width = _vm->_graphicsManager._maxX - _vm->_globals.Liste2[idx]._posX; + if (_vm->_globals->Liste2[idx]._width + _vm->_globals->Liste2[idx]._posX > _vm->_graphicsManager._maxX) + _vm->_globals->Liste2[idx]._width = _vm->_graphicsManager._maxX - _vm->_globals->Liste2[idx]._posX; - if (_vm->_globals.Liste2[idx]._height + _vm->_globals.Liste2[idx]._posY > _vm->_graphicsManager._maxY) - _vm->_globals.Liste2[idx]._height = _vm->_graphicsManager._maxY - _vm->_globals.Liste2[idx]._posY; + if (_vm->_globals->Liste2[idx]._height + _vm->_globals->Liste2[idx]._posY > _vm->_graphicsManager._maxY) + _vm->_globals->Liste2[idx]._height = _vm->_graphicsManager._maxY - _vm->_globals->Liste2[idx]._posY; - if (_vm->_globals.Liste2[idx]._width <= 0 || _vm->_globals.Liste2[idx]._height <= 0) - _vm->_globals.Liste2[idx]._visibleFl = false; + if (_vm->_globals->Liste2[idx]._width <= 0 || _vm->_globals->Liste2[idx]._height <= 0) + _vm->_globals->Liste2[idx]._visibleFl = false; - if (_vm->_globals.Liste2[idx]._visibleFl) + if (_vm->_globals->Liste2[idx]._visibleFl) _vm->_graphicsManager.addDirtyRect( - _vm->_globals.Liste2[idx]._posX, - _vm->_globals.Liste2[idx]._posY, - _vm->_globals.Liste2[idx]._posX + _vm->_globals.Liste2[idx]._width, - _vm->_globals.Liste2[idx]._posY + _vm->_globals.Liste2[idx]._height); + _vm->_globals->Liste2[idx]._posX, + _vm->_globals->Liste2[idx]._posY, + _vm->_globals->Liste2[idx]._posX + _vm->_globals->Liste2[idx]._width, + _vm->_globals->Liste2[idx]._posY + _vm->_globals->Liste2[idx]._height); } void ObjectsManager::displayBob(int idx) { @@ -582,11 +582,11 @@ void ObjectsManager::displayBob(int idx) { resetBob(idx); - const byte *data = _vm->_globals._animBqe[idx]._data; + const byte *data = _vm->_globals->_animBqe[idx]._data; int bankIdx = READ_LE_INT16(data); if (!bankIdx) return; - if ((!_vm->_globals.Bank[bankIdx]._loadedFl) || (!READ_LE_UINT16(data + 24))) + if ((!_vm->_globals->Bank[bankIdx]._loadedFl) || (!READ_LE_UINT16(data + 24))) return; @@ -602,15 +602,15 @@ void ObjectsManager::displayBob(int idx) { _bob[idx]._isSpriteFl = false; - if (_vm->_globals.Bank[bankIdx]._fileHeader == 1) { + if (_vm->_globals->Bank[bankIdx]._fileHeader == 1) { _bob[idx]._isSpriteFl = true; _bob[idx]._zoomFactor = 0; _bob[idx]._flipFl = false; } - _bob[idx]._animData = _vm->_globals._animBqe[idx]._data; + _bob[idx]._animData = _vm->_globals->_animBqe[idx]._data; _bob[idx]._bobMode = 10; - _bob[idx]._spriteData = _vm->_globals.Bank[bankIdx]._data; + _bob[idx]._spriteData = _vm->_globals->Bank[bankIdx]._data; _bob[idx]._bobModeChange = v9; _bob[idx].field20 = v6; @@ -627,7 +627,7 @@ void ObjectsManager::setBobOffset(int idx, int offset) { } void ObjectsManager::SCBOB(int idx) { - HidingItem *hid = &_vm->_globals._hidingItem[idx]; + HidingItem *hid = &_vm->_globals->_hidingItem[idx]; if (hid->_useCount == 0) return; @@ -710,9 +710,9 @@ void ObjectsManager::CALCUL_BOB(int idx) { _bob[idx]._zooInmFactor = posZoom; _bob[idx]._zoomOutFactor = negZoom; - _vm->_globals.Liste2[idx]._visibleFl = true; - _vm->_globals.Liste2[idx]._posX = newX; - _vm->_globals.Liste2[idx]._posY = newY; + _vm->_globals->Liste2[idx]._visibleFl = true; + _vm->_globals->Liste2[idx]._posX = newX; + _vm->_globals->Liste2[idx]._posY = newY; int width = getWidth(_bob[idx]._spriteData, _bob[idx]._frameIndex); int height = getHeight(_bob[idx]._spriteData, _bob[idx]._frameIndex); @@ -726,15 +726,15 @@ void ObjectsManager::CALCUL_BOB(int idx) { width = _vm->_graphicsManager.zoomOut(width, negZoom); } - _vm->_globals.Liste2[idx]._width = width; - _vm->_globals.Liste2[idx]._height = height; + _vm->_globals->Liste2[idx]._width = width; + _vm->_globals->Liste2[idx]._height = height; _bob[idx]._oldWidth = width; _bob[idx]._oldHeight = height; } void ObjectsManager::checkHidingItem() { for (int hidingItemIdx = 0; hidingItemIdx <= 19; hidingItemIdx++) { - HidingItem *hid = &_vm->_globals._hidingItem[hidingItemIdx]; + HidingItem *hid = &_vm->_globals->_hidingItem[hidingItemIdx]; if (hid->_useCount == 0) continue; @@ -786,7 +786,7 @@ void ObjectsManager::DEF_SPRITE(int idx) { _vm->_graphicsManager.Affiche_Perfect(_vm->_graphicsManager._vesaBuffer, spr->_spriteData, spr->_destX + 300, spr->_destY + 300, spr->_spriteIndex, spr->_reducePct, spr->_zoomPct, spr->_flipFl); - ListeItem *list = &_vm->_globals.Liste[idx]; + ListeItem *list = &_vm->_globals->Liste[idx]; list->_width = spr->_width; list->_height = spr->_height; @@ -814,9 +814,9 @@ void ObjectsManager::DEF_SPRITE(int idx) { } void ObjectsManager::displayHiding(int idx) { - HidingItem *hid = &_vm->_globals._hidingItem[idx]; + HidingItem *hid = &_vm->_globals->_hidingItem[idx]; - _vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, _vm->_globals._hidingItemData[1], + _vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, _vm->_globals->_hidingItemData[1], hid->_x + 300, hid->_y + 300, hid->_spriteIndex); _vm->_graphicsManager.addDirtyRect(hid->_x, hid->_y, hid->_x + hid->_width, hid->_y + hid->_height); } @@ -888,9 +888,9 @@ void ObjectsManager::computeSprite(int idx) { spr->_zoomPct = zoomPercent; spr->_reducePct = reducePercent; - _vm->_globals.Liste[idx]._visibleFl = true; - _vm->_globals.Liste[idx]._posX = newPosX; - _vm->_globals.Liste[idx]._posY = newPosY; + _vm->_globals->Liste[idx]._visibleFl = true; + _vm->_globals->Liste[idx]._posX = newPosX; + _vm->_globals->Liste[idx]._posY = newPosY; int width = getWidth(spr->_spriteData, spr->_spriteIndex); int height = getHeight(spr->_spriteData, spr->_spriteIndex); @@ -909,12 +909,12 @@ void ObjectsManager::computeSprite(int idx) { // Before Sort void ObjectsManager::beforeSort(SortMode sortMode, int index, int priority) { - ++_vm->_globals._sortedDisplayCount; - assert (_vm->_globals._sortedDisplayCount <= 48); + ++_vm->_globals->_sortedDisplayCount; + assert (_vm->_globals->_sortedDisplayCount <= 48); - _vm->_globals._sortedDisplay[_vm->_globals._sortedDisplayCount]._sortMode = sortMode; - _vm->_globals._sortedDisplay[_vm->_globals._sortedDisplayCount]._index = index; - _vm->_globals._sortedDisplay[_vm->_globals._sortedDisplayCount]._priority = priority; + _vm->_globals->_sortedDisplay[_vm->_globals->_sortedDisplayCount]._sortMode = sortMode; + _vm->_globals->_sortedDisplay[_vm->_globals->_sortedDisplayCount]._index = index; + _vm->_globals->_sortedDisplay[_vm->_globals->_sortedDisplayCount]._priority = priority; } // Display BOB Anim @@ -951,8 +951,8 @@ void ObjectsManager::displayBobAnim() { byte *dataPtr = _bob[idx]._animData + 20; int dataIdx = _bob[idx]._animDataIdx; _bob[idx]._xp = READ_LE_INT16(dataPtr + 2 * dataIdx); - if (_vm->_globals._lockedAnims[idx]._enableFl) - _bob[idx]._xp = _vm->_globals._lockedAnims[idx]._posX; + if (_vm->_globals->_lockedAnims[idx]._enableFl) + _bob[idx]._xp = _vm->_globals->_lockedAnims[idx]._posX; if ( PERSO_ON && idx > 20 ) _bob[idx]._xp += _vm->_eventsManager->_startPos.x; @@ -964,7 +964,7 @@ void ObjectsManager::displayBobAnim() { _bob[idx]._animDataIdx += 5; if (_bob[idx]._moveChange1 > 0) { - _bob[idx]._moveChange1 /= _vm->_globals._speed; + _bob[idx]._moveChange1 /= _vm->_globals->_speed; if (_bob[idx]._moveChange1 > 0) { _bob[idx]._moveChange2 = 1; if (_bob[idx]._bobModeChange == 1 || _bob[idx]._bobModeChange == 2) @@ -984,8 +984,8 @@ void ObjectsManager::displayBobAnim() { byte *bobData = _bob[idx]._animData + 20; _bob[idx]._xp = READ_LE_INT16(bobData); - if (_vm->_globals._lockedAnims[idx]._enableFl) - _bob[idx]._xp = _vm->_globals._lockedAnims[idx]._posX; + if (_vm->_globals->_lockedAnims[idx]._enableFl) + _bob[idx]._xp = _vm->_globals->_lockedAnims[idx]._posX; if (PERSO_ON && idx > 20) _bob[idx]._xp += _vm->_eventsManager->_startPos.x; @@ -997,7 +997,7 @@ void ObjectsManager::displayBobAnim() { _bob[idx]._animDataIdx += 5; if (_bob[idx]._moveChange1 > 0) { - _bob[idx]._moveChange1 /= _vm->_globals._speed; + _bob[idx]._moveChange1 /= _vm->_globals->_speed; // Original code. It can't be negative, so the check is on == 0 if (_bob[idx]._moveChange1 <= 0) _bob[idx]._moveChange1 = 1; @@ -1023,25 +1023,25 @@ void ObjectsManager::displayBobAnim() { if (i > 20 || !PERSO_ON) { if ((_bob[i]._bobMode == 10) && (_bob[i]._bobMode10)) { if ((_bob[i]._bobModeChange != 2) && (_bob[i]._bobModeChange != 4)) { - if (_vm->_globals.Liste2[i]._visibleFl) { + if (_vm->_globals->Liste2[i]._visibleFl) { _vm->_graphicsManager.copySurface(_vm->_graphicsManager._vesaScreen, - _vm->_globals.Liste2[i]._posX, _vm->_globals.Liste2[i]._posY, - _vm->_globals.Liste2[i]._width, _vm->_globals.Liste2[i]._height, - _vm->_graphicsManager._vesaBuffer, _vm->_globals.Liste2[i]._posX, - _vm->_globals.Liste2[i]._posY); - _vm->_globals.Liste2[i]._visibleFl = false; + _vm->_globals->Liste2[i]._posX, _vm->_globals->Liste2[i]._posY, + _vm->_globals->Liste2[i]._width, _vm->_globals->Liste2[i]._height, + _vm->_graphicsManager._vesaBuffer, _vm->_globals->Liste2[i]._posX, + _vm->_globals->Liste2[i]._posY); + _vm->_globals->Liste2[i]._visibleFl = false; } } } if (_bob[i]._bobMode == 11) { - if (_vm->_globals.Liste2[i]._visibleFl) { + if (_vm->_globals->Liste2[i]._visibleFl) { _vm->_graphicsManager.copySurface(_vm->_graphicsManager._vesaScreen, - _vm->_globals.Liste2[i]._posX, _vm->_globals.Liste2[i]._posY, - _vm->_globals.Liste2[i]._width, _vm->_globals.Liste2[i]._height, + _vm->_globals->Liste2[i]._posX, _vm->_globals->Liste2[i]._posY, + _vm->_globals->Liste2[i]._width, _vm->_globals->Liste2[i]._height, _vm->_graphicsManager._vesaBuffer, - _vm->_globals.Liste2[i]._posX, _vm->_globals.Liste2[i]._posY); - _vm->_globals.Liste2[i]._visibleFl = false; + _vm->_globals->Liste2[i]._posX, _vm->_globals->Liste2[i]._posY); + _vm->_globals->Liste2[i]._visibleFl = false; } _bob[i]._bobMode = 0; @@ -1069,7 +1069,7 @@ void ObjectsManager::displayVBob() { int width, height; for (int idx = 0; idx <= 29; idx++) { - VBobItem *vbob = &_vm->_globals.VBob[idx]; + VBobItem *vbob = &_vm->_globals->VBob[idx]; if (vbob->_displayMode == 4) { width = getWidth(vbob->_spriteData, vbob->_frameIndex); height = getHeight(vbob->_spriteData, vbob->_frameIndex); @@ -1081,7 +1081,7 @@ void ObjectsManager::displayVBob() { vbob->_xp, vbob->_yp, width, height); _vm->_graphicsManager.addDirtyRect(vbob->_xp, vbob->_yp, vbob->_xp + width, height + vbob->_yp); - vbob->_surface = _vm->_globals.freeMemory(vbob->_surface); + vbob->_surface = _vm->_globals->freeMemory(vbob->_surface); vbob->_displayMode = 0; vbob->_spriteData = g_PTRNUL; @@ -1109,7 +1109,7 @@ void ObjectsManager::displayVBob() { vbob->_displayMode = 1; vbob->_oldSpriteData = vbob->_spriteData; - vbob->_surface = _vm->_globals.freeMemory(vbob->_surface); + vbob->_surface = _vm->_globals->freeMemory(vbob->_surface); vbob->_oldX = vbob->_xp; vbob->_oldY = vbob->_yp; @@ -1120,9 +1120,9 @@ void ObjectsManager::displayVBob() { width = getWidth(vbob->_spriteData, vbob->_frameIndex); height = getHeight(vbob->_spriteData, vbob->_frameIndex); - vbob->_surface = _vm->_globals.freeMemory(vbob->_surface); + vbob->_surface = _vm->_globals->freeMemory(vbob->_surface); - byte *surface = _vm->_globals.allocMemory(height * width); + byte *surface = _vm->_globals->allocMemory(height * width); vbob->_surface = surface; _vm->_graphicsManager.copySurfaceRect(_vm->_graphicsManager._vesaScreen, surface, @@ -1174,7 +1174,7 @@ void ObjectsManager::clearSprite() { } for (int idx = 0; idx < MAX_SPRITE; idx++) { - ListeItem *list = &_vm->_globals.Liste[idx]; + ListeItem *list = &_vm->_globals->Liste[idx]; list->_visibleFl = false; list->_posX = 0; list->_posY = 0; @@ -1259,8 +1259,8 @@ void ObjectsManager::GOHOME() { if (_vm->_linesManager._route == (RouteItem *)g_PTRNUL) return; - if (_vm->_globals.Compteur > 1) { - --_vm->_globals.Compteur; + if (_vm->_globals->Compteur > 1) { + --_vm->_globals->Compteur; return; } @@ -1271,8 +1271,8 @@ void ObjectsManager::GOHOME() { int oldPosX = 0; int oldPosY = 0; int oldFrameIdx = 0; - _vm->_globals.Compteur = 0; - if (_vm->_globals._oldDirection == DIR_NONE) { + _vm->_globals->Compteur = 0; + if (_vm->_globals->_oldDirection == DIR_NONE) { computeAndSetSpriteSize(); newPosX = _vm->_linesManager._route->_x; newPosY = _vm->_linesManager._route->_y; @@ -1280,25 +1280,25 @@ void ObjectsManager::GOHOME() { _vm->_linesManager._route++; if (newPosX != -1 || newPosY != -1) { - _vm->_globals._oldDirection = newDirection; - _vm->_globals._oldDirectionSpriteIdx = newDirection + 59; - _vm->_globals._oldFrameIndex = 0; + _vm->_globals->_oldDirection = newDirection; + _vm->_globals->_oldDirectionSpriteIdx = newDirection + 59; + _vm->_globals->_oldFrameIndex = 0; _oldCharacterPosX = newPosX; _oldCharacterPosY = newPosY; } else { - setSpriteIndex(0, _vm->_globals._oldDirection + 59); - _vm->_globals._actionDirection = DIR_NONE; + setSpriteIndex(0, _vm->_globals->_oldDirection + 59); + _vm->_globals->_actionDirection = DIR_NONE; int zoneId; - if (_vm->_globals._actionMoveTo) - zoneId = _vm->_globals._saveData->_data[svLastZoneNum]; + if (_vm->_globals->_actionMoveTo) + zoneId = _vm->_globals->_saveData->_data[svLastZoneNum]; else zoneId = _zoneNum; _vm->_linesManager._route = (RouteItem *)g_PTRNUL; computeAndSetSpriteSize(); setFlipSprite(0, false); - _vm->_globals.Compteur = 0; + _vm->_globals->Compteur = 0; _vm->_linesManager._route = (RouteItem *)g_PTRNUL; - _vm->_globals._oldDirection = DIR_NONE; + _vm->_globals->_oldDirection = DIR_NONE; if (zoneId > 0) { if (_vm->_linesManager.ZONEP[zoneId]._destX && _vm->_linesManager.ZONEP[zoneId]._destY && _vm->_linesManager.ZONEP[zoneId]._destY != 31) { if (_vm->_linesManager.ZONEP[zoneId]._spriteIndex == -1) { @@ -1307,22 +1307,22 @@ void ObjectsManager::GOHOME() { _vm->_linesManager.ZONEP[zoneId]._spriteIndex = 0; } else { setSpriteIndex(0, _vm->_linesManager.ZONEP[zoneId]._spriteIndex); - _vm->_globals._actionDirection = _vm->_linesManager.ZONEP[zoneId]._spriteIndex - 59; + _vm->_globals->_actionDirection = _vm->_linesManager.ZONEP[zoneId]._spriteIndex - 59; } } } } - _vm->_globals.Compteur = 0; + _vm->_globals->Compteur = 0; return; } - if (_vm->_globals._oldDirection == DIR_RIGHT) { - if (_vm->_globals._oldFrameIndex < 24 || _vm->_globals._oldFrameIndex > 35) { + if (_vm->_globals->_oldDirection == DIR_RIGHT) { + if (_vm->_globals->_oldFrameIndex < 24 || _vm->_globals->_oldFrameIndex > 35) { oldPosX = _oldCharacterPosX; oldPosY = _oldCharacterPosY; oldFrameIdx = 24; } else { - int deltaX = _vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedX; - int deltaY = _vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedY; + int deltaX = _vm->_globals->_hopkinsItem[_vm->_globals->_oldFrameIndex]._speedX; + int deltaY = _vm->_globals->_hopkinsItem[_vm->_globals->_oldFrameIndex]._speedY; if (_sprite[0]._zoomFactor < 0) { deltaX = _vm->_graphicsManager.zoomOut(deltaX, -_sprite[0]._zoomFactor); @@ -1333,20 +1333,20 @@ void ObjectsManager::GOHOME() { } oldPosX = _oldCharacterPosX + deltaX; oldPosY = _oldCharacterPosY + deltaY; - oldFrameIdx = _vm->_globals._oldFrameIndex + 1; + oldFrameIdx = _vm->_globals->_oldFrameIndex + 1; if (oldFrameIdx > 35) oldFrameIdx = 24; } - _vm->_globals.Compteur = 5 / _vm->_globals._speed; + _vm->_globals->Compteur = 5 / _vm->_globals->_speed; } - if (_vm->_globals._oldDirection == DIR_LEFT) { - if (_vm->_globals._oldFrameIndex < 24 || _vm->_globals._oldFrameIndex > 35) { + if (_vm->_globals->_oldDirection == DIR_LEFT) { + if (_vm->_globals->_oldFrameIndex < 24 || _vm->_globals->_oldFrameIndex > 35) { oldPosX = _oldCharacterPosX; oldPosY = _oldCharacterPosY; oldFrameIdx = 24; } else { - int deltaX = _vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedX; - int deltaY = _vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedY; + int deltaX = _vm->_globals->_hopkinsItem[_vm->_globals->_oldFrameIndex]._speedX; + int deltaY = _vm->_globals->_hopkinsItem[_vm->_globals->_oldFrameIndex]._speedY; if (_sprite[0]._zoomFactor < 0) { deltaX = _vm->_graphicsManager.zoomOut(deltaX, -_sprite[0]._zoomFactor); deltaY = _vm->_graphicsManager.zoomOut(deltaY, -_sprite[0]._zoomFactor); @@ -1356,19 +1356,19 @@ void ObjectsManager::GOHOME() { } oldPosX = _oldCharacterPosX - deltaX; oldPosY = _oldCharacterPosY - deltaY; - oldFrameIdx = _vm->_globals._oldFrameIndex + 1; + oldFrameIdx = _vm->_globals->_oldFrameIndex + 1; if (oldFrameIdx > 35) oldFrameIdx = 24; } - _vm->_globals.Compteur = 5 / _vm->_globals._speed; + _vm->_globals->Compteur = 5 / _vm->_globals->_speed; } - if (_vm->_globals._oldDirection == DIR_UP) { - if (_vm->_globals._oldFrameIndex > 11) { + if (_vm->_globals->_oldDirection == DIR_UP) { + if (_vm->_globals->_oldFrameIndex > 11) { oldPosX = _oldCharacterPosX; oldPosY = _oldCharacterPosY; oldFrameIdx = 0; } else { - int deltaY = abs(_vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedY); + int deltaY = abs(_vm->_globals->_hopkinsItem[_vm->_globals->_oldFrameIndex]._speedY); if (_sprite[0]._zoomFactor < 0) { deltaY = _vm->_graphicsManager.zoomOut(deltaY, -_sprite[0]._zoomFactor); } else if (_sprite[0]._zoomFactor > 0) { @@ -1376,20 +1376,20 @@ void ObjectsManager::GOHOME() { } oldPosX = _oldCharacterPosX; oldPosY = _oldCharacterPosY - deltaY; - oldFrameIdx = _vm->_globals._oldFrameIndex + 1; + oldFrameIdx = _vm->_globals->_oldFrameIndex + 1; if (oldFrameIdx > 11) oldFrameIdx = 0; } - _vm->_globals.Compteur = 4 / _vm->_globals._speed; + _vm->_globals->Compteur = 4 / _vm->_globals->_speed; } - if (_vm->_globals._oldDirection == DIR_DOWN) { - if (_vm->_globals._oldFrameIndex < 48 || _vm->_globals._oldFrameIndex > 59) { + if (_vm->_globals->_oldDirection == DIR_DOWN) { + if (_vm->_globals->_oldFrameIndex < 48 || _vm->_globals->_oldFrameIndex > 59) { oldPosX = _oldCharacterPosX; oldPosY = _oldCharacterPosY; oldFrameIdx = 48; } else { - int deltaY = abs(_vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedY); + int deltaY = abs(_vm->_globals->_hopkinsItem[_vm->_globals->_oldFrameIndex]._speedY); if (_sprite[0]._zoomFactor < 0) { deltaY = _vm->_graphicsManager.zoomOut(deltaY, -_sprite[0]._zoomFactor); } else if (_sprite[0]._zoomFactor > 0) { @@ -1397,20 +1397,20 @@ void ObjectsManager::GOHOME() { } oldPosX = _oldCharacterPosX; oldPosY = deltaY + _oldCharacterPosY; - oldFrameIdx = _vm->_globals._oldFrameIndex + 1; + oldFrameIdx = _vm->_globals->_oldFrameIndex + 1; if (oldFrameIdx > 59) oldFrameIdx = 48; } - _vm->_globals.Compteur = 4 / _vm->_globals._speed; + _vm->_globals->Compteur = 4 / _vm->_globals->_speed; } - if (_vm->_globals._oldDirection == DIR_UP_RIGHT) { - if (_vm->_globals._oldFrameIndex < 12 || _vm->_globals._oldFrameIndex > 23) { + if (_vm->_globals->_oldDirection == DIR_UP_RIGHT) { + if (_vm->_globals->_oldFrameIndex < 12 || _vm->_globals->_oldFrameIndex > 23) { oldPosX = _oldCharacterPosX; oldPosY = _oldCharacterPosY; oldFrameIdx = 12; } else { - int deltaX = _vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedX; - int deltaY = _vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedY; + int deltaX = _vm->_globals->_hopkinsItem[_vm->_globals->_oldFrameIndex]._speedX; + int deltaY = _vm->_globals->_hopkinsItem[_vm->_globals->_oldFrameIndex]._speedY; if (_sprite[0]._zoomFactor < 0) { deltaX = _vm->_graphicsManager.zoomOut(deltaX, -_sprite[0]._zoomFactor); deltaY = _vm->_graphicsManager.zoomOut(deltaY, -_sprite[0]._zoomFactor); @@ -1421,20 +1421,20 @@ void ObjectsManager::GOHOME() { } oldPosX = deltaX + _oldCharacterPosX; oldPosY = _oldCharacterPosY + deltaY; - oldFrameIdx = _vm->_globals._oldFrameIndex + 1; + oldFrameIdx = _vm->_globals->_oldFrameIndex + 1; if (oldFrameIdx > 23) oldFrameIdx = 12; } - _vm->_globals.Compteur = 5 / _vm->_globals._speed; + _vm->_globals->Compteur = 5 / _vm->_globals->_speed; } - if (_vm->_globals._oldDirection == DIR_UP_LEFT) { - if (_vm->_globals._oldFrameIndex < 12 || _vm->_globals._oldFrameIndex > 23) { + if (_vm->_globals->_oldDirection == DIR_UP_LEFT) { + if (_vm->_globals->_oldFrameIndex < 12 || _vm->_globals->_oldFrameIndex > 23) { oldPosX = _oldCharacterPosX; oldPosY = _oldCharacterPosY; oldFrameIdx = 12; } else { - int deltaX = _vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedX; - int deltaY = _vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedY; + int deltaX = _vm->_globals->_hopkinsItem[_vm->_globals->_oldFrameIndex]._speedX; + int deltaY = _vm->_globals->_hopkinsItem[_vm->_globals->_oldFrameIndex]._speedY; if (_sprite[0]._zoomFactor < 0) { deltaX = _vm->_graphicsManager.zoomOut(deltaX, -_sprite[0]._zoomFactor); deltaY = _vm->_graphicsManager.zoomOut(deltaY, -_sprite[0]._zoomFactor); @@ -1444,20 +1444,20 @@ void ObjectsManager::GOHOME() { } oldPosX = _oldCharacterPosX - deltaX; oldPosY = _oldCharacterPosY + deltaY; - oldFrameIdx = _vm->_globals._oldFrameIndex + 1; + oldFrameIdx = _vm->_globals->_oldFrameIndex + 1; if (oldFrameIdx > 23) oldFrameIdx = 12; } - _vm->_globals.Compteur = 5 / _vm->_globals._speed; + _vm->_globals->Compteur = 5 / _vm->_globals->_speed; } - if (_vm->_globals._oldDirection == DIR_DOWN_RIGHT) { - if (_vm->_globals._oldFrameIndex < 36 || _vm->_globals._oldFrameIndex > 47) { + if (_vm->_globals->_oldDirection == DIR_DOWN_RIGHT) { + if (_vm->_globals->_oldFrameIndex < 36 || _vm->_globals->_oldFrameIndex > 47) { oldPosX = _oldCharacterPosX; oldPosY = _oldCharacterPosY; oldFrameIdx = 36; } else { - int deltaX = _vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedX; - int deltaY = _vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedY; + int deltaX = _vm->_globals->_hopkinsItem[_vm->_globals->_oldFrameIndex]._speedX; + int deltaY = _vm->_globals->_hopkinsItem[_vm->_globals->_oldFrameIndex]._speedY; if (_sprite[0]._zoomFactor < 0) { deltaX = _vm->_graphicsManager.zoomOut(deltaX, -_sprite[0]._zoomFactor); deltaY = _vm->_graphicsManager.zoomOut(deltaY, -_sprite[0]._zoomFactor); @@ -1468,20 +1468,20 @@ void ObjectsManager::GOHOME() { } oldPosX = deltaX + _oldCharacterPosX; oldPosY = _oldCharacterPosY + deltaY; - oldFrameIdx = _vm->_globals._oldFrameIndex + 1; + oldFrameIdx = _vm->_globals->_oldFrameIndex + 1; if (oldFrameIdx > 47) oldFrameIdx = 36; } - _vm->_globals.Compteur = 5 / _vm->_globals._speed; + _vm->_globals->Compteur = 5 / _vm->_globals->_speed; } - if (_vm->_globals._oldDirection == DIR_DOWN_LEFT) { - if (_vm->_globals._oldFrameIndex < 36 || _vm->_globals._oldFrameIndex > 47) { + if (_vm->_globals->_oldDirection == DIR_DOWN_LEFT) { + if (_vm->_globals->_oldFrameIndex < 36 || _vm->_globals->_oldFrameIndex > 47) { oldPosX = _oldCharacterPosX; oldPosY = _oldCharacterPosY; oldFrameIdx = 36; } else { - int deltaX = _vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedX; - int deltaY = _vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedY; + int deltaX = _vm->_globals->_hopkinsItem[_vm->_globals->_oldFrameIndex]._speedX; + int deltaY = _vm->_globals->_hopkinsItem[_vm->_globals->_oldFrameIndex]._speedY; if (_sprite[0]._zoomFactor < 0) { deltaX = _vm->_graphicsManager.zoomOut(deltaX, -_sprite[0]._zoomFactor); deltaY = _vm->_graphicsManager.zoomOut(deltaY, -_sprite[0]._zoomFactor); @@ -1492,11 +1492,11 @@ void ObjectsManager::GOHOME() { } oldPosX = _oldCharacterPosX - deltaX; oldPosY = _oldCharacterPosY + deltaY; - oldFrameIdx = _vm->_globals._oldFrameIndex + 1; + oldFrameIdx = _vm->_globals->_oldFrameIndex + 1; if (oldFrameIdx > 47) oldFrameIdx = 36; } - _vm->_globals.Compteur = 5 / _vm->_globals._speed; + _vm->_globals->Compteur = 5 / _vm->_globals->_speed; } bool loopCond = false; do { @@ -1507,17 +1507,17 @@ void ObjectsManager::GOHOME() { if (newPosX == -1 && newPosY == -1) { int zoneId; - if (_vm->_globals._actionMoveTo) - zoneId = _vm->_globals._saveData->_data[svLastZoneNum]; + if (_vm->_globals->_actionMoveTo) + zoneId = _vm->_globals->_saveData->_data[svLastZoneNum]; else zoneId = _zoneNum; - setSpriteIndex(0, _vm->_globals._oldDirection + 59); - _vm->_globals._actionDirection = DIR_NONE; + setSpriteIndex(0, _vm->_globals->_oldDirection + 59); + _vm->_globals->_actionDirection = DIR_NONE; _vm->_linesManager._route = (RouteItem *)g_PTRNUL; computeAndSetSpriteSize(); setFlipSprite(0, false); - _vm->_globals.Compteur = 0; - _vm->_globals._oldDirection = DIR_NONE; + _vm->_globals->Compteur = 0; + _vm->_globals->_oldDirection = DIR_NONE; _oldCharacterPosX = getSpriteX(0); _oldCharacterPosY = getSpriteY(0); @@ -1529,45 +1529,45 @@ void ObjectsManager::GOHOME() { _vm->_linesManager.ZONEP[zoneId]._spriteIndex = 0; } else { setSpriteIndex(0, _vm->_linesManager.ZONEP[zoneId]._spriteIndex); - _vm->_globals._actionDirection = _vm->_linesManager.ZONEP[zoneId]._spriteIndex - 59; + _vm->_globals->_actionDirection = _vm->_linesManager.ZONEP[zoneId]._spriteIndex - 59; } } } - _vm->_globals.Compteur = 0; + _vm->_globals->Compteur = 0; return; } - if (_vm->_globals._oldDirection != newDirection) + if (_vm->_globals->_oldDirection != newDirection) break; - if ((newDirection == DIR_RIGHT && newPosX >= oldPosX) || (_vm->_globals._oldDirection == DIR_LEFT && newPosX <= oldPosX) || - (_vm->_globals._oldDirection == DIR_UP && newPosY <= oldPosY) || (_vm->_globals._oldDirection == DIR_DOWN && newPosY >= oldPosY) || - (_vm->_globals._oldDirection == DIR_UP_RIGHT && newPosX >= oldPosX) || (_vm->_globals._oldDirection == DIR_UP_LEFT && newPosX <= oldPosX) || - (_vm->_globals._oldDirection == DIR_DOWN_RIGHT && newPosX >= oldPosX) || (_vm->_globals._oldDirection == DIR_DOWN_LEFT && newPosX <= oldPosX)) + if ((newDirection == DIR_RIGHT && newPosX >= oldPosX) || (_vm->_globals->_oldDirection == DIR_LEFT && newPosX <= oldPosX) || + (_vm->_globals->_oldDirection == DIR_UP && newPosY <= oldPosY) || (_vm->_globals->_oldDirection == DIR_DOWN && newPosY >= oldPosY) || + (_vm->_globals->_oldDirection == DIR_UP_RIGHT && newPosX >= oldPosX) || (_vm->_globals->_oldDirection == DIR_UP_LEFT && newPosX <= oldPosX) || + (_vm->_globals->_oldDirection == DIR_DOWN_RIGHT && newPosX >= oldPosX) || (_vm->_globals->_oldDirection == DIR_DOWN_LEFT && newPosX <= oldPosX)) loopCond = true; } while (!loopCond); if (loopCond) { computeAndSetSpriteSize(); - if ((_vm->_globals._oldDirection == DIR_DOWN_LEFT) || (_vm->_globals._oldDirection == DIR_LEFT) || (_vm->_globals._oldDirection == DIR_UP_LEFT)) + if ((_vm->_globals->_oldDirection == DIR_DOWN_LEFT) || (_vm->_globals->_oldDirection == DIR_LEFT) || (_vm->_globals->_oldDirection == DIR_UP_LEFT)) setFlipSprite(0, true); - if ((_vm->_globals._oldDirection == DIR_UP) || (_vm->_globals._oldDirection == DIR_UP_RIGHT) || (_vm->_globals._oldDirection == DIR_RIGHT) || - (_vm->_globals._oldDirection == DIR_DOWN_RIGHT) || (_vm->_globals._oldDirection == DIR_DOWN)) + if ((_vm->_globals->_oldDirection == DIR_UP) || (_vm->_globals->_oldDirection == DIR_UP_RIGHT) || (_vm->_globals->_oldDirection == DIR_RIGHT) || + (_vm->_globals->_oldDirection == DIR_DOWN_RIGHT) || (_vm->_globals->_oldDirection == DIR_DOWN)) setFlipSprite(0, false); setSpriteX(0, newPosX); setSpriteY(0, newPosY); setSpriteIndex(0, oldFrameIdx); } else { - if ((_vm->_globals._oldDirection == DIR_DOWN_LEFT) || (_vm->_globals._oldDirection == DIR_LEFT) || (_vm->_globals._oldDirection == DIR_UP_LEFT)) + if ((_vm->_globals->_oldDirection == DIR_DOWN_LEFT) || (_vm->_globals->_oldDirection == DIR_LEFT) || (_vm->_globals->_oldDirection == DIR_UP_LEFT)) setFlipSprite(0, true); - if ((_vm->_globals._oldDirection == DIR_UP) || (_vm->_globals._oldDirection == DIR_UP_RIGHT) || (_vm->_globals._oldDirection == DIR_RIGHT) || - (_vm->_globals._oldDirection == DIR_DOWN_RIGHT) || (_vm->_globals._oldDirection == DIR_DOWN)) + if ((_vm->_globals->_oldDirection == DIR_UP) || (_vm->_globals->_oldDirection == DIR_UP_RIGHT) || (_vm->_globals->_oldDirection == DIR_RIGHT) || + (_vm->_globals->_oldDirection == DIR_DOWN_RIGHT) || (_vm->_globals->_oldDirection == DIR_DOWN)) setFlipSprite(0, false); - _vm->_globals.Compteur = 0; + _vm->_globals->Compteur = 0; } - _vm->_globals._oldDirection = newDirection; - _vm->_globals._oldDirectionSpriteIdx = newDirection + 59; - _vm->_globals._oldFrameIndex = oldFrameIdx; + _vm->_globals->_oldDirection = newDirection; + _vm->_globals->_oldDirectionSpriteIdx = newDirection + 59; + _vm->_globals->_oldFrameIndex = oldFrameIdx; _oldCharacterPosX = newPosX; _oldCharacterPosY = newPosY; } @@ -1577,9 +1577,9 @@ void ObjectsManager::GOHOME2() { return; int realSpeed = 2; - if (_vm->_globals._speed == 2) + if (_vm->_globals->_speed == 2) realSpeed = 4; - else if (_vm->_globals._speed == 3) + else if (_vm->_globals->_speed == 3) realSpeed = 6; int countColisionPixel = 0; @@ -1595,10 +1595,10 @@ void ObjectsManager::GOHOME2() { ++countColisionPixel; if (countColisionPixel >= realSpeed) { - _vm->_globals._lastDirection = newDirection; + _vm->_globals->_lastDirection = newDirection; setSpriteX(0, nexPosX); setSpriteY(0, newPosY); - switch (_vm->_globals._lastDirection) { + switch (_vm->_globals->_lastDirection) { case DIR_UP: setSpriteIndex(0, 4); break; @@ -1619,7 +1619,7 @@ void ObjectsManager::GOHOME2() { } } - switch (_vm->_globals._lastDirection) { + switch (_vm->_globals->_lastDirection) { case DIR_UP: setSpriteIndex(0, 0); break; @@ -1712,7 +1712,7 @@ void ObjectsManager::loadZone(const Common::String &file) { for (int i = 0; i < 100; i++) _vm->_linesManager.ZONEP[i + 1]._messageId = READ_LE_UINT16(verbData + 2 * i); - _vm->_globals.freeMemory(ptr); + _vm->_globals->freeMemory(ptr); _vm->_linesManager.CARRE_ZONE(); } @@ -1720,28 +1720,28 @@ void ObjectsManager::handleCityMap() { _vm->_dialogsManager->_inventFl = false; _vm->_eventsManager->_gameKey = KEY_NONE; _vm->_linesManager.setMaxLineIdx(1); - _vm->_globals._characterMaxPosY = 440; - _vm->_globals._cityMapEnabledFl = true; + _vm->_globals->_characterMaxPosY = 440; + _vm->_globals->_cityMapEnabledFl = true; _vm->_graphicsManager._noFadingFl = false; - _vm->_globals._freezeCharacterFl = false; + _vm->_globals->_freezeCharacterFl = false; _spritePtr = g_PTRNUL; - _vm->_globals._exitId = 0; - _vm->_globals._checkDistanceFl = true; + _vm->_globals->_exitId = 0; + _vm->_globals->_checkDistanceFl = true; _vm->_soundManager.playSound(31); - _vm->_globals.iRegul = 1; + _vm->_globals->iRegul = 1; _vm->_graphicsManager.loadImage("PLAN"); _vm->_linesManager.loadLines("PLAN.OB2"); - _vm->_globals.loadHidingItems("PLAN.CA2"); + _vm->_globals->loadHidingItems("PLAN.CA2"); loadZone("PLAN.ZO2"); _spritePtr = _vm->_fileManager->loadFile("VOITURE.SPR"); _vm->_animationManager->loadAnim("PLAN"); _vm->_graphicsManager.displayAllBob(); _vm->_graphicsManager.initScreen("PLAN", 2, false); for (int i = 0; i <= 15; i++) - _vm->_globals.B_CACHE_OFF(i); - _vm->_globals.B_CACHE_OFF(19); - _vm->_globals.B_CACHE_OFF(20); - _vm->_globals.enableHiding(); + _vm->_globals->B_CACHE_OFF(i); + _vm->_globals->B_CACHE_OFF(19); + _vm->_globals->B_CACHE_OFF(20); + _vm->_globals->enableHiding(); if (!_mapCarPosX && !_mapCarPosY) { _mapCarPosX = 900; @@ -1762,7 +1762,7 @@ void ObjectsManager::handleCityMap() { for (int i = 0; i <= 4; i++) _vm->_eventsManager->refreshScreenAndEvents(); - _vm->_globals.iRegul = 1; + _vm->_globals->iRegul = 1; _vm->_graphicsManager.fadeInLong(); _vm->_eventsManager->changeMouseCursor(4); _vm->_graphicsManager._noFadingFl = false; @@ -1772,19 +1772,19 @@ void ObjectsManager::handleCityMap() { int mouseButton = _vm->_eventsManager->getMouseButton(); if (mouseButton) { // First cop call : Go to the bank and free the hostages - if (_vm->_globals._saveData->_data[svBankAttackAnimPlayedFl] == 1 && !_vm->_globals._saveData->_data[svCopCall1PlayedFl]) { - _vm->_globals._saveData->_data[svCopCall1PlayedFl] = 1; - _vm->_globals._introSpeechOffFl = true; + if (_vm->_globals->_saveData->_data[svBankAttackAnimPlayedFl] == 1 && !_vm->_globals->_saveData->_data[svCopCall1PlayedFl]) { + _vm->_globals->_saveData->_data[svCopCall1PlayedFl] = 1; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("APPEL1.pe2"); - _vm->_globals._introSpeechOffFl = false; + _vm->_globals->_introSpeechOffFl = false; mouseButton = 0; } // Second cop call: Helico has been found in the empty lot - if (_vm->_globals._saveData->_data[svFreedHostageFl] == 1 && !_vm->_globals._saveData->_data[svCopCall2PlayedFl]) { - _vm->_globals._saveData->_data[svCopCall2PlayedFl] = 1; - _vm->_globals._introSpeechOffFl = true; + if (_vm->_globals->_saveData->_data[svFreedHostageFl] == 1 && !_vm->_globals->_saveData->_data[svCopCall2PlayedFl]) { + _vm->_globals->_saveData->_data[svCopCall2PlayedFl] = 1; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("APPEL2.pe2"); - _vm->_globals._introSpeechOffFl = false; + _vm->_globals->_introSpeechOffFl = false; mouseButton = 0; _vm->_eventsManager->_curMouseButton = 0; } @@ -1795,24 +1795,24 @@ void ObjectsManager::handleCityMap() { _vm->_linesManager.checkZone(); GOHOME2(); - if (_vm->_linesManager._route == (RouteItem *)g_PTRNUL && _vm->_globals._actionMoveTo) + if (_vm->_linesManager._route == (RouteItem *)g_PTRNUL && _vm->_globals->_actionMoveTo) PARADISE(); _vm->_eventsManager->refreshScreenAndEvents(); - if (_vm->_globals._exitId) + if (_vm->_globals->_exitId) loopCond = true; } while (!_vm->shouldQuit() && !loopCond); if (!_vm->_graphicsManager._noFadingFl) _vm->_graphicsManager.fadeOutLong(); - _vm->_globals.iRegul = 0; + _vm->_globals->iRegul = 0; _vm->_graphicsManager._noFadingFl = false; _mapCarPosX = getSpriteX(0); _mapCarPosY = getSpriteY(0); removeSprite(0); - _spritePtr = _vm->_globals.freeMemory(_spritePtr); + _spritePtr = _vm->_globals->freeMemory(_spritePtr); clearScreen(); - _vm->_globals._cityMapEnabledFl = false; + _vm->_globals->_cityMapEnabledFl = false; } /** @@ -1823,7 +1823,7 @@ void ObjectsManager::handleLeftButton() { int destX = _vm->_eventsManager->getMouseX(); int destY = _vm->_eventsManager->getMouseY(); - if (!_vm->_dialogsManager->_inventFl && !_vm->_globals._cityMapEnabledFl && + if (!_vm->_dialogsManager->_inventFl && !_vm->_globals->_cityMapEnabledFl && destX > _vm->_graphicsManager._scrollOffset - 30 && destX < _vm->_graphicsManager._scrollOffset + 50 && destY > -30 && destY < 50) { int oldMouseCursor = _vm->_eventsManager->_mouseCursorId; @@ -1831,35 +1831,35 @@ void ObjectsManager::handleLeftButton() { _vm->_dialogsManager->showInventory(); _vm->_dialogsManager->_inventFl = false; _vm->_eventsManager->_gameKey = KEY_NONE; - if (!_vm->_globals._exitId) { + if (!_vm->_globals->_exitId) { _vm->_dialogsManager->_inventFl = false; _vm->_eventsManager->_mouseCursorId = oldMouseCursor; } return; } - if (_vm->_globals._saveData->_data[svField354] == 1 && !_vm->_globals._cityMapEnabledFl + if (_vm->_globals->_saveData->_data[svField354] == 1 && !_vm->_globals->_cityMapEnabledFl && destX >= 533 && destX <= 559 && destY >= 26 && destY <= 59) { changeCharacterHead(CHARACTER_HOPKINS_CLONE, CHARACTER_HOPKINS); return; } - if (_vm->_globals._saveData->_data[svField356] == 1 && !_vm->_globals._cityMapEnabledFl + if (_vm->_globals->_saveData->_data[svField356] == 1 && !_vm->_globals->_cityMapEnabledFl && destX >= 533 && destX <= 559 && destY >= 26 && destY <= 48) { changeCharacterHead(CHARACTER_SAMANTHA, CHARACTER_HOPKINS); return; } - if (_vm->_globals._saveData->_data[svField357] == 1) { - if (_vm->_globals._saveData->_data[svField353] == 1 && !_vm->_globals._cityMapEnabledFl + if (_vm->_globals->_saveData->_data[svField357] == 1) { + if (_vm->_globals->_saveData->_data[svField353] == 1 && !_vm->_globals->_cityMapEnabledFl && destX >= 533 && destX <= 559 && destY >= 26 && destY <= 59) { changeCharacterHead(CHARACTER_HOPKINS, CHARACTER_HOPKINS_CLONE); return; } - if (_vm->_globals._saveData->_data[svField355] == 1 && !_vm->_globals._cityMapEnabledFl + if (_vm->_globals->_saveData->_data[svField355] == 1 && !_vm->_globals->_cityMapEnabledFl && destX >= 567 && destX <= 593 && destY >= 26 && destY <= 59) { changeCharacterHead(CHARACTER_HOPKINS, CHARACTER_SAMANTHA); return; } } - if (_vm->_globals._cityMapEnabledFl && _vm->_globals._actionMoveTo) { + if (_vm->_globals->_cityMapEnabledFl && _vm->_globals->_actionMoveTo) { _vm->_linesManager.checkZone(); if (_zoneNum <= 0) return; @@ -1872,14 +1872,14 @@ void ObjectsManager::handleLeftButton() { _vm->_linesManager._testRoute2[routeIdx].invalidate(); } - if (_vm->_globals._actionMoveTo) { + if (_vm->_globals->_actionMoveTo) { _vm->_linesManager.checkZone(); - _vm->_globals._actionMoveTo = false; - _vm->_globals._saveData->_data[svLastMouseCursor] = 0; - _vm->_globals._saveData->_data[svLastZoneNum] = 0; + _vm->_globals->_actionMoveTo = false; + _vm->_globals->_saveData->_data[svLastMouseCursor] = 0; + _vm->_globals->_saveData->_data[svLastZoneNum] = 0; } - if (_vm->_globals._cityMapEnabledFl && (_vm->_eventsManager->_mouseCursorId != 4 || _zoneNum <= 0)) + if (_vm->_globals->_cityMapEnabledFl && (_vm->_eventsManager->_mouseCursorId != 4 || _zoneNum <= 0)) return; if (_zoneNum != -1 && _zoneNum != 0) { if (_vm->_linesManager.ZONEP[_zoneNum]._destX && _vm->_linesManager.ZONEP[_zoneNum]._destY && _vm->_linesManager.ZONEP[_zoneNum]._destY != 31) { @@ -1887,65 +1887,65 @@ void ObjectsManager::handleLeftButton() { destY = _vm->_linesManager.ZONEP[_zoneNum]._destY; } } - _vm->_globals._actionMoveTo = false; + _vm->_globals->_actionMoveTo = false; RouteItem *oldRoute = _vm->_linesManager._route; _vm->_linesManager._route = (RouteItem *)g_PTRNUL; if (_forestFl && _zoneNum >= 20 && _zoneNum <= 23) { if (getSpriteY(0) > 374 && getSpriteY(0) <= 410) { _vm->_linesManager._route = (RouteItem *)g_PTRNUL; - setSpriteIndex(0, _vm->_globals._oldDirectionSpriteIdx); - _vm->_globals._actionDirection = DIR_NONE; + setSpriteIndex(0, _vm->_globals->_oldDirectionSpriteIdx); + _vm->_globals->_actionDirection = DIR_NONE; _vm->_linesManager._route = (RouteItem *)g_PTRNUL; computeAndSetSpriteSize(); setFlipSprite(0, false); - _vm->_globals.Compteur = 0; - _vm->_globals._oldDirection = DIR_NONE; + _vm->_globals->Compteur = 0; + _vm->_globals->_oldDirection = DIR_NONE; } else { _vm->_linesManager._route = _vm->_linesManager.PARCOURS2(getSpriteX(0), getSpriteY(0), getSpriteX(0), 390); if (_vm->_linesManager._route != (RouteItem *)g_PTRNUL) _vm->_linesManager.PACOURS_PROPRE(_vm->_linesManager._route); _oldCharacterPosX = getSpriteX(0); _oldCharacterPosY = getSpriteY(0); - _vm->_globals.Compteur = 0; + _vm->_globals->Compteur = 0; if (_vm->_linesManager._route != (RouteItem *)g_PTRNUL || oldRoute == _vm->_linesManager._route) { - _vm->_globals._oldDirection = DIR_NONE; + _vm->_globals->_oldDirection = DIR_NONE; } else { _vm->_linesManager._route = oldRoute; } } } else { - if (!_vm->_globals._freezeCharacterFl && !_vm->_globals._cityMapEnabledFl) { + if (!_vm->_globals->_freezeCharacterFl && !_vm->_globals->_cityMapEnabledFl) { _vm->_linesManager._route = _vm->_linesManager.PARCOURS2(getSpriteX(0), getSpriteY(0), destX, destY); if (_vm->_linesManager._route != (RouteItem *)g_PTRNUL) _vm->_linesManager.PACOURS_PROPRE(_vm->_linesManager._route); _oldCharacterPosX = getSpriteX(0); _oldCharacterPosY = getSpriteY(0); - _vm->_globals.Compteur = 0; + _vm->_globals->Compteur = 0; if (_vm->_linesManager._route != (RouteItem *)g_PTRNUL || oldRoute == _vm->_linesManager._route) - _vm->_globals._oldDirection = DIR_NONE; + _vm->_globals->_oldDirection = DIR_NONE; else _vm->_linesManager._route = oldRoute; } } - if (!_vm->_globals._freezeCharacterFl && _vm->_globals._cityMapEnabledFl) + if (!_vm->_globals->_freezeCharacterFl && _vm->_globals->_cityMapEnabledFl) _vm->_linesManager._route = _vm->_linesManager.cityMapCarRoute(getSpriteX(0), getSpriteY(0), destX, destY); if (_zoneNum != -1 && _zoneNum != 0) { if (_vm->_eventsManager->_mouseCursorId == 23) - _vm->_globals._saveData->_data[svLastMouseCursor] = 5; + _vm->_globals->_saveData->_data[svLastMouseCursor] = 5; else - _vm->_globals._saveData->_data[svLastMouseCursor] = _vm->_eventsManager->_mouseCursorId; + _vm->_globals->_saveData->_data[svLastMouseCursor] = _vm->_eventsManager->_mouseCursorId; - if (_vm->_globals._cityMapEnabledFl) - _vm->_globals._saveData->_data[svLastMouseCursor] = 6; - _vm->_globals._saveData->_data[svLastZoneNum] = _zoneNum; - _vm->_globals._saveData->_data[svLastObjectIndex] = _curObjectIndex; - _vm->_globals._actionMoveTo = true; + if (_vm->_globals->_cityMapEnabledFl) + _vm->_globals->_saveData->_data[svLastMouseCursor] = 6; + _vm->_globals->_saveData->_data[svLastZoneNum] = _zoneNum; + _vm->_globals->_saveData->_data[svLastObjectIndex] = _curObjectIndex; + _vm->_globals->_actionMoveTo = true; } _vm->_fontManager->hideText(5); _vm->_graphicsManager.SETCOLOR4(251, 100, 100, 100); - if (_vm->_globals._screenId == 20 && _vm->_globals._saveData->_data[svField132] == 1 + if (_vm->_globals->_screenId == 20 && _vm->_globals->_saveData->_data[svField132] == 1 && _curObjectIndex == 20 && _zoneNum == 12 && _vm->_eventsManager->_mouseCursorId == 23) { // Special case for throwing darts at the switch in Purgatory - the player shouldn't move @@ -1956,8 +1956,8 @@ void ObjectsManager::handleLeftButton() { } void ObjectsManager::PARADISE() { - char result = _vm->_globals._saveData->_data[svLastMouseCursor]; - if (result && _vm->_globals._saveData->_data[svLastZoneNum] && result != 4 && result > 3) { + char result = _vm->_globals->_saveData->_data[svLastMouseCursor]; + if (result && _vm->_globals->_saveData->_data[svLastZoneNum] && result != 4 && result > 3) { _vm->_fontManager->hideText(5); if (!_forestFl || _zoneNum < 20 || _zoneNum > 23) { if (_vm->_graphicsManager._largeScreenFl) { @@ -2004,20 +2004,20 @@ void ObjectsManager::PARADISE() { _vm->_eventsManager->refreshScreenAndEvents(); _vm->_graphicsManager._scrollStatus = 0; } - _vm->_talkManager.REPONSE(_vm->_globals._saveData->_data[svLastZoneNum], _vm->_globals._saveData->_data[svLastMouseCursor]); + _vm->_talkManager.REPONSE(_vm->_globals->_saveData->_data[svLastZoneNum], _vm->_globals->_saveData->_data[svLastMouseCursor]); } else { - _vm->_talkManager.REPONSE2(_vm->_globals._saveData->_data[svLastZoneNum], _vm->_globals._saveData->_data[svLastMouseCursor]); + _vm->_talkManager.REPONSE2(_vm->_globals->_saveData->_data[svLastZoneNum], _vm->_globals->_saveData->_data[svLastMouseCursor]); } _vm->_eventsManager->changeMouseCursor(4); if (_zoneNum != -1 && _zoneNum != 0 && !_vm->_linesManager.ZONEP[_zoneNum]._enabledFl) { _zoneNum = -1; _forceZoneFl = true; } - if (_zoneNum != _vm->_globals._saveData->_data[svLastZoneNum] || _zoneNum == -1 || _zoneNum == 0) { + if (_zoneNum != _vm->_globals->_saveData->_data[svLastZoneNum] || _zoneNum == -1 || _zoneNum == 0) { _vm->_eventsManager->_mouseCursorId = 4; _changeVerbFl = false; } else { - _vm->_eventsManager->_mouseCursorId = _vm->_globals._saveData->_data[svLastMouseCursor]; + _vm->_eventsManager->_mouseCursorId = _vm->_globals->_saveData->_data[svLastMouseCursor]; if (_changeVerbFl) { nextVerbIcon(); _changeVerbFl = false; @@ -2028,18 +2028,18 @@ void ObjectsManager::PARADISE() { if (_vm->_eventsManager->_mouseCursorId != 23) _vm->_eventsManager->changeMouseCursor(_vm->_eventsManager->_mouseCursorId); _zoneNum = 0; - _vm->_globals._saveData->_data[svLastMouseCursor] = 0; - _vm->_globals._saveData->_data[svLastZoneNum] = 0; + _vm->_globals->_saveData->_data[svLastMouseCursor] = 0; + _vm->_globals->_saveData->_data[svLastZoneNum] = 0; } - if (_vm->_globals._cityMapEnabledFl) { + if (_vm->_globals->_cityMapEnabledFl) { _vm->_eventsManager->_mouseCursorId = 0; _vm->_eventsManager->changeMouseCursor(0); } - if (_vm->_globals._freezeCharacterFl && _vm->_eventsManager->_mouseCursorId == 4) { + if (_vm->_globals->_freezeCharacterFl && _vm->_eventsManager->_mouseCursorId == 4) { if (_zoneNum != -1 && _zoneNum != 0) handleRightButton(); } - _vm->_globals._actionMoveTo = false; + _vm->_globals->_actionMoveTo = false; } /** @@ -2050,11 +2050,11 @@ void ObjectsManager::clearScreen() { _vm->_graphicsManager.endDisplayBob(); _vm->_fontManager->hideText(5); _vm->_fontManager->hideText(9); - _vm->_globals.clearVBob(); + _vm->_globals->clearVBob(); _vm->_animationManager->clearAnim(); _vm->_linesManager.clearAllZones(); _vm->_linesManager.resetLines(); - _vm->_globals.resetHidingItems(); + _vm->_globals->resetHidingItems(); for (int i = 0; i <= 48; i++) { _vm->_linesManager.BOBZONE[i] = 0; @@ -2067,17 +2067,17 @@ void ObjectsManager::clearScreen() { _vm->_linesManager.resetLinesNumb(); _vm->_linesManager.resetLastLine(); _vm->_linesManager._route = (RouteItem *)g_PTRNUL; - _vm->_globals._answerBuffer = _vm->_globals.freeMemory(_vm->_globals._answerBuffer); - _vm->_globals.SPRITE_ECRAN = _vm->_globals.freeMemory(_vm->_globals.SPRITE_ECRAN); + _vm->_globals->_answerBuffer = _vm->_globals->freeMemory(_vm->_globals->_answerBuffer); + _vm->_globals->SPRITE_ECRAN = _vm->_globals->freeMemory(_vm->_globals->SPRITE_ECRAN); _vm->_eventsManager->_startPos.x = 0; _vm->_eventsManager->_mouseSpriteId = 0; - _vm->_globals._saveData->_data[svLastMouseCursor] = 0; - _vm->_globals._saveData->_data[svLastZoneNum] = 0; - _vm->_globals._actionMoveTo = false; + _vm->_globals->_saveData->_data[svLastMouseCursor] = 0; + _vm->_globals->_saveData->_data[svLastZoneNum] = 0; + _vm->_globals->_actionMoveTo = false; _forceZoneFl = true; _changeVerbFl = false; _vm->_linesManager._route = (RouteItem *)g_PTRNUL; - _vm->_globals._oldDirection = DIR_NONE; + _vm->_globals->_oldDirection = DIR_NONE; _vm->_graphicsManager.resetDirtyRects(); } @@ -2092,17 +2092,17 @@ void ObjectsManager::changeCharacterHead(PlayerCharacter oldCharacter, PlayerCha _changeHeadFl = true; _vm->_graphicsManager.copySurface(_vm->_graphicsManager._vesaScreen, 532, 25, 65, 40, _vm->_graphicsManager._vesaBuffer, 532, 25); _vm->_graphicsManager.addDirtyRect(532, 25, 597, 65); - _vm->_globals._checkDistanceFl = true; + _vm->_globals->_checkDistanceFl = true; _vm->_linesManager._route = (RouteItem *)g_PTRNUL; if (oldCharacter == CHARACTER_SAMANTHA && newCharacter == CHARACTER_HOPKINS - && _vm->_globals._saveData->_realHopkins._location == _vm->_globals._screenId) { + && _vm->_globals->_saveData->_realHopkins._location == _vm->_globals->_screenId) { _changeHeadFl = false; - loc = &_vm->_globals._saveData->_samantha; + loc = &_vm->_globals->_saveData->_samantha; loc->_pos.x = getSpriteX(0); loc->_pos.y = getSpriteY(0); loc->_startSpriteIndex = 64; - loc->_location = _vm->_globals._screenId; + loc->_location = _vm->_globals->_screenId; loc->_zoomFactor = _sprite[0]._animationType; removeSprite(1); @@ -2110,24 +2110,24 @@ void ObjectsManager::changeCharacterHead(PlayerCharacter oldCharacter, PlayerCha animateSprite(1); removeSprite(0); - _vm->_globals._saveData->_data[svField354] = 0; - _vm->_globals._saveData->_data[svField356] = 0; - _vm->_globals._saveData->_data[svField357] = 1; + _vm->_globals->_saveData->_data[svField354] = 0; + _vm->_globals->_saveData->_data[svField356] = 0; + _vm->_globals->_saveData->_data[svField357] = 1; - loc = &_vm->_globals._saveData->_realHopkins; - _vm->_globals.PERSO = _vm->_fileManager->loadFile("PERSO.SPR"); - _vm->_globals._characterType = 0; - addStaticSprite(_vm->_globals.PERSO, loc->_pos, 0, 64, loc->_zoomFactor, false, 34, 190); + loc = &_vm->_globals->_saveData->_realHopkins; + _vm->_globals->PERSO = _vm->_fileManager->loadFile("PERSO.SPR"); + _vm->_globals->_characterType = 0; + addStaticSprite(_vm->_globals->PERSO, loc->_pos, 0, 64, loc->_zoomFactor, false, 34, 190); animateSprite(0); - _vm->_globals.loadCharacterData(); + _vm->_globals->loadCharacterData(); } else if (oldCharacter == CHARACTER_HOPKINS && newCharacter == CHARACTER_SAMANTHA - && _vm->_globals._saveData->_samantha._location == _vm->_globals._screenId) { + && _vm->_globals->_saveData->_samantha._location == _vm->_globals->_screenId) { _changeHeadFl = false; - loc = &_vm->_globals._saveData->_realHopkins; + loc = &_vm->_globals->_saveData->_realHopkins; loc->_pos.x = getSpriteX(0); loc->_pos.y = getSpriteY(0); loc->_startSpriteIndex = 64; - loc->_location = _vm->_globals._screenId; + loc->_location = _vm->_globals->_screenId; loc->_zoomFactor = _sprite[0]._zoomFactor; removeSprite(1); @@ -2135,40 +2135,40 @@ void ObjectsManager::changeCharacterHead(PlayerCharacter oldCharacter, PlayerCha animateSprite(1); removeSprite(0); - _vm->_globals._saveData->_data[svField354] = 0; - _vm->_globals._saveData->_data[svField356] = 1; - _vm->_globals._saveData->_data[svField357] = 0; + _vm->_globals->_saveData->_data[svField354] = 0; + _vm->_globals->_saveData->_data[svField356] = 1; + _vm->_globals->_saveData->_data[svField357] = 0; - loc = &_vm->_globals._saveData->_samantha; - _vm->_globals.PERSO = _vm->_fileManager->loadFile("PSAMAN.SPR"); - _vm->_globals._characterType = 2; - addStaticSprite(_vm->_globals.PERSO, loc->_pos, 0, 64, loc->_zoomFactor, false, 20, 127); + loc = &_vm->_globals->_saveData->_samantha; + _vm->_globals->PERSO = _vm->_fileManager->loadFile("PSAMAN.SPR"); + _vm->_globals->_characterType = 2; + addStaticSprite(_vm->_globals->PERSO, loc->_pos, 0, 64, loc->_zoomFactor, false, 20, 127); animateSprite(0); - _vm->_globals.loadCharacterData(); + _vm->_globals->loadCharacterData(); } else { switch (oldCharacter) { case CHARACTER_HOPKINS: - loc = &_vm->_globals._saveData->_realHopkins; + loc = &_vm->_globals->_saveData->_realHopkins; loc->_pos.x = getSpriteX(0); loc->_pos.y = getSpriteY(0); loc->_startSpriteIndex = 64; - loc->_location = _vm->_globals._screenId; + loc->_location = _vm->_globals->_screenId; loc->_zoomFactor = _sprite[0]._zoomFactor; break; case CHARACTER_HOPKINS_CLONE: - loc = &_vm->_globals._saveData->_cloneHopkins; + loc = &_vm->_globals->_saveData->_cloneHopkins; loc->_pos.x = getSpriteX(0); loc->_pos.y = getSpriteY(0); loc->_startSpriteIndex = 64; - loc->_location = _vm->_globals._screenId; + loc->_location = _vm->_globals->_screenId; loc->_zoomFactor = _sprite[0]._zoomFactor; break; case CHARACTER_SAMANTHA: - loc = &_vm->_globals._saveData->_samantha; + loc = &_vm->_globals->_saveData->_samantha; loc->_pos.x = getSpriteX(0); loc->_pos.y = getSpriteY(0); loc->_startSpriteIndex = 64; - loc->_location = _vm->_globals._screenId; + loc->_location = _vm->_globals->_screenId; loc->_zoomFactor = _sprite[0]._zoomFactor; break; default: @@ -2177,25 +2177,25 @@ void ObjectsManager::changeCharacterHead(PlayerCharacter oldCharacter, PlayerCha switch (newCharacter) { case CHARACTER_HOPKINS: - _vm->_globals._saveData->_data[svHopkinsCloneFl] = 0; - _vm->_globals._saveData->_data[svField354] = 0; - _vm->_globals._saveData->_data[svField356] = 0; - _vm->_globals._saveData->_data[svField357] = 1; - _vm->_globals._exitId = _vm->_globals._saveData->_realHopkins._location; + _vm->_globals->_saveData->_data[svHopkinsCloneFl] = 0; + _vm->_globals->_saveData->_data[svField354] = 0; + _vm->_globals->_saveData->_data[svField356] = 0; + _vm->_globals->_saveData->_data[svField357] = 1; + _vm->_globals->_exitId = _vm->_globals->_saveData->_realHopkins._location; break; case CHARACTER_HOPKINS_CLONE: - _vm->_globals._saveData->_data[svHopkinsCloneFl] = 1; - _vm->_globals._saveData->_data[svField354] = 1; - _vm->_globals._saveData->_data[svField356] = 0; - _vm->_globals._saveData->_data[svField357] = 0; - _vm->_globals._exitId = _vm->_globals._saveData->_cloneHopkins._location; + _vm->_globals->_saveData->_data[svHopkinsCloneFl] = 1; + _vm->_globals->_saveData->_data[svField354] = 1; + _vm->_globals->_saveData->_data[svField356] = 0; + _vm->_globals->_saveData->_data[svField357] = 0; + _vm->_globals->_exitId = _vm->_globals->_saveData->_cloneHopkins._location; break; case CHARACTER_SAMANTHA: - _vm->_globals._saveData->_data[svHopkinsCloneFl] = 0; - _vm->_globals._saveData->_data[svField354] = 0; - _vm->_globals._saveData->_data[svField356] = 1; - _vm->_globals._saveData->_data[svField357] = 0; - _vm->_globals._exitId = _vm->_globals._saveData->_samantha._location; + _vm->_globals->_saveData->_data[svHopkinsCloneFl] = 0; + _vm->_globals->_saveData->_data[svField354] = 0; + _vm->_globals->_saveData->_data[svField356] = 1; + _vm->_globals->_saveData->_data[svField357] = 0; + _vm->_globals->_exitId = _vm->_globals->_saveData->_samantha._location; break; } } @@ -2203,10 +2203,10 @@ void ObjectsManager::changeCharacterHead(PlayerCharacter oldCharacter, PlayerCha // Check Size void ObjectsManager::computeAndSetSpriteSize() { - int size = _vm->_globals._spriteSize[getSpriteY(0)]; - if (_vm->_globals._characterType == 1) { + int size = _vm->_globals->_spriteSize[getSpriteY(0)]; + if (_vm->_globals->_characterType == 1) { size = 20 * (5 * abs(size) - 100) / -80; - } else if (_vm->_globals._characterType == 2) { + } else if (_vm->_globals->_characterType == 2) { size = 20 * (5 * abs(size) - 165) / -67; } setSpriteZoom(0, size); @@ -2220,7 +2220,7 @@ void ObjectsManager::nextVerbIcon() { for(;;) { if (_vm->_eventsManager->_mouseCursorId == 4) { - if (!_vm->_globals._freezeCharacterFl || _zoneNum == -1 || _zoneNum == 0) + if (!_vm->_globals->_freezeCharacterFl || _zoneNum == -1 || _zoneNum == 0) return; ++_vm->_eventsManager->_mouseCursorId; @@ -2436,7 +2436,7 @@ void ObjectsManager::initBorder(int zoneIdx) { else if (zoneIdx == 32) _vm->_eventsManager->_mouseCursorId = 16; - if (zoneIdx >= 1 && zoneIdx <= 28 && !_vm->_globals._inventory[zoneIdx]) { + if (zoneIdx >= 1 && zoneIdx <= 28 && !_vm->_globals->_inventory[zoneIdx]) { _vm->_eventsManager->_mouseCursorId = 0; _borderPos = Common::Point(0, 0); _borderSpriteIndex = 0; @@ -2463,13 +2463,13 @@ void ObjectsManager::nextObjectIcon(int idx) { do { if (nextCursorId == 2 || nextCursorId == 5 || nextCursorId == 6) { _vm->_eventsManager->_mouseCursorId = 6; - if (_vm->_globals._objectAuthIcons[_vm->_globals._inventory[idx]]._flag1 == 1) + if (_vm->_globals->_objectAuthIcons[_vm->_globals->_inventory[idx]]._flag1 == 1) return; nextCursorId++; } if (nextCursorId == 7) { _vm->_eventsManager->_mouseCursorId = 7; - if (_vm->_globals._objectAuthIcons[_vm->_globals._inventory[idx]]._flag2 == 1) + if (_vm->_globals->_objectAuthIcons[_vm->_globals->_inventory[idx]]._flag2 == 1) return; nextCursorId++; } @@ -2479,35 +2479,35 @@ void ObjectsManager::nextObjectIcon(int idx) { } if (nextCursorId == 9 || nextCursorId == 10) { _vm->_eventsManager->_mouseCursorId = 10; - if (_vm->_globals._objectAuthIcons[_vm->_globals._inventory[idx]]._flag6 == 1) + if (_vm->_globals->_objectAuthIcons[_vm->_globals->_inventory[idx]]._flag6 == 1) return; nextCursorId = 11; } if (nextCursorId == 11) { _vm->_eventsManager->_mouseCursorId = 11; - if (_vm->_globals._objectAuthIcons[_vm->_globals._inventory[idx]]._flag3 == 1) + if (_vm->_globals->_objectAuthIcons[_vm->_globals->_inventory[idx]]._flag3 == 1) return; nextCursorId++; } if (nextCursorId == 12 || nextCursorId == 13) { _vm->_eventsManager->_mouseCursorId = 13; - if (_vm->_globals._objectAuthIcons[_vm->_globals._inventory[idx]]._flag4 == 1) + if (_vm->_globals->_objectAuthIcons[_vm->_globals->_inventory[idx]]._flag4 == 1) return; nextCursorId = 14; } if (nextCursorId == 14 || nextCursorId == 15) { _vm->_eventsManager->_mouseCursorId = 15; - if (_vm->_globals._objectAuthIcons[_vm->_globals._inventory[idx]]._flag5 == 1) + if (_vm->_globals->_objectAuthIcons[_vm->_globals->_inventory[idx]]._flag5 == 1) return; nextCursorId = 23; } if (nextCursorId >= 16 && nextCursorId <= 23) { _vm->_eventsManager->_mouseCursorId = 23; - if (_vm->_globals._objectAuthIcons[_vm->_globals._inventory[idx]]._flag5 == 2) + if (_vm->_globals->_objectAuthIcons[_vm->_globals->_inventory[idx]]._flag5 == 2) return; nextCursorId = 24; } @@ -2517,7 +2517,7 @@ void ObjectsManager::nextObjectIcon(int idx) { } nextCursorId = 6; - } while (_vm->_globals._objectAuthIcons[_vm->_globals._inventory[idx]]._flag6 != 2); + } while (_vm->_globals->_objectAuthIcons[_vm->_globals->_inventory[idx]]._flag6 != 2); } void ObjectsManager::takeInventoryObject(int idx) { @@ -2560,26 +2560,26 @@ void ObjectsManager::OPTI_OBJET() { break; } - _vm->_globals.freeMemory(data); + _vm->_globals->freeMemory(data); } void ObjectsManager::handleSpecialGames() { byte *oldPalette; - switch (_vm->_globals._screenId) { + switch (_vm->_globals->_screenId) { case 5: - if ((getSpriteY(0) > 399) || _vm->_globals._saveData->_data[svField173]) + if ((getSpriteY(0) > 399) || _vm->_globals->_saveData->_data[svField173]) break; - _vm->_globals._saveData->_data[svField173] = 1; - _vm->_globals._introSpeechOffFl = true; + _vm->_globals->_saveData->_data[svField173] = 1; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("flicspe1.pe2"); - _vm->_globals._introSpeechOffFl = false; + _vm->_globals->_introSpeechOffFl = false; - if (_vm->_globals._censorshipFl) + if (_vm->_globals->_censorshipFl) break; - oldPalette = _vm->_globals.allocMemory(1000); + oldPalette = _vm->_globals->allocMemory(1000); memcpy(oldPalette, _vm->_graphicsManager._palette, 769); _vm->_saveLoadManager.saveFile("TEMP1.SCR", _vm->_graphicsManager._vesaScreen, 307200); @@ -2602,7 +2602,7 @@ void ObjectsManager::handleSpecialGames() { PERSO_ON = false; memcpy(_vm->_graphicsManager._palette, oldPalette, 769); _vm->_graphicsManager.setPaletteVGA256(_vm->_graphicsManager._palette); - _vm->_globals.freeMemory(oldPalette); + _vm->_globals->freeMemory(oldPalette); _vm->_graphicsManager.lockScreen(); _vm->_graphicsManager.m_scroll16(_vm->_graphicsManager._vesaScreen, _vm->_eventsManager->_startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); _vm->_graphicsManager.unlockScreen(); @@ -2612,82 +2612,82 @@ void ObjectsManager::handleSpecialGames() { _vm->_graphicsManager.updateScreen(); break; case 20: - _vm->_globals._saveData->_data[svField132] = (getSpriteX(0) > 65 && getSpriteX(0) <= 124 && getSpriteY(0) > 372 && getSpriteY(0) <= 398) ? 1 : 0; + _vm->_globals->_saveData->_data[svField132] = (getSpriteX(0) > 65 && getSpriteX(0) <= 124 && getSpriteY(0) > 372 && getSpriteY(0) <= 398) ? 1 : 0; break; case 35: - if (_vm->_globals._prevScreenId == 16) + if (_vm->_globals->_prevScreenId == 16) handleForest(35, 500, 555, 100, 440, 1); - else if (_vm->_globals._prevScreenId == 36) + else if (_vm->_globals->_prevScreenId == 36) handleForest(35, 6, 84, 100, 440, 4); break; case 36: - if (_vm->_globals._prevScreenId == 35) + if (_vm->_globals->_prevScreenId == 35) handleForest(36, 551, 633, 100, 440, 2); - else if (_vm->_globals._prevScreenId == 37) + else if (_vm->_globals->_prevScreenId == 37) handleForest(36, 6, 84, 100, 440, 4); break; case 37: - if (_vm->_globals._prevScreenId == 36) + if (_vm->_globals->_prevScreenId == 36) handleForest(37, 551, 633, 100, 440, 1); - else if (_vm->_globals._prevScreenId == 38) + else if (_vm->_globals->_prevScreenId == 38) handleForest(37, 392, 529, 100, 440, 2); break; case 38: - if (_vm->_globals._prevScreenId == 37) + if (_vm->_globals->_prevScreenId == 37) handleForest(38, 133, 252, 100, 440, 4); - else if (_vm->_globals._prevScreenId == 39) + else if (_vm->_globals->_prevScreenId == 39) handleForest(38, 6, 84, 100, 440, 3); break; case 39: - if (_vm->_globals._prevScreenId == 38) + if (_vm->_globals->_prevScreenId == 38) handleForest(39, 551, 633, 100, 440, 2); - else if (_vm->_globals._prevScreenId == 40) + else if (_vm->_globals->_prevScreenId == 40) handleForest(39, 6, 84, 100, 440, 3); break; case 40: - if (_vm->_globals._prevScreenId == 39) + if (_vm->_globals->_prevScreenId == 39) handleForest(40, 133, 252, 100, 440, 4); - else if (_vm->_globals._prevScreenId == 41) + else if (_vm->_globals->_prevScreenId == 41) handleForest(40, 392, 529, 100, 440, 2); break; case 41: - if (_vm->_globals._prevScreenId == 40) + if (_vm->_globals->_prevScreenId == 40) handleForest(41, 551, 633, 100, 440, 1); - else if (_vm->_globals._prevScreenId == 17) + else if (_vm->_globals->_prevScreenId == 17) handleForest(41, 6, 84, 100, 440, 3); break; case 57: - _vm->_globals._disableInventFl = true; - if (_vm->_globals._saveData->_data[svField261] == 1 && getBobAnimDataIdx(5) == 37) { + _vm->_globals->_disableInventFl = true; + if (_vm->_globals->_saveData->_data[svField261] == 1 && getBobAnimDataIdx(5) == 37) { stopBobAnimation(5); setBobAnimDataIdx(5, 0); setBobAnimation(6); - _vm->_globals._saveData->_data[svField261] = 2; + _vm->_globals->_saveData->_data[svField261] = 2; _vm->_linesManager.disableZone(15); _vm->_soundManager.playSoundFile("SOUND75.WAV"); } - if (_vm->_globals._saveData->_data[svField261] == 2 && getBobAnimDataIdx(6) == 6) { + if (_vm->_globals->_saveData->_data[svField261] == 2 && getBobAnimDataIdx(6) == 6) { stopBobAnimation(6); setBobAnimDataIdx(6, 0); setBobAnimation(7); _vm->_linesManager.enableZone(14); - _vm->_globals._saveData->_data[svField261] = 3; + _vm->_globals->_saveData->_data[svField261] = 3; } - _vm->_globals._disableInventFl = false; + _vm->_globals->_disableInventFl = false; break; case 93: - if (_vm->_globals._saveData->_data[svField333]) + if (_vm->_globals->_saveData->_data[svField333]) break; - _vm->_globals._disableInventFl = true; + _vm->_globals->_disableInventFl = true; do _vm->_eventsManager->refreshScreenAndEvents(); while (getBobAnimDataIdx(8) != 3); - _vm->_globals._introSpeechOffFl = true; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("GM3.PE2"); stopBobAnimation(8); - _vm->_globals._saveData->_data[svField333] = 1; - _vm->_globals._disableInventFl = false; + _vm->_globals->_saveData->_data[svField333] = 1; + _vm->_globals->_disableInventFl = false; break; } } @@ -2708,7 +2708,7 @@ void ObjectsManager::VBOB(byte *src, int idx, int xp, int yp, int frameIndex) { if (idx > 29) error("MAX_VBOB exceeded"); - VBobItem *vbob = &_vm->_globals.VBob[idx]; + VBobItem *vbob = &_vm->_globals->VBob[idx]; if (vbob->_displayMode <= 1) { vbob->_displayMode = 1; vbob->_xp = xp; @@ -2719,7 +2719,7 @@ void ObjectsManager::VBOB(byte *src, int idx, int xp, int yp, int frameIndex) { vbob->_oldFrameIndex = frameIndex; vbob->_spriteData = src; vbob->_oldSpriteData = src; - vbob->_surface = _vm->_globals.freeMemory(vbob->_surface); + vbob->_surface = _vm->_globals->freeMemory(vbob->_surface); } else if (vbob->_displayMode == 2 || vbob->_displayMode == 4) { vbob->_displayMode = 3; vbob->_oldX = vbob->_xp; @@ -2737,7 +2737,7 @@ void ObjectsManager::VBOB_OFF(int idx) { if (idx > 29) error("MAX_VBOB exceeded"); - VBobItem *vbob = &_vm->_globals.VBob[idx]; + VBobItem *vbob = &_vm->_globals->VBob[idx]; if (vbob->_displayMode <= 1) vbob->_displayMode = 0; else @@ -2746,7 +2746,7 @@ void ObjectsManager::VBOB_OFF(int idx) { void ObjectsManager::doActionBack(int idx) { if (_curGestureFile != 1) { - _gestureBuf = _vm->_globals.freeMemory(_gestureBuf); + _gestureBuf = _vm->_globals->freeMemory(_gestureBuf); _curGestureFile = 1; _gestureBuf = _vm->_fileManager->loadFile("DOS.SPR"); } @@ -2787,7 +2787,7 @@ void ObjectsManager::doActionBack(int idx) { void ObjectsManager::doActionRight(int idx) { if (_curGestureFile != 3) { - _gestureBuf = _vm->_globals.freeMemory(_gestureBuf); + _gestureBuf = _vm->_globals->freeMemory(_gestureBuf); _curGestureFile = 3; _gestureBuf = _vm->_fileManager->loadFile("PROFIL.SPR"); } @@ -2828,7 +2828,7 @@ void ObjectsManager::doActionRight(int idx) { void ObjectsManager::doActionDiagRight(int idx) { if (_curGestureFile != 4) { - _gestureBuf = _vm->_globals.freeMemory(_gestureBuf); + _gestureBuf = _vm->_globals->freeMemory(_gestureBuf); _curGestureFile = 4; _gestureBuf = _vm->_fileManager->loadFile("3Q.SPR"); } @@ -2869,7 +2869,7 @@ void ObjectsManager::doActionDiagRight(int idx) { void ObjectsManager::doActionFront(int idx) { if (_curGestureFile != 2) { - _gestureBuf = _vm->_globals.freeMemory(_gestureBuf); + _gestureBuf = _vm->_globals->freeMemory(_gestureBuf); _curGestureFile = 2; _gestureBuf = _vm->_fileManager->loadFile("FACE.SPR"); } @@ -2892,7 +2892,7 @@ void ObjectsManager::doActionFront(int idx) { void ObjectsManager::doActionDiagLeft(int idx) { if (_curGestureFile != 4) { - _gestureBuf = _vm->_globals.freeMemory(_gestureBuf); + _gestureBuf = _vm->_globals->freeMemory(_gestureBuf); _curGestureFile = 4; _gestureBuf = _vm->_fileManager->loadFile("3Q.SPR"); } @@ -2933,7 +2933,7 @@ void ObjectsManager::doActionDiagLeft(int idx) { void ObjectsManager::doActionLeft(int idx) { if (_curGestureFile != 3) { - _gestureBuf = _vm->_globals.freeMemory(_gestureBuf); + _gestureBuf = _vm->_globals->freeMemory(_gestureBuf); _curGestureFile = 3; _gestureBuf = _vm->_fileManager->loadFile("PROFIL.SPR"); } @@ -3044,13 +3044,13 @@ void ObjectsManager::loadLinkFile(const Common::String &file) { Common::File f; Common::String filename = file + ".LNK"; byte *ptr = _vm->_fileManager->searchCat(filename, RES_LIN); - size_t nbytes = _vm->_globals._catalogSize; + size_t nbytes = _vm->_globals->_catalogSize; if (ptr == g_PTRNUL) { if (!f.open(filename)) error("Error opening file - %s", filename.c_str()); nbytes = f.size(); - ptr = _vm->_globals.allocMemory(nbytes); + ptr = _vm->_globals->allocMemory(nbytes); if (g_PTRNUL == ptr) error("INILINK"); _vm->_fileManager->readStream(f, ptr, nbytes); @@ -3058,36 +3058,36 @@ void ObjectsManager::loadLinkFile(const Common::String &file) { } if (!OBSSEUL) { for (int idx = 0; idx < 500; ++idx) - _vm->_globals._spriteSize[idx] = READ_LE_INT16((uint16 *)ptr + idx); + _vm->_globals->_spriteSize[idx] = READ_LE_INT16((uint16 *)ptr + idx); - _vm->_globals.resetHidingItems(); + _vm->_globals->resetHidingItems(); Common::String filename2 = Common::String((const char *)ptr + 1000); if (!filename2.empty()) { - _vm->_globals._hidingItemData[1] = _vm->_fileManager->searchCat(filename2, RES_SLI); + _vm->_globals->_hidingItemData[1] = _vm->_fileManager->searchCat(filename2, RES_SLI); - if (_vm->_globals._hidingItemData[1] || _vm->_globals._hidingItemData[1] == g_PTRNUL) { - _vm->_globals._hidingItemData[1] = _vm->_fileManager->loadFile(filename2); + if (_vm->_globals->_hidingItemData[1] || _vm->_globals->_hidingItemData[1] == g_PTRNUL) { + _vm->_globals->_hidingItemData[1] = _vm->_fileManager->loadFile(filename2); } else { - _vm->_globals._hidingItemData[1] = _vm->_fileManager->loadFile("RES_SLI.RES"); + _vm->_globals->_hidingItemData[1] = _vm->_fileManager->loadFile("RES_SLI.RES"); } int curDataCacheId = 60; byte *curDataPtr = ptr + 1000; for (int hidingIdx = 0; hidingIdx <= 21; hidingIdx++) { - HidingItem *hid = &_vm->_globals._hidingItem[hidingIdx]; + HidingItem *hid = &_vm->_globals->_hidingItem[hidingIdx]; int curSpriteId = READ_LE_INT16(curDataPtr + 2 * curDataCacheId); hid->_spriteIndex = curSpriteId; hid->_x = READ_LE_INT16(curDataPtr + 2 * curDataCacheId + 2); hid->_y = READ_LE_INT16(curDataPtr + 2 * curDataCacheId + 4); hid->_yOffset = READ_LE_INT16(curDataPtr + 2 * curDataCacheId + 8); - if (!_vm->_globals._hidingItemData[1]) { + if (!_vm->_globals->_hidingItemData[1]) { hid->_useCount = 0; } else { - hid->_spriteData = _vm->_globals._hidingItemData[1]; - hid->_width = getWidth(_vm->_globals._hidingItemData[1], curSpriteId); - hid->_height = getHeight(_vm->_globals._hidingItemData[1], curSpriteId); + hid->_spriteData = _vm->_globals->_hidingItemData[1]; + hid->_width = getWidth(_vm->_globals->_hidingItemData[1], curSpriteId); + hid->_height = getHeight(_vm->_globals->_hidingItemData[1], curSpriteId); hid->_useCount = 1; } if (!hid->_x && !hid->_y && !hid->_spriteIndex) @@ -3095,7 +3095,7 @@ void ObjectsManager::loadLinkFile(const Common::String &file) { curDataCacheId += 5; } - _vm->_globals.enableHiding(); + _vm->_globals->enableHiding(); } } @@ -3195,14 +3195,14 @@ void ObjectsManager::loadLinkFile(const Common::String &file) { } } } - _vm->_globals.freeMemory(ptr); + _vm->_globals->freeMemory(ptr); } void ObjectsManager::sceneSpecialIni() { - switch (_vm->_globals._screenId) { + switch (_vm->_globals->_screenId) { case 17: - if (_vm->_globals._prevScreenId == 20) { - _vm->_globals._disableInventFl = true; + if (_vm->_globals->_prevScreenId == 20) { + _vm->_globals->_disableInventFl = true; _vm->_graphicsManager.SETCOLOR3(252, 100, 100, 100); _vm->_graphicsManager.SETCOLOR3(253, 100, 100, 100); _vm->_graphicsManager.SETCOLOR3(251, 100, 100, 100); @@ -3213,19 +3213,19 @@ void ObjectsManager::sceneSpecialIni() { animateSprite(0); for (int i = 0; i <= 4; i++) _vm->_eventsManager->refreshScreenAndEvents(); - VBOB(_vm->_globals.SPRITE_ECRAN, 5, 15, 28, 1); + VBOB(_vm->_globals->SPRITE_ECRAN, 5, 15, 28, 1); _vm->_fontManager->hideText(9); bool displayedTxtFl = false; if (!_vm->_soundManager._textOffFl) { - _vm->_fontManager->initTextBuffers(9, 383, _vm->_globals._textFilename, 220, 72, 6, 36, 253); + _vm->_fontManager->initTextBuffers(9, 383, _vm->_globals->_textFilename, 220, 72, 6, 36, 253); _vm->_fontManager->showText(9); displayedTxtFl = true; } if (!_vm->_soundManager._voiceOffFl) _vm->_soundManager.mixVoice(383, 4, displayedTxtFl); - _vm->_globals._saveData->_data[svField270] = 1; - _vm->_globals._saveData->_data[svField300] = 1; - _vm->_globals._saveData->_data[svField320] = 1; + _vm->_globals->_saveData->_data[svField270] = 1; + _vm->_globals->_saveData->_data[svField300] = 1; + _vm->_globals->_saveData->_data[svField320] = 1; if (_vm->_soundManager._voiceOffFl) { for (int i = 0; i <= 199; i++) _vm->_eventsManager->refreshScreenAndEvents(); @@ -3235,23 +3235,23 @@ void ObjectsManager::sceneSpecialIni() { for (int i = 0; i <= 3; i++) _vm->_eventsManager->refreshScreenAndEvents(); _vm->_graphicsManager._noFadingFl = true; - _vm->_globals._disableInventFl = false; + _vm->_globals->_disableInventFl = false; } break; case 18: - if (_vm->_globals._prevScreenId == 17) { + if (_vm->_globals->_prevScreenId == 17) { _vm->_eventsManager->_mouseSpriteId = 4; for (int i = 0; i <= 4; i++) _vm->_eventsManager->refreshScreenAndEvents(); _vm->_graphicsManager.fadeInLong(); - _vm->_globals.iRegul = 1; - _vm->_globals._disableInventFl = false; + _vm->_globals->iRegul = 1; + _vm->_globals->_disableInventFl = false; _vm->_graphicsManager._noFadingFl = true; - _vm->_globals._introSpeechOffFl = true; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("MAGE1.pe2"); _vm->_graphicsManager._noFadingFl = true; - _vm->_globals._disableInventFl = false; + _vm->_globals->_disableInventFl = false; } break; @@ -3279,20 +3279,20 @@ void ObjectsManager::sceneSpecialIni() { _vm->_linesManager.ZONEP[22]._messageId = 30; _vm->_linesManager.ZONEP[23]._messageId = 30; for (int i = svField200; i <= svField214; i++) { - if (_vm->_globals._saveData->_data[i] != 2) - _vm->_globals._saveData->_data[i] = 0; + if (_vm->_globals->_saveData->_data[i] != 2) + _vm->_globals->_saveData->_data[i] = 0; } break; case 73: - if (!_vm->_globals._saveData->_data[svSecondElevatorAvailableFl]) { - _vm->_globals.resetHidingUseCount(0); - _vm->_globals.resetHidingUseCount(1); + if (!_vm->_globals->_saveData->_data[svSecondElevatorAvailableFl]) { + _vm->_globals->resetHidingUseCount(0); + _vm->_globals->resetHidingUseCount(1); } break; case 93: - if (!_vm->_globals._saveData->_data[svField333]) + if (!_vm->_globals->_saveData->_data[svField333]) setBobAnimation(8); break; } @@ -3444,9 +3444,9 @@ void ObjectsManager::enableVerb(int idx, int a2) { void ObjectsManager::ACTION(const byte *spriteData, const Common::String &actionStr, int speed, bool flipFl) { Common::String tmpStr = ""; int realSpeed = speed; - if (_vm->_globals._speed == 2) + if (_vm->_globals->_speed == 2) realSpeed = speed / 2; - else if (_vm->_globals._speed == 3) + else if (_vm->_globals->_speed == 3) realSpeed = speed / 3; const byte *oldSpriteData = _sprite[0]._spriteData; int spriteIndex = _sprite[0]._spriteIndex; @@ -3486,9 +3486,9 @@ void ObjectsManager::SPACTION(byte *spriteData, const Common::String &animationS Common::String tmpStr = ""; int realSpeed = speed; - if (_vm->_globals._speed == 2) + if (_vm->_globals->_speed == 2) realSpeed = speed / 2; - else if (_vm->_globals._speed == 3) + else if (_vm->_globals->_speed == 3) realSpeed = speed / 3; _oldSpriteData = _sprite[0]._spriteData; @@ -3527,9 +3527,9 @@ void ObjectsManager::SPACTION(byte *spriteData, const Common::String &animationS void ObjectsManager::SPACTION1(byte *spriteData, const Common::String &animString, int speed) { Common::String tmpStr = ""; int realSpeed = speed; - if (_vm->_globals._speed == 2) + if (_vm->_globals->_speed == 2) realSpeed = speed / 2; - else if (_vm->_globals._speed == 3) + else if (_vm->_globals->_speed == 3) realSpeed = speed / 3; int spriteIndex = 0; @@ -3568,10 +3568,10 @@ void ObjectsManager::SPACTION1(byte *spriteData, const Common::String &animStrin void ObjectsManager::handleForest(int screenId, int minX, int maxX, int minY, int maxY, int idx) { int savegameIdx = screenId; - if (_vm->_globals._screenId != screenId) + if (_vm->_globals->_screenId != screenId) return; - switch (_vm->_globals._screenId) { + switch (_vm->_globals->_screenId) { case 35: if (idx > 2) savegameIdx = 201; @@ -3616,25 +3616,25 @@ void ObjectsManager::handleForest(int screenId, int minX, int maxX, int minY, in break; } - if (_vm->_globals._saveData->_data[savegameIdx] == 2) + if (_vm->_globals->_saveData->_data[savegameIdx] == 2) return; - if (_vm->_globals._saveData->_data[savegameIdx]) { - if (_vm->_globals._saveData->_data[savegameIdx] == 1) { + if (_vm->_globals->_saveData->_data[savegameIdx]) { + if (_vm->_globals->_saveData->_data[savegameIdx] == 1) { if (((idx == 1 || idx == 2) && getBobAnimDataIdx(idx) == 26) || ((idx == 3 || idx == 4) && getBobAnimDataIdx(idx) == 27)) { _vm->_dialogsManager->_removeInventFl = true; _vm->_soundManager.playSample(1); - _vm->_globals._saveData->_data[savegameIdx] = 4; + _vm->_globals->_saveData->_data[savegameIdx] = 4; } } - if (_vm->_globals._saveData->_data[savegameIdx] == 4) { + if (_vm->_globals->_saveData->_data[savegameIdx] == 4) { if (idx >= 1 && idx <= 4 && getBobAnimDataIdx(idx) > 30) - _vm->_globals._saveData->_data[savegameIdx] = 3; + _vm->_globals->_saveData->_data[savegameIdx] = 3; } - if (_vm->_globals._saveData->_data[savegameIdx] == 3) { + if (_vm->_globals->_saveData->_data[savegameIdx] == 3) { _vm->_graphicsManager.FADE_LINUX = 2; _vm->_animationManager->playAnim("CREVE2.ANM", 100, 24, 500); - _vm->_globals._exitId = 150; + _vm->_globals->_exitId = 150; _vm->_graphicsManager._noFadingFl = true; hideBob(1); hideBob(2); @@ -3647,13 +3647,13 @@ void ObjectsManager::handleForest(int screenId, int minX, int maxX, int minY, in && maxY > getSpriteY(0)) { if (idx >= 1 && idx <= 4) setBobAnimation(idx); - _vm->_globals._saveData->_data[savegameIdx] = 1; + _vm->_globals->_saveData->_data[savegameIdx] = 1; } } void ObjectsManager::lockAnimX(int idx, int x) { - _vm->_globals._lockedAnims[idx]._enableFl = true; - _vm->_globals._lockedAnims[idx]._posX = x; + _vm->_globals->_lockedAnims[idx]._enableFl = true; + _vm->_globals->_lockedAnims[idx]._posX = x; } /** @@ -3665,12 +3665,12 @@ void ObjectsManager::PERSONAGE(const Common::String &backgroundFile, const Commo _vm->_eventsManager->_gameKey = KEY_NONE; _vm->_dialogsManager->_removeInventFl = false; _vm->_graphicsManager._scrollOffset = 0; - _vm->_globals._cityMapEnabledFl = false; - _vm->_globals.iRegul = 1; + _vm->_globals->_cityMapEnabledFl = false; + _vm->_globals->iRegul = 1; _vm->_soundManager.playSound(soundNum); _vm->_linesManager._route = (RouteItem *)g_PTRNUL; - _vm->_globals._freezeCharacterFl = true; - _vm->_globals._exitId = 0; + _vm->_globals->_freezeCharacterFl = true; + _vm->_globals->_exitId = 0; if (!backgroundFile.empty()) _vm->_graphicsManager.loadImage(backgroundFile); if (!linkFile.empty()) @@ -3685,8 +3685,8 @@ void ObjectsManager::PERSONAGE(const Common::String &backgroundFile, const Commo _vm->_graphicsManager.initScreen(s4, 2, initializeScreen); } _vm->_eventsManager->mouseOn(); - if (_vm->_globals._screenId == 61) { - addStaticSprite(_vm->_globals.PERSO, Common::Point(330, 418), 0, 60, 0, false, 34, 190); + if (_vm->_globals->_screenId == 61) { + addStaticSprite(_vm->_globals->PERSO, Common::Point(330, 418), 0, 60, 0, false, 34, 190); animateSprite(0); _vm->_linesManager._route = (RouteItem *)g_PTRNUL; computeAndSetSpriteSize(); @@ -3699,16 +3699,16 @@ void ObjectsManager::PERSONAGE(const Common::String &backgroundFile, const Commo for (int i = 0; i <= 4; i++) _vm->_eventsManager->refreshScreenAndEvents(); _vm->_graphicsManager.fadeInLong(); - if (_vm->_globals._screenId == 61) { + if (_vm->_globals->_screenId == 61) { _vm->_animationManager->playSequence("OUVRE.SEQ", 10, 4, 10); stopBobAnimation(3); - _vm->_globals._checkDistanceFl = true; + _vm->_globals->_checkDistanceFl = true; _oldCharacterPosX = getSpriteX(0); - _vm->_globals._oldDirection = DIR_NONE; - _vm->_globals.Compteur = 0; + _vm->_globals->_oldDirection = DIR_NONE; + _vm->_globals->Compteur = 0; _vm->_linesManager._route = (RouteItem *)g_PTRNUL; _vm->_linesManager._route = _vm->_linesManager.PARCOURS2(getSpriteX(0), getSpriteY(0), 330, 345); - _vm->_globals._checkDistanceFl = true; + _vm->_globals->_checkDistanceFl = true; do { GOHOME(); _vm->_eventsManager->refreshScreenAndEvents(); @@ -3724,12 +3724,12 @@ void ObjectsManager::PERSONAGE(const Common::String &backgroundFile, const Commo handleRightButton(); _vm->_dialogsManager->testDialogOpening(); _vm->_linesManager.checkZone(); - if (_vm->_globals._actionMoveTo) + if (_vm->_globals->_actionMoveTo) PARADISE(); - if (!_vm->_globals._exitId) + if (!_vm->_globals->_exitId) _vm->_eventsManager->refreshScreenAndEvents(); - if (_vm->_globals._exitId) + if (_vm->_globals->_exitId) break; } while (!_vm->shouldQuit()); if (_vm->shouldQuit()) @@ -3738,10 +3738,10 @@ void ObjectsManager::PERSONAGE(const Common::String &backgroundFile, const Commo _vm->_graphicsManager.fadeOutLong(); if (!animFile.empty()) _vm->_graphicsManager.endDisplayBob(); - if (_vm->_globals._screenId == 61) + if (_vm->_globals->_screenId == 61) removeSprite(0); clearScreen(); - _vm->_globals.iRegul = 0; + _vm->_globals->iRegul = 0; } /** @@ -3754,13 +3754,13 @@ void ObjectsManager::PERSONAGE2(const Common::String &backgroundFile, const Comm _verb = 4; _vm->_graphicsManager._scrollOffset = 0; _vm->_dialogsManager->_removeInventFl = false; - _vm->_globals._cityMapEnabledFl = false; + _vm->_globals->_cityMapEnabledFl = false; _vm->_graphicsManager._noFadingFl = false; - _vm->_globals._freezeCharacterFl = false; - _vm->_globals._exitId = 0; - _vm->_globals._checkDistanceFl = true; + _vm->_globals->_freezeCharacterFl = false; + _vm->_globals->_exitId = 0; + _vm->_globals->_checkDistanceFl = true; _vm->_soundManager.playSound(soundNum); - _vm->_globals.iRegul = 1; + _vm->_globals->iRegul = 1; if (!backgroundFile.empty()) _vm->_graphicsManager.loadImage(backgroundFile); if (!linkFile.empty()) @@ -3781,31 +3781,31 @@ void ObjectsManager::PERSONAGE2(const Common::String &backgroundFile, const Comm _vm->_graphicsManager.SETCOLOR3(253, 100, 100, 100); _vm->_graphicsManager.SETCOLOR3(251, 100, 100, 100); _vm->_graphicsManager.SETCOLOR3(254, 0, 0, 0); - if (_vm->_globals._characterType) { - if (!_vm->_globals._saveData->_data[svAlternateSpriteFl] && !_vm->_globals._saveData->_data[svField356]) { - _vm->_globals.PERSO = _vm->_fileManager->loadFile("PERSO.SPR"); - _vm->_globals._characterType = 0; + if (_vm->_globals->_characterType) { + if (!_vm->_globals->_saveData->_data[svAlternateSpriteFl] && !_vm->_globals->_saveData->_data[svField356]) { + _vm->_globals->PERSO = _vm->_fileManager->loadFile("PERSO.SPR"); + _vm->_globals->_characterType = 0; } } - if (!_vm->_globals._characterType && _vm->_globals._saveData->_data[svAlternateSpriteFl] == 1) { - _vm->_globals.PERSO = _vm->_fileManager->loadFile("HOPFEM.SPR"); - _vm->_globals._characterType = 1; + if (!_vm->_globals->_characterType && _vm->_globals->_saveData->_data[svAlternateSpriteFl] == 1) { + _vm->_globals->PERSO = _vm->_fileManager->loadFile("HOPFEM.SPR"); + _vm->_globals->_characterType = 1; } - if (_vm->_globals._characterType != 2 && _vm->_globals._saveData->_data[svField356] == 1) { - _vm->_globals.PERSO = _vm->_fileManager->loadFile("PSAMAN.SPR"); - _vm->_globals._characterType = 2; + if (_vm->_globals->_characterType != 2 && _vm->_globals->_saveData->_data[svField356] == 1) { + _vm->_globals->PERSO = _vm->_fileManager->loadFile("PSAMAN.SPR"); + _vm->_globals->_characterType = 2; } - _vm->_globals.loadCharacterData(); - switch (_vm->_globals._characterType) { + _vm->_globals->loadCharacterData(); + switch (_vm->_globals->_characterType) { case 0: - addStaticSprite(_vm->_globals.PERSO, _characterPos, 0, _startSpriteIndex, 0, false, 34, 190); + addStaticSprite(_vm->_globals->PERSO, _characterPos, 0, _startSpriteIndex, 0, false, 34, 190); break; case 1: - addStaticSprite(_vm->_globals.PERSO, _characterPos, 0, _startSpriteIndex, 0, false, 28, 155); + addStaticSprite(_vm->_globals->PERSO, _characterPos, 0, _startSpriteIndex, 0, false, 28, 155); break; case 2: - addStaticSprite(_vm->_globals.PERSO, _characterPos, 0, _startSpriteIndex, 0, false, 20, 127); + addStaticSprite(_vm->_globals->PERSO, _characterPos, 0, _startSpriteIndex, 0, false, 20, 127); break; } _vm->_eventsManager->setMouseXY(_characterPos); @@ -3813,20 +3813,20 @@ void ObjectsManager::PERSONAGE2(const Common::String &backgroundFile, const Comm _vm->_graphicsManager._scrollPosX = (int16)getSpriteX(0) - 320; computeAndSetSpriteSize(); animateSprite(0); - _vm->_globals.enableHiding(); + _vm->_globals->enableHiding(); _vm->_linesManager._route = (RouteItem *)g_PTRNUL; computeAndSetSpriteSize(); sceneSpecialIni(); _vm->_eventsManager->_mouseSpriteId = 4; _oldCharacterPosX = _characterPos.x; _oldCharacterPosY = _characterPos.y; - _vm->_globals._oldDirection = DIR_NONE; - _vm->_globals.Compteur = 0; + _vm->_globals->_oldDirection = DIR_NONE; + _vm->_globals->Compteur = 0; for (int idx = 0; idx < 5; ++idx) _vm->_eventsManager->refreshScreenAndEvents(); - _vm->_globals.iRegul = 1; + _vm->_globals->iRegul = 1; if (!_vm->_graphicsManager._noFadingFl) _vm->_graphicsManager.fadeInLong(); _vm->_graphicsManager._noFadingFl = false; @@ -3847,7 +3847,7 @@ void ObjectsManager::PERSONAGE2(const Common::String &backgroundFile, const Comm if ((xCheck == xp) && (yCheck == yp)) { _vm->_linesManager._route = (RouteItem *)g_PTRNUL; PARADISE(); - if (_vm->_globals._exitId) + if (_vm->_globals->_exitId) breakFlag = true; } xCheck = xp; @@ -3858,23 +3858,23 @@ void ObjectsManager::PERSONAGE2(const Common::String &backgroundFile, const Comm handleRightButton(); } } - if (!_vm->_globals._exitId) { + if (!_vm->_globals->_exitId) { _vm->_dialogsManager->testDialogOpening(); _vm->_linesManager.checkZone(); if (_vm->_linesManager._route == (RouteItem *)g_PTRNUL || (GOHOME(), _vm->_linesManager._route == (RouteItem *)g_PTRNUL)) { - if (_vm->_globals._actionMoveTo) + if (_vm->_globals->_actionMoveTo) PARADISE(); } handleSpecialGames(); _vm->_eventsManager->refreshScreenAndEvents(); - if (!_vm->_globals._exitId) + if (!_vm->_globals->_exitId) continue; } breakFlag = true; } - if (_vm->_globals._exitId != 8 || _vm->_globals._screenId != 5 || !_helicopterFl) { + if (_vm->_globals->_exitId != 8 || _vm->_globals->_screenId != 5 || !_helicopterFl) { if (!_vm->_graphicsManager._noFadingFl) _vm->_graphicsManager.fadeOutLong(); _vm->_graphicsManager._noFadingFl = false; @@ -3889,7 +3889,7 @@ void ObjectsManager::PERSONAGE2(const Common::String &backgroundFile, const Comm } else { _helicopterFl = false; } - _vm->_globals.iRegul = 0; + _vm->_globals->iRegul = 0; } void ObjectsManager::setVerb(int id) { diff --git a/engines/hopkins/saveload.cpp b/engines/hopkins/saveload.cpp index 78673f428d..35b41c7716 100644 --- a/engines/hopkins/saveload.cpp +++ b/engines/hopkins/saveload.cpp @@ -142,14 +142,14 @@ void SaveLoadManager::writeSavegameHeader(Common::OutSaveFile *out, hopkinsSaveg Common::Error SaveLoadManager::saveGame(int slot, const Common::String &saveName) { /* Pack any necessary data into the savegame data structure */ // Set the selected slot number - _vm->_globals._saveData->_data[svLastSavegameSlot] = slot; + _vm->_globals->_saveData->_data[svLastSavegameSlot] = slot; // Set up the inventory for (int i = 0; i < 35; ++i) - _vm->_globals._saveData->_inventory[i] = _vm->_globals._inventory[i]; + _vm->_globals->_saveData->_inventory[i] = _vm->_globals->_inventory[i]; - _vm->_globals._saveData->_mapCarPosX = _vm->_objectsManager._mapCarPosX; - _vm->_globals._saveData->_mapCarPosY = _vm->_objectsManager._mapCarPosY; + _vm->_globals->_saveData->_mapCarPosX = _vm->_objectsManager._mapCarPosX; + _vm->_globals->_saveData->_mapCarPosY = _vm->_objectsManager._mapCarPosY; /* Create the savegame */ Common::OutSaveFile *savefile = g_system->getSavefileManager()->openForSaving(_vm->generateSaveName(slot)); @@ -200,15 +200,15 @@ Common::Error SaveLoadManager::loadGame(int slot) { // Unpack the inventory for (int i = 0; i < 35; ++i) - _vm->_globals._inventory[i] = _vm->_globals._saveData->_inventory[i]; + _vm->_globals->_inventory[i] = _vm->_globals->_saveData->_inventory[i]; // Set variables from loaded data as necessary - _vm->_globals._saveData->_data[svLastSavegameSlot] = slot; - _vm->_globals._exitId = _vm->_globals._saveData->_data[svLastScreenId]; - _vm->_globals._saveData->_data[svLastPrevScreenId] = 0; - _vm->_globals._screenId = 0; - _vm->_objectsManager._mapCarPosX = _vm->_globals._saveData->_mapCarPosX; - _vm->_objectsManager._mapCarPosY = _vm->_globals._saveData->_mapCarPosY; + _vm->_globals->_saveData->_data[svLastSavegameSlot] = slot; + _vm->_globals->_exitId = _vm->_globals->_saveData->_data[svLastScreenId]; + _vm->_globals->_saveData->_data[svLastPrevScreenId] = 0; + _vm->_globals->_screenId = 0; + _vm->_objectsManager._mapCarPosX = _vm->_globals->_saveData->_mapCarPosX; + _vm->_objectsManager._mapCarPosY = _vm->_globals->_saveData->_mapCarPosY; return Common::kNoError; } @@ -259,19 +259,19 @@ void SaveLoadManager::createThumbnail(Graphics::Surface *s) { } void SaveLoadManager::syncSavegameData(Common::Serializer &s, int version) { - s.syncBytes(&_vm->_globals._saveData->_data[0], 2050); - syncCharacterLocation(s, _vm->_globals._saveData->_cloneHopkins); - syncCharacterLocation(s, _vm->_globals._saveData->_realHopkins); - syncCharacterLocation(s, _vm->_globals._saveData->_samantha); + s.syncBytes(&_vm->_globals->_saveData->_data[0], 2050); + syncCharacterLocation(s, _vm->_globals->_saveData->_cloneHopkins); + syncCharacterLocation(s, _vm->_globals->_saveData->_realHopkins); + syncCharacterLocation(s, _vm->_globals->_saveData->_samantha); for (int i = 0; i < 35; ++i) - s.syncAsSint16LE(_vm->_globals._saveData->_inventory[i]); + s.syncAsSint16LE(_vm->_globals->_saveData->_inventory[i]); if (version > 1) { - s.syncAsSint16LE(_vm->_globals._saveData->_mapCarPosX); - s.syncAsSint16LE(_vm->_globals._saveData->_mapCarPosY); + s.syncAsSint16LE(_vm->_globals->_saveData->_mapCarPosX); + s.syncAsSint16LE(_vm->_globals->_saveData->_mapCarPosY); } else { - _vm->_globals._saveData->_mapCarPosX = _vm->_globals._saveData->_mapCarPosY = 0; + _vm->_globals->_saveData->_mapCarPosX = _vm->_globals->_saveData->_mapCarPosY = 0; } } diff --git a/engines/hopkins/script.cpp b/engines/hopkins/script.cpp index 20bc7decc1..6de67dfbda 100644 --- a/engines/hopkins/script.cpp +++ b/engines/hopkins/script.cpp @@ -57,7 +57,7 @@ int ScriptManager::handleOpcode(byte *dataP) { int mesgId = READ_LE_INT16(dataP + 13); opcodeType = 1; if (!_tempObjectFl) { - if (_vm->_globals._saveData->_data[svField356] == 1) { + if (_vm->_globals->_saveData->_data[svField356] == 1) { if (mesgId == 53) mesgId = 644; if (mesgId == 624) @@ -136,15 +136,15 @@ int ScriptManager::handleOpcode(byte *dataP) { if (!_vm->_soundManager._textOffFl) { int textPosX = READ_LE_INT16(dataP + 9); int textPosY = READ_LE_INT16(dataP + 11); - _vm->_fontManager->initTextBuffers(9, mesgId, _vm->_globals._textFilename, 2 * textPosX, 2 * textPosY + 40, 6, dataP[7], 253); + _vm->_fontManager->initTextBuffers(9, mesgId, _vm->_globals->_textFilename, 2 * textPosX, 2 * textPosY + 40, 6, dataP[7], 253); _vm->_fontManager->showText(9); displayedTxtFl = true; } if (!_vm->_soundManager._voiceOffFl) _vm->_soundManager.mixVoice(mesgId, 4, displayedTxtFl); } else { // if (_tempObjectFl) - if (_vm->_globals._saveData->_data[svField356]) { - _vm->_fontManager->initTextBuffers(9, 635, _vm->_globals._textFilename, 55, 20, dataP[8], 35, 253); + if (_vm->_globals->_saveData->_data[svField356]) { + _vm->_fontManager->initTextBuffers(9, 635, _vm->_globals->_textFilename, 55, 20, dataP[8], 35, 253); bool displayedTxtFl = false; if (!_vm->_soundManager._textOffFl) { _vm->_fontManager->showText(9); @@ -155,11 +155,11 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_soundManager.mixVoice(635, 4, displayedTxtFl); } else { int textPosX = READ_LE_INT16(dataP + 9); - if (_vm->_globals._language == LANG_FR && !_vm->_soundManager._textOffFl) + if (_vm->_globals->_language == LANG_FR && !_vm->_soundManager._textOffFl) _vm->_fontManager->initTextBuffers(9, mesgId, "OBJET1.TXT", 2 * textPosX, 60, 6, dataP[7], 253); - else if (_vm->_globals._language == LANG_EN && !_vm->_soundManager._textOffFl) + else if (_vm->_globals->_language == LANG_EN && !_vm->_soundManager._textOffFl) _vm->_fontManager->initTextBuffers(9, mesgId, "OBJETAN.TXT", 2 * textPosX, 60, 6, dataP[7], 253); - else if (_vm->_globals._language == LANG_SP && !_vm->_soundManager._textOffFl) { + else if (_vm->_globals->_language == LANG_SP && !_vm->_soundManager._textOffFl) { _vm->_fontManager->initTextBuffers(9, mesgId, "OBJETES.TXT", 2 * textPosX, 60, 6, dataP[7], 253); } @@ -183,13 +183,13 @@ int ScriptManager::handleOpcode(byte *dataP) { int vbobPosX = READ_LE_INT16(dataP + 8); int vbobPosY = READ_LE_INT16(dataP + 10); if (vbobIdx == 52) { - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, vbobPosX, READ_LE_INT16(dataP + 10), vbobFrameIndex); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, vbobPosX, READ_LE_INT16(dataP + 10), vbobFrameIndex); } else if (vbobIdx == 51) { _vm->_objectsManager.BOB_VIVANT(vbobFrameIndex); } else if (vbobIdx != 50) { - _vm->_objectsManager.VBOB(_vm->_globals.SPRITE_ECRAN, vbobIdx, vbobPosX, vbobPosY, vbobFrameIndex); + _vm->_objectsManager.VBOB(_vm->_globals->SPRITE_ECRAN, vbobIdx, vbobPosX, vbobPosY, vbobFrameIndex); if (v4) - v4 /= _vm->_globals._speed; + v4 /= _vm->_globals->_speed; if (v4 > 1) { do { if (_vm->shouldQuit()) @@ -210,49 +210,49 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_objectsManager._characterPos.y = READ_LE_INT16(dataP + 8); _vm->_objectsManager._startSpriteIndex = dataP[5]; if (_vm->_objectsManager._changeHeadFl) { - if (_vm->_globals._saveData->_data[svField354] == 1 - && _vm->_globals._saveData->_cloneHopkins._pos.x && _vm->_globals._saveData->_cloneHopkins._pos.y - && _vm->_globals._saveData->_cloneHopkins._startSpriteIndex && _vm->_globals._saveData->_cloneHopkins._location) { + if (_vm->_globals->_saveData->_data[svField354] == 1 + && _vm->_globals->_saveData->_cloneHopkins._pos.x && _vm->_globals->_saveData->_cloneHopkins._pos.y + && _vm->_globals->_saveData->_cloneHopkins._startSpriteIndex && _vm->_globals->_saveData->_cloneHopkins._location) { - _vm->_objectsManager._characterPos = _vm->_globals._saveData->_cloneHopkins._pos; - _vm->_objectsManager._startSpriteIndex = _vm->_globals._saveData->_cloneHopkins._startSpriteIndex; + _vm->_objectsManager._characterPos = _vm->_globals->_saveData->_cloneHopkins._pos; + _vm->_objectsManager._startSpriteIndex = _vm->_globals->_saveData->_cloneHopkins._startSpriteIndex; } - if (_vm->_globals._saveData->_data[svField356] == 1 - && _vm->_globals._saveData->_samantha._pos.x && _vm->_globals._saveData->_samantha._pos.y - && _vm->_globals._saveData->_samantha._startSpriteIndex && _vm->_globals._saveData->_samantha._location) { - _vm->_objectsManager._characterPos = _vm->_globals._saveData->_samantha._pos; - _vm->_objectsManager._startSpriteIndex = _vm->_globals._saveData->_samantha._startSpriteIndex; + if (_vm->_globals->_saveData->_data[svField356] == 1 + && _vm->_globals->_saveData->_samantha._pos.x && _vm->_globals->_saveData->_samantha._pos.y + && _vm->_globals->_saveData->_samantha._startSpriteIndex && _vm->_globals->_saveData->_samantha._location) { + _vm->_objectsManager._characterPos = _vm->_globals->_saveData->_samantha._pos; + _vm->_objectsManager._startSpriteIndex = _vm->_globals->_saveData->_samantha._startSpriteIndex; } - if (_vm->_globals._saveData->_data[svField357] == 1 - && _vm->_globals._saveData->_realHopkins._pos.x && _vm->_globals._saveData->_realHopkins._pos.y - && _vm->_globals._saveData->_realHopkins._startSpriteIndex && _vm->_globals._saveData->_realHopkins._location) { - _vm->_objectsManager._characterPos = _vm->_globals._saveData->_realHopkins._pos; - _vm->_objectsManager._startSpriteIndex = _vm->_globals._saveData->_realHopkins._startSpriteIndex; + if (_vm->_globals->_saveData->_data[svField357] == 1 + && _vm->_globals->_saveData->_realHopkins._pos.x && _vm->_globals->_saveData->_realHopkins._pos.y + && _vm->_globals->_saveData->_realHopkins._startSpriteIndex && _vm->_globals->_saveData->_realHopkins._location) { + _vm->_objectsManager._characterPos = _vm->_globals->_saveData->_realHopkins._pos; + _vm->_objectsManager._startSpriteIndex = _vm->_globals->_saveData->_realHopkins._startSpriteIndex; } } - if (_vm->_globals._saveData->_data[svField356] == 1 - && _vm->_globals._saveData->_realHopkins._location == _vm->_globals._screenId) { + if (_vm->_globals->_saveData->_data[svField356] == 1 + && _vm->_globals->_saveData->_realHopkins._location == _vm->_globals->_screenId) { _vm->_objectsManager.addStaticSprite( _vm->_objectsManager._headSprites, - _vm->_globals._saveData->_realHopkins._pos, + _vm->_globals->_saveData->_realHopkins._pos, 1, 2, - _vm->_globals._saveData->_realHopkins._zoomFactor, + _vm->_globals->_saveData->_realHopkins._zoomFactor, false, 34, 190); _vm->_objectsManager.animateSprite(1); _vm->_objectsManager._twoCharactersFl = true; } - if (_vm->_globals._saveData->_data[svField357] == 1 - && _vm->_globals._saveData->_data[svField355] == 1 - && _vm->_globals._saveData->_samantha._location == _vm->_globals._screenId) { + if (_vm->_globals->_saveData->_data[svField357] == 1 + && _vm->_globals->_saveData->_data[svField355] == 1 + && _vm->_globals->_saveData->_samantha._location == _vm->_globals->_screenId) { _vm->_objectsManager.addStaticSprite( _vm->_objectsManager._headSprites, - _vm->_globals._saveData->_samantha._pos, + _vm->_globals->_saveData->_samantha._pos, 1, 3, - _vm->_globals._saveData->_samantha._zoomFactor, + _vm->_globals->_saveData->_samantha._zoomFactor, false, 20, 127); @@ -265,9 +265,9 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case MKTAG24('S', 'T', 'E'): if (!_vm->_objectsManager._disableFl) { - _vm->_globals._prevScreenId = _vm->_globals._screenId; - _vm->_globals._saveData->_data[svLastPrevScreenId] = _vm->_globals._screenId; - _vm->_globals._screenId = _vm->_globals._saveData->_data[svLastScreenId] = dataP[5]; + _vm->_globals->_prevScreenId = _vm->_globals->_screenId; + _vm->_globals->_saveData->_data[svLastPrevScreenId] = _vm->_globals->_screenId; + _vm->_globals->_screenId = _vm->_globals->_saveData->_data[svLastScreenId] = dataP[5]; vbobFrameIndex = dataP[6]; } opcodeType = 1; @@ -279,178 +279,178 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case MKTAG24('P', 'E', 'R'): { int specialOpcode = READ_LE_INT16(dataP + 5); - if (!_vm->_globals._saveData->_data[svAlternateSpriteFl] && !_vm->_globals._saveData->_data[svField356]) { + if (!_vm->_globals->_saveData->_data[svAlternateSpriteFl] && !_vm->_globals->_saveData->_data[svField356]) { vbobFrameIndex = 0; switch (specialOpcode) { case 1: case 14: - if (_vm->_globals._actionDirection == DIR_UP) + if (_vm->_globals->_actionDirection == DIR_UP) _vm->_objectsManager.doActionBack(4); - if (_vm->_globals._actionDirection == DIR_RIGHT) + if (_vm->_globals->_actionDirection == DIR_RIGHT) _vm->_objectsManager.doActionRight(4); - if (_vm->_globals._actionDirection == DIR_UP_RIGHT) + if (_vm->_globals->_actionDirection == DIR_UP_RIGHT) _vm->_objectsManager.doActionDiagRight(4); - if (_vm->_globals._actionDirection == DIR_DOWN) + if (_vm->_globals->_actionDirection == DIR_DOWN) _vm->_objectsManager.doActionFront(4); - if (_vm->_globals._actionDirection == DIR_UP_LEFT) + if (_vm->_globals->_actionDirection == DIR_UP_LEFT) _vm->_objectsManager.doActionDiagLeft(4); - if (_vm->_globals._actionDirection == DIR_LEFT) + if (_vm->_globals->_actionDirection == DIR_LEFT) _vm->_objectsManager.doActionLeft(4); break; case 2: - if (_vm->_globals._actionDirection == DIR_UP) + if (_vm->_globals->_actionDirection == DIR_UP) _vm->_objectsManager.doActionBack(7); - if (_vm->_globals._actionDirection == DIR_RIGHT) + if (_vm->_globals->_actionDirection == DIR_RIGHT) _vm->_objectsManager.doActionRight(7); - if (_vm->_globals._actionDirection == DIR_UP_RIGHT) + if (_vm->_globals->_actionDirection == DIR_UP_RIGHT) _vm->_objectsManager.doActionDiagRight(7); - if (_vm->_globals._actionDirection == DIR_DOWN) + if (_vm->_globals->_actionDirection == DIR_DOWN) _vm->_objectsManager.doActionFront(7); - if (_vm->_globals._actionDirection == DIR_UP_LEFT) + if (_vm->_globals->_actionDirection == DIR_UP_LEFT) _vm->_objectsManager.doActionDiagLeft(7); - if (_vm->_globals._actionDirection == DIR_LEFT) + if (_vm->_globals->_actionDirection == DIR_LEFT) _vm->_objectsManager.doActionLeft(7); - if (_vm->_globals._actionDirection == DIR_UP) + if (_vm->_globals->_actionDirection == DIR_UP) _vm->_objectsManager.doActionBack(8); - if (_vm->_globals._actionDirection == DIR_RIGHT) + if (_vm->_globals->_actionDirection == DIR_RIGHT) _vm->_objectsManager.doActionRight(8); - if (_vm->_globals._actionDirection == DIR_UP_RIGHT) + if (_vm->_globals->_actionDirection == DIR_UP_RIGHT) _vm->_objectsManager.doActionDiagRight(8); - if (_vm->_globals._actionDirection == DIR_DOWN) + if (_vm->_globals->_actionDirection == DIR_DOWN) _vm->_objectsManager.doActionFront(8); - if (_vm->_globals._actionDirection == DIR_UP_LEFT) + if (_vm->_globals->_actionDirection == DIR_UP_LEFT) _vm->_objectsManager.doActionDiagLeft(8); - if (_vm->_globals._actionDirection == DIR_LEFT) + if (_vm->_globals->_actionDirection == DIR_LEFT) _vm->_objectsManager.doActionLeft(8); break; case 19: case 4: - if (_vm->_globals._actionDirection == DIR_UP) + if (_vm->_globals->_actionDirection == DIR_UP) _vm->_objectsManager.doActionBack(1); - if (_vm->_globals._actionDirection == DIR_RIGHT) + if (_vm->_globals->_actionDirection == DIR_RIGHT) _vm->_objectsManager.doActionRight(1); - if (_vm->_globals._actionDirection == DIR_UP_RIGHT) + if (_vm->_globals->_actionDirection == DIR_UP_RIGHT) _vm->_objectsManager.doActionDiagRight(1); - if (_vm->_globals._actionDirection == DIR_DOWN) + if (_vm->_globals->_actionDirection == DIR_DOWN) _vm->_objectsManager.doActionFront(1); - if (_vm->_globals._actionDirection == DIR_UP_LEFT) + if (_vm->_globals->_actionDirection == DIR_UP_LEFT) _vm->_objectsManager.doActionDiagLeft(1); - if (_vm->_globals._actionDirection == DIR_LEFT) + if (_vm->_globals->_actionDirection == DIR_LEFT) _vm->_objectsManager.doActionLeft(1); break; case 5: - if (_vm->_globals._actionDirection == DIR_UP) + if (_vm->_globals->_actionDirection == DIR_UP) _vm->_objectsManager.doActionBack(5); - if (_vm->_globals._actionDirection == DIR_RIGHT) + if (_vm->_globals->_actionDirection == DIR_RIGHT) _vm->_objectsManager.doActionRight(5); - if (_vm->_globals._actionDirection == DIR_UP_RIGHT) + if (_vm->_globals->_actionDirection == DIR_UP_RIGHT) _vm->_objectsManager.doActionDiagRight(5); - if (_vm->_globals._actionDirection == DIR_DOWN) + if (_vm->_globals->_actionDirection == DIR_DOWN) _vm->_objectsManager.doActionFront(5); - if (_vm->_globals._actionDirection == DIR_UP_LEFT) + if (_vm->_globals->_actionDirection == DIR_UP_LEFT) _vm->_objectsManager.doActionDiagLeft(5); - if (_vm->_globals._actionDirection == DIR_LEFT) + if (_vm->_globals->_actionDirection == DIR_LEFT) _vm->_objectsManager.doActionLeft(5); - if (_vm->_globals._actionDirection == DIR_UP) + if (_vm->_globals->_actionDirection == DIR_UP) _vm->_objectsManager.doActionBack(6); - if (_vm->_globals._actionDirection == DIR_RIGHT) + if (_vm->_globals->_actionDirection == DIR_RIGHT) _vm->_objectsManager.doActionRight(6); - if (_vm->_globals._actionDirection == DIR_UP_RIGHT) + if (_vm->_globals->_actionDirection == DIR_UP_RIGHT) _vm->_objectsManager.doActionDiagRight(6); - if (_vm->_globals._actionDirection == DIR_DOWN) + if (_vm->_globals->_actionDirection == DIR_DOWN) _vm->_objectsManager.doActionFront(6); - if (_vm->_globals._actionDirection == DIR_UP_LEFT) + if (_vm->_globals->_actionDirection == DIR_UP_LEFT) _vm->_objectsManager.doActionDiagLeft(6); - if (_vm->_globals._actionDirection == DIR_LEFT) + if (_vm->_globals->_actionDirection == DIR_LEFT) _vm->_objectsManager.doActionLeft(6); break; case 17: case 7: - if (_vm->_globals._actionDirection == DIR_UP) + if (_vm->_globals->_actionDirection == DIR_UP) _vm->_objectsManager.doActionBack(2); - if (_vm->_globals._actionDirection == DIR_RIGHT) + if (_vm->_globals->_actionDirection == DIR_RIGHT) _vm->_objectsManager.doActionRight(2); - if (_vm->_globals._actionDirection == DIR_UP_RIGHT) + if (_vm->_globals->_actionDirection == DIR_UP_RIGHT) _vm->_objectsManager.doActionDiagRight(2); - if (_vm->_globals._actionDirection == DIR_DOWN) + if (_vm->_globals->_actionDirection == DIR_DOWN) _vm->_objectsManager.doActionFront(2); - if (_vm->_globals._actionDirection == DIR_UP_LEFT) + if (_vm->_globals->_actionDirection == DIR_UP_LEFT) _vm->_objectsManager.doActionDiagLeft(2); - if (_vm->_globals._actionDirection == DIR_LEFT) + if (_vm->_globals->_actionDirection == DIR_LEFT) _vm->_objectsManager.doActionLeft(2); break; case 18: case 8: - if (_vm->_globals._actionDirection == DIR_UP) + if (_vm->_globals->_actionDirection == DIR_UP) _vm->_objectsManager.doActionBack(3); - if (_vm->_globals._actionDirection == DIR_RIGHT) + if (_vm->_globals->_actionDirection == DIR_RIGHT) _vm->_objectsManager.doActionRight(3); - if (_vm->_globals._actionDirection == DIR_UP_RIGHT) + if (_vm->_globals->_actionDirection == DIR_UP_RIGHT) _vm->_objectsManager.doActionDiagRight(3); - if (_vm->_globals._actionDirection == DIR_DOWN) + if (_vm->_globals->_actionDirection == DIR_DOWN) _vm->_objectsManager.doActionFront(3); - if (_vm->_globals._actionDirection == DIR_UP_LEFT) + if (_vm->_globals->_actionDirection == DIR_UP_LEFT) _vm->_objectsManager.doActionDiagLeft(3); - if (_vm->_globals._actionDirection == DIR_LEFT) + if (_vm->_globals->_actionDirection == DIR_LEFT) _vm->_objectsManager.doActionLeft(3); break; case 9: - if (_vm->_globals._actionDirection == DIR_UP) + if (_vm->_globals->_actionDirection == DIR_UP) _vm->_objectsManager.doActionBack(5); - if (_vm->_globals._actionDirection == DIR_RIGHT) + if (_vm->_globals->_actionDirection == DIR_RIGHT) _vm->_objectsManager.doActionRight(5); - if (_vm->_globals._actionDirection == DIR_UP_RIGHT) + if (_vm->_globals->_actionDirection == DIR_UP_RIGHT) _vm->_objectsManager.doActionDiagRight(5); - if (_vm->_globals._actionDirection == DIR_DOWN) + if (_vm->_globals->_actionDirection == DIR_DOWN) _vm->_objectsManager.doActionFront(5); - if (_vm->_globals._actionDirection == DIR_UP_LEFT) + if (_vm->_globals->_actionDirection == DIR_UP_LEFT) _vm->_objectsManager.doActionDiagLeft(5); - if (_vm->_globals._actionDirection == DIR_LEFT) + if (_vm->_globals->_actionDirection == DIR_LEFT) _vm->_objectsManager.doActionLeft(5); break; case 10: - if (_vm->_globals._actionDirection == DIR_UP) + if (_vm->_globals->_actionDirection == DIR_UP) _vm->_objectsManager.doActionBack(6); - if (_vm->_globals._actionDirection == DIR_RIGHT) + if (_vm->_globals->_actionDirection == DIR_RIGHT) _vm->_objectsManager.doActionRight(6); - if (_vm->_globals._actionDirection == DIR_UP_RIGHT) + if (_vm->_globals->_actionDirection == DIR_UP_RIGHT) _vm->_objectsManager.doActionDiagRight(6); - if (_vm->_globals._actionDirection == DIR_DOWN) + if (_vm->_globals->_actionDirection == DIR_DOWN) _vm->_objectsManager.doActionFront(6); - if (_vm->_globals._actionDirection == DIR_UP_LEFT) + if (_vm->_globals->_actionDirection == DIR_UP_LEFT) _vm->_objectsManager.doActionDiagLeft(6); - if (_vm->_globals._actionDirection == DIR_LEFT) + if (_vm->_globals->_actionDirection == DIR_LEFT) _vm->_objectsManager.doActionLeft(6); break; case 15: case 11: - if (_vm->_globals._actionDirection == DIR_UP) + if (_vm->_globals->_actionDirection == DIR_UP) _vm->_objectsManager.doActionBack(7); - if (_vm->_globals._actionDirection == DIR_RIGHT) + if (_vm->_globals->_actionDirection == DIR_RIGHT) _vm->_objectsManager.doActionRight(7); - if (_vm->_globals._actionDirection == DIR_UP_RIGHT) + if (_vm->_globals->_actionDirection == DIR_UP_RIGHT) _vm->_objectsManager.doActionDiagRight(7); - if (_vm->_globals._actionDirection == DIR_DOWN) + if (_vm->_globals->_actionDirection == DIR_DOWN) _vm->_objectsManager.doActionFront(7); - if (_vm->_globals._actionDirection == DIR_UP_LEFT) + if (_vm->_globals->_actionDirection == DIR_UP_LEFT) _vm->_objectsManager.doActionDiagLeft(7); - if (_vm->_globals._actionDirection == DIR_LEFT) + if (_vm->_globals->_actionDirection == DIR_LEFT) _vm->_objectsManager.doActionLeft(7); break; case 16: case 12: - if (_vm->_globals._actionDirection == DIR_UP) + if (_vm->_globals->_actionDirection == DIR_UP) _vm->_objectsManager.doActionBack(8); - if (_vm->_globals._actionDirection == DIR_RIGHT) + if (_vm->_globals->_actionDirection == DIR_RIGHT) _vm->_objectsManager.doActionRight(8); - if (_vm->_globals._actionDirection == DIR_UP_RIGHT) + if (_vm->_globals->_actionDirection == DIR_UP_RIGHT) _vm->_objectsManager.doActionDiagRight(8); - if (_vm->_globals._actionDirection == DIR_DOWN) + if (_vm->_globals->_actionDirection == DIR_DOWN) _vm->_objectsManager.doActionFront(8); - if (_vm->_globals._actionDirection == DIR_UP_LEFT) + if (_vm->_globals->_actionDirection == DIR_UP_LEFT) _vm->_objectsManager.doActionDiagLeft(8); - if (_vm->_globals._actionDirection == DIR_LEFT) + if (_vm->_globals->_actionDirection == DIR_LEFT) _vm->_objectsManager.doActionLeft(8); break; } @@ -462,7 +462,7 @@ int ScriptManager::handleOpcode(byte *dataP) { opcodeType = 1; break; case MKTAG24('W', 'A', 'I'): { - uint frameNumb = READ_LE_UINT16(dataP + 5) / _vm->_globals._speed; + uint frameNumb = READ_LE_UINT16(dataP + 5) / _vm->_globals->_speed; if (!frameNumb) frameNumb = 1; for (uint i = 0; i < frameNumb + 1; i++) { @@ -497,11 +497,11 @@ int ScriptManager::handleOpcode(byte *dataP) { opcodeType = 5; break; case MKTAG24('S', 'O', 'R'): - _vm->_globals._exitId = READ_LE_INT16(dataP + 5); + _vm->_globals->_exitId = READ_LE_INT16(dataP + 5); opcodeType = 5; break; case MKTAG24('B', 'C', 'A'): - _vm->_globals.B_CACHE_OFF(READ_LE_INT16(dataP + 5)); + _vm->_globals->B_CACHE_OFF(READ_LE_INT16(dataP + 5)); opcodeType = 1; break; case MKTAG24('A', 'N', 'I'): { @@ -545,9 +545,9 @@ int ScriptManager::handleOpcode(byte *dataP) { case 13: _vm->_eventsManager->_mouseButton = _vm->_eventsManager->_curMouseButton; - _vm->_globals._disableInventFl = true; + _vm->_globals->_disableInventFl = true; _vm->_graphicsManager.fadeOutLong(); - _vm->_globals.disableHiding(); + _vm->_globals->disableHiding(); _vm->_objectsManager.removeSprite(0); _vm->_fontManager->hideText(5); _vm->_fontManager->hideText(9); @@ -585,7 +585,7 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_graphicsManager.endDisplayBob(); // If uncensored, rip the throat of the hostage - if (!_vm->_globals._censorshipFl) { + if (!_vm->_globals->_censorshipFl) { _vm->_soundManager._specialSoundNum = 16; _vm->_graphicsManager.FADE_LINUX = 2; _vm->_animationManager->playAnim("EGORGE.ANM", 50, 28, 500); @@ -620,7 +620,7 @@ int ScriptManager::handleOpcode(byte *dataP) { if ((_vm->getPlatform() == Common::kPlatformWindows) && _vm->getIsDemo()) _vm->_graphicsManager.fadeOutLong(); - _vm->_globals._disableInventFl = false; + _vm->_globals->_disableInventFl = false; _vm->_objectsManager._helicopterFl = true; break; @@ -661,16 +661,16 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case 27: - if (_vm->_globals._saveData->_data[svField94] != 1 || _vm->_globals._saveData->_data[svField95] != 1) + if (_vm->_globals->_saveData->_data[svField94] != 1 || _vm->_globals->_saveData->_data[svField95] != 1) _vm->_talkManager.startAnimatedCharacterDialogue("STANDAR.pe2"); else _vm->_talkManager.startAnimatedCharacterDialogue("STANDAR1.pe2"); break; case 29: - _vm->_globals._disableInventFl = true; + _vm->_globals->_disableInventFl = true; _vm->_talkManager.animateObject("TELEP.pe2"); - _vm->_globals._disableInventFl = false; + _vm->_globals->_disableInventFl = false; break; case 32: @@ -690,19 +690,19 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case 36: - if (_vm->_globals._saveData->_data[svField270] == 2 && _vm->_globals._saveData->_data[svField94] == 1 && _vm->_globals._saveData->_data[svField95] == 1) - _vm->_globals._saveData->_data[svField270] = 3; - if (!_vm->_globals._saveData->_data[svField270]) + if (_vm->_globals->_saveData->_data[svField270] == 2 && _vm->_globals->_saveData->_data[svField94] == 1 && _vm->_globals->_saveData->_data[svField95] == 1) + _vm->_globals->_saveData->_data[svField270] = 3; + if (!_vm->_globals->_saveData->_data[svField270]) _vm->_talkManager.startStaticCharacterDialogue("PATRON0.pe2"); - if (_vm->_globals._saveData->_data[svField270] == 1) + if (_vm->_globals->_saveData->_data[svField270] == 1) _vm->_talkManager.startStaticCharacterDialogue("PATRON1.pe2"); - if (_vm->_globals._saveData->_data[svField270] == 2) + if (_vm->_globals->_saveData->_data[svField270] == 2) _vm->_talkManager.startStaticCharacterDialogue("PATRON2.pe2"); - if (_vm->_globals._saveData->_data[svField270] == 3) + if (_vm->_globals->_saveData->_data[svField270] == 3) _vm->_talkManager.startStaticCharacterDialogue("PATRON3.pe2"); - if (_vm->_globals._saveData->_data[svField270] > 3) { + if (_vm->_globals->_saveData->_data[svField270] > 3) { _vm->_talkManager.startStaticCharacterDialogue("PATRON4.pe2"); - _vm->_globals._saveData->_data[svField270] = 5; + _vm->_globals->_saveData->_data[svField270] = 5; } break; @@ -752,7 +752,7 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case 46: { - _vm->_globals._checkDistanceFl = true; + _vm->_globals->_checkDistanceFl = true; _vm->_linesManager._route = (RouteItem *)g_PTRNUL; _vm->_linesManager._route = _vm->_linesManager.PARCOURS2(_vm->_objectsManager.getSpriteX(0), _vm->_objectsManager.getSpriteY(0), 564, 420); _vm->_objectsManager._zoneNum = -1; @@ -764,7 +764,7 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_eventsManager->refreshScreenAndEvents(); } while (_vm->_linesManager._route != (RouteItem *)g_PTRNUL); _vm->_objectsManager.removeSprite(0); - _vm->_globals._checkDistanceFl = true; + _vm->_globals->_checkDistanceFl = true; _vm->_soundManager.loadSample(1, "SOUND44.WAV"); _vm->_soundManager.loadSample(2, "SOUND45.WAV"); _vm->_objectsManager.OPTI_BOBON(9, 10, -1, 0, 0, 0); @@ -802,14 +802,14 @@ int ScriptManager::handleOpcode(byte *dataP) { playFl = false; break; case 12: - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 513, 249, 1); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 513, 249, 1); break; case 23: - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 513, 249, 2); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 513, 249, 2); playFl = false; break; case 34: - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 513, 249, 3); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 513, 249, 3); playFl = false; break; } @@ -834,12 +834,12 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case 49: { - _vm->_globals.disableHiding(); + _vm->_globals->disableHiding(); _vm->_objectsManager.removeSprite(0); _vm->_objectsManager.OPTI_BOBON(9, 10, -1, 0, 0, 0); int endIdx; - if (_vm->_globals._saveData->_data[svField133] == 1) + if (_vm->_globals->_saveData->_data[svField133] == 1) endIdx = 41; else endIdx = 12; @@ -882,7 +882,7 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_objectsManager.animateSprite(0); _vm->_objectsManager.stopBobAnimation(9); } - _vm->_globals.enableHiding(); + _vm->_globals->enableHiding(); break; } @@ -893,7 +893,7 @@ int ScriptManager::handleOpcode(byte *dataP) { case 51: { _vm->_graphicsManager.fadeOutLong(); - _vm->_globals.disableHiding(); + _vm->_globals->disableHiding(); _vm->_objectsManager.removeSprite(0); _vm->_fontManager->hideText(5); _vm->_fontManager->hideText(9); @@ -920,14 +920,14 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_objectsManager.stopBobAnimation(2); _vm->_graphicsManager.fadeOutLong(); _vm->_graphicsManager._noFadingFl = true; - _vm->_globals._exitId = 20; + _vm->_globals->_exitId = 20; break; } case 52: - _vm->_globals._introSpeechOffFl = true; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("GARDE.PE2"); - _vm->_globals._introSpeechOffFl = false; + _vm->_globals->_introSpeechOffFl = false; break; case 53: @@ -948,41 +948,41 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case 56: - _vm->_globals.PERSO = _vm->_fileManager->loadFile("HOPFEM.SPR"); - _vm->_globals._characterType = 1; - _vm->_globals._saveData->_data[svAlternateSpriteFl] = 1; - _vm->_globals.loadCharacterData(); + _vm->_globals->PERSO = _vm->_fileManager->loadFile("HOPFEM.SPR"); + _vm->_globals->_characterType = 1; + _vm->_globals->_saveData->_data[svAlternateSpriteFl] = 1; + _vm->_globals->loadCharacterData(); _vm->_objectsManager._sprite[0]._deltaX = 28; _vm->_objectsManager._sprite[0]._deltaY = 155; _vm->_objectsManager.computeAndSetSpriteSize(); break; case 57: - _vm->_globals.PERSO = _vm->_fileManager->loadFile("PERSO.SPR"); - _vm->_globals._characterType = 0; - _vm->_globals._saveData->_data[svAlternateSpriteFl] = 0; - _vm->_globals.loadCharacterData(); + _vm->_globals->PERSO = _vm->_fileManager->loadFile("PERSO.SPR"); + _vm->_globals->_characterType = 0; + _vm->_globals->_saveData->_data[svAlternateSpriteFl] = 0; + _vm->_globals->loadCharacterData(); _vm->_objectsManager._sprite[0]._deltaX = 34; _vm->_objectsManager._sprite[0]._deltaY = 190; _vm->_objectsManager.computeAndSetSpriteSize(); break; case 58: - _vm->_globals._introSpeechOffFl = true; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("Gm1.PE2"); - _vm->_globals._saveData->_data[svField176] = 1; - _vm->_globals._saveData->_data[svField270] = 2; - _vm->_globals._introSpeechOffFl = false; + _vm->_globals->_saveData->_data[svField176] = 1; + _vm->_globals->_saveData->_data[svField270] = 2; + _vm->_globals->_introSpeechOffFl = false; break; case 59: { - _vm->_globals._checkDistanceFl = true; + _vm->_globals->_checkDistanceFl = true; _vm->_objectsManager._oldCharacterPosX = _vm->_objectsManager.getSpriteX(0); - _vm->_globals._oldDirection = DIR_NONE; - _vm->_globals.Compteur = 0; + _vm->_globals->_oldDirection = DIR_NONE; + _vm->_globals->Compteur = 0; _vm->_linesManager._route = (RouteItem *)g_PTRNUL; _vm->_linesManager._route = _vm->_linesManager.PARCOURS2(_vm->_objectsManager.getSpriteX(0), _vm->_objectsManager.getSpriteY(0), 445, 332); - _vm->_globals._checkDistanceFl = true; + _vm->_globals->_checkDistanceFl = true; do { if (_vm->shouldQuit()) return -1; // Exiting game @@ -1094,13 +1094,13 @@ int ScriptManager::handleOpcode(byte *dataP) { } case 81: { - _vm->_globals._checkDistanceFl = true; + _vm->_globals->_checkDistanceFl = true; _vm->_objectsManager._oldCharacterPosX = _vm->_objectsManager.getSpriteX(0); - _vm->_globals._oldDirection = DIR_NONE; - _vm->_globals.Compteur = 0; + _vm->_globals->_oldDirection = DIR_NONE; + _vm->_globals->Compteur = 0; _vm->_linesManager._route = (RouteItem *)g_PTRNUL; _vm->_linesManager._route = _vm->_linesManager.PARCOURS2(_vm->_objectsManager.getSpriteX(0), _vm->_objectsManager.getSpriteY(0), 119, 268); - _vm->_globals._checkDistanceFl = true; + _vm->_globals->_checkDistanceFl = true; do { if (_vm->shouldQuit()) return -1; // Exiting game @@ -1149,7 +1149,7 @@ int ScriptManager::handleOpcode(byte *dataP) { if (_vm->_objectsManager.getBobAnimDataIdx(8) == 32) break; } - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 201, 14, 1); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 201, 14, 1); _vm->_objectsManager.animateSprite(0); _vm->_objectsManager.stopBobAnimation(11); _vm->_objectsManager.stopBobAnimation(8); @@ -1176,9 +1176,9 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case 84: - _vm->_globals._introSpeechOffFl = true; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("CVIGIL1.PE2"); - _vm->_globals._introSpeechOffFl = false; + _vm->_globals->_introSpeechOffFl = false; break; case 85: @@ -1199,24 +1199,24 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case 86: - if (_vm->_globals._saveData->_data[svField231] == 1) { + if (_vm->_globals->_saveData->_data[svField231] == 1) { _vm->_talkManager.startAnimatedCharacterDialogue("chotess1.pe2"); } else { - _vm->_globals._introSpeechOffFl = true; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("chotesse.pe2"); - _vm->_globals._introSpeechOffFl = false; + _vm->_globals->_introSpeechOffFl = false; } break; case 87: - if (_vm->_globals._saveData->_data[svField188]) + if (_vm->_globals->_saveData->_data[svField188]) _vm->_talkManager.startAnimatedCharacterDialogue("stand2.pe2"); else _vm->_talkManager.startAnimatedCharacterDialogue("stand1.pe2"); break; case 88: - if (_vm->_globals._saveData->_data[svField183] == 1) { + if (_vm->_globals->_saveData->_data[svField183] == 1) { _vm->_objectsManager.setBobAnimDataIdx(1, 0); _vm->_objectsManager.setBobAnimDataIdx(2, 0); _vm->_objectsManager.setBobAnimation(1); @@ -1250,10 +1250,10 @@ int ScriptManager::handleOpcode(byte *dataP) { } _vm->_objectsManager.stopBobAnimation(1); _vm->_objectsManager.stopBobAnimation(2); - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 283, 160, 6); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 283, 160, 6); _vm->_soundManager.removeSample(1); } - if (_vm->_globals._saveData->_data[svField183] == 2) { + if (_vm->_globals->_saveData->_data[svField183] == 2) { _vm->_objectsManager.setBobAnimDataIdx(1, 0); _vm->_objectsManager.setBobAnimDataIdx(3, 0); _vm->_objectsManager.setBobAnimation(1); @@ -1287,67 +1287,67 @@ int ScriptManager::handleOpcode(byte *dataP) { } _vm->_objectsManager.stopBobAnimation(1); _vm->_objectsManager.stopBobAnimation(3); - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 283, 161, 8); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 283, 161, 8); _vm->_soundManager.removeSample(1); } break; case 90: _vm->_soundManager.playSoundFile("SOUND52.WAV"); - if (!_vm->_globals._saveData->_data[svField186]) { + if (!_vm->_globals->_saveData->_data[svField186]) { _vm->_animationManager->playSequence("CIB5A.SEQ", 1, 12, 1); - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 155, 29, 0); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 155, 29, 0); } - if (_vm->_globals._saveData->_data[svField186] == 1) { + if (_vm->_globals->_saveData->_data[svField186] == 1) { _vm->_animationManager->playSequence("CIB5C.SEQ", 1, 12, 1); - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 155, 29, 0); - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 329, 87, 2); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 155, 29, 0); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 329, 87, 2); } break; case 91: _vm->_soundManager.playSoundFile("SOUND52.WAV"); - if (!_vm->_globals._saveData->_data[svField186]) { + if (!_vm->_globals->_saveData->_data[svField186]) { _vm->_animationManager->playSequence("CIB5B.SEQ", 1, 12, 1); - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 155, 29, 5); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 155, 29, 5); } - if (_vm->_globals._saveData->_data[svField186] == 1) { + if (_vm->_globals->_saveData->_data[svField186] == 1) { _vm->_animationManager->playSequence("CIB5D.SEQ", 1, 12, 1); - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 155, 29, 5); - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 283, 160, 6); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 155, 29, 5); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 283, 160, 6); } break; case 92: _vm->_soundManager.playSoundFile("SOUND52.WAV"); - if (!_vm->_globals._saveData->_data[svField184]) { + if (!_vm->_globals->_saveData->_data[svField184]) { _vm->_animationManager->playSequence("CIB6A.SEQ", 1, 12, 1); - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 155, 29, 0); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 155, 29, 0); } - if (_vm->_globals._saveData->_data[svField184] == 1) { + if (_vm->_globals->_saveData->_data[svField184] == 1) { _vm->_animationManager->playSequence("CIB6C.SEQ", 1, 12, 1); - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 155, 29, 0); - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 293, 139, 3); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 155, 29, 0); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 293, 139, 3); } break; case 93: _vm->_soundManager.playSoundFile("SOUND52.WAV"); - if (!_vm->_globals._saveData->_data[svField184]) { + if (!_vm->_globals->_saveData->_data[svField184]) { _vm->_animationManager->playSequence("CIB6B.SEQ", 1, 12, 1); - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 155, 29, 5); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 155, 29, 5); } - if (_vm->_globals._saveData->_data[svField184] == 1) { + if (_vm->_globals->_saveData->_data[svField184] == 1) { _vm->_animationManager->playSequence("CIB6D.SEQ", 1, 12, 1); - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 155, 29, 5); - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 283, 161, 8); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 155, 29, 5); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 283, 161, 8); } break; case 94: - if (!_vm->_globals._saveData->_data[svField228]) + if (!_vm->_globals->_saveData->_data[svField228]) _vm->_talkManager.startAnimatedCharacterDialogue("flicn.pe2"); - if (_vm->_globals._saveData->_data[svField228] == 1) + if (_vm->_globals->_saveData->_data[svField228] == 1) _vm->_talkManager.startAnimatedCharacterDialogue("flicn1.pe2"); break; @@ -1374,16 +1374,16 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_eventsManager->refreshScreenAndEvents(); } while (_vm->_objectsManager.getBobAnimDataIdx(12) != 117); - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 830, 122, 0); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 830, 122, 0); _vm->_objectsManager.stopBobAnimation(12); _vm->_objectsManager.stopBobAnimation(10); _vm->_objectsManager.setBobAnimation(11); break; case 98: - _vm->_globals._introSpeechOffFl = true; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("CVIGIL2.PE2"); - _vm->_globals._introSpeechOffFl = false; + _vm->_globals->_introSpeechOffFl = false; break; case 100: @@ -1396,40 +1396,40 @@ int ScriptManager::handleOpcode(byte *dataP) { case 103: // Dice game - _vm->_globals._introSpeechOffFl = true; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("tourist1.pe2"); - _vm->_globals._introSpeechOffFl = false; + _vm->_globals->_introSpeechOffFl = false; _vm->_animationManager->playAnim2("T421.ANM", 100, 14, 500); _vm->_eventsManager->refreshScreenAndEvents(); _vm->_eventsManager->refreshScreenAndEvents(); _vm->_eventsManager->refreshScreenAndEvents(); - _vm->_globals._introSpeechOffFl = true; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("tourist2.pe2"); - _vm->_globals._introSpeechOffFl = false; + _vm->_globals->_introSpeechOffFl = false; break; case 104: - _vm->_globals._introSpeechOffFl = true; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("tourist3.pe2"); - _vm->_globals._introSpeechOffFl = false; + _vm->_globals->_introSpeechOffFl = false; break; case 105: - _vm->_globals._checkDistanceFl = true; + _vm->_globals->_checkDistanceFl = true; _vm->_objectsManager._oldCharacterPosX = _vm->_objectsManager.getSpriteX(0); - _vm->_globals._oldDirection = DIR_NONE; - _vm->_globals.Compteur = 0; + _vm->_globals->_oldDirection = DIR_NONE; + _vm->_globals->Compteur = 0; _vm->_linesManager._route = (RouteItem *)g_PTRNUL; - if (_vm->_globals._saveData->_data[svField253] == 1) { + if (_vm->_globals->_saveData->_data[svField253] == 1) { _vm->_linesManager._route = _vm->_linesManager.PARCOURS2(_vm->_objectsManager.getSpriteX(0), _vm->_objectsManager.getSpriteY(0), 201, 294); } - if (_vm->_globals._saveData->_data[svField253] == 2) { + if (_vm->_globals->_saveData->_data[svField253] == 2) { _vm->_linesManager._route = _vm->_linesManager.PARCOURS2(_vm->_objectsManager.getSpriteX(0), _vm->_objectsManager.getSpriteY(0), 158, 338); } - if (_vm->_globals._saveData->_data[svField253] > 2) { + if (_vm->_globals->_saveData->_data[svField253] > 2) { _vm->_linesManager._route = _vm->_linesManager.PARCOURS2(_vm->_objectsManager.getSpriteX(0), _vm->_objectsManager.getSpriteY(0), 211, 393); } - _vm->_globals._checkDistanceFl = true; + _vm->_globals->_checkDistanceFl = true; do { if (_vm->shouldQuit()) return -1; // Exiting game @@ -1440,7 +1440,7 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_objectsManager.removeSprite(0); _vm->_objectsManager.setSpriteIndex(0, 60); _vm->_soundManager.loadSample(1, "SOUND63.WAV"); - if (_vm->_globals._saveData->_data[svField253] > 2) { + if (_vm->_globals->_saveData->_data[svField253] > 2) { _vm->_objectsManager.setBobAnimation(4); bool playFl = false; for (;;) { @@ -1468,7 +1468,7 @@ int ScriptManager::handleOpcode(byte *dataP) { } _vm->_objectsManager.stopBobAnimation(4); } - if (_vm->_globals._saveData->_data[svField253] == 1) { + if (_vm->_globals->_saveData->_data[svField253] == 1) { _vm->_objectsManager.setBobAnimation(6); bool playFl = false; for (;;) { @@ -1496,7 +1496,7 @@ int ScriptManager::handleOpcode(byte *dataP) { } _vm->_objectsManager.stopBobAnimation(6); } - if (_vm->_globals._saveData->_data[svField253] == 2) { + if (_vm->_globals->_saveData->_data[svField253] == 2) { _vm->_objectsManager.setBobAnimation(5); bool playFl = false; for (;;) { @@ -1606,33 +1606,33 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case 108: - _vm->_globals._introSpeechOffFl = true; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("peche1.pe2"); - _vm->_globals._introSpeechOffFl = false; + _vm->_globals->_introSpeechOffFl = false; break; case 109: - _vm->_globals._introSpeechOffFl = true; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("peche2.pe2"); - _vm->_globals._introSpeechOffFl = false; + _vm->_globals->_introSpeechOffFl = false; break; case 110: - _vm->_globals._introSpeechOffFl = true; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("peche3.pe2"); - _vm->_globals._introSpeechOffFl = false; + _vm->_globals->_introSpeechOffFl = false; break; case 111: - _vm->_globals._introSpeechOffFl = true; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("peche4.pe2"); - _vm->_globals._introSpeechOffFl = false; + _vm->_globals->_introSpeechOffFl = false; break; case 112: - _vm->_globals._introSpeechOffFl = true; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("teint1.pe2"); - _vm->_globals._introSpeechOffFl = false; + _vm->_globals->_introSpeechOffFl = false; break; case 113: @@ -1656,17 +1656,17 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case 171: { - _vm->_globals._introSpeechOffFl = true; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("gred1.pe2"); - _vm->_globals._introSpeechOffFl = false; - _vm->_globals._checkDistanceFl = true; + _vm->_globals->_introSpeechOffFl = false; + _vm->_globals->_checkDistanceFl = true; _vm->_objectsManager._oldCharacterPosX = _vm->_objectsManager.getSpriteX(0); - _vm->_globals._oldDirection = DIR_NONE; - _vm->_globals.Compteur = 0; - _vm->_globals._checkDistanceFl = true; + _vm->_globals->_oldDirection = DIR_NONE; + _vm->_globals->Compteur = 0; + _vm->_globals->_checkDistanceFl = true; _vm->_linesManager._route = (RouteItem *)g_PTRNUL; _vm->_linesManager._route = _vm->_linesManager.PARCOURS2(_vm->_objectsManager.getSpriteX(0), _vm->_objectsManager.getSpriteY(0), 361, 325); - _vm->_globals._checkDistanceFl = true; + _vm->_globals->_checkDistanceFl = true; _vm->_objectsManager._zoneNum = -1; do { if (_vm->shouldQuit()) @@ -1675,7 +1675,7 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_objectsManager.GOHOME(); _vm->_eventsManager->refreshScreenAndEvents(); } while (_vm->_linesManager._route != (RouteItem *)g_PTRNUL); - _vm->_globals._exitId = 59; + _vm->_globals->_exitId = 59; break; } @@ -1684,17 +1684,17 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case 173: { - _vm->_globals._introSpeechOffFl = true; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("gbleu1.pe2"); - _vm->_globals._introSpeechOffFl = false; - _vm->_globals._checkDistanceFl = true; + _vm->_globals->_introSpeechOffFl = false; + _vm->_globals->_checkDistanceFl = true; _vm->_objectsManager._oldCharacterPosX = _vm->_objectsManager.getSpriteX(0); - _vm->_globals._oldDirection = DIR_NONE; - _vm->_globals.Compteur = 0; - _vm->_globals._checkDistanceFl = true; + _vm->_globals->_oldDirection = DIR_NONE; + _vm->_globals->Compteur = 0; + _vm->_globals->_checkDistanceFl = true; _vm->_linesManager._route = (RouteItem *)g_PTRNUL; _vm->_linesManager._route = _vm->_linesManager.PARCOURS2(_vm->_objectsManager.getSpriteX(0), _vm->_objectsManager.getSpriteY(0), 361, 325); - _vm->_globals._checkDistanceFl = true; + _vm->_globals->_checkDistanceFl = true; _vm->_objectsManager._zoneNum = -1; do { if (_vm->shouldQuit()) @@ -1703,7 +1703,7 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_objectsManager.GOHOME(); _vm->_eventsManager->refreshScreenAndEvents(); } while (_vm->_linesManager._route != (RouteItem *)g_PTRNUL); - _vm->_globals._exitId = 59; + _vm->_globals->_exitId = 59; break; } @@ -1759,21 +1759,21 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case 176: - _vm->_globals._introSpeechOffFl = true; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("gred2.pe2"); - _vm->_globals._introSpeechOffFl = false; + _vm->_globals->_introSpeechOffFl = false; break; case 177: - _vm->_globals._introSpeechOffFl = true; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("gbleu2.pe2"); - _vm->_globals._introSpeechOffFl = false; + _vm->_globals->_introSpeechOffFl = false; break; case 200: - _vm->_globals._introSpeechOffFl = true; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("Gm2.PE2"); - _vm->_globals._introSpeechOffFl = false; + _vm->_globals->_introSpeechOffFl = false; break; case 201: @@ -1789,9 +1789,9 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case 202: - _vm->_globals._introSpeechOffFl = true; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("SVGARD2.PE2"); - _vm->_globals._introSpeechOffFl = false; + _vm->_globals->_introSpeechOffFl = false; break; case 203: @@ -1803,7 +1803,7 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_eventsManager->refreshScreenAndEvents(); if (_vm->_objectsManager.getBobAnimDataIdx(4) == 18) - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 18, 334, 0, false); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 18, 334, 0, false); } while (_vm->_objectsManager.getBobAnimDataIdx(4) != 26); _vm->_objectsManager.stopBobAnimation(4); _vm->_objectsManager.animateSprite(0); @@ -1872,16 +1872,16 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case 208: { - _vm->_globals._disableInventFl = true; - if (_vm->_globals._saveData->_data[svLastPrevScreenId] != _vm->_globals._saveData->_data[svField401]) { + _vm->_globals->_disableInventFl = true; + if (_vm->_globals->_saveData->_data[svLastPrevScreenId] != _vm->_globals->_saveData->_data[svField401]) { _vm->_soundManager._specialSoundNum = 208; _vm->_animationManager->playSequence("SORT.SEQ", 10, 4, 10, true); _vm->_soundManager._specialSoundNum = 0; } - _vm->_globals._checkDistanceFl = true; + _vm->_globals->_checkDistanceFl = true; _vm->_linesManager._route = (RouteItem *)g_PTRNUL; _vm->_linesManager._route = _vm->_linesManager.PARCOURS2(_vm->_objectsManager.getSpriteX(0), _vm->_objectsManager.getSpriteY(0), 330, 418); - _vm->_globals._checkDistanceFl = true; + _vm->_globals->_checkDistanceFl = true; _vm->_objectsManager._zoneNum = 0; do { if (_vm->shouldQuit()) @@ -1891,8 +1891,8 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_eventsManager->refreshScreenAndEvents(); } while (_vm->_linesManager._route != (RouteItem *)g_PTRNUL); _vm->_objectsManager.setSpriteIndex(0, 64); - _vm->_globals._exitId = _vm->_globals._saveData->_data[svField401]; - _vm->_globals._disableInventFl = false; + _vm->_globals->_exitId = _vm->_globals->_saveData->_data[svField401]; + _vm->_globals->_disableInventFl = false; break; } @@ -1910,10 +1910,10 @@ int ScriptManager::handleOpcode(byte *dataP) { } while (_vm->_objectsManager.getBobAnimDataIdx(1) != 9); _vm->_objectsManager.stopBobAnimation(1); _vm->_linesManager._route = (RouteItem *)g_PTRNUL; - _vm->_globals._checkDistanceFl = true; + _vm->_globals->_checkDistanceFl = true; _vm->_linesManager._route = _vm->_linesManager.PARCOURS2(_vm->_objectsManager.getSpriteX(0), _vm->_objectsManager.getSpriteY(0), 330, 314); _vm->_objectsManager._zoneNum = 0; - _vm->_globals._checkDistanceFl = true; + _vm->_globals->_checkDistanceFl = true; do { if (_vm->shouldQuit()) return -1; // Exiting game @@ -1940,15 +1940,15 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_soundManager._specialSoundNum = 210; _vm->_animationManager->playSequence2("SECRET1.SEQ", 1, 12, 1); _vm->_soundManager._specialSoundNum = 0; - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 192, 152, 0); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 192, 152, 0); _vm->_objectsManager.setBobAnimation(9); _vm->_objectsManager.OBSSEUL = true; _vm->_objectsManager.loadLinkFile("IM73a"); _vm->_objectsManager.OBSSEUL = false; - _vm->_globals.enableHiding(); + _vm->_globals->enableHiding(); _vm->_animationManager->NO_SEQ = false; - _vm->_globals.setHidingUseCount(0); - _vm->_globals.setHidingUseCount(1); + _vm->_globals->setHidingUseCount(0); + _vm->_globals->setHidingUseCount(1); _vm->_graphicsManager.SETCOLOR4(252, 100, 100, 100); _vm->_graphicsManager.SETCOLOR4(253, 100, 100, 100); _vm->_graphicsManager.SETCOLOR4(251, 100, 100, 100); @@ -1957,7 +1957,7 @@ int ScriptManager::handleOpcode(byte *dataP) { case 211: _vm->_objectsManager.removeSprite(0); - _vm->_globals.disableHiding(); + _vm->_globals->disableHiding(); _vm->_animationManager->NO_SEQ = true; _vm->_soundManager._specialSoundNum = 211; _vm->_animationManager->playSequence("SECRET2.SEQ", 1, 12, 100); @@ -1980,37 +1980,37 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case 215: - _vm->_globals._introSpeechOffFl = true; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("aviat.pe2"); - _vm->_globals._introSpeechOffFl = false; + _vm->_globals->_introSpeechOffFl = false; break; case 216: - _vm->_globals._introSpeechOffFl = true; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("aviat1.pe2"); - _vm->_globals._introSpeechOffFl = false; + _vm->_globals->_introSpeechOffFl = false; break; case 229: _vm->_soundManager._specialSoundNum = 229; _vm->_animationManager->playSequence("MUR.SEQ", 1, 12, 1); _vm->_soundManager._specialSoundNum = 0; - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 340, 157, 2); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 340, 157, 2); break; case 230: { _vm->_objectsManager.OBSSEUL = true; _vm->_objectsManager.loadLinkFile("IM93a"); _vm->_objectsManager.OBSSEUL = false; - _vm->_globals.enableHiding(); - _vm->_globals._checkDistanceFl = true; + _vm->_globals->enableHiding(); + _vm->_globals->_checkDistanceFl = true; _vm->_objectsManager._oldCharacterPosX = _vm->_objectsManager.getSpriteX(0); - _vm->_globals._oldDirection = DIR_NONE; - _vm->_globals.Compteur = 0; - _vm->_globals._checkDistanceFl = true; + _vm->_globals->_oldDirection = DIR_NONE; + _vm->_globals->Compteur = 0; + _vm->_globals->_checkDistanceFl = true; _vm->_linesManager._route = (RouteItem *)g_PTRNUL; _vm->_linesManager._route = _vm->_linesManager.PARCOURS2(_vm->_objectsManager.getSpriteX(0), _vm->_objectsManager.getSpriteY(0), 488, 280); - _vm->_globals._checkDistanceFl = true; + _vm->_globals->_checkDistanceFl = true; do { if (_vm->shouldQuit()) return -1; // Exiting game @@ -2035,16 +2035,16 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_objectsManager.setSpriteX(0, 476); _vm->_objectsManager.setSpriteY(0, 278); _vm->_objectsManager.animateSprite(0); - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 337, 154, 3); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 337, 154, 3); _vm->_objectsManager.OBSSEUL = true; _vm->_objectsManager.loadLinkFile("IM93c"); _vm->_objectsManager.OBSSEUL = false; - _vm->_globals.enableHiding(); + _vm->_globals->enableHiding(); break; } case 231: - _vm->_globals.disableHiding(); + _vm->_globals->disableHiding(); _vm->_objectsManager.removeSprite(0); _vm->_objectsManager.setBobAnimation(12); do { @@ -2053,9 +2053,9 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_eventsManager->refreshScreenAndEvents(); } while (_vm->_objectsManager.getBobAnimDataIdx(12) != 6); - _vm->_globals._introSpeechOffFl = true; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("PRMORT.pe2"); - _vm->_globals._introSpeechOffFl = false; + _vm->_globals->_introSpeechOffFl = false; do { if (_vm->shouldQuit()) return -1; // Exiting game @@ -2064,11 +2064,11 @@ int ScriptManager::handleOpcode(byte *dataP) { } while (_vm->_objectsManager.getBobAnimDataIdx(12) != 12); _vm->_objectsManager.animateSprite(0); _vm->_objectsManager.stopBobAnimation(12); - _vm->_globals.enableHiding(); + _vm->_globals->enableHiding(); break; case 233: { - _vm->_globals.disableHiding(); + _vm->_globals->disableHiding(); _vm->_objectsManager.removeSprite(0); _vm->_objectsManager.setBobAnimation(11); bool playFl = false; @@ -2081,7 +2081,7 @@ int ScriptManager::handleOpcode(byte *dataP) { playFl = true; } while (_vm->_objectsManager.getBobAnimDataIdx(11) != 13); _vm->_objectsManager.stopBobAnimation(11); - _vm->_globals.enableHiding(); + _vm->_globals->enableHiding(); _vm->_objectsManager.setBobAnimation(13); do { if (_vm->shouldQuit()) @@ -2089,18 +2089,18 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_eventsManager->refreshScreenAndEvents(); } while (_vm->_objectsManager.getBobAnimDataIdx(13) != 48); - _vm->_globals._introSpeechOffFl = true; + _vm->_globals->_introSpeechOffFl = true; _vm->_talkManager.startAnimatedCharacterDialogue("HRADIO.PE2"); - _vm->_globals._introSpeechOffFl = false; + _vm->_globals->_introSpeechOffFl = false; _vm->_graphicsManager.fadeOutLong(); _vm->_objectsManager.stopBobAnimation(13); _vm->_graphicsManager._noFadingFl = true; - _vm->_globals._exitId = 94; + _vm->_globals->_exitId = 94; break; } case 236: { - char v47 = _vm->_globals._saveData->_data[svField341]; + char v47 = _vm->_globals->_saveData->_data[svField341]; if (v47) { if (v47 == 2) vbobFrameIndex = 5; @@ -2110,27 +2110,27 @@ int ScriptManager::handleOpcode(byte *dataP) { vbobFrameIndex = 6; _vm->_soundManager.playSoundFile("SOUND83.WAV"); _vm->_objectsManager.OPTI_ONE(vbobFrameIndex, 26, 50, 0); - if (_vm->_globals._saveData->_data[svField341] == 1) - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 27, 117, 0); - if (_vm->_globals._saveData->_data[svField341] == 2) - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 145, 166, 2); - if (_vm->_globals._saveData->_data[svField341] == 3) - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 296, 212, 4); - if (_vm->_globals._saveData->_data[svField341] == 1) - _vm->_globals._saveData->_data[svField338] = 0; - if (_vm->_globals._saveData->_data[svField341] == 2) - _vm->_globals._saveData->_data[svField339] = 0; - if (_vm->_globals._saveData->_data[svField341] == 3) - _vm->_globals._saveData->_data[svField340] = 0; + if (_vm->_globals->_saveData->_data[svField341] == 1) + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 27, 117, 0); + if (_vm->_globals->_saveData->_data[svField341] == 2) + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 145, 166, 2); + if (_vm->_globals->_saveData->_data[svField341] == 3) + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 296, 212, 4); + if (_vm->_globals->_saveData->_data[svField341] == 1) + _vm->_globals->_saveData->_data[svField338] = 0; + if (_vm->_globals->_saveData->_data[svField341] == 2) + _vm->_globals->_saveData->_data[svField339] = 0; + if (_vm->_globals->_saveData->_data[svField341] == 3) + _vm->_globals->_saveData->_data[svField340] = 0; } _vm->_soundManager.playSoundFile("SOUND83.WAV"); _vm->_objectsManager.OPTI_ONE(6, 0, 23, 0); - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 27, 117, 1); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 27, 117, 1); break; } case 237: { - switch (_vm->_globals._saveData->_data[svField341]) { + switch (_vm->_globals->_saveData->_data[svField341]) { case 1: vbobFrameIndex = 6; break; @@ -2142,34 +2142,34 @@ int ScriptManager::handleOpcode(byte *dataP) { break; } - if (_vm->_globals._saveData->_data[svField341]) { + if (_vm->_globals->_saveData->_data[svField341]) { _vm->_soundManager.playSoundFile("SOUND83.WAV"); _vm->_objectsManager.OPTI_ONE(vbobFrameIndex, 26, 50, 0); - switch (_vm->_globals._saveData->_data[svField341]) { + switch (_vm->_globals->_saveData->_data[svField341]) { case 1: - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 27, 117, 0); - _vm->_globals._saveData->_data[svField338] = 0; + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 27, 117, 0); + _vm->_globals->_saveData->_data[svField338] = 0; break; case 2: - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 145, 166, 2); - _vm->_globals._saveData->_data[svField339] = 0; + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 145, 166, 2); + _vm->_globals->_saveData->_data[svField339] = 0; break; case 3: - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 296, 212, 4); - _vm->_globals._saveData->_data[svField340] = 0; + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 296, 212, 4); + _vm->_globals->_saveData->_data[svField340] = 0; break; } } _vm->_soundManager.playSoundFile("SOUND83.WAV"); _vm->_objectsManager.OPTI_ONE(5, 0, 23, 0); - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 145, 166, 3); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 145, 166, 3); break; } case 238: { - switch (_vm->_globals._saveData->_data[svField341]) { + switch (_vm->_globals->_saveData->_data[svField341]) { case 1: vbobFrameIndex = 6; break; @@ -2181,27 +2181,27 @@ int ScriptManager::handleOpcode(byte *dataP) { break; } - if (_vm->_globals._saveData->_data[svField341]) { + if (_vm->_globals->_saveData->_data[svField341]) { _vm->_soundManager.playSoundFile("SOUND83.WAV"); _vm->_objectsManager.OPTI_ONE(vbobFrameIndex, 26, 50, 0); - switch (_vm->_globals._saveData->_data[svField341]) { + switch (_vm->_globals->_saveData->_data[svField341]) { case 1: - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 27, 117, 0); - _vm->_globals._saveData->_data[svField338] = 0; + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 27, 117, 0); + _vm->_globals->_saveData->_data[svField338] = 0; break; case 2: - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 145, 166, 2); - _vm->_globals._saveData->_data[svField339] = 0; + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 145, 166, 2); + _vm->_globals->_saveData->_data[svField339] = 0; break; case 3: - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 296, 212, 4); - _vm->_globals._saveData->_data[svField340] = 0; + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 296, 212, 4); + _vm->_globals->_saveData->_data[svField340] = 0; break; } } _vm->_soundManager.playSoundFile("SOUND83.WAV"); _vm->_objectsManager.OPTI_ONE(4, 0, 23, 0); - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 296, 212, 5); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 296, 212, 5); break; } @@ -2237,7 +2237,7 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_fontManager->hideText(9); bool displayedTxtFl = false; if (!_vm->_soundManager._textOffFl) { - _vm->_fontManager->initTextBuffers(9, 617, _vm->_globals._textFilename, 91, 41, 3, 30, 253); + _vm->_fontManager->initTextBuffers(9, 617, _vm->_globals->_textFilename, 91, 41, 3, 30, 253); _vm->_fontManager->showText(9); displayedTxtFl = true; } @@ -2249,15 +2249,15 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_eventsManager->refreshScreenAndEvents(); } - CharacterLocation *realHopkins = &_vm->_globals._saveData->_realHopkins; + CharacterLocation *realHopkins = &_vm->_globals->_saveData->_realHopkins; realHopkins->_pos.x = _vm->_objectsManager.getSpriteX(0); realHopkins->_pos.y = _vm->_objectsManager.getSpriteY(0); realHopkins->_startSpriteIndex = 57; realHopkins->_location = 97; - _vm->_globals._saveData->_data[svHopkinsCloneFl] = 1; - _vm->_globals._saveData->_data[svField352] = 1; - _vm->_globals._saveData->_data[svField353] = 1; - _vm->_globals._saveData->_data[svField354] = 1; + _vm->_globals->_saveData->_data[svHopkinsCloneFl] = 1; + _vm->_globals->_saveData->_data[svField352] = 1; + _vm->_globals->_saveData->_data[svField353] = 1; + _vm->_globals->_saveData->_data[svField354] = 1; break; } @@ -2272,19 +2272,19 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_animationManager->playSequence("RESUF.SEQ", 1, 24, 1); _vm->_animationManager->NO_SEQ = false; - CharacterLocation *samantha = &_vm->_globals._saveData->_samantha; + CharacterLocation *samantha = &_vm->_globals->_saveData->_samantha; samantha->_pos.x = 404; samantha->_pos.y = 395; samantha->_startSpriteIndex = 64; - samantha->_location = _vm->_globals._screenId; - samantha->_zoomFactor = -(100 * (67 - (100 - abs(_vm->_globals._spriteSize[790 / 2]))) / 67); + samantha->_location = _vm->_globals->_screenId; + samantha->_zoomFactor = -(100 * (67 - (100 - abs(_vm->_globals->_spriteSize[790 / 2]))) / 67); - _vm->_globals._saveData->_data[svField357] = 1; - _vm->_globals._saveData->_data[svField354] = 0; - _vm->_globals._saveData->_data[svField356] = 0; - _vm->_globals._saveData->_data[svField355] = 1; + _vm->_globals->_saveData->_data[svField357] = 1; + _vm->_globals->_saveData->_data[svField354] = 0; + _vm->_globals->_saveData->_data[svField356] = 0; + _vm->_globals->_saveData->_data[svField355] = 1; _vm->_objectsManager._twoCharactersFl = true; - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 373, 191, 3); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 373, 191, 3); _vm->_objectsManager.addStaticSprite(_vm->_objectsManager._headSprites, samantha->_pos, 1, 3, samantha->_zoomFactor, false, 20, 127); _vm->_objectsManager.animateSprite(1); break; @@ -2292,7 +2292,7 @@ int ScriptManager::handleOpcode(byte *dataP) { case 243: _vm->_soundManager.playSoundFile("SOUND88.WAV"); - if (_vm->_globals._saveData->_data[svField341] == 2) { + if (_vm->_globals->_saveData->_data[svField341] == 2) { _vm->_animationManager->NO_SEQ = true; _vm->_animationManager->playSequence("RESU.SEQ", 2, 24, 2); _vm->_animationManager->NO_SEQ = false; @@ -2306,8 +2306,8 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_objectsManager.OPTI_ONE(5, 0, 6, 0); _vm->_linesManager.ZONEP[4]._destX = 276; _vm->_objectsManager.enableVerb(4, 19); - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 285, 379, 0); - _vm->_globals._saveData->_data[svField399] = 1; + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 285, 379, 0); + _vm->_globals->_saveData->_data[svField399] = 1; break; case 246: @@ -2321,7 +2321,7 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_graphicsManager._noFadingFl = true; _vm->_graphicsManager.fadeOutLong(); _vm->_objectsManager.PERSO_ON = false; - _vm->_globals._exitId = 100; + _vm->_globals->_exitId = 100; break; case 600: @@ -2340,17 +2340,17 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case 601: - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 513, 163, 7, false); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 513, 163, 7, false); _vm->_objectsManager.OPTI_ONE(2, 0, 16, 4); break; case 602: - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 513, 163, 7, false); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 513, 163, 7, false); _vm->_objectsManager.OPTI_ONE(4, 0, 16, 4); break; case 603: - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 513, 163, 7, false); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 513, 163, 7, false); _vm->_objectsManager.OPTI_ONE(3, 0, 16, 4); _vm->_soundManager._specialSoundNum = 199; _vm->_graphicsManager.FADE_LINUX = 2; @@ -2358,22 +2358,22 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_soundManager._specialSoundNum = 0; memset(_vm->_graphicsManager._vesaBuffer, 0, 614400); _vm->_graphicsManager._noFadingFl = true; - _vm->_globals._exitId = 151; + _vm->_globals->_exitId = 151; break; case 604: - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 513, 163, 7, false); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 513, 163, 7, false); _vm->_objectsManager.OPTI_ONE(1, 0, 16, 4); _vm->_soundManager._specialSoundNum = 199; _vm->_animationManager->playAnim("BOMBE2A.ANM", 50, 14, 500); _vm->_soundManager._specialSoundNum = 0; _vm->_graphicsManager._noFadingFl = true; memset(_vm->_graphicsManager._vesaBuffer, 0, 614400); - _vm->_globals._exitId = 151; + _vm->_globals->_exitId = 151; break; case 605: - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 513, 163, 7, false); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 513, 163, 7, false); _vm->_objectsManager.OPTI_ONE(5, 0, 16, 4); _vm->_graphicsManager.fadeOutShort(); _vm->_soundManager._specialSoundNum = 199; @@ -2382,17 +2382,17 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_soundManager._specialSoundNum = 0; _vm->_graphicsManager._noFadingFl = true; memset(_vm->_graphicsManager._vesaBuffer, 0, 614400); - _vm->_globals._exitId = 151; + _vm->_globals->_exitId = 151; break; case 606: - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 513, 163, 7, false); + _vm->_graphicsManager.fastDisplay(_vm->_globals->SPRITE_ECRAN, 513, 163, 7, false); _vm->_objectsManager.OPTI_ONE(6, 0, 16, 4); if ((_vm->getPlatform() != Common::kPlatformWindows) || !_vm->getIsDemo()) { _vm->_animationManager->playAnim("BOMBE3A.ANM", 50, 14, 500); memset(_vm->_graphicsManager._vesaBuffer, 0, 614400); } - _vm->_globals._exitId = 6; + _vm->_globals->_exitId = 6; break; case 607: @@ -2449,12 +2449,12 @@ int ScriptManager::handleOpcode(byte *dataP) { opcodeType = 1; int idx = READ_LE_INT16(dataP + 5); assert(idx >= 0 && idx < 2050); - _vm->_globals._saveData->_data[idx] = dataP[7]; + _vm->_globals->_saveData->_data[idx] = dataP[7]; break; } case MKTAG24('A', 'D', 'D'): opcodeType = 1; - _vm->_globals._saveData->_data[READ_LE_INT16(dataP + 5)] += dataP[7]; + _vm->_globals->_saveData->_data[READ_LE_INT16(dataP + 5)] += dataP[7]; break; case MKTAG24('B', 'O', 'S'): opcodeType = 1; @@ -2542,24 +2542,24 @@ int ScriptManager::handleIf(const byte *dataP, int offset) { int saveDataIdx1 = READ_LE_INT16(buf + 5); int compVal1 = READ_LE_INT16(buf + 7); bool check1Fl = false; - if ((oper == 1 && _vm->_globals._saveData->_data[saveDataIdx1] == compVal1) || - (oper == 2 && _vm->_globals._saveData->_data[saveDataIdx1] != compVal1) || - (oper == 3 && _vm->_globals._saveData->_data[saveDataIdx1] <= compVal1) || - (oper == 4 && _vm->_globals._saveData->_data[saveDataIdx1] >= compVal1) || - (oper == 5 && _vm->_globals._saveData->_data[saveDataIdx1] > compVal1) || - (oper == 6 && _vm->_globals._saveData->_data[saveDataIdx1] < compVal1)) + if ((oper == 1 && _vm->_globals->_saveData->_data[saveDataIdx1] == compVal1) || + (oper == 2 && _vm->_globals->_saveData->_data[saveDataIdx1] != compVal1) || + (oper == 3 && _vm->_globals->_saveData->_data[saveDataIdx1] <= compVal1) || + (oper == 4 && _vm->_globals->_saveData->_data[saveDataIdx1] >= compVal1) || + (oper == 5 && _vm->_globals->_saveData->_data[saveDataIdx1] > compVal1) || + (oper == 6 && _vm->_globals->_saveData->_data[saveDataIdx1] < compVal1)) check1Fl = true; bool check2Fl = false; if (operType != 3) { int saveDataIdx2 = READ_LE_INT16(buf + 9); int compVal2 = READ_LE_INT16(buf + 11); - if ((oper2 == 1 && compVal2 == _vm->_globals._saveData->_data[saveDataIdx2]) || - (oper2 == 2 && compVal2 != _vm->_globals._saveData->_data[saveDataIdx2]) || - (oper2 == 3 && compVal2 >= _vm->_globals._saveData->_data[saveDataIdx2]) || - (oper2 == 4 && compVal2 <= _vm->_globals._saveData->_data[saveDataIdx2]) || - (oper2 == 5 && compVal2 < _vm->_globals._saveData->_data[saveDataIdx2]) || - (oper2 == 6 && compVal2 > _vm->_globals._saveData->_data[saveDataIdx2])) + if ((oper2 == 1 && compVal2 == _vm->_globals->_saveData->_data[saveDataIdx2]) || + (oper2 == 2 && compVal2 != _vm->_globals->_saveData->_data[saveDataIdx2]) || + (oper2 == 3 && compVal2 >= _vm->_globals->_saveData->_data[saveDataIdx2]) || + (oper2 == 4 && compVal2 <= _vm->_globals->_saveData->_data[saveDataIdx2]) || + (oper2 == 5 && compVal2 < _vm->_globals->_saveData->_data[saveDataIdx2]) || + (oper2 == 6 && compVal2 > _vm->_globals->_saveData->_data[saveDataIdx2])) check2Fl = true; } diff --git a/engines/hopkins/sound.cpp b/engines/hopkins/sound.cpp index d7a6c81a51..600ecba0b1 100644 --- a/engines/hopkins/sound.cpp +++ b/engines/hopkins/sound.cpp @@ -273,7 +273,7 @@ void SoundManager::loadAnimSound() { } void SoundManager::playAnimSound(int soundNumber) { - if (!_vm->_globals._censorshipFl && _specialSoundNum == 2) { + if (!_vm->_globals->_censorshipFl && _specialSoundNum == 2) { switch (soundNumber) { case 20: playSample(5); @@ -524,41 +524,41 @@ bool SoundManager::mixVoice(int voiceId, int voiceMode, bool dispTxtFl) { if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS) filename = "ENG_VOI.RES"; // Win95 and Linux versions uses another set of names - else if (_vm->_globals._language == LANG_FR) + else if (_vm->_globals->_language == LANG_FR) filename = "RES_VFR.RES"; - else if (_vm->_globals._language == LANG_EN) + else if (_vm->_globals->_language == LANG_EN) filename = "RES_VAN.RES"; - else if (_vm->_globals._language == LANG_SP) + else if (_vm->_globals->_language == LANG_SP) filename = "RES_VES.RES"; - catPos = _vm->_globals._catalogPos; - catLen = _vm->_globals._catalogSize; + catPos = _vm->_globals->_catalogPos; + catLen = _vm->_globals->_catalogSize; } else if (!_vm->_fileManager->searchCat(filename + ".APC", RES_VOI)) { if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS) filename = "ENG_VOI.RES"; // Win95 and Linux versions uses another set of names - else if (_vm->_globals._language == LANG_FR) + else if (_vm->_globals->_language == LANG_FR) filename = "RES_VFR.RES"; - else if (_vm->_globals._language == LANG_EN) + else if (_vm->_globals->_language == LANG_EN) filename = "RES_VAN.RES"; - else if (_vm->_globals._language == LANG_SP) + else if (_vm->_globals->_language == LANG_SP) filename = "RES_VES.RES"; - catPos = _vm->_globals._catalogPos; - catLen = _vm->_globals._catalogSize; + catPos = _vm->_globals->_catalogPos; + catLen = _vm->_globals->_catalogSize; } else if (!_vm->_fileManager->searchCat(filename + ".RAW", RES_VOI)) { if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS) filename = "ENG_VOI.RES"; // Win95 and Linux versions uses another set of names - else if (_vm->_globals._language == LANG_FR) + else if (_vm->_globals->_language == LANG_FR) filename = "RES_VFR.RES"; - else if (_vm->_globals._language == LANG_EN) + else if (_vm->_globals->_language == LANG_EN) filename = "RES_VAN.RES"; - else if (_vm->_globals._language == LANG_SP) + else if (_vm->_globals->_language == LANG_SP) filename = "RES_VES.RES"; - catPos = _vm->_globals._catalogPos; - catLen = _vm->_globals._catalogSize; + catPos = _vm->_globals->_catalogPos; + catLen = _vm->_globals->_catalogSize; } else { if (!f.exists(filename + ".WAV")) { if (!f.exists(filename + ".APC")) diff --git a/engines/hopkins/talk.cpp b/engines/hopkins/talk.cpp index ccbaf9e5e2..1256261350 100644 --- a/engines/hopkins/talk.cpp +++ b/engines/hopkins/talk.cpp @@ -56,25 +56,25 @@ void TalkManager::startAnimatedCharacterDialogue(const Common::String &filename) _vm->_fontManager->hideText(9); _vm->_eventsManager->refreshScreenAndEvents(); _vm->_graphicsManager._scrollStatus = 1; - bool oldDisableInventFl = _vm->_globals._disableInventFl; - _vm->_globals._disableInventFl = true; + bool oldDisableInventFl = _vm->_globals->_disableInventFl; + _vm->_globals->_disableInventFl = true; _characterBuffer = _vm->_fileManager->searchCat(filename, RES_PER); - _characterSize = _vm->_globals._catalogSize; + _characterSize = _vm->_globals->_catalogSize; if (_characterBuffer == g_PTRNUL) { _characterBuffer = _vm->_fileManager->loadFile(filename); _characterSize = _vm->_fileManager->fileSize(filename); } - _vm->_globals._saveData->_data[svDialogField4] = 0; + _vm->_globals->_saveData->_data[svDialogField4] = 0; getStringFromBuffer(40, spriteFilename, (const char *)_characterBuffer); getStringFromBuffer(0, _questionsFilename, (const char *)_characterBuffer); getStringFromBuffer(20, _answersFilename, (const char *)_characterBuffer); - if (_vm->_globals._language == LANG_FR) { + if (_vm->_globals->_language == LANG_FR) { _answersFilename = _questionsFilename = "RUE.TXT"; - } else if (_vm->_globals._language == LANG_EN) { + } else if (_vm->_globals->_language == LANG_EN) { _answersFilename = _questionsFilename = "RUEAN.TXT"; - } else if (_vm->_globals._language == LANG_SP) { + } else if (_vm->_globals->_language == LANG_SP) { _answersFilename = _questionsFilename = "RUEES.TXT"; } _dialogueMesgId1 = READ_LE_INT16((uint16 *)_characterBuffer + 40); @@ -104,7 +104,7 @@ void TalkManager::startAnimatedCharacterDialogue(const Common::String &filename) int oldMouseCursorId = _vm->_eventsManager->_mouseCursorId; _vm->_eventsManager->_mouseCursorId = 4; _vm->_eventsManager->changeMouseCursor(0); - if (!_vm->_globals._introSpeechOffFl) { + if (!_vm->_globals->_introSpeechOffFl) { int answer = 0; int dlgAnswer; do { @@ -116,7 +116,7 @@ void TalkManager::startAnimatedCharacterDialogue(const Common::String &filename) _vm->_eventsManager->refreshScreenAndEvents(); } while (dlgAnswer != _dialogueMesgId4); } - if (_vm->_globals._introSpeechOffFl) { + if (_vm->_globals->_introSpeechOffFl) { int idx = 1; int answer; do @@ -124,9 +124,9 @@ void TalkManager::startAnimatedCharacterDialogue(const Common::String &filename) while (answer != -1); } clearCharacterAnim(); - _vm->_globals._introSpeechOffFl = false; - _characterBuffer = _vm->_globals.freeMemory(_characterBuffer); - _characterSprite = _vm->_globals.freeMemory(_characterSprite); + _vm->_globals->_introSpeechOffFl = false; + _characterBuffer = _vm->_globals->freeMemory(_characterBuffer); + _characterSprite = _vm->_globals->freeMemory(_characterSprite); _vm->_graphicsManager.NB_SCREEN(false); _vm->_saveLoadManager.load("TEMP.SCR", _vm->_graphicsManager._vesaScreen); @@ -147,7 +147,7 @@ void TalkManager::startAnimatedCharacterDialogue(const Common::String &filename) _vm->_graphicsManager.m_scroll16(_vm->_graphicsManager._vesaScreen, _vm->_eventsManager->_startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); _vm->_graphicsManager.unlockScreen(); memcpy(_vm->_graphicsManager._vesaBuffer, _vm->_graphicsManager._vesaScreen, 614399); - _vm->_globals._disableInventFl = oldDisableInventFl; + _vm->_globals->_disableInventFl = oldDisableInventFl; _vm->_graphicsManager.updateScreen(); for (int i = 0; i <= 4; i++) _vm->_eventsManager->refreshScreenAndEvents(); @@ -156,21 +156,21 @@ void TalkManager::startAnimatedCharacterDialogue(const Common::String &filename) void TalkManager::startStaticCharacterDialogue(const Common::String &filename) { // TODO: The original disables the mouse cursor here - bool oldDisableInventFl = _vm->_globals._disableInventFl; - _vm->_globals._disableInventFl = true; + bool oldDisableInventFl = _vm->_globals->_disableInventFl; + _vm->_globals->_disableInventFl = true; _characterBuffer = _vm->_fileManager->searchCat(filename, RES_PER); - _characterSize = _vm->_globals._catalogSize; + _characterSize = _vm->_globals->_catalogSize; if (_characterBuffer == g_PTRNUL) { _characterBuffer = _vm->_fileManager->loadFile(filename); _characterSize = _vm->_fileManager->fileSize(filename); } - _vm->_globals._saveData->_data[svDialogField4] = 0; + _vm->_globals->_saveData->_data[svDialogField4] = 0; getStringFromBuffer(0, _questionsFilename, (const char *)_characterBuffer); getStringFromBuffer(20, _answersFilename, (const char *)_characterBuffer); - switch (_vm->_globals._language) { + switch (_vm->_globals->_language) { case LANG_EN: _questionsFilename = "RUEAN.TXT"; _answersFilename = "RUEAN.TXT"; @@ -195,7 +195,7 @@ void TalkManager::startStaticCharacterDialogue(const Common::String &filename) { _vm->_eventsManager->_mouseCursorId = 4; _vm->_eventsManager->changeMouseCursor(0); - if (!_vm->_globals._introSpeechOffFl) { + if (!_vm->_globals->_introSpeechOffFl) { int answer; do { answer = dialogQuestion(true); @@ -206,7 +206,7 @@ void TalkManager::startStaticCharacterDialogue(const Common::String &filename) { } while (answer != _dialogueMesgId4); } - if (_vm->_globals._introSpeechOffFl) { + if (_vm->_globals->_introSpeechOffFl) { int idx = 1; int answer; do @@ -214,14 +214,14 @@ void TalkManager::startStaticCharacterDialogue(const Common::String &filename) { while (answer != -1); } - _characterBuffer = _vm->_globals.freeMemory(_characterBuffer); + _characterBuffer = _vm->_globals->freeMemory(_characterBuffer); _vm->_eventsManager->_mouseCursorId = oldMouseCursorId; _vm->_eventsManager->changeMouseCursor(oldMouseCursorId); _vm->_graphicsManager.initColorTable(145, 150, _vm->_graphicsManager._palette); _vm->_graphicsManager.setPaletteVGA256(_vm->_graphicsManager._palette); // TODO: The original re-enables the mouse cursor here - _vm->_globals._disableInventFl = oldDisableInventFl; + _vm->_globals->_disableInventFl = oldDisableInventFl; } void TalkManager::getStringFromBuffer(int srcStart, Common::String &dest, const char *srcData) { @@ -349,7 +349,7 @@ int TalkManager::dialogAnswer(int idx, bool animatedFl) { int curBufVal = READ_LE_INT16((uint16 *)charBuf + 9); if (curBufVal) - _vm->_globals._saveData->_data[svDialogField4] = curBufVal; + _vm->_globals->_saveData->_data[svDialogField4] = curBufVal; if (!frameNumb) frameNumb = 10; @@ -473,26 +473,26 @@ void TalkManager::searchCharacterPalette(int startIdx, bool dark) { void TalkManager::dialogWait() { for (int idx = 26; idx <= 30; ++idx) { - if (_vm->_globals._animBqe[idx]._enabledFl) + if (_vm->_globals->_animBqe[idx]._enabledFl) BOB_VISU_PARLE(idx); } } void TalkManager::dialogTalk() { for (int idx = 26; idx <= 30; ++idx) { - if (_vm->_globals._animBqe[idx]._enabledFl) + if (_vm->_globals->_animBqe[idx]._enabledFl) _vm->_objectsManager.hideBob(idx); } for (int idx = 26; idx <= 30; ++idx) { - if (_vm->_globals._animBqe[idx]._enabledFl) + if (_vm->_globals->_animBqe[idx]._enabledFl) _vm->_objectsManager.resetBob(idx); } } void TalkManager::dialogEndTalk() { for (int idx = 21; idx <= 25; ++idx) { - if (_vm->_globals._animBqe[idx]._enabledFl) + if (_vm->_globals->_animBqe[idx]._enabledFl) _vm->_objectsManager.hideBob(idx); } @@ -500,7 +500,7 @@ void TalkManager::dialogEndTalk() { _vm->_eventsManager->refreshScreenAndEvents(); for (int idx = 21; idx <= 25; ++idx) { - if (_vm->_globals._animBqe[idx]._enabledFl) + if (_vm->_globals->_animBqe[idx]._enabledFl) _vm->_objectsManager.resetBob(idx); } } @@ -531,7 +531,7 @@ int TalkManager::countBoxLines(int idx, const Common::String &file) { error("Error opening file - %s", dest.c_str()); f.seek(indexData[idx]); - byte *decryptBuf = _vm->_globals.allocMemory(2058); + byte *decryptBuf = _vm->_globals->allocMemory(2058); assert(decryptBuf != g_PTRNUL); f.read(decryptBuf, 2048); @@ -589,13 +589,13 @@ int TalkManager::countBoxLines(int idx, const Common::String &file) { ++lineCount; curBufIndx += lineSize; } while (curChar != '%'); - _vm->_globals.freeMemory(decryptBuf); + _vm->_globals->freeMemory(decryptBuf); return lineCount; } void TalkManager::VISU_PARLE() { for (int idx = 21; idx <= 25; ++idx) { - if (_vm->_globals._animBqe[idx]._enabledFl) + if (_vm->_globals->_animBqe[idx]._enabledFl) BOB_VISU_PARLE(idx); } } @@ -604,7 +604,7 @@ void TalkManager::BOB_VISU_PARLE(int idx) { _vm->_objectsManager._priorityFl = true; if (!_vm->_objectsManager._bob[idx]._bobMode) { _vm->_objectsManager.resetBob(idx); - byte *bqeData = _vm->_globals._animBqe[idx]._data; + byte *bqeData = _vm->_globals->_animBqe[idx]._data; int newMode = READ_LE_INT16(bqeData + 2); if (!newMode) newMode = 1; @@ -612,7 +612,7 @@ void TalkManager::BOB_VISU_PARLE(int idx) { _vm->_objectsManager._bob[idx]._isSpriteFl = true; _vm->_objectsManager._bob[idx]._zoomFactor = 0; _vm->_objectsManager._bob[idx]._flipFl = false; - _vm->_objectsManager._bob[idx]._animData = _vm->_globals._animBqe[idx]._data; + _vm->_objectsManager._bob[idx]._animData = _vm->_globals->_animBqe[idx]._data; _vm->_objectsManager._bob[idx]._bobMode = 10; bqeData = _characterSprite; _vm->_objectsManager._bob[idx]._spriteData = _characterSprite; @@ -641,11 +641,11 @@ void TalkManager::startCharacterAnim0(int startIdx, bool readOnlyFl) { do { if (!READ_LE_INT16(&_characterAnim[2 * idx + 4])) break; - if (_vm->_globals._speed != 501) + if (_vm->_globals->_speed != 501) _vm->_graphicsManager.fastDisplay(_characterSprite, _vm->_eventsManager->_startPos.x + READ_LE_INT16(&_characterAnim[2 * idx]), READ_LE_INT16(&_characterAnim[2 * idx + 2]), _characterAnim[2 * idx + 8]); idx += 5; - } while (_vm->_globals._speed != 501); + } while (_vm->_globals->_speed != 501); } } @@ -698,8 +698,8 @@ void TalkManager::initCharacterAnim() { void TalkManager::clearCharacterAnim() { for (int idx = 21; idx <= 34; ++idx) { - _vm->_globals._animBqe[idx]._data = _vm->_globals.freeMemory(_vm->_globals._animBqe[idx]._data); - _vm->_globals._animBqe[idx]._enabledFl = false; + _vm->_globals->_animBqe[idx]._data = _vm->_globals->freeMemory(_vm->_globals->_animBqe[idx]._data); + _vm->_globals->_animBqe[idx]._enabledFl = false; } } @@ -716,25 +716,25 @@ bool TalkManager::searchCharacterAnim(int idx, const byte *bufPerso, int animId, if (READ_BE_UINT32(curPtr) == MKTAG('A', 'N', 'I', 'M') || READ_BE_UINT24(curPtr) == MKTAG24('F', 'I', 'N')) loopCond = true; if (bufIndx > bufferSize) { - _vm->_globals._animBqe[idx]._enabledFl = false; - _vm->_globals._animBqe[idx]._data = g_PTRNUL; + _vm->_globals->_animBqe[idx]._enabledFl = false; + _vm->_globals->_animBqe[idx]._data = g_PTRNUL; return false; } ++bufIndx; ++animLength; ++curPtr; } while (!loopCond); - _vm->_globals._animBqe[idx]._data = _vm->_globals.allocMemory(animLength + 50); - _vm->_globals._animBqe[idx]._enabledFl = true; - memcpy(_vm->_globals._animBqe[idx]._data, (const byte *)(bufPerso + bufPos + 5), 20); + _vm->_globals->_animBqe[idx]._data = _vm->_globals->allocMemory(animLength + 50); + _vm->_globals->_animBqe[idx]._enabledFl = true; + memcpy(_vm->_globals->_animBqe[idx]._data, (const byte *)(bufPerso + bufPos + 5), 20); int bqeVal = READ_LE_INT16(bufPos + bufPerso + 29); - WRITE_LE_UINT16(_vm->_globals._animBqe[idx]._data + 20, READ_LE_INT16(bufPos + bufPerso + 25)); - WRITE_LE_UINT16(_vm->_globals._animBqe[idx]._data + 22, READ_LE_INT16(bufPos + bufPerso + 27)); - WRITE_LE_UINT16(_vm->_globals._animBqe[idx]._data + 24, bqeVal); - WRITE_LE_UINT16(_vm->_globals._animBqe[idx]._data + 26, READ_LE_INT16(bufPos + bufPerso + 31)); - _vm->_globals._animBqe[idx]._data[28] = bufPerso[bufPos + 33]; - _vm->_globals._animBqe[idx]._data[29] = bufPerso[bufPos + 34]; - byte *bqeCurData = _vm->_globals._animBqe[idx]._data + 20; + WRITE_LE_UINT16(_vm->_globals->_animBqe[idx]._data + 20, READ_LE_INT16(bufPos + bufPerso + 25)); + WRITE_LE_UINT16(_vm->_globals->_animBqe[idx]._data + 22, READ_LE_INT16(bufPos + bufPerso + 27)); + WRITE_LE_UINT16(_vm->_globals->_animBqe[idx]._data + 24, bqeVal); + WRITE_LE_UINT16(_vm->_globals->_animBqe[idx]._data + 26, READ_LE_INT16(bufPos + bufPerso + 31)); + _vm->_globals->_animBqe[idx]._data[28] = bufPerso[bufPos + 33]; + _vm->_globals->_animBqe[idx]._data[29] = bufPerso[bufPos + 34]; + byte *bqeCurData = _vm->_globals->_animBqe[idx]._data + 20; const byte *curBufPerso = bufPos + bufPerso + 25; for (int i = 1; i < 5000; i++) { bqeCurData += 10; @@ -770,10 +770,10 @@ void TalkManager::REPONSE(int zone, int verb) { do { outerLoopFl = false; bool tagFound = false; - if (_vm->_globals._answerBuffer == g_PTRNUL) + if (_vm->_globals->_answerBuffer == g_PTRNUL) return; - byte *curAnswerBuf = _vm->_globals._answerBuffer; + byte *curAnswerBuf = _vm->_globals->_answerBuffer; for (;;) { if (READ_BE_UINT24(curAnswerBuf) == MKTAG24('F', 'I', 'N')) return; @@ -789,7 +789,7 @@ void TalkManager::REPONSE(int zone, int verb) { // 'COD' tag found curAnswerBuf += 5; - ptr = _vm->_globals.allocMemory(620); + ptr = _vm->_globals->allocMemory(620); assert(ptr != g_PTRNUL); memset(ptr, 0, 620); uint16 curAnswerIdx = 0; @@ -847,7 +847,7 @@ void TalkManager::REPONSE(int zone, int verb) { innerLoopCond = true; else if (opcodeType == 6) { // JUMP - _vm->_globals.freeMemory(ptr); + _vm->_globals->freeMemory(ptr); zoneObj = _vm->_objectsManager._jumpZone; verbObj = _vm->_objectsManager._jumpVerb; outerLoopFl = true; @@ -855,14 +855,14 @@ void TalkManager::REPONSE(int zone, int verb) { } } while (!innerLoopCond); } while (outerLoopFl); - _vm->_globals.freeMemory(ptr); - _vm->_globals._saveData->_data[svLastZoneNum] = 0; + _vm->_globals->freeMemory(ptr); + _vm->_globals->_saveData->_data[svLastZoneNum] = 0; return; } void TalkManager::REPONSE2(int zone, int verb) { int indx = 0; - if (verb != 5 || _vm->_globals._saveData->_data[svLastObjectIndex] != 4) + if (verb != 5 || _vm->_globals->_saveData->_data[svLastObjectIndex] != 4) return; if (zone == 22 || zone == 23) { @@ -887,7 +887,7 @@ void TalkManager::REPONSE2(int zone, int verb) { _vm->_objectsManager.stopBobAnimation(6); _vm->_objectsManager.setBobAnimation(8); - switch (_vm->_globals._screenId) { + switch (_vm->_globals->_screenId) { case 35: indx = 201; break; @@ -910,7 +910,7 @@ void TalkManager::REPONSE2(int zone, int verb) { indx = 213; break; } - _vm->_globals._saveData->_data[indx] = 2; + _vm->_globals->_saveData->_data[indx] = 2; _vm->_linesManager.disableZone(22); _vm->_linesManager.disableZone(23); } else if (zone == 20 || zone == 21) { @@ -934,7 +934,7 @@ void TalkManager::REPONSE2(int zone, int verb) { while (_vm->_objectsManager.getBobAnimDataIdx(5) < 12); _vm->_objectsManager.stopBobAnimation(5); _vm->_objectsManager.setBobAnimation(7); - switch (_vm->_globals._screenId) { + switch (_vm->_globals->_screenId) { case 35: indx = 200; break; @@ -957,7 +957,7 @@ void TalkManager::REPONSE2(int zone, int verb) { indx = 212; break; } - _vm->_globals._saveData->_data[indx] = 2; + _vm->_globals->_saveData->_data[indx] = 2; _vm->_linesManager.disableZone(21); _vm->_linesManager.disableZone(20); } @@ -970,7 +970,7 @@ void TalkManager::animateObject(const Common::String &filename) { _vm->_graphicsManager._scrollStatus = 1; _vm->_linesManager.clearAllZones(); _vm->_linesManager.resetLines(); - _vm->_globals.resetHidingItems(); + _vm->_globals->resetHidingItems(); for (int i = 0; i <= 44; i++) _vm->_linesManager.BOBZONE[i] = 0; @@ -979,7 +979,7 @@ void TalkManager::animateObject(const Common::String &filename) { _vm->_eventsManager->_mouseCursorId = 4; _vm->_eventsManager->changeMouseCursor(0); _characterBuffer = _vm->_fileManager->searchCat(filename, RES_PER); - _characterSize = _vm->_globals._catalogSize; + _characterSize = _vm->_globals->_catalogSize; if (_characterBuffer == g_PTRNUL) { _characterBuffer = _vm->_fileManager->loadFile(filename); _characterSize = _vm->_fileManager->fileSize(filename); @@ -992,7 +992,7 @@ void TalkManager::animateObject(const Common::String &filename) { getStringFromBuffer(20, curScreenFilename, (const char *)_characterBuffer); if (curScreenFilename == "NULL") - curScreenFilename = Common::String::format("IM%d", _vm->_globals._screenId); + curScreenFilename = Common::String::format("IM%d", _vm->_globals->_screenId); _characterSprite = _vm->_fileManager->searchCat(spriteFilename, RES_SAN); if (_characterSprite) @@ -1013,18 +1013,18 @@ void TalkManager::animateObject(const Common::String &filename) { _vm->_objectsManager.PERSO_ON = true; searchCharacterPalette(_paletteBufferIdx, true); startCharacterAnim0(_paletteBufferIdx, false); - byte *oldAnswerBufferPtr = _vm->_globals._answerBuffer; - _vm->_globals._answerBuffer = g_PTRNUL; - _vm->_globals._freezeCharacterFl = true; + byte *oldAnswerBufferPtr = _vm->_globals->_answerBuffer; + _vm->_globals->_answerBuffer = g_PTRNUL; + _vm->_globals->_freezeCharacterFl = true; _vm->_objectsManager.loadLinkFile(screenFilename); _vm->_objectsManager.PERSO_ON = true; - _vm->_globals._actionMoveTo = false; + _vm->_globals->_actionMoveTo = false; _vm->_objectsManager._zoneNum = -1; initCharacterAnim(); VISU_PARLE(); dialogWait(); _vm->_graphicsManager.initScreen(screenFilename, 2, true); - _vm->_globals._freezeCharacterFl = true; + _vm->_globals->_freezeCharacterFl = true; _vm->_objectsManager._forceZoneFl = true; _vm->_objectsManager._zoneNum = -1; do { @@ -1035,33 +1035,33 @@ void TalkManager::animateObject(const Common::String &filename) { _vm->_objectsManager.handleRightButton(); _vm->_linesManager.checkZone(); - if (_vm->_globals._actionMoveTo) + if (_vm->_globals->_actionMoveTo) _vm->_objectsManager.PARADISE(); _vm->_eventsManager->refreshScreenAndEvents(); - } while (!_vm->_globals._exitId); + } while (!_vm->_globals->_exitId); dialogEndTalk(); dialogTalk(); clearCharacterAnim(); clearCharacterAnim(); - _vm->_globals._introSpeechOffFl = false; - _characterBuffer = _vm->_globals.freeMemory(_characterBuffer); - _characterSprite = _vm->_globals.freeMemory(_characterSprite); + _vm->_globals->_introSpeechOffFl = false; + _characterBuffer = _vm->_globals->freeMemory(_characterBuffer); + _characterSprite = _vm->_globals->freeMemory(_characterSprite); _vm->_graphicsManager.NB_SCREEN(false); _vm->_linesManager.clearAllZones(); _vm->_linesManager.resetLines(); - _vm->_globals.resetHidingItems(); + _vm->_globals->resetHidingItems(); for (int i = 0; i <= 44; i++) _vm->_linesManager.BOBZONE[i] = 0; - _vm->_globals.freeMemory(_vm->_globals._answerBuffer); - _vm->_globals._answerBuffer = oldAnswerBufferPtr; + _vm->_globals->freeMemory(_vm->_globals->_answerBuffer); + _vm->_globals->_answerBuffer = oldAnswerBufferPtr; _vm->_objectsManager._disableFl = true; _vm->_objectsManager.loadLinkFile(curScreenFilename); _vm->_graphicsManager.initScreen(curScreenFilename, 2, true); _vm->_objectsManager._disableFl = false; - _vm->_globals._freezeCharacterFl = false; - if (_vm->_globals._exitId == 101) - _vm->_globals._exitId = 0; + _vm->_globals->_freezeCharacterFl = false; + if (_vm->_globals->_exitId == 101) + _vm->_globals->_exitId = 0; _vm->_saveLoadManager.load("TEMP.SCR", _vm->_graphicsManager._vesaScreen); g_system->getSavefileManager()->removeSavefile("TEMP.SCR"); @@ -1081,7 +1081,7 @@ void TalkManager::animateObject(const Common::String &filename) { _vm->_graphicsManager.unlockScreen(); _vm->_graphicsManager.setPaletteVGA256(_vm->_graphicsManager._palette); memcpy(_vm->_graphicsManager._vesaBuffer, _vm->_graphicsManager._vesaScreen, 614399); - _vm->_globals._disableInventFl = false; + _vm->_globals->_disableInventFl = false; _vm->_graphicsManager.updateScreen(); for (int i = 0; i <= 4; i++) _vm->_eventsManager->refreshScreenAndEvents(); |