diff options
Diffstat (limited to 'engines/hopkins/dialogs.cpp')
-rw-r--r-- | engines/hopkins/dialogs.cpp | 138 |
1 files changed, 69 insertions, 69 deletions
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) |