diff options
Diffstat (limited to 'engines')
35 files changed, 4206 insertions, 4206 deletions
diff --git a/engines/tsage/blue_force/blueforce_dialogs.cpp b/engines/tsage/blue_force/blueforce_dialogs.cpp index 2d4f6adcf0..86feceb015 100644 --- a/engines/tsage/blue_force/blueforce_dialogs.cpp +++ b/engines/tsage/blue_force/blueforce_dialogs.cpp @@ -66,10 +66,10 @@ RightClickDialog::RightClickDialog() : GfxDialog() { // Set the dialog position Rect dialogRect; dialogRect.resize(_surface, 0, 0, 100); - dialogRect.center(_globals->_events._mousePos.x, _globals->_events._mousePos.y); + dialogRect.center(g_globals->_events._mousePos.x, g_globals->_events._mousePos.y); // Ensure the dialog will be entirely on-screen - Rect screenRect = _globals->gfxManager()._bounds; + Rect screenRect = g_globals->gfxManager()._bounds; screenRect.collapse(4, 4); dialogRect.contain(screenRect); @@ -88,10 +88,10 @@ RightClickDialog::~RightClickDialog() { void RightClickDialog::draw() { // Save the covered background area - _savedArea = Surface_getArea(_globals->_gfxManagerInstance.getSurface(), _bounds); + _savedArea = Surface_getArea(g_globals->_gfxManagerInstance.getSurface(), _bounds); // Draw the dialog image - _globals->gfxManager().copyFrom(_surface, _bounds.left, _bounds.top); + g_globals->gfxManager().copyFrom(_surface, _bounds.left, _bounds.top); // Pre-process rect lists for (int idx = 0; idx < 5; ++idx) { @@ -153,9 +153,9 @@ void RightClickDialog::execute() { // Dialog event handler loop _gfxManager.activate(); - while (!_vm->shouldQuit() && (_selectedAction == -1)) { + while (!g_vm->shouldQuit() && (_selectedAction == -1)) { Event evt; - while (_globals->_events.getEvent(evt, EVENT_MOUSE_MOVE | EVENT_BUTTON_DOWN)) { + while (g_globals->_events.getEvent(evt, EVENT_MOUSE_MOVE | EVENT_BUTTON_DOWN)) { evt.mousePos.x -= _bounds.left; evt.mousePos.y -= _bounds.top; @@ -232,9 +232,9 @@ void AmmoBeltDialog::execute() { // Dialog event handler loop _gfxManager.activate(); - while (!_vm->shouldQuit() && !_closeFlag) { + while (!g_vm->shouldQuit() && !_closeFlag) { Event evt; - while (_globals->_events.getEvent(evt, EVENT_MOUSE_MOVE | EVENT_BUTTON_DOWN)) { + while (g_globals->_events.getEvent(evt, EVENT_MOUSE_MOVE | EVENT_BUTTON_DOWN)) { evt.mousePos.x -= _bounds.left; evt.mousePos.y -= _bounds.top; @@ -321,13 +321,13 @@ void AmmoBeltDialog::draw() { if (!_savedArea) { // Save the covered background area - _savedArea = Surface_getArea(_globals->_gfxManagerInstance.getSurface(), _bounds); + _savedArea = Surface_getArea(g_globals->_gfxManagerInstance.getSurface(), _bounds); } else { bounds.moveTo(0, 0); } // Draw the dialog image - _globals->gfxManager().copyFrom(_surface, bounds.left, bounds.top); + g_globals->gfxManager().copyFrom(_surface, bounds.left, bounds.top); // Setup clip flags bool clip1 = true, clip2 = true; @@ -344,7 +344,7 @@ void AmmoBeltDialog::draw() { if (clip1) { GfxSurface clipSurface = surfaceFromRes(9, 6, BF_GLOBALS._clip1Bullets); _clip1Rect.resize(clipSurface, _clip1Rect.left, _clip1Rect.top, 100); - _globals->gfxManager().copyFrom(clipSurface, bounds.left + _clip1Rect.left, + g_globals->gfxManager().copyFrom(clipSurface, bounds.left + _clip1Rect.left, bounds.top + _clip1Rect.top); } @@ -352,7 +352,7 @@ void AmmoBeltDialog::draw() { if (clip2) { GfxSurface clipSurface = surfaceFromRes(9, 6, BF_GLOBALS._clip2Bullets); _clip2Rect.resize(clipSurface, _clip2Rect.left, _clip2Rect.top, 100); - _globals->gfxManager().copyFrom(clipSurface, bounds.left + _clip2Rect.left, + g_globals->gfxManager().copyFrom(clipSurface, bounds.left + _clip2Rect.left, bounds.top + _clip2Rect.top); } @@ -360,7 +360,7 @@ void AmmoBeltDialog::draw() { if (gunLoaded) { GfxSurface loadedSurface = surfaceFromRes(9, 7, 1); _loadedRect.resize(loadedSurface, _loadedRect.left, _loadedRect.top, 100); - _globals->gfxManager().copyFrom(loadedSurface, bounds.left + _loadedRect.left, + g_globals->gfxManager().copyFrom(loadedSurface, bounds.left + _loadedRect.left, bounds.top + _loadedRect.top); } } diff --git a/engines/tsage/blue_force/blueforce_logic.cpp b/engines/tsage/blue_force/blueforce_logic.cpp index 80b379d5d5..15d68ae4f0 100644 --- a/engines/tsage/blue_force/blueforce_logic.cpp +++ b/engines/tsage/blue_force/blueforce_logic.cpp @@ -43,9 +43,9 @@ namespace BlueForce { void BlueForceGame::start() { // Start the game - _globals->_sceneManager.changeScene(300); + g_globals->_sceneManager.changeScene(300); - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_events.setCursor(CURSOR_WALK); } Scene *BlueForceGame::createScene(int sceneNumber) { @@ -240,20 +240,20 @@ void BlueForceGame::processEvent(Event &event) { case Common::KEYCODE_F4: // F4 - Restart restartGame(); - _globals->_events.setCursorFromFlag(); + g_globals->_events.setCursorFromFlag(); break; case Common::KEYCODE_F7: // F7 - Restore restoreGame(); - _globals->_events.setCursorFromFlag(); + g_globals->_events.setCursorFromFlag(); break; case Common::KEYCODE_F10: // F10 - Pause GfxDialog::setPalette(); MessageDialog::show(GAME_PAUSED_MSG, OK_BTN_STRING); - _globals->_events.setCursorFromFlag(); + g_globals->_events.setCursorFromFlag(); break; default: @@ -470,16 +470,16 @@ void NamedObject::setDetails(int resNum, int lookLineNum, int talkLineNum, int u switch (mode) { case 2: - _globals->_sceneItems.push_front(this); + g_globals->_sceneItems.push_front(this); break; case 4: - _globals->_sceneItems.addBefore(item, this); + g_globals->_sceneItems.addBefore(item, this); break; case 5: - _globals->_sceneItems.addAfter(item, this); + g_globals->_sceneItems.addAfter(item, this); break; default: - _globals->_sceneItems.push_back(this); + g_globals->_sceneItems.push_back(this); break; } } diff --git a/engines/tsage/blue_force/blueforce_logic.h b/engines/tsage/blue_force/blueforce_logic.h index 0184c6503b..969e4abd8b 100644 --- a/engines/tsage/blue_force/blueforce_logic.h +++ b/engines/tsage/blue_force/blueforce_logic.h @@ -35,7 +35,7 @@ namespace BlueForce { using namespace TsAGE; -#define BF_INVENTORY (*((::TsAGE::BlueForce::BlueForceInvObjectList *)_globals->_inventory)) +#define BF_INVENTORY (*((::TsAGE::BlueForce::BlueForceInvObjectList *)g_globals->_inventory)) class BlueForceGame: public Game { public: diff --git a/engines/tsage/blue_force/blueforce_scenes1.cpp b/engines/tsage/blue_force/blueforce_scenes1.cpp index 0d47cb1c5d..c953584665 100644 --- a/engines/tsage/blue_force/blueforce_scenes1.cpp +++ b/engines/tsage/blue_force/blueforce_scenes1.cpp @@ -56,9 +56,9 @@ void Scene100::Action1::signal() { setDelay(6); break; case 1: { - Common::String msg1 = _resourceManager->getMessage(100, _state++); + Common::String msg1 = g_resourceManager->getMessage(100, _state++); if (msg1.compareTo("LASTCREDIT")) { - Common::String msg2 = _resourceManager->getMessage(100, _state++); + Common::String msg2 = g_resourceManager->getMessage(100, _state++); setTextStrings(msg1, msg2, this); --_actionIndex; } else { @@ -121,7 +121,7 @@ void Scene100::Action1::setTextStrings(const Common::String &msg1, const Common: } void Scene100::Action2::signal() { - Scene100 *scene = (Scene100 *)_globals->_sceneManager._scene; + Scene100 *scene = (Scene100 *)g_globals->_sceneManager._scene; static byte black[3] = {0, 0, 0}; switch (_actionIndex++) { @@ -139,7 +139,7 @@ void Scene100::Action2::signal() { ConfMan.flushToDisk(); } else { // Prompt user for whether to start play or watch introduction - _globals->_player.enableControl(); + g_globals->_player.enableControl(); if (MessageDialog::show2(WATCH_INTRO_MSG, START_PLAY_BTN_STRING, INTRODUCTION_BTN_STRING) == 0) { // Signal to start the game @@ -150,7 +150,7 @@ void Scene100::Action2::signal() { } // At this point the introduction needs to start - _globals->_scenePalette.addFader(black, 1, 2, this); + g_globals->_scenePalette.addFader(black, 1, 2, this); break; } case 3: @@ -178,9 +178,9 @@ void Scene100::postInit(SceneObjectList *OwnerList) { BF_GLOBALS._v51C44 = 1; BF_GLOBALS._interfaceY = SCREEN_HEIGHT; - _globals->_player.postInit(); - _globals->_player.hide(); - _globals->_player.disableControl(); + g_globals->_player.postInit(); + g_globals->_player.hide(); + g_globals->_player.disableControl(); _index = 109; if (BF_GLOBALS._dayNumber < 6) { diff --git a/engines/tsage/blue_force/blueforce_scenes6.cpp b/engines/tsage/blue_force/blueforce_scenes6.cpp index e6101039ab..dec17b2f6b 100644 --- a/engines/tsage/blue_force/blueforce_scenes6.cpp +++ b/engines/tsage/blue_force/blueforce_scenes6.cpp @@ -355,7 +355,7 @@ void Scene666::signal() { _text._fontNumber = 4; _text._width = 150; - Common::String msg = _resourceManager->getMessage(666, BF_GLOBALS._deathReason); + Common::String msg = g_resourceManager->getMessage(666, BF_GLOBALS._deathReason); sceneBounds = BF_GLOBALS._sceneManager._scene->_sceneBounds; sceneBounds.collapse(4, 2); BF_GLOBALS.gfxManager()._font.getStringBounds(msg.c_str(), textRect, _text._width); diff --git a/engines/tsage/blue_force/blueforce_ui.cpp b/engines/tsage/blue_force/blueforce_ui.cpp index a4edffbe39..fb4008d2c1 100644 --- a/engines/tsage/blue_force/blueforce_ui.cpp +++ b/engines/tsage/blue_force/blueforce_ui.cpp @@ -272,7 +272,7 @@ void UICollection::draw() { UIElements::UIElements(): UICollection() { _cursorVisage.setVisage(1, 5); - _saver->addLoadNotifier(&UIElements::loadNotifierProc); + g_saver->addLoadNotifier(&UIElements::loadNotifierProc); } void UIElements::synchronize(Serializer &s) { diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp index 49fc31dbd1..d86548bd4b 100644 --- a/engines/tsage/converse.cpp +++ b/engines/tsage/converse.cpp @@ -78,7 +78,7 @@ void SequenceManager::remove() { _sequenceData.clear(); } - if (_globals->_sceneObjects->contains(&_sceneText)) + if (g_globals->_sceneObjects->contains(&_sceneText)) _sceneText.remove(); Common::set_to(&_objectList[0], &_objectList[6], (SceneObject *)NULL); @@ -86,7 +86,7 @@ void SequenceManager::remove() { } void SequenceManager::signal() { - if (_globals->_sceneObjects->contains(&_sceneText)) + if (g_globals->_sceneObjects->contains(&_sceneText)) _sceneText.hide(); bool continueFlag = true; @@ -143,8 +143,8 @@ void SequenceManager::signal() { v1 = getNextValue(); v3 = getNextValue(); v2 = getNextValue(); - _globals->_sceneManager._scene->_sceneBounds.moveTo(v3, v2); - _globals->_sceneManager._scene->loadScene(v1); + g_globals->_sceneManager._scene->_sceneBounds.moveTo(v3, v2); + g_globals->_sceneManager._scene->loadScene(v1); break; case 10: { int resNum= getNextValue(); @@ -224,7 +224,7 @@ void SequenceManager::signal() { int minPercent = getNextValue(); int yEnd = getNextValue(); int maxPercent = getNextValue(); - _globals->_sceneManager._scene->setZoomPercents(yStart, minPercent, yEnd, maxPercent); + g_globals->_sceneManager._scene->setZoomPercents(yStart, minPercent, yEnd, maxPercent); break; } case 26: @@ -252,7 +252,7 @@ void SequenceManager::signal() { break; case 30: v1 = getNextValue(); - _globals->_scrollFollower = (v1 == -1) ? NULL : _objectList[v1]; + g_globals->_scrollFollower = (v1 == -1) ? NULL : _objectList[v1]; break; case 31: _sceneObject->setObjectWrapper(new SceneObjectWrapper()); @@ -266,7 +266,7 @@ void SequenceManager::signal() { setDelay(1); else { _sceneText.remove(); - _globals->_sceneManager._scene->_stripManager.start(v1, this); + g_globals->_sceneManager._scene->_stripManager.start(v1, this); } break; case 34: { @@ -319,7 +319,7 @@ void SequenceManager::signal() { void SequenceManager::process(Event &event) { if (((event.eventType == EVENT_BUTTON_DOWN) || (event.eventType == EVENT_KEYPRESS)) && - !event.handled && _globals->_sceneObjects->contains(&_sceneText)) { + !event.handled && g_globals->_sceneObjects->contains(&_sceneText)) { // Remove the text item _sceneText.remove(); setDelay(2); @@ -334,8 +334,8 @@ void SequenceManager::attached(EventHandler *newOwner, EventHandler *endHandler, // Get the sequence number to use _resNum = va_arg(va, int); - byte *seqData = _resourceManager->getResource(RES_SEQUENCE, _resNum, 0); - uint seqSize = _vm->_memoryManager.getSize(seqData); + byte *seqData = g_resourceManager->getResource(RES_SEQUENCE, _resNum, 0); + uint seqSize = g_vm->_memoryManager.getSize(seqData); _sequenceData.resize(seqSize); Common::copy(seqData, seqData + seqSize, &_sequenceData[0]); @@ -375,14 +375,14 @@ void SequenceManager::setMessage(int resNum, int lineNum, int fontNum, int color _sceneText._width = width; // Get the display message - Common::String msg = _resourceManager->getMessage(resNum, lineNum); + Common::String msg = g_resourceManager->getMessage(resNum, lineNum); // Set the text message _sceneText.setup(msg); // Move the text to the correct position Rect textRect = _sceneText._bounds; - Rect sceneBounds = _globals->_sceneManager._scene->_sceneBounds; + Rect sceneBounds = g_globals->_sceneManager._scene->_sceneBounds; sceneBounds.collapse(4, 2); textRect.moveTo(pt); textRect.contain(sceneBounds); @@ -405,14 +405,14 @@ void SequenceManager::setMessage(int resNum, int lineNum, int fontNum, int color } SequenceManager *SequenceManager::globalManager() { - return &_globals->_sequenceManager; + return &g_globals->_sequenceManager; } /*--------------------------------------------------------------------------*/ ConversationChoiceDialog::ConversationChoiceDialog() { _stdColor = 23; - _highlightColor = _globals->_scenePalette._colors.background; + _highlightColor = g_globals->_scenePalette._colors.background; _fontNumber = 1; } @@ -443,17 +443,17 @@ int ConversationChoiceDialog::execute(const Common::StringArray &choiceList) { // Draw the dialog draw(); - _globals->_events.showCursor(); + g_globals->_events.showCursor(); // Event handling loop Event event; - while (!_vm->shouldQuit()) { - while (!_globals->_events.getEvent(event, EVENT_KEYPRESS | EVENT_BUTTON_DOWN | EVENT_MOUSE_MOVE) && - !_vm->shouldQuit()) { + while (!g_vm->shouldQuit()) { + while (!g_globals->_events.getEvent(event, EVENT_KEYPRESS | EVENT_BUTTON_DOWN | EVENT_MOUSE_MOVE) && + !g_vm->shouldQuit()) { g_system->delayMillis(10); g_system->updateScreen(); } - if (_vm->shouldQuit()) + if (g_vm->shouldQuit()) break; if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode >= Common::KEYCODE_1) && @@ -504,7 +504,7 @@ void ConversationChoiceDialog::draw() { // Make a backup copy of the area the dialog will occupy Rect tempRect = _bounds; tempRect.collapse(-10, -10); - _savedArea = Surface_getArea(_globals->_gfxManagerInstance.getSurface(), tempRect); + _savedArea = Surface_getArea(g_globals->_gfxManagerInstance.getSurface(), tempRect); // Fill in the contents of the entire dialog _gfxManager._bounds = Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); @@ -573,8 +573,8 @@ void StripManager::start(int stripNum, EventHandler *owner, StripCallback *callb _stripNum = stripNum; _callbackObject = callback; - _sceneNumber = _globals->_sceneManager._scene->_screenNumber; - _sceneBounds = _globals->_sceneManager._scene->_sceneBounds; + _sceneNumber = g_globals->_sceneManager._scene->_screenNumber; + _sceneBounds = g_globals->_sceneManager._scene->_sceneBounds; _script.clear(); assert(owner); @@ -603,8 +603,8 @@ void StripManager::reset() { void StripManager::load() { // Get the script - byte *script = _resourceManager->getResource(RES_STRIP, _stripNum, 2); - uint scriptSize = _vm->_memoryManager.getSize(script); + byte *script = g_resourceManager->getResource(RES_STRIP, _stripNum, 2); + uint scriptSize = g_vm->_memoryManager.getSize(script); _script.resize(scriptSize); Common::copy(script, script + scriptSize, &_script[0]); @@ -612,8 +612,8 @@ void StripManager::load() { DEALLOCATE(script); // Get the object list - byte *obj44List = _resourceManager->getResource(RES_STRIP, _stripNum, 1); - int dataSize = _vm->_memoryManager.getSize(obj44List); + byte *obj44List = g_resourceManager->getResource(RES_STRIP, _stripNum, 1); + int dataSize = g_vm->_memoryManager.getSize(obj44List); assert((dataSize % 0x44) == 0); byte *dataP = obj44List; @@ -677,9 +677,9 @@ void StripManager::remove() { if (_activeSpeaker) _activeSpeaker->remove(); - if (_sceneNumber != _globals->_sceneManager._scene->_screenNumber) { - _globals->_sceneManager._scene->_sceneBounds = _sceneBounds; - _globals->_sceneManager._scene->loadScene(_sceneNumber); + if (_sceneNumber != g_globals->_sceneManager._scene->_screenNumber) { + g_globals->_sceneManager._scene->_sceneBounds = _sceneBounds; + g_globals->_sceneManager._scene->loadScene(_sceneNumber); } if (_onEnd) @@ -744,9 +744,9 @@ void StripManager::signal() { _activeSpeaker->remove(); _activeSpeaker = speakerP; - if ((_activeSpeaker->_newSceneNumber == -1) && (_globals->_sceneManager._scene->_screenNumber != _sceneNumber)) { - _globals->_sceneManager._scene->_sceneBounds = _sceneBounds; - _globals->_sceneManager._scene->loadScene(_sceneNumber); + if ((_activeSpeaker->_newSceneNumber == -1) && (g_globals->_sceneManager._scene->_screenNumber != _sceneNumber)) { + g_globals->_sceneManager._scene->_sceneBounds = _sceneBounds; + g_globals->_sceneManager._scene->loadScene(_sceneNumber); } _activeSpeaker->proc12(this); @@ -839,7 +839,7 @@ Speaker::Speaker() : EventHandler() { _textPos = Common::Point(10, 20); _fontNumber = 2; _textMode = ALIGN_LEFT; - _color1 = _color2 = _color3 = _globals->_scenePalette._colors.foreground; + _color1 = _color2 = _color3 = g_globals->_scenePalette._colors.foreground; _action = NULL; _speakerName = "SPEAKER"; } @@ -872,9 +872,9 @@ void Speaker::remove() { void Speaker::proc12(Action *action) { _action = action; if (_newSceneNumber != -1) { - _oldSceneNumber = _globals->_sceneManager._sceneNumber; - _sceneBounds = _globals->_sceneManager._scene->_sceneBounds; - _globals->_sceneManager._scene->loadScene(_newSceneNumber); + _oldSceneNumber = g_globals->_sceneManager._sceneNumber; + _sceneBounds = g_globals->_sceneManager._scene->_sceneBounds; + g_globals->_sceneManager._scene->loadScene(_newSceneNumber); } if (_hideObjects) @@ -882,14 +882,14 @@ void Speaker::proc12(Action *action) { _objectList.activate(); // Draw the speaker objects without any fading - FadeMode fadeMode = _globals->_sceneManager._fadeMode; - _globals->_sceneManager._fadeMode = FADEMODE_IMMEDIATE; - _globals->_sceneObjects->draw(); - _globals->_sceneManager._fadeMode = fadeMode; + FadeMode fadeMode = g_globals->_sceneManager._fadeMode; + g_globals->_sceneManager._fadeMode = FADEMODE_IMMEDIATE; + g_globals->_sceneObjects->draw(); + g_globals->_sceneManager._fadeMode = fadeMode; } void Speaker::setText(const Common::String &msg) { - _globals->_sceneObjects->draw(); + g_globals->_sceneObjects->draw(); _sceneText._color1 = _color1; _sceneText._color2 = _color2; @@ -942,16 +942,16 @@ void ScreenSpeaker::setText(const Common::String &msg) { gfxMan._font.setFontNumber(_fontNumber); Rect textRect; - _globals->gfxManager().getStringBounds(msg.c_str(), textRect, _textWidth); + g_globals->gfxManager().getStringBounds(msg.c_str(), textRect, _textWidth); if (_npc) { textRect.center(_npc->_position.x, _npc->_bounds.top - (textRect.height() / 2 + 10)); } else { - textRect.center(_globals->_sceneManager._scene->_sceneBounds.left + - (_globals->_sceneManager._scene->_sceneBounds.width() / 2), - _globals->_sceneManager._scene->_sceneBounds.top); + textRect.center(g_globals->_sceneManager._scene->_sceneBounds.left + + (g_globals->_sceneManager._scene->_sceneBounds.width() / 2), + g_globals->_sceneManager._scene->_sceneBounds.top); } - Rect rect2 = _globals->_sceneManager._scene->_sceneBounds; + Rect rect2 = g_globals->_sceneManager._scene->_sceneBounds; rect2.collapse(10, 6); textRect.contain(rect2); @@ -967,14 +967,14 @@ void ScreenSpeaker::setText(const Common::String &msg) { void SpeakerAction::signal() { switch (_actionIndex++) { case 0: - setDelay(_globals->_randomSource.getRandomNumber(60) + 60); + setDelay(g_globals->_randomSource.getRandomNumber(60) + 60); break; case 1: static_cast<SceneObject *>(_owner)->setFrame(1); static_cast<SceneObject *>(_owner)->animate(ANIM_MODE_5, this, NULL); break; case 2: - setDelay(_globals->_randomSource.getRandomNumber(10)); + setDelay(g_globals->_randomSource.getRandomNumber(10)); _actionIndex = 0; break; default: diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index ce2231b6be..c237548547 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -50,7 +50,7 @@ InvObject::InvObject(int sceneNumber, int rlbNum, int cursorNum, CursorType curs // Decode the image for the inventory item to get it's display bounds uint size; - byte *imgData = _resourceManager->getSubResource(_displayResNum, _rlbNum, _cursorNum, &size); + byte *imgData = g_resourceManager->getSubResource(_displayResNum, _rlbNum, _cursorNum, &size); GfxSurface s = surfaceFromRes(imgData); _bounds = s.getBounds(); @@ -58,7 +58,7 @@ InvObject::InvObject(int sceneNumber, int rlbNum, int cursorNum, CursorType curs } InvObject::InvObject(int visage, int strip, int frame) { - assert(_vm->getGameID() == GType_BlueForce); + assert(g_vm->getGameID() == GType_BlueForce); _visage = visage; _strip = strip; _frame = frame; @@ -67,19 +67,19 @@ InvObject::InvObject(int visage, int strip, int frame) { } void InvObject::setCursor() { - if (_vm->getGameID() == GType_BlueForce) { + if (g_vm->getGameID() == GType_BlueForce) { // Blue Force cursor handling _cursorId = (CursorType)BF_GLOBALS._inventory->indexOf(this); - _globals->_events.setCursor(_cursorId); + g_globals->_events.setCursor(_cursorId); } else { // Ringworld cursor handling - _globals->_events._currentCursor = _cursorId; + g_globals->_events._currentCursor = _cursorId; if (_iconResNum != -1) { GfxSurface s = surfaceFromRes(_iconResNum, _rlbNum, _cursorNum); Graphics::Surface src = s.lockSurface(); - _globals->_events.setCursor(src, s._transColor, s._centroid, _cursorId); + g_globals->_events.setCursor(src, s._transColor, s._centroid, _cursorId); } } } @@ -171,7 +171,7 @@ void Action::remove() { _owner->_action = NULL; _owner = NULL; } else { - _globals->_sceneManager.removeAction(this); + g_globals->_sceneManager.removeAction(this); } _attached = false; @@ -189,7 +189,7 @@ void Action::dispatch() { _action->dispatch(); if (_delayFrames) { - uint32 frameNumber = _globals->_events.getFrameNumber(); + uint32 frameNumber = g_globals->_events.getFrameNumber(); if (frameNumber >= _startFrame) { _delayFrames -= frameNumber - _startFrame; @@ -205,7 +205,7 @@ void Action::dispatch() { void Action::attached(EventHandler *newOwner, EventHandler *endHandler, va_list va) { _actionIndex = 0; _delayFrames = 0; - _startFrame = _globals->_events.getFrameNumber(); + _startFrame = g_globals->_events.getFrameNumber(); _owner = newOwner; _endHandler = endHandler; _attached = true; @@ -214,7 +214,7 @@ void Action::attached(EventHandler *newOwner, EventHandler *endHandler, va_list void Action::setDelay(int numFrames) { _delayFrames = numFrames; - _startFrame = _globals->_events.getFrameNumber(); + _startFrame = g_globals->_events.getFrameNumber(); } /*--------------------------------------------------------------------------*/ @@ -323,7 +323,7 @@ void ObjectMover::setup(const Common::Point &destPos) { _sceneObject->calcAngle(destPos); if ((_sceneObject->_objectWrapper) && !(_sceneObject->_flags & OBJFLAG_SUPPRESS_DISPATCH)) { - if (_vm->getGameID() == GType_Ringworld) + if (g_vm->getGameID() == GType_Ringworld) _sceneObject->_objectWrapper->dispatch(); else _sceneObject->updateAngle(destPos); @@ -486,8 +486,8 @@ void PlayerMover::endMove() { } // Set up the new interim destination along the route - _globals->_walkRegions._routeEnds.moveSrc = _globals->_walkRegions._routeEnds.moveDest; - _globals->_walkRegions._routeEnds.moveDest = _routeList[_routeIndex]; + g_globals->_walkRegions._routeEnds.moveSrc = g_globals->_walkRegions._routeEnds.moveDest; + g_globals->_walkRegions._routeEnds.moveDest = _routeList[_routeIndex]; setup(_routeList[_routeIndex]); dispatch(); } @@ -495,18 +495,18 @@ void PlayerMover::endMove() { void PlayerMover::setDest(const Common::Point &destPos) { _routeList[0] = _sceneObject->_position; - if (_globals->_walkRegions._resNum == -1) { + if (g_globals->_walkRegions._resNum == -1) { // Scene has no walk regions defined, so player can walk anywhere directly _routeList[0] = destPos; _routeList[1] = Common::Point(ROUTE_END_VAL, ROUTE_END_VAL); } else { // Figure out a path to the destination (or as close as possible to it) - pathfind(_routeList, _sceneObject->_position, destPos, _globals->_walkRegions._routeEnds); + pathfind(_routeList, _sceneObject->_position, destPos, g_globals->_walkRegions._routeEnds); } _routeIndex = 0; - _globals->_walkRegions._routeEnds.moveSrc = _sceneObject->_position; - _globals->_walkRegions._routeEnds.moveDest = _routeList[0]; + g_globals->_walkRegions._routeEnds.moveSrc = _sceneObject->_position; + g_globals->_walkRegions._routeEnds.moveDest = _routeList[0]; setup(_routeList[0]); } @@ -519,7 +519,7 @@ void PlayerMover::pathfind(Common::Point *routeList, Common::Point srcPos, Commo Common::Point objPos; // Get the region the source is in - int srcRegion = _globals->_walkRegions.indexOf(srcPos); + int srcRegion = g_globals->_walkRegions.indexOf(srcPos); if (srcRegion == -1) { srcRegion = findClosestRegion(srcPos, regionIndexes); } @@ -528,7 +528,7 @@ void PlayerMover::pathfind(Common::Point *routeList, Common::Point srcPos, Commo routeRegions[0] = 0; while (!routeRegions[0]) { // Check the destination region - int destRegion = _globals->_walkRegions.indexOf(destPos, ®ionIndexes); + int destRegion = g_globals->_walkRegions.indexOf(destPos, ®ionIndexes); if ((srcRegion == -1) && (destRegion == -1)) { // Both source and destination are outside walkable areas @@ -539,14 +539,14 @@ void PlayerMover::pathfind(Common::Point *routeList, Common::Point srcPos, Commo Common::Point newPos; findLinePoint(&tempRouteEnds, &objPos, 1, &newPos); - int srcId = _globals->_walkRegions.indexOf(newPos); + int srcId = g_globals->_walkRegions.indexOf(newPos); if (srcId == -1) { tempRouteEnds.moveDest = tempRouteEnds.moveSrc; tempRouteEnds.moveSrc = routeEnds.moveDest; findLinePoint(&tempRouteEnds, &objPos, 1, &newPos); - srcRegion = _globals->_walkRegions.indexOf(newPos); + srcRegion = g_globals->_walkRegions.indexOf(newPos); if (srcRegion == -1) srcRegion = checkMover(srcPos, destPos); @@ -579,8 +579,8 @@ void PlayerMover::pathfind(Common::Point *routeList, Common::Point srcPos, Commo } // field 0 holds the start, and field 1 holds the destination - WRField18 &currSrcField = _globals->_walkRegions._field18[0]; - WRField18 &currDestField = _globals->_walkRegions._field18[1]; + WRField18 &currSrcField = g_globals->_walkRegions._field18[0]; + WRField18 &currDestField = g_globals->_walkRegions._field18[1]; currSrcField._pt1 = srcPos; currSrcField._pt2 = srcPos; @@ -598,11 +598,11 @@ void PlayerMover::pathfind(Common::Point *routeList, Common::Point srcPos, Commo int breakEntry2 = routeRegions[idx + 1]; int listIndex = 0; - while (_globals->_walkRegions._idxList[_globals->_walkRegions[breakEntry]._idxListIndex + listIndex] != + while (g_globals->_walkRegions._idxList[g_globals->_walkRegions[breakEntry]._idxListIndex + listIndex] != breakEntry2) ++listIndex; - tempList[idx] = _globals->_walkRegions._idxList2[_globals->_walkRegions[breakEntry]._idxList2Index + tempList[idx] = g_globals->_walkRegions._idxList2[g_globals->_walkRegions[breakEntry]._idxList2Index + listIndex]; ++endIndex; @@ -613,8 +613,8 @@ void PlayerMover::pathfind(Common::Point *routeList, Common::Point srcPos, Commo int thisIdx = tempList[listIndex]; int nextIdx = tempList[listIndex + 1]; - WRField18 &thisField = _globals->_walkRegions._field18[thisIdx]; - WRField18 &nextField = _globals->_walkRegions._field18[nextIdx]; + WRField18 &thisField = g_globals->_walkRegions._field18[thisIdx]; + WRField18 &nextField = g_globals->_walkRegions._field18[nextIdx]; if (sub_F8E5_calculatePoint(currSrcField._pt1, nextField._pt1, thisField._pt1, thisField._pt2) && @@ -663,8 +663,8 @@ void PlayerMover::pathfind(Common::Point *routeList, Common::Point srcPos, Commo } int PlayerMover::regionIndexOf(const Common::Point &pt) { - for (uint idx = 0; idx < _globals->_walkRegions._regionList.size(); ++idx) { - if (_globals->_walkRegions._regionList[idx].contains(pt)) + for (uint idx = 0; idx < g_globals->_walkRegions._regionList.size(); ++idx) { + if (g_globals->_walkRegions._regionList[idx].contains(pt)) return idx + 1; } @@ -784,14 +784,14 @@ int PlayerMover::checkMover(Common::Point &srcPos, const Common::Point &destPos) _sceneObject->_mover->dispatch(); // Scan walk regions for point - for (uint idx = 0; idx < _globals->_walkRegions._regionList.size(); ++idx) { - if (_globals->_walkRegions[idx].contains(_sceneObject->_position)) { + for (uint idx = 0; idx < g_globals->_walkRegions._regionList.size(); ++idx) { + if (g_globals->_walkRegions[idx].contains(_sceneObject->_position)) { regionIndex = idx + 1; srcPos = _sceneObject->_position; break; } } - } while ((regionIndex == 0) && (_sceneObject->_mover) && !_vm->shouldQuit()); + } while ((regionIndex == 0) && (_sceneObject->_mover) && !g_vm->shouldQuit()); _sceneObject->_position = objPos; _sceneObject->_regionBitList = regionBitList; @@ -846,14 +846,14 @@ int PlayerMover::calculateRestOfRoute(int *routeList, int srcRegion, int destReg return 32000; } - WalkRegion &srcWalkRegion = _globals->_walkRegions[srcRegion]; + WalkRegion &srcWalkRegion = g_globals->_walkRegions[srcRegion]; int distance; if (!routeList[0]) { // The route is empty (new route). distance = 0; } else { // Find the distance from the last region in the route. - WalkRegion ®ion = _globals->_walkRegions[routeList[*routeList]]; + WalkRegion ®ion = g_globals->_walkRegions[routeList[*routeList]]; distance = findDistance(srcWalkRegion._pt, region._pt); } @@ -874,7 +874,7 @@ int PlayerMover::calculateRestOfRoute(int *routeList, int srcRegion, int destReg int foundIndex = 0; int idx = 0; int currDest; - while ((currDest = _globals->_walkRegions._idxList[srcWalkRegion._idxListIndex + idx]) != 0) { + while ((currDest = g_globals->_walkRegions._idxList[srcWalkRegion._idxListIndex + idx]) != 0) { if (currDest == destRegion) { foundIndex = idx; break; @@ -885,7 +885,7 @@ int PlayerMover::calculateRestOfRoute(int *routeList, int srcRegion, int destReg // Check every connected region until we find a route to the destination (or we have no more to check). int bestDistance = 31990; - while (((currDest = _globals->_walkRegions._idxList[srcWalkRegion._idxListIndex + foundIndex]) != 0) && (!foundRoute)) { + while (((currDest = g_globals->_walkRegions._idxList[srcWalkRegion._idxListIndex + foundIndex]) != 0) && (!foundRoute)) { int newDistance = calculateRestOfRoute(tempList, currDest, destRegion, foundRoute); if ((newDistance <= bestDistance) || foundRoute) { @@ -1046,7 +1046,7 @@ void PaletteModifierCached::synchronize(Serializer &s) { PaletteRotation::PaletteRotation() : PaletteModifierCached() { _percent = 0; _delayCtr = 0; - _frameNumber = _globals->_events.getFrameNumber(); + _frameNumber = g_globals->_events.getFrameNumber(); } void PaletteRotation::synchronize(Serializer &s) { @@ -1064,7 +1064,7 @@ void PaletteRotation::synchronize(Serializer &s) { void PaletteRotation::signal() { if (_delayCtr) { - uint32 frameNumber = _globals->_events.getFrameNumber(); + uint32 frameNumber = g_globals->_events.getFrameNumber(); if (frameNumber >= _frameNumber) { _delayCtr = frameNumber - _frameNumber; @@ -1245,7 +1245,7 @@ ScenePalette::ScenePalette(int paletteNum) { } bool ScenePalette::loadPalette(int paletteNum) { - byte *palData = _resourceManager->getResource(RES_PALETTE, paletteNum, 0, true); + byte *palData = g_resourceManager->getResource(RES_PALETTE, paletteNum, 0, true); if (!palData) return false; @@ -1397,7 +1397,7 @@ PaletteFader *ScenePalette::addFader(const byte *arrBufferRGB, int palSize, int } fader->setPalette(this, step); - _globals->_scenePalette._listeners.push_back(fader); + g_globals->_scenePalette._listeners.push_back(fader); return fader; } @@ -1405,7 +1405,7 @@ PaletteFader *ScenePalette::addFader(const byte *arrBufferRGB, int palSize, int void ScenePalette::changeBackground(const Rect &bounds, FadeMode fadeMode) { ScenePalette tempPalette; - if (_globals->_sceneManager._hasPalette) { + if (g_globals->_sceneManager._hasPalette) { if ((fadeMode == FADEMODE_GRADUAL) || (fadeMode == FADEMODE_IMMEDIATE)) { // Fade out any active palette tempPalette.getPalette(); @@ -1418,16 +1418,16 @@ void ScenePalette::changeBackground(const Rect &bounds, FadeMode fadeMode) { g_system->delayMillis(10); } } else { - _globals->_scenePalette.refresh(); - _globals->_sceneManager._hasPalette = false; + g_globals->_scenePalette.refresh(); + g_globals->_sceneManager._hasPalette = false; } } Rect tempRect = bounds; - if (_vm->getGameID() == GType_BlueForce) + if (g_vm->getGameID() == GType_BlueForce) tempRect.setHeight(BF_GLOBALS._interfaceY); - _globals->_screenSurface.copyFrom(_globals->_sceneManager._scene->_backSurface, + g_globals->_screenSurface.copyFrom(g_globals->_sceneManager._scene->_backSurface, tempRect, Rect(0, 0, tempRect.width(), tempRect.height()), NULL); for (SynchronizedList<PaletteModifier *>::iterator i = tempPalette._listeners.begin(); i != tempPalette._listeners.end(); ++i) @@ -1469,11 +1469,11 @@ void SceneItem::synchronize(Serializer &s) { } void SceneItem::remove() { - _globals->_sceneItems.remove(this); + g_globals->_sceneItems.remove(this); } bool SceneItem::startAction(CursorType action, Event &event) { - if (_vm->getGameID() == GType_Ringworld) { + if (g_vm->getGameID() == GType_Ringworld) { doAction(action); return true; } else if ((action == CURSOR_LOOK) || (action == CURSOR_USE) || (action == CURSOR_TALK) || @@ -1510,25 +1510,25 @@ void SceneItem::doAction(int action) { } bool SceneItem::contains(const Common::Point &pt) { - const Rect &sceneBounds = _globals->_sceneManager._scene->_sceneBounds; + const Rect &sceneBounds = g_globals->_sceneManager._scene->_sceneBounds; if (_sceneRegionId == 0) return _bounds.contains(pt.x + sceneBounds.left, pt.y + sceneBounds.top); else - return _globals->_sceneRegions.indexOf(Common::Point(pt.x + sceneBounds.left, + return g_globals->_sceneRegions.indexOf(Common::Point(pt.x + sceneBounds.left, pt.y + sceneBounds.top)) == _sceneRegionId; } void SceneItem::display(int resNum, int lineNum, ...) { Common::String msg = (!resNum || (resNum == -1)) ? Common::String() : - _resourceManager->getMessage(resNum, lineNum); + g_resourceManager->getMessage(resNum, lineNum); - if ((_vm->getGameID() == GType_BlueForce) && BF_GLOBALS._uiElements._active) + if ((g_vm->getGameID() == GType_BlueForce) && BF_GLOBALS._uiElements._active) BF_GLOBALS._uiElements.hide(); - if (_globals->_sceneObjects->contains(&_globals->_sceneText)) { - _globals->_sceneText.remove(); - _globals->_sceneObjects->draw(); + if (g_globals->_sceneObjects->contains(&g_globals->_sceneText)) { + g_globals->_sceneText.remove(); + g_globals->_sceneObjects->draw(); } GfxFontBackup font; @@ -1536,7 +1536,7 @@ void SceneItem::display(int resNum, int lineNum, ...) { Rect textRect; int maxWidth = 120; bool keepOnscreen = false; - bool centerText = _vm->getGameID() == GType_Ringworld; + bool centerText = g_vm->getGameID() == GType_Ringworld; if (resNum != 0) { va_list va; @@ -1554,7 +1554,7 @@ void SceneItem::display(int resNum, int lineNum, ...) { case SET_WIDTH: // Set width maxWidth = va_arg(va, int); - _globals->_sceneText._width = maxWidth; + g_globals->_sceneText._width = maxWidth; break; case SET_X: // Set the X Position @@ -1566,21 +1566,21 @@ void SceneItem::display(int resNum, int lineNum, ...) { break; case SET_FONT: // Set the font number - _globals->_sceneText._fontNumber = va_arg(va, int); - _globals->gfxManager()._font.setFontNumber(_globals->_sceneText._fontNumber); + g_globals->_sceneText._fontNumber = va_arg(va, int); + g_globals->gfxManager()._font.setFontNumber(g_globals->_sceneText._fontNumber); break; case SET_BG_COLOR: { // Set the background color int bgColor = va_arg(va, int); - _globals->gfxManager()._font._colors.background = bgColor; + g_globals->gfxManager()._font._colors.background = bgColor; if (!bgColor) - _globals->gfxManager().setFillFlag(false); + g_globals->gfxManager().setFillFlag(false); break; } case SET_FG_COLOR: // Set the foreground color - _globals->_sceneText._color1 = va_arg(va, int); - _globals->gfxManager()._font._colors.foreground = _globals->_sceneText._color1; + g_globals->_sceneText._color1 = va_arg(va, int); + g_globals->gfxManager()._font._colors.foreground = g_globals->_sceneText._color1; break; case SET_KEEP_ONSCREEN: // Suppresses immediate display @@ -1589,15 +1589,15 @@ void SceneItem::display(int resNum, int lineNum, ...) { case SET_EXT_BGCOLOR: { // Set secondary bg color int v = va_arg(va, int); - _globals->_sceneText._color2 = v; - _globals->gfxManager()._font._colors2.background = v; + g_globals->_sceneText._color2 = v; + g_globals->gfxManager()._font._colors2.background = v; break; } case SET_EXT_FGCOLOR: { // Set secondary fg color int v = va_arg(va, int); - _globals->_sceneText._color3 = v; - _globals->gfxManager()._font._colors.foreground = v; + g_globals->_sceneText._color3 = v; + g_globals->gfxManager()._font._colors.foreground = v; break; } case SET_POS_MODE: @@ -1606,7 +1606,7 @@ void SceneItem::display(int resNum, int lineNum, ...) { break; case SET_TEXT_MODE: // Set the text mode - _globals->_sceneText._textMode = (TextAlign)va_arg(va, int); + g_globals->_sceneText._textMode = (TextAlign)va_arg(va, int); break; default: break; @@ -1618,27 +1618,27 @@ void SceneItem::display(int resNum, int lineNum, ...) { if (resNum) { // Get required bounding size - _globals->gfxManager().getStringBounds(msg.c_str(), textRect, maxWidth); + g_globals->gfxManager().getStringBounds(msg.c_str(), textRect, maxWidth); textRect.center(pos.x, pos.y); - textRect.contain(_globals->gfxManager()._bounds); + textRect.contain(g_globals->gfxManager()._bounds); if (centerText) { - _globals->_sceneText._color1 = _globals->_sceneText._color2; - _globals->_sceneText._color2 = 0; - _globals->_sceneText._color3 = 0; + g_globals->_sceneText._color1 = g_globals->_sceneText._color2; + g_globals->_sceneText._color2 = 0; + g_globals->_sceneText._color3 = 0; } - _globals->_sceneText.setup(msg); + g_globals->_sceneText.setup(msg); if (centerText) { - _globals->_sceneText.setPosition(Common::Point( - _globals->_sceneManager._scene->_sceneBounds.left + textRect.left, - _globals->_sceneManager._scene->_sceneBounds.top + textRect.top), 0); + g_globals->_sceneText.setPosition(Common::Point( + g_globals->_sceneManager._scene->_sceneBounds.left + textRect.left, + g_globals->_sceneManager._scene->_sceneBounds.top + textRect.top), 0); } else { - _globals->_sceneText.setPosition(pos, 0); + g_globals->_sceneText.setPosition(pos, 0); } - _globals->_sceneText.fixPriority(255); - _globals->_sceneObjects->draw(); + g_globals->_sceneText.fixPriority(255); + g_globals->_sceneObjects->draw(); } // Unless the flag is set to keep the message on-screen, show it until a mouse or keypress, then remove it @@ -1646,16 +1646,16 @@ void SceneItem::display(int resNum, int lineNum, ...) { Event event; // Keep event on-screen until a mouse or keypress - while (!_vm->shouldQuit() && !_globals->_events.getEvent(event, + while (!g_vm->shouldQuit() && !g_globals->_events.getEvent(event, EVENT_BUTTON_DOWN | EVENT_KEYPRESS)) { g_system->updateScreen(); g_system->delayMillis(10); } - _globals->_sceneText.remove(); + g_globals->_sceneText.remove(); } - if ((_vm->getGameID() == GType_BlueForce) && BF_GLOBALS._uiElements._active) { + if ((g_vm->getGameID() == GType_BlueForce) && BF_GLOBALS._uiElements._active) { // Show user interface BF_GLOBALS._uiElements.show(); @@ -1665,7 +1665,7 @@ void SceneItem::display(int resNum, int lineNum, ...) { } void SceneItem::display2(int resNum, int lineNum) { - if (_vm->getGameID() == GType_BlueForce) + if (g_vm->getGameID() == GType_BlueForce) display(resNum, lineNum, SET_WIDTH, 312, SET_X, 4 + GLOBALS._sceneManager._scene->_sceneBounds.left, SET_Y, GLOBALS._sceneManager._scene->_sceneBounds.top + BF_INTERFACE_Y + 2, @@ -1676,7 +1676,7 @@ void SceneItem::display2(int resNum, int lineNum) { } void SceneItem::display(const Common::String &msg) { - assert(_vm->getGameID() == GType_BlueForce); + assert(g_vm->getGameID() == GType_BlueForce); display(-1, -1, msg.c_str(), SET_WIDTH, 312, @@ -1689,7 +1689,7 @@ void SceneItem::display(const Common::String &msg) { /*--------------------------------------------------------------------------*/ bool SceneHotspot::startAction(CursorType action, Event &event) { - if (_vm->getGameID() != GType_BlueForce) + if (g_vm->getGameID() != GType_BlueForce) return SceneItem::startAction(action, event); else { BlueForce::SceneExt *scene = (BlueForce::SceneExt *)BF_GLOBALS._sceneManager._scene; @@ -1701,19 +1701,19 @@ bool SceneHotspot::startAction(CursorType action, Event &event) { void SceneHotspot::doAction(int action) { switch ((int)action) { case CURSOR_LOOK: - if (_vm->getGameID() == GType_BlueForce) + if (g_vm->getGameID() == GType_BlueForce) SceneItem::display(LOOK_SCENE_HOTSPOT); else display(1, 0, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); break; case CURSOR_USE: - if (_vm->getGameID() == GType_BlueForce) + if (g_vm->getGameID() == GType_BlueForce) SceneItem::display(USE_SCENE_HOTSPOT); else display(1, 5, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); break; case CURSOR_TALK: - if (_vm->getGameID() == GType_BlueForce) + if (g_vm->getGameID() == GType_BlueForce) SceneItem::display(TALK_SCENE_HOTSPOT); else display(1, 15, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); @@ -1721,7 +1721,7 @@ void SceneHotspot::doAction(int action) { case CURSOR_WALK: break; default: - if (_vm->getGameID() == GType_BlueForce) + if (g_vm->getGameID() == GType_BlueForce) SceneItem::display(DEFAULT_SCENE_HOTSPOT); else display(2, action, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); @@ -1744,7 +1744,7 @@ bool NamedHotspot::startAction(CursorType action, Event &event) { case CURSOR_LOOK: if (_lookLineNum == -1) SceneHotspot::doAction(action); - else if (_vm->getGameID() == GType_BlueForce) + else if (g_vm->getGameID() == GType_BlueForce) SceneItem::display2(_resNum, _lookLineNum); else SceneItem::display(_resNum, _lookLineNum, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); @@ -1752,7 +1752,7 @@ bool NamedHotspot::startAction(CursorType action, Event &event) { case CURSOR_USE: if (_useLineNum == -1) SceneHotspot::doAction(action); - else if (_vm->getGameID() == GType_BlueForce) + else if (g_vm->getGameID() == GType_BlueForce) SceneItem::display2(_resNum, _useLineNum); else SceneItem::display(_resNum, _useLineNum, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); @@ -1760,7 +1760,7 @@ bool NamedHotspot::startAction(CursorType action, Event &event) { case CURSOR_TALK: if (_talkLineNum == -1) SceneHotspot::doAction(action); - else if (_vm->getGameID() == GType_BlueForce) + else if (g_vm->getGameID() == GType_BlueForce) SceneItem::display2(_resNum, _talkLineNum); else SceneItem::display2(_resNum, _talkLineNum); @@ -1776,7 +1776,7 @@ void NamedHotspot::setDetails(int ys, int xs, int ye, int xe, const int resnum, _lookLineNum = lookLineNum; _useLineNum = useLineNum; _talkLineNum = -1; - _globals->_sceneItems.addItems(this, NULL); + g_globals->_sceneItems.addItems(this, NULL); } void NamedHotspot::setDetails(const Rect &bounds, int resNum, int lookLineNum, int talkLineNum, int useLineNum, int mode, SceneItem *item) { @@ -1788,16 +1788,16 @@ void NamedHotspot::setDetails(const Rect &bounds, int resNum, int lookLineNum, i switch (mode) { case 2: - _globals->_sceneItems.push_front(this); + g_globals->_sceneItems.push_front(this); break; case 4: - _globals->_sceneItems.addBefore(item, this); + g_globals->_sceneItems.addBefore(item, this); break; case 5: - _globals->_sceneItems.addAfter(item, this); + g_globals->_sceneItems.addAfter(item, this); break; default: - _globals->_sceneItems.push_back(this); + g_globals->_sceneItems.push_back(this); break; } } @@ -1828,7 +1828,7 @@ void NamedHotspot::synchronize(Serializer &s) { s.syncAsSint16LE(_lookLineNum); s.syncAsSint16LE(_useLineNum); - if (_vm->getGameID() == GType_BlueForce) + if (g_vm->getGameID() == GType_BlueForce) s.syncAsSint16LE(_talkLineNum); } @@ -1850,7 +1850,7 @@ void SceneObjectWrapper::remove() { } void SceneObjectWrapper::dispatch() { - if (_vm->getGameID() == GType_Ringworld) + if (g_vm->getGameID() == GType_Ringworld) check(); } @@ -1962,7 +1962,7 @@ void SceneObject::animEnded() { int SceneObject::changeFrame() { int frameNum = _frame; - uint32 mouseCtr = _globals->_events.getFrameNumber(); + uint32 mouseCtr = g_globals->_events.getFrameNumber(); if ((_updateStartFrame <= mouseCtr) || (_animateMode == ANIM_MODE_1)) { if (_numFrames > 0) { @@ -2073,7 +2073,7 @@ void SceneObject::addMover(ObjectMover *mover, ...) { if (mover) { // Set up the assigned mover - _walkStartFrame = _globals->_events.getFrameNumber(); + _walkStartFrame = g_globals->_events.getFrameNumber(); if (_moveRate != 0) _walkStartFrame = 60 / _moveRate; @@ -2096,7 +2096,7 @@ void SceneObject::getHorizBounds() { } int SceneObject::getRegionIndex() { - return _globals->_sceneRegions.indexOf(_position); + return g_globals->_sceneRegions.indexOf(_position); } int SceneObject::checkRegion(const Common::Point &pt) { @@ -2107,7 +2107,7 @@ int SceneObject::checkRegion(const Common::Point &pt) { Common::Point savedPos = _position; _position = pt; - int regIndex = _globals->_sceneRegions.indexOf(pt); + int regIndex = g_globals->_sceneRegions.indexOf(pt); if (_regionBitList & (1 << regIndex)) regionIndex = regIndex; @@ -2129,7 +2129,7 @@ int SceneObject::checkRegion(const Common::Point &pt) { newY -= _yDiff; SynchronizedList<SceneObject *>::iterator i; - for (i = _globals->_sceneObjects->begin(); (regionIndex == 0) && (i != _globals->_sceneObjects->end()); ++i) { + for (i = g_globals->_sceneObjects->begin(); (regionIndex == 0) && (i != g_globals->_sceneObjects->end()); ++i) { if ((*i) && ((*i)->_flags & OBJFLAG_CHECK_REGION)) { int objYDiff = (*i)->_position.y - _yDiff; if ((objYDiff >= yPos) && (objYDiff <= newY) && @@ -2146,7 +2146,7 @@ int SceneObject::checkRegion(const Common::Point &pt) { void SceneObject::animate(AnimateMode animMode, ...) { _animateMode = animMode; - _updateStartFrame = _globals->_events.getFrameNumber(); + _updateStartFrame = g_globals->_events.getFrameNumber(); if (_numFrames) _updateStartFrame += 60 / _numFrames; @@ -2234,7 +2234,7 @@ void SceneObject::checkAngle(const Common::Point &pt) { _angle = (angleAmount + 180) % 360; } - if (_objectWrapper && (_vm->getGameID() == GType_Ringworld)) + if (_objectWrapper && (g_vm->getGameID() == GType_Ringworld)) _objectWrapper->dispatch(); } @@ -2291,7 +2291,7 @@ void SceneObject::synchronize(Serializer &s) { void SceneObject::postInit(SceneObjectList *OwnerList) { if (!OwnerList) - OwnerList = _globals->_sceneObjects; + OwnerList = g_globals->_sceneObjects; if (!OwnerList->contains(this)) { _percent = 100; @@ -2319,7 +2319,7 @@ void SceneObject::postInit(SceneObjectList *OwnerList) { void SceneObject::remove() { SceneItem::remove(); - if (_globals->_sceneObjects->contains(this)) + if (g_globals->_sceneObjects->contains(this)) // For objects in the object list, flag the object for removal in the next drawing, so that // the drawing code has a chance to restore the area previously covered by the object _flags |= OBJFLAG_PANES | OBJFLAG_REMOVE | OBJFLAG_HIDE; @@ -2329,7 +2329,7 @@ void SceneObject::remove() { } void SceneObject::dispatch() { - uint32 currTime = _globals->_events.getFrameNumber(); + uint32 currTime = g_globals->_events.getFrameNumber(); if (_action) _action->dispatch(); @@ -2373,7 +2373,7 @@ void SceneObject::dispatch() { int frameNum = 0; do { int count = getFrameCount(); - frameNum = _globals->_randomSource.getRandomNumber(count - 1); + frameNum = g_globals->_randomSource.getRandomNumber(count - 1); } while (frameNum == _frame); setFrame(frameNum); @@ -2431,7 +2431,7 @@ void SceneObject::dispatch() { // Handle updating the zoom and/or priority if (!(_flags & OBJFLAG_ZOOMED)) { int yp = CLIP((int)_position.y, 0, 255); - setZoom(_globals->_sceneManager._scene->_zoomPercents[yp]); + setZoom(g_globals->_sceneManager._scene->_zoomPercents[yp]); } if (!(_flags & OBJFLAG_FIXED_PRIORITY)) { setPriority(_position.y); @@ -2445,8 +2445,8 @@ void SceneObject::calcAngle(const Common::Point &pt) { } void SceneObject::removeObject() { - _globals->_sceneItems.remove(this); - _globals->_sceneObjects->remove(this); + g_globals->_sceneItems.remove(this); + g_globals->_sceneObjects->remove(this); if (_objectWrapper) { _objectWrapper->remove(); @@ -2478,11 +2478,11 @@ void SceneObject::reposition() { */ void SceneObject::draw() { Rect destRect = _bounds; - destRect.translate(-_globals->_sceneManager._scene->_sceneBounds.left, - -_globals->_sceneManager._scene->_sceneBounds.top); - Region *priorityRegion = _globals->_sceneManager._scene->_priorities.find(_priority); + destRect.translate(-g_globals->_sceneManager._scene->_sceneBounds.left, + -g_globals->_sceneManager._scene->_sceneBounds.top); + Region *priorityRegion = g_globals->_sceneManager._scene->_priorities.find(_priority); GfxSurface frame = getFrame(); - _globals->gfxManager().copyFrom(frame, destRect, priorityRegion); + g_globals->gfxManager().copyFrom(frame, destRect, priorityRegion); } /** @@ -2491,17 +2491,17 @@ void SceneObject::draw() { */ void SceneObject::updateScreen() { Rect srcRect = _paneRects[CURRENT_PANENUM]; - const Rect &sceneBounds = _globals->_sceneManager._scene->_sceneBounds; + const Rect &sceneBounds = g_globals->_sceneManager._scene->_sceneBounds; srcRect.left = (srcRect.left / 4) * 4; srcRect.right = ((srcRect.right + 3) / 4) * 4; - srcRect.clip(_globals->_sceneManager._scene->_sceneBounds); + srcRect.clip(g_globals->_sceneManager._scene->_sceneBounds); if (srcRect.isValidRect()) { Rect destRect = srcRect; destRect.translate(-sceneBounds.left, -sceneBounds.top); - srcRect.translate(-_globals->_sceneOffset.x, -_globals->_sceneOffset.y); + srcRect.translate(-g_globals->_sceneOffset.x, -g_globals->_sceneOffset.y); - _globals->_screenSurface.copyFrom(_globals->_sceneManager._scene->_backSurface, srcRect, destRect); + g_globals->_screenSurface.copyFrom(g_globals->_sceneManager._scene->_backSurface, srcRect, destRect); } } @@ -2530,20 +2530,20 @@ void SceneObject::setup(int visage, int stripFrameNum, int frameNum, int posX, i void BackgroundSceneObject::postInit(SceneObjectList *OwnerList) { SceneObjectList dummyList; - SceneObjectList *pList = !_globals->_sceneManager._scene ? &dummyList : - &_globals->_sceneManager._scene->_bgSceneObjects; + SceneObjectList *pList = !g_globals->_sceneManager._scene ? &dummyList : + &g_globals->_sceneManager._scene->_bgSceneObjects; SceneObject::postInit(pList); } void BackgroundSceneObject::draw() { - assert(_globals->_sceneManager._scene); + assert(g_globals->_sceneManager._scene); Rect destRect = _bounds; - destRect.translate(-_globals->_sceneManager._scene->_sceneBounds.left, - -_globals->_sceneManager._scene->_sceneBounds.top); - Region *priorityRegion = _globals->_sceneManager._scene->_priorities.find(_priority); + destRect.translate(-g_globals->_sceneManager._scene->_sceneBounds.left, + -g_globals->_sceneManager._scene->_sceneBounds.top); + Region *priorityRegion = g_globals->_sceneManager._scene->_priorities.find(_priority); GfxSurface frame = getFrame(); - _globals->_sceneManager._scene->_backSurface.copyFrom(frame, destRect, priorityRegion); + g_globals->_sceneManager._scene->_backSurface.copyFrom(frame, destRect, priorityRegion); } /*--------------------------------------------------------------------------*/ @@ -2556,27 +2556,27 @@ void SceneObjectList::draw() { if (_objList.size() == 0) { // Alternate draw mode - if (_globals->_paneRefreshFlag[paneNum] == 1) { + if (g_globals->_paneRefreshFlag[paneNum] == 1) { // Load the background - _globals->_sceneManager._scene->refreshBackground(0, 0); + g_globals->_sceneManager._scene->refreshBackground(0, 0); - Rect tempRect = _globals->_sceneManager._scene->_sceneBounds; - tempRect.translate(-_globals->_sceneOffset.x, -_globals->_sceneOffset.y); - ScenePalette::changeBackground(tempRect, _globals->_sceneManager._fadeMode); + Rect tempRect = g_globals->_sceneManager._scene->_sceneBounds; + tempRect.translate(-g_globals->_sceneOffset.x, -g_globals->_sceneOffset.y); + ScenePalette::changeBackground(tempRect, g_globals->_sceneManager._fadeMode); } else { - _globals->_paneRegions[CURRENT_PANENUM].draw(); + g_globals->_paneRegions[CURRENT_PANENUM].draw(); } - _globals->_paneRegions[CURRENT_PANENUM].setRect(0, 0, 0, 0); - _globals->_sceneManager.fadeInIfNecessary(); + g_globals->_paneRegions[CURRENT_PANENUM].setRect(0, 0, 0, 0); + g_globals->_sceneManager.fadeInIfNecessary(); } else { // If there is a scroll follower, check whether it has moved off-screen - if (_globals->_scrollFollower) { - const Rect &scrollerRect = _globals->_sceneManager._scrollerRect; + if (g_globals->_scrollFollower) { + const Rect &scrollerRect = g_globals->_sceneManager._scrollerRect; Common::Point objPos( - _globals->_scrollFollower->_position.x - _globals->_sceneManager._scene->_sceneBounds.left, - _globals->_scrollFollower->_position.y - _globals->_sceneManager._scene->_sceneBounds.top); + g_globals->_scrollFollower->_position.x - g_globals->_sceneManager._scene->_sceneBounds.left, + g_globals->_scrollFollower->_position.y - g_globals->_sceneManager._scene->_sceneBounds.top); int loadCount = 0; if (objPos.x >= scrollerRect.right) { @@ -2597,21 +2597,21 @@ void SceneObjectList::draw() { } if (loadCount > 0) - _globals->_sceneManager.setBgOffset(Common::Point(xAmount, yAmount), loadCount); + g_globals->_sceneManager.setBgOffset(Common::Point(xAmount, yAmount), loadCount); } - if (_globals->_sceneManager._sceneLoadCount > 0) { - --_globals->_sceneManager._sceneLoadCount; - _globals->_sceneManager._scene->loadBackground(_globals->_sceneManager._sceneBgOffset.x, - _globals->_sceneManager._sceneBgOffset.y); + if (g_globals->_sceneManager._sceneLoadCount > 0) { + --g_globals->_sceneManager._sceneLoadCount; + g_globals->_sceneManager._scene->loadBackground(g_globals->_sceneManager._sceneBgOffset.x, + g_globals->_sceneManager._sceneBgOffset.y); } // Set up the flag mask uint32 flagMask = (paneNum == 0) ? OBJFLAG_PANE_0 : OBJFLAG_PANE_1; // Initial loop to set up object list and update object position, priority, and flags - for (SynchronizedList<SceneObject *>::iterator i = _globals->_sceneObjects->begin(); - i != _globals->_sceneObjects->end(); ++i) { + for (SynchronizedList<SceneObject *>::iterator i = g_globals->_sceneObjects->begin(); + i != g_globals->_sceneObjects->end(); ++i) { SceneObject *obj = *i; objList.push_back(obj); @@ -2624,10 +2624,10 @@ void SceneObjectList::draw() { // Handle updating object priority if (!(obj->_flags & OBJFLAG_FIXED_PRIORITY)) { obj->_priority = MIN((int)obj->_position.y, - (int)_globals->_sceneManager._scene->_backgroundBounds.bottom - 1); + (int)g_globals->_sceneManager._scene->_backgroundBounds.bottom - 1); } - if ((_globals->_paneRefreshFlag[paneNum] != 0) || !_globals->_paneRegions[paneNum].empty()) { + if ((g_globals->_paneRefreshFlag[paneNum] != 0) || !g_globals->_paneRegions[paneNum].empty()) { obj->_flags |= flagMask; } } @@ -2636,20 +2636,20 @@ void SceneObjectList::draw() { checkIntersection(objList, objList.size(), CURRENT_PANENUM); sortList(objList); - if (_globals->_paneRefreshFlag[paneNum] == 1) { + if (g_globals->_paneRefreshFlag[paneNum] == 1) { // Load the background - _globals->_sceneManager._scene->refreshBackground(0, 0); + g_globals->_sceneManager._scene->refreshBackground(0, 0); } - _globals->_sceneManager._scene->_sceneBounds.left &= ~3; - _globals->_sceneManager._scene->_sceneBounds.right &= ~3; - _globals->_sceneOffset.x &= ~3; + g_globals->_sceneManager._scene->_sceneBounds.left &= ~3; + g_globals->_sceneManager._scene->_sceneBounds.right &= ~3; + g_globals->_sceneOffset.x &= ~3; - if (_globals->_paneRefreshFlag[paneNum] != 0) { + if (g_globals->_paneRefreshFlag[paneNum] != 0) { // Change the background - Rect tempRect = _globals->_sceneManager._scene->_sceneBounds; - tempRect.translate(-_globals->_sceneOffset.x, -_globals->_sceneOffset.y); - ScenePalette::changeBackground(tempRect, _globals->_sceneManager._fadeMode); + Rect tempRect = g_globals->_sceneManager._scene->_sceneBounds; + tempRect.translate(-g_globals->_sceneOffset.x, -g_globals->_sceneOffset.y); + ScenePalette::changeBackground(tempRect, g_globals->_sceneManager._fadeMode); } else { for (uint objIndex = 0; objIndex < objList.size(); ++objIndex) { SceneObject *obj = objList[objIndex]; @@ -2658,10 +2658,10 @@ void SceneObjectList::draw() { obj->updateScreen(); } - _globals->_paneRegions[paneNum].draw(); + g_globals->_paneRegions[paneNum].draw(); } - _globals->_paneRegions[paneNum].setRect(0, 0, 0, 0); + g_globals->_paneRegions[paneNum].setRect(0, 0, 0, 0); redraw: // Main draw loop for (uint objIndex = 0; objIndex < objList.size(); ++objIndex) { @@ -2674,9 +2674,9 @@ redraw: } // Update the palette - _globals->_sceneManager.fadeInIfNecessary(); - _globals->_sceneManager._loadMode = 0; - _globals->_paneRefreshFlag[paneNum] = 0; + g_globals->_sceneManager.fadeInIfNecessary(); + g_globals->_sceneManager._loadMode = 0; + g_globals->_paneRefreshFlag[paneNum] = 0; // Loop through the object list, removing any objects and refreshing the screen as necessary for (uint objIndex = 0; objIndex < objList.size(); ++objIndex) { @@ -2759,9 +2759,9 @@ void SceneObjectList::sortList(Common::Array<SceneObject *> &ObjList) { } void SceneObjectList::activate() { - SceneObjectList *objectList = _globals->_sceneObjects; - _globals->_sceneObjects = this; - _globals->_sceneObjects_queue.push_front(this); + SceneObjectList *objectList = g_globals->_sceneObjects; + g_globals->_sceneObjects = this; + g_globals->_sceneObjects_queue.push_front(this); // Flag all the objects as modified SynchronizedList<SceneObject *>::iterator i; @@ -2778,19 +2778,19 @@ void SceneObjectList::activate() { } void SceneObjectList::deactivate() { - if (_globals->_sceneObjects_queue.size() <= 1) + if (g_globals->_sceneObjects_queue.size() <= 1) return; - SceneObjectList *objectList = *_globals->_sceneObjects_queue.begin(); - _globals->_sceneObjects_queue.pop_front(); - _globals->_sceneObjects = *_globals->_sceneObjects_queue.begin(); + SceneObjectList *objectList = *g_globals->_sceneObjects_queue.begin(); + g_globals->_sceneObjects_queue.pop_front(); + g_globals->_sceneObjects = *g_globals->_sceneObjects_queue.begin(); SynchronizedList<SceneObject *>::iterator i; for (i = objectList->begin(); i != objectList->end(); ++i) { if (!((*i)->_flags & OBJFLAG_CLONED)) { SceneObject *sceneObj = (*i)->clone(); sceneObj->_flags |= OBJFLAG_HIDE | OBJFLAG_REMOVE | OBJFLAG_CLONED; - _globals->_sceneObjects->push_front(sceneObj); + g_globals->_sceneObjects->push_front(sceneObj); } } } @@ -2819,12 +2819,12 @@ void SceneText::setup(const Common::String &msg) { gfxMan.activate(); Rect textRect; - if ((_vm->getGameID() != GType_Ringworld) && _globals->_sceneObjects->contains(this) && + if ((g_vm->getGameID() != GType_Ringworld) && g_globals->_sceneObjects->contains(this) && (_flags & OBJFLAG_REMOVE)) { // Trying to setup a SceneText scheduled to be removed, so remove it now _bounds.expandPanes(); this->removeObject(); - _globals->_sceneObjects->remove(this); + g_globals->_sceneObjects->remove(this); } gfxMan._font.setFontNumber(_fontNumber); @@ -2867,7 +2867,7 @@ void SceneText::synchronize(Serializer &s) { void SceneText::updateScreen() { // FIXME: Hack for Blue Force to handle not refreshing the screen if the user interface // has been re-activated after showing some scene text - if ((_vm->getGameID() != GType_BlueForce) || (_bounds.top < BF_INTERFACE_Y) || + if ((g_vm->getGameID() != GType_BlueForce) || (_bounds.top < BF_INTERFACE_Y) || !BF_GLOBALS._uiElements._visible) SceneObject::updateScreen(); } @@ -2886,7 +2886,7 @@ Visage::Visage(const Visage &v) { _rlbNum = v._rlbNum; _data = v._data; if (_data) - _vm->_memoryManager.incLocks(_data); + g_vm->_memoryManager.incLocks(_data); } Visage &Visage::operator=(const Visage &s) { @@ -2894,7 +2894,7 @@ Visage &Visage::operator=(const Visage &s) { _rlbNum = s._rlbNum; _data = s._data; if (_data) - _vm->_memoryManager.incLocks(_data); + g_vm->_memoryManager.incLocks(_data); return *this; } @@ -2905,12 +2905,12 @@ void Visage::setVisage(int resNum, int rlbNum) { _rlbNum = rlbNum; DEALLOCATE(_data); - if (_vm->getGameID() == GType_Ringworld) { + if (g_vm->getGameID() == GType_Ringworld) { // In Ringworld, we immediately get the data - _data = _resourceManager->getResource(RES_VISAGE, resNum, rlbNum); + _data = g_resourceManager->getResource(RES_VISAGE, resNum, rlbNum); } else { // Blue Force has an extra indirection via the visage index file - byte *indexData = _resourceManager->getResource(RES_VISAGE, resNum, 9999); + byte *indexData = g_resourceManager->getResource(RES_VISAGE, resNum, 9999); if (rlbNum == 9999) { _data = indexData; } else { @@ -2926,7 +2926,7 @@ void Visage::setVisage(int resNum, int rlbNum) { } _flipHoriz = flags & 1; - _data = _resourceManager->getResource(RES_VISAGE, resNum, rlbNum); + _data = g_resourceManager->getResource(RES_VISAGE, resNum, rlbNum); } } @@ -2993,10 +2993,10 @@ void Player::postInit(SceneObjectList *OwnerList) { void Player::disableControl() { _canWalk = false; _uiEnabled = false; - _globals->_events.setCursor(CURSOR_NONE); + g_globals->_events.setCursor(CURSOR_NONE); _enabled = false; - if ((_vm->getGameID() == GType_BlueForce) && BF_GLOBALS._uiElements._active) + if ((g_vm->getGameID() == GType_BlueForce) && BF_GLOBALS._uiElements._active) BF_GLOBALS._uiElements.hide(); } @@ -3005,23 +3005,23 @@ void Player::enableControl() { _uiEnabled = true; _enabled = true; - if (_vm->getGameID() == GType_Ringworld) { - _globals->_events.setCursor(CURSOR_WALK); + if (g_vm->getGameID() == GType_Ringworld) { + g_globals->_events.setCursor(CURSOR_WALK); - switch (_globals->_events.getCursor()) { + switch (g_globals->_events.getCursor()) { case CURSOR_WALK: case CURSOR_LOOK: case CURSOR_USE: case CURSOR_TALK: - _globals->_events.setCursor(_globals->_events.getCursor()); + g_globals->_events.setCursor(g_globals->_events.getCursor()); break; default: - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_events.setCursor(CURSOR_WALK); break; } } else { - CursorType cursor = _globals->_events.getCursor(); - _globals->_events.setCursor(cursor); + CursorType cursor = g_globals->_events.getCursor(); + g_globals->_events.setCursor(cursor); if (BF_GLOBALS._uiElements._active) BF_GLOBALS._uiElements.show(); @@ -3029,19 +3029,19 @@ void Player::enableControl() { } void Player::process(Event &event) { - if ((_vm->getGameID() != GType_Ringworld) && _action) + if ((g_vm->getGameID() != GType_Ringworld) && _action) _action->process(event); if (!event.handled && (event.eventType == EVENT_BUTTON_DOWN) && - (_globals->_events.getCursor() == CURSOR_WALK) && _globals->_player._canWalk && - (_position != event.mousePos) && _globals->_sceneObjects->contains(this)) { + (g_globals->_events.getCursor() == CURSOR_WALK) && g_globals->_player._canWalk && + (_position != event.mousePos) && g_globals->_sceneObjects->contains(this)) { - if ((_vm->getGameID() == GType_BlueForce) && !BF_GLOBALS._player._enabled) + if ((g_vm->getGameID() == GType_BlueForce) && !BF_GLOBALS._player._enabled) return; PlayerMover *newMover = new PlayerMover(); - Common::Point destPos(event.mousePos.x + _globals->_sceneManager._scene->_sceneBounds.left, - event.mousePos.y + _globals->_sceneManager._scene->_sceneBounds.top); + Common::Point destPos(event.mousePos.x + g_globals->_sceneManager._scene->_sceneBounds.left, + event.mousePos.y + g_globals->_sceneManager._scene->_sceneBounds.top); addMover(newMover, &destPos, NULL); event.handled = true; @@ -3055,7 +3055,7 @@ void Player::synchronize(Serializer &s) { s.syncAsByte(_uiEnabled); s.syncAsSint16LE(_field8C); - if (_vm->getGameID() == GType_BlueForce) + if (g_vm->getGameID() == GType_BlueForce) s.syncAsByte(_enabled); } @@ -3064,7 +3064,7 @@ void Player::synchronize(Serializer &s) { Region::Region(int resNum, int rlbNum, ResourceType ctlType) { _regionId = rlbNum; - byte *regionData = _resourceManager->getResource(ctlType, resNum, rlbNum); + byte *regionData = g_resourceManager->getResource(ctlType, resNum, rlbNum); assert(regionData); load(regionData); @@ -3199,7 +3199,7 @@ LineSliceSet Region::mergeSlices(const LineSliceSet &set1, const LineSliceSet &s * Copies the background covered by the given region to the screen surface */ void Region::draw() { - Rect &sceneBounds = _globals->_sceneManager._scene->_sceneBounds; + Rect &sceneBounds = g_globals->_sceneManager._scene->_sceneBounds; for (int yp = sceneBounds.top; yp < sceneBounds.bottom; ++yp) { // Generate a line slice set @@ -3214,10 +3214,10 @@ void Region::draw() { rect1.right = (rect1.right + 3) & ~3; Rect rect2 = rect1; - rect1.translate(-_globals->_sceneOffset.x, -_globals->_sceneOffset.y); + rect1.translate(-g_globals->_sceneOffset.x, -g_globals->_sceneOffset.y); rect2.translate(-sceneBounds.left, -sceneBounds.top); - _globals->gfxManager().getSurface().copyFrom(_globals->_sceneManager._scene->_backSurface, + g_globals->gfxManager().getSurface().copyFrom(g_globals->_sceneManager._scene->_backSurface, rect1, rect2); } } @@ -3282,8 +3282,8 @@ void Region::uniteRect(const Rect &rect) { void SceneRegions::load(int sceneNum) { clear(); - bool altRegions = _vm->getFeatures() & GF_ALT_REGIONS; - byte *regionData = _resourceManager->getResource(RES_CONTROL, sceneNum, altRegions ? 1 : 9999, true); + bool altRegions = g_vm->getFeatures() & GF_ALT_REGIONS; + byte *regionData = g_resourceManager->getResource(RES_CONTROL, sceneNum, altRegions ? 1 : 9999, true); if (regionData) { int regionCount = READ_LE_UINT16(regionData); @@ -3504,7 +3504,7 @@ void WalkRegions::load(int sceneNum) { clear(); _resNum = sceneNum; - if (_vm->getFeatures() & GF_ALT_REGIONS) { + if (g_vm->getFeatures() & GF_ALT_REGIONS) { loadRevised(); } else { loadOriginal(); @@ -3515,7 +3515,7 @@ void WalkRegions::load(int sceneNum) { * This version handles loading walk regions for Ringworld floppy version and Demo #1 */ void WalkRegions::loadOriginal() { - byte *regionData = _resourceManager->getResource(RES_WALKRGNS, _resNum, 1, true); + byte *regionData = g_resourceManager->getResource(RES_WALKRGNS, _resNum, 1, true); if (!regionData) { // No data, so return _resNum = -1; @@ -3526,8 +3526,8 @@ void WalkRegions::loadOriginal() { int dataSize; // Load the field 18 list - dataP = _resourceManager->getResource(RES_WALKRGNS, _resNum, 2); - dataSize = _vm->_memoryManager.getSize(dataP); + dataP = g_resourceManager->getResource(RES_WALKRGNS, _resNum, 2); + dataSize = g_vm->_memoryManager.getSize(dataP); assert(dataSize % 10 == 0); byte *p = dataP; @@ -3540,8 +3540,8 @@ void WalkRegions::loadOriginal() { DEALLOCATE(dataP); // Load the idx list - dataP = _resourceManager->getResource(RES_WALKRGNS, _resNum, 3); - dataSize = _vm->_memoryManager.getSize(dataP); + dataP = g_resourceManager->getResource(RES_WALKRGNS, _resNum, 3); + dataSize = g_vm->_memoryManager.getSize(dataP); assert(dataSize % 2 == 0); p = dataP; @@ -3551,8 +3551,8 @@ void WalkRegions::loadOriginal() { DEALLOCATE(dataP); // Load the secondary idx list - dataP = _resourceManager->getResource(RES_WALKRGNS, _resNum, 4); - dataSize = _vm->_memoryManager.getSize(dataP); + dataP = g_resourceManager->getResource(RES_WALKRGNS, _resNum, 4); + dataSize = g_vm->_memoryManager.getSize(dataP); assert(dataSize % 2 == 0); p = dataP; @@ -3562,7 +3562,7 @@ void WalkRegions::loadOriginal() { DEALLOCATE(dataP); // Handle the loading of the actual regions themselves - dataP = _resourceManager->getResource(RES_WALKRGNS, _resNum, 5); + dataP = g_resourceManager->getResource(RES_WALKRGNS, _resNum, 5); byte *pWalkRegion = regionData + 16; byte *srcP = dataP; @@ -3593,7 +3593,7 @@ void WalkRegions::loadOriginal() { * version, it may also be used by future game titles */ void WalkRegions::loadRevised() { - byte *regionData = _resourceManager->getResource(RES_WALKRGNS, _resNum, 2, true); + byte *regionData = g_resourceManager->getResource(RES_WALKRGNS, _resNum, 2, true); if (!regionData) { // No data, so return _resNum = -1; @@ -3676,8 +3676,8 @@ void ScenePriorities::load(int resNum) { _resNum = resNum; clear(); - bool altMode = (_vm->getFeatures() & GF_ALT_REGIONS) != 0; - byte *regionData = _resourceManager->getResource(RES_PRIORITY, resNum, altMode ? 1 : 9999, true); + bool altMode = (g_vm->getFeatures() & GF_ALT_REGIONS) != 0; + byte *regionData = g_resourceManager->getResource(RES_PRIORITY, resNum, altMode ? 1 : 9999, true); if (!regionData) return; @@ -3702,7 +3702,7 @@ void ScenePriorities::load(int resNum) { Region *ScenePriorities::find(int priority) { // If no priority regions are loaded, then return the placeholder region if (empty()) { - if (_vm->getGameID() == GType_Ringworld) + if (g_vm->getGameID() == GType_Ringworld) return &_defaultPriorityRegion; return NULL; } @@ -3758,8 +3758,8 @@ GameHandler::GameHandler() : EventHandler() { } GameHandler::~GameHandler() { - if (_globals) - _globals->_game->removeHandler(this); + if (g_globals) + g_globals->_game->removeHandler(this); } void GameHandler::execute() { @@ -3789,7 +3789,7 @@ SceneHandler::SceneHandler() { void SceneHandler::registerHandler() { postInit(); - _globals->_game->addHandler(this); + g_globals->_game->addHandler(this); } uint32 SceneHandler::getFrameDifference() { @@ -3799,61 +3799,61 @@ uint32 SceneHandler::getFrameDifference() { void SceneHandler::postInit(SceneObjectList *OwnerList) { _delayTicks = 2; - _globals->_scenePalette.loadPalette(0); - _globals->_scenePalette.refresh(); + g_globals->_scenePalette.loadPalette(0); + g_globals->_scenePalette.refresh(); - _globals->_soundManager.postInit(); - _globals->_soundManager.buildDriverList(true); - _globals->_soundManager.installConfigDrivers(); + g_globals->_soundManager.postInit(); + g_globals->_soundManager.buildDriverList(true); + g_globals->_soundManager.installConfigDrivers(); - _globals->_game->start(); + g_globals->_game->start(); } void SceneHandler::process(Event &event) { // Main keypress handler if (!event.handled) { - _globals->_game->processEvent(event); + g_globals->_game->processEvent(event); if (event.eventType == EVENT_KEYPRESS) - _globals->_events.setCursorFromFlag(); + g_globals->_events.setCursorFromFlag(); } // Check for displaying right-click dialog if ((event.eventType == EVENT_BUTTON_DOWN) && (event.btnState == BTNSHIFT_RIGHT) && - _globals->_player._uiEnabled) { - _globals->_game->rightClick(); + g_globals->_player._uiEnabled) { + g_globals->_game->rightClick(); event.handled = true; return; } // If there is an active scene, pass the event to it - if (_globals->_sceneManager._scene) - _globals->_sceneManager._scene->process(event); + if (g_globals->_sceneManager._scene) + g_globals->_sceneManager._scene->process(event); if (!event.handled) { // Separate check for F5 - Save key if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_F5)) { // F5 - Save - _globals->_game->saveGame(); + g_globals->_game->saveGame(); event.handled = true; - _globals->_events.setCursorFromFlag(); + g_globals->_events.setCursorFromFlag(); } // Check for debugger if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_d) && (event.kbd.flags & Common::KBD_CTRL)) { // Attach to the debugger - _vm->_debugger->attach(); - _vm->_debugger->onFrame(); + g_vm->_debugger->attach(); + g_vm->_debugger->onFrame(); } // Mouse press handling - bool enabled = (_vm->getGameID() == GType_BlueForce) ? _globals->_player._enabled : - _globals->_player._uiEnabled; - if (enabled && (event.eventType == EVENT_BUTTON_DOWN) && !_globals->_sceneItems.empty()) { + bool enabled = (g_vm->getGameID() == GType_BlueForce) ? g_globals->_player._enabled : + g_globals->_player._uiEnabled; + if (enabled && (event.eventType == EVENT_BUTTON_DOWN) && !g_globals->_sceneItems.empty()) { // Check if the mouse is on the player - if (_globals->_player.contains(event.mousePos)) { + if (g_globals->_player.contains(event.mousePos)) { playerAction(event); if (event.handled) return; @@ -3861,29 +3861,29 @@ void SceneHandler::process(Event &event) { // Scan the item list to find one the mouse is within SynchronizedList<SceneItem *>::iterator i; - for (i = _globals->_sceneItems.begin(); i != _globals->_sceneItems.end(); ++i) { + for (i = g_globals->_sceneItems.begin(); i != g_globals->_sceneItems.end(); ++i) { if ((*i)->contains(event.mousePos)) { // Pass the action to the item - bool handled = (*i)->startAction(_globals->_events.getCursor(), event); + bool handled = (*i)->startAction(g_globals->_events.getCursor(), event); if (!handled) // Item wasn't handled, keep scanning continue; - if ((_vm->getGameID() == GType_Ringworld) || (_globals->_events.getCursor() == CURSOR_9999)) { - event.handled = _globals->_events.getCursor() != CURSOR_WALK; + if ((g_vm->getGameID() == GType_Ringworld) || (g_globals->_events.getCursor() == CURSOR_9999)) { + event.handled = g_globals->_events.getCursor() != CURSOR_WALK; - if (_globals->_player._uiEnabled && _globals->_player._canWalk && - (_globals->_events.getCursor() != CURSOR_LOOK)) { - _globals->_events.setCursor(CURSOR_WALK); - } else if (_globals->_player._canWalk && (_globals->_events.getCursor() != CURSOR_LOOK)) { - _globals->_events.setCursor(CURSOR_WALK); - } else if (_globals->_player._uiEnabled && (_globals->_events.getCursor() != CURSOR_LOOK)) { - _globals->_events.setCursor(CURSOR_USE); + if (g_globals->_player._uiEnabled && g_globals->_player._canWalk && + (g_globals->_events.getCursor() != CURSOR_LOOK)) { + g_globals->_events.setCursor(CURSOR_WALK); + } else if (g_globals->_player._canWalk && (g_globals->_events.getCursor() != CURSOR_LOOK)) { + g_globals->_events.setCursor(CURSOR_WALK); + } else if (g_globals->_player._uiEnabled && (g_globals->_events.getCursor() != CURSOR_LOOK)) { + g_globals->_events.setCursor(CURSOR_USE); } - if (_vm->getGameID() == GType_BlueForce) + if (g_vm->getGameID() == GType_BlueForce) event.handled = true; - } else if (_vm->getGameID() != GType_Ringworld) { + } else if (g_vm->getGameID() != GType_Ringworld) { event.handled = true; } break; @@ -3895,7 +3895,7 @@ void SceneHandler::process(Event &event) { } // Handle player processing - _globals->_player.process(event); + g_globals->_player.process(event); } } @@ -3904,7 +3904,7 @@ void SceneHandler::dispatch() { if (_saveGameSlot != -1) { int saveSlot = _saveGameSlot; _saveGameSlot = -1; - Common::Error err = _saver->save(saveSlot, _saveName); + Common::Error err = g_saver->save(saveSlot, _saveName); // FIXME: Make use of the description string in err to enhance // the error reported to the user. if (err.getCode() != Common::kNoError) @@ -3913,49 +3913,49 @@ void SceneHandler::dispatch() { if (_loadGameSlot != -1) { int loadSlot = _loadGameSlot; _loadGameSlot = -1; - _saver->restore(loadSlot); - _globals->_events.setCursorFromFlag(); + g_saver->restore(loadSlot); + g_globals->_events.setCursorFromFlag(); } - _globals->_soundManager.dispatch(); - _globals->_scenePalette.signalListeners(); + g_globals->_soundManager.dispatch(); + g_globals->_scenePalette.signalListeners(); // Dispatch to any objects registered in the scene - _globals->_sceneObjects->recurse(SceneHandler::dispatchObject); + g_globals->_sceneObjects->recurse(SceneHandler::dispatchObject); // If a scene is active, then dispatch to it - if (_globals->_sceneManager._scene) - _globals->_sceneManager._scene->dispatch(); + if (g_globals->_sceneManager._scene) + g_globals->_sceneManager._scene->dispatch(); // Not actually used //_eventListeners.forEach(SceneHandler::handleListener); // Handle pending events Event event; - if (_globals->_events.getEvent(event)) { + if (g_globals->_events.getEvent(event)) { // Process pending events do { process(event); - } while (_globals->_events.getEvent(event)); - } else if (_vm->getGameID() == GType_BlueForce) { + } while (g_globals->_events.getEvent(event)); + } else if (g_vm->getGameID() == GType_BlueForce) { // For Blue Force, 'none' events need to be generated in the absence of any event.eventType = EVENT_NONE; - event.mousePos = _globals->_events._mousePos; + event.mousePos = g_globals->_events._mousePos; process(event); } // Handle drawing the contents of the scene - if (_globals->_sceneManager._scene) - _globals->_sceneObjects->draw(); + if (g_globals->_sceneManager._scene) + g_globals->_sceneObjects->draw(); // Check to see if any scene change is required - _globals->_sceneManager.checkScene(); + g_globals->_sceneManager.checkScene(); // Signal the ScummVM debugger - _vm->_debugger->onFrame(); + g_vm->_debugger->onFrame(); // Delay between frames - _globals->_events.delay(_delayTicks); + g_globals->_events.delay(_delayTicks); } void SceneHandler::dispatchObject(EventHandler *obj) { diff --git a/engines/tsage/core.h b/engines/tsage/core.h index 4e219f67db..5d26b14265 100644 --- a/engines/tsage/core.h +++ b/engines/tsage/core.h @@ -166,7 +166,7 @@ public: }; #define ADD_PLAYER_MOVER(X, Y) { Common::Point pt(X, Y); PlayerMover *mover = new PlayerMover(); \ - _globals->_player.addMover(mover, &pt, this); } + g_globals->_player.addMover(mover, &pt, this); } #define ADD_PLAYER_MOVER_NULL(OBJ, X, Y) { Common::Point pt(X, Y); PlayerMover *mover = new PlayerMover(); \ OBJ.addMover(mover, &pt, NULL); } #define ADD_PLAYER_MOVER_THIS(OBJ, X, Y) { Common::Point pt(X, Y); PlayerMover *mover = new PlayerMover(); \ diff --git a/engines/tsage/debugger.cpp b/engines/tsage/debugger.cpp index 2a6b4eb66b..7d4a42ea25 100644 --- a/engines/tsage/debugger.cpp +++ b/engines/tsage/debugger.cpp @@ -68,9 +68,9 @@ bool Debugger::Cmd_Scene(int argc, const char **argv) { } if (argc == 3) - _globals->_sceneManager._sceneNumber = strToInt(argv[2]); + g_globals->_sceneManager._sceneNumber = strToInt(argv[2]); - _globals->_sceneManager.changeScene(strToInt(argv[1])); + g_globals->_sceneManager.changeScene(strToInt(argv[1])); return false; } @@ -87,20 +87,20 @@ bool Debugger::Cmd_WalkRegions(int argc, const char **argv) { int color = 16; // Lock the background surface for access - Graphics::Surface destSurface = _globals->_sceneManager._scene->_backSurface.lockSurface(); + Graphics::Surface destSurface = g_globals->_sceneManager._scene->_backSurface.lockSurface(); // Loop through drawing each walk region in a different color to the background surface Common::String regionsDesc; - for (uint regionIndex = 0; regionIndex < _globals->_walkRegions._regionList.size(); ++regionIndex, ++color) { - WalkRegion &wr = _globals->_walkRegions._regionList[regionIndex]; + for (uint regionIndex = 0; regionIndex < g_globals->_walkRegions._regionList.size(); ++regionIndex, ++color) { + WalkRegion &wr = g_globals->_walkRegions._regionList[regionIndex]; for (int yp = wr._bounds.top; yp < wr._bounds.bottom; ++yp) { LineSliceSet sliceSet = wr.getLineSlices(yp); for (uint idx = 0; idx < sliceSet.items.size(); ++idx) - destSurface.hLine(sliceSet.items[idx].xs - _globals->_sceneOffset.x, yp, - sliceSet.items[idx].xe - _globals->_sceneOffset.x, color); + destSurface.hLine(sliceSet.items[idx].xs - g_globals->_sceneOffset.x, yp, + sliceSet.items[idx].xe - g_globals->_sceneOffset.x, color); } regionsDesc += Common::String::format("Region #%d d bounds=%d,%d,%d,%d\n", @@ -108,12 +108,12 @@ bool Debugger::Cmd_WalkRegions(int argc, const char **argv) { } // Release the surface - _globals->_sceneManager._scene->_backSurface.unlockSurface(); + g_globals->_sceneManager._scene->_backSurface.unlockSurface(); // Mark the scene as requiring a full redraw - _globals->_paneRefreshFlag[0] = 2; + g_globals->_paneRefreshFlag[0] = 2; - DebugPrintf("Total regions = %d\n", _globals->_walkRegions._regionList.size()); + DebugPrintf("Total regions = %d\n", g_globals->_walkRegions._regionList.size()); DebugPrintf("%s\n", regionsDesc.c_str()); return false; @@ -134,12 +134,12 @@ bool Debugger::Cmd_PriorityRegions(int argc, const char **argv) { int count = 0; // Lock the background surface for access - Graphics::Surface destSurface = _globals->_sceneManager._scene->_backSurface.lockSurface(); + Graphics::Surface destSurface = g_globals->_sceneManager._scene->_backSurface.lockSurface(); - Common::List<Region>::iterator i = _globals->_sceneManager._scene->_priorities.begin(); + Common::List<Region>::iterator i = g_globals->_sceneManager._scene->_priorities.begin(); Common::String regionsDesc; - for (; i != _globals->_sceneManager._scene->_priorities.end(); ++i, ++color, ++count) { + for (; i != g_globals->_sceneManager._scene->_priorities.end(); ++i, ++color, ++count) { Region &r = *i; if ((regionNum == 0) || (regionNum == (count + 1))) { @@ -147,8 +147,8 @@ bool Debugger::Cmd_PriorityRegions(int argc, const char **argv) { byte *destP = (byte *)destSurface.getBasePtr(0, y); for (int x = 0; x < destSurface.w; ++x) { - if (r.contains(Common::Point(_globals->_sceneManager._scene->_sceneBounds.left + x, - _globals->_sceneManager._scene->_sceneBounds.top + y))) + if (r.contains(Common::Point(g_globals->_sceneManager._scene->_sceneBounds.left + x, + g_globals->_sceneManager._scene->_sceneBounds.top + y))) *destP = color; ++destP; } @@ -160,10 +160,10 @@ bool Debugger::Cmd_PriorityRegions(int argc, const char **argv) { } // Release the surface - _globals->_sceneManager._scene->_backSurface.unlockSurface(); + g_globals->_sceneManager._scene->_backSurface.unlockSurface(); // Mark the scene as requiring a full redraw - _globals->_paneRefreshFlag[0] = 2; + g_globals->_paneRefreshFlag[0] = 2; DebugPrintf("Total regions = %d\n", count); DebugPrintf("%s", regionsDesc.c_str()); @@ -187,12 +187,12 @@ bool Debugger::Cmd_SceneRegions(int argc, const char **argv) { int count = 0; // Lock the background surface for access - Graphics::Surface destSurface = _globals->_sceneManager._scene->_backSurface.lockSurface(); + Graphics::Surface destSurface = g_globals->_sceneManager._scene->_backSurface.lockSurface(); - Common::List<Region>::iterator i = _globals->_sceneRegions.begin(); + Common::List<Region>::iterator i = g_globals->_sceneRegions.begin(); Common::String regionsDesc; - for (; i != _globals->_sceneRegions.end(); ++i, ++color, ++count) { + for (; i != g_globals->_sceneRegions.end(); ++i, ++color, ++count) { Region &r = *i; if ((regionNum == 0) || (regionNum == (count + 1))) { @@ -200,8 +200,8 @@ bool Debugger::Cmd_SceneRegions(int argc, const char **argv) { byte *destP = (byte *)destSurface.getBasePtr(0, y); for (int x = 0; x < destSurface.w; ++x) { - if (r.contains(Common::Point(_globals->_sceneManager._scene->_sceneBounds.left + x, - _globals->_sceneManager._scene->_sceneBounds.top + y))) + if (r.contains(Common::Point(g_globals->_sceneManager._scene->_sceneBounds.left + x, + g_globals->_sceneManager._scene->_sceneBounds.top + y))) *destP = color; ++destP; } @@ -213,10 +213,10 @@ bool Debugger::Cmd_SceneRegions(int argc, const char **argv) { } // Release the surface - _globals->_sceneManager._scene->_backSurface.unlockSurface(); + g_globals->_sceneManager._scene->_backSurface.unlockSurface(); // Mark the scene as requiring a full redraw - _globals->_paneRefreshFlag[0] = 2; + g_globals->_paneRefreshFlag[0] = 2; DebugPrintf("Total regions = %d\n", count); DebugPrintf("%s", regionsDesc.c_str()); @@ -235,7 +235,7 @@ bool Debugger::Cmd_SetFlag(int argc, const char **argv) { } int flagNum = strToInt(argv[1]); - _globals->setFlag(flagNum); + g_globals->setFlag(flagNum); return true; } @@ -250,7 +250,7 @@ bool Debugger::Cmd_GetFlag(int argc, const char **argv) { } int flagNum = strToInt(argv[1]); - DebugPrintf("Value: %d\n", _globals->getFlag(flagNum)); + DebugPrintf("Value: %d\n", g_globals->getFlag(flagNum)); return true; } @@ -265,7 +265,7 @@ bool Debugger::Cmd_ClearFlag(int argc, const char **argv) { } int flagNum = strToInt(argv[1]); - _globals->clearFlag(flagNum); + g_globals->clearFlag(flagNum); return true; } @@ -444,14 +444,14 @@ bool Debugger::Cmd_MoveObject(int argc, const char **argv) { */ bool Debugger::Cmd_Hotspots(int argc, const char **argv) { int colIndex = 16; - const Rect &sceneBounds = _globals->_sceneManager._scene->_sceneBounds; + const Rect &sceneBounds = g_globals->_sceneManager._scene->_sceneBounds; // Lock the background surface for access - Graphics::Surface destSurface = _globals->_sceneManager._scene->_backSurface.lockSurface(); + Graphics::Surface destSurface = g_globals->_sceneManager._scene->_backSurface.lockSurface(); // Iterate through the scene items SynchronizedList<SceneItem *>::iterator i; - for (i = _globals->_sceneItems.reverse_begin(); i != _globals->_sceneItems.end(); --i, ++colIndex) { + for (i = g_globals->_sceneItems.reverse_begin(); i != g_globals->_sceneItems.end(); --i, ++colIndex) { SceneItem *o = *i; // Draw the contents of the hotspot area @@ -461,11 +461,11 @@ bool Debugger::Cmd_Hotspots(int argc, const char **argv) { o->_bounds.right - sceneBounds.left - 1, o->_bounds.bottom - sceneBounds.top - 1), colIndex); } else { // Scene uses a region, so get it and use it to fill out only the correct parts - SceneRegions::iterator ri = _globals->_sceneRegions.begin(); - while ((ri != _globals->_sceneRegions.end()) && ((*ri)._regionId != o->_sceneRegionId)) + SceneRegions::iterator ri = g_globals->_sceneRegions.begin(); + while ((ri != g_globals->_sceneRegions.end()) && ((*ri)._regionId != o->_sceneRegionId)) ++ri; - if (ri != _globals->_sceneRegions.end()) { + if (ri != g_globals->_sceneRegions.end()) { // Fill out the areas defined by the region Region &r = *ri; @@ -481,10 +481,10 @@ bool Debugger::Cmd_Hotspots(int argc, const char **argv) { } // Release the surface - _globals->_sceneManager._scene->_backSurface.unlockSurface(); + g_globals->_sceneManager._scene->_backSurface.unlockSurface(); // Mark the scene as requiring a full redraw - _globals->_paneRefreshFlag[0] = 2; + g_globals->_paneRefreshFlag[0] = 2; return false; } @@ -499,7 +499,7 @@ bool Debugger::Cmd_Sound(int argc, const char **argv) { } int soundNum = strToInt(argv[1]); - _globals->_soundHandler.play(soundNum); + g_globals->_soundHandler.play(soundNum); return false; } diff --git a/engines/tsage/dialogs.cpp b/engines/tsage/dialogs.cpp index 841a7b776d..002835e76b 100644 --- a/engines/tsage/dialogs.cpp +++ b/engines/tsage/dialogs.cpp @@ -64,16 +64,16 @@ MessageDialog::MessageDialog(const Common::String &message, const Common::String setDefaults(); // Set the dialog's center - setCenter(_globals->_dialogCenter.x, _globals->_dialogCenter.y); + setCenter(g_globals->_dialogCenter.x, g_globals->_dialogCenter.y); } int MessageDialog::show(const Common::String &message, const Common::String &btn1Message, const Common::String &btn2Message) { // Ensure that the cursor is the arrow - _globals->_events.setCursor(CURSOR_ARROW); + g_globals->_events.setCursor(CURSOR_ARROW); int result = show2(message, btn1Message, btn2Message); - _globals->_events.setCursorFromFlag(); + g_globals->_events.setCursorFromFlag(); return result; } @@ -116,7 +116,7 @@ void ModalDialog::draw() { // Make a backup copy of the area the dialog will occupy Rect tempRect = _bounds; tempRect.collapse(-10, -10); - _savedArea = Surface_getArea(_globals->_gfxManagerInstance.getSurface(), tempRect); + _savedArea = Surface_getArea(g_globals->_gfxManagerInstance.getSurface(), tempRect); _gfxManager.activate(); @@ -138,7 +138,7 @@ void ModalDialog::drawFrame() { _bounds.collapse(-10, -10); // Fill the dialog area - _globals->gfxManager().fillRect(origRect, 54); + g_globals->gfxManager().fillRect(origRect, 54); // Draw top line GfxSurface surface = surfaceFromRes(8, 1, 7); @@ -285,14 +285,14 @@ void InventoryDialog::execute() { bool lookFlag = false; _gfxManager.activate(); - while (!_vm->shouldQuit()) { + while (!g_vm->shouldQuit()) { // Get events Event event; - while (!_globals->_events.getEvent(event) && !_vm->shouldQuit()) { + while (!g_globals->_events.getEvent(event) && !g_vm->shouldQuit()) { g_system->delayMillis(10); g_system->updateScreen(); } - if (_vm->shouldQuit()) + if (g_vm->shouldQuit()) break; hiliteObj = NULL; @@ -319,18 +319,18 @@ void InventoryDialog::execute() { if (hiliteObj == &_btnOk) { // Ok button clicked if (lookFlag) - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_events.setCursor(CURSOR_WALK); break; } else if (hiliteObj == &_btnLook) { // Look button clicked if (_btnLook._message == LOOK_BTN_STRING) { _btnLook._message = PICK_BTN_STRING; lookFlag = 1; - _globals->_events.setCursor(CURSOR_LOOK); + g_globals->_events.setCursor(CURSOR_LOOK); } else { _btnLook._message = LOOK_BTN_STRING; lookFlag = 0; - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_events.setCursor(CURSOR_WALK); } hiliteObj->draw(); @@ -338,7 +338,7 @@ void InventoryDialog::execute() { // Inventory item selected InvObject *invObject = static_cast<GfxInvImage *>(hiliteObj)->_invObject; if (lookFlag) { - _globals->_screenSurface.displayText(invObject->_description); + g_globals->_screenSurface.displayText(invObject->_description); } else { RING_INVENTORY._selectedItem = invObject; invObject->setCursor(); @@ -360,20 +360,20 @@ void OptionsDialog::show() { if (btn == &dlg->_btnQuit) { // Quit game if (MessageDialog::show(QUIT_CONFIRM_MSG, CANCEL_BTN_STRING, QUIT_BTN_STRING) == 1) { - _vm->quitGame(); + g_vm->quitGame(); } } else if (btn == &dlg->_btnRestart) { // Restart game - _globals->_game->restartGame(); + g_globals->_game->restartGame(); } else if (btn == &dlg->_btnSound) { // Sound dialog SoundDialog::execute(); } else if (btn == &dlg->_btnSave) { // Save button - _globals->_game->saveGame(); + g_globals->_game->saveGame(); } else if (btn == &dlg->_btnRestore) { // Restore button - _globals->_game->restoreGame(); + g_globals->_game->restoreGame(); } dlg->remove(); @@ -421,8 +421,8 @@ void SoundDialog::execute() { ConfigDialog *dlg = new ConfigDialog(); dlg->runModal(); delete dlg; - _globals->_soundManager.syncSounds(); - _globals->_events.setCursorFromFlag(); + g_globals->_soundManager.syncSounds(); + g_globals->_events.setCursorFromFlag(); } } // End of namespace TsAGE diff --git a/engines/tsage/events.cpp b/engines/tsage/events.cpp index b9d8730997..940709c8c7 100644 --- a/engines/tsage/events.cpp +++ b/engines/tsage/events.cpp @@ -39,8 +39,8 @@ EventsClass::EventsClass() { _frameNumber = 0; _priorFrameTime = 0; _prevDelayFrame = 0; - _saver->addListener(this); - _saver->addLoadNotifier(&EventsClass::loadNotifierProc); + g_saver->addListener(this); + g_saver->addLoadNotifier(&EventsClass::loadNotifierProc); } bool EventsClass::pollEvent() { @@ -79,7 +79,7 @@ bool EventsClass::pollEvent() { void EventsClass::waitForPress(int eventMask) { Event evt; - while (!_vm->shouldQuit() && !getEvent(evt, eventMask)) + while (!g_vm->shouldQuit() && !getEvent(evt, eventMask)) g_system->delayMillis(10); } @@ -87,7 +87,7 @@ void EventsClass::waitForPress(int eventMask) { * Standard event retrieval, which only returns keyboard and mouse clicks */ bool EventsClass::getEvent(Event &evt, int eventMask) { - while (pollEvent() && !_vm->shouldQuit()) { + while (pollEvent() && !g_vm->shouldQuit()) { evt.handled = false; evt.eventType = EVENT_NONE; evt.mousePos = _event.mouse; @@ -143,7 +143,7 @@ void EventsClass::setCursor(CursorType cursorType) { return; _lastCursor = cursorType; - _globals->clearFlag(122); + g_globals->clearFlag(122); CursorMan.showMouse(true); const byte *cursor; @@ -154,55 +154,55 @@ void EventsClass::setCursor(CursorType cursorType) { switch (cursorType) { case CURSOR_NONE: // No cursor - _globals->setFlag(122); + g_globals->setFlag(122); - if ((_vm->getFeatures() & GF_DEMO) || (_vm->getGameID() == GType_BlueForce)) { + if ((g_vm->getFeatures() & GF_DEMO) || (g_vm->getGameID() == GType_BlueForce)) { CursorMan.showMouse(false); return; } - cursor = _resourceManager->getSubResource(4, 1, 6, &size); + cursor = g_resourceManager->getSubResource(4, 1, 6, &size); break; case CURSOR_LOOK: // Look cursor - if (_vm->getGameID() == GType_BlueForce) - cursor = _resourceManager->getSubResource(1, 5, 3, &size); + if (g_vm->getGameID() == GType_BlueForce) + cursor = g_resourceManager->getSubResource(1, 5, 3, &size); else - cursor = _resourceManager->getSubResource(4, 1, 5, &size); + cursor = g_resourceManager->getSubResource(4, 1, 5, &size); _currentCursor = CURSOR_LOOK; break; case CURSOR_USE: // Use cursor - if (_vm->getGameID() == GType_BlueForce) { - cursor = _resourceManager->getSubResource(1, 5, 2, &size); + if (g_vm->getGameID() == GType_BlueForce) { + cursor = g_resourceManager->getSubResource(1, 5, 2, &size); } else { - cursor = _resourceManager->getSubResource(4, 1, 4, &size); + cursor = g_resourceManager->getSubResource(4, 1, 4, &size); } _currentCursor = CURSOR_USE; break; case CURSOR_TALK: // Talk cursor - if (_vm->getGameID() == GType_BlueForce) { - cursor = _resourceManager->getSubResource(1, 5, 4, &size); + if (g_vm->getGameID() == GType_BlueForce) { + cursor = g_resourceManager->getSubResource(1, 5, 4, &size); } else { - cursor = _resourceManager->getSubResource(4, 1, 3, &size); + cursor = g_resourceManager->getSubResource(4, 1, 3, &size); } _currentCursor = CURSOR_TALK; break; case CURSOR_EXIT: // Exit cursor (Blue Force) - assert(_vm->getGameID() == GType_BlueForce); - cursor = _resourceManager->getSubResource(1, 5, 7, &size); + assert(g_vm->getGameID() == GType_BlueForce); + cursor = g_resourceManager->getSubResource(1, 5, 7, &size); _currentCursor = CURSOR_EXIT; break; case CURSOR_PRINTER: // Printer cursor (Blue Force) - assert(_vm->getGameID() == GType_BlueForce); - cursor = _resourceManager->getSubResource(1, 7, 6, &size); + assert(g_vm->getGameID() == GType_BlueForce); + cursor = g_resourceManager->getSubResource(1, 7, 6, &size); _currentCursor = CURSOR_PRINTER; break; @@ -214,12 +214,12 @@ void EventsClass::setCursor(CursorType cursorType) { case CURSOR_WALK: default: - if (_vm->getGameID() == GType_BlueForce) { + if (g_vm->getGameID() == GType_BlueForce) { if (cursorType == CURSOR_WALK) { - cursor = _resourceManager->getSubResource(1, 5, 1, &size); + cursor = g_resourceManager->getSubResource(1, 5, 1, &size); } else { // Inventory icon - cursor = _resourceManager->getSubResource(10, ((int)cursorType - 1) / 20 + 1, + cursor = g_resourceManager->getSubResource(10, ((int)cursorType - 1) / 20 + 1, ((int)cursorType - 1) % 20 + 1, &size); questionEnabled = true; } @@ -245,7 +245,7 @@ void EventsClass::setCursor(CursorType cursorType) { DEALLOCATE(cursor); // For Blue Force, enable the question button when an inventory icon is selected - if (_vm->getGameID() == GType_BlueForce) + if (g_vm->getGameID() == GType_BlueForce) BF_GLOBALS._uiElements._question.setEnabled(questionEnabled); } @@ -257,22 +257,22 @@ void EventsClass::pushCursor(CursorType cursorType) { switch (cursorType) { case CURSOR_NONE: // No cursor - cursor = _resourceManager->getSubResource(4, 1, 6, &size); + cursor = g_resourceManager->getSubResource(4, 1, 6, &size); break; case CURSOR_LOOK: // Look cursor - cursor = _resourceManager->getSubResource(4, 1, 5, &size); + cursor = g_resourceManager->getSubResource(4, 1, 5, &size); break; case CURSOR_USE: // Use cursor - cursor = _resourceManager->getSubResource(4, 1, 4, &size); + cursor = g_resourceManager->getSubResource(4, 1, 4, &size); break; case CURSOR_TALK: // Talk cursor - cursor = _resourceManager->getSubResource(4, 1, 3, &size); + cursor = g_resourceManager->getSubResource(4, 1, 3, &size); break; case CURSOR_ARROW: @@ -338,7 +338,7 @@ CursorType EventsClass::hideCursor() { } bool EventsClass::isCursorVisible() const { - return !_globals->getFlag(122); + return !g_globals->getFlag(122); } /** @@ -373,10 +373,10 @@ void EventsClass::listenerSynchronize(Serializer &s) { void EventsClass::loadNotifierProc(bool postFlag) { if (postFlag) { - if (_globals->_events._lastCursor == CURSOR_NONE) - _globals->_events._lastCursor = _globals->_events._currentCursor; + if (g_globals->_events._lastCursor == CURSOR_NONE) + g_globals->_events._lastCursor = g_globals->_events._currentCursor; else - _globals->_events._lastCursor = CURSOR_NONE; + g_globals->_events._lastCursor = CURSOR_NONE; } } diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index 808dfd5739..1da971f858 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -28,8 +28,8 @@ namespace TsAGE { -Globals *_globals = NULL; -ResourceManager *_resourceManager = NULL; +Globals *g_globals = NULL; +ResourceManager *g_resourceManager = NULL; /*--------------------------------------------------------------------------*/ @@ -56,7 +56,7 @@ Globals::Globals() : _dialogCenter(160, 140), _gfxManagerInstance(_screenSurface _stripNum = 0; _gfxEdgeAdjust = 3; - if (_vm->getFeatures() & GF_DEMO) { + if (g_vm->getFeatures() & GF_DEMO) { _gfxFontNumber = 0; _gfxColors.background = 6; _gfxColors.foreground = 0; @@ -67,7 +67,7 @@ Globals::Globals() : _dialogCenter(160, 140), _gfxManagerInstance(_screenSurface _color1 = _gfxColors.foreground; _color2 = _gfxColors.foreground; _color3 = _gfxColors.foreground; - } else if (_vm->getGameID() == GType_BlueForce) { + } else if (g_vm->getGameID() == GType_BlueForce) { // Blue Force _gfxFontNumber = 0; _gfxColors.background = 89; @@ -75,7 +75,7 @@ Globals::Globals() : _dialogCenter(160, 140), _gfxManagerInstance(_screenSurface _fontColors.background = 88; _fontColors.foreground = 92; _dialogCenter.y = 140; - } else if ((_vm->getGameID() == GType_Ringworld) && (_vm->getFeatures() & GF_CD)) { + } else if ((g_vm->getGameID() == GType_Ringworld) && (g_vm->getFeatures() & GF_CD)) { _gfxFontNumber = 50; _gfxColors.background = 53; _gfxColors.foreground = 0; @@ -108,9 +108,9 @@ Globals::Globals() : _dialogCenter(160, 140), _gfxManagerInstance(_screenSurface _scrollFollower = NULL; _inventory = NULL; - switch (_vm->getGameID()) { + switch (g_vm->getGameID()) { case GType_Ringworld: - if (!(_vm->getFeatures() & GF_DEMO)) { + if (!(g_vm->getFeatures() & GF_DEMO)) { _inventory = new Ringworld::RingworldInvObjectList(); _game = new Ringworld::RingworldGame(); } else { @@ -132,12 +132,12 @@ Globals::~Globals() { delete _inventory; delete _sceneHandler; delete _game; - _globals = NULL; + g_globals = NULL; } void Globals::reset() { Common::set_to(&_flags[0], &_flags[MAX_FLAGS], false); - _saver->addFactory(classFactoryProc); + g_saver->addFactory(classFactoryProc); } void Globals::synchronize(Serializer &s) { diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h index 86ad025339..15f8c0b611 100644 --- a/engines/tsage/globals.h +++ b/engines/tsage/globals.h @@ -97,14 +97,14 @@ public: void dispatchSounds(); }; -extern Globals *_globals; +extern Globals *g_globals; -#define GLOBALS (*_globals) -#define BF_GLOBALS (*((::TsAGE::BlueForce::BlueForceGlobals *)_globals)) +#define GLOBALS (*g_globals) +#define BF_GLOBALS (*((::TsAGE::BlueForce::BlueForceGlobals *)g_globals)) -// Note: Currently this can't be part of the _globals structure, since it needs to be constructed +// Note: Currently this can't be part of the g_globals structure, since it needs to be constructed // prior to many of the fields in Globals execute their constructors -extern ResourceManager *_resourceManager; +extern ResourceManager *g_resourceManager; namespace BlueForce { diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index 69c9995b93..4b2da0b456 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -120,7 +120,7 @@ GfxSurface surfaceFromRes(const byte *imgData) { GfxSurface surfaceFromRes(int resNum, int rlbNum, int subNum) { uint size; - byte *imgData = _resourceManager->getSubResource(resNum, rlbNum, subNum, &size); + byte *imgData = g_resourceManager->getSubResource(resNum, rlbNum, subNum, &size); GfxSurface surface = surfaceFromRes(imgData); DEALLOCATE(imgData); @@ -202,8 +202,8 @@ void Rect::resize(const GfxSurface &surface, int xp, int yp, int percent) { * Expands the pane region to contain the specified Rect */ void Rect::expandPanes() { - _globals->_paneRegions[0].uniteRect(*this); - _globals->_paneRegions[1].uniteRect(*this); + g_globals->_paneRegions[0].uniteRect(*this); + g_globals->_paneRegions[1].uniteRect(*this); } /** @@ -408,7 +408,7 @@ bool GfxSurface::displayText(const Common::String &msg, const Common::Point &pt) // Write for a mouse or keypress Event event; - while (!_globals->_events.getEvent(event, EVENT_BUTTON_DOWN | EVENT_KEYPRESS) && !_vm->shouldQuit()) + while (!g_globals->_events.getEvent(event, EVENT_BUTTON_DOWN | EVENT_KEYPRESS) && !g_vm->shouldQuit()) ; // Restore the display area @@ -423,15 +423,15 @@ bool GfxSurface::displayText(const Common::String &msg, const Common::Point &pt) * Loads a quarter of a screen from a resource */ void GfxSurface::loadScreenSection(Graphics::Surface &dest, int xHalf, int yHalf, int xSection, int ySection) { - int screenNum = _globals->_sceneManager._scene->_activeScreenNumber; + int screenNum = g_globals->_sceneManager._scene->_activeScreenNumber; Rect updateRect(0, 0, 160, 100); updateRect.translate(xHalf * 160, yHalf * 100); - int xHalfCount = (_globals->_sceneManager._scene->_backgroundBounds.right + 159) / 160; - int yHalfCount = (_globals->_sceneManager._scene->_backgroundBounds.bottom + 99) / 100; + int xHalfCount = (g_globals->_sceneManager._scene->_backgroundBounds.right + 159) / 160; + int yHalfCount = (g_globals->_sceneManager._scene->_backgroundBounds.bottom + 99) / 100; if (xSection < xHalfCount && ySection < yHalfCount) { int rlbNum = xSection * yHalfCount + ySection; - byte *data = _resourceManager->getResource(RES_BITMAP, screenNum, rlbNum); + byte *data = g_resourceManager->getResource(RES_BITMAP, screenNum, rlbNum); for (int y = 0; y < updateRect.height(); ++y) { byte *pSrc = data + y * 160; @@ -582,8 +582,8 @@ void GfxSurface::copyFrom(GfxSurface &src, Rect srcBounds, Rect destBounds, Regi while (tempSrc < (pSrc + destBounds.width())) { if (!priorityRegion || !priorityRegion->contains(Common::Point( - xp + _globals->_sceneManager._scene->_sceneBounds.left, - destBounds.top + y + _globals->_sceneManager._scene->_sceneBounds.top))) { + xp + g_globals->_sceneManager._scene->_sceneBounds.left, + destBounds.top + y + g_globals->_sceneManager._scene->_sceneBounds.top))) { if (*tempSrc != src._transColor) *tempDest = *tempSrc; } @@ -609,7 +609,7 @@ void GfxSurface::draw(const Common::Point &pt, Rect *rect) { *rect = tempRect; } else { // Draw image - _globals->gfxManager().copyFrom(*this, tempRect, NULL); + g_globals->gfxManager().copyFrom(*this, tempRect, NULL); } } @@ -623,12 +623,12 @@ GfxElement::GfxElement() { void GfxElement::setDefaults() { _flags = 0; - _fontNumber = _globals->_gfxFontNumber; - _colors = _globals->_gfxColors; - _fontColors = _globals->_fontColors; - _color1 = _globals->_color1; - _color2 = _globals->_color2; - _color3 = _globals->_color3; + _fontNumber = g_globals->_gfxFontNumber; + _colors = g_globals->_gfxColors; + _fontColors = g_globals->_fontColors; + _color1 = g_globals->_color1; + _color2 = g_globals->_color2; + _color3 = g_globals->_color3; } /** @@ -636,13 +636,13 @@ void GfxElement::setDefaults() { */ void GfxElement::highlight() { // Get a lock on the surface - GfxManager &gfxManager = _globals->gfxManager(); + GfxManager &gfxManager = g_globals->gfxManager(); Graphics::Surface surface = gfxManager.lockSurface(); // Scan through the contents of the element, switching any occurances of the foreground // color with the background color and vice versa Rect tempRect(_bounds); - tempRect.collapse(_globals->_gfxEdgeAdjust - 1, _globals->_gfxEdgeAdjust - 1); + tempRect.collapse(g_globals->_gfxEdgeAdjust - 1, g_globals->_gfxEdgeAdjust - 1); for (int yp = tempRect.top; yp < tempRect.bottom; ++yp) { byte *lineP = (byte *)surface.getBasePtr(tempRect.left, yp); @@ -661,7 +661,7 @@ void GfxElement::highlight() { */ void GfxElement::drawFrame() { // Get a lock on the surface and save the active font - GfxManager &gfxManager = _globals->gfxManager(); + GfxManager &gfxManager = g_globals->gfxManager(); gfxManager.lockSurface(); uint8 bgColor, fgColor; @@ -674,7 +674,7 @@ void GfxElement::drawFrame() { } Rect tempRect = _bounds; - tempRect.collapse(_globals->_gfxEdgeAdjust, _globals->_gfxEdgeAdjust); + tempRect.collapse(g_globals->_gfxEdgeAdjust, g_globals->_gfxEdgeAdjust); tempRect.collapse(-1, -1); gfxManager.fillRect(tempRect, _colors.background); @@ -715,10 +715,10 @@ bool GfxElement::focusedEvent(Event &event) { // HACK: It should use the GfxManager object to figure out the relative // position, but for now this seems like the easiest way. - int xOffset = mousePos.x - _globals->_events._mousePos.x; - int yOffset = mousePos.y - _globals->_events._mousePos.y; + int xOffset = mousePos.x - g_globals->_events._mousePos.x; + int yOffset = mousePos.y - g_globals->_events._mousePos.y; - while (event.eventType != EVENT_BUTTON_UP && !_vm->shouldQuit()) { + while (event.eventType != EVENT_BUTTON_UP && !g_vm->shouldQuit()) { g_system->delayMillis(10); if (_bounds.contains(mousePos)) { @@ -733,7 +733,7 @@ bool GfxElement::focusedEvent(Event &event) { highlight(); } - if (_globals->_events.getEvent(event, EVENT_MOUSE_MOVE | EVENT_BUTTON_UP)) { + if (g_globals->_events.getEvent(event, EVENT_MOUSE_MOVE | EVENT_BUTTON_UP)) { if (event.eventType == EVENT_MOUSE_MOVE) { mousePos.x = event.mousePos.x + xOffset; mousePos.y = event.mousePos.y + yOffset; @@ -769,7 +769,7 @@ void GfxImage::setDefaults() { // Decode the image uint size; - byte *imgData = _resourceManager->getSubResource(_resNum, _rlbNum, _cursorNum, &size); + byte *imgData = g_resourceManager->getSubResource(_resNum, _rlbNum, _cursorNum, &size); _surface = surfaceFromRes(imgData); DEALLOCATE(imgData); @@ -781,9 +781,9 @@ void GfxImage::setDefaults() { void GfxImage::draw() { Rect tempRect = _bounds; - tempRect.translate(_globals->gfxManager()._topLeft.x, _globals->gfxManager()._topLeft.y); + tempRect.translate(g_globals->gfxManager()._topLeft.x, g_globals->gfxManager()._topLeft.y); - _globals->gfxManager().copyFrom(_surface, tempRect); + g_globals->gfxManager().copyFrom(_surface, tempRect); } /*--------------------------------------------------------------------------*/ @@ -805,7 +805,7 @@ void GfxMessage::setDefaults() { GfxElement::setDefaults(); GfxFontBackup font; - GfxManager &gfxManager = _globals->gfxManager(); + GfxManager &gfxManager = g_globals->gfxManager(); Rect tempRect; gfxManager._font.setFontNumber(this->_fontNumber); @@ -818,7 +818,7 @@ void GfxMessage::setDefaults() { void GfxMessage::draw() { GfxFontBackup font; - GfxManager &gfxManager = _globals->gfxManager(); + GfxManager &gfxManager = g_globals->gfxManager(); // Set the font and color gfxManager.setFillFlag(false); @@ -838,7 +838,7 @@ void GfxButton::setDefaults() { GfxElement::setDefaults(); GfxFontBackup font; - GfxManager &gfxManager = _globals->gfxManager(); + GfxManager &gfxManager = g_globals->gfxManager(); Rect tempRect; // Get the string bounds and round up the x end to a multiple of 16 @@ -847,8 +847,8 @@ void GfxButton::setDefaults() { tempRect.right = ((tempRect.right + 15) / 16) * 16; // Set the button bounds - tempRect.collapse(-_globals->_gfxEdgeAdjust, -_globals->_gfxEdgeAdjust); - if (_vm->getFeatures() & GF_CD) + tempRect.collapse(-g_globals->_gfxEdgeAdjust, -g_globals->_gfxEdgeAdjust); + if (g_vm->getFeatures() & GF_CD) --tempRect.top; tempRect.moveTo(_bounds.left, _bounds.top); _bounds = tempRect; @@ -857,7 +857,7 @@ void GfxButton::setDefaults() { void GfxButton::draw() { // Get a lock on the surface and save the active font GfxFontBackup font; - GfxManager &gfxManager = _globals->gfxManager(); + GfxManager &gfxManager = g_globals->gfxManager(); gfxManager.lockSurface(); // Draw a basic frame for the button @@ -873,8 +873,8 @@ void GfxButton::draw() { // Display the button's text Rect tempRect(_bounds); - tempRect.collapse(_globals->_gfxEdgeAdjust, _globals->_gfxEdgeAdjust); - if (_vm->getFeatures() & GF_CD) + tempRect.collapse(g_globals->_gfxEdgeAdjust, g_globals->_gfxEdgeAdjust); + if (g_vm->getFeatures() & GF_CD) ++tempRect.top; gfxManager._font.writeLines(_message.c_str(), tempRect, ALIGN_CENTER); @@ -936,14 +936,14 @@ void GfxDialog::setDefaults() { // Set the dialog boundaries _gfxManager._bounds = tempRect; - tempRect.collapse(-_globals->_gfxEdgeAdjust * 2, -_globals->_gfxEdgeAdjust * 2); + tempRect.collapse(-g_globals->_gfxEdgeAdjust * 2, -g_globals->_gfxEdgeAdjust * 2); _bounds = tempRect; } void GfxDialog::remove() { if (_savedArea) { // Restore the area the dialog covered - _globals->_gfxManagerInstance.copyFrom(*_savedArea, _bounds.left, _bounds.top); + g_globals->_gfxManagerInstance.copyFrom(*_savedArea, _bounds.left, _bounds.top); delete _savedArea; _savedArea = NULL; @@ -954,7 +954,7 @@ void GfxDialog::draw() { Rect tempRect(_bounds); // Make a backup copy of the area the dialog will occupy - _savedArea = Surface_getArea(_globals->_gfxManagerInstance.getSurface(), _bounds); + _savedArea = Surface_getArea(g_globals->_gfxManagerInstance.getSurface(), _bounds); // Set the palette for use in the dialog setPalette(); @@ -966,7 +966,7 @@ void GfxDialog::draw() { drawFrame(); // Reset the dialog's graphics manager to only draw within the dialog boundaries - tempRect.translate(_globals->_gfxEdgeAdjust * 2, _globals->_gfxEdgeAdjust * 2); + tempRect.translate(g_globals->_gfxEdgeAdjust * 2, g_globals->_gfxEdgeAdjust * 2); _gfxManager._bounds = tempRect; // Draw each element in the dialog in order @@ -1003,7 +1003,7 @@ void GfxDialog::addElements(GfxElement *ge, ...) { } void GfxDialog::setTopLeft(int xp, int yp) { - _bounds.moveTo(xp - _globals->_gfxEdgeAdjust * 2, yp - _globals->_gfxEdgeAdjust * 2); + _bounds.moveTo(xp - g_globals->_gfxEdgeAdjust * 2, yp - g_globals->_gfxEdgeAdjust * 2); } void GfxDialog::setCenter(int xp, int yp) { @@ -1029,9 +1029,9 @@ GfxButton *GfxDialog::execute(GfxButton *defaultButton) { GfxButton *selectedButton = NULL; bool breakFlag = false; - while (!_vm->shouldQuit() && !breakFlag) { + while (!g_vm->shouldQuit() && !breakFlag) { Event event; - while (_globals->_events.getEvent(event) && !breakFlag) { + while (g_globals->_events.getEvent(event) && !breakFlag) { // Adjust mouse positions to be relative within the dialog event.mousePos.x -= _gfxManager._bounds.left; event.mousePos.y -= _gfxManager._bounds.top; @@ -1069,28 +1069,28 @@ GfxButton *GfxDialog::execute(GfxButton *defaultButton) { } void GfxDialog::setPalette() { - if (_vm->getGameID() == GType_BlueForce) { - _globals->_scenePalette.loadPalette(2); - _globals->_scenePalette.setPalette(0, 1); - _globals->_scenePalette.setPalette(_globals->_gfxColors.background, 1); - _globals->_scenePalette.setPalette(_globals->_gfxColors.foreground, 1); - _globals->_scenePalette.setPalette(_globals->_fontColors.background, 1); - _globals->_scenePalette.setPalette(_globals->_fontColors.foreground, 1); - _globals->_scenePalette.setEntry(255, 0xff, 0xff, 0xff); - _globals->_scenePalette.setPalette(255, 1); + if (g_vm->getGameID() == GType_BlueForce) { + g_globals->_scenePalette.loadPalette(2); + g_globals->_scenePalette.setPalette(0, 1); + g_globals->_scenePalette.setPalette(g_globals->_gfxColors.background, 1); + g_globals->_scenePalette.setPalette(g_globals->_gfxColors.foreground, 1); + g_globals->_scenePalette.setPalette(g_globals->_fontColors.background, 1); + g_globals->_scenePalette.setPalette(g_globals->_fontColors.foreground, 1); + g_globals->_scenePalette.setEntry(255, 0xff, 0xff, 0xff); + g_globals->_scenePalette.setPalette(255, 1); } else { - _globals->_scenePalette.loadPalette(0); - _globals->_scenePalette.setPalette(0, 1); - _globals->_scenePalette.setPalette(_globals->_scenePalette._colors.foreground, 1); - _globals->_scenePalette.setPalette(_globals->_fontColors.background, 1); - _globals->_scenePalette.setPalette(_globals->_fontColors.foreground, 1); - _globals->_scenePalette.setPalette(255, 1); + g_globals->_scenePalette.loadPalette(0); + g_globals->_scenePalette.setPalette(0, 1); + g_globals->_scenePalette.setPalette(g_globals->_scenePalette._colors.foreground, 1); + g_globals->_scenePalette.setPalette(g_globals->_fontColors.background, 1); + g_globals->_scenePalette.setPalette(g_globals->_fontColors.foreground, 1); + g_globals->_scenePalette.setPalette(255, 1); } } /*--------------------------------------------------------------------------*/ -GfxManager::GfxManager() : _surface(_globals->_screenSurface), _oldManager(NULL) { +GfxManager::GfxManager() : _surface(g_globals->_screenSurface), _oldManager(NULL) { _font.setOwner(this); _font._fillFlag = false; _bounds = Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); @@ -1109,19 +1109,19 @@ void GfxManager::setDefaults() { _pane0Rect4 = screenBounds; _font._edgeSize = Common::Point(1, 1); - _font._colors = _globals->_fontColors; - _font.setFontNumber(_globals->_gfxFontNumber); + _font._colors = g_globals->_fontColors; + _font.setFontNumber(g_globals->_gfxFontNumber); } void GfxManager::activate() { - assert(!contains(_globals->_gfxManagers, this)); - _globals->_gfxManagers.push_front(this); + assert(!contains(g_globals->_gfxManagers, this)); + g_globals->_gfxManagers.push_front(this); } void GfxManager::deactivate() { // Assert that there will still be another manager, and we're correctly removing our own - assert((_globals->_gfxManagers.size() > 1) && (&_globals->gfxManager() == this)); - _globals->_gfxManagers.pop_front(); + assert((g_globals->_gfxManagers.size() > 1) && (&g_globals->gfxManager() == this)); + g_globals->_gfxManagers.pop_front(); } int GfxManager::getStringWidth(const char *s, int numChars) { @@ -1159,7 +1159,7 @@ void GfxManager::setDialogPalette() { // Get the main palette information byte palData[256 * 3]; uint count, start; - _resourceManager->getPalette(0, &palData[0], &start, &count); + g_resourceManager->getPalette(0, &palData[0], &start, &count); g_system->getPaletteManager()->setPalette(&palData[0], start, count); // Miscellaneous @@ -1194,7 +1194,7 @@ int GfxManager::getAngle(const Common::Point &p1, const Common::Point &p2) { GfxFont::GfxFont() { - _fontNumber = (_vm->getFeatures() & GF_DEMO) ? 0 : 50; + _fontNumber = (g_vm->getFeatures() & GF_DEMO) ? 0 : 50; _numChars = 0; _bpp = 0; _fontData = NULL; @@ -1218,9 +1218,9 @@ void GfxFont::setFontNumber(uint32 fontNumber) { _fontNumber = fontNumber; - _fontData = _resourceManager->getResource(RES_FONT, _fontNumber, 0, true); + _fontData = g_resourceManager->getResource(RES_FONT, _fontNumber, 0, true); if (!_fontData) - _fontData = _resourceManager->getResource(RES_FONT, _fontNumber, 0); + _fontData = g_resourceManager->getResource(RES_FONT, _fontNumber, 0); _numChars = READ_LE_UINT16(_fontData + 4); _fontSize.y = READ_LE_UINT16(_fontData + 6); @@ -1509,17 +1509,17 @@ void GfxFont::writeLines(const char *s, const Rect &bounds, TextAlign align) { /*--------------------------------------------------------------------------*/ GfxFontBackup::GfxFontBackup() { - _edgeSize = _globals->gfxManager()._font._edgeSize; - _position = _globals->gfxManager()._font._position; - _colors = _globals->gfxManager()._font._colors; - _fontNumber = _globals->gfxManager()._font._fontNumber; + _edgeSize = g_globals->gfxManager()._font._edgeSize; + _position = g_globals->gfxManager()._font._position; + _colors = g_globals->gfxManager()._font._colors; + _fontNumber = g_globals->gfxManager()._font._fontNumber; } GfxFontBackup::~GfxFontBackup() { - _globals->gfxManager()._font.setFontNumber(_fontNumber); - _globals->gfxManager()._font._edgeSize = _edgeSize; - _globals->gfxManager()._font._position = _position; - _globals->gfxManager()._font._colors = _colors; + g_globals->gfxManager()._font.setFontNumber(_fontNumber); + g_globals->gfxManager()._font._edgeSize = _edgeSize; + g_globals->gfxManager()._font._position = _position; + g_globals->gfxManager()._font._colors = _colors; } diff --git a/engines/tsage/resources.cpp b/engines/tsage/resources.cpp index 99b431b5dc..e83801d748 100644 --- a/engines/tsage/resources.cpp +++ b/engines/tsage/resources.cpp @@ -438,7 +438,7 @@ ResourceManager::~ResourceManager() { void ResourceManager::addLib(const Common::String &libName) { assert(_libList.size() < 5); - _libList.push_back(new TLib(_vm->_memoryManager, libName)); + _libList.push_back(new TLib(g_vm->_memoryManager, libName)); } byte *ResourceManager::getResource(uint16 id, bool suppressErrors) { diff --git a/engines/tsage/ringworld/ringworld_demo.cpp b/engines/tsage/ringworld/ringworld_demo.cpp index 5612325aff..adf4aae9dd 100644 --- a/engines/tsage/ringworld/ringworld_demo.cpp +++ b/engines/tsage/ringworld/ringworld_demo.cpp @@ -31,9 +31,9 @@ namespace Ringworld { void RingworldDemoGame::start() { // Start the demo's single scene - _globals->_sceneManager.changeScene(1); + g_globals->_sceneManager.changeScene(1); - _globals->_events.setCursor(CURSOR_NONE); + g_globals->_events.setCursor(CURSOR_NONE); } Scene *RingworldDemoGame::createScene(int sceneNumber) { @@ -43,11 +43,11 @@ Scene *RingworldDemoGame::createScene(int sceneNumber) { void RingworldDemoGame::quitGame() { if (MessageDialog::show(DEMO_EXIT_MSG, EXIT_BTN_STRING, DEMO_BTN_STRING) == 0) - _vm->quitGame(); + g_vm->quitGame(); } void RingworldDemoGame::pauseGame() { - _globals->_events.setCursor(CURSOR_ARROW); + g_globals->_events.setCursor(CURSOR_ARROW); MessageDialog *dlg = new MessageDialog(DEMO_PAUSED_MSG, EXIT_BTN_STRING, DEMO_RESUME_BTN_STRING); dlg->draw(); @@ -55,10 +55,10 @@ void RingworldDemoGame::pauseGame() { bool exitFlag = selectedButton != &dlg->_btn2; delete dlg; - _globals->_events.hideCursor(); + g_globals->_events.hideCursor(); if (exitFlag) - _vm->quitGame(); + g_vm->quitGame(); } void RingworldDemoGame::processEvent(Event &event) { @@ -74,8 +74,8 @@ void RingworldDemoGame::processEvent(Event &event) { ConfigDialog *dlg = new ConfigDialog(); dlg->runModal(); delete dlg; - _globals->_soundManager.syncSounds(); - _globals->_events.setCursorFromFlag(); + g_globals->_soundManager.syncSounds(); + g_globals->_events.setCursorFromFlag(); break; } diff --git a/engines/tsage/ringworld/ringworld_dialogs.cpp b/engines/tsage/ringworld/ringworld_dialogs.cpp index ca4ccbc7c5..9d1a7effc2 100644 --- a/engines/tsage/ringworld/ringworld_dialogs.cpp +++ b/engines/tsage/ringworld/ringworld_dialogs.cpp @@ -54,18 +54,18 @@ RightClickButton::RightClickButton(int buttonIndex, int xp, int yp) : GfxButton( void RightClickButton::highlight() { if (_savedButton) { // Button was previously highlighted, so de-highlight by restoring saved area - _globals->gfxManager().copyFrom(*_savedButton, _bounds.left, _bounds.top); + g_globals->gfxManager().copyFrom(*_savedButton, _bounds.left, _bounds.top); delete _savedButton; _savedButton = NULL; } else { // Highlight button by getting the needed highlighted image resource - _savedButton = Surface_getArea(_globals->gfxManager().getSurface(), _bounds); + _savedButton = Surface_getArea(g_globals->gfxManager().getSurface(), _bounds); uint size; - byte *imgData = _resourceManager->getSubResource(7, 2, _buttonIndex, &size); + byte *imgData = g_resourceManager->getSubResource(7, 2, _buttonIndex, &size); GfxSurface btnSelected = surfaceFromRes(imgData); - _globals->gfxManager().copyFrom(btnSelected, _bounds.left, _bounds.top); + g_globals->gfxManager().copyFrom(btnSelected, _bounds.left, _bounds.top); DEALLOCATE(imgData); } @@ -83,17 +83,17 @@ RightClickDialog::RightClickDialog() : GfxDialog(), // Set the palette and change the cursor _gfxManager.setDialogPalette(); - _globals->_events.setCursor(CURSOR_ARROW); + g_globals->_events.setCursor(CURSOR_ARROW); // Get the dialog image _surface = surfaceFromRes(7, 1, 1); // Set the dialog position dialogRect.resize(_surface, 0, 0, 100); - dialogRect.center(_globals->_events._mousePos.x, _globals->_events._mousePos.y); + dialogRect.center(g_globals->_events._mousePos.x, g_globals->_events._mousePos.y); // Ensure the dialog will be entirely on-screen - Rect screenRect = _globals->gfxManager()._bounds; + Rect screenRect = g_globals->gfxManager()._bounds; screenRect.collapse(4, 4); dialogRect.contain(screenRect); @@ -122,10 +122,10 @@ RightClickButton *RightClickDialog::findButton(const Common::Point &pt) { void RightClickDialog::draw() { // Save the covered background area - _savedArea = Surface_getArea(_globals->_gfxManagerInstance.getSurface(), _bounds); + _savedArea = Surface_getArea(g_globals->_gfxManagerInstance.getSurface(), _bounds); // Draw the dialog image - _globals->gfxManager().copyFrom(_surface, _bounds.left, _bounds.top); + g_globals->gfxManager().copyFrom(_surface, _bounds.left, _bounds.top); } bool RightClickDialog::process(Event &event) { @@ -173,9 +173,9 @@ void RightClickDialog::execute() { // Dialog event handler loop _gfxManager.activate(); - while (!_vm->shouldQuit() && (_selectedAction == -1)) { + while (!g_vm->shouldQuit() && (_selectedAction == -1)) { Event evt; - while (_globals->_events.getEvent(evt, EVENT_MOUSE_MOVE | EVENT_BUTTON_DOWN)) { + while (g_globals->_events.getEvent(evt, EVENT_MOUSE_MOVE | EVENT_BUTTON_DOWN)) { evt.mousePos.x -= _bounds.left; evt.mousePos.y -= _bounds.top; @@ -190,19 +190,19 @@ void RightClickDialog::execute() { switch (_selectedAction) { case 1: // Look action - _globals->_events.setCursor(CURSOR_LOOK); + g_globals->_events.setCursor(CURSOR_LOOK); break; case 2: // Walk action - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_events.setCursor(CURSOR_WALK); break; case 3: // Use cursor - _globals->_events.setCursor(CURSOR_USE); + g_globals->_events.setCursor(CURSOR_USE); break; case 4: // Talk cursor - _globals->_events.setCursor(CURSOR_TALK); + g_globals->_events.setCursor(CURSOR_TALK); break; case 5: // Inventory dialog diff --git a/engines/tsage/ringworld/ringworld_logic.cpp b/engines/tsage/ringworld/ringworld_logic.cpp index a131969633..3fb284f5da 100644 --- a/engines/tsage/ringworld/ringworld_logic.cpp +++ b/engines/tsage/ringworld/ringworld_logic.cpp @@ -278,7 +278,7 @@ void SceneArea::display() { _bounds.setWidth(_surface.getBounds().width()); _bounds.setHeight(_surface.getBounds().height()); - _savedArea = Surface_getArea(_globals->_gfxManagerInstance.getSurface(), _bounds); + _savedArea = Surface_getArea(g_globals->_gfxManagerInstance.getSurface(), _bounds); draw2(); } @@ -297,13 +297,13 @@ void SceneArea::draw(bool flag) { void SceneArea::wait() { // Wait until a mouse or keypress Event event; - while (!_vm->shouldQuit() && !_globals->_events.getEvent(event)) { + while (!g_vm->shouldQuit() && !g_globals->_events.getEvent(event)) { g_system->updateScreen(); g_system->delayMillis(10); } SynchronizedList<SceneItem *>::iterator ii; - for (ii = _globals->_sceneItems.begin(); ii != _globals->_sceneItems.end(); ++ii) { + for (ii = g_globals->_sceneItems.begin(); ii != g_globals->_sceneItems.end(); ++ii) { SceneItem *sceneItem = *ii; if (sceneItem->contains(event.mousePos)) { sceneItem->doAction(_actionId); @@ -311,7 +311,7 @@ void SceneArea::wait() { } } - _globals->_events.setCursor(CURSOR_ARROW); + g_globals->_events.setCursor(CURSOR_ARROW); } void SceneArea::synchronize(Serializer &s) { @@ -406,11 +406,11 @@ RingworldInvObjectList::RingworldInvObjectList() : void RingworldGame::start() { // Set some default flags - _globals->setFlag(12); - _globals->setFlag(34); + g_globals->setFlag(12); + g_globals->setFlag(34); // Set the screen to scroll in response to the player moving off-screen - _globals->_scrollFollower = &_globals->_player; + g_globals->_scrollFollower = &g_globals->_player; // Set the object's that will be in the player's inventory by default RING_INVENTORY._stunner._sceneNumber = 1; @@ -421,8 +421,8 @@ void RingworldGame::start() { if (ConfMan.hasKey("save_slot")) { slot = ConfMan.getInt("save_slot"); - Common::String file = _vm->generateSaveName(slot); - Common::InSaveFile *in = _vm->_system->getSavefileManager()->openForLoading(file); + Common::String file = g_vm->generateSaveName(slot); + Common::InSaveFile *in = g_vm->_system->getSavefileManager()->openForLoading(file); if (in) delete in; else @@ -430,28 +430,28 @@ void RingworldGame::start() { } if (slot >= 0) - _globals->_sceneHandler->_loadGameSlot = slot; + g_globals->_sceneHandler->_loadGameSlot = slot; else // Switch to the title screen - _globals->_sceneManager.setNewScene(1000); + g_globals->_sceneManager.setNewScene(1000); - _globals->_events.showCursor(); + g_globals->_events.showCursor(); } void RingworldGame::restart() { - _globals->_scenePalette.clearListeners(); - _globals->_soundHandler.stop(); + g_globals->_scenePalette.clearListeners(); + g_globals->_soundHandler.stop(); // Reset the flags - _globals->reset(); - _globals->setFlag(34); + g_globals->reset(); + g_globals->setFlag(34); // Clear save/load slots - _globals->_sceneHandler->_saveGameSlot = -1; - _globals->_sceneHandler->_loadGameSlot = -1; + g_globals->_sceneHandler->_saveGameSlot = -1; + g_globals->_sceneHandler->_loadGameSlot = -1; - _globals->_stripNum = 0; - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_stripNum = 0; + g_globals->_events.setCursor(CURSOR_WALK); // Reset item properties RING_INVENTORY._stunner._sceneNumber = 1; @@ -489,37 +489,37 @@ void RingworldGame::restart() { RING_INVENTORY._selectedItem = NULL; // Change to the first game scene - _globals->_sceneManager.changeScene(30); + g_globals->_sceneManager.changeScene(30); } void RingworldGame::endGame(int resNum, int lineNum) { - _globals->_events.setCursor(CURSOR_WALK); - Common::String msg = _resourceManager->getMessage(resNum, lineNum); - bool savesExist = _saver->savegamesExist(); + g_globals->_events.setCursor(CURSOR_WALK); + Common::String msg = g_resourceManager->getMessage(resNum, lineNum); + bool savesExist = g_saver->savegamesExist(); if (!savesExist) { // No savegames exist, so prompt the user to restart or quit if (MessageDialog::show(msg, QUIT_BTN_STRING, RESTART_BTN_STRING) == 0) - _vm->quitGame(); + g_vm->quitGame(); else restart(); } else { // Savegames exist, so prompt for Restore/Restart bool breakFlag; do { - if (_vm->shouldQuit()) { + if (g_vm->shouldQuit()) { breakFlag = true; } else if (MessageDialog::show(msg, RESTART_BTN_STRING, RESTORE_BTN_STRING) == 0) { restart(); breakFlag = true; } else { - handleSaveLoad(false, _globals->_sceneHandler->_loadGameSlot, _globals->_sceneHandler->_saveName); - breakFlag = _globals->_sceneHandler->_loadGameSlot >= 0; + handleSaveLoad(false, g_globals->_sceneHandler->_loadGameSlot, g_globals->_sceneHandler->_saveName); + breakFlag = g_globals->_sceneHandler->_loadGameSlot >= 0; } } while (!breakFlag); } - _globals->_events.setCursorFromFlag(); + g_globals->_events.setCursorFromFlag(); } void RingworldGame::processEvent(Event &event) { @@ -544,20 +544,20 @@ void RingworldGame::processEvent(Event &event) { case Common::KEYCODE_F4: // F4 - Restart restartGame(); - _globals->_events.setCursorFromFlag(); + g_globals->_events.setCursorFromFlag(); break; case Common::KEYCODE_F7: // F7 - Restore restoreGame(); - _globals->_events.setCursorFromFlag(); + g_globals->_events.setCursorFromFlag(); break; case Common::KEYCODE_F10: // F10 - Pause GfxDialog::setPalette(); MessageDialog::show(GAME_PAUSED_MSG, OK_BTN_STRING); - _globals->_events.setCursorFromFlag(); + g_globals->_events.setCursorFromFlag(); break; default: diff --git a/engines/tsage/ringworld/ringworld_logic.h b/engines/tsage/ringworld/ringworld_logic.h index 40b202bd7f..84816347af 100644 --- a/engines/tsage/ringworld/ringworld_logic.h +++ b/engines/tsage/ringworld/ringworld_logic.h @@ -144,7 +144,7 @@ public: virtual Common::String getClassName() { return "RingworldInvObjectList"; } }; -#define RING_INVENTORY (*((::TsAGE::Ringworld::RingworldInvObjectList *)_globals->_inventory)) +#define RING_INVENTORY (*((::TsAGE::Ringworld::RingworldInvObjectList *)g_globals->_inventory)) class RingworldGame: public Game { public: diff --git a/engines/tsage/ringworld/ringworld_scenes1.cpp b/engines/tsage/ringworld/ringworld_scenes1.cpp index 20af25561c..8227e2a884 100644 --- a/engines/tsage/ringworld/ringworld_scenes1.cpp +++ b/engines/tsage/ringworld/ringworld_scenes1.cpp @@ -35,14 +35,14 @@ namespace Ringworld { *--------------------------------------------------------------------------*/ void Scene10::Action1::signal() { - Scene10 *scene = (Scene10 *)_globals->_sceneManager._scene; + Scene10 *scene = (Scene10 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: setDelay(6); break; case 1: - _globals->_scenePalette.addRotation(240, 254, -1); + g_globals->_scenePalette.addRotation(240, 254, -1); scene->_stripManager.start(10, this); break; case 2: @@ -100,21 +100,21 @@ void Scene10::Action1::signal() { scene->_object4.animate(ANIM_MODE_6, this); break; case 10: - _globals->_soundHandler.fadeOut(this); + g_globals->_soundHandler.fadeOut(this); break; case 11: - _globals->_scenePalette.clearListeners(); - _globals->_sceneManager.changeScene(15); + g_globals->_scenePalette.clearListeners(); + g_globals->_sceneManager.changeScene(15); break; } } void Scene10::Action2::signal() { - Scene10 *scene = (Scene10 *)_globals->_sceneManager._scene; + Scene10 *scene = (Scene10 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - setDelay(_globals->_randomSource.getRandomNumber(179)); + setDelay(g_globals->_randomSource.getRandomNumber(179)); break; case 1: scene->_object3.setFrame(1); @@ -183,11 +183,11 @@ void Scene10::postInit(SceneObjectList *OwnerList) { _object6.animate(ANIM_MODE_2, NULL); _object6._numFrames = 5; - _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); - _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; + g_globals->_sceneManager._scene->_sceneBounds.contain(g_globals->_sceneManager._scene->_backgroundBounds); + g_globals->_sceneOffset.x = (g_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; setAction(&_action1); - _globals->_soundHandler.play(5); + g_globals->_soundHandler.play(5); } void Scene10::stripCallback(int v) { @@ -213,7 +213,7 @@ void Scene10::stripCallback(int v) { *--------------------------------------------------------------------------*/ void Scene15::Action1::signal() { - Scene15 *scene = (Scene15 *)_globals->_sceneManager._scene; + Scene15 *scene = (Scene15 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -239,13 +239,13 @@ void Scene15::Action1::signal() { } case 3: SceneItem::display(0, 0); - _globals->_sceneManager.changeScene(20); + g_globals->_sceneManager.changeScene(20); break; } } void Scene15::Action1::dispatch() { - Scene15 *scene = (Scene15 *)_globals->_sceneManager._scene; + Scene15 *scene = (Scene15 *)g_globals->_sceneManager._scene; if (scene->_object1._position.y < 100) scene->_object1.changeZoom(100 - scene->_object1._position.y); @@ -258,7 +258,7 @@ void Scene15::postInit(SceneObjectList *OwnerList) { loadScene(15); Scene::postInit(); setZoomPercents(0, 100, 200, 100); - _globals->_soundHandler.play(6); + g_globals->_soundHandler.play(6); setAction(&_action1); } @@ -268,7 +268,7 @@ void Scene15::postInit(SceneObjectList *OwnerList) { *--------------------------------------------------------------------------*/ void Scene20::Action1::signal() { - Scene20 *scene = (Scene20 *)_globals->_sceneManager._scene; + Scene20 *scene = (Scene20 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -278,11 +278,11 @@ void Scene20::Action1::signal() { scene->_stripManager.start(20, this); break; case 2: - _globals->_soundHandler.fadeOut(this); + g_globals->_soundHandler.fadeOut(this); break; case 3: - _globals->_sceneManager._fadeMode = FADEMODE_GRADUAL; - _globals->_sceneManager.changeScene(30); // First game scene + g_globals->_sceneManager._fadeMode = FADEMODE_GRADUAL; + g_globals->_sceneManager.changeScene(30); // First game scene break; default: break; @@ -290,7 +290,7 @@ void Scene20::Action1::signal() { } void Scene20::Action2::signal() { - Scene20 *scene = (Scene20 *)_globals->_sceneManager._scene; + Scene20 *scene = (Scene20 *)g_globals->_sceneManager._scene; NpcMover *npcMover; switch (_actionIndex++) { @@ -305,51 +305,51 @@ void Scene20::Action2::signal() { case 2: { NpcMover *mover = new NpcMover(); Common::Point pt(455, 77); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); ObjectMover2 *mover2 = new ObjectMover2(); - scene->_SceneObjectExt.addMover(mover2, 5, 10, &_globals->_player); + scene->_SceneObjectExt.addMover(mover2, 5, 10, &g_globals->_player); ObjectMover2 *mover3 = new ObjectMover2(); - scene->_sceneObject3.addMover(mover3, 10, 15, &_globals->_player); + scene->_sceneObject3.addMover(mover3, 10, 15, &g_globals->_player); break; } case 3: { npcMover = new NpcMover(); Common::Point pt(557, 100); - _globals->_player.addMover(npcMover, &pt, this); + g_globals->_player.addMover(npcMover, &pt, this); break; } case 4: { npcMover = new NpcMover(); Common::Point pt(602, 90); - _globals->_player.addMover(npcMover, &pt, this); + g_globals->_player.addMover(npcMover, &pt, this); break; } case 5: { npcMover = new NpcMover(); Common::Point pt(618, 90); - _globals->_player.addMover(npcMover, &pt, this); + g_globals->_player.addMover(npcMover, &pt, this); break; } case 6: { npcMover = new NpcMover(); Common::Point pt(615, 81); - _globals->_player.addMover(npcMover, &pt, this); + g_globals->_player.addMover(npcMover, &pt, this); break; } case 7: { npcMover = new NpcMover(); Common::Point pt(588, 79); - _globals->_player.addMover(npcMover, &pt, this); + g_globals->_player.addMover(npcMover, &pt, this); break; } case 8: scene->_sound.release(); - _globals->_soundHandler.fadeOut(this); + g_globals->_soundHandler.fadeOut(this); break; case 9: SceneItem::display(0, 0, LIST_END); - _globals->_sceneManager._fadeMode = FADEMODE_GRADUAL; - _globals->_sceneManager.changeScene(40); + g_globals->_sceneManager._fadeMode = FADEMODE_GRADUAL; + g_globals->_sceneManager.changeScene(40); break; default: break; @@ -357,7 +357,7 @@ void Scene20::Action2::signal() { } void Scene20::Action3::signal() { - Scene20 *scene = (Scene20 *)_globals->_sceneManager._scene; + Scene20 *scene = (Scene20 *)g_globals->_sceneManager._scene; NpcMover *npcMover; switch (_actionIndex++) { @@ -367,47 +367,47 @@ void Scene20::Action3::signal() { case 1: { npcMover = new NpcMover(); Common::Point pt(615, 81); - _globals->_player.addMover(npcMover, &pt, this); + g_globals->_player.addMover(npcMover, &pt, this); ObjectMover2 *mover1 = new ObjectMover2(); - scene->_SceneObjectExt.addMover(mover1, 5, 10, &_globals->_player); + scene->_SceneObjectExt.addMover(mover1, 5, 10, &g_globals->_player); ObjectMover2 *mover2 = new ObjectMover2(); - scene->_sceneObject3.addMover(mover2, 20, 25, &_globals->_player); + scene->_sceneObject3.addMover(mover2, 20, 25, &g_globals->_player); break; } case 2: { npcMover = new NpcMover(); Common::Point pt(618, 90); - _globals->_player.addMover(npcMover, &pt, this); + g_globals->_player.addMover(npcMover, &pt, this); break; } case 3: { - _globals->_player._moveDiff = Common::Point(10, 10); + g_globals->_player._moveDiff = Common::Point(10, 10); scene->_SceneObjectExt._moveDiff = Common::Point(10, 10); scene->_sceneObject3._moveDiff = Common::Point(10, 10); npcMover = new NpcMover(); Common::Point pt(445, 132); - _globals->_player.addMover(npcMover, &pt, this); + g_globals->_player.addMover(npcMover, &pt, this); break; } case 4: { npcMover = new NpcMover(); Common::Point pt(151, 137); - _globals->_player.addMover(npcMover, &pt, this); + g_globals->_player.addMover(npcMover, &pt, this); break; } case 5: { npcMover = new NpcMover(); Common::Point pt(-15, 137); - _globals->_player.addMover(npcMover, &pt, this); + g_globals->_player.addMover(npcMover, &pt, this); break; } case 6: scene->_sound.play(60, this, 127); - _globals->_soundHandler.release(); + g_globals->_soundHandler.release(); break; case 7: - _globals->_sceneManager._fadeMode = FADEMODE_GRADUAL; - _globals->_sceneManager.changeScene(90); + g_globals->_sceneManager._fadeMode = FADEMODE_GRADUAL; + g_globals->_sceneManager.changeScene(90); break; default: break; @@ -415,7 +415,7 @@ void Scene20::Action3::signal() { } void Scene20::Action4::signal() { - Scene20 *scene = (Scene20 *)_globals->_sceneManager._scene; + Scene20 *scene = (Scene20 *)g_globals->_sceneManager._scene; NpcMover *npcMover; switch (_actionIndex++) { @@ -425,20 +425,20 @@ void Scene20::Action4::signal() { case 1: { npcMover = new NpcMover(); Common::Point pt(486, 134); - _globals->_player.addMover(npcMover, &pt, this); + g_globals->_player.addMover(npcMover, &pt, this); ObjectMover2 *mover1 = new ObjectMover2(); - scene->_SceneObjectExt.addMover(mover1, 20, 35, &_globals->_player); + scene->_SceneObjectExt.addMover(mover1, 20, 35, &g_globals->_player); break; } case 2: { - _globals->_player._moveDiff = Common::Point(12, 12); + g_globals->_player._moveDiff = Common::Point(12, 12); scene->_SceneObjectExt._moveDiff = Common::Point(12, 12); NpcMover *mover1 = new NpcMover(); Common::Point pt(486, 134); scene->_sceneObject3.addMover(mover1, &pt, this); NpcMover *mover2 = new NpcMover(); pt = Common::Point(-15, 134); - _globals->_player.addMover(mover2, &pt, NULL); + g_globals->_player.addMover(mover2, &pt, NULL); NpcMover *mover3 = new NpcMover(); pt = Common::Point(-15, 134); scene->_SceneObjectExt.addMover(mover3, &pt, NULL); @@ -485,7 +485,7 @@ void Scene20::Action4::signal() { scene->_sceneObject5._moveDiff.x = 48; ObjectMover3 *mover = new ObjectMover3(); - scene->_sceneObject5.addMover(mover, &_globals->_player, 4, this); + scene->_sceneObject5.addMover(mover, &g_globals->_player, 4, this); break; } case 6: { @@ -494,24 +494,24 @@ void Scene20::Action4::signal() { scene->_SceneObjectExt.animate(ANIM_MODE_2, NULL); scene->_sceneObject5.remove(); - _globals->_player.setVisage(21); - _globals->_player.setStrip(1); - _globals->_player.setFrame(1); - _globals->_player.animate(ANIM_MODE_5, this); - _globals->_player._moveDiff.x = 4; + g_globals->_player.setVisage(21); + g_globals->_player.setStrip(1); + g_globals->_player.setFrame(1); + g_globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player._moveDiff.x = 4; npcMover = new NpcMover(); - Common::Point pt(_globals->_player._position.x - 25, _globals->_player._position.y + 5); - _globals->_player.addMover(npcMover, &pt, this); + Common::Point pt(g_globals->_player._position.x - 25, g_globals->_player._position.y + 5); + g_globals->_player.addMover(npcMover, &pt, this); break; } case 7: - _globals->_player.setStrip(2); - _globals->_player.animate(ANIM_MODE_2, NULL); + g_globals->_player.setStrip(2); + g_globals->_player.animate(ANIM_MODE_2, NULL); scene->_sound.play(77, this, 127); break; case 8: - _globals->_game->endGame(20, 0); + g_globals->_game->endGame(20, 0); break; default: break; @@ -529,15 +529,15 @@ void Scene20::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_speakerQText); _stripManager.addSpeaker(&_speakerGameText); - _speakerQText._npc = &_globals->_player; + _speakerQText._npc = &g_globals->_player; - if (_globals->_sceneManager._previousScene == 30) { + if (g_globals->_sceneManager._previousScene == 30) { // Cut scene: Assassins are coming - _globals->_player.postInit(); - _globals->_player.setVisage(20); - _globals->_player.setPosition(Common::Point(405, 69)); - _globals->_player._moveDiff = Common::Point(10, 10); - _globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.postInit(); + g_globals->_player.setVisage(20); + g_globals->_player.setPosition(Common::Point(405, 69)); + g_globals->_player._moveDiff = Common::Point(10, 10); + g_globals->_player.animate(ANIM_MODE_1, NULL); _SceneObjectExt.postInit(); _SceneObjectExt.setVisage(20); @@ -551,21 +551,21 @@ void Scene20::postInit(SceneObjectList *OwnerList) { _SceneObjectExt._moveDiff = Common::Point(10, 10); _sceneObject3._moveDiff = Common::Point(10, 10); - _globals->_soundHandler.play(20); + g_globals->_soundHandler.play(20); _sound.play(21); _sound.holdAt(true); setAction(&_action2); _sceneBounds = Rect(320, 0, 640, 200); - } else if (_globals->_sceneManager._previousScene == 60) { + } else if (g_globals->_sceneManager._previousScene == 60) { // Evasion _sound.play(30); - _globals->_player.postInit(); - _globals->_player.setVisage(20); - _globals->_player.setPosition(Common::Point(588, 79)); - _globals->_player._moveDiff = Common::Point(5, 5); - _globals->_player.fixPriority(50); - _globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.postInit(); + g_globals->_player.setVisage(20); + g_globals->_player.setPosition(Common::Point(588, 79)); + g_globals->_player._moveDiff = Common::Point(5, 5); + g_globals->_player.fixPriority(50); + g_globals->_player.animate(ANIM_MODE_1, NULL); _SceneObjectExt.postInit(); _SceneObjectExt.setVisage(20); @@ -578,28 +578,28 @@ void Scene20::postInit(SceneObjectList *OwnerList) { _sceneObject3.setPosition(Common::Point(595, 79)); _sceneObject3.animate(ANIM_MODE_1, NULL); - if ((_globals->getFlag(120) && _globals->getFlag(116)) || - (_globals->getFlag(117) && _globals->getFlag(119))) { + if ((g_globals->getFlag(120) && g_globals->getFlag(116)) || + (g_globals->getFlag(117) && g_globals->getFlag(119))) { // Successful evasion setAction(&_action3); - } else if (_globals->getFlag(104)) { + } else if (g_globals->getFlag(104)) { _sceneMode = 21; - setAction(&_sequenceManager, this, 21, &_globals->_player, &_SceneObjectExt, NULL); + setAction(&_sequenceManager, this, 21, &g_globals->_player, &_SceneObjectExt, NULL); } else { // Failed evasion _sceneObject3._moveDiff = Common::Point(8, 8); setAction(&_action4); } - _sceneBounds.center(_globals->_player._position.x, _globals->_player._position.y); + _sceneBounds.center(g_globals->_player._position.x, g_globals->_player._position.y); } else { // Intro: Quinn looking at the monaster - _globals->_player.postInit(); - _globals->_player.setVisage(2640); - _globals->_player.animate(ANIM_MODE_NONE, NULL); - _globals->_player.setStrip2(1); - _globals->_player.setFrame2(4); - _globals->_player.fixPriority(200); - _globals->_player.setPosition(Common::Point(425, 233)); + g_globals->_player.postInit(); + g_globals->_player.setVisage(2640); + g_globals->_player.animate(ANIM_MODE_NONE, NULL); + g_globals->_player.setStrip2(1); + g_globals->_player.setFrame2(4); + g_globals->_player.fixPriority(200); + g_globals->_player.setPosition(Common::Point(425, 233)); setAction(&_action1); _speakerQText.setTextPos(Common::Point(350, 20)); @@ -607,17 +607,17 @@ void Scene20::postInit(SceneObjectList *OwnerList) { _speakerGameText.setTextPos(Common::Point(350, 20)); _speakerGameText._textWidth = 260; - _globals->_soundHandler.play(8); + g_globals->_soundHandler.play(8); _sceneBounds = Rect(320, 0, 640, 200); } - _globals->_player.disableControl(); + g_globals->_player.disableControl(); loadScene(20); } void Scene20::signal() { if (_sceneMode == 21) - _globals->_sceneManager.changeScene(90); + g_globals->_sceneManager.changeScene(90); } /*-------------------------------------------------------------------------- @@ -631,7 +631,7 @@ void Scene30::BeamObject::doAction(int action) { else if (action == CURSOR_LOOK) display2(30, 2); else if (action == CURSOR_USE) { - Scene30 *parent = (Scene30 *)_globals->_sceneManager._scene; + Scene30 *parent = (Scene30 *)g_globals->_sceneManager._scene; parent->setAction(&parent->_beamAction); } else SceneObject::doAction(action); @@ -649,38 +649,38 @@ void Scene30::DoorObject::doAction(int action) { } void Scene30::BeamAction::signal() { - Scene30 *scene = (Scene30 *)_globals->_sceneManager._scene; + Scene30 *scene = (Scene30 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: { // Disable control and move player to the doorway beam - _globals->_player.disableControl(); + g_globals->_player.disableControl(); NpcMover *mover = new NpcMover(); Common::Point pt(114, 198); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 1: // Perform the animation of player raising hand - _globals->_player.setVisage(31); - _globals->_player.setStrip(1); - _globals->_player.setFrame(1); - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.setVisage(31); + g_globals->_player.setStrip(1); + g_globals->_player.setFrame(1); + g_globals->_player.animate(ANIM_MODE_5, this); break; case 2: // Hide the beam and lower the player's hand scene->_sound.play(10, NULL, 127); - _globals->_player.animate(ANIM_MODE_6, this); + g_globals->_player.animate(ANIM_MODE_6, this); scene->_beam.remove(); break; case 3: { // Bring the Kzin to the doorway - _globals->_player.setVisage(0); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setStrip(7); + g_globals->_player.setVisage(0); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setStrip(7); scene->_kzin.postInit(); scene->_kzin.setVisage(2801); scene->_kzin.animate(ANIM_MODE_1, NULL); @@ -689,7 +689,7 @@ void Scene30::BeamAction::signal() { NpcMover *mover = new NpcMover(); Common::Point pt(158, 170); scene->_kzin.addMover(mover, &pt, this); - _globals->_sceneItems.push_front(&scene->_kzin); + g_globals->_sceneItems.push_front(&scene->_kzin); break; } @@ -702,7 +702,7 @@ void Scene30::BeamAction::signal() { case 5: // Run the Kzin's talk sequence scene->_sound.play(13, NULL, 127); - _globals->_soundHandler.play(12, NULL, 127); + g_globals->_soundHandler.play(12, NULL, 127); scene->_stripManager.start((scene->_sceneMode == 0) ? 30 : 37, this); break; @@ -715,7 +715,7 @@ void Scene30::BeamAction::signal() { // Re-activate player control scene->_sceneMode = 31; scene->_kzin.setAction(&scene->_kzinAction); - _globals->_player.enableControl(); + g_globals->_player.enableControl(); // End this action remove(); @@ -727,19 +727,19 @@ void Scene30::BeamAction::signal() { } void Scene30::KzinAction::signal() { - Scene30 *scene = (Scene30 *)_globals->_sceneManager._scene; + Scene30 *scene = (Scene30 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: setDelay(1200); break; case 1: - _globals->_soundHandler.fadeOut(NULL); - _globals->_player.disableControl(); - setAction(&scene->_sequenceManager, _globals->_sceneManager._scene, 31, &scene->_kzin, &scene->_door, NULL); + g_globals->_soundHandler.fadeOut(NULL); + g_globals->_player.disableControl(); + setAction(&scene->_sequenceManager, g_globals->_sceneManager._scene, 31, &scene->_kzin, &scene->_door, NULL); break; case 2: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; default: @@ -748,28 +748,28 @@ void Scene30::KzinAction::signal() { } void Scene30::RingAction::signal() { - Scene30 *scene = (Scene30 *)_globals->_sceneManager._scene; + Scene30 *scene = (Scene30 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_kzin.setAction(NULL); NpcMover *mover = new NpcMover(); Common::Point pt(114, 198); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 1: - _globals->_player.checkAngle(&scene->_kzin); + g_globals->_player.checkAngle(&scene->_kzin); scene->_stripManager.start(32, this); break; case 2: { - _globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.animate(ANIM_MODE_1, NULL); NpcMover *mover = new NpcMover(); Common::Point pt(143, 177); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } @@ -785,7 +785,7 @@ void Scene30::RingAction::signal() { scene->_kzin.addMover(kzinMover, &pt, this); NpcMover *playerMover = new NpcMover(); pt = Common::Point(335, 36); - _globals->_player.addMover(playerMover, &pt, this); + g_globals->_player.addMover(playerMover, &pt, this); break; } @@ -793,7 +793,7 @@ void Scene30::RingAction::signal() { break; case 6: - _globals->_sceneManager.changeScene(20); + g_globals->_sceneManager.changeScene(20); break; default: @@ -802,19 +802,19 @@ void Scene30::RingAction::signal() { } void Scene30::TalkAction::signal() { - Scene30 *scene = (Scene30 *)_globals->_sceneManager._scene; + Scene30 *scene = (Scene30 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_kzin.setAction(NULL); NpcMover *mover = new NpcMover(); Common::Point pt(114, 198); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 1: - _globals->_player.checkAngle(&scene->_kzin); + g_globals->_player.checkAngle(&scene->_kzin); scene->_stripManager.start(34, this); break; case 2: @@ -822,7 +822,7 @@ void Scene30::TalkAction::signal() { break; case 3: scene->_kzin.setAction(&scene->_kzinAction); - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; default: @@ -833,7 +833,7 @@ void Scene30::TalkAction::signal() { /*--------------------------------------------------------------------------*/ void Scene30::KzinObject::doAction(int action) { - Scene30 *scene = (Scene30 *)_globals->_sceneManager._scene; + Scene30 *scene = (Scene30 *)g_globals->_sceneManager._scene; switch (action) { case OBJECT_STUNNER: @@ -853,7 +853,7 @@ void Scene30::KzinObject::doAction(int action) { display2(30, 10); break; case CURSOR_TALK: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->setAction(&scene->_talkAction); break; default: @@ -881,19 +881,19 @@ void Scene30::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_speakerSText); _stripManager.addSpeaker(&_speakerQText); _speakerSText._npc = &_kzin; - _speakerQText._npc = &_globals->_player; + _speakerQText._npc = &g_globals->_player; // Setup player - _globals->_player.postInit(); - _globals->_player.setVisage(0); - _globals->_player.animate(ANIM_MODE_1); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.setStrip(7); - _globals->_player.setFrame(1); - _globals->_player.setPosition(Common::Point(114, 198)); - _globals->_player.changeZoom(75); - _globals->_player.enableControl(); + g_globals->_player.postInit(); + g_globals->_player.setVisage(0); + g_globals->_player.animate(ANIM_MODE_1); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.setStrip(7); + g_globals->_player.setFrame(1); + g_globals->_player.setPosition(Common::Point(114, 198)); + g_globals->_player.changeZoom(75); + g_globals->_player.enableControl(); // Set up beam object _beam.postInit(); @@ -911,7 +911,7 @@ void Scene30::postInit(SceneObjectList *OwnerList) { _courtyardHotspot.setBounds(Rect(0, 0, 320, 200)); // Add the objects and hotspots to the scene - _globals->_sceneItems.addItems(&_beam, &_wallsHotspot, &_door, &_treeHotspot, &_groundHotspot, + g_globals->_sceneItems.addItems(&_beam, &_wallsHotspot, &_door, &_treeHotspot, &_groundHotspot, &_courtyardHotspot, NULL); // Load the scene data @@ -927,12 +927,12 @@ void Scene30::signal() { _beam.setStrip(2); _beam.setPosition(Common::Point(124, 178)); _beam.fixPriority(188); - _globals->_sceneItems.push_front(&_beam); - _globals->_player.enableControl(); + g_globals->_sceneItems.push_front(&_beam); + g_globals->_player.enableControl(); } else if (_sceneMode == 32) { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneMode = 31; - setAction(&_sequenceManager, _globals->_sceneManager._scene, 31, &_kzin, &_door, NULL); + setAction(&_sequenceManager, g_globals->_sceneManager._scene, 31, &_kzin, &_door, NULL); } } @@ -942,14 +942,14 @@ void Scene30::signal() { *--------------------------------------------------------------------------*/ void Scene40::Action1::signal() { - Scene40 *scene = (Scene40 *)_globals->_sceneManager._scene; + Scene40 *scene = (Scene40 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: setDelay(120); break; case 1: - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_events.setCursor(CURSOR_WALK); scene->_stripManager.start(40, this); break; case 2: @@ -962,7 +962,7 @@ void Scene40::Action1::signal() { case 3: scene->_doorway.hide(); scene->_dyingKzin.setPosition(Common::Point(296, 62)); - _globals->_player.animate(ANIM_MODE_5, NULL); + g_globals->_player.animate(ANIM_MODE_5, NULL); scene->_object1.setVisage(43); scene->_object1.setStrip(3); scene->_object1.animate(ANIM_MODE_5, NULL); @@ -1026,8 +1026,8 @@ void Scene40::Action1::signal() { break; } case 12: { - _globals->_soundHandler.play(26); - _globals->_player._uiEnabled = true; + g_globals->_soundHandler.play(26); + g_globals->_player._uiEnabled = true; scene->_assassin.setVisage(42); scene->_assassin.setPosition(Common::Point(4, 191)); scene->_assassin.setStrip(1); @@ -1048,41 +1048,41 @@ void Scene40::Action1::signal() { scene->_soundHandler.play(28); break; case 15: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_object1.setVisage(40); scene->_object1.setStrip(4); scene->_object1.setFrame(1); scene->_object1.animate(ANIM_MODE_5, NULL); - _globals->_player.setVisage(40); - _globals->_player.setStrip(2); - _globals->_player.setFrame(1); - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.setVisage(40); + g_globals->_player.setStrip(2); + g_globals->_player.setFrame(1); + g_globals->_player.animate(ANIM_MODE_5, this); break; case 16: - _globals->_soundHandler.play(77, this); + g_globals->_soundHandler.play(77, this); break; case 17: - _globals->_game->endGame(40, 20); + g_globals->_game->endGame(40, 20); remove(); break; } } void Scene40::Action2::signal() { - Scene40 *scene = (Scene40 *)_globals->_sceneManager._scene; + Scene40 *scene = (Scene40 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); if (scene->_assassin._position.x < 229) _actionIndex = 0; setDelay(1); break; case 1: scene->_assassin.animate(ANIM_MODE_NONE, NULL); - _globals->_player.setStrip(2); - _globals->_player.setFrame(1); - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.setStrip(2); + g_globals->_player.setFrame(1); + g_globals->_player.animate(ANIM_MODE_5, this); break; case 2: { scene->_soundHandler.play(28); @@ -1109,19 +1109,19 @@ void Scene40::Action2::signal() { RING_INVENTORY._infoDisk._sceneNumber = 40; break; case 4: - _globals->_player.animate(ANIM_MODE_6, this); + g_globals->_player.animate(ANIM_MODE_6, this); break; case 5: { - _globals->_player.setVisage(0); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setStrip(1); + g_globals->_player.setVisage(0); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setStrip(1); Common::Point pt(230, 195); PlayerMover *mover = new PlayerMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 6: { - _globals->_player.setStrip(7); + g_globals->_player.setStrip(7); scene->_object1.setVisage(2806); scene->_object1.animate(ANIM_MODE_1, NULL); SceneObjectWrapper *wrapper = new SceneObjectWrapper(); @@ -1143,45 +1143,45 @@ void Scene40::Action2::signal() { case 9: scene->_dyingKzin.setAction(&scene->_action7); scene->_object1.remove(); - _globals->_stripNum = 88; - _globals->_events.setCursor(CURSOR_WALK); - _globals->_player.enableControl(); + g_globals->_stripNum = 88; + g_globals->_events.setCursor(CURSOR_WALK); + g_globals->_player.enableControl(); scene->_assassin.setAction(&scene->_action8); break; } } void Scene40::Action3::signal() { - Scene40 *scene = (Scene40 *)_globals->_sceneManager._scene; + Scene40 *scene = (Scene40 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: { - _globals->_player.setAction(NULL); - _globals->_stripNum = 99; - _globals->_player.disableControl(); + g_globals->_player.setAction(NULL); + g_globals->_stripNum = 99; + g_globals->_player.disableControl(); Common::Point pt(240, 195); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 1: - _globals->_player.setVisage(5010); - _globals->_player._strip = 2; - _globals->_player._frame = 1; - _globals->_player.animate(ANIM_MODE_4, 5, 1, this); + g_globals->_player.setVisage(5010); + g_globals->_player._strip = 2; + g_globals->_player._frame = 1; + g_globals->_player.animate(ANIM_MODE_4, 5, 1, this); break; case 2: scene->_assassin.setStrip(2); scene->_assassin.setFrame(1); RING_INVENTORY._infoDisk._sceneNumber = 1; - _globals->_player.animate(ANIM_MODE_6, this); + g_globals->_player.animate(ANIM_MODE_6, this); break; case 3: - _globals->_player.setVisage(0); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setStrip(7); - _globals->_stripNum = 88; - _globals->_player.enableControl(); + g_globals->_player.setVisage(0); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setStrip(7); + g_globals->_stripNum = 88; + g_globals->_player.enableControl(); remove(); break; } @@ -1192,22 +1192,22 @@ void Scene40::Action4::signal() { case 0: { Common::Point pt(178, 190); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 1: - _globals->_stripNum = 88; - _globals->_player.enableControl(); + g_globals->_stripNum = 88; + g_globals->_player.enableControl(); break; } } void Scene40::Action5::signal() { - Scene40 *scene = (Scene40 *)_globals->_sceneManager._scene; + Scene40 *scene = (Scene40 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - setDelay(_globals->_randomSource.getRandomNumber(119) + 120); + setDelay(g_globals->_randomSource.getRandomNumber(119) + 120); break; case 1: scene->_object2.animate(ANIM_MODE_8, 1, this); @@ -1216,7 +1216,7 @@ void Scene40::Action5::signal() { } void Scene40::Action6::signal() { - Scene40 *scene = (Scene40 *)_globals->_sceneManager._scene; + Scene40 *scene = (Scene40 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: { @@ -1253,17 +1253,17 @@ void Scene40::Action6::signal() { } void Scene40::Action7::signal() { - Scene40 *scene = (Scene40 *)_globals->_sceneManager._scene; + Scene40 *scene = (Scene40 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - setDelay(_globals->_randomSource.getRandomNumber(499) + 500); + setDelay(g_globals->_randomSource.getRandomNumber(499) + 500); break; case 1: scene->_object7.postInit(); scene->_object7.setVisage(46); - if (_globals->_randomSource.getRandomNumber(32767) >= 16384) { + if (g_globals->_randomSource.getRandomNumber(32767) >= 16384) { scene->_object7.setStrip(3); scene->_object7.setPosition(Common::Point(15, 185)); } else { @@ -1282,16 +1282,16 @@ void Scene40::Action7::signal() { } void Scene40::Action8::signal() { - Scene40 *scene = (Scene40 *)_globals->_sceneManager._scene; + Scene40 *scene = (Scene40 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: setDelay(300); break; case 1: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); - if ((_globals->_player._position.y >= 197) || (_globals->_player._visage)) { + if ((g_globals->_player._position.y >= 197) || (g_globals->_player._visage)) { _actionIndex = 1; setDelay(30); } else { @@ -1301,7 +1301,7 @@ void Scene40::Action8::signal() { scene->_doorway.fixPriority(200); scene->_doorway._moveRate = 60; - if (_globals->_player._position.x >= 145) { + if (g_globals->_player._position.x >= 145) { scene->_doorway.fixPriority(-1); scene->_doorway.setPosition(Common::Point(6, 157)); } else { @@ -1309,7 +1309,7 @@ void Scene40::Action8::signal() { } scene->_doorway._moveDiff = Common::Point(40, 40); - Common::Point pt(_globals->_player._position.x, _globals->_player._position.y - 18); + Common::Point pt(g_globals->_player._position.x, g_globals->_player._position.y - 18); NpcMover *mover = new NpcMover(); scene->_doorway.addMover(mover, &pt, this); scene->_doorway.animate(ANIM_MODE_5, NULL); @@ -1317,16 +1317,16 @@ void Scene40::Action8::signal() { break; case 2: scene->_doorway.remove(); - _globals->_player.setVisage(40); - _globals->_player.setStrip(2); - _globals->_player.setFrame(1); - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.setVisage(40); + g_globals->_player.setStrip(2); + g_globals->_player.setFrame(1); + g_globals->_player.animate(ANIM_MODE_5, this); break; case 3: - _globals->_soundHandler.play(77, this); + g_globals->_soundHandler.play(77, this); break; case 4: - _globals->_game->endGame(40, 45); + g_globals->_game->endGame(40, 45); remove(); break; } @@ -1337,7 +1337,7 @@ void Scene40::Action8::dispatch() { _action->dispatch(); if (_delayFrames) { - uint32 frameNumber = _globals->_events.getFrameNumber(); + uint32 frameNumber = g_globals->_events.getFrameNumber(); if ((_startFrame + 60) < frameNumber) { --_delayFrames; _startFrame = frameNumber; @@ -1373,14 +1373,14 @@ void Scene40::DyingKzin::doAction(int action) { } void Scene40::Assassin::doAction(int action) { - Scene40 *scene = (Scene40 *)_globals->_sceneManager._scene; + Scene40 *scene = (Scene40 *)g_globals->_sceneManager._scene; switch (action) { case OBJECT_STUNNER: if (scene->_assassin._visage == 44) SceneItem::display2(40, 21); else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); Common::Point pt(230, 187); NpcMover *mover = new NpcMover(); addMover(mover, &pt, NULL); @@ -1402,7 +1402,7 @@ void Scene40::Assassin::doAction(int action) { else if (RING_INVENTORY._infoDisk._sceneNumber == 1) SceneItem::display2(40, 19); else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setAction(&scene->_action3); } break; @@ -1421,7 +1421,7 @@ void Scene40::Item2::doAction(int action) { switch (action) { case OBJECT_STUNNER: SceneItem::display2(40, 35); - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_events.setCursor(CURSOR_WALK); break; case OBJECT_SCANNER: SceneItem::display2(40, 34); @@ -1445,7 +1445,7 @@ void Scene40::Item6::doAction(int action) { switch (action) { case OBJECT_STUNNER: SceneItem::display2(40, 25); - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_events.setCursor(CURSOR_WALK); break; case OBJECT_SCANNER: SceneItem::display2(40, 42); @@ -1478,7 +1478,7 @@ void Scene40::postInit(SceneObjectList *OwnerList) { Scene::postInit(); setZoomPercents(0, 100, 200, 100); - _globals->_stripNum = 99; + g_globals->_stripNum = 99; _stripManager.addSpeaker(&_speakerQR); _stripManager.addSpeaker(&_speakerSL); @@ -1488,19 +1488,19 @@ void Scene40::postInit(SceneObjectList *OwnerList) { _speakerGameText._color1 = 9; _speakerGameText.setTextPos(Common::Point(160, 30)); - _speakerQText._npc = &_globals->_player; + _speakerQText._npc = &g_globals->_player; _speakerSText._npc = &_object1; - _globals->_player.postInit(); - _globals->_player.setVisage(0); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.setPosition(Common::Point(130, 220)); - _globals->_player.disableControl(); + g_globals->_player.postInit(); + g_globals->_player.setVisage(0); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.setPosition(Common::Point(130, 220)); + g_globals->_player.disableControl(); - if (_globals->_sceneManager._previousScene == 20) { - _globals->_soundHandler.play(24); - _globals->_player.setVisage(43); + if (g_globals->_sceneManager._previousScene == 20) { + g_globals->_soundHandler.play(24); + g_globals->_player.setVisage(43); _object1.postInit(); _object1.setVisage(41); @@ -1522,7 +1522,7 @@ void Scene40::postInit(SceneObjectList *OwnerList) { _assassin.postInit(); _assassin.setPosition(Common::Point(-40, 191)); - _globals->_sceneItems.push_back(&_assassin); + g_globals->_sceneItems.push_back(&_assassin); _dyingKzin.postInit(); _dyingKzin.setVisage(40); @@ -1557,8 +1557,8 @@ void Scene40::postInit(SceneObjectList *OwnerList) { _assassin.setStrip(2); } - _globals->_sceneItems.push_back(&_assassin); - _globals->_player.setPosition(Common::Point(170, 220)); + g_globals->_sceneItems.push_back(&_assassin); + g_globals->_player.setPosition(Common::Point(170, 220)); setAction(&_action4); } @@ -1567,24 +1567,24 @@ void Scene40::postInit(SceneObjectList *OwnerList) { _item6._sceneRegionId = 3; _item2._sceneRegionId = 7; - _globals->_sceneItems.addItems(&_dyingKzin, &_item8, &_item1, &_item2, &_item3, &_item4, + g_globals->_sceneItems.addItems(&_dyingKzin, &_item8, &_item1, &_item2, &_item3, &_item4, &_item6, &_item7, &_item5, NULL); } void Scene40::signal() { if (_sceneMode == 41) - _globals->_sceneManager.changeScene(50); + g_globals->_sceneManager.changeScene(50); } void Scene40::dispatch() { - if ((_globals->_stripNum == 88) && (_globals->_player._position.y >= 197)) { - _globals->_player.disableControl(); - _globals->_stripNum = 0; - _globals->_player.setAction(NULL); + if ((g_globals->_stripNum == 88) && (g_globals->_player._position.y >= 197)) { + g_globals->_player.disableControl(); + g_globals->_stripNum = 0; + g_globals->_player.setAction(NULL); _sceneMode = 41; - setAction(&_sequenceManager, this, 41, &_globals->_player, NULL); + setAction(&_sequenceManager, this, 41, &g_globals->_player, NULL); - if (_globals->_sceneManager._previousScene == 20) { + if (g_globals->_sceneManager._previousScene == 20) { _dyingKzin.setAction(&_action6); } } @@ -1598,49 +1598,49 @@ void Scene40::dispatch() { *--------------------------------------------------------------------------*/ void Scene50::Action1::signal() { - Scene50 *scene = (Scene50 *)_globals->_sceneManager._scene; + Scene50 *scene = (Scene50 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - setAction(&scene->_sequenceManager, this, 54, &_globals->_player, NULL); + setAction(&scene->_sequenceManager, this, 54, &g_globals->_player, NULL); break; case 1: - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_events.setCursor(CURSOR_WALK); scene->_stripManager.start(63, this); break; case 2: if (scene->_stripManager._field2E8 != 107) { - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); } else { Common::Point pt(282, 139); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); } break; case 3: - _globals->_stripNum = -1; - _globals->_sceneManager.changeScene(60); + g_globals->_stripNum = -1; + g_globals->_sceneManager.changeScene(60); break; } } void Scene50::Action2::signal() { - Scene50 *scene = (Scene50 *)_globals->_sceneManager._scene; + Scene50 *scene = (Scene50 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_stripManager.start(66, this); break; case 1: { Common::Point pt(141, 142); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 2: - _globals->_sceneManager.changeScene(40); + g_globals->_sceneManager.changeScene(40); remove(); break; } @@ -1649,14 +1649,14 @@ void Scene50::Action2::signal() { void Scene50::Action3::signal() { switch (_actionIndex++) { case 0: { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); Common::Point pt(136, 185); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 1: - _globals->_sceneManager.changeScene(60); + g_globals->_sceneManager.changeScene(60); remove(); break; } @@ -1665,7 +1665,7 @@ void Scene50::Action3::signal() { /*--------------------------------------------------------------------------*/ void Scene50::Object1::doAction(int action) { - Scene50 *scene = (Scene50 *)_globals->_sceneManager._scene; + Scene50 *scene = (Scene50 *)g_globals->_sceneManager._scene; switch (action) { case OBJECT_STUNNER: @@ -1681,7 +1681,7 @@ void Scene50::Object1::doAction(int action) { SceneItem::display2(50, 21); break; case CURSOR_TALK: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 52; scene->setAction(&scene->_sequenceManager, scene, 52, NULL); break; @@ -1692,7 +1692,7 @@ void Scene50::Object1::doAction(int action) { } void Scene50::Object2::doAction(int action) { - Scene50 *scene = (Scene50 *)_globals->_sceneManager._scene; + Scene50 *scene = (Scene50 *)g_globals->_sceneManager._scene; switch (action) { case OBJECT_STUNNER: @@ -1706,7 +1706,7 @@ void Scene50::Object2::doAction(int action) { break; case OBJECT_INFODISK: case CURSOR_USE: - _globals->_stripNum = 50; + g_globals->_stripNum = 50; scene->setAction(&scene->_action3); break; default: @@ -1716,7 +1716,7 @@ void Scene50::Object2::doAction(int action) { } void Scene50::Object3::doAction(int action) { - Scene50 *scene = (Scene50 *)_globals->_sceneManager._scene; + Scene50 *scene = (Scene50 *)g_globals->_sceneManager._scene; switch (action) { case OBJECT_STUNNER: @@ -1733,7 +1733,7 @@ void Scene50::Object3::doAction(int action) { SceneItem::display2(50, 8); break; case CURSOR_TALK: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 52; scene->setAction(&scene->_sequenceManager, scene, 52, NULL); break; @@ -1744,7 +1744,7 @@ void Scene50::Object3::doAction(int action) { } void Scene50::Object4::doAction(int action) { - Scene50 *scene = (Scene50 *)_globals->_sceneManager._scene; + Scene50 *scene = (Scene50 *)g_globals->_sceneManager._scene; switch (action) { case OBJECT_STUNNER: @@ -1758,10 +1758,10 @@ void Scene50::Object4::doAction(int action) { break; case OBJECT_INFODISK: case CURSOR_USE: - _globals->_player.disableControl(); - _globals->_stripNum = 0; + g_globals->_player.disableControl(); + g_globals->_stripNum = 0; scene->_sceneMode = 51; - scene->setAction(&scene->_sequenceManager, scene, 51, &_globals->_player, NULL); + scene->setAction(&scene->_sequenceManager, scene, 51, &g_globals->_player, NULL); break; default: SceneHotspot::doAction(action); @@ -1790,20 +1790,20 @@ void Scene50::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_speakerQText); _stripManager.addSpeaker(&_speakerSText); - _globals->_player.postInit(); - _globals->_player.setVisage(0); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player._canWalk = false; - _globals->_player.changeZoom(75); - _globals->_player._moveDiff.y = 3; - - if (_globals->_sceneManager._previousScene == 40) { - _globals->_player.setPosition(Common::Point(128, 123)); - } else if (_globals->_stripNum == 50) { - _globals->_player.setPosition(Common::Point(136, 185)); + g_globals->_player.postInit(); + g_globals->_player.setVisage(0); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player._canWalk = false; + g_globals->_player.changeZoom(75); + g_globals->_player._moveDiff.y = 3; + + if (g_globals->_sceneManager._previousScene == 40) { + g_globals->_player.setPosition(Common::Point(128, 123)); + } else if (g_globals->_stripNum == 50) { + g_globals->_player.setPosition(Common::Point(136, 185)); } else { - _globals->_player.setPosition(Common::Point(270, 143)); + g_globals->_player.setPosition(Common::Point(270, 143)); } _object2.postInit(); @@ -1824,37 +1824,37 @@ void Scene50::postInit(SceneObjectList *OwnerList) { _object4.setPosition(Common::Point(295, 144)); _object4.fixPriority(178); - _globals->_sceneItems.addItems(&_object2, &_object3, &_object4, NULL); + g_globals->_sceneItems.addItems(&_object2, &_object3, &_object4, NULL); - if (!_globals->getFlag(101)) { - _globals->_player.disableControl(); - _globals->setFlag(101); + if (!g_globals->getFlag(101)) { + g_globals->_player.disableControl(); + g_globals->setFlag(101); setAction(&_action1); } else { - _globals->_player.enableControl(); + g_globals->_player.enableControl(); - if (_globals->_sceneManager._previousScene == 40) { - _globals->_player.disableControl(); + if (g_globals->_sceneManager._previousScene == 40) { + g_globals->_player.disableControl(); _sceneMode = 54; - setAction(&_sequenceManager, this, 54, &_globals->_player, NULL); + setAction(&_sequenceManager, this, 54, &g_globals->_player, NULL); } } _item0.setBounds(Rect(200, 0, 320, 200)); - _globals->_sceneItems.addItems(&_item3, &_item4, &_item5, &_item0, NULL); + g_globals->_sceneItems.addItems(&_item3, &_item4, &_item5, &_item0, NULL); } void Scene50::signal() { switch (_sceneMode) { case 51: - _globals->_sceneManager.changeScene(60); + g_globals->_sceneManager.changeScene(60); break; case 55: - _globals->_sceneManager.changeScene(40); + g_globals->_sceneManager.changeScene(40); break; case 52: case 54: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; } } @@ -1862,13 +1862,13 @@ void Scene50::signal() { void Scene50::dispatch() { Scene::dispatch(); - if ((_sceneMode != 55) && _doorwayRect.contains(_globals->_player._position)) { + if ((_sceneMode != 55) && _doorwayRect.contains(g_globals->_player._position)) { // Player in house doorway, start player moving to within - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneMode = 55; Common::Point pt(89, 111); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); } } @@ -1878,7 +1878,7 @@ void Scene50::dispatch() { *--------------------------------------------------------------------------*/ void Scene60::Action1::signal() { - Scene60 *scene = (Scene60 *)_globals->_sceneManager._scene; + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -1902,7 +1902,7 @@ void Scene60::Action1::signal() { scene->_controlButton.animate(ANIM_MODE_2, NULL); - if (!_globals->getFlag(83)) { + if (!g_globals->getFlag(83)) { scene->_message.postInit(); scene->_message.setVisage(60); scene->_message.setStrip2(3); @@ -1911,18 +1911,18 @@ void Scene60::Action1::signal() { scene->_message.animate(ANIM_MODE_2, NULL); scene->_message._numFrames = 5; - _globals->_sceneItems.push_front(&scene->_message); + g_globals->_sceneItems.push_front(&scene->_message); scene->_soundHandler2.play(38); } - _globals->_events.setCursor(CURSOR_USE); + g_globals->_events.setCursor(CURSOR_USE); break; case 3: scene->_soundHandler2.play(37); scene->loadScene(65); scene->_message.remove(); - if (_globals->_sceneObjects->contains(&scene->_redLights)) + if (g_globals->_sceneObjects->contains(&scene->_redLights)) scene->_redLights.remove(); scene->_controlButton.remove(); @@ -1951,15 +1951,15 @@ void Scene60::Action1::signal() { scene->_rose.setFrame(1); scene->_rose.setPosition(Common::Point(145, 165)); - _globals->_sceneItems.push_front(&scene->_nextButton); - _globals->_sceneItems.push_front(&scene->_prevButton); - _globals->_sceneItems.push_front(&scene->_exitButton); + g_globals->_sceneItems.push_front(&scene->_nextButton); + g_globals->_sceneItems.push_front(&scene->_prevButton); + g_globals->_sceneItems.push_front(&scene->_exitButton); setDelay(10); - _globals->_events.setCursor(CURSOR_USE); + g_globals->_events.setCursor(CURSOR_USE); break; case 4: - _globals->setFlag(90); + g_globals->setFlag(90); // Deliberate fall-through case 5: case 6: @@ -1967,13 +1967,13 @@ void Scene60::Action1::signal() { SceneItem::display(60, _actionIndex - 4, SET_Y, 40, SET_X, 25, SET_FONT, 75, SET_EXT_BGCOLOR, -1, SET_FG_COLOR, 34, SET_POS_MODE, 0, SET_WIDTH, 280, SET_KEEP_ONSCREEN, 1, LIST_END); - _globals->_events.setCursor(CURSOR_USE); + g_globals->_events.setCursor(CURSOR_USE); break; case 9: - _globals->_player._uiEnabled = false; + g_globals->_player._uiEnabled = false; RING_INVENTORY._infoDisk._sceneNumber = 1; - if (_globals->_sceneObjects->contains(&scene->_message)) + if (g_globals->_sceneObjects->contains(&scene->_message)) scene->_message.remove(); scene->_controlButton.animate(ANIM_MODE_NONE); @@ -1993,14 +1993,14 @@ void Scene60::Action1::signal() { scene->_masterButton.setFrame(1); scene->_masterButton._state = 0; - _globals->clearFlag(103); - _globals->clearFlag(!_globals->_stripNum ? 116 : 119); + g_globals->clearFlag(103); + g_globals->clearFlag(!g_globals->_stripNum ? 116 : 119); break; case 10: setDelay(60); break; case 11: - _globals->_player._uiEnabled = true; + g_globals->_player._uiEnabled = true; scene->_floppyDrive.remove(); remove(); break; @@ -2011,7 +2011,7 @@ void Scene60::Action1::signal() { } void Scene60::Action2::signal() { - Scene60 *scene = (Scene60 *)_globals->_sceneManager._scene; + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -2022,7 +2022,7 @@ void Scene60::Action2::signal() { scene->_stripManager.start(66, this); break; case 3: - _globals->_sceneManager.changeScene(50); + g_globals->_sceneManager.changeScene(50); break; } } @@ -2030,7 +2030,7 @@ void Scene60::Action2::signal() { /*--------------------------------------------------------------------------*/ void Scene60::PrevObject::doAction(int action) { - Scene60 *scene = (Scene60 *)_globals->_sceneManager._scene; + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; if (action == CURSOR_LOOK) { SceneItem::display2(60, 16); @@ -2048,7 +2048,7 @@ void Scene60::PrevObject::doAction(int action) { } void Scene60::NextObject::doAction(int action) { - Scene60 *scene = (Scene60 *)_globals->_sceneManager._scene; + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; if (action == CURSOR_LOOK) { SceneItem::display2(60, 17); @@ -2065,7 +2065,7 @@ void Scene60::NextObject::doAction(int action) { } void Scene60::ExitObject::doAction(int action) { - Scene60 *scene = (Scene60 *)_globals->_sceneManager._scene; + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; if (action == CURSOR_LOOK) { SceneItem::display2(60, 18); @@ -2096,8 +2096,8 @@ void Scene60::ExitObject::doAction(int action) { scene->_masterButton.setStrip(8); scene->_masterButton.setPosition(Common::Point(143, 105)); - _globals->_sceneItems.push_front(&scene->_masterButton); - _globals->_sceneItems.push_front(&scene->_slaveButton); + g_globals->_sceneItems.push_front(&scene->_masterButton); + g_globals->_sceneItems.push_front(&scene->_slaveButton); scene->_redLights.postInit(); scene->_redLights.setVisage(60); @@ -2111,14 +2111,14 @@ void Scene60::ExitObject::doAction(int action) { if (scene->_masterButton._state) scene->_masterButton.setFrame(2); - _globals->_sceneItems.push_front(&scene->_item1); - _globals->_sceneItems.push_front(&scene->_controlButton); - _globals->_sceneItems.push_front(&scene->_slaveButton); - _globals->_sceneItems.push_front(&scene->_masterButton); - _globals->_sceneItems.push_back(&scene->_item2); + g_globals->_sceneItems.push_front(&scene->_item1); + g_globals->_sceneItems.push_front(&scene->_controlButton); + g_globals->_sceneItems.push_front(&scene->_slaveButton); + g_globals->_sceneItems.push_front(&scene->_masterButton); + g_globals->_sceneItems.push_back(&scene->_item2); - _globals->gfxManager()._font.setFontNumber(2); - _globals->_sceneText._fontNumber = 2; + g_globals->gfxManager()._font.setFontNumber(2); + g_globals->_sceneText._fontNumber = 2; scene->_action1.setActionIndex(2); scene->_action1.setDelay(1); @@ -2130,20 +2130,20 @@ void Scene60::ExitObject::doAction(int action) { } void Scene60::MessageObject::doAction(int action) { - Scene60 *scene = (Scene60 *)_globals->_sceneManager._scene; + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; if (action == CURSOR_LOOK) { SceneItem::display2(60, 9); } else if (action == CURSOR_USE) { scene->_action1.setDelay(1); - _globals->setFlag(83); + g_globals->setFlag(83); } else { SceneHotspot::doAction(action); } } void Scene60::ControlObject::doAction(int action) { - Scene60 *scene = (Scene60 *)_globals->_sceneManager._scene; + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; if (action == CURSOR_LOOK) { SceneItem::display2(60, 11); @@ -2151,9 +2151,9 @@ void Scene60::ControlObject::doAction(int action) { if (_animateMode == ANIM_MODE_NONE) SceneItem::display2(60, 14); else if (!scene->_slaveButton._state) { - _globals->_soundHandler.play(40); - _globals->_soundHandler.holdAt(true); - _globals->_sceneManager.changeScene(20); + g_globals->_soundHandler.play(40); + g_globals->_soundHandler.holdAt(true); + g_globals->_sceneManager.changeScene(20); } else { scene->_sceneMode = 15; setAction(&scene->_sequenceManager, scene, 62, NULL); @@ -2164,7 +2164,7 @@ void Scene60::ControlObject::doAction(int action) { } void Scene60::SlaveObject::doAction(int action) { - Scene60 *scene = (Scene60 *)_globals->_sceneManager._scene; + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; if (action == CURSOR_LOOK) { SceneItem::display2(60, 8); @@ -2174,14 +2174,14 @@ void Scene60::SlaveObject::doAction(int action) { else if (_state) { scene->_soundHandler3.stop(); animate(ANIM_MODE_6, NULL); - _globals->clearFlag(102); - _globals->clearFlag(!_globals->_stripNum ? 117 : 120); + g_globals->clearFlag(102); + g_globals->clearFlag(!g_globals->_stripNum ? 117 : 120); _state = 0; scene->_sceneMode = 9998; } else { scene->_soundHandler3.play(39); - _globals->setFlag(102); - _globals->setFlag(!_globals->_stripNum ? 117 : 120); + g_globals->setFlag(102); + g_globals->setFlag(!g_globals->_stripNum ? 117 : 120); animate(ANIM_MODE_5, NULL); _state = 1; scene->_sceneMode = 9998; @@ -2194,7 +2194,7 @@ void Scene60::SlaveObject::doAction(int action) { } void Scene60::MasterObject::doAction(int action) { - Scene60 *scene = (Scene60 *)_globals->_sceneManager._scene; + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; if (action == CURSOR_LOOK) { SceneItem::display2(60, 7); @@ -2207,15 +2207,15 @@ void Scene60::MasterObject::doAction(int action) { scene->_soundHandler3.stop(); animate(ANIM_MODE_6, NULL); _state = 0; - _globals->clearFlag(103); - _globals->clearFlag(!_globals->_stripNum ? 116 : 119); + g_globals->clearFlag(103); + g_globals->clearFlag(!g_globals->_stripNum ? 116 : 119); scene->_sceneMode = 9998; } else { scene->_soundHandler3.play(39); animate(ANIM_MODE_5, NULL); _state = 1; - _globals->setFlag(103); - _globals->setFlag(!_globals->_stripNum ? 116 : 119); + g_globals->setFlag(103); + g_globals->setFlag(!g_globals->_stripNum ? 116 : 119); scene->_sceneMode = 9998; } @@ -2226,12 +2226,12 @@ void Scene60::MasterObject::doAction(int action) { } void Scene60::FloppyDrive::doAction(int action) { - Scene60 *scene = (Scene60 *)_globals->_sceneManager._scene; + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; if (action == CURSOR_LOOK) { SceneItem::display2(60, 13); } else if (action == CURSOR_USE) { - _globals->setFlag(!_globals->_stripNum ? 118 : 121); + g_globals->setFlag(!g_globals->_stripNum ? 118 : 121); scene->setAction(&scene->_action1); } else { SceneHotspot::doAction(action); @@ -2241,12 +2241,12 @@ void Scene60::FloppyDrive::doAction(int action) { /*--------------------------------------------------------------------------*/ void Scene60::Item1::doAction(int action) { - Scene60 *scene = (Scene60 *)_globals->_sceneManager._scene; + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; switch (action) { case OBJECT_INFODISK: RING_INVENTORY._infoDisk._sceneNumber = 60; - _globals->setFlag(!_globals->_stripNum ? 118 : 121); + g_globals->setFlag(!g_globals->_stripNum ? 118 : 121); scene->_sceneMode = 0; scene->setAction(&scene->_action1); break; @@ -2255,14 +2255,14 @@ void Scene60::Item1::doAction(int action) { break; case CURSOR_USE: if (RING_INVENTORY._infoDisk._sceneNumber == 60) { - if (_globals->getFlag(118) && !_globals->_stripNum) { - _globals->clearFlag(118); + if (g_globals->getFlag(118) && !g_globals->_stripNum) { + g_globals->clearFlag(118); scene->setAction(&scene->_action1); scene->_action1.setActionIndex(9); scene->_action1.setDelay(1); } - if (_globals->getFlag(121) && !_globals->_stripNum) { - _globals->clearFlag(121); + if (g_globals->getFlag(121) && !g_globals->_stripNum) { + g_globals->clearFlag(121); scene->setAction(&scene->_action1); scene->_action1.setActionIndex(9); scene->_action1.setDelay(1); @@ -2280,7 +2280,7 @@ void Scene60::Item1::doAction(int action) { } void Scene60::Item::doAction(int action) { - Scene60 *scene = (Scene60 *)_globals->_sceneManager._scene; + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -2312,8 +2312,8 @@ void Scene60::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_speakerQText); _stripManager.addSpeaker(&_speakerSText); - _globals->_player._uiEnabled = true; - _globals->_events.setCursor(CURSOR_USE); + g_globals->_player._uiEnabled = true; + g_globals->_events.setCursor(CURSOR_USE); _slaveButton.postInit(); _slaveButton.setVisage(60); @@ -2327,19 +2327,19 @@ void Scene60::postInit(SceneObjectList *OwnerList) { _masterButton.setPosition(Common::Point(143, 105)); _masterButton._state = 0; - _globals->_sceneItems.push_back(&_masterButton); - _globals->_sceneItems.push_back(&_slaveButton); + g_globals->_sceneItems.push_back(&_masterButton); + g_globals->_sceneItems.push_back(&_slaveButton); _controlButton.postInit(); _controlButton.setVisage(60); _controlButton.setStrip(5); _controlButton.setPosition(Common::Point(233, 143)); - _globals->_sceneItems.push_back(&_controlButton); + g_globals->_sceneItems.push_back(&_controlButton); - if (_globals->_stripNum == -1) { - _globals->_stripNum = 0; + if (g_globals->_stripNum == -1) { + g_globals->_stripNum = 0; } else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneMode = 9999; setAction(&_sequenceManager, this, 61, NULL); } @@ -2347,18 +2347,18 @@ void Scene60::postInit(SceneObjectList *OwnerList) { _item1.setBounds(Rect(130, 55, 174, 70)); _item2.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); - if (_globals->_stripNum == 0) { - if (_globals->getFlag(117)) { + if (g_globals->_stripNum == 0) { + if (g_globals->getFlag(117)) { _slaveButton._state = 1; _slaveButton.setFrame(2); } - if (_globals->getFlag(116)) { + if (g_globals->getFlag(116)) { _masterButton._state = 1; _masterButton.setFrame(2); } - if (_globals->getFlag(118)) { + if (g_globals->getFlag(118)) { _controlButton.animate(ANIM_MODE_2, NULL); _redLights.postInit(); @@ -2368,7 +2368,7 @@ void Scene60::postInit(SceneObjectList *OwnerList) { _soundHandler1.play(35); - if (!_globals->getFlag(83)) { + if (!g_globals->getFlag(83)) { _message.postInit(); _message.setVisage(60); _message.setStrip2(3); @@ -2376,23 +2376,23 @@ void Scene60::postInit(SceneObjectList *OwnerList) { _message.setPosition(Common::Point(148, 85)); _message.animate(ANIM_MODE_2, NULL); _message._numFrames = 5; - _globals->_sceneItems.push_front(&_message); + g_globals->_sceneItems.push_front(&_message); _soundHandler2.play(38); } } } else { - if (_globals->getFlag(120)) { + if (g_globals->getFlag(120)) { _slaveButton._state = 1; _slaveButton.setFrame(2); } - if (_globals->getFlag(119)) { + if (g_globals->getFlag(119)) { _masterButton._state = 1; _masterButton.setFrame(2); } - if (_globals->getFlag(121)) { + if (g_globals->getFlag(121)) { _controlButton.animate(ANIM_MODE_2, NULL); _redLights.postInit(); @@ -2403,7 +2403,7 @@ void Scene60::postInit(SceneObjectList *OwnerList) { _soundHandler1.play(35); - if (!_globals->getFlag(83)) { + if (!g_globals->getFlag(83)) { _message.postInit(); _message.setVisage(60); _message.setStrip2(3); @@ -2411,24 +2411,24 @@ void Scene60::postInit(SceneObjectList *OwnerList) { _message.setPosition(Common::Point(148, 85)); _message.animate(ANIM_MODE_2, NULL); _message._numFrames = 5; - _globals->_sceneItems.push_front(&_message); + g_globals->_sceneItems.push_front(&_message); _soundHandler2.play(38); } } } - _globals->_sceneItems.addItems(&_item3, &_item4, &_item5, &_item6, + g_globals->_sceneItems.addItems(&_item3, &_item4, &_item5, &_item6, &_item1, &_item2, NULL); } void Scene60::signal() { if (_sceneMode != 0) { if (_sceneMode == 9998) { - _globals->_events.setCursor(CURSOR_USE); + g_globals->_events.setCursor(CURSOR_USE); } else if (_sceneMode == 9999) { - _globals->_player._uiEnabled = true; - _globals->_events.setCursor(CURSOR_USE); + g_globals->_player._uiEnabled = true; + g_globals->_events.setCursor(CURSOR_USE); _gfxButton.setText(EXIT_MSG); _gfxButton._bounds.center(160, 193); @@ -2436,7 +2436,7 @@ void Scene60::signal() { _gfxButton._bounds.expandPanes(); } else { SceneItem::display2(60, _sceneMode); - _globals->_events.setCursor(CURSOR_USE); + g_globals->_events.setCursor(CURSOR_USE); } } } @@ -2446,7 +2446,7 @@ void Scene60::process(Event &event) { if (_screenNumber == 60) { if (_gfxButton.process(event)) - _globals->_sceneManager.changeScene(50); + g_globals->_sceneManager.changeScene(50); } } @@ -2456,15 +2456,15 @@ void Scene60::process(Event &event) { *--------------------------------------------------------------------------*/ void Scene90::Action1::signal() { - Scene90 *scene = (Scene90 *)_globals->_sceneManager._scene; + Scene90 *scene = (Scene90 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: setDelay(10); break; case 1: - _globals->_scenePalette.addRotation(64, 72, -1); - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_scenePalette.addRotation(64, 72, -1); + g_globals->_events.setCursor(CURSOR_WALK); scene->_stripManager.start(90, this); break; case 2: @@ -2486,17 +2486,17 @@ void Scene90::Action1::signal() { if (scene->_stripManager._field2E8 == 220) scene->_stripManager.start(91, this, scene); else { - scene->_stripManager.start(_globals->getFlag(104) ? 93 : 92, this, scene); + scene->_stripManager.start(g_globals->getFlag(104) ? 93 : 92, this, scene); _actionIndex = 7; } break; case 6: scene->_object2.animate(ANIM_MODE_NONE); - _globals->_player._uiEnabled = true; + g_globals->_player._uiEnabled = true; break; case 7: scene->_object2.animate(ANIM_MODE_NONE); - _globals->_soundHandler.play(56); + g_globals->_soundHandler.play(56); scene->_object3.animate(ANIM_MODE_5, this); break; case 8: { @@ -2518,7 +2518,7 @@ void Scene90::Action1::signal() { PlayerMover2 *mover = new PlayerMover2(); scene->_object1.addMover(mover, 10, 15, &scene->_object5); - if (!_globals->getFlag(104)) { + if (!g_globals->getFlag(104)) { mover = new PlayerMover2(); scene->_object4.addMover(mover, 10, 15, &scene->_object1); } @@ -2526,17 +2526,17 @@ void Scene90::Action1::signal() { break; } case 11: - _globals->_soundHandler.play(57); - _globals->_soundHandler.play(68); + g_globals->_soundHandler.play(57); + g_globals->_soundHandler.play(68); scene->_object3.animate(ANIM_MODE_6, NULL); - SceneItem::display(90, _globals->getFlag(104) ? 15 : 14, + SceneItem::display(90, g_globals->getFlag(104) ? 15 : 14, SET_EXT_BGCOLOR, 13, SET_KEEP_ONSCREEN, -1, SET_X, 120, SET_Y, 20, LIST_END); break; case 12: SceneItem::display(0, 0); - _globals->_scenePalette.clearListeners(); - _globals->_sceneManager.changeScene(95); + g_globals->_scenePalette.clearListeners(); + g_globals->_sceneManager.changeScene(95); break; } } @@ -2544,14 +2544,14 @@ void Scene90::Action1::signal() { /*--------------------------------------------------------------------------*/ void Scene90::Object1::doAction(int action) { - Scene90 *scene = (Scene90 *)_globals->_sceneManager._scene; + Scene90 *scene = (Scene90 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(90, 7); break; case CURSOR_USE: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 97; setAction(&scene->_sequenceManager, scene, 97, this, NULL); break; @@ -2562,12 +2562,12 @@ void Scene90::Object1::doAction(int action) { } void Scene90::Object2::doAction(int action) { - Scene90 *scene = (Scene90 *)_globals->_sceneManager._scene; + Scene90 *scene = (Scene90 *)g_globals->_sceneManager._scene; switch (action) { case OBJECT_STUNNER: case CURSOR_USE: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_object6.postInit(); scene->_object6.setVisage(90); scene->_object6.setStrip(6); @@ -2583,7 +2583,7 @@ void Scene90::Object2::doAction(int action) { SceneItem::display2(90, 8); break; case CURSOR_TALK: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setAction(&scene->_sequenceManager, scene, 96, this, NULL); break; default: @@ -2604,7 +2604,7 @@ Scene90::Scene90() : } void Scene90::stripCallback(int v) { - Scene90 *scene = (Scene90 *)_globals->_sceneManager._scene; + Scene90 *scene = (Scene90 *)g_globals->_sceneManager._scene; if (v == 1) scene->_object2.animate(ANIM_MODE_7, NULL); @@ -2635,7 +2635,7 @@ void Scene90::postInit(SceneObjectList *OwnerList) { _object5._moveDiff = Common::Point(22, 22); _object5.setPosition(Common::Point(151, 177)); _object5.changeZoom(-1); - _globals->_sceneItems.push_back(&_object5); + g_globals->_sceneItems.push_back(&_object5); _object1.postInit(); _object1.setVisage(2337); @@ -2644,9 +2644,9 @@ void Scene90::postInit(SceneObjectList *OwnerList) { _object1._moveDiff = Common::Point(20, 20); _object1.setPosition(Common::Point(212, 183)); _object1.changeZoom(-1); - _globals->_sceneItems.push_back(&_object1); + g_globals->_sceneItems.push_back(&_object1); - if (!_globals->getFlag(104)) { + if (!g_globals->getFlag(104)) { _object4.postInit(); _object4.setVisage(2331); _object4.setObjectWrapper(new SceneObjectWrapper()); @@ -2654,7 +2654,7 @@ void Scene90::postInit(SceneObjectList *OwnerList) { _object4._moveDiff = Common::Point(20, 20); _object4.setPosition(Common::Point(251, 207)); _object4.changeZoom(-1); - _globals->_sceneItems.push_back(&_object4); + g_globals->_sceneItems.push_back(&_object4); } _object2.postInit(); @@ -2662,17 +2662,17 @@ void Scene90::postInit(SceneObjectList *OwnerList) { _object2.animate(ANIM_MODE_1, NULL); _object2.setPosition(Common::Point(315, 185)); _object2._strip = 2; - _globals->_sceneItems.push_back(&_object2); + g_globals->_sceneItems.push_back(&_object2); _object3.postInit(); _object3.setVisage(90); _object3.animate(ANIM_MODE_1, NULL); _object3.setPosition(Common::Point(196, 181)); _object3.fixPriority(175); - _globals->_sceneItems.push_back(&_object3); + g_globals->_sceneItems.push_back(&_object3); - _globals->_player.disableControl(); - _globals->_soundHandler.play(55); + g_globals->_player.disableControl(); + g_globals->_soundHandler.play(55); _soundHandler1.play(52); _soundHandler1.holdAt(true); @@ -2682,21 +2682,21 @@ void Scene90::postInit(SceneObjectList *OwnerList) { _item1.setBounds(Rect(271, 65, 271, 186)); _item2.setBounds(Rect(0, 17, 124, 77)); - _globals->_sceneItems.addItems(&_item1, &_item2, &_item3, NULL); + g_globals->_sceneItems.addItems(&_item1, &_item2, &_item3, NULL); } void Scene90::signal() { switch (_sceneMode) { case 91: _sceneMode = 92; - _globals->_soundHandler.play(77, this); + g_globals->_soundHandler.play(77, this); break; case 92: - _globals->_scenePalette.clearListeners(); - _globals->_game->endGame(90, 6); + g_globals->_scenePalette.clearListeners(); + g_globals->_game->endGame(90, 6); break; case 96: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; case 97: _stripManager._field2E8 = 0; @@ -2714,7 +2714,7 @@ void Scene90::signal() { *--------------------------------------------------------------------------*/ void Scene95::Action1::signal() { - Scene95 *scene = (Scene95 *)_globals->_sceneManager._scene; + Scene95 *scene = (Scene95 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -2739,7 +2739,7 @@ void Scene95::Action1::signal() { Common::Point pt1(5, 198); NpcMover *mover1 = new NpcMover(); - _globals->_player.addMover(mover1, &pt1, this); + g_globals->_player.addMover(mover1, &pt1, this); Common::Point pt2(9, 190); NpcMover *mover2 = new NpcMover(); @@ -2751,7 +2751,7 @@ void Scene95::Action1::signal() { Common::Point pt1(235, 72); PlayerMover *mover1 = new PlayerMover(); - _globals->_player.addMover(mover1, &pt1, NULL); + g_globals->_player.addMover(mover1, &pt1, NULL); Common::Point pt2(235, 72); PlayerMover *mover2 = new PlayerMover(); @@ -2782,8 +2782,8 @@ void Scene95::Action1::signal() { break; case 7: { SceneItem::display(0, 0); - _globals->_player.setVisage(92); - _globals->_player.setPosition(Common::Point(-25, 200)); + g_globals->_player.setVisage(92); + g_globals->_player.setPosition(Common::Point(-25, 200)); scene->_object1.setVisage(91); scene->_object1.setPosition(Common::Point(-22, 220)); @@ -2791,7 +2791,7 @@ void Scene95::Action1::signal() { Common::Point pt1(5, 198); NpcMover *mover1 = new NpcMover(); - _globals->_player.addMover(mover1, &pt1, this); + g_globals->_player.addMover(mover1, &pt1, this); Common::Point pt2(9, 190); NpcMover *mover2 = new NpcMover(); @@ -2801,7 +2801,7 @@ void Scene95::Action1::signal() { case 8: { Common::Point pt1(108, 112); PlayerMover *mover1 = new PlayerMover(); - _globals->_player.addMover(mover1, &pt1, this); + g_globals->_player.addMover(mover1, &pt1, this); Common::Point pt2(108, 112); PlayerMover *mover2 = new PlayerMover(); @@ -2809,7 +2809,7 @@ void Scene95::Action1::signal() { break; } case 9: - _globals->_sceneManager.changeScene(2300); + g_globals->_sceneManager.changeScene(2300); break; } } @@ -2824,14 +2824,14 @@ void Scene95::postInit(SceneObjectList *OwnerList) { Scene::postInit(); setZoomPercents(100, 10, 200, 100); - _globals->_player.postInit(); - _globals->_player.setVisage(2337); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player._strip = 4; - _globals->_player._moveDiff = Common::Point(30, 30); - _globals->_player.setPosition(Common::Point(-35, 200)); - _globals->_player.changeZoom(-1); - _globals->_player.disableControl(); + g_globals->_player.postInit(); + g_globals->_player.setVisage(2337); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player._strip = 4; + g_globals->_player._moveDiff = Common::Point(30, 30); + g_globals->_player.setPosition(Common::Point(-35, 200)); + g_globals->_player.changeZoom(-1); + g_globals->_player.disableControl(); _object1.postInit(); _object1.setVisage(2333); @@ -2855,7 +2855,7 @@ void Scene95::postInit(SceneObjectList *OwnerList) { *--------------------------------------------------------------------------*/ void Scene6100::Action1::signal() { - Scene6100 *scene = (Scene6100 *)_globals->_sceneManager._scene; + Scene6100 *scene = (Scene6100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -2872,7 +2872,7 @@ void Scene6100::Action1::signal() { } void Scene6100::Action2::signal() { - Scene6100 *scene = (Scene6100 *)_globals->_sceneManager._scene; + Scene6100 *scene = (Scene6100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -2889,7 +2889,7 @@ void Scene6100::Action2::signal() { } void Scene6100::Action3::signal() { - Scene6100 *scene = (Scene6100 *)_globals->_sceneManager._scene; + Scene6100 *scene = (Scene6100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -2897,9 +2897,9 @@ void Scene6100::Action3::signal() { setDelay(60); break; case 1: - _globals->_scenePalette.clearListeners(); + g_globals->_scenePalette.clearListeners(); scene->_fadePercent = 100; - _globals->_scenePalette.refresh(); + g_globals->_scenePalette.refresh(); scene->loadScene(9997); scene->_object1.hide(); scene->_object2.hide(); @@ -2910,7 +2910,7 @@ void Scene6100::Action3::signal() { scene->_rocks.hide(); scene->_sceneText.hide(); - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_events.setCursor(CURSOR_WALK); scene->_stripManager.start(8120, this); break; case 2: @@ -2918,12 +2918,12 @@ void Scene6100::Action3::signal() { break; case 3: scene->showMessage(NULL, 0, NULL); - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_events.setCursor(CURSOR_WALK); scene->_stripManager.start(8130, this); break; case 4: - _globals->setFlag(76); - _globals->_sceneManager.changeScene( + g_globals->setFlag(76); + g_globals->_sceneManager.changeScene( (scene->_stripManager._field2E8 == 135) ? 6100 : 2320); remove(); break; @@ -2931,7 +2931,7 @@ void Scene6100::Action3::signal() { } void Scene6100::Action4::signal() { - Scene6100 *scene = (Scene6100 *)_globals->_sceneManager._scene; + Scene6100 *scene = (Scene6100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -2948,7 +2948,7 @@ void Scene6100::Action4::signal() { } void Scene6100::Action5::dispatch() { - Scene6100 *scene = (Scene6100 *)_globals->_sceneManager._scene; + Scene6100 *scene = (Scene6100 *)g_globals->_sceneManager._scene; FloatSet zeroSet; const double MULTIPLY_FACTOR = 0.01744; // 2 * pi / 360 @@ -2998,9 +2998,9 @@ void Scene6100::Action5::dispatch() { if (idx != 3) { scene->_objList[idx]->_floats._float1 = - _globals->_randomSource.getRandomNumber(199); + g_globals->_randomSource.getRandomNumber(199); scene->_objList[idx]->_floats._float2 = - _globals->_randomSource.getRandomNumber(999) + 750.0; + g_globals->_randomSource.getRandomNumber(999) + 750.0; scene->_objList[idx]->_floats.proc1( -(scene->_turnAmount * 10 + scene->_angle) * MULTIPLY_FACTOR); @@ -3022,34 +3022,34 @@ void Scene6100::Action5::dispatch() { scene->_soundHandler.play(233); scene->showMessage(NULL, 0, NULL); - if (!_globals->getFlag(76)) + if (!g_globals->getFlag(76)) scene->_probe.setAction(&scene->_action1); break; case 1: scene->_soundHandler.play(233); scene->showMessage(NULL, 0, NULL); - if (!_globals->getFlag(76)) + if (!g_globals->getFlag(76)) scene->_probe.setAction(&scene->_action2); break; case 2: scene->_soundHandler.play(234); scene->showMessage(NULL, 0, NULL); - if (!_globals->getFlag(76)) + if (!g_globals->getFlag(76)) scene->_probe.setAction(NULL); scene->setAction(&scene->_action3); break; } - _globals->_scenePalette.clearListeners(); + g_globals->_scenePalette.clearListeners(); scene->_fadePercent = 0; } } } void Scene6100::GetBoxAction::signal() { - Scene6100 *scene = (Scene6100 *)_globals->_sceneManager._scene; + Scene6100 *scene = (Scene6100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: { @@ -3062,7 +3062,7 @@ void Scene6100::GetBoxAction::signal() { } case 1: { scene->showMessage(SCENE6100_TAKE_CONTROLS, 35, this); - _globals->_scenePalette.clearListeners(); + g_globals->_scenePalette.clearListeners(); Common::Point pt(scene->_rocks._position.x, scene->_rocks._position.y - 10); NpcMover *mover = new NpcMover(); @@ -3081,13 +3081,13 @@ void Scene6100::GetBoxAction::signal() { break; case 5: scene->showMessage(NULL, 0, NULL); - _globals->_sceneManager.changeScene(2320); + g_globals->_sceneManager.changeScene(2320); remove(); } } void Scene6100::GetBoxAction::dispatch() { - Scene6100 *scene = (Scene6100 *)_globals->_sceneManager._scene; + Scene6100 *scene = (Scene6100 *)g_globals->_sceneManager._scene; if (!scene->_probe._mover && (scene->_getBoxAction._actionIndex >= 1)) { if (scene->_getBoxAction._actionIndex == 1) { @@ -3113,7 +3113,7 @@ void Scene6100::Action7::signal() { setDelay(90); break; case 2: - _globals->_sceneManager.changeScene(2100); + g_globals->_sceneManager.changeScene(2100); remove(); break; } @@ -3134,7 +3134,7 @@ void Scene6100::Object::synchronize(Serializer &s) { /*--------------------------------------------------------------------------*/ void Scene6100::ProbeMover::dispatch() { - Scene6100 *scene = (Scene6100 *)_globals->_sceneManager._scene; + Scene6100 *scene = (Scene6100 *)g_globals->_sceneManager._scene; if (!dontMove()) { if (scene->_speed > 0) { @@ -3168,10 +3168,10 @@ Scene6100::Scene6100(): Scene() { _angle = 0; _msgActive = false; - _globals->_sceneHandler->_delayTicks = 8; + g_globals->_sceneHandler->_delayTicks = 8; - _globals->_player.disableControl(); - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_player.disableControl(); + g_globals->_events.setCursor(CURSOR_WALK); } void Scene6100::synchronize(Serializer &s) { @@ -3240,10 +3240,10 @@ void Scene6100::postInit(SceneObjectList *OwnerList) { int baseVal = 2000; for (int idx = 0; idx < 3; ++idx) { - _objList[idx]->_floats._float1 = _globals->_randomSource.getRandomNumber(999); + _objList[idx]->_floats._float1 = g_globals->_randomSource.getRandomNumber(999); _objList[idx]->_floats._float2 = baseVal; _objList[idx]->_floats._float3 = 0.0; - baseVal += _globals->_randomSource.getRandomNumber(499); + baseVal += g_globals->_randomSource.getRandomNumber(499); _objList[idx]->postInit(); _objList[idx]->setVisage(6100); @@ -3251,23 +3251,23 @@ void Scene6100::postInit(SceneObjectList *OwnerList) { _objList[idx]->_strip = 2; _objList[idx]->setPosition(Common::Point( - _globals->_randomSource.getRandomNumber(319), 60)); + g_globals->_randomSource.getRandomNumber(319), 60)); _objList[idx]->fixPriority(1); _objList[idx]->changeZoom(-1); } setAction(&_action5); - _globals->_scenePalette.addRotation(96, 143, -1); + g_globals->_scenePalette.addRotation(96, 143, -1); - if (!_globals->getFlag(76)) + if (!g_globals->getFlag(76)) _probe.setAction(&_action4); - _globals->_soundHandler.play(231); + g_globals->_soundHandler.play(231); } void Scene6100::remove() { - _globals->_player.disableControl(); - _globals->_scenePalette.clearListeners(); + g_globals->_player.disableControl(); + g_globals->_scenePalette.clearListeners(); Scene::remove(); } @@ -3294,18 +3294,18 @@ void Scene6100::dispatch() { _probe._action->dispatch(); // Handle mouse controlling the turning - int changeAmount = (_globals->_events._mousePos.x - 160) / -20; + int changeAmount = (g_globals->_events._mousePos.x - 160) / -20; _turnAmount += (changeAmount - _turnAmount) / 2; if (_fadePercent < 100) { _fadePercent += 10; if (_fadePercent >= 100) { - _globals->_scenePalette.addRotation(96, 143, -1); + g_globals->_scenePalette.addRotation(96, 143, -1); _fadePercent = 100; } byte adjustData[] = {0xff, 0xff, 0xff, 0}; - _globals->_scenePalette.fade(adjustData, false, _fadePercent); + g_globals->_scenePalette.fade(adjustData, false, _fadePercent); } if (_action != &_action3) { diff --git a/engines/tsage/ringworld/ringworld_scenes10.cpp b/engines/tsage/ringworld/ringworld_scenes10.cpp index fdb0532cb7..9a9f63705b 100644 --- a/engines/tsage/ringworld/ringworld_scenes10.cpp +++ b/engines/tsage/ringworld/ringworld_scenes10.cpp @@ -37,17 +37,17 @@ Scene2::Scene2() : Scene() { /*--------------------------------------------------------------------------*/ void Object9350::postInit(SceneObjectList *OwnerList) { - //SceneObject::postInit(&_globals->_sceneManager._bgSceneObjects); + //SceneObject::postInit(&g_globals->_sceneManager._bgSceneObjects); SceneObject::postInit(OwnerList); } void Object9350::draw() { reposition(); Rect destRect = _bounds; - destRect.translate(-_globals->_sceneOffset.x, -_globals->_sceneOffset.y); - Region *priorityRegion = _globals->_sceneManager._scene->_priorities.find(_globals->_sceneManager._scene->_stripManager._stripNum); + destRect.translate(-g_globals->_sceneOffset.x, -g_globals->_sceneOffset.y); + Region *priorityRegion = g_globals->_sceneManager._scene->_priorities.find(g_globals->_sceneManager._scene->_stripManager._stripNum); GfxSurface frame = getFrame(); - _globals->gfxManager().copyFrom(frame, destRect, priorityRegion); + g_globals->gfxManager().copyFrom(frame, destRect, priorityRegion); } /*-------------------------------------------------------------------------- @@ -55,37 +55,37 @@ void Object9350::draw() { * *--------------------------------------------------------------------------*/ void Scene9100::SceneHotspot1::doAction(int action) { - Scene9100 *scene = (Scene9100 *)_globals->_sceneManager._scene; + Scene9100 *scene = (Scene9100 *)g_globals->_sceneManager._scene; if (action == CURSOR_TALK) { - if (_globals->getFlag(23)) { - _globals->_player.disableControl(); + if (g_globals->getFlag(23)) { + g_globals->_player.disableControl(); scene->_sceneMode = 9104; } else { - _globals->setFlag(23); - _globals->_player.disableControl(); + g_globals->setFlag(23); + g_globals->_player.disableControl(); scene->_sceneMode = 9105; } - scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &_globals->_player, &scene->_object5, &scene->_object6, NULL); + scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &g_globals->_player, &scene->_object5, &scene->_object6, NULL); } else { NamedHotspot::doAction(action); } } void Scene9100::dispatch() { - Scene9100 *scene = (Scene9100 *)_globals->_sceneManager._scene; + Scene9100 *scene = (Scene9100 *)g_globals->_sceneManager._scene; if (!_action) { - if (_globals->_player._position.x < 25) { - _globals->_player.disableControl(); - if (!_globals->getFlag(23) || _globals->getFlag(11)) + if (g_globals->_player._position.x < 25) { + g_globals->_player.disableControl(); + if (!g_globals->getFlag(23) || g_globals->getFlag(11)) _sceneMode = 9106; else { _sceneMode = 9108; - _globals->setFlag(11); + g_globals->setFlag(11); } - scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &_globals->_player, NULL); + scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &g_globals->_player, NULL); } } else { Scene::dispatch(); @@ -93,13 +93,13 @@ void Scene9100::dispatch() { } void Scene9100::signal() { - Scene9100 *scene = (Scene9100 *)_globals->_sceneManager._scene; + Scene9100 *scene = (Scene9100 *)g_globals->_sceneManager._scene; switch (scene->_sceneMode) { case 9102: case 9106: case 9108: - _globals->_sceneManager.changeScene(9150); + g_globals->_sceneManager.changeScene(9150); break; case 9105: _sceneHotspot3.remove(); @@ -109,7 +109,7 @@ void Scene9100::signal() { case 9107: case 9109: default: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; } } @@ -125,7 +125,7 @@ void Scene9100::postInit(SceneObjectList *OwnerList) { _object1.animate(ANIM_MODE_2, NULL); _object1.fixPriority(10); - _globals->_player.postInit(); + g_globals->_player.postInit(); _object2.postInit(); _object2.hide(); @@ -139,7 +139,7 @@ void Scene9100::postInit(SceneObjectList *OwnerList) { _object5.postInit(); _object5.hide(); - if (!_globals->getFlag(23)) { + if (!g_globals->getFlag(23)) { _object6.postInit(); _object6.setVisage(9111); _object6.setStrip(6); @@ -153,25 +153,25 @@ void Scene9100::postInit(SceneObjectList *OwnerList) { _sceneHotspot5.setDetails(69, 36, 121, 272, 9100, 45, 46); _sceneHotspot6.setDetails(127, 0, 200, 52, 9100, 47, 48); - _globals->_soundHandler.play(251); - if (_globals->_sceneManager._previousScene == 9150) { - if (_globals->getFlag(20)) { - _globals->_player.disableControl(); - if (_globals->getFlag(11)) + g_globals->_soundHandler.play(251); + if (g_globals->_sceneManager._previousScene == 9150) { + if (g_globals->getFlag(20)) { + g_globals->_player.disableControl(); + if (g_globals->getFlag(11)) _sceneMode = 9107; else _sceneMode = 9109; - setAction(&_sequenceManager, this, _sceneMode, &_globals->_player, &_object5, NULL); + setAction(&_sequenceManager, this, _sceneMode, &g_globals->_player, &_object5, NULL); } else { _sceneMode = 9103; - _globals->_player.disableControl(); - setAction(&_sequenceManager, this, _sceneMode, &_globals->_player, &_object2, &_object3, &_object4, &_object5, NULL); - _globals->setFlag(20); + g_globals->_player.disableControl(); + setAction(&_sequenceManager, this, _sceneMode, &g_globals->_player, &_object2, &_object3, &_object4, &_object5, NULL); + g_globals->setFlag(20); } } else { _sceneMode = 9102; - _globals->_player.disableControl(); - setAction(&_sequenceManager, this, _sceneMode, &_globals->_player, &_object2, &_object3, &_object4, &_object5, NULL); + g_globals->_player.disableControl(); + setAction(&_sequenceManager, this, _sceneMode, &g_globals->_player, &_object2, &_object3, &_object4, &_object5, NULL); } } @@ -182,7 +182,7 @@ void Scene9100::postInit(SceneObjectList *OwnerList) { void Scene9150::Object3::signal() { switch (_signalFlag++) { case 0: - _timer = 10 + _globals->_randomSource.getRandomNumber(90); + _timer = 10 + g_globals->_randomSource.getRandomNumber(90); break; default: animate(ANIM_MODE_5, this); @@ -201,15 +201,15 @@ void Scene9150::signal() { switch (_sceneMode) { case 9151: case 9157: - _globals->_sceneManager.changeScene(9100); + g_globals->_sceneManager.changeScene(9100); break; case 9153: - _globals->_sceneManager.changeScene(9300); + g_globals->_sceneManager.changeScene(9300); break; case 9152: case 9155: case 9156: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; case 9154: default: @@ -229,21 +229,21 @@ void Scene9150::dispatch() { if (_action) { _action->dispatch(); } else { - if (_globals->_player._position.x >= 160) { - if (_globals->_player._position.x > 630) { - _globals->_player.disableControl(); + if (g_globals->_player._position.x >= 160) { + if (g_globals->_player._position.x > 630) { + g_globals->_player.disableControl(); _sceneMode = 9157; - setAction(&_sequenceManager1, this, _sceneMode, &_globals->_player, NULL); + setAction(&_sequenceManager1, this, _sceneMode, &g_globals->_player, NULL); } } else { - _globals->_player.disableControl(); - if (_globals->getFlag(11)) { - _globals->_soundHandler.play(286); + g_globals->_player.disableControl(); + if (g_globals->getFlag(11)) { + g_globals->_soundHandler.play(286); _sceneMode = 9153; } else { _sceneMode = 9156; } - setAction(&_sequenceManager1, this, _sceneMode, &_globals->_player, NULL); + setAction(&_sequenceManager1, this, _sceneMode, &g_globals->_player, NULL); } } } @@ -251,7 +251,7 @@ void Scene9150::dispatch() { void Scene9150::postInit(SceneObjectList *OwnerList) { Scene::postInit(); setZoomPercents(0, 100, 200, 100); - _globals->_player.postInit(); + g_globals->_player.postInit(); _object3.postInit(); _sceneState = 1; @@ -272,26 +272,26 @@ void Scene9150::postInit(SceneObjectList *OwnerList) { _sceneHotspot8.setDetails(133, 584, 142, 640, 9150, 57, -1); _sceneHotspot10.setDetails(83, 304, 103, 323, 9150, 58, 59); - _globals->_soundHandler.play(285); - _globals->_player.disableControl(); + g_globals->_soundHandler.play(285); + g_globals->_player.disableControl(); - if (_globals->getFlag(20)) { + if (g_globals->getFlag(20)) { // Walking alone - _globals->_scrollFollower = &_globals->_player; - if (_globals->getFlag(11)) + g_globals->_scrollFollower = &g_globals->_player; + if (g_globals->getFlag(11)) // Hero wearing peasan suit _sceneMode = 9155; else // Hero wearing Purple suit _sceneMode = 9152; - setAction(&_sequenceManager1, this, _sceneMode, &_globals->_player, NULL); + setAction(&_sequenceManager1, this, _sceneMode, &g_globals->_player, NULL); } else { // Walking with the tiger _sceneMode = 9151; _object2.postInit(); _object2.hide(); _object1.postInit(); - setAction(&_sequenceManager1, this, _sceneMode, &_globals->_player, &_object1, &_object2, NULL); + setAction(&_sequenceManager1, this, _sceneMode, &g_globals->_player, &_object1, &_object2, NULL); } } @@ -300,22 +300,22 @@ void Scene9150::postInit(SceneObjectList *OwnerList) { * *--------------------------------------------------------------------------*/ void Scene9200::SceneHotspot1::doAction(int action) { - Scene9200 *scene = (Scene9200 *)_globals->_sceneManager._scene; + Scene9200 *scene = (Scene9200 *)g_globals->_sceneManager._scene; if (action == OBJECT_TUNIC) { - _globals->_player.disableControl(); - if (_globals->getFlag(93)) { + g_globals->_player.disableControl(); + if (g_globals->getFlag(93)) { scene->_sceneState = 9214; - scene->setAction(&scene->_sequenceManager, scene, 9214, &_globals->_player, &scene->_object2, NULL); + scene->setAction(&scene->_sequenceManager, scene, 9214, &g_globals->_player, &scene->_object2, NULL); } else { - _globals->setFlag(93); + g_globals->setFlag(93); scene->_sceneState = 9213; - scene->setAction(&scene->_sequenceManager, scene, 9213, &_globals->_player, &scene->_object2, NULL); + scene->setAction(&scene->_sequenceManager, scene, 9213, &g_globals->_player, &scene->_object2, NULL); } } else if (action <= 100) { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneState = 9214; - scene->setAction(&scene->_sequenceManager, scene, 9214, &_globals->_player, &scene->_object2, NULL); + scene->setAction(&scene->_sequenceManager, scene, 9214, &g_globals->_player, &scene->_object2, NULL); } else { NamedHotspot::doAction(action); } @@ -324,15 +324,15 @@ void Scene9200::SceneHotspot1::doAction(int action) { void Scene9200::signal() { switch (_sceneState++) { case 9207: - _globals->_sceneManager.changeScene(9700); + g_globals->_sceneManager.changeScene(9700); break; case 9208: case 9211: case 9212: - _globals->_sceneManager.changeScene(9500); + g_globals->_sceneManager.changeScene(9500); break; case 9209: - _globals->_sceneManager.changeScene(9360); + g_globals->_sceneManager.changeScene(9360); break; case 9210: _hotspot1.remove(); @@ -344,7 +344,7 @@ void Scene9200::signal() { case 9205: case 9206: default: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; } } @@ -360,30 +360,30 @@ void Scene9200::dispatch() { if (_action) { _action->dispatch(); } else { - if ( (_globals->_player._position.x <= 0) || ((_globals->_player._position.x < 100) && (_globals->_player._position.y > 199))) { - _globals->_player.disableControl(); + if ( (g_globals->_player._position.x <= 0) || ((g_globals->_player._position.x < 100) && (g_globals->_player._position.y > 199))) { + g_globals->_player.disableControl(); _sceneState = 9209; - setAction(&_sequenceManager, this, 9209, &_globals->_player, &_object2, &_object3, NULL); + setAction(&_sequenceManager, this, 9209, &g_globals->_player, &_object2, &_object3, NULL); } else { - if (rect9200.contains(_globals->_player._position)) { - if (_globals->getFlag(93)) { - if (_globals->getFlag(86)) { + if (rect9200.contains(g_globals->_player._position)) { + if (g_globals->getFlag(93)) { + if (g_globals->getFlag(86)) { _sceneState = 9215; - setAction(&_sequenceManager, this, 9215, &_globals->_player, &_object2, &_object3, NULL); + setAction(&_sequenceManager, this, 9215, &g_globals->_player, &_object2, &_object3, NULL); } else { _sceneState = 9208; - setAction(&_sequenceManager, this, 9208, &_globals->_player, &_object2, &_object3, NULL); + setAction(&_sequenceManager, this, 9208, &g_globals->_player, &_object2, &_object3, NULL); } } else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneState = 9204; - setAction(&_sequenceManager, this, 9204, &_globals->_player, &_object2, &_object3, NULL); + setAction(&_sequenceManager, this, 9204, &g_globals->_player, &_object2, &_object3, NULL); } } else { - if (_globals->_player._position.y < 140) { - _globals->_player.disableControl(); + if (g_globals->_player._position.y < 140) { + g_globals->_player.disableControl(); _sceneState = 9207; - setAction(&_sequenceManager, this, 9207, &_globals->_player, &_object2, &_object3, NULL); + setAction(&_sequenceManager, this, 9207, &g_globals->_player, &_object2, &_object3, NULL); } } } @@ -394,7 +394,7 @@ void Scene9200::postInit(SceneObjectList *OwnerList) { Scene::postInit(); setZoomPercents(130, 50, 200, 150); - _globals->_player.postInit(); + g_globals->_player.postInit(); _object3.postInit(); _object3.hide(); _object1.postInit(); @@ -410,7 +410,7 @@ void Scene9200::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_speakerGR); _stripManager.addSpeaker(&_speakerGText); - if (!_globals->getFlag(86)) { + if (!g_globals->getFlag(86)) { _object2.postInit(); _hotspot1.setDetails(96, 194, 160, 234, 9200, 29, 31); } @@ -422,51 +422,51 @@ void Scene9200::postInit(SceneObjectList *OwnerList) { _hotspot7.setDetails(107, 262, 153, 286, 9200, 10, 11); _hotspot8.setDetails(69, 276, 164, 320, 9200, 12, 13); - _globals->_events.setCursor(CURSOR_WALK); - _globals->_player.disableControl(); + g_globals->_events.setCursor(CURSOR_WALK); + g_globals->_player.disableControl(); - switch (_globals->_sceneManager._previousScene) { + switch (g_globals->_sceneManager._previousScene) { case 9500: - if (_globals->getFlag(85)) { + if (g_globals->getFlag(85)) { if (RING_INVENTORY._helmet._sceneNumber == 1) { - _globals->setFlag(86); - _globals->_player.disableControl(); + g_globals->setFlag(86); + g_globals->_player.disableControl(); _sceneState = 9210; - setAction(&_sequenceManager, this, 9210, &_globals->_player, &_object2, &_object3, NULL); + setAction(&_sequenceManager, this, 9210, &g_globals->_player, &_object2, &_object3, NULL); } else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneState = 9212; - setAction(&_sequenceManager, this, 9212, &_globals->_player, &_object2, &_object3, NULL); + setAction(&_sequenceManager, this, 9212, &g_globals->_player, &_object2, &_object3, NULL); } } else { if (RING_INVENTORY._helmet._sceneNumber == 1) { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneState = 9211; - setAction(&_sequenceManager, this, 9211, &_globals->_player, &_object2, &_object3, NULL); + setAction(&_sequenceManager, this, 9211, &g_globals->_player, &_object2, &_object3, NULL); } else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneState = 9202; - setAction(&_sequenceManager, this, 9202, &_globals->_player, &_object2, &_object3, NULL); + setAction(&_sequenceManager, this, 9202, &g_globals->_player, &_object2, &_object3, NULL); } } break; case 9700: - if (_globals->getFlag(86)) { + if (g_globals->getFlag(86)) { _sceneState = 9206; - setAction(&_sequenceManager, this, 9206, &_globals->_player, &_object2, &_object3, NULL); + setAction(&_sequenceManager, this, 9206, &g_globals->_player, &_object2, &_object3, NULL); } else { _sceneState = 9203; - setAction(&_sequenceManager, this, 9203, &_globals->_player, &_object2, &_object3, NULL); + setAction(&_sequenceManager, this, 9203, &g_globals->_player, &_object2, &_object3, NULL); } break; case 9360: default: - if (_globals->getFlag(86)) { + if (g_globals->getFlag(86)) { _sceneState = 9205; - setAction(&_sequenceManager, this, 9205, &_globals->_player, &_object2, &_object3, NULL); + setAction(&_sequenceManager, this, 9205, &g_globals->_player, &_object2, &_object3, NULL); } else { _sceneState = 9201; - setAction(&_sequenceManager, this, 9201, &_globals->_player, &_object2, &_object3, NULL); + setAction(&_sequenceManager, this, 9201, &g_globals->_player, &_object2, &_object3, NULL); } break; } @@ -479,14 +479,14 @@ void Scene9200::postInit(SceneObjectList *OwnerList) { void Scene9300::signal() { switch (_sceneMode++) { case 9301: - _globals->setFlag(84); + g_globals->setFlag(84); // No break on purpose case 9303: - _globals->_soundHandler.play(295); - _globals->_sceneManager.changeScene(9350); + g_globals->_soundHandler.play(295); + g_globals->_sceneManager.changeScene(9350); break; case 9302: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; default: break; @@ -496,10 +496,10 @@ void Scene9300::signal() { void Scene9300::dispatch() { if (_action) { _action->dispatch(); - } else if (_globals->_player._position.y < 145) { - _globals->_player.disableControl(); + } else if (g_globals->_player._position.y < 145) { + g_globals->_player.disableControl(); _sceneMode = 9303; - setAction(&_sequenceManager, this, 9303, &_globals->_player, &_object1, &_object2, NULL); + setAction(&_sequenceManager, this, 9303, &g_globals->_player, &_object1, &_object2, NULL); } } @@ -508,11 +508,11 @@ void Scene9300::postInit(SceneObjectList *OwnerList) { setZoomPercents(130, 75, 230, 150); _sceneMode = 0; - _globals->_player.postInit(); - _globals->_player.changeZoom(-1); + g_globals->_player.postInit(); + g_globals->_player.changeZoom(-1); _object1.postInit(); _object2.postInit(); - _globals->_soundHandler.play(289); + g_globals->_soundHandler.play(289); _hotspot1.setDetails(35, 142, 76, 212, 9300, 0, 1); _hotspot2.setDetails(28, 90, 81, 143, 9300, 2, 3); @@ -528,14 +528,14 @@ void Scene9300::postInit(SceneObjectList *OwnerList) { _hotspot12.setDetails(0, 0, 94, 35, 9300, 22, 23); _hotspot13.setDetails(12, 268, 149, 320, 9300, 24, 25); - if (_globals->_sceneManager._previousScene == 9350) { - _globals->_player.disableControl(); + if (g_globals->_sceneManager._previousScene == 9350) { + g_globals->_player.disableControl(); _sceneMode = 9302; - setAction(&_sequenceManager, this, 9302, &_globals->_player, &_object1, &_object2, NULL); + setAction(&_sequenceManager, this, 9302, &g_globals->_player, &_object1, &_object2, NULL); } else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneMode = 9301; - setAction(&_sequenceManager, this, 9301, &_globals->_player, &_object1, &_object2, NULL); + setAction(&_sequenceManager, this, 9301, &g_globals->_player, &_object1, &_object2, NULL); } } @@ -550,17 +550,17 @@ void Scene9350::signal() { case 9352: case 9353: case 9354: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; case 9355: - _globals->_sceneManager.changeScene(9300); + g_globals->_sceneManager.changeScene(9300); break; case 9356: - _globals->_sceneManager.changeScene(9360); + g_globals->_sceneManager.changeScene(9360); break; case 9357: case 9359: - _globals->_sceneManager.changeScene(9400); + g_globals->_sceneManager.changeScene(9400); break; default: break; @@ -569,18 +569,18 @@ void Scene9350::signal() { void Scene9350::dispatch() { if (_action == 0) { - if ((_globals->_player._position.x > 300) && (_globals->_player._position.y < 160)) { - _globals->_player.disableControl(); + if ((g_globals->_player._position.x > 300) && (g_globals->_player._position.y < 160)) { + g_globals->_player.disableControl(); _sceneState = 9356; - setAction(&_sequenceManager, this, 9356, &_globals->_player, &_object2, NULL); - } else if ((_globals->_player._position.x > 110) && (_globals->_player._position.y >= 195)) { - _globals->_player.disableControl(); + setAction(&_sequenceManager, this, 9356, &g_globals->_player, &_object2, NULL); + } else if ((g_globals->_player._position.x > 110) && (g_globals->_player._position.y >= 195)) { + g_globals->_player.disableControl(); _sceneState = 9357; - setAction(&_sequenceManager, this, 9357, &_globals->_player, &_object2, NULL); - } else if ((_globals->_player._position.x < 10) || ((_globals->_player._position.x <= 110) && (_globals->_player._position.y >= 195))) { - _globals->_player.disableControl(); + setAction(&_sequenceManager, this, 9357, &g_globals->_player, &_object2, NULL); + } else if ((g_globals->_player._position.x < 10) || ((g_globals->_player._position.x <= 110) && (g_globals->_player._position.y >= 195))) { + g_globals->_player.disableControl(); _sceneState = 9355; - setAction(&_sequenceManager, this, 9355, &_globals->_player, &_object2, NULL); + setAction(&_sequenceManager, this, 9355, &g_globals->_player, &_object2, NULL); } } else { Scene::dispatch(); @@ -590,7 +590,7 @@ void Scene9350::dispatch() { void Scene9350::postInit(SceneObjectList *OwnerList) { Scene::postInit(); setZoomPercents(95, 80, 200, 100); - _globals->_player.postInit(); + g_globals->_player.postInit(); _object1.setup(9351, 1, 3, 139, 97, 0); _sceneHotspot1.setDetails(42, 0, 97, 60, 9350, 0, -1); @@ -599,28 +599,28 @@ void Scene9350::postInit(SceneObjectList *OwnerList) { _sceneHotspot4.setDetails(0, 308, 109, 320, 9350, 2, -1); _sceneHotspot5.setDetails(0, 0, 200, 320, 9350, 3, -1); - _globals->_events.setCursor(CURSOR_WALK); - _globals->_player.disableControl(); + g_globals->_events.setCursor(CURSOR_WALK); + g_globals->_player.disableControl(); - if (_globals->_sceneManager._previousScene == 9360) { - _globals->_player.disableControl(); + if (g_globals->_sceneManager._previousScene == 9360) { + g_globals->_player.disableControl(); _sceneState = 9352; - setAction(&_sequenceManager, this, 9352, &_globals->_player, &_object2, NULL); - } else if (_globals->_sceneManager._previousScene == 9400) { - _globals->_player.disableControl(); + setAction(&_sequenceManager, this, 9352, &g_globals->_player, &_object2, NULL); + } else if (g_globals->_sceneManager._previousScene == 9400) { + g_globals->_player.disableControl(); _sceneState = 9353; - setAction(&_sequenceManager, this, 9353, &_globals->_player, &_object2, NULL); + setAction(&_sequenceManager, this, 9353, &g_globals->_player, &_object2, NULL); } else { - if (_globals->getFlag(84)) { - _globals->clearFlag(84); + if (g_globals->getFlag(84)) { + g_globals->clearFlag(84); _object2.postInit(); - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneState = 9359; - setAction(&_sequenceManager, this, 9359, &_globals->_player, &_object2, NULL); + setAction(&_sequenceManager, this, 9359, &g_globals->_player, &_object2, NULL); } else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneState = 9354; - setAction(&_sequenceManager, this, 9354, &_globals->_player, &_object2, NULL); + setAction(&_sequenceManager, this, 9354, &g_globals->_player, &_object2, NULL); } } } @@ -636,16 +636,16 @@ void Scene9360::signal() { case 9362: case 9363: case 9364: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; case 9365: - _globals->_sceneManager.changeScene(9350); + g_globals->_sceneManager.changeScene(9350); break; case 9366: - _globals->_sceneManager.changeScene(9200); + g_globals->_sceneManager.changeScene(9200); break; case 9367: - _globals->_sceneManager.changeScene(9450); + g_globals->_sceneManager.changeScene(9450); break; default: break; @@ -654,18 +654,18 @@ void Scene9360::signal() { void Scene9360::dispatch() { if (_action == 0) { - if ((_globals->_player._position.x > 300) && (_globals->_player._position.y < 160)) { - _globals->_player.disableControl(); + if ((g_globals->_player._position.x > 300) && (g_globals->_player._position.y < 160)) { + g_globals->_player.disableControl(); _sceneState = 9366; - setAction(&_sequenceManager, this, 9366, &_globals->_player, NULL); - } else if ((_globals->_player._position.x > 110) && (_globals->_player._position.y >= 195)) { - _globals->_player.disableControl(); + setAction(&_sequenceManager, this, 9366, &g_globals->_player, NULL); + } else if ((g_globals->_player._position.x > 110) && (g_globals->_player._position.y >= 195)) { + g_globals->_player.disableControl(); _sceneState = 9367; - setAction(&_sequenceManager, this, 9367, &_globals->_player, NULL); - } else if ((_globals->_player._position.x < 10) || ((_globals->_player._position.x <= 110) && (_globals->_player._position.y >= 195))) { - _globals->_player.disableControl(); + setAction(&_sequenceManager, this, 9367, &g_globals->_player, NULL); + } else if ((g_globals->_player._position.x < 10) || ((g_globals->_player._position.x <= 110) && (g_globals->_player._position.y >= 195))) { + g_globals->_player.disableControl(); _sceneState = 9365; - setAction(&_sequenceManager, this, 9365, &_globals->_player, NULL); + setAction(&_sequenceManager, this, 9365, &g_globals->_player, NULL); } } else { Scene::dispatch(); @@ -675,7 +675,7 @@ void Scene9360::dispatch() { void Scene9360::postInit(SceneObjectList *OwnerList) { Scene::postInit(); setZoomPercents(95, 80, 200, 100); - _globals->_player.postInit(); + g_globals->_player.postInit(); _hotspot1.setDetails(37, 92, 93, 173, 9360, 0, 1); _hotspot2.setDetails(42, 0, 100, 63, 9360, 2, -1); @@ -685,20 +685,20 @@ void Scene9360::postInit(SceneObjectList *OwnerList) { _hotspot6.setDetails(35, 61, 103, 92, 9360, 4, -1); _hotspot7.setDetails(33, 174, 93, 207, 9360, 4, -1); _hotspot8.setDetails(28, 257, 149, 320, 9360, 4, -1); - _globals->_events.setCursor(CURSOR_WALK); - _globals->_player.disableControl(); - if (_globals->_sceneManager._previousScene == 9350) { - _globals->_player.disableControl(); + g_globals->_events.setCursor(CURSOR_WALK); + g_globals->_player.disableControl(); + if (g_globals->_sceneManager._previousScene == 9350) { + g_globals->_player.disableControl(); _sceneState = 9364; - setAction(&_sequenceManager, this, 9364, &_globals->_player, NULL); - } else if (_globals->_sceneManager._previousScene == 9450) { - _globals->_player.disableControl(); + setAction(&_sequenceManager, this, 9364, &g_globals->_player, NULL); + } else if (g_globals->_sceneManager._previousScene == 9450) { + g_globals->_player.disableControl(); _sceneState = 9363; - setAction(&_sequenceManager, this, 9363, &_globals->_player, NULL); + setAction(&_sequenceManager, this, 9363, &g_globals->_player, NULL); } else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneState = 9362; - setAction(&_sequenceManager, this, 9362, &_globals->_player, NULL); + setAction(&_sequenceManager, this, 9362, &g_globals->_player, NULL); } _object1.setup(9351, 1, 1, 131, 90, 0); } @@ -712,22 +712,22 @@ Scene9400::Scene9400() { } void Scene9400::SceneHotspot7::doAction(int action) { - Scene9400 *scene = (Scene9400 *)_globals->_sceneManager._scene; + Scene9400 *scene = (Scene9400 *)g_globals->_sceneManager._scene; if ((action == CURSOR_USE) && (RING_INVENTORY._straw._sceneNumber != 1)) { scene->_sceneState = 1; RING_INVENTORY._straw._sceneNumber = 1; - scene->setAction(&scene->_sequenceManager, scene, 9408, &_globals->_player, NULL); + scene->setAction(&scene->_sequenceManager, scene, 9408, &g_globals->_player, NULL); } else { NamedHotspot::doAction(action); } } void Scene9400::SceneHotspot8::doAction(int action) { - Scene9400 *scene = (Scene9400 *)_globals->_sceneManager._scene; + Scene9400 *scene = (Scene9400 *)g_globals->_sceneManager._scene; if (action == CURSOR_TALK) { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneState = 2; scene->signal(); } else { @@ -744,7 +744,7 @@ void Scene9400::signal() { case 1: _object1._numFrames = 6; _object1.animate(ANIM_MODE_2, NULL); - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; case 2: _object1.animate(ANIM_MODE_5, this); @@ -754,10 +754,10 @@ void Scene9400::signal() { break; case 4: _object1.animate(ANIM_MODE_2, this); - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; case 9350: - _globals->_sceneManager.changeScene(9350); + g_globals->_sceneManager.changeScene(9350); break; default: break; @@ -774,13 +774,13 @@ void Scene9400::dispatch() { _field1032 = 0; } if (_action == 0) { - if (_globals->_player._position.y < 120) { + if (g_globals->_player._position.y < 120) { _sceneState = 9350; - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setAction(&_action1); Common::Point pt(-45, 88); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); } } else { Scene::dispatch(); @@ -791,7 +791,7 @@ void Scene9400::postInit(SceneObjectList *OwnerList) { Scene::postInit(); _screenNumber = 9400; setZoomPercents(0, 100, 200, 100); - _globals->_player.postInit(); + g_globals->_player.postInit(); _object1.postInit(); _object3.postInit(); _speakerQText._textPos.x = 20; @@ -809,17 +809,17 @@ void Scene9400::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_speakerOR); _stripManager.addSpeaker(&_speakerOText); - _globals->_events.setCursor(CURSOR_WALK); - _globals->_player.disableControl(); + g_globals->_events.setCursor(CURSOR_WALK); + g_globals->_player.disableControl(); - // Useless check (skipped) : if (_globals->_sceneManager._previousScene == 9350) + // Useless check (skipped) : if (g_globals->_sceneManager._previousScene == 9350) _sceneState = 2; - if (!_globals->getFlag(89)) { - _globals->setFlag(89); + if (!g_globals->getFlag(89)) { + g_globals->setFlag(89); _sceneState = 0; } - setAction(&_sequenceManager, this, 9400, &_globals->_player, &_object1, &_object3, NULL); + setAction(&_sequenceManager, this, 9400, &g_globals->_player, &_object1, &_object3, NULL); } void Scene9400::synchronize(Serializer &s) { @@ -833,7 +833,7 @@ void Scene9400::synchronize(Serializer &s) { * *--------------------------------------------------------------------------*/ void Scene9450::Object2::signal() { - Scene9450 *scene = (Scene9450 *)_globals->_sceneManager._scene; + Scene9450 *scene = (Scene9450 *)g_globals->_sceneManager._scene; this->setAction(&scene->_sequenceManager3, this, 9458, this, &scene->_object1, NULL); } @@ -844,29 +844,29 @@ void Scene9450::Object3::dispatch() { } void Scene9450::Hotspot1::doAction(int action) { - Scene9450 *scene = (Scene9450 *)_globals->_sceneManager._scene; + Scene9450 *scene = (Scene9450 *)g_globals->_sceneManager._scene; if (action == CURSOR_USE) { if (scene->_object2._action) scene->_object2._action->remove(); scene->_sceneMode = 9459; - _globals->_player.disableControl(); - scene->setAction(&scene->_sequenceManager1, scene, 9459, &scene->_object2, &scene->_object1, &scene->_object3, &_globals->_player, NULL); + g_globals->_player.disableControl(); + scene->setAction(&scene->_sequenceManager1, scene, 9459, &scene->_object2, &scene->_object1, &scene->_object3, &g_globals->_player, NULL); } else { NamedHotspot::doAction(action); } } void Scene9450::Hotspot3::doAction(int action) { - Scene9450 *scene = (Scene9450 *)_globals->_sceneManager._scene; + Scene9450 *scene = (Scene9450 *)g_globals->_sceneManager._scene; switch (action) { case OBJECT_CLOAK: case OBJECT_JACKET: case OBJECT_TUNIC2: scene->_sceneMode = 9460; - _globals->_player.disableControl(); - scene->setAction(&scene->_sequenceManager1, scene, 9460, &_globals->_player, &scene->_object2, &scene->_object1, NULL); + g_globals->_player.disableControl(); + scene->setAction(&scene->_sequenceManager1, scene, 9460, &g_globals->_player, &scene->_object2, &scene->_object1, NULL); break; case OBJECT_TUNIC: SceneItem::display(9450, 49, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); @@ -883,14 +883,14 @@ void Scene9450::Hotspot3::doAction(int action) { if (scene->_object2._action) scene->_object2._action->remove(); scene->_sceneMode = 9459; - _globals->_player.disableControl(); - scene->setAction(&scene->_sequenceManager1, scene, 9459, &scene->_object2, &scene->_object1, &scene->_object3, &_globals->_player, NULL); + g_globals->_player.disableControl(); + scene->setAction(&scene->_sequenceManager1, scene, 9459, &scene->_object2, &scene->_object1, &scene->_object3, &g_globals->_player, NULL); } else if ((RING_INVENTORY._cloak._sceneNumber != 1) && (RING_INVENTORY._jacket._sceneNumber != 1) && (RING_INVENTORY._tunic2._sceneNumber != 1)) { SceneItem::display(9450, 38, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); } else { scene->_sceneMode = 9460; - _globals->_player.disableControl(); - scene->setAction(&scene->_sequenceManager1, scene, 9460, &_globals->_player, &scene->_object2, &scene->_object1, NULL); + g_globals->_player.disableControl(); + scene->setAction(&scene->_sequenceManager1, scene, 9460, &g_globals->_player, &scene->_object2, &scene->_object1, NULL); } break; default: @@ -911,8 +911,8 @@ void Scene9450::signal() { setAction(&_sequenceManager1, this, 9457, &_object2, &_object1, &_object3, NULL); break; case 9451: - if (_globals->getFlag(87)) { - _globals->_player.enableControl(); + if (g_globals->getFlag(87)) { + g_globals->_player.enableControl(); } else { _sceneMode = 1001; if (_object2._action) @@ -927,20 +927,20 @@ void Scene9450::signal() { setAction(&_sequenceManager1, this, 9455, &_object2, &_object1, &_object3, NULL); break; case 9453: - _globals->_sceneManager.changeScene(9360); + g_globals->_sceneManager.changeScene(9360); break; case 9459: RING_INVENTORY._tunic._sceneNumber = 1; _object2.signal(); - _globals->_player.enableControl(); - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_player.enableControl(); + g_globals->_events.setCursor(CURSOR_WALK); _hotspot1.remove(); break; case 1006: - _globals->setFlag(87); + g_globals->setFlag(87); // No break on purpose default: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; } } @@ -949,14 +949,14 @@ void Scene9450::dispatch() { if (_action) { _action->dispatch(); } else { - if ((_globals->_player._position.y < 98) && (_globals->_player._position.x > 241) && (_globals->_player._position.x < 282)) { - _globals->_player.disableControl(); + if ((g_globals->_player._position.y < 98) && (g_globals->_player._position.x > 241) && (g_globals->_player._position.x < 282)) { + g_globals->_player.disableControl(); _sceneMode = 9452; - setAction(&_sequenceManager1, this, 9452, &_globals->_player, NULL); - } else if ((_globals->_player._position.y < 99) && (_globals->_player._position.x > 68) && (_globals->_player._position.x < 103)) { - _globals->_player.disableControl(); + setAction(&_sequenceManager1, this, 9452, &g_globals->_player, NULL); + } else if ((g_globals->_player._position.y < 99) && (g_globals->_player._position.x > 68) && (g_globals->_player._position.x < 103)) { + g_globals->_player.disableControl(); _sceneMode = 9453; - setAction(&_sequenceManager1, this, 9453, &_globals->_player, NULL); + setAction(&_sequenceManager1, this, 9453, &g_globals->_player, NULL); } } } @@ -964,18 +964,18 @@ void Scene9450::dispatch() { void Scene9450::postInit(SceneObjectList *OwnerList) { Scene::postInit(); setZoomPercents(84, 75, 167, 150); - _globals->_events.setCursor(CURSOR_WALK); - _globals->_player.postInit(); + g_globals->_events.setCursor(CURSOR_WALK); + g_globals->_player.postInit(); _object2.postInit(); _object1.postInit(); _object1.hide(); - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneMode = 9451; - setAction(&_sequenceManager1, this, 9451, &_globals->_player, NULL); + setAction(&_sequenceManager1, this, 9451, &g_globals->_player, NULL); - if (_globals->getFlag(87)) { + if (g_globals->getFlag(87)) { if (RING_INVENTORY._tunic._sceneNumber == 1) { _object2.signal(); } else { @@ -1016,67 +1016,67 @@ void Scene9450::postInit(SceneObjectList *OwnerList) { * *--------------------------------------------------------------------------*/ void Scene9500::Hotspot1::doAction(int action) { - Scene9500 *scene = (Scene9500 *)_globals->_sceneManager._scene; + Scene9500 *scene = (Scene9500 *)g_globals->_sceneManager._scene; if (action == OBJECT_SWORD) { scene->_sceneMode = 9510; - _globals->setFlag(92); + g_globals->setFlag(92); RING_INVENTORY._sword._sceneNumber = 9500; - _globals->_player.disableControl(); - _globals->_sceneItems.remove(this); + g_globals->_player.disableControl(); + g_globals->_sceneItems.remove(this); scene->_hotspot2.setDetails(87, 294, 104, 314, 9400, 17, -1); - scene->setAction(&scene->_sequenceManager, scene, 9510, &_globals->_player, &scene->_object2, NULL); + scene->setAction(&scene->_sequenceManager, scene, 9510, &g_globals->_player, &scene->_object2, NULL); } else { NamedHotspot::doAction(action); } } void Scene9500::Hotspot2::doAction(int action) { - Scene9500 *scene = (Scene9500 *)_globals->_sceneManager._scene; + Scene9500 *scene = (Scene9500 *)g_globals->_sceneManager._scene; if (action == CURSOR_USE) { scene->_sceneMode = 9511; - _globals->_player.disableControl(); - _globals->_sceneItems.remove(this); - scene->setAction(&scene->_sequenceManager, scene, 9511, &_globals->_player, &scene->_object2, NULL); + g_globals->_player.disableControl(); + g_globals->_sceneItems.remove(this); + scene->setAction(&scene->_sequenceManager, scene, 9511, &g_globals->_player, &scene->_object2, NULL); } else { NamedHotspot::doAction(action); } } void Scene9500::Hotspot3::doAction(int action) { - Scene9500 *scene = (Scene9500 *)_globals->_sceneManager._scene; + Scene9500 *scene = (Scene9500 *)g_globals->_sceneManager._scene; if ((action == CURSOR_USE) && (RING_INVENTORY._candle._sceneNumber != 1)){ scene->_sceneMode = 9505; - _globals->_player.disableControl(); - _globals->_sceneItems.remove(this); - scene->setAction(&scene->_sequenceManager, scene, 9505, &_globals->_player, &scene->_candle, NULL); + g_globals->_player.disableControl(); + g_globals->_sceneItems.remove(this); + scene->setAction(&scene->_sequenceManager, scene, 9505, &g_globals->_player, &scene->_candle, NULL); } else { NamedHotspot::doAction(action); } } void Scene9500::Hotspot4::doAction(int action) { - Scene9500 *scene = (Scene9500 *)_globals->_sceneManager._scene; + Scene9500 *scene = (Scene9500 *)g_globals->_sceneManager._scene; if (action == OBJECT_CANDLE) { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); if (RING_INVENTORY._straw._sceneNumber == 9500) { scene->_sceneMode = 9506; - _globals->_sceneItems.remove(&scene->_hotspot5); - _globals->_sceneItems.remove(this); - scene->setAction(&scene->_sequenceManager, scene, 9506, &_globals->_player, &scene->_object3, NULL); + g_globals->_sceneItems.remove(&scene->_hotspot5); + g_globals->_sceneItems.remove(this); + scene->setAction(&scene->_sequenceManager, scene, 9506, &g_globals->_player, &scene->_object3, NULL); RING_INVENTORY._candle._sceneNumber = 9850; } else { scene->_sceneMode = 9507; - scene->setAction(&scene->_sequenceManager, scene, 9507, &_globals->_player, &scene->_object3, NULL); + scene->setAction(&scene->_sequenceManager, scene, 9507, &g_globals->_player, &scene->_object3, NULL); } } else if (action == OBJECT_STRAW) { scene->_sceneMode = 9512; - _globals->_player.disableControl(); + g_globals->_player.disableControl(); RING_INVENTORY._straw._sceneNumber = 9500; - scene->setAction(&scene->_sequenceManager, scene, 9512, &_globals->_player, &scene->_object3, NULL); + scene->setAction(&scene->_sequenceManager, scene, 9512, &g_globals->_player, &scene->_object3, NULL); } else { NamedHotspot::doAction(action); } @@ -1085,35 +1085,35 @@ void Scene9500::Hotspot4::doAction(int action) { void Scene9500::signal() { switch (_sceneMode) { case 9503: - _globals->_sceneManager.changeScene(9200); - _globals->_soundHandler.play(295); + g_globals->_sceneManager.changeScene(9200); + g_globals->_soundHandler.play(295); break; case 9504: - _globals->_sceneManager.changeScene(9850); + g_globals->_sceneManager.changeScene(9850); break; case 9505: _candle.setStrip(2); RING_INVENTORY._candle._sceneNumber = 1; - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; case 9506: - _globals->setFlag(85); - _globals->_player.enableControl(); + g_globals->setFlag(85); + g_globals->_player.enableControl(); break; case 9511: RING_INVENTORY._helmet._sceneNumber = 1; - _globals->_player.enableControl(); - if (!_globals->getFlag(51)) { - _globals->setFlag(51); - _globals->_player.disableControl(); + g_globals->_player.enableControl(); + if (!g_globals->getFlag(51)) { + g_globals->setFlag(51); + g_globals->_player.disableControl(); _sceneMode = 9514; - setAction(&_sequenceManager, this, 9514, &_globals->_player, NULL, NULL, NULL, NULL); + setAction(&_sequenceManager, this, 9514, &g_globals->_player, NULL, NULL, NULL, NULL); } break; case 0: case 9514: default: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; } } @@ -1122,14 +1122,14 @@ void Scene9500::dispatch() { if (_action) { _action->dispatch(); } else { - if (_globals->_player._position.y >= 199) { - _globals->_player.disableControl(); + if (g_globals->_player._position.y >= 199) { + g_globals->_player.disableControl(); _sceneMode = 9503; - setAction(&_sequenceManager, this, 9503, &_globals->_player, NULL, NULL, NULL, NULL); - } else if (_globals->_player._position.y < 127) { - _globals->_player.disableControl(); + setAction(&_sequenceManager, this, 9503, &g_globals->_player, NULL, NULL, NULL, NULL); + } else if (g_globals->_player._position.y < 127) { + g_globals->_player.disableControl(); _sceneMode = 9504; - setAction(&_sequenceManager, this, 9504, &_globals->_player, NULL, NULL, NULL, NULL); + setAction(&_sequenceManager, this, 9504, &g_globals->_player, NULL, NULL, NULL, NULL); } } @@ -1143,8 +1143,8 @@ void Scene9500::postInit(SceneObjectList *OwnerList) { Scene::postInit(); setZoomPercents(110, 75, 200, 150); - _globals->_player.postInit(); - _globals->_soundHandler.play(305); + g_globals->_player.postInit(); + g_globals->_soundHandler.play(305); _candle.postInit(); _candle.setVisage(9500); @@ -1164,7 +1164,7 @@ void Scene9500::postInit(SceneObjectList *OwnerList) { _object3._strip = 2; _object3._frame = 9; _object3.setPosition(Common::Point(168, 128)); - if (_globals->getFlag(85)) { + if (g_globals->getFlag(85)) { _object3.setVisage(9500); _object3.setStrip(4); _object3.animate(ANIM_MODE_8, 0, NULL); @@ -1174,7 +1174,7 @@ void Scene9500::postInit(SceneObjectList *OwnerList) { _object2.postInit(); _object2.hide(); - if (_globals->getFlag(92)) { + if (g_globals->getFlag(92)) { _object2.show(); _object2.setVisage(9501); _object2.setStrip(1); @@ -1196,7 +1196,7 @@ void Scene9500::postInit(SceneObjectList *OwnerList) { _hotspot6.setDetails(93, 11, 167, 46, 9500, 0, 1); _hotspot7.setDetails(100, 70, 125, 139, 9500, 2, 3); - if (!_globals->getFlag(85)) { + if (!g_globals->getFlag(85)) { _hotspot5.setDetails(111, 68, 155, 244, 9500, 17, -1); _hotspot4.setDetails(57, 71, 120, 126, 9500, 16, -1); } @@ -1214,21 +1214,21 @@ void Scene9500::postInit(SceneObjectList *OwnerList) { _hotspot18.setDetails(98, 144, 117, 162, 9500, 9, 10); _hotspot20.setDetails(102, 27, 132, 50, 9500, 9, 10); - _globals->_events.setCursor(CURSOR_WALK); - _globals->_player.disableControl(); + g_globals->_events.setCursor(CURSOR_WALK); + g_globals->_player.disableControl(); - if ((_globals->_sceneManager._previousScene == 9200) || (_globals->_sceneManager._previousScene != 9850)) { + if ((g_globals->_sceneManager._previousScene == 9200) || (g_globals->_sceneManager._previousScene != 9850)) { _sceneMode = 0; if (RING_INVENTORY._helmet._sceneNumber != 1) { - setAction(&_sequenceManager, this, 9501, &_globals->_player, &_candle, NULL); + setAction(&_sequenceManager, this, 9501, &g_globals->_player, &_candle, NULL); } else { RING_INVENTORY._helmet._sceneNumber = 9500; _hotspot2.setDetails(87, 294, 104, 314, 9400, 17, -1); - setAction(&_sequenceManager, this, 9513, &_globals->_player, &_object2, NULL); + setAction(&_sequenceManager, this, 9513, &g_globals->_player, &_object2, NULL); } } else { _sceneMode = 0; - setAction(&_sequenceManager, this, 9502, &_globals->_player, &_candle, NULL); + setAction(&_sequenceManager, this, 9502, &g_globals->_player, &_candle, NULL); } } @@ -1239,7 +1239,7 @@ void Scene9500::postInit(SceneObjectList *OwnerList) { void Scene9700::signal() { switch (_sceneMode ++) { case 9703: - _globals->setFlag(88); + g_globals->setFlag(88); // No break on purpose case 9701: case 9702: @@ -1247,13 +1247,13 @@ void Scene9700::signal() { _gfxButton1._bounds.center(50, 190); _gfxButton1.draw(); _gfxButton1._bounds.expandPanes(); - _globals->_player.enableControl(); - _globals->_player._canWalk = false; - _globals->_events.setCursor(CURSOR_USE); + g_globals->_player.enableControl(); + g_globals->_player._canWalk = false; + g_globals->_events.setCursor(CURSOR_USE); break; case 9704: - _globals->_soundHandler.play(323); - _globals->_sceneManager.changeScene(9750); + g_globals->_soundHandler.play(323); + g_globals->_sceneManager.changeScene(9750); break; } } @@ -1262,17 +1262,17 @@ void Scene9700::process(Event &event) { Scene::process(event); if ((event.eventType == EVENT_BUTTON_DOWN) && !_action) { if (_gfxButton1.process(event)) { - _globals->_sceneManager.changeScene(9200); - } else if (_globals->_events._currentCursor == OBJECT_SCANNER) { + g_globals->_sceneManager.changeScene(9200); + } else if (g_globals->_events._currentCursor == OBJECT_SCANNER) { event.handled = true; if (RING_INVENTORY._helmet._sceneNumber == 1) { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneMode = 9704; - setAction(&_sequenceManager, this, 9704, &_globals->_player, &_object1, NULL); + setAction(&_sequenceManager, this, 9704, &g_globals->_player, &_object1, NULL); } else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneMode = 9703; - setAction(&_sequenceManager, this, 9703, &_globals->_player, &_object1, NULL); + setAction(&_sequenceManager, this, 9703, &g_globals->_player, &_object1, NULL); } } } @@ -1291,16 +1291,16 @@ void Scene9700::postInit(SceneObjectList *OwnerList) { _object1.postInit(); _object1.hide(); - _globals->_player.postInit(); - if (!_globals->getFlag(97)) { - _globals->_player.disableControl(); + g_globals->_player.postInit(); + if (!g_globals->getFlag(97)) { + g_globals->_player.disableControl(); _sceneMode = 9701; - setAction(&_sequenceManager, this, 9701, &_globals->_player, &_object1, NULL); - _globals->setFlag(97); + setAction(&_sequenceManager, this, 9701, &g_globals->_player, &_object1, NULL); + g_globals->setFlag(97); } else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneMode = 9702; - setAction(&_sequenceManager, this, 9702, &_globals->_player, &_object1, NULL); + setAction(&_sequenceManager, this, 9702, &g_globals->_player, &_object1, NULL); } } @@ -1311,10 +1311,10 @@ void Scene9700::postInit(SceneObjectList *OwnerList) { void Scene9750::signal() { switch (_sceneMode ++) { case 9751: - _globals->_soundHandler.fadeOut(this); + g_globals->_soundHandler.fadeOut(this); break; case 9752: - _globals->_sceneManager.changeScene(2100); + g_globals->_sceneManager.changeScene(2100); default: break; } @@ -1329,14 +1329,14 @@ void Scene9750::postInit(SceneObjectList *OwnerList) { Scene::postInit(); setZoomPercents(0, 100, 200, 100); - _globals->_player.postInit(); + g_globals->_player.postInit(); _object1.postInit(); _object1.hide(); _object2.postInit(); _object2.hide(); - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneMode = 9751; - setAction(&_sequenceManager, this, 9751, &_globals->_player, &_object1, &_object2, NULL); + setAction(&_sequenceManager, this, 9751, &g_globals->_player, &_object1, &_object2, NULL); } @@ -1371,19 +1371,19 @@ void Scene9850::Object7::doAction(int action) { // Hair covered tunic void Scene9850::Hotspot12::doAction(int action) { - Scene9850 *scene = (Scene9850 *)_globals->_sceneManager._scene; + Scene9850 *scene = (Scene9850 *)g_globals->_sceneManager._scene; if (action == CURSOR_USE) { if (RING_INVENTORY._tunic2._sceneNumber != 1) { RING_INVENTORY._tunic2._sceneNumber = 1; - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 9858; - scene->setAction(&scene->_sequenceManager, scene, 9858, &_globals->_player, &scene->_objTunic2, NULL); + scene->setAction(&scene->_sequenceManager, scene, 9858, &g_globals->_player, &scene->_objTunic2, NULL); } else { RING_INVENTORY._tunic2._sceneNumber = 9850; - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 9861; - scene->setAction(&scene->_sequenceManager, scene, 9861, &_globals->_player, &scene->_objTunic2, NULL); + scene->setAction(&scene->_sequenceManager, scene, 9861, &g_globals->_player, &scene->_objTunic2, NULL); } } else if ((action != CURSOR_LOOK) || (RING_INVENTORY._tunic2._sceneNumber != 1)) { NamedHotspot::doAction(action); @@ -1393,19 +1393,19 @@ void Scene9850::Hotspot12::doAction(int action) { } void Scene9850::Hotspot14::doAction(int action) { - Scene9850 *scene = (Scene9850 *)_globals->_sceneManager._scene; + Scene9850 *scene = (Scene9850 *)g_globals->_sceneManager._scene; if (action == CURSOR_USE) { if (RING_INVENTORY._jacket._sceneNumber != 1) { RING_INVENTORY._jacket._sceneNumber = 1; - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 9857; - scene->setAction(&scene->_sequenceManager, scene, 9857, &_globals->_player, &scene->_objJacket, NULL); + scene->setAction(&scene->_sequenceManager, scene, 9857, &g_globals->_player, &scene->_objJacket, NULL); } else { RING_INVENTORY._jacket._sceneNumber = 9850; - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 9860; - scene->setAction(&scene->_sequenceManager, scene, 9860, &_globals->_player, &scene->_objJacket, NULL); + scene->setAction(&scene->_sequenceManager, scene, 9860, &g_globals->_player, &scene->_objJacket, NULL); } } else if ((action != CURSOR_LOOK) || (RING_INVENTORY._jacket._sceneNumber != 1)) { NamedHotspot::doAction(action); @@ -1415,19 +1415,19 @@ void Scene9850::Hotspot14::doAction(int action) { } void Scene9850::Hotspot16::doAction(int action) { - Scene9850 *scene = (Scene9850 *)_globals->_sceneManager._scene; + Scene9850 *scene = (Scene9850 *)g_globals->_sceneManager._scene; if (action == CURSOR_USE) { if (RING_INVENTORY._cloak._sceneNumber != 1) { RING_INVENTORY._cloak._sceneNumber = 1; - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 9862; - scene->setAction(&scene->_sequenceManager, scene, 9862, &_globals->_player, &scene->_objCloak, NULL); + scene->setAction(&scene->_sequenceManager, scene, 9862, &g_globals->_player, &scene->_objCloak, NULL); } else { RING_INVENTORY._cloak._sceneNumber = 9850; - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 9859; - scene->setAction(&scene->_sequenceManager, scene, 9859, &_globals->_player, &scene->_objCloak, NULL); + scene->setAction(&scene->_sequenceManager, scene, 9859, &g_globals->_player, &scene->_objCloak, NULL); } } else if ((action != CURSOR_LOOK) || (RING_INVENTORY._cloak._sceneNumber != 1)) { NamedHotspot::doAction(action); @@ -1437,7 +1437,7 @@ void Scene9850::Hotspot16::doAction(int action) { } void Scene9850::Hotspot17::doAction(int action) { - Scene9850 *scene = (Scene9850 *)_globals->_sceneManager._scene; + Scene9850 *scene = (Scene9850 *)g_globals->_sceneManager._scene; if (action == OBJECT_SCANNER) { SceneItem::display(9850, 32, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); @@ -1449,7 +1449,7 @@ void Scene9850::Hotspot17::doAction(int action) { } void Scene9850::Hotspot18::doAction(int action) { - Scene9850 *scene = (Scene9850 *)_globals->_sceneManager._scene; + Scene9850 *scene = (Scene9850 *)g_globals->_sceneManager._scene; if (action == OBJECT_SCANNER) { SceneItem::display(9850, 32, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); @@ -1461,7 +1461,7 @@ void Scene9850::Hotspot18::doAction(int action) { } void Scene9850::Hotspot19::doAction(int action) { - Scene9850 *scene = (Scene9850 *)_globals->_sceneManager._scene; + Scene9850 *scene = (Scene9850 *)g_globals->_sceneManager._scene; if (action == OBJECT_SCANNER) { SceneItem::display(9850, 31, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); @@ -1474,20 +1474,20 @@ void Scene9850::Hotspot19::doAction(int action) { // Arrow on Statue void Scene9850::Hotspot20::doAction(int action) { - Scene9850 *scene = (Scene9850 *)_globals->_sceneManager._scene; + Scene9850 *scene = (Scene9850 *)g_globals->_sceneManager._scene; if (action == CURSOR_USE) { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); if (scene->_objSword._state == 0) { if (RING_INVENTORY._scimitar._sceneNumber == 9850) scene->_objScimitar.show(); if (RING_INVENTORY._sword._sceneNumber == 9850) scene->_objSword.show(); scene->_sceneMode = 11; - setAction(&scene->_sequenceManager, scene, 9853, &_globals->_player, &scene->_objDoor, &scene->_objLever, NULL); + setAction(&scene->_sequenceManager, scene, 9853, &g_globals->_player, &scene->_objDoor, &scene->_objLever, NULL); } else { scene->_sceneMode = 10; - setAction(&scene->_sequenceManager, scene, 9854, &_globals->_player, &scene->_objDoor, &scene->_objLever, NULL); + setAction(&scene->_sequenceManager, scene, 9854, &g_globals->_player, &scene->_objDoor, &scene->_objLever, NULL); } scene->_objSword._state ^= 1; } else { @@ -1503,26 +1503,26 @@ void Scene9850::signal() { _objScimitar.hide(); if (RING_INVENTORY._sword._sceneNumber == 9850) _objSword.hide(); - _globals->_sceneItems.remove(&_objScimitar); - _globals->_sceneItems.remove(&_objSword); - _globals->_sceneItems.addItems(&_hotspot19, NULL); - _globals->_player.enableControl(); + g_globals->_sceneItems.remove(&_objScimitar); + g_globals->_sceneItems.remove(&_objSword); + g_globals->_sceneItems.addItems(&_hotspot19, NULL); + g_globals->_player.enableControl(); break; case 11: // Hidden closet opened if (RING_INVENTORY._scimitar._sceneNumber == 9850) - _globals->_sceneItems.addItems(&_objScimitar, NULL); + g_globals->_sceneItems.addItems(&_objScimitar, NULL); if (RING_INVENTORY._sword._sceneNumber == 9850) - _globals->_sceneItems.addItems(&_objSword, NULL); - _globals->_sceneItems.remove(&_hotspot19); - _globals->_player.enableControl(); + g_globals->_sceneItems.addItems(&_objSword, NULL); + g_globals->_sceneItems.remove(&_hotspot19); + g_globals->_player.enableControl(); break; case 9500: - _globals->_sceneManager.changeScene(_sceneMode - 1); + g_globals->_sceneManager.changeScene(_sceneMode - 1); break; case 0: default: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; } } @@ -1531,7 +1531,7 @@ void Scene9850::process(Event &event) { Scene::process(event); if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_4)) { event.handled = true; - _globals->_player.disableControl(); + g_globals->_player.disableControl(); if (_objSword._state == 0) { _sceneMode = 0; setAction(&_sequenceManager, this, 9853, &_objLever, &_objDoor, &_objScimitar, &_objSword, NULL); @@ -1546,10 +1546,10 @@ void Scene9850::process(Event &event) { void Scene9850::dispatch() { if (_action) { _action->dispatch(); - } else if (_globals->_player._position.y >= 198) { - _globals->_player.disableControl(); + } else if (g_globals->_player._position.y >= 198) { + g_globals->_player.disableControl(); _sceneMode = 9500; - setAction(&_sequenceManager, this, 9852, &_globals->_player, NULL); + setAction(&_sequenceManager, this, 9852, &g_globals->_player, NULL); } } @@ -1638,10 +1638,10 @@ void Scene9850::postInit(SceneObjectList *OwnerList) { _hotspot15.setDetails(43, 162, 92, 191, 9850, 23, 24); _hotspot16.setDetails(40, 146, 90, 169, 9850, 25, -1); - _globals->_player.postInit(); - _globals->_player.disableControl(); + g_globals->_player.postInit(); + g_globals->_player.disableControl(); _sceneMode = 0; - setAction(&_sequenceManager, this, 9851, &_globals->_player, NULL); + setAction(&_sequenceManager, this, 9851, &g_globals->_player, NULL); } /*-------------------------------------------------------------------------- @@ -1652,7 +1652,7 @@ void Scene9900::strAction1::signal() { const byte mask1[3] = {0xff, 0xff, 0xff}; const byte mask2[3] = {0, 0, 0}; - Scene9900 *scene = (Scene9900 *)_globals->_sceneManager._scene; + Scene9900 *scene = (Scene9900 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -1664,23 +1664,23 @@ void Scene9900::strAction1::signal() { _object9.fixPriority(250); _object9.setPosition(Common::Point(171, 59)); _object9.animate(ANIM_MODE_5, NULL); - _globals->_scenePalette.addRotation(67, 111, 1, 1, this); + g_globals->_scenePalette.addRotation(67, 111, 1, 1, this); scene->_object2.hide(); break; case 1: _palette1.getPalette(); - _globals->_scenePalette.addFader(&mask1[0], 1, 10, this); + g_globals->_scenePalette.addFader(&mask1[0], 1, 10, this); break; case 2: _object9.remove(); - _globals->_scenePalette.addFader(&mask2[0], 1, 5, this); + g_globals->_scenePalette.addFader(&mask2[0], 1, 5, this); break; case 3: - _globals->_soundHandler.play(377); + g_globals->_soundHandler.play(377); setDelay(120); break; case 4: - _globals->_scenePalette.addFader(_palette1._palette, 256, 1, this); + g_globals->_scenePalette.addFader(_palette1._palette, 256, 1, this); break; case 5: remove(); @@ -1702,7 +1702,7 @@ void Scene9900::strAction2::signal() { _var3 = 0; // No break on purpose case 1: { - Common::String msg = _resourceManager->getMessage(8030, _lineNum++); + Common::String msg = g_resourceManager->getMessage(8030, _lineNum++); if (msg.compareTo("LASTCREDIT")) { if (_var3) { // Not used? @@ -1740,7 +1740,7 @@ void Scene9900::strAction2::signal() { _txtArray2[_txtArray1Index]._fontNumber = 2; _txtArray2[_txtArray1Index]._color1 = 23; - msg = _resourceManager->getMessage(8030, _lineNum++); + msg = g_resourceManager->getMessage(8030, _lineNum++); _txtArray2[_txtArray1Index].setup(msg); _txtArray2[_txtArray1Index]._moveRate = 20; _txtArray2[_txtArray1Index]._moveDiff.y = 2; @@ -1749,7 +1749,7 @@ void Scene9900::strAction2::signal() { _txtArray2[_txtArray1Index].setPosition(Common::Point((320 - frameWidth) / 2, 200 + frameHeight)); } else { // WORKAROUND: Fix inventory becoming available at end of credits - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_events.setCursor(CURSOR_WALK); _actionIndex = 3; signal(); } @@ -1804,21 +1804,21 @@ void Scene9900::strAction3::signal() { case 0: _palette2.getPalette(); _palette3.loadPalette(2003); - _globals->_scenePalette.addFader(_palette3._palette, 256, 5, this); + g_globals->_scenePalette.addFader(_palette3._palette, 256, 5, this); break; case 1: - _globals->_scenePalette.addFader(&mask3[0], 1, 10, this); + g_globals->_scenePalette.addFader(&mask3[0], 1, 10, this); break; case 2: - _globals->_scenePalette.addFader(&mask4[0], 1, 1, this); + g_globals->_scenePalette.addFader(&mask4[0], 1, 1, this); break; case 3: _palette2.loadPalette(17); - _globals->_sceneManager._scene->loadScene(17); - _globals->_scenePalette.addFader(_palette2._palette, 256, 5, this); + g_globals->_sceneManager._scene->loadScene(17); + g_globals->_scenePalette.addFader(_palette2._palette, 256, 5, this); break; case 4: - _globals->_game->endGame(9900, 61); + g_globals->_game->endGame(9900, 61); remove(); default: break; @@ -1858,40 +1858,40 @@ void Scene9900::signal() { switch (_sceneMode){ case 150: - _globals->_soundHandler.play(380); + g_globals->_soundHandler.play(380); _object8.postInit(); _object8.setVisage(2002); _object8.setStrip(1); _object8.setFrame(1); _object8.fixPriority(200); _object8.setPosition(Common::Point(64, 199)); - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneMode = 9908; setAction(&_sequenceManager, this, 9908, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6); break; case 162: warning("TBC: shutdown();"); - _globals->_game->quitGame(); + g_globals->_game->quitGame(); break; case 9901: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneMode = 9906; setAction(&_sequenceManager, this, 9906, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6); - _globals->_player._uiEnabled = true; - _globals->_events.setCursor(CURSOR_USE); + g_globals->_player._uiEnabled = true; + g_globals->_events.setCursor(CURSOR_USE); break; case 9902: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneMode = 9901; setAction(&_sequenceManager, this, 9901, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6); break; case 9903: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneMode = 9902; setAction(&_sequenceManager, this, 9902, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6); break; case 9904: - _globals->_soundHandler.play(390); + g_globals->_soundHandler.play(390); _sceneMode = 9912; setAction(&_strAction2, this); break; @@ -1901,50 +1901,50 @@ void Scene9900::signal() { break; case 9906: if (_object8._state == 0) { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneMode = 9913; setAction(&_sequenceManager, this, 9913, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6); } else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneMode = 9905; setAction(&_sequenceManager, this, 9905, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6); } break; case 9907: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneMode = 9903; setAction(&_sequenceManager, this, 9903, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6); break; case 9908: _object8.remove(); - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneMode = 9904; setAction(&_sequenceManager, this, 9904, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6); break; case 9909: - _globals->_soundHandler.play(375); - _globals->_player.disableControl(); + g_globals->_soundHandler.play(375); + g_globals->_player.disableControl(); _sceneMode = 9907; setAction(&_sequenceManager, this, 9907, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6); break; case 9910: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneMode = 9911; setAction(&_sequenceManager, this, 9911, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6); break; case 9911: - _globals->_soundHandler.play(367); - _globals->_player.disableControl(); + g_globals->_soundHandler.play(367); + g_globals->_player.disableControl(); _sceneMode = 9909; setAction(&_sequenceManager, this, 9909, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6); break; case 9912: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneMode = 9912; setAction(&_sequenceManager, this, 9912, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6); _sceneMode = 162; - _globals->_player.enableControl(); - _globals->_player._canWalk = false; + g_globals->_player.enableControl(); + g_globals->_player._canWalk = false; break; case 9913: _sceneMode = 200; @@ -1960,10 +1960,10 @@ void Scene9900::process(Event &event) { return; Scene::process(event); if (_sceneMode == 9906) { - if ((event.eventType == EVENT_BUTTON_DOWN) && (_globals->_events.getCursor() == OBJECT_ITEMS)) { + if ((event.eventType == EVENT_BUTTON_DOWN) && (g_globals->_events.getCursor() == OBJECT_ITEMS)) { _object8._state = 1; RING_INVENTORY._items._sceneNumber = 9900; - _globals->_events.setCursor(CURSOR_USE); + g_globals->_events.setCursor(CURSOR_USE); } } } @@ -1995,7 +1995,7 @@ void Scene9900::postInit(SceneObjectList *OwnerList) { RING_INVENTORY._items._description = Common::String("One of the items from the stasis ship. The other is on the Lance's bridge."); _stripManager.addSpeaker(&_speakerMR); - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneMode = 9910; setAction(&_sequenceManager, this, 9910, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6); } @@ -2011,7 +2011,7 @@ void Scene9999::Action1::signal() { setDelay(600); break; case 1: - _globals->_sceneManager.changeScene(3500); + g_globals->_sceneManager.changeScene(3500); break; default: break; @@ -2030,8 +2030,8 @@ void Scene9999::Action2::signal() { setDelay(300); break; case 2: - _globals->_stripNum = 3600; - _globals->_sceneManager.changeScene(3600); + g_globals->_stripNum = 3600; + g_globals->_sceneManager.changeScene(3600); default: break; } @@ -2047,14 +2047,14 @@ void Scene9999::postInit(SceneObjectList *OwnerList) { _object1.setStrip2(3); _object1.setPosition(Common::Point(160, 152)); - _globals->_player.postInit(); - _globals->_player.setVisage(1303); - _globals->_player.setStrip2(1); - _globals->_player.fixPriority(250); - _globals->_player.animate(ANIM_MODE_2, NULL); - _globals->_player.setPosition(Common::Point(194, 98)); - _globals->_player._numFrames = 20; - _globals->_player.disableControl(); + g_globals->_player.postInit(); + g_globals->_player.setVisage(1303); + g_globals->_player.setStrip2(1); + g_globals->_player.fixPriority(250); + g_globals->_player.animate(ANIM_MODE_2, NULL); + g_globals->_player.setPosition(Common::Point(194, 98)); + g_globals->_player._numFrames = 20; + g_globals->_player.disableControl(); _object2.postInit(); _object2.setVisage(1303); @@ -2070,21 +2070,21 @@ void Scene9999::postInit(SceneObjectList *OwnerList) { _object3.setPosition(Common::Point(292, 149)); _object3.setAction(&_action3); - if (_globals->_sceneManager._previousScene == 3500) + if (g_globals->_sceneManager._previousScene == 3500) setAction(&_action2); else setAction(&_action1); - _globals->_sceneManager._scene->_sceneBounds.center(_globals->_player._position.x, _globals->_player._position.y); - _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); - _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; + g_globals->_sceneManager._scene->_sceneBounds.center(g_globals->_player._position.x, g_globals->_player._position.y); + g_globals->_sceneManager._scene->_sceneBounds.contain(g_globals->_sceneManager._scene->_backgroundBounds); + g_globals->_sceneOffset.x = (g_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; - if (_globals->_sceneManager._previousScene == 3500) - _globals->_stripNum = 2222; + if (g_globals->_sceneManager._previousScene == 3500) + g_globals->_stripNum = 2222; else - _globals->_stripNum = 2121; + g_globals->_stripNum = 2121; - _globals->_soundHandler.play(118); + g_globals->_soundHandler.play(118); } diff --git a/engines/tsage/ringworld/ringworld_scenes2.cpp b/engines/tsage/ringworld/ringworld_scenes2.cpp index cfd3e3d8f7..e07c9253e6 100644 --- a/engines/tsage/ringworld/ringworld_scenes2.cpp +++ b/engines/tsage/ringworld/ringworld_scenes2.cpp @@ -36,11 +36,11 @@ namespace Ringworld { *--------------------------------------------------------------------------*/ void Scene1000::Action1::signal() { - Scene1000 *scene = (Scene1000 *)_globals->_sceneManager._scene; + Scene1000 *scene = (Scene1000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(10); break; case 1: @@ -63,7 +63,7 @@ void Scene1000::Action1::signal() { break; } case 3: - _globals->_sceneManager.changeScene(1400); + g_globals->_sceneManager.changeScene(1400); break; } @@ -72,7 +72,7 @@ void Scene1000::Action1::signal() { void Scene1000::Action2::signal() { switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(10); break; case 1: @@ -82,7 +82,7 @@ void Scene1000::Action2::signal() { break; case 2: SceneItem::display(0, 0); - _globals->_sceneManager.changeScene(2000); + g_globals->_sceneManager.changeScene(2000); break; default: break; @@ -90,11 +90,11 @@ void Scene1000::Action2::signal() { } void Scene1000::Action3::signal() { - Scene1000 *scene = (Scene1000 *)_globals->_sceneManager._scene; + Scene1000 *scene = (Scene1000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_sceneManager._scene->loadBackground(0, 0); + g_globals->_sceneManager._scene->loadBackground(0, 0); setDelay(60); break; case 1: { @@ -108,11 +108,11 @@ void Scene1000::Action3::signal() { setDelay(60); break; case 4: - _globals->_player.show(); + g_globals->_player.show(); setDelay(240); break; case 5: { - _globals->_player.enableControl(); + g_globals->_player.enableControl(); const char *SEEN_INTRO = "seen_intro"; if (!ConfMan.hasKey(SEEN_INTRO) || !ConfMan.getBool(SEEN_INTRO)) { @@ -123,31 +123,31 @@ void Scene1000::Action3::signal() { setDelay(1); } else { // Prompt user for whether to start play or watch introduction - _globals->_player.enableControl(); + g_globals->_player.enableControl(); if (MessageDialog::show2(WATCH_INTRO_MSG, START_PLAY_BTN_STRING, INTRODUCTION_BTN_STRING) == 0) { _actionIndex = 20; - _globals->_soundHandler.fadeOut(this); + g_globals->_soundHandler.fadeOut(this); } else { setDelay(1); } } - _globals->_player.disableControl(); + g_globals->_player.disableControl(); break; } case 6: { scene->_object3.remove(); - _globals->_player.setStrip2(2); + g_globals->_player.setStrip2(2); NpcMover *mover = new NpcMover(); Common::Point pt(480, 100); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 7: - _globals->_scenePalette.loadPalette(1002); - _globals->_scenePalette.refresh(); - _globals->_scenePalette.addRotation(80, 95, -1); + g_globals->_scenePalette.loadPalette(1002); + g_globals->_scenePalette.refresh(); + g_globals->_scenePalette.addRotation(80, 95, -1); scene->_object3.postInit(); scene->_object3.setVisage(1002); scene->_object3.setStrip(1); @@ -216,14 +216,14 @@ void Scene1000::Action3::signal() { break; case 18: zoom(false); - _globals->_scenePalette.clearListeners(); - _globals->_soundHandler.fadeOut(this); + g_globals->_scenePalette.clearListeners(); + g_globals->_soundHandler.fadeOut(this); break; case 19: - _globals->_sceneManager.changeScene(10); + g_globals->_sceneManager.changeScene(10); break; case 20: - _globals->_sceneManager.changeScene(30); + g_globals->_sceneManager.changeScene(30); break; default: break; @@ -231,19 +231,19 @@ void Scene1000::Action3::signal() { } void Scene1000::Action3::zoom(bool up) { - Scene1000 *scene = (Scene1000 *)_globals->_sceneManager._scene; + Scene1000 *scene = (Scene1000 *)g_globals->_sceneManager._scene; if (up) { - while ((scene->_object3._percent < 100) && !_vm->shouldQuit()) { + while ((scene->_object3._percent < 100) && !g_vm->shouldQuit()) { scene->_object3.changeZoom(MIN(scene->_object3._percent + 5, 100)); - _globals->_sceneObjects->draw(); - _globals->_events.delay(1); + g_globals->_sceneObjects->draw(); + g_globals->_events.delay(1); } } else { - while ((scene->_object3._percent > 0) && !_vm->shouldQuit()) { + while ((scene->_object3._percent > 0) && !g_vm->shouldQuit()) { scene->_object3.changeZoom(MAX(scene->_object3._percent - 5, 0)); - _globals->_sceneObjects->draw(); - _globals->_events.delay(1); + g_globals->_sceneObjects->draw(); + g_globals->_events.delay(1); } } } @@ -255,7 +255,7 @@ void Scene1000::postInit(SceneObjectList *OwnerList) { setZoomPercents(0, 100, 200, 100); loadScene(1000); - if (_globals->_sceneManager._previousScene == 2000) { + if (g_globals->_sceneManager._previousScene == 2000) { setZoomPercents(150, 10, 180, 100); _object1.postInit(); _object1.setVisage(1001); @@ -266,12 +266,12 @@ void Scene1000::postInit(SceneObjectList *OwnerList) { setAction(&_action2); - _globals->_sceneManager._scene->_sceneBounds.center(_object1._position.x, _object1._position.y); - _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); + g_globals->_sceneManager._scene->_sceneBounds.center(_object1._position.x, _object1._position.y); + g_globals->_sceneManager._scene->_sceneBounds.contain(g_globals->_sceneManager._scene->_backgroundBounds); - _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; - _globals->_soundHandler.play(114); - } else if (_globals->_sceneManager._previousScene == 2222) { + g_globals->_sceneOffset.x = (g_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; + g_globals->_soundHandler.play(114); + } else if (g_globals->_sceneManager._previousScene == 2222) { setZoomPercents(150, 10, 180, 100); _object1.postInit(); _object1.setVisage(1001); @@ -280,28 +280,28 @@ void Scene1000::postInit(SceneObjectList *OwnerList) { _object1._moveDiff = Common::Point(2, 2); _object1.setPosition(Common::Point(120, 180)); - _globals->_sceneManager._scene->_sceneBounds.center(_object1._position.x, _object1._position.y); - _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); - _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; + g_globals->_sceneManager._scene->_sceneBounds.center(_object1._position.x, _object1._position.y); + g_globals->_sceneManager._scene->_sceneBounds.contain(g_globals->_sceneManager._scene->_backgroundBounds); + g_globals->_sceneOffset.x = (g_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; setAction(&_action1); } else { - _globals->_soundHandler.play(4); + g_globals->_soundHandler.play(4); setZoomPercents(0, 10, 30, 100); _object3.postInit(); _object3.setVisage(1050); _object3.changeZoom(-1); _object3.setPosition(Common::Point(158, 0)); - _globals->_player.postInit(); - _globals->_player.setVisage(1050); - _globals->_player.setStrip(3); - _globals->_player.setPosition(Common::Point(160, 191)); - _globals->_player._moveDiff.x = 12; - _globals->_player.hide(); - _globals->_player.disableControl(); + g_globals->_player.postInit(); + g_globals->_player.setVisage(1050); + g_globals->_player.setStrip(3); + g_globals->_player.setPosition(Common::Point(160, 191)); + g_globals->_player._moveDiff.x = 12; + g_globals->_player.hide(); + g_globals->_player.disableControl(); - _globals->_sceneManager._scene->_sceneBounds.center(_object3._position.x, _object3._position.y); + g_globals->_sceneManager._scene->_sceneBounds.center(_object3._position.x, _object3._position.y); setAction(&_action3); } @@ -313,7 +313,7 @@ void Scene1000::postInit(SceneObjectList *OwnerList) { *--------------------------------------------------------------------------*/ void Scene1001::Action1::signal() { - Scene1001 *scene = (Scene1001 *)_globals->_sceneManager._scene; + Scene1001 *scene = (Scene1001 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -478,9 +478,9 @@ void Scene1001::Action1::signal() { setDelay(30); break; case 19: { - _globals->_soundHandler.play(91); + g_globals->_soundHandler.play(91); byte adjustData[4] = {0xff, 0xff, 0xff, 0}; - _globals->_scenePalette.fade(adjustData, false, 0); + g_globals->_scenePalette.fade(adjustData, false, 0); scene->_object1._strip = 7; scene->_object1._frame = 1; @@ -490,8 +490,8 @@ void Scene1001::Action1::signal() { break; } case 20: - _globals->_scenePalette.loadPalette(16); - _globals->_scenePalette.refresh(); + g_globals->_scenePalette.loadPalette(16); + g_globals->_scenePalette.refresh(); setDelay(6); break; case 21: @@ -499,14 +499,14 @@ void Scene1001::Action1::signal() { scene->_object1.animate(ANIM_MODE_5, this); break; case 22: - _globals->_soundHandler.play(92); + g_globals->_soundHandler.play(92); scene->_stripManager.start(111, this); break; case 23: setDelay(60); break; case 24: - _globals->_sceneManager.changeScene(2000); + g_globals->_sceneManager.changeScene(2000); break; } } @@ -529,7 +529,7 @@ void Scene1001::postInit(SceneObjectList *OwnerList) { _object3.setStrip2(4); _object3.setPosition(Common::Point(61, 177)); - _globals->_soundHandler.play(85); + g_globals->_soundHandler.play(85); setAction(&_action1); } @@ -540,11 +540,11 @@ void Scene1001::postInit(SceneObjectList *OwnerList) { *--------------------------------------------------------------------------*/ void Scene1250::Action1::signal() { - Scene1250 *scene = (Scene1250 *)_globals->_sceneManager._scene; + Scene1250 *scene = (Scene1250 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - setDelay(_globals->_randomSource.getRandomNumber(120) + 60); + setDelay(g_globals->_randomSource.getRandomNumber(120) + 60); break; case 1: scene->_object1.animate(ANIM_MODE_5, this); @@ -554,11 +554,11 @@ void Scene1250::Action1::signal() { } void Scene1250::Action2::signal() { - Scene1250 *scene = (Scene1250 *)_globals->_sceneManager._scene; + Scene1250 *scene = (Scene1250 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - switch (_globals->_randomSource.getRandomNumber(2)) { + switch (g_globals->_randomSource.getRandomNumber(2)) { case 0: scene->_object2.setPosition(Common::Point(163, 75)); break; @@ -580,7 +580,7 @@ void Scene1250::Action2::signal() { } void Scene1250::Action3::signal() { - Scene1250 *scene = (Scene1250 *)_globals->_sceneManager._scene; + Scene1250 *scene = (Scene1250 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -593,13 +593,13 @@ void Scene1250::Action3::signal() { setDelay(6); break; case 3: - _globals->_sceneManager.changeScene(1000); + g_globals->_sceneManager.changeScene(1000); break; } } void Scene1250::Action4::signal() { - Scene1250 *scene = (Scene1250 *)_globals->_sceneManager._scene; + Scene1250 *scene = (Scene1250 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -612,7 +612,7 @@ void Scene1250::Action4::signal() { setDelay(6); break; case 3: - _globals->_sceneManager.changeScene(2000); + g_globals->_sceneManager.changeScene(2000); break; } } @@ -643,14 +643,14 @@ void Scene1250::postInit(SceneObjectList *OwnerList) { _object2._frame = 1; _object2.setAction(&_action2); - _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); - _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; + g_globals->_sceneManager._scene->_sceneBounds.contain(g_globals->_sceneManager._scene->_backgroundBounds); + g_globals->_sceneOffset.x = (g_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; - if ((_globals->_sceneManager._previousScene != 2000) || (_globals->_stripNum != 1250)) { + if ((g_globals->_sceneManager._previousScene != 2000) || (g_globals->_stripNum != 1250)) { setAction(&_action4); } else { setAction(&_action3); - _globals->_soundHandler.play(114); + g_globals->_soundHandler.play(114); } } @@ -660,7 +660,7 @@ void Scene1250::postInit(SceneObjectList *OwnerList) { *--------------------------------------------------------------------------*/ void Scene1400::Action1::signal() { - Scene1400 *scene = (Scene1400 *)_globals->_sceneManager._scene; + Scene1400 *scene = (Scene1400 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -671,23 +671,23 @@ void Scene1400::Action1::signal() { Common::Point pt(160, 700); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 2: { - _globals->_player.setStrip2(3); - _globals->_player.changeZoom(100); + g_globals->_player.setStrip2(3); + g_globals->_player.changeZoom(100); Common::Point pt(160, 100); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); SceneItem::display(0, 0); setDelay(360); break; } case 3: - SceneItem::display(1400, 2, SET_X, 60, SET_Y, _globals->_sceneManager._scene->_sceneBounds.bottom - 80, + SceneItem::display(1400, 2, SET_X, 60, SET_Y, g_globals->_sceneManager._scene->_sceneBounds.bottom - 80, SET_FONT, 2, SET_FG_COLOR, 13, SET_POS_MODE, 0, SET_KEEP_ONSCREEN, -1, LIST_END); setDelay(420); break; @@ -696,7 +696,7 @@ void Scene1400::Action1::signal() { setDelay(360); break; case 5: - SceneItem::display(1400, 3, SET_X, 60, SET_Y, _globals->_sceneManager._scene->_sceneBounds.bottom - 80, + SceneItem::display(1400, 3, SET_X, 60, SET_Y, g_globals->_sceneManager._scene->_sceneBounds.bottom - 80, SET_FONT, 2, SET_FG_COLOR, 23, SET_POS_MODE, 0, SET_KEEP_ONSCREEN, -1, LIST_END); setDelay(360); break; @@ -704,25 +704,25 @@ void Scene1400::Action1::signal() { SceneItem::display(0, 0); break; case 7: { - _globals->_player._frame = 1; - _globals->_player.setStrip2(1); - _globals->_player._numFrames = 5; - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player._frame = 1; + g_globals->_player.setStrip2(1); + g_globals->_player._numFrames = 5; + g_globals->_player.animate(ANIM_MODE_5, this); Common::Point pt(205, 70); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, NULL); - _globals->_sceneManager._fadeMode = FADEMODE_NONE; + g_globals->_player.addMover(mover, &pt, NULL); + g_globals->_sceneManager._fadeMode = FADEMODE_NONE; scene->loadScene(1402); break; } case 8: - _globals->_player.setStrip2(2); - _globals->_player._numFrames = 10; - _globals->_player.animate(ANIM_MODE_2, NULL); + g_globals->_player.setStrip2(2); + g_globals->_player._numFrames = 10; + g_globals->_player.animate(ANIM_MODE_2, NULL); - SceneItem::display(1400, 4, SET_X, 30, SET_Y, _globals->_player._position.y + 10, SET_FONT, 2, + SceneItem::display(1400, 4, SET_X, 30, SET_Y, g_globals->_player._position.y + 10, SET_FONT, 2, SET_FG_COLOR, 13, SET_POS_MODE, 0, SET_KEEP_ONSCREEN, -1, LIST_END); setDelay(300); break; @@ -730,16 +730,16 @@ void Scene1400::Action1::signal() { SceneItem::display(0, 0); Common::Point pt(450, 45); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 10: - _globals->_sceneManager._scrollerRect = Rect(40, 20, 280, 180); - _globals->_sceneManager._fadeMode = FADEMODE_GRADUAL; - _globals->_stripNum = 1500; - _globals->_soundHandler.stop(); + g_globals->_sceneManager._scrollerRect = Rect(40, 20, 280, 180); + g_globals->_sceneManager._fadeMode = FADEMODE_GRADUAL; + g_globals->_stripNum = 1500; + g_globals->_soundHandler.stop(); - _globals->_sceneManager.changeScene(1500); + g_globals->_sceneManager.changeScene(1500); break; } } @@ -748,41 +748,41 @@ void Scene1400::Action1::dispatch() { Action::dispatch(); if ((_actionIndex > 3) && (_actionIndex < 9)) - _globals->_sceneText.setPosition(Common::Point(60, _globals->_sceneManager._scene->_sceneBounds.bottom - 80)); + g_globals->_sceneText.setPosition(Common::Point(60, g_globals->_sceneManager._scene->_sceneBounds.bottom - 80)); - if ((_actionIndex <= 2) && (_globals->_player._percent > 22)) - _globals->_player.changeZoom(100 - (800 - _globals->_player._position.y)); + if ((_actionIndex <= 2) && (g_globals->_player._percent > 22)) + g_globals->_player.changeZoom(100 - (800 - g_globals->_player._position.y)); - if ((_actionIndex >= 9) && (_globals->_player._percent > 22)) - _globals->_player.changeZoom(100 - (_globals->_player._position.x - 205)); + if ((_actionIndex >= 9) && (g_globals->_player._percent > 22)) + g_globals->_player.changeZoom(100 - (g_globals->_player._position.x - 205)); } /*--------------------------------------------------------------------------*/ void Scene1400::postInit(SceneObjectList *OwnerList) { - if (_globals->_stripNum != 1400) { + if (g_globals->_stripNum != 1400) { loadScene(1401); } else { loadScene(1402); } Scene::postInit(); - _globals->_sceneManager._scrollerRect = Rect(40, 90, 280, 180); - _globals->_player.postInit(); - _globals->_player.setVisage(1401); - _globals->_player.animate(ANIM_MODE_2, 0); - _globals->_player.setStrip2(4); - _globals->_player.fixPriority(4); - _globals->_player.disableControl(); + g_globals->_sceneManager._scrollerRect = Rect(40, 90, 280, 180); + g_globals->_player.postInit(); + g_globals->_player.setVisage(1401); + g_globals->_player.animate(ANIM_MODE_2, 0); + g_globals->_player.setStrip2(4); + g_globals->_player.fixPriority(4); + g_globals->_player.disableControl(); - _globals->_player._moveDiff = Common::Point(4, 2); - _globals->_player.setPosition(Common::Point(160, 800)); - _globals->_sceneManager._scene->_sceneBounds.center(_globals->_player._position); - _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); - _globals->_sceneOffset.y = (_globals->_sceneManager._scene->_sceneBounds.top / 100) * 100; + g_globals->_player._moveDiff = Common::Point(4, 2); + g_globals->_player.setPosition(Common::Point(160, 800)); + g_globals->_sceneManager._scene->_sceneBounds.center(g_globals->_player._position); + g_globals->_sceneManager._scene->_sceneBounds.contain(g_globals->_sceneManager._scene->_backgroundBounds); + g_globals->_sceneOffset.y = (g_globals->_sceneManager._scene->_sceneBounds.top / 100) * 100; setAction(&_action1); - _globals->_soundHandler.play(118); + g_globals->_soundHandler.play(118); } /*-------------------------------------------------------------------------- @@ -791,7 +791,7 @@ void Scene1400::postInit(SceneObjectList *OwnerList) { *--------------------------------------------------------------------------*/ void Scene1500::Action1::signal() { - Scene1500 *scene = (Scene1500 *)_globals->_sceneManager._scene; + Scene1500 *scene = (Scene1500 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: { @@ -856,17 +856,17 @@ void Scene1500::Action1::signal() { scene->_soundHandler.play(124, this); break; case 8: - _globals->_soundHandler.play(126, this); + g_globals->_soundHandler.play(126, this); break; case 9: - _globals->_soundHandler.play(127); - _globals->_sceneManager.changeScene(2000); + g_globals->_soundHandler.play(127); + g_globals->_sceneManager.changeScene(2000); break; } } void Scene1500::Action2::signal() { - Scene1500 *scene = (Scene1500 *)_globals->_sceneManager._scene; + Scene1500 *scene = (Scene1500 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -897,8 +897,8 @@ void Scene1500::Action2::signal() { } case 3: scene->_soundHandler.release(); - _globals->_stripNum = 1505; - _globals->_sceneManager.changeScene(2400); + g_globals->_stripNum = 1505; + g_globals->_sceneManager.changeScene(2400); break; } } @@ -909,8 +909,8 @@ void Scene1500::postInit(SceneObjectList *OwnerList) { loadScene(1500); Scene::postInit(); - if ((_globals->_stripNum == 1500) || ((_globals->_stripNum != 1504) && (_globals->_stripNum != 2751))) { - _globals->_soundHandler.play(120); + if ((g_globals->_stripNum == 1500) || ((g_globals->_stripNum != 1504) && (g_globals->_stripNum != 2751))) { + g_globals->_soundHandler.play(120); setZoomPercents(105, 20, 145, 100); setAction(&_action1); diff --git a/engines/tsage/ringworld/ringworld_scenes3.cpp b/engines/tsage/ringworld/ringworld_scenes3.cpp index f744a98c33..7103a48ed9 100644 --- a/engines/tsage/ringworld/ringworld_scenes3.cpp +++ b/engines/tsage/ringworld/ringworld_scenes3.cpp @@ -36,7 +36,7 @@ namespace Ringworld { *--------------------------------------------------------------------------*/ void Scene2000::Action1::signal() { - Scene2000 *scene = (Scene2000 *)_globals->_sceneManager._scene; + Scene2000 *scene = (Scene2000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -49,82 +49,82 @@ void Scene2000::Action1::signal() { setDelay(4); break; case 3: - _globals->_stripNum = 0; - _globals->_sceneManager.changeScene(1250); + g_globals->_stripNum = 0; + g_globals->_sceneManager.changeScene(1250); break; } } void Scene2000::Action2::signal() { - Scene2000 *scene = (Scene2000 *)_globals->_sceneManager._scene; + Scene2000 *scene = (Scene2000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: scene->_object2.animate(ANIM_MODE_6, NULL); - setDelay(_globals->_randomSource.getRandomNumber(179) + 60); + setDelay(g_globals->_randomSource.getRandomNumber(179) + 60); break; case 1: - setDelay(_globals->_randomSource.getRandomNumber(179) + 60); - if (_globals->_randomSource.getRandomNumber(4) >= 2) + setDelay(g_globals->_randomSource.getRandomNumber(179) + 60); + if (g_globals->_randomSource.getRandomNumber(4) >= 2) _actionIndex = 0; break; case 2: - setDelay(_globals->_randomSource.getRandomNumber(179) + 60); - _actionIndex = _globals->_randomSource.getRandomNumber(1); + setDelay(g_globals->_randomSource.getRandomNumber(179) + 60); + _actionIndex = g_globals->_randomSource.getRandomNumber(1); break; } } void Scene2000::Action3::signal() { - Scene2000 *scene = (Scene2000 *)_globals->_sceneManager._scene; + Scene2000 *scene = (Scene2000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: scene->_object6.animate(ANIM_MODE_5, NULL); - setDelay(_globals->_randomSource.getRandomNumber(179) + 60); + setDelay(g_globals->_randomSource.getRandomNumber(179) + 60); break; case 1: scene->_object6.animate(ANIM_MODE_6, NULL); - setDelay(_globals->_randomSource.getRandomNumber(179) + 60); + setDelay(g_globals->_randomSource.getRandomNumber(179) + 60); _actionIndex = 0; break; } } void Scene2000::Action4::signal() { - Scene2000 *scene = (Scene2000 *)_globals->_sceneManager._scene; + Scene2000 *scene = (Scene2000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: scene->_object4.animate(ANIM_MODE_5, NULL); - setDelay(_globals->_randomSource.getRandomNumber(179) + 60); + setDelay(g_globals->_randomSource.getRandomNumber(179) + 60); break; case 1: scene->_object4.animate(ANIM_MODE_6, NULL); - setDelay(_globals->_randomSource.getRandomNumber(179) + 60); + setDelay(g_globals->_randomSource.getRandomNumber(179) + 60); _actionIndex = 0; break; } } void Scene2000::Action5::signal() { - Scene2000 *scene = (Scene2000 *)_globals->_sceneManager._scene; + Scene2000 *scene = (Scene2000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: scene->_object3.animate(ANIM_MODE_5, NULL); - setDelay(_globals->_randomSource.getRandomNumber(125) + 300); + setDelay(g_globals->_randomSource.getRandomNumber(125) + 300); break; case 1: scene->_object3.animate(ANIM_MODE_6, NULL); - setDelay(_globals->_randomSource.getRandomNumber(125) + 300); + setDelay(g_globals->_randomSource.getRandomNumber(125) + 300); _actionIndex = 0; break; } } void Scene2000::Action6::signal() { - Scene2000 *scene = (Scene2000 *)_globals->_sceneManager._scene; + Scene2000 *scene = (Scene2000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -135,7 +135,7 @@ void Scene2000::Action6::signal() { scene->_stripManager.start(2000, this); break; case 2: - _globals->_soundHandler.play(81); + g_globals->_soundHandler.play(81); scene->_object6.postInit(); scene->_object6.setVisage(2003); scene->_object6.setAction(NULL); @@ -150,15 +150,15 @@ void Scene2000::Action6::signal() { scene->_object6.animate(ANIM_MODE_6, this); break; case 5: - _globals->_soundHandler.play(80); + g_globals->_soundHandler.play(80); scene->_object6.remove(); - _globals->_sceneManager.changeScene(1001); + g_globals->_sceneManager.changeScene(1001); break; } } void Scene2000::Action7::signal() { - Scene2000 *scene = (Scene2000 *)_globals->_sceneManager._scene; + Scene2000 *scene = (Scene2000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -171,13 +171,13 @@ void Scene2000::Action7::signal() { setDelay(3); break; case 3: - _globals->_sceneManager.changeScene(2222); + g_globals->_sceneManager.changeScene(2222); break; } } void Scene2000::Action8::signal() { - Scene2000 *scene = (Scene2000 *)_globals->_sceneManager._scene; + Scene2000 *scene = (Scene2000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -190,14 +190,14 @@ void Scene2000::Action8::signal() { setDelay(10); break; case 3: - _globals->_stripNum = 2005; - _globals->_sceneManager.changeScene(1000); + g_globals->_stripNum = 2005; + g_globals->_sceneManager.changeScene(1000); break; } } void Scene2000::Action9::signal() { - Scene2000 *scene = (Scene2000 *)_globals->_sceneManager._scene; + Scene2000 *scene = (Scene2000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -210,8 +210,8 @@ void Scene2000::Action9::signal() { setDelay(3); break; case 3: - _globals->_stripNum = 2008; - _globals->_sceneManager.changeScene(9999); + g_globals->_stripNum = 2008; + g_globals->_sceneManager.changeScene(9999); break; } } @@ -230,14 +230,14 @@ void Scene2000::Action10::signal() { break; case 3: SceneItem::display(0, 0); - _globals->_stripNum = 0; - _globals->_sceneManager.changeScene(9999); + g_globals->_stripNum = 0; + g_globals->_sceneManager.changeScene(9999); break; } } void Scene2000::Action11::signal() { - Scene2000 *scene = (Scene2000 *)_globals->_sceneManager._scene; + Scene2000 *scene = (Scene2000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -250,35 +250,35 @@ void Scene2000::Action11::signal() { scene->_stripManager.start(2077, this); break; case 3: - _globals->_stripNum = 0; - _globals->_sceneManager.changeScene(1400); + g_globals->_stripNum = 0; + g_globals->_sceneManager.changeScene(1400); break; } } void Scene2000::Action12::signal() { - Scene2000 *scene = (Scene2000 *)_globals->_sceneManager._scene; + Scene2000 *scene = (Scene2000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: setDelay(60); break; case 1: - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_events.setCursor(CURSOR_WALK); scene->_stripManager.start(2020, this); break; case 2: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(10); break; case 3: - _globals->_sceneManager.changeScene(2300); + g_globals->_sceneManager.changeScene(2300); break; } } void Scene2000::Action13::signal() { - Scene2000 *scene = (Scene2000 *)_globals->_sceneManager._scene; + Scene2000 *scene = (Scene2000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -289,18 +289,18 @@ void Scene2000::Action13::signal() { break; case 2: SceneItem::display(0, 0); - _globals->_stripNum = 2751; - _globals->_sceneManager.changeScene(1500); + g_globals->_stripNum = 2751; + g_globals->_sceneManager.changeScene(1500); break; } } void Scene2000::Action14::signal() { - Scene2000 *scene = (Scene2000 *)_globals->_sceneManager._scene; + Scene2000 *scene = (Scene2000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(30); break; case 1: @@ -310,12 +310,12 @@ void Scene2000::Action14::signal() { setDelay(60); break; case 3: - _globals->_soundHandler.play(99); + g_globals->_soundHandler.play(99); scene->_object8.show(); scene->_object8.animate(ANIM_MODE_5, this); break; case 4: - _globals->_soundHandler.play(12); + g_globals->_soundHandler.play(12); scene->_object8.setStrip(2); scene->_object8.setFrame(1); scene->_object9.show(); @@ -326,7 +326,7 @@ void Scene2000::Action14::signal() { scene->_stripManager.start(2001, this, scene); break; case 6: - _globals->_soundHandler.fadeOut(NULL); + g_globals->_soundHandler.fadeOut(NULL); scene->_object8.setStrip(1); scene->_object8.setFrame(scene->_object8.getFrameCount()); scene->_object8.animate(ANIM_MODE_6, this); @@ -335,7 +335,7 @@ void Scene2000::Action14::signal() { scene->_object10.remove(); break; case 7: - _globals->_soundHandler.play(111); + g_globals->_soundHandler.play(111); scene->_object8.remove(); setDelay(5); break; @@ -343,8 +343,8 @@ void Scene2000::Action14::signal() { scene->_stripManager.start(2071, this); break; case 9: - _globals->_stripNum = 1250; - _globals->_sceneManager.changeScene(1000); + g_globals->_stripNum = 1250; + g_globals->_sceneManager.changeScene(1000); break; } } @@ -386,7 +386,7 @@ void Scene2000::postInit(SceneObjectList *OwnerList) { _object2.setPosition(Common::Point(43, 115)); _object2.setAction(&_action2); - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _object6.postInit(); _object6.setVisage(2003); @@ -415,7 +415,7 @@ void Scene2000::postInit(SceneObjectList *OwnerList) { _object10.fixPriority(195); _object10.hide(); - switch (_globals->_sceneManager._previousScene) { + switch (g_globals->_sceneManager._previousScene) { case 1000: setAction(&_action7); break; @@ -427,11 +427,11 @@ void Scene2000::postInit(SceneObjectList *OwnerList) { setAction(&_action13); break; case 2200: - _globals->_soundHandler.play(111); + g_globals->_soundHandler.play(111); setAction(&_action14); break; case 2222: - _globals->_soundHandler.play(115); + g_globals->_soundHandler.play(115); setAction(&_action8); break; case 3500: @@ -439,14 +439,14 @@ void Scene2000::postInit(SceneObjectList *OwnerList) { break; default: _object6.remove(); - _globals->_soundHandler.play(80); + g_globals->_soundHandler.play(80); setAction(&_action6); break; } _soundHandler1.play(78); - _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); - _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; + g_globals->_sceneManager._scene->_sceneBounds.contain(g_globals->_sceneManager._scene->_backgroundBounds); + g_globals->_sceneOffset.x = (g_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; } void Scene2000::stripCallback(int v) { @@ -485,22 +485,22 @@ void Scene2000::stripCallback(int v) { *--------------------------------------------------------------------------*/ void Scene2100::Action1::signal() { - Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; + Scene2100 *scene = (Scene2100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); if (!scene->_sitFl) setDelay(1); else { - setAction(&scene->_sequenceManager, this, 2102, &_globals->_player, NULL); + setAction(&scene->_sequenceManager, this, 2102, &g_globals->_player, NULL); scene->_sitFl = 0; } break; case 1: { Common::Point pt(157, 62); PlayerMover *mover = new PlayerMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 2: @@ -510,15 +510,15 @@ void Scene2100::Action1::signal() { case 3: { Common::Point pt(157, 56); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 4: - _globals->_player._strip = 3; + g_globals->_player._strip = 3; setDelay(3); break; case 5: - _globals->_player.fixPriority(1); + g_globals->_player.fixPriority(1); scene->_area1.display(); scene->_area2.display(); scene->_area3.display(); @@ -526,12 +526,12 @@ void Scene2100::Action1::signal() { scene->_area1.draw(true); _state = 0; - _globals->_events.setCursor(CURSOR_USE); + g_globals->_events.setCursor(CURSOR_USE); - while (!_state && !_vm->shouldQuit()) { + while (!_state && !g_vm->shouldQuit()) { // Wait for an event Event event; - if (!_globals->_events.getEvent(event)) { + if (!g_globals->_events.getEvent(event)) { g_system->updateScreen(); g_system->delayMillis(10); continue; @@ -570,37 +570,37 @@ void Scene2100::Action1::signal() { if (_state == 2100) { Common::Point pt(157, 65); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } else { - _globals->_sceneManager.changeScene(_state); + g_globals->_sceneManager.changeScene(_state); } break; case 7: - _globals->_player.fixPriority(-1); + g_globals->_player.fixPriority(-1); scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_6, this); break; case 8: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; } } void Scene2100::Action2::signal() { - Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; + Scene2100 *scene = (Scene2100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: scene->_object3._numFrames = 5; - setDelay(_globals->_randomSource.getRandomNumber(59)); + setDelay(g_globals->_randomSource.getRandomNumber(59)); break; case 1: scene->_object3.animate(ANIM_MODE_5, this); break; case 2: - setDelay(_globals->_randomSource.getRandomNumber(59)); + setDelay(g_globals->_randomSource.getRandomNumber(59)); break; case 3: scene->_object3.animate(ANIM_MODE_6, this); @@ -610,12 +610,12 @@ void Scene2100::Action2::signal() { } void Scene2100::Action3::signal() { - Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; + Scene2100 *scene = (Scene2100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: case 2: - setDelay(_globals->_randomSource.getRandomNumber(119)); + setDelay(g_globals->_randomSource.getRandomNumber(119)); break; case 1: scene->_object2.animate(ANIM_MODE_5, this); @@ -628,64 +628,64 @@ void Scene2100::Action3::signal() { } void Scene2100::Action4::signal() { - Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; + Scene2100 *scene = (Scene2100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); if (!scene->_sitFl) setDelay(1); else - setAction(&scene->_sequenceManager, this, 2102, &_globals->_player, NULL); + setAction(&scene->_sequenceManager, this, 2102, &g_globals->_player, NULL); break; case 1: { Common::Point pt(80, 66); PlayerMover *mover = new PlayerMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 2: - _globals->_player.setVisage(2109); - _globals->_player._frame = 1; - _globals->_player._strip = 2; - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.setVisage(2109); + g_globals->_player._frame = 1; + g_globals->_player._strip = 2; + g_globals->_player.animate(ANIM_MODE_5, this); break; case 3: - _globals->_sceneManager.changeScene(2120); + g_globals->_sceneManager.changeScene(2120); break; } } void Scene2100::Action5::signal() { // Quinn enters the cokpit after Seeker decided to enter the cave alone - Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; + Scene2100 *scene = (Scene2100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: setDelay(30); break; case 1: - setAction(&scene->_sequenceManager, this, 2104, &_globals->_player, &scene->_object1, NULL); + setAction(&scene->_sequenceManager, this, 2104, &g_globals->_player, &scene->_object1, NULL); break; case 2: { Common::Point pt(272, 127); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 3: - _globals->_player.checkAngle(&scene->_object3); + g_globals->_player.checkAngle(&scene->_object3); setDelay(30); break; case 4: - _globals->_sceneManager.changeScene(3700); + g_globals->_sceneManager.changeScene(3700); break; } } void Scene2100::Action6::signal() { // Seeker stands up and walks to the elevator - Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; + Scene2100 *scene = (Scene2100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: { @@ -717,50 +717,50 @@ void Scene2100::Action6::signal() { } void Scene2100::Action7::signal() { - Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; + Scene2100 *scene = (Scene2100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: setDelay(60); break; case 1: - setAction(&scene->_sequenceManager, this, 2104, &_globals->_player, &scene->_object1, NULL); + setAction(&scene->_sequenceManager, this, 2104, &g_globals->_player, &scene->_object1, NULL); break; case 2: - setAction(&scene->_sequenceManager, this, 2104, &_globals->_player, NULL); + setAction(&scene->_sequenceManager, this, 2104, &g_globals->_player, NULL); break; case 3: - _globals->_sceneManager.changeScene(8100); + g_globals->_sceneManager.changeScene(8100); break; } } void Scene2100::Action8::signal() { - Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; + Scene2100 *scene = (Scene2100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: setDelay(60); break; case 1: - setAction(&scene->_sequenceManager, this, 2104, &_globals->_player, &scene->_object1, NULL); + setAction(&scene->_sequenceManager, this, 2104, &g_globals->_player, &scene->_object1, NULL); break; case 2: { Common::Point pt(200, 174); PlayerMover *mover = new PlayerMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 3: - _globals->_player.checkAngle(&scene->_object3); + g_globals->_player.checkAngle(&scene->_object3); scene->_stripManager.start((RING_INVENTORY._translator._sceneNumber == 1) ? 7720 : 7710, this); break; case 4: if (RING_INVENTORY._translator._sceneNumber != 1) - _globals->_sceneManager.changeScene(7600); + g_globals->_sceneManager.changeScene(7600); else { - _globals->setFlag(24); - _globals->_player.enableControl(); + g_globals->setFlag(24); + g_globals->_player.enableControl(); remove(); } break; @@ -768,7 +768,7 @@ void Scene2100::Action8::signal() { } void Scene2100::Action9::signal() { - Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; + Scene2100 *scene = (Scene2100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -795,7 +795,7 @@ void Scene2100::Action9::signal() { break; case 5: scene->_object4.hide(); - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_events.setCursor(CURSOR_WALK); scene->_stripManager.start(6010, this); break; case 6: @@ -808,20 +808,20 @@ void Scene2100::Action9::signal() { } void Scene2100::Action10::signal() { - Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; + Scene2100 *scene = (Scene2100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: setDelay(60); break; case 1: - setAction(&scene->_sequenceManager, this, 2102, &_globals->_player, NULL); + setAction(&scene->_sequenceManager, this, 2102, &g_globals->_player, NULL); break; case 2: { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); Common::Point pt(155, 64); PlayerMover *mover = new PlayerMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 3: @@ -853,10 +853,10 @@ void Scene2100::Action10::signal() { scene->_object1.animate(ANIM_MODE_5, this); break; case 6: { - _globals->_player.fixPriority(1); + g_globals->_player.fixPriority(1); Common::Point pt(144, 54); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 7: { @@ -872,8 +872,8 @@ void Scene2100::Action10::signal() { break; } case 8: - _globals->_player.fixPriority(1); - _globals->_player.setStrip(1); + g_globals->_player.fixPriority(1); + g_globals->_player.setStrip(1); scene->_object3.fixPriority(1); scene->_object3.setStrip(2); scene->_object2.fixPriority(2); @@ -886,16 +886,16 @@ void Scene2100::Action10::signal() { scene->_object1.animate(ANIM_MODE_6, this); break; case 10: - _globals->setFlag(70); - _globals->_stripNum = 2101; - _globals->_sceneManager.changeScene(2320); + g_globals->setFlag(70); + g_globals->_stripNum = 2101; + g_globals->_sceneManager.changeScene(2320); break; } } void Scene2100::Action11::signal() { // Miranda stands up and walks to the elevator - Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; + Scene2100 *scene = (Scene2100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -953,16 +953,16 @@ void Scene2100::Action11::signal() { case 7: scene->_object3.remove(); scene->_object2.remove(); - _globals->setFlag(70); - _globals->_stripNum = 2102; - _globals->_player.enableControl(); - _globals->_player._canWalk = false; + g_globals->setFlag(70); + g_globals->_stripNum = 2102; + g_globals->_player.enableControl(); + g_globals->_player._canWalk = false; break; } } void Scene2100::Action12::signal() { - Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; + Scene2100 *scene = (Scene2100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -978,7 +978,7 @@ void Scene2100::Action12::signal() { case 3: { Common::Point pt1(158, 74); NpcMover *mover1 = new NpcMover(); - _globals->_player.addMover(mover1, &pt1, this); + g_globals->_player.addMover(mover1, &pt1, this); Common::Point pt2(158, 68); NpcMover *mover2 = new NpcMover(); @@ -989,10 +989,10 @@ void Scene2100::Action12::signal() { scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_6, NULL); - _globals->_player.fixPriority(-1); + g_globals->_player.fixPriority(-1); Common::Point pt1(277, 84); PlayerMover *mover1 = new PlayerMover(); - _globals->_player.addMover(mover1, &pt1, this); + g_globals->_player.addMover(mover1, &pt1, this); scene->_object2.fixPriority(-1); Common::Point pt2(255, 76); @@ -1001,29 +1001,29 @@ void Scene2100::Action12::signal() { break; } case 6: - _globals->_player.setStrip(4); + g_globals->_player.setStrip(4); scene->_object2.setStrip(4); setDelay(60); break; case 7: - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_events.setCursor(CURSOR_WALK); scene->_stripManager.start(6052, this); break; case 8: if (scene->_stripManager._field2E8 == 320) - _globals->setFlag(74); + g_globals->setFlag(74); setDelay(30); break; case 9: - _globals->_events.setCursor(OBJECT_STUNNER); + g_globals->_events.setCursor(OBJECT_STUNNER); scene->_object2.setAction(&scene->_action13); setDelay(60); break; case 10: - if (_globals->getFlag(74)) + if (g_globals->getFlag(74)) setDelay(1); else - setAction(&scene->_sequenceManager, this, 2101, &_globals->_player, NULL); + setAction(&scene->_sequenceManager, this, 2101, &g_globals->_player, NULL); break; case 11: scene->_stripManager.start(2170, this); @@ -1032,14 +1032,14 @@ void Scene2100::Action12::signal() { setDelay(5); break; case 13: - scene->_stripManager.start(_globals->getFlag(74) ? 2172 : 2174, this); + scene->_stripManager.start(g_globals->getFlag(74) ? 2172 : 2174, this); break; case 14: - if (_globals->getFlag(74)) { - _globals->_stripNum = 6100; - _globals->_sceneManager.changeScene(2320); + if (g_globals->getFlag(74)) { + g_globals->_stripNum = 6100; + g_globals->_sceneManager.changeScene(2320); } else { - _globals->_sceneManager.changeScene(6100); + g_globals->_sceneManager.changeScene(6100); } remove(); break; @@ -1047,7 +1047,7 @@ void Scene2100::Action12::signal() { } void Scene2100::Action13::signal() { - Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; + Scene2100 *scene = (Scene2100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -1082,17 +1082,17 @@ void Scene2100::Action13::signal() { } void Scene2100::Action14::signal() { - Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; + Scene2100 *scene = (Scene2100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: setDelay(6); break; case 1: - setAction(&scene->_sequenceManager, this, 2104, &_globals->_player, &scene->_object1, NULL); + setAction(&scene->_sequenceManager, this, 2104, &g_globals->_player, &scene->_object1, NULL); break; case 2: - setAction(&scene->_sequenceManager, this, 2101, &_globals->_player, NULL); + setAction(&scene->_sequenceManager, this, 2101, &g_globals->_player, NULL); break; case 3: scene->_stripManager.start(6008, this); @@ -1160,14 +1160,14 @@ void Scene2100::Action14::signal() { setDelay(90); break; case 15: - _globals->_sceneManager.changeScene(7000); + g_globals->_sceneManager.changeScene(7000); remove(); break; } } void Scene2100::Action15::signal() { - Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; + Scene2100 *scene = (Scene2100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -1232,7 +1232,7 @@ void Scene2100::Action15::signal() { } void Scene2100::Action16::signal() { - Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; + Scene2100 *scene = (Scene2100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -1243,13 +1243,13 @@ void Scene2100::Action16::signal() { scene->_stripManager.start(7001, this); break; case 2: - setAction(&scene->_sequenceManager, this, 2102, &_globals->_player, NULL); + setAction(&scene->_sequenceManager, this, 2102, &g_globals->_player, NULL); break; case 3: { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); Common::Point pt(155, 63); PlayerMover *mover = new PlayerMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 5: @@ -1259,12 +1259,12 @@ void Scene2100::Action16::signal() { case 6: { Common::Point pt(160, 54); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 7: - _globals->_player.fixPriority(1); - _globals->_player.setStrip(3); + g_globals->_player.fixPriority(1); + g_globals->_player.setStrip(3); setDelay(45); break; case 8: @@ -1272,26 +1272,26 @@ void Scene2100::Action16::signal() { scene->_object1.animate(ANIM_MODE_6, this); break; case 9: - _globals->setFlag(15); - _globals->setFlag(36); - _globals->_sceneManager.changeScene(7000); + g_globals->setFlag(15); + g_globals->setFlag(36); + g_globals->_sceneManager.changeScene(7000); remove(); break; } } void Scene2100::Action17::signal() { - Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; + Scene2100 *scene = (Scene2100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: setDelay(60); break; case 1: - setAction(&scene->_sequenceManager, this, 2104, &_globals->_player, &scene->_object1, NULL); + setAction(&scene->_sequenceManager, this, 2104, &g_globals->_player, &scene->_object1, NULL); break; case 2: - setAction(&scene->_sequenceManager, this, 2101, &_globals->_player, NULL); + setAction(&scene->_sequenceManager, this, 2101, &g_globals->_player, NULL); break; case 3: scene->_stripManager.start(7070, this); @@ -1317,7 +1317,7 @@ void Scene2100::Action17::signal() { break; case 8: RING_INVENTORY._stasisNegator._sceneNumber = 1; - _globals->_sceneManager.changeScene(9100); + g_globals->_sceneManager.changeScene(9100); remove(); break; } @@ -1326,17 +1326,17 @@ void Scene2100::Action17::signal() { /*--------------------------------------------------------------------------*/ void Scene2100::Hotspot2::doAction(int action) { - Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; + Scene2100 *scene = (Scene2100 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(2100, 3); break; case CURSOR_USE: - if (_globals->getFlag(13)) + if (g_globals->getFlag(13)) SceneItem::display2(2100, 29); else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->setAction(&scene->_action4); } break; @@ -1348,17 +1348,17 @@ void Scene2100::Hotspot2::doAction(int action) { void Scene2100::Hotspot3::doAction(int action) { // Computer, on the left - Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; + Scene2100 *scene = (Scene2100 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(2100, 4); break; case CURSOR_USE: - if (_globals->getFlag(13)) + if (g_globals->getFlag(13)) SceneItem::display2(2100, 29); else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->setAction(&scene->_action4); } break; @@ -1383,17 +1383,17 @@ void Scene2100::Hotspot4::doAction(int action) { } void Scene2100::Hotspot8::doAction(int action) { - Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; + Scene2100 *scene = (Scene2100 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(2100, 12); break; case CURSOR_USE: - if (_globals->getFlag(13)) + if (g_globals->getFlag(13)) SceneItem::display2(2100, 29); else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->setAction(&scene->_action4); } break; @@ -1405,7 +1405,7 @@ void Scene2100::Hotspot8::doAction(int action) { void Scene2100::Hotspot10::doAction(int action) { // Quinn's Console - Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; + Scene2100 *scene = (Scene2100 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -1413,15 +1413,15 @@ void Scene2100::Hotspot10::doAction(int action) { break; case CURSOR_USE: if (scene->_sitFl) { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 2102; - scene->setAction(&scene->_sequenceManager, scene, 2102, &_globals->_player, NULL); - } else if (_globals->getFlag(13)) { + scene->setAction(&scene->_sequenceManager, scene, 2102, &g_globals->_player, NULL); + } else if (g_globals->getFlag(13)) { SceneItem::display2(2100, 28); } else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 2101; - scene->setAction(&scene->_sequenceManager, scene, 2101, &_globals->_player, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2101, &g_globals->_player, NULL); } break; default: @@ -1433,13 +1433,13 @@ void Scene2100::Hotspot10::doAction(int action) { void Scene2100::Hotspot14::doAction(int action) { switch (action) { case CURSOR_LOOK: - if (_globals->getFlag(0)) + if (g_globals->getFlag(0)) SceneItem::display2(2100, 19); else SceneItem::display2(2100, 18); break; case CURSOR_USE: - if (_globals->getFlag(1)) + if (g_globals->getFlag(1)) SceneItem::display2(2100, 21); else SceneItem::display2(2100, 20); @@ -1452,7 +1452,7 @@ void Scene2100::Hotspot14::doAction(int action) { void Scene2100::Object1::doAction(int action) { // Elevator - Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; + Scene2100 *scene = (Scene2100 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -1468,29 +1468,29 @@ void Scene2100::Object1::doAction(int action) { } void Scene2100::Object2::doAction(int action) { - Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; + Scene2100 *scene = (Scene2100 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(2100, 30); break; case CURSOR_TALK: - if (_globals->getFlag(72)) { - _globals->_player.disableControl(); - if (!_globals->getFlag(52)) { + if (g_globals->getFlag(72)) { + g_globals->_player.disableControl(); + if (!g_globals->getFlag(52)) { scene->_sceneMode = 2111; scene->setAction(&scene->_sequenceManager, scene, 2111, NULL); } else { - scene->_sceneMode = _globals->getFlag(53) ? 2112 : 2110; + scene->_sceneMode = g_globals->getFlag(53) ? 2112 : 2110; scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, NULL); } - } else if (_globals->getFlag(13)) { + } else if (g_globals->getFlag(13)) { SceneItem::display2(2100, 31); - } else if (_globals->getFlag(14)) { + } else if (g_globals->getFlag(14)) { SceneItem::display2(2100, 32); } else { - _globals->setFlag(14); - _globals->_player.disableControl(); + g_globals->setFlag(14); + g_globals->_player.disableControl(); scene->_sceneMode = 2108; scene->setAction(&scene->_sequenceManager, scene, 2109, NULL); } @@ -1503,19 +1503,19 @@ void Scene2100::Object2::doAction(int action) { void Scene2100::Object3::doAction(int action) { // Miranda - Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; + Scene2100 *scene = (Scene2100 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: - if (_globals->getFlag(59)) + if (g_globals->getFlag(59)) SceneItem::display2(2100, 34); else error("***I have no response."); break; case CURSOR_TALK: - if (_globals->getFlag(59)) { - _globals->_player.disableControl(); + if (g_globals->getFlag(59)) { + g_globals->_player.disableControl(); scene->_sceneMode = 2108; scene->setAction(&scene->_sequenceManager, scene, 2108, NULL); } else { @@ -1566,7 +1566,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_speakerHText); _stripManager.addSpeaker(&_speakerGameText); _speakerMText._npc = &_object3; - _speakerQText._npc = &_globals->_player; + _speakerQText._npc = &g_globals->_player; _speakerSText._npc = &_object2; _object1.postInit(); @@ -1646,7 +1646,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _hotspot15.setBounds(Rect(14, 90, 46, 107)); _hotspot1.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); - if (!_globals->getFlag(36) && !_globals->getFlag(70) && !_globals->getFlag(43)) { + if (!g_globals->getFlag(36) && !g_globals->getFlag(70) && !g_globals->getFlag(43)) { _object3.postInit(); _object3.setPosition(Common::Point(246, 156)); _object3.animate(ANIM_MODE_NONE, NULL); @@ -1655,10 +1655,10 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _object3.setVisage(2107); _object3.setStrip(1); _object3.setAction(&_action2); - _globals->_sceneItems.push_back(&_object3); + g_globals->_sceneItems.push_back(&_object3); } - if (!_globals->getFlag(59) && !_globals->getFlag(70) && !_globals->getFlag(37) && !_globals->getFlag(114)) { + if (!g_globals->getFlag(59) && !g_globals->getFlag(70) && !g_globals->getFlag(37) && !g_globals->getFlag(114)) { _object2.postInit(); _object2.setVisage(2108); _object2._strip = 3; @@ -1667,50 +1667,50 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _object2.changeZoom(100); _object2.fixPriority(113); _object2.setAction(&_action3); - _globals->_sceneItems.push_back(&_object2); + g_globals->_sceneItems.push_back(&_object2); } - _globals->_sceneItems.addItems(&_hotspot15, &_hotspot11, &_hotspot10, &_hotspot9, &_hotspot14, + g_globals->_sceneItems.addItems(&_hotspot15, &_hotspot11, &_hotspot10, &_hotspot9, &_hotspot14, &_hotspot13, &_hotspot12, &_hotspot8, &_object1, &_hotspot2, &_hotspot3, &_hotspot4, &_hotspot5, &_hotspot6, &_hotspot7, &_hotspot1, NULL); - _globals->_player.postInit(); - if (_globals->getFlag(13)) { - _globals->_player.setVisage(2170); - _globals->_player._moveDiff.y = 1; + g_globals->_player.postInit(); + if (g_globals->getFlag(13)) { + g_globals->_player.setVisage(2170); + g_globals->_player._moveDiff.y = 1; } else { - _globals->_player.setVisage(0); - _globals->_player._moveDiff.y = 3; + g_globals->_player.setVisage(0); + g_globals->_player._moveDiff.y = 3; } - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player._moveDiff.x = 4; - _globals->_player.changeZoom(-1); - _globals->_player.disableControl(); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player._moveDiff.x = 4; + g_globals->_player.changeZoom(-1); + g_globals->_player.disableControl(); _sitFl = 0; - switch (_globals->_sceneManager._previousScene) { + switch (g_globals->_sceneManager._previousScene) { case 2120: - _globals->_soundHandler.play(160); - _globals->_soundHandler.holdAt(true); + g_globals->_soundHandler.play(160); + g_globals->_soundHandler.holdAt(true); _object1.fixPriority(-1); - _globals->_player.fixPriority(-1); - _globals->_player.setPosition(Common::Point(80, 66)); - _globals->_player.enableControl(); + g_globals->_player.fixPriority(-1); + g_globals->_player.setPosition(Common::Point(80, 66)); + g_globals->_player.enableControl(); break; case 2150: - _globals->_player.fixPriority(1); - _globals->_player.setPosition(Common::Point(157, 56)); + g_globals->_player.fixPriority(1); + g_globals->_player.setPosition(Common::Point(157, 56)); _sceneMode = 2104; - setAction(&_sequenceManager, this, 2104, &_globals->_player, &_object1, NULL); + setAction(&_sequenceManager, this, 2104, &g_globals->_player, &_object1, NULL); break; case 2222: - if (_globals->_sceneObjects->contains(&_object3)) + if (g_globals->_sceneObjects->contains(&_object3)) _object3.remove(); - _globals->_player.fixPriority(1); - _globals->_player.setPosition(Common::Point(144, 55)); + g_globals->_player.fixPriority(1); + g_globals->_player.setPosition(Common::Point(144, 55)); _object2.setVisage(2806); _object2.changeZoom(-1); @@ -1723,12 +1723,12 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { setAction(&_action12); break; case 2320: - if (_globals->_stripNum == 2321) { - if (_globals->_sceneObjects->contains(&_object3)) + if (g_globals->_stripNum == 2321) { + if (g_globals->_sceneObjects->contains(&_object3)) _object3.remove(); - _globals->_player.fixPriority(1); - _globals->_player.setPosition(Common::Point(144, 55)); + g_globals->_player.fixPriority(1); + g_globals->_player.setPosition(Common::Point(144, 55)); _object2.postInit(); _object2.setVisage(2806); @@ -1741,9 +1741,9 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _object2.animate(ANIM_MODE_1, NULL); setAction(&_action12); - } else if (_globals->_stripNum == 6100) { - _globals->_player.setPosition(Common::Point(157, 56)); - _globals->_player.fixPriority(1); + } else if (g_globals->_stripNum == 6100) { + g_globals->_player.setPosition(Common::Point(157, 56)); + g_globals->_player.fixPriority(1); _object4.postInit(); _object4.setVisage(2102); @@ -1752,27 +1752,27 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { setAction(&_action14); } else { - _globals->_player.disableControl(); - _globals->_player.fixPriority(1); - _globals->_player.setPosition(Common::Point(157, 56)); + g_globals->_player.disableControl(); + g_globals->_player.fixPriority(1); + g_globals->_player.setPosition(Common::Point(157, 56)); _sceneMode = 2104; - setAction(&_sequenceManager, this, 2104, &_globals->_player, &_object1, NULL); + setAction(&_sequenceManager, this, 2104, &g_globals->_player, &_object1, NULL); } break; case 3700: - _globals->_soundHandler.play(160); - _globals->_soundHandler.holdAt(true); + g_globals->_soundHandler.play(160); + g_globals->_soundHandler.holdAt(true); Scene::setZoomPercents(80, 75, 100, 90); - if (_globals->_sceneObjects->contains(&_object2)) + if (g_globals->_sceneObjects->contains(&_object2)) _object2.remove(); - _globals->_player._angle = 225; - _globals->_player.setStrip(6); - _globals->_player.setFrame(1); - _globals->_player.fixPriority(-1); - _globals->_player.setPosition(Common::Point(272, 127)); + g_globals->_player._angle = 225; + g_globals->_player.setStrip(6); + g_globals->_player.setFrame(1); + g_globals->_player.fixPriority(-1); + g_globals->_player.setPosition(Common::Point(272, 127)); _object3.setPosition(Common::Point(246, 156)); _object3.fixPriority(156); @@ -1780,15 +1780,15 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { setAction(&_sequenceManager, this, 2105, &_object3, NULL); break; case 4250: - _globals->_soundHandler.play(160); - _globals->_soundHandler.holdAt(true); - _globals->clearFlag(43); + g_globals->_soundHandler.play(160); + g_globals->_soundHandler.holdAt(true); + g_globals->clearFlag(43); - _globals->_player.setVisage(2104); - _globals->_player.setFrame(1); - _globals->_player.setPosition(Common::Point(65, 149)); - _globals->_player.fixPriority(152); - _globals->_player.setStrip(2); + g_globals->_player.setVisage(2104); + g_globals->_player.setFrame(1); + g_globals->_player.setPosition(Common::Point(65, 149)); + g_globals->_player.fixPriority(152); + g_globals->_player.setStrip(2); _object4.postInit(); _object4.setVisage(2102); @@ -1799,16 +1799,16 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { setAction(&_sequenceManager, this, 2107, &_object4, NULL); break; case 5000: - _globals->_soundHandler.play(160); - _globals->_soundHandler.holdAt(true); + g_globals->_soundHandler.play(160); + g_globals->_soundHandler.holdAt(true); - if (_globals->_sceneObjects->contains(&_object2)) + if (g_globals->_sceneObjects->contains(&_object2)) _object2.remove(); - _globals->_player.setStrip(3); - _globals->_player.setFrame(1); - _globals->_player.fixPriority(1); - _globals->_player.setPosition(Common::Point(157, 56)); + g_globals->_player.setStrip(3); + g_globals->_player.setFrame(1); + g_globals->_player.fixPriority(1); + g_globals->_player.setPosition(Common::Point(157, 56)); _object3.setPosition(Common::Point(246, 156)); _object3.fixPriority(156); @@ -1816,13 +1816,13 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { setAction(&_action5); break; case 5100: - _globals->_soundHandler.play(160); - _globals->_soundHandler.holdAt(true); - _globals->_player.setVisage(2104); - _globals->_player.setFrame(1); - _globals->_player.setPosition(Common::Point(65, 149)); - _globals->_player.fixPriority(152); - _globals->_player.setStrip(2); + g_globals->_soundHandler.play(160); + g_globals->_soundHandler.holdAt(true); + g_globals->_player.setVisage(2104); + g_globals->_player.setFrame(1); + g_globals->_player.setPosition(Common::Point(65, 149)); + g_globals->_player.fixPriority(152); + g_globals->_player.setStrip(2); _sitFl = 1; @@ -1835,67 +1835,67 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { setAction(&_action9); break; case 7000: - _globals->_soundHandler.play(160); - _globals->_soundHandler.holdAt(true); + g_globals->_soundHandler.play(160); + g_globals->_soundHandler.holdAt(true); if (RING_INVENTORY._stasisBox2._sceneNumber == 1) { - _globals->_player.fixPriority(1); - _globals->_player.setPosition(Common::Point(157, 56)); + g_globals->_player.fixPriority(1); + g_globals->_player.setPosition(Common::Point(157, 56)); _object4.postInit(); _object4.setVisage(2102); _object4.setPosition(Common::Point(160, 199)); _object4.hide(); - _globals->clearFlag(15); - _globals->clearFlag(109); - _globals->clearFlag(72); + g_globals->clearFlag(15); + g_globals->clearFlag(109); + g_globals->clearFlag(72); setAction(&_action17); } else { - _globals->_player.setVisage(2104); - _globals->_player.setFrame(1); - _globals->_player.setPosition(Common::Point(65, 149)); - _globals->_player.fixPriority(152); - _globals->_player.setStrip(2); + g_globals->_player.setVisage(2104); + g_globals->_player.setFrame(1); + g_globals->_player.setPosition(Common::Point(65, 149)); + g_globals->_player.fixPriority(152); + g_globals->_player.setStrip(2); _sitFl = 1; setAction(&_action16); } break; case 7600: - _globals->_soundHandler.play(160); - _globals->_soundHandler.holdAt(true); + g_globals->_soundHandler.play(160); + g_globals->_soundHandler.holdAt(true); - if (_globals->_sceneObjects->contains(&_object2)) + if (g_globals->_sceneObjects->contains(&_object2)) _object2.remove(); - _globals->_player.fixPriority(1); - _globals->_player.setPosition(Common::Point(157, 56)); + g_globals->_player.fixPriority(1); + g_globals->_player.setPosition(Common::Point(157, 56)); setAction(&_action8); break; case 8100: - _globals->_soundHandler.play(160); - _globals->_soundHandler.holdAt(true); + g_globals->_soundHandler.play(160); + g_globals->_soundHandler.holdAt(true); - _globals->_player.setVisage(2104); - _globals->_player.setFrame(1); - _globals->_player.setPosition(Common::Point(65, 149)); - _globals->_player.fixPriority(152); - _globals->_player.setStrip(2); + g_globals->_player.setVisage(2104); + g_globals->_player.setFrame(1); + g_globals->_player.setPosition(Common::Point(65, 149)); + g_globals->_player.fixPriority(152); + g_globals->_player.setStrip(2); _sceneMode = 2106; setAction(&_sequenceManager, this, 2106, NULL); break; case 9750: - _globals->_soundHandler.play(160); - _globals->_soundHandler.holdAt(true); + g_globals->_soundHandler.play(160); + g_globals->_soundHandler.holdAt(true); - _globals->_player.setVisage(2104); - _globals->_player.setFrame(1); - _globals->_player.setPosition(Common::Point(65, 149)); - _globals->_player.fixPriority(152); - _globals->_player.setStrip(2); + g_globals->_player.setVisage(2104); + g_globals->_player.setFrame(1); + g_globals->_player.setPosition(Common::Point(65, 149)); + g_globals->_player.fixPriority(152); + g_globals->_player.setStrip(2); _object4.postInit(); _object4.setVisage(2102); @@ -1906,15 +1906,15 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { setAction(&_sequenceManager, this, 2103, &_object4, NULL); break; default: - _globals->_soundHandler.play(160); - _globals->_soundHandler.holdAt(true); + g_globals->_soundHandler.play(160); + g_globals->_soundHandler.holdAt(true); - _globals->_player._uiEnabled = true; + g_globals->_player._uiEnabled = true; break; } - _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); - _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; + g_globals->_sceneManager._scene->_sceneBounds.contain(g_globals->_sceneManager._scene->_backgroundBounds); + g_globals->_sceneOffset.x = (g_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; } void Scene2100::stripCallback(int v) { @@ -1933,22 +1933,22 @@ void Scene2100::signal() { switch (_sceneMode) { case 2101: _sitFl = 1; - _globals->_player._uiEnabled = true; - _globals->_events.setCursor(CURSOR_USE); + g_globals->_player._uiEnabled = true; + g_globals->_events.setCursor(CURSOR_USE); break; case 2102: _sitFl = 0; - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; case 2103: - _globals->_stripNum = 9000; - _globals->_sceneManager.changeScene(4000); + g_globals->_stripNum = 9000; + g_globals->_sceneManager.changeScene(4000); break; case 2106: - _globals->_sceneManager.changeScene(7000); + g_globals->_sceneManager.changeScene(7000); break; case 2107: - _globals->_sceneManager.changeScene(5000); + g_globals->_sceneManager.changeScene(5000); break; case 2104: case 2105: @@ -1956,7 +1956,7 @@ void Scene2100::signal() { case 2110: case 2111: case 2112: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; } } @@ -2009,12 +2009,12 @@ Scene2120::Action1::Action1() { } void Scene2120::Action1::signal() { - Scene2120 *scene = (Scene2120 *)_globals->_sceneManager._scene; + Scene2120 *scene = (Scene2120 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: setDelay(30); - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_events.setCursor(CURSOR_WALK); break; case 1: // First page of index @@ -2047,10 +2047,10 @@ void Scene2120::Action1::signal() { } void Scene2120::Action1::dispatch() { - Scene2120 *scene = (Scene2120 *)_globals->_sceneManager._scene; + Scene2120 *scene = (Scene2120 *)g_globals->_sceneManager._scene; Event event; - if (_globals->_events.getEvent(event) && (event.eventType == EVENT_BUTTON_DOWN)) { + if (g_globals->_events.getEvent(event) && (event.eventType == EVENT_BUTTON_DOWN)) { if (scene->_listRect.contains(event.mousePos) && (scene->_dbMode != 2)) { scene->_topicArrowHotspot.setPosition(Common::Point(scene->_topicArrowHotspot._position.x, event.mousePos.y)); } @@ -2066,8 +2066,8 @@ void Scene2120::Action1::dispatch() { else scene->_subjectIndex = (scene->_topicArrowHotspot._position.y - 44) / 8 + 16; - if ((scene->_subjectIndex == 27) && _globals->getFlag(70)) - _globals->setFlag(75); + if ((scene->_subjectIndex == 27) && g_globals->getFlag(70)) + g_globals->setFlag(75); scene->_topicArrowHotspot.hide(); scene->_prevDbMode = scene->_dbMode; @@ -2144,9 +2144,9 @@ void Scene2120::Action1::dispatch() { setAction(NULL); SceneItem::display(0, 0); - _globals->_gfxManagerInstance._font.setFontNumber(2); - _globals->_sceneText._fontNumber = 2; - _globals->_sceneManager.changeScene(_globals->_sceneManager._previousScene); + g_globals->_gfxManagerInstance._font.setFontNumber(2); + g_globals->_sceneText._fontNumber = 2; + g_globals->_sceneManager.changeScene(g_globals->_sceneManager._previousScene); } else { // Exit out of topic display to index SceneItem::display(0, 0); @@ -2184,7 +2184,7 @@ Scene2120::Scene2120(): Scene() { void Scene2120::postInit(SceneObjectList *OwnerList) { loadScene(2120); setZoomPercents(0, 100, 200, 100); - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _subjectButton.setBounds(Rect(266, 13, 320, 56)); _nextPageButton.setBounds(Rect(266, 56, 320, 98)); @@ -2203,8 +2203,8 @@ void Scene2120::postInit(SceneObjectList *OwnerList) { _arrowHotspot.setPosition(Common::Point(400, 200)); setAction(&_action1); - _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); - _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; + g_globals->_sceneManager._scene->_sceneBounds.contain(g_globals->_sceneManager._scene->_backgroundBounds); + g_globals->_sceneOffset.x = (g_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; } void Scene2120::synchronize(Serializer &s) { @@ -2223,14 +2223,14 @@ void Scene2120::synchronize(Serializer &s) { *--------------------------------------------------------------------------*/ void Scene2150::Action1::signal() { - Scene2150 *scene = (Scene2150 *)_globals->_sceneManager._scene; + Scene2150 *scene = (Scene2150 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); Common::Point pt(158, 103); PlayerMover *mover = new PlayerMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 1: @@ -2238,15 +2238,15 @@ void Scene2150::Action1::signal() { scene->_hotspot1.animate(ANIM_MODE_5, this); break; case 2: { - _globals->_player.setStrip2(4); + g_globals->_player.setStrip2(4); Common::Point pt(158, 95); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 3: - _globals->_player.setStrip2(-1); - _globals->_player._strip = 3; + g_globals->_player.setStrip2(-1); + g_globals->_player._strip = 3; setDelay(10); break; case 4: @@ -2257,12 +2257,12 @@ void Scene2150::Action1::signal() { scene->_area2.draw(true); _state = 0; - _globals->_events.setCursor(CURSOR_USE); + g_globals->_events.setCursor(CURSOR_USE); - while (!_state && !_vm->shouldQuit()) { + while (!_state && !g_vm->shouldQuit()) { // Wait for an event Event event; - if (!_globals->_events.getEvent(event)) { + if (!g_globals->_events.getEvent(event)) { g_system->updateScreen(); g_system->delayMillis(10); continue; @@ -2301,10 +2301,10 @@ void Scene2150::Action1::signal() { if (_state == 2150) { Common::Point pt(158, 103); PlayerMover *mover = new PlayerMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } else { - _globals->_sceneManager.changeScene(_state); + g_globals->_sceneManager.changeScene(_state); } break; case 6: @@ -2312,28 +2312,28 @@ void Scene2150::Action1::signal() { scene->_hotspot1.animate(ANIM_MODE_6, this); break; case 7: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; } } void Scene2150::Action2::signal() { - Scene2150 *scene = (Scene2150 *)_globals->_sceneManager._scene; + Scene2150 *scene = (Scene2150 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); Common::Point pt(47, 85); PlayerMover *mover = new PlayerMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 1: - _globals->_player.setVisage(2152); - _globals->_player.setFrame(1); - _globals->_player.setStrip(8); - _globals->_player.animate(ANIM_MODE_8, 1, this); + g_globals->_player.setVisage(2152); + g_globals->_player.setFrame(1); + g_globals->_player.setStrip(8); + g_globals->_player.animate(ANIM_MODE_8, 1, this); scene->_soundHandler.play(163); break; @@ -2342,7 +2342,7 @@ void Scene2150::Action2::signal() { scene->_hotspot10.animate(ANIM_MODE_5, this); break; case 3: - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_events.setCursor(CURSOR_WALK); scene->_stripManager.start((RING_INVENTORY._ale._sceneNumber == 2150) ? 2151 : 2152, this); break; case 4: @@ -2358,21 +2358,21 @@ void Scene2150::Action2::signal() { scene->_hotspot14.setFrame(scene->_stripManager._field2E8 - 5); } - _globals->_player.setFrame(1); - _globals->_player.setStrip(7); - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.setFrame(1); + g_globals->_player.setStrip(7); + g_globals->_player.animate(ANIM_MODE_5, this); break; case 5: scene->_soundHandler.play(164); scene->_hotspot10.animate(ANIM_MODE_6, NULL); scene->_hotspot14.remove(); - _globals->_player.animate(ANIM_MODE_6, this); + g_globals->_player.animate(ANIM_MODE_6, this); break; case 6: - _globals->_player.setVisage(0); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.enableControl(); + g_globals->_player.setVisage(0); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.enableControl(); remove(); break; @@ -2382,7 +2382,7 @@ void Scene2150::Action2::signal() { /*--------------------------------------------------------------------------*/ void Scene2150::Hotspot1::doAction(int action) { - Scene2150 *scene = (Scene2150 *)_globals->_sceneManager._scene; + Scene2150 *scene = (Scene2150 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -2398,16 +2398,16 @@ void Scene2150::Hotspot1::doAction(int action) { } void Scene2150::Hotspot2::doAction(int action) { - Scene2150 *scene = (Scene2150 *)_globals->_sceneManager._scene; + Scene2150 *scene = (Scene2150 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(2150, 1); break; case CURSOR_USE: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 2156; - scene->setAction(&scene->_sequenceManager, scene, 2156, &_globals->_player, this, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2156, &g_globals->_player, this, NULL); break; default: SceneHotspot::doAction(action); @@ -2416,16 +2416,16 @@ void Scene2150::Hotspot2::doAction(int action) { } void Scene2150::Hotspot4::doAction(int action) { - Scene2150 *scene = (Scene2150 *)_globals->_sceneManager._scene; + Scene2150 *scene = (Scene2150 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(2150, 3); break; case CURSOR_USE: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 2155; - scene->setAction(&scene->_sequenceManager, scene, 2155, &_globals->_player, &scene->_hotspot4, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2155, &g_globals->_player, &scene->_hotspot4, NULL); break; default: SceneHotspot::doAction(action); @@ -2434,19 +2434,19 @@ void Scene2150::Hotspot4::doAction(int action) { } void Scene2150::Hotspot7::doAction(int action) { - Scene2150 *scene = (Scene2150 *)_globals->_sceneManager._scene; + Scene2150 *scene = (Scene2150 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(2150, 7); break; case CURSOR_USE: - if (_globals->getFlag(13)) + if (g_globals->getFlag(13)) SceneItem::display2(2150, 19); else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 2154; - scene->setAction(&scene->_sequenceManager, scene, 2154, &_globals->_player, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2154, &g_globals->_player, NULL); } break; default: @@ -2456,14 +2456,14 @@ void Scene2150::Hotspot7::doAction(int action) { } void Scene2150::Hotspot10::doAction(int action) { - Scene2150 *scene = (Scene2150 *)_globals->_sceneManager._scene; + Scene2150 *scene = (Scene2150 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(2150, 10); break; case CURSOR_USE: - if (_globals->getFlag(13)) + if (g_globals->getFlag(13)) SceneItem::display2(2150, 19); else scene->setAction(&scene->_action2); @@ -2544,60 +2544,60 @@ void Scene2150::postInit(SceneObjectList *OwnerList) { _hotspot10.setStrip(5); _hotspot10.setPosition(Common::Point(59, 56)); - _globals->_player.postInit(); - _globals->_player.setVisage(_globals->getFlag(13) ? 2170 : 0); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.fixPriority(-1); - _globals->_player.changeZoom(-1); - _globals->_player._moveDiff.y = 3; + g_globals->_player.postInit(); + g_globals->_player.setVisage(g_globals->getFlag(13) ? 2170 : 0); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.fixPriority(-1); + g_globals->_player.changeZoom(-1); + g_globals->_player._moveDiff.y = 3; _hotspot8.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); _hotspot9.setBounds(Rect(133, 0, 198, 91)); _hotspot11.setBounds(Rect(142, 119, 176, 158)); - _globals->_sceneItems.addItems(&_hotspot1, &_hotspot2, &_hotspot3, &_hotspot4, &_hotspot5, + g_globals->_sceneItems.addItems(&_hotspot1, &_hotspot2, &_hotspot3, &_hotspot4, &_hotspot5, &_hotspot6, &_hotspot7, &_hotspot10, &_hotspot9, &_hotspot11, &_hotspot8, NULL); - switch (_globals->_sceneManager._previousScene) { + switch (g_globals->_sceneManager._previousScene) { case 2120: - _globals->_soundHandler.play(160); - _globals->_soundHandler.holdAt(true); - _globals->_player.setPosition(Common::Point(108, 99)); + g_globals->_soundHandler.play(160); + g_globals->_soundHandler.holdAt(true); + g_globals->_player.setPosition(Common::Point(108, 99)); break; case 2200: - _globals->_player.disableControl(); - _globals->_player.setPosition(Common::Point(159, 240)); + g_globals->_player.disableControl(); + g_globals->_player.setPosition(Common::Point(159, 240)); _sceneMode = 2152; - setAction(&_sequenceManager, this, 2152, &_globals->_player, NULL); + setAction(&_sequenceManager, this, 2152, &g_globals->_player, NULL); break; case 2280: - _globals->_player.disableControl(); - _globals->_player._angle = 180; - _globals->_player.setPosition(Common::Point(265, 80)); + g_globals->_player.disableControl(); + g_globals->_player._angle = 180; + g_globals->_player.setPosition(Common::Point(265, 80)); _hotspot2._frame = _hotspot2.getFrameCount(); _sceneMode = 2157; setAction(&_sequenceManager, this, 2157, &_hotspot2, NULL); break; case 2230: - _globals->_events.setCursor(CURSOR_WALK); - _globals->_player._strip = 4; - _globals->_player.setPosition(Common::Point(229, 139)); + g_globals->_events.setCursor(CURSOR_WALK); + g_globals->_player._strip = 4; + g_globals->_player.setPosition(Common::Point(229, 139)); break; case 2100: default: - _globals->_player.disableControl(); - _globals->_player.setPosition(Common::Point(158, 95)); - _globals->_player.setStrip(3); + g_globals->_player.disableControl(); + g_globals->_player.setPosition(Common::Point(158, 95)); + g_globals->_player.setStrip(3); _sceneMode = 2151; - setAction(&_sequenceManager, this, 2151, &_globals->_player, &_hotspot1, NULL); + setAction(&_sequenceManager, this, 2151, &g_globals->_player, &_hotspot1, NULL); break; } - _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); - _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; + g_globals->_sceneManager._scene->_sceneBounds.contain(g_globals->_sceneManager._scene->_backgroundBounds); + g_globals->_sceneOffset.x = (g_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; } void Scene2150::synchronize(Serializer &s) { @@ -2609,22 +2609,22 @@ void Scene2150::synchronize(Serializer &s) { void Scene2150::signal() { switch (_sceneMode) { case 2151: - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.enableControl(); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.enableControl(); break; case 2152: case 2153: case 2157: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; case 2154: - _globals->_sceneManager.changeScene(2120); + g_globals->_sceneManager.changeScene(2120); break; case 2155: - _globals->_sceneManager.changeScene(2230); + g_globals->_sceneManager.changeScene(2230); break; case 2156: - _globals->_sceneManager.changeScene(2280); + g_globals->_sceneManager.changeScene(2280); break; } } @@ -2633,22 +2633,22 @@ void Scene2150::dispatch() { Scene::dispatch(); if (!_action) { - if (_rect1.contains(_globals->_player._position)) { - _globals->_player.disableControl(); + if (_rect1.contains(g_globals->_player._position)) { + g_globals->_player.disableControl(); _sceneMode = 2156; - setAction(&_sequenceManager, this, 2156, &_globals->_player, &_hotspot2, NULL); + setAction(&_sequenceManager, this, 2156, &g_globals->_player, &_hotspot2, NULL); } - if (_rect2.contains(_globals->_player._position)) { - _globals->_player.disableControl(); + if (_rect2.contains(g_globals->_player._position)) { + g_globals->_player.disableControl(); _sceneMode = 2155; - setAction(&_sequenceManager, this, 2155, &_globals->_player, &_hotspot4, NULL); + setAction(&_sequenceManager, this, 2155, &g_globals->_player, &_hotspot4, NULL); } - if (_globals->_player._position.y >= 196) { - _globals->_player.disableControl(); + if (g_globals->_player._position.y >= 196) { + g_globals->_player.disableControl(); SceneItem::display2(2150, 20); _sceneMode = 2153; - setAction(&_sequenceManager, this, 2153, &_globals->_player, NULL); + setAction(&_sequenceManager, this, 2153, &g_globals->_player, NULL); } } } @@ -2659,7 +2659,7 @@ void Scene2150::dispatch() { *--------------------------------------------------------------------------*/ void Scene2200::Action1::signal() { - Scene2200 *scene = (Scene2200 *)_globals->_sceneManager._scene; + Scene2200 *scene = (Scene2200 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -2670,14 +2670,14 @@ void Scene2200::Action1::signal() { break; case 2: SceneItem::display2(2200, 7); - _globals->_sceneManager.changeScene(2150); + g_globals->_sceneManager.changeScene(2150); remove(); break; } } void Scene2200::Action2::signal() { - Scene2200 *scene = (Scene2200 *)_globals->_sceneManager._scene; + Scene2200 *scene = (Scene2200 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -2694,20 +2694,20 @@ void Scene2200::Action2::signal() { setDelay(30); break; case 4: - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_events.setCursor(CURSOR_WALK); scene->_stripManager.start(2040, this, scene); break; case 5: scene->_hotspot4.setStrip(4); scene->_hotspot4.animate(ANIM_MODE_NONE, NULL); - _globals->_player._uiEnabled = true; + g_globals->_player._uiEnabled = true; remove(); break; } } void Scene2200::Action3::signal() { - Scene2200 *scene = (Scene2200 *)_globals->_sceneManager._scene; + Scene2200 *scene = (Scene2200 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: { @@ -2715,7 +2715,7 @@ void Scene2200::Action3::signal() { scene->_hotspot4.setStrip(4); scene->_hotspot4.animate(ANIM_MODE_NONE, NULL); - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_hotspot2.postInit(); scene->_hotspot2.setVisage(2201); @@ -2734,16 +2734,16 @@ void Scene2200::Action3::signal() { setDelay(120); break; case 2: - if (_globals->getFlag(83)) { + if (g_globals->getFlag(83)) { _actionIndex = 8; setDelay(5); } else { - for (SynchronizedList<SceneObject *>::iterator i = _globals->_sceneObjects->begin(); - i != _globals->_sceneObjects->end(); ++i) { + for (SynchronizedList<SceneObject *>::iterator i = g_globals->_sceneObjects->begin(); + i != g_globals->_sceneObjects->end(); ++i) { (*i)->hide(); } - _globals->_sceneManager._scene->loadScene(66); + g_globals->_sceneManager._scene->loadScene(66); scene->_hotspot6.postInit(); scene->_hotspot6.setVisage(66); @@ -2775,12 +2775,12 @@ void Scene2200::Action3::signal() { setDelay(5); break; case 7: - for (SynchronizedList<SceneObject *>::iterator i = _globals->_sceneObjects->begin(); - i != _globals->_sceneObjects->end(); ++i) + for (SynchronizedList<SceneObject *>::iterator i = g_globals->_sceneObjects->begin(); + i != g_globals->_sceneObjects->end(); ++i) (*i)->show(); scene->_hotspot6.remove(); - _globals->_sceneManager._scene->loadScene(2200); + g_globals->_sceneManager._scene->loadScene(2200); setDelay(5); break; case 8: @@ -2791,7 +2791,7 @@ void Scene2200::Action3::signal() { scene->_hotspot4.animate(ANIM_MODE_NONE, NULL); break; case 10: - _globals->_sceneManager.changeScene(2000); + g_globals->_sceneManager.changeScene(2000); remove(); break; } @@ -2808,7 +2808,7 @@ void Scene2200::Action3::process(Event &event) { } void Scene2200::Action4::signal() { - Scene2200 *scene = (Scene2200 *)_globals->_sceneManager._scene; + Scene2200 *scene = (Scene2200 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -2823,7 +2823,7 @@ void Scene2200::Action4::signal() { setDelay(10); break; case 3: - _globals->_player._uiEnabled = true; + g_globals->_player._uiEnabled = true; remove(); break; } @@ -2832,7 +2832,7 @@ void Scene2200::Action4::signal() { /*--------------------------------------------------------------------------*/ void Scene2200::Hotspot3::doAction(int action) { - Scene2200 *scene = (Scene2200 *)_globals->_sceneManager._scene; + Scene2200 *scene = (Scene2200 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -2842,7 +2842,7 @@ void Scene2200::Hotspot3::doAction(int action) { SceneItem::display2(2200, 11); break; case CURSOR_TALK: - _globals->_player._uiEnabled = false; + g_globals->_player._uiEnabled = false; scene->setAction(&scene->_action4); break; default: @@ -2852,7 +2852,7 @@ void Scene2200::Hotspot3::doAction(int action) { } void Scene2200::Hotspot5::doAction(int action) { - Scene2200 *scene = (Scene2200 *)_globals->_sceneManager._scene; + Scene2200 *scene = (Scene2200 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -2863,7 +2863,7 @@ void Scene2200::Hotspot5::doAction(int action) { break; case CURSOR_TALK: scene->_sceneMode = 2201; - _globals->_player._uiEnabled = false; + g_globals->_player._uiEnabled = false; scene->setAction(&scene->_sequenceManager, scene, 2201, NULL); break; default: @@ -2873,19 +2873,19 @@ void Scene2200::Hotspot5::doAction(int action) { } void Scene2200::Hotspot9::doAction(int action) { - Scene2200 *scene = (Scene2200 *)_globals->_sceneManager._scene; + Scene2200 *scene = (Scene2200 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: - SceneItem::display2(2200, _globals->getFlag(8) ? 1 : 0); + SceneItem::display2(2200, g_globals->getFlag(8) ? 1 : 0); break; case CURSOR_USE: SceneItem::display2(2200, 3); break; case OBJECT_INFODISK: - if (_globals->_sceneManager._previousScene == 2310) { + if (g_globals->_sceneManager._previousScene == 2310) { scene->_soundHandler2.play(35); - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->setAction(&scene->_action3); } break; @@ -2917,7 +2917,7 @@ void Scene2200::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_speakerMR); _stripManager.addSpeaker(&_speakerGameText); - _speakerQText._npc = &_globals->_player; + _speakerQText._npc = &g_globals->_player; _speakerSText._npc = &_hotspot5; _speakerMText._npc = &_hotspot3; @@ -2933,21 +2933,21 @@ void Scene2200::postInit(SceneObjectList *OwnerList) { _hotspot8.setPosition(Common::Point(96, 184)); _hotspot8.fixPriority(236); - _globals->_player.postInit(); - _globals->_player.setVisage(2640); - _globals->_player.setFrame2(3); - _globals->_player.setPosition(Common::Point(110, 233)); - _globals->_player.disableControl(); + g_globals->_player.postInit(); + g_globals->_player.setVisage(2640); + g_globals->_player.setFrame2(3); + g_globals->_player.setPosition(Common::Point(110, 233)); + g_globals->_player.disableControl(); - switch (_globals->_sceneManager._previousScene) { + switch (g_globals->_sceneManager._previousScene) { case 2150: _hotspot5.remove(); _hotspot8.remove(); break; case 4000: - _globals->_soundHandler.play(100); - _globals->_soundHandler.holdAt(true); - _globals->_player.remove(); + g_globals->_soundHandler.play(100); + g_globals->_soundHandler.holdAt(true); + g_globals->_player.remove(); _hotspot5.remove(); _hotspot8.remove(); @@ -2977,20 +2977,20 @@ void Scene2200::postInit(SceneObjectList *OwnerList) { _hotspot3.postInit(); _hotspot3.setVisage(2215); _hotspot3.setPosition(Common::Point(144, 132)); - _globals->_sceneItems.push_back(&_hotspot3); + g_globals->_sceneItems.push_back(&_hotspot3); _hotspot4.postInit(); _hotspot4.setVisage(2215); _hotspot4._strip = 2; _hotspot4.setPosition(Common::Point(120, 78)); _hotspot4.fixPriority(255); - _globals->_sceneItems.push_back(&_hotspot4); + g_globals->_sceneItems.push_back(&_hotspot4); _soundHandler1.play(101); _soundHandler2.play(100); - _globals->_soundHandler.holdAt(true); + g_globals->_soundHandler.holdAt(true); - _globals->_sceneItems.push_back(&_hotspot5); + g_globals->_sceneItems.push_back(&_hotspot5); setAction(&_action2); break; } @@ -2999,9 +2999,9 @@ void Scene2200::postInit(SceneObjectList *OwnerList) { _hotspot9.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); _hotspot10.setBounds(Rect(87, 43, 149, 109)); - _globals->_sceneItems.addItems(&_hotspot10, &_hotspot9, NULL); - _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); - _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; + g_globals->_sceneItems.addItems(&_hotspot10, &_hotspot9, NULL); + g_globals->_sceneManager._scene->_sceneBounds.contain(g_globals->_sceneManager._scene->_backgroundBounds); + g_globals->_sceneOffset.x = (g_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; } void Scene2200::stripCallback(int v) { @@ -3024,15 +3024,15 @@ void Scene2200::synchronize(Serializer &s) { void Scene2200::signal() { if ((_sceneMode == 2201) || (_sceneMode == 2202)) - _globals->_player._uiEnabled = true; + g_globals->_player._uiEnabled = true; } void Scene2200::dispatch() { Scene::dispatch(); if (!_action) { - if (_exitRect.contains(_globals->_player._position)) - _globals->_sceneManager.changeScene(2150); + if (_exitRect.contains(g_globals->_player._position)) + g_globals->_sceneManager.changeScene(2150); } } @@ -3042,7 +3042,7 @@ void Scene2200::dispatch() { *--------------------------------------------------------------------------*/ void Scene2222::Action1::signal() { - Scene2222 *scene = (Scene2222 *)_globals->_sceneManager._scene; + Scene2222 *scene = (Scene2222 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -3055,13 +3055,13 @@ void Scene2222::Action1::signal() { setDelay(30); break; case 3: - _globals->_sceneManager.changeScene(1000); + g_globals->_sceneManager.changeScene(1000); break; } } void Scene2222::Action2::signal() { - Scene2222 *scene = (Scene2222 *)_globals->_sceneManager._scene; + Scene2222 *scene = (Scene2222 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -3074,8 +3074,8 @@ void Scene2222::Action2::signal() { setDelay(120); break; case 3: - _globals->_sceneManager._fadeMode = FADEMODE_GRADUAL; - _globals->_sceneManager.changeScene(2100); + g_globals->_sceneManager._fadeMode = FADEMODE_GRADUAL; + g_globals->_sceneManager.changeScene(2100); break; } } @@ -3083,7 +3083,7 @@ void Scene2222::Action2::signal() { /*--------------------------------------------------------------------------*/ void Scene2222::postInit(SceneObjectList *OwnerList) { - loadScene((_globals->_sceneManager._previousScene == 2000) ? 3400 : 3450); + loadScene((g_globals->_sceneManager._previousScene == 2000) ? 3400 : 3450); Scene::postInit(); setZoomPercents(0, 100, 200, 100); @@ -3123,7 +3123,7 @@ void Scene2222::postInit(SceneObjectList *OwnerList) { _hotspot5.setFrame(5); _hotspot5.animate(ANIM_MODE_2, 0); - if (_globals->_sceneManager._previousScene == 2100) { + if (g_globals->_sceneManager._previousScene == 2100) { _hotspot1.setPosition(Common::Point(61, 101)); _hotspot2.setPosition(Common::Point(239, 149)); _hotspot3.setPosition(Common::Point(184, 85)); @@ -3142,10 +3142,10 @@ void Scene2222::postInit(SceneObjectList *OwnerList) { } _soundHandler.play(116); - _globals->_sceneManager._scene->_sceneBounds.center(_hotspot1._position); + g_globals->_sceneManager._scene->_sceneBounds.center(_hotspot1._position); - _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); - _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; + g_globals->_sceneManager._scene->_sceneBounds.contain(g_globals->_sceneManager._scene->_backgroundBounds); + g_globals->_sceneOffset.x = (g_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; } @@ -3155,7 +3155,7 @@ void Scene2222::postInit(SceneObjectList *OwnerList) { *--------------------------------------------------------------------------*/ void Scene2230::Action1::signal() { - Scene2230 *scene = (Scene2230 *)_globals->_sceneManager._scene; + Scene2230 *scene = (Scene2230 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -3174,7 +3174,7 @@ void Scene2230::Action1::signal() { case 1: { Common::Point pt(84, 74); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 2: @@ -3183,20 +3183,20 @@ void Scene2230::Action1::signal() { case 3: { Common::Point pt(63, 60); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 4: scene->_hotspot1.animate(ANIM_MODE_6, this); break; case 5: - _globals->_sceneManager.changeScene(2150); + g_globals->_sceneManager.changeScene(2150); break; } } void Scene2230::Action2::signal() { - Scene2230 *scene = (Scene2230 *)_globals->_sceneManager._scene; + Scene2230 *scene = (Scene2230 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -3210,67 +3210,67 @@ void Scene2230::Action2::signal() { } break; case 1: { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_field30A = 1; - _globals->_player._regionBitList |= ~0x80; + g_globals->_player._regionBitList |= ~0x80; Common::Point pt(160, 96); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 2: - _globals->_player.setVisage(2235); - _globals->_player.setStrip2(1); - _globals->_player.fixPriority(100); - _globals->_player._frame = 1; - _globals->_player.setPosition(Common::Point(200, 68)); - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.setVisage(2235); + g_globals->_player.setStrip2(1); + g_globals->_player.fixPriority(100); + g_globals->_player._frame = 1; + g_globals->_player.setPosition(Common::Point(200, 68)); + g_globals->_player.animate(ANIM_MODE_5, this); break; case 3: scene->_soundHandler.play(157); - _globals->_player._moveDiff = Common::Point(1, 1); - _globals->_player.setAction(&scene->_action4); - _globals->_player._uiEnabled = true; + g_globals->_player._moveDiff = Common::Point(1, 1); + g_globals->_player.setAction(&scene->_action4); + g_globals->_player._uiEnabled = true; - _globals->_events.setCursor(CURSOR_USE); + g_globals->_events.setCursor(CURSOR_USE); remove(); break; } } void Scene2230::Action3::signal() { - Scene2230 *scene = (Scene2230 *)_globals->_sceneManager._scene; + Scene2230 *scene = (Scene2230 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: { - _globals->_player.setAction(NULL); - _globals->_player._moveDiff = Common::Point(5, 3); - _globals->_player.setStrip2(_globals->_player._strip); + g_globals->_player.setAction(NULL); + g_globals->_player._moveDiff = Common::Point(5, 3); + g_globals->_player.setStrip2(g_globals->_player._strip); Common::Point pt(190, 74); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); scene->_soundHandler.stop(); break; } case 1: - _globals->_player._strip = 3; - _globals->_player._frame = 1; - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player._strip = 3; + g_globals->_player._frame = 1; + g_globals->_player.animate(ANIM_MODE_5, this); break; case 2: - _globals->_player._regionBitList |= 0x80; + g_globals->_player._regionBitList |= 0x80; scene->_field30A = 0; - _globals->_player.setVisage(0); - _globals->_player.setStrip2(-1); - _globals->_player.fixPriority(-1); - _globals->_player.setPosition(Common::Point(164, 96)); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player._canWalk = true; + g_globals->_player.setVisage(0); + g_globals->_player.setStrip2(-1); + g_globals->_player.fixPriority(-1); + g_globals->_player.setPosition(Common::Point(164, 96)); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player._canWalk = true; - _globals->_events.setCursor(CURSOR_USE); + g_globals->_events.setCursor(CURSOR_USE); remove(); } } @@ -3278,16 +3278,16 @@ void Scene2230::Action3::signal() { void Scene2230::Action4::signal() { switch (_actionIndex++) { case 0: - Common::Point pt(190 + _globals->_randomSource.getRandomNumber(9), 68); + Common::Point pt(190 + g_globals->_randomSource.getRandomNumber(9), 68); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); _actionIndex = 0; break; } } void Scene2230::Action5::signal() { - Scene2230 *scene = (Scene2230 *)_globals->_sceneManager._scene; + Scene2230 *scene = (Scene2230 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -3301,22 +3301,22 @@ void Scene2230::Action5::signal() { } break; case 1: { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); Common::Point pt(209, 124); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 2: - _globals->_player.fixPriority(1430); - _globals->_player.setVisage(2232); - _globals->_player._strip = 1; - _globals->_player._frame = 1; - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.fixPriority(1430); + g_globals->_player.setVisage(2232); + g_globals->_player._strip = 1; + g_globals->_player._frame = 1; + g_globals->_player.animate(ANIM_MODE_5, this); break; case 3: - _globals->_events.setCursor(CURSOR_USE); - _globals->_player._uiEnabled = true; + g_globals->_events.setCursor(CURSOR_USE); + g_globals->_player._uiEnabled = true; scene->_field30A = 2; remove(); break; @@ -3324,32 +3324,32 @@ void Scene2230::Action5::signal() { } void Scene2230::Action6::signal() { - Scene2230 *scene = (Scene2230 *)_globals->_sceneManager._scene; + Scene2230 *scene = (Scene2230 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player._strip = 2; - _globals->_player._frame = 1; - _globals->_player.fixPriority(-1); - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player._strip = 2; + g_globals->_player._frame = 1; + g_globals->_player.fixPriority(-1); + g_globals->_player.animate(ANIM_MODE_5, this); break; case 1: scene->_field30A = 0; - _globals->_player.setVisage(0); - _globals->_player._strip = 1; - _globals->_player._canWalk = true; - _globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setVisage(0); + g_globals->_player._strip = 1; + g_globals->_player._canWalk = true; + g_globals->_player.animate(ANIM_MODE_1, NULL); remove(); break; } } void Scene2230::Action7::signal() { - Scene2230 *scene = (Scene2230 *)_globals->_sceneManager._scene; + Scene2230 *scene = (Scene2230 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); switch (scene->_field30A) { case 1: @@ -3366,7 +3366,7 @@ void Scene2230::Action7::signal() { case 1: { Common::Point pt(140, 119); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 2: { @@ -3389,23 +3389,23 @@ void Scene2230::Action7::signal() { scene->_hotspot8._frame = 2; break; case 4: - _globals->_sceneItems.push_front(&scene->_hotspot10); - _globals->_sceneItems.push_front(&scene->_hotspot11); - _globals->_sceneItems.push_front(&scene->_hotspot12); + g_globals->_sceneItems.push_front(&scene->_hotspot10); + g_globals->_sceneItems.push_front(&scene->_hotspot11); + g_globals->_sceneItems.push_front(&scene->_hotspot12); scene->_hotspot2.remove(); - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; } } void Scene2230::Action8::signal() { - Scene2230 *scene = (Scene2230 *)_globals->_sceneManager._scene; + Scene2230 *scene = (Scene2230 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); switch (scene->_field30A) { case 1: @@ -3422,13 +3422,13 @@ void Scene2230::Action8::signal() { case 1: { Common::Point pt(140, 119); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 2: { - _globals->_sceneItems.remove(&scene->_hotspot10); - _globals->_sceneItems.remove(&scene->_hotspot11); - _globals->_sceneItems.remove(&scene->_hotspot12); + g_globals->_sceneItems.remove(&scene->_hotspot10); + g_globals->_sceneItems.remove(&scene->_hotspot11); + g_globals->_sceneItems.remove(&scene->_hotspot12); switch (scene->_field30A) { case 1: @@ -3464,7 +3464,7 @@ void Scene2230::Action8::signal() { } case 5: scene->_hotspot8.setStrip2(1); - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; @@ -3475,7 +3475,7 @@ void Scene2230::Action8::signal() { /*--------------------------------------------------------------------------*/ void Scene2230::Hotspot1::doAction(int action) { - Scene2230 *scene = (Scene2230 *)_globals->_sceneManager._scene; + Scene2230 *scene = (Scene2230 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -3493,13 +3493,13 @@ void Scene2230::Hotspot1::doAction(int action) { void Scene2230::Hotspot3::doAction(int action) { switch (action) { case CURSOR_LOOK: - if (_globals->getFlag(4)) + if (g_globals->getFlag(4)) SceneItem::display2(2230, 1); else { SceneItem::display2(2230, 1); SceneItem::display2(2230, 2); SceneItem::display2(2230, 3); - _globals->setFlag(4); + g_globals->setFlag(4); } break; default: @@ -3511,14 +3511,14 @@ void Scene2230::Hotspot3::doAction(int action) { void Scene2230::Hotspot4::doAction(int action) { switch (action) { case CURSOR_LOOK: - if (_globals->getFlag(30)) + if (g_globals->getFlag(30)) SceneItem::display2(2230, 6); - else if (_globals->getFlag(29)) { + else if (g_globals->getFlag(29)) { SceneItem::display2(2230, 5); - _globals->setFlag(30); + g_globals->setFlag(30); } else { SceneItem::display2(2230, 4); - _globals->setFlag(29); + g_globals->setFlag(29); } break; case CURSOR_USE: @@ -3533,10 +3533,10 @@ void Scene2230::Hotspot4::doAction(int action) { void Scene2230::Hotspot5::doAction(int action) { switch (action) { case CURSOR_LOOK: - if (_globals->getFlag(5)) + if (g_globals->getFlag(5)) SceneItem::display2(2230, 9); else { - _globals->setFlag(5); + g_globals->setFlag(5); SceneItem::display2(2230, 8); } break; @@ -3547,21 +3547,21 @@ void Scene2230::Hotspot5::doAction(int action) { } void Scene2230::Hotspot6::doAction(int action) { - Scene2230 *scene = (Scene2230 *)_globals->_sceneManager._scene; + Scene2230 *scene = (Scene2230 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: - if (_globals->getFlag(6)) + if (g_globals->getFlag(6)) SceneItem::display2(2230, 11); else { - _globals->setFlag(6); + g_globals->setFlag(6); SceneItem::display2(2230, 10); } break; case CURSOR_USE: if (scene->_field30A == 1) scene->setAction(&scene->_action3); - else if (_globals->getFlag(13)) + else if (g_globals->getFlag(13)) SceneItem::display2(2230, 28); else scene->setAction(&scene->_action2); @@ -3573,21 +3573,21 @@ void Scene2230::Hotspot6::doAction(int action) { } void Scene2230::Hotspot7::doAction(int action) { - Scene2230 *scene = (Scene2230 *)_globals->_sceneManager._scene; + Scene2230 *scene = (Scene2230 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: - if (_globals->getFlag(7)) + if (g_globals->getFlag(7)) SceneItem::display2(2230, 13); else { - _globals->setFlag(6); + g_globals->setFlag(6); SceneItem::display2(2230, 12); } break; case CURSOR_USE: if (scene->_field30A == 2) scene->setAction(&scene->_action6); - else if (_globals->getFlag(13)) + else if (g_globals->getFlag(13)) SceneItem::display2(2230, 29); else scene->setAction(&scene->_action5); @@ -3599,22 +3599,22 @@ void Scene2230::Hotspot7::doAction(int action) { } void Scene2230::Hotspot8::doAction(int action) { - Scene2230 *scene = (Scene2230 *)_globals->_sceneManager._scene; + Scene2230 *scene = (Scene2230 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: if (scene->_hotspot8._strip == 1) { - if (_globals->getFlag(22)) + if (g_globals->getFlag(22)) SceneItem::display2(2230, 19); else { - _globals->setFlag(22); + g_globals->setFlag(22); SceneItem::display2(2230, 14); } } else { - if (_globals->getFlag(25)) + if (g_globals->getFlag(25)) SceneItem::display2(2230, 21); else { - _globals->setFlag(25); + g_globals->setFlag(25); SceneItem::display2(2230, 20); } } @@ -3634,10 +3634,10 @@ void Scene2230::Hotspot8::doAction(int action) { void Scene2230::Hotspot10::doAction(int action) { switch (action) { case CURSOR_LOOK: - if (_globals->getFlag(26)) + if (g_globals->getFlag(26)) SceneItem::display2(2230, 25); else { - _globals->setFlag(26); + g_globals->setFlag(26); SceneItem::display2(2230, 24); } break; @@ -3653,10 +3653,10 @@ void Scene2230::Hotspot10::doAction(int action) { void Scene2230::Hotspot11::doAction(int action) { switch (action) { case CURSOR_LOOK: - if (_globals->getFlag(27)) + if (g_globals->getFlag(27)) SceneItem::display2(2230, 23); else { - _globals->setFlag(27); + g_globals->setFlag(27); SceneItem::display2(2230, 22); } break; @@ -3672,10 +3672,10 @@ void Scene2230::Hotspot11::doAction(int action) { void Scene2230::Hotspot12::doAction(int action) { switch (action) { case CURSOR_LOOK: - if (_globals->getFlag(28)) + if (g_globals->getFlag(28)) SceneItem::display2(2230, 27); else { - _globals->setFlag(28); + g_globals->setFlag(28); SceneItem::display2(2230, 26); } break; @@ -3716,17 +3716,17 @@ void Scene2230::postInit(SceneObjectList *OwnerList) { _rect1 = Rect(59, 64, 89, 74); - _globals->_player.postInit(); - _globals->_player.setVisage(_globals->getFlag(13) ? 2170 : 0); - _globals->_player.animate(ANIM_MODE_1, 0); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.setPosition(Common::Point(80, 80)); - _globals->_player._moveDiff.y = 3; - _globals->_player._regionBitList |= 0x80; - _globals->_player.changeZoom(-1); + g_globals->_player.postInit(); + g_globals->_player.setVisage(g_globals->getFlag(13) ? 2170 : 0); + g_globals->_player.animate(ANIM_MODE_1, 0); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.setPosition(Common::Point(80, 80)); + g_globals->_player._moveDiff.y = 3; + g_globals->_player._regionBitList |= 0x80; + g_globals->_player.changeZoom(-1); _field30A = 0; - _globals->_player.enableControl(); + g_globals->_player.enableControl(); _hotspot5.setBounds(Rect(108, 34, 142, 76)); _hotspot4.setBounds(Rect(92, 14, 106, 57)); @@ -3737,11 +3737,11 @@ void Scene2230::postInit(SceneObjectList *OwnerList) { _hotspot11.setBounds(Rect(158, 109, 164, 115)); _hotspot12.setBounds(Rect(170, 109, 177, 115)); - _globals->_sceneItems.addItems(&_hotspot8, &_hotspot5, &_hotspot4, &_hotspot6, &_hotspot7, + g_globals->_sceneItems.addItems(&_hotspot8, &_hotspot5, &_hotspot4, &_hotspot6, &_hotspot7, &_hotspot1, &_hotspot3, NULL); - _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); - _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; + g_globals->_sceneManager._scene->_sceneBounds.contain(g_globals->_sceneManager._scene->_backgroundBounds); + g_globals->_sceneOffset.x = (g_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; } void Scene2230::synchronize(Serializer &s) { @@ -3754,7 +3754,7 @@ void Scene2230::dispatch() { Scene::dispatch(); if (!_action) { - if (_rect1.contains(_globals->_player._position)) + if (_rect1.contains(g_globals->_player._position)) setAction(&_action1); } } @@ -3765,14 +3765,14 @@ void Scene2230::dispatch() { *--------------------------------------------------------------------------*/ void Scene2280::Action1::signal() { - Scene2280 *scene = (Scene2280 *)_globals->_sceneManager._scene; + Scene2280 *scene = (Scene2280 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); Common::Point pt(192, 97); PlayerMover *mover = new PlayerMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 1: @@ -3782,90 +3782,90 @@ void Scene2280::Action1::signal() { case 2: { Common::Point pt(218, 87); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 3: - _globals->_player.setStrip(3); + g_globals->_player.setStrip(3); setDelay(10); break; case 4: - _globals->_player.fixPriority(1); + g_globals->_player.fixPriority(1); scene->_soundHandler.play(162); scene->_hotspot16.animate(ANIM_MODE_6, this); break; case 5: - _globals->_sceneManager.changeScene(7000); + g_globals->_sceneManager.changeScene(7000); break; } } void Scene2280::Action2::signal() { - Scene2280 *scene = (Scene2280 *)_globals->_sceneManager._scene; + Scene2280 *scene = (Scene2280 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); Common::Point pt(94, 117); PlayerMover *mover = new PlayerMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 1: scene->_soundHandler.play(265); - _globals->_player.setVisage(2162); - _globals->_player._frame = 1; - _globals->_player._strip = 1; - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.setVisage(2162); + g_globals->_player._frame = 1; + g_globals->_player._strip = 1; + g_globals->_player.animate(ANIM_MODE_5, this); scene->_hotspot8.remove(); scene->_hotspot10.remove(); break; case 2: - _globals->_player._frame = 1; - _globals->_player._strip = 2; - _globals->_player.animate(ANIM_MODE_4, 3, 1, this); + g_globals->_player._frame = 1; + g_globals->_player._strip = 2; + g_globals->_player.animate(ANIM_MODE_4, 3, 1, this); break; case 3: - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.animate(ANIM_MODE_5, this); scene->_hotspot12.remove(); break; case 4: scene->_soundHandler.play(266); - _globals->_player.setVisage(2170); - _globals->_player._frame = 1; - _globals->_player._strip = 4; - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player._moveDiff = Common::Point(4, 1); + g_globals->_player.setVisage(2170); + g_globals->_player._frame = 1; + g_globals->_player._strip = 4; + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player._moveDiff = Common::Point(4, 1); - _globals->setFlag(13); + g_globals->setFlag(13); SceneItem::display2(2280, 37); - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; } } void Scene2280::Action3::signal() { - Scene2280 *scene = (Scene2280 *)_globals->_sceneManager._scene; + Scene2280 *scene = (Scene2280 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); Common::Point pt(94, 117); PlayerMover *mover = new PlayerMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 1: scene->_soundHandler.play(265); - _globals->_player.setVisage(2162); - _globals->_player._frame = 6; - _globals->_player._strip = 2; - _globals->_player.animate(ANIM_MODE_4, 3, -1, this); + g_globals->_player.setVisage(2162); + g_globals->_player._frame = 6; + g_globals->_player._strip = 2; + g_globals->_player.animate(ANIM_MODE_4, 3, -1, this); break; case 2: scene->_hotspot12.postInit(); @@ -3875,13 +3875,13 @@ void Scene2280::Action3::signal() { scene->_hotspot12.setPosition(Common::Point(88, 76)); scene->_hotspot12.fixPriority(1); - _globals->_player.animate(ANIM_MODE_6, this); + g_globals->_player.animate(ANIM_MODE_6, this); break; case 3: - _globals->_player._strip = 1; - _globals->_player._frame = 12; + g_globals->_player._strip = 1; + g_globals->_player._frame = 12; - _globals->_player.animate(ANIM_MODE_6, this); + g_globals->_player.animate(ANIM_MODE_6, this); break; case 4: scene->_hotspot8.postInit(); @@ -3902,22 +3902,22 @@ void Scene2280::Action3::signal() { scene->_hotspot10.changeZoom(100); scene->_hotspot10.fixPriority(1); - _globals->clearFlag(13); + g_globals->clearFlag(13); - _globals->_player.setVisage(0); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player._strip = 4; - _globals->_player._moveDiff = Common::Point(3, 5); + g_globals->_player.setVisage(0); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player._strip = 4; + g_globals->_player._moveDiff = Common::Point(3, 5); SceneItem::display2(2280, 38); - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; } } void Scene2280::Action4::signal() { - Scene2280 *scene = (Scene2280 *)_globals->_sceneManager._scene; + Scene2280 *scene = (Scene2280 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: { @@ -3926,24 +3926,24 @@ void Scene2280::Action4::signal() { case 51: { Common::Point pt(163, 67); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 6: case 50: { Common::Point pt(173, 63); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } } break; } case 1: - _globals->_player.setVisage(2161); - _globals->_player._strip = 1; - _globals->_player._frame = 1; - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.setVisage(2161); + g_globals->_player._strip = 1; + g_globals->_player._frame = 1; + g_globals->_player.animate(ANIM_MODE_5, this); break; case 2: switch (_state) { @@ -3966,7 +3966,7 @@ void Scene2280::Action4::signal() { scene->_hotspot17.fixPriority(1); RING_INVENTORY._medkit._sceneNumber = 2280; - _globals->_sceneItems.push_front(&scene->_hotspot17); + g_globals->_sceneItems.push_front(&scene->_hotspot17); break; case 51: scene->_hotspot18.postInit(); @@ -3979,17 +3979,17 @@ void Scene2280::Action4::signal() { scene->_hotspot18.fixPriority(1); RING_INVENTORY._scanner._sceneNumber = 2280; - _globals->_sceneItems.push_front(&scene->_hotspot18); + g_globals->_sceneItems.push_front(&scene->_hotspot18); break; } - _globals->_player.animate(ANIM_MODE_6, this); + g_globals->_player.animate(ANIM_MODE_6, this); break; case 3: - _globals->_player.enableControl(); - _globals->_player.setVisage(0); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player._strip = 2; + g_globals->_player.enableControl(); + g_globals->_player.setVisage(0); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player._strip = 2; remove(); break; @@ -3999,24 +3999,24 @@ void Scene2280::Action4::signal() { /*--------------------------------------------------------------------------*/ void Scene2280::Hotspot1::doAction(int action) { - Scene2280 *scene = (Scene2280 *)_globals->_sceneManager._scene; + Scene2280 *scene = (Scene2280 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: - if (_globals->getFlag(16)) + if (g_globals->getFlag(16)) SceneItem::display2(2280, 22); else { - _globals->setFlag(16); + g_globals->setFlag(16); SceneItem::display2(2230, 21); } break; case CURSOR_USE: - if (!_globals->getFlag(15)) + if (!g_globals->getFlag(15)) SceneItem::display2(2280, 23); - else if (!_globals->getFlag(13)) + else if (!g_globals->getFlag(13)) SceneItem::display2(2280, 46); else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->setAction(&scene->_action1); } break; @@ -4029,10 +4029,10 @@ void Scene2280::Hotspot1::doAction(int action) { void Scene2280::Hotspot2::doAction(int action) { switch (action) { case CURSOR_LOOK: - if (_globals->getFlag(2)) + if (g_globals->getFlag(2)) SceneItem::display2(2280, 1); else { - _globals->setFlag(2); + g_globals->setFlag(2); SceneItem::display2(2280, 0); } break; @@ -4048,10 +4048,10 @@ void Scene2280::Hotspot2::doAction(int action) { void Scene2280::Hotspot4::doAction(int action) { switch (action) { case CURSOR_LOOK: - if (_globals->getFlag(21)) + if (g_globals->getFlag(21)) SceneItem::display2(2280, 33); else { - _globals->setFlag(21); + g_globals->setFlag(21); SceneItem::display2(2280, 32); } break; @@ -4065,31 +4065,31 @@ void Scene2280::Hotspot4::doAction(int action) { } void Scene2280::Hotspot7::doAction(int action) { - Scene2280 *scene = (Scene2280 *)_globals->_sceneManager._scene; + Scene2280 *scene = (Scene2280 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(2280, 24); break; case OBJECT_SCANNER: - if (_globals->getFlag(13)) + if (g_globals->getFlag(13)) SceneItem::display2(2280, 43); else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_action4._state = 51; - _globals->_events.setCursor(CURSOR_WALK); - _globals->_events._currentCursor = CURSOR_700; + g_globals->_events.setCursor(CURSOR_WALK); + g_globals->_events._currentCursor = CURSOR_700; scene->setAction(&scene->_action4); } break; case OBJECT_MEDKIT: - if (_globals->getFlag(13)) + if (g_globals->getFlag(13)) SceneItem::display2(2280, 43); else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_action4._state = 50; - _globals->_events.setCursor(CURSOR_WALK); - _globals->_events._currentCursor = CURSOR_700; + g_globals->_events.setCursor(CURSOR_WALK); + g_globals->_events._currentCursor = CURSOR_700; scene->setAction(&scene->_action4); } break; @@ -4100,14 +4100,14 @@ void Scene2280::Hotspot7::doAction(int action) { } void Scene2280::Hotspot8::doAction(int action) { - Scene2280 *scene = (Scene2280 *)_globals->_sceneManager._scene; + Scene2280 *scene = (Scene2280 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(2280, 3); break; case CURSOR_USE: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->setAction(&scene->_action2); break; default: @@ -4117,14 +4117,14 @@ void Scene2280::Hotspot8::doAction(int action) { } void Scene2280::Hotspot10::doAction(int action) { - Scene2280 *scene = (Scene2280 *)_globals->_sceneManager._scene; + Scene2280 *scene = (Scene2280 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(2280, 4); break; case CURSOR_USE: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->setAction(&scene->_action2); break; default: @@ -4134,14 +4134,14 @@ void Scene2280::Hotspot10::doAction(int action) { } void Scene2280::Hotspot12::doAction(int action) { - Scene2280 *scene = (Scene2280 *)_globals->_sceneManager._scene; + Scene2280 *scene = (Scene2280 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(2280, 11); break; case CURSOR_USE: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->setAction(&scene->_action2); break; default: @@ -4151,15 +4151,15 @@ void Scene2280::Hotspot12::doAction(int action) { } void Scene2280::Hotspot14::doAction(int action) { - Scene2280 *scene = (Scene2280 *)_globals->_sceneManager._scene; + Scene2280 *scene = (Scene2280 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(2280, 3); break; case CURSOR_USE: - _globals->_player.disableControl(); - if (_globals->getFlag(13)) + g_globals->_player.disableControl(); + if (g_globals->getFlag(13)) scene->setAction(&scene->_action3); else scene->setAction(&scene->_action2); @@ -4171,22 +4171,22 @@ void Scene2280::Hotspot14::doAction(int action) { } void Scene2280::Hotspot17::doAction(int action) { - Scene2280 *scene = (Scene2280 *)_globals->_sceneManager._scene; + Scene2280 *scene = (Scene2280 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: - if (_globals->getFlag(18)) + if (g_globals->getFlag(18)) SceneItem::display2(2280, 26); else { - _globals->setFlag(18); + g_globals->setFlag(18); SceneItem::display2(2280, 25); } break; case CURSOR_USE: - if (_globals->getFlag(13)) + if (g_globals->getFlag(13)) SceneItem::display2(2280, 29); else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_action4._state = 6; scene->setAction(&scene->_action4); } @@ -4198,22 +4198,22 @@ void Scene2280::Hotspot17::doAction(int action) { } void Scene2280::Hotspot18::doAction(int action) { - Scene2280 *scene = (Scene2280 *)_globals->_sceneManager._scene; + Scene2280 *scene = (Scene2280 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: - if (_globals->getFlag(19)) + if (g_globals->getFlag(19)) SceneItem::display2(2280, 28); else { - _globals->setFlag(19); + g_globals->setFlag(19); SceneItem::display2(2280, 27); } break; case CURSOR_USE: - if (_globals->getFlag(13)) + if (g_globals->getFlag(13)) SceneItem::display2(2280, 29); else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_action4._state = 1; scene->setAction(&scene->_action4); } @@ -4254,7 +4254,7 @@ void Scene2280::postInit(SceneObjectList *OwnerList) { _hotspot17.setPosition(Common::Point(162, 39)); _hotspot17.fixPriority(1); - _globals->_sceneItems.push_back(&_hotspot17); + g_globals->_sceneItems.push_back(&_hotspot17); } if (RING_INVENTORY._scanner._sceneNumber == 2280) { @@ -4265,10 +4265,10 @@ void Scene2280::postInit(SceneObjectList *OwnerList) { _hotspot17.setPosition(Common::Point(152, 43)); _hotspot17.fixPriority(1); - _globals->_sceneItems.push_back(&_hotspot17); + g_globals->_sceneItems.push_back(&_hotspot17); } - if (!_globals->getFlag(13)) { + if (!g_globals->getFlag(13)) { _hotspot8.postInit(); _hotspot8.setVisage(2280); _hotspot8._strip = 2; @@ -4289,7 +4289,7 @@ void Scene2280::postInit(SceneObjectList *OwnerList) { _hotspot12.setPosition(Common::Point(88, 76)); _hotspot12.fixPriority(1); - _globals->_sceneItems.addItems(&_hotspot8, &_hotspot10, &_hotspot12, NULL); + g_globals->_sceneItems.addItems(&_hotspot8, &_hotspot10, &_hotspot12, NULL); } _hotspot14.setBounds(Rect(70, 50, 90, 104)); @@ -4322,47 +4322,47 @@ void Scene2280::postInit(SceneObjectList *OwnerList) { _exitRect = Rect(145, 180, 195, 195); - _globals->_player.postInit(); - _globals->_player.setVisage(_globals->getFlag(13) ? 2170 : 0); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.setPosition(Common::Point(146, 161)); - _globals->_player.changeZoom(-1); - _globals->_player._moveDiff = Common::Point(4, 3); + g_globals->_player.postInit(); + g_globals->_player.setVisage(g_globals->getFlag(13) ? 2170 : 0); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.setPosition(Common::Point(146, 161)); + g_globals->_player.changeZoom(-1); + g_globals->_player._moveDiff = Common::Point(4, 3); - if ((_globals->_sceneManager._previousScene != 7300) && (_globals->_sceneManager._previousScene != 7000)) { - _globals->_player.enableControl(); + if ((g_globals->_sceneManager._previousScene != 7300) && (g_globals->_sceneManager._previousScene != 7000)) { + g_globals->_player.enableControl(); } else { - _globals->setFlag(109); - _globals->_player.fixPriority(76); - _globals->_player.disableControl(); + g_globals->setFlag(109); + g_globals->_player.fixPriority(76); + g_globals->_player.disableControl(); _sceneMode = 2281; - setAction(&_sequenceManager, this, 2281, &_globals->_player, &_hotspot16, NULL); + setAction(&_sequenceManager, this, 2281, &g_globals->_player, &_hotspot16, NULL); - _globals->_soundHandler.play(160); - _globals->_soundHandler.holdAt(true); + g_globals->_soundHandler.play(160); + g_globals->_soundHandler.holdAt(true); } - _globals->_sceneItems.addItems(&_hotspot13, &_hotspot11, &_hotspot9, &_hotspot14, &_hotspot7, + g_globals->_sceneItems.addItems(&_hotspot13, &_hotspot11, &_hotspot9, &_hotspot14, &_hotspot7, &_hotspot6, &_hotspot2, &_hotspot3, &_hotspot4, &_hotspot5, &_hotspot1, &_hotspot16, &_hotspot15, NULL); - _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); - _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; + g_globals->_sceneManager._scene->_sceneBounds.contain(g_globals->_sceneManager._scene->_backgroundBounds); + g_globals->_sceneOffset.x = (g_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; } void Scene2280::signal() { if (_sceneMode == 2281) { - _globals->_player.fixPriority(-1); - _globals->_player.enableControl(); + g_globals->_player.fixPriority(-1); + g_globals->_player.enableControl(); } } void Scene2280::dispatch() { Scene::dispatch(); if (!_action) { - if (_exitRect.contains(_globals->_player._position)) - _globals->_sceneManager.changeScene(2150); + if (_exitRect.contains(g_globals->_player._position)) + g_globals->_sceneManager.changeScene(2150); } } @@ -4378,7 +4378,7 @@ void Scene2280::synchronize(Serializer &s) { void Scene2300::Action1::signal() { // Quinn and Seeker - Scene2300 *scene = (Scene2300 *)_globals->_sceneManager._scene; + Scene2300 *scene = (Scene2300 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -4405,8 +4405,8 @@ void Scene2300::Action1::signal() { } case 3: setDelay(2); - _globals->_player._uiEnabled = true; - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_player._uiEnabled = true; + g_globals->_events.setCursor(CURSOR_WALK); break; case 4: { scene->_hotspot5.setVisage(93); @@ -4431,23 +4431,23 @@ void Scene2300::Action1::signal() { } case 6: scene->_soundHandler1.play(28); - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_hotspot2.setVisage(40); scene->_hotspot2.setStrip(4); scene->_hotspot2.setFrame(1); scene->_hotspot2.animate(ANIM_MODE_5, NULL); - _globals->_player.setVisage(40); - _globals->_player.setStrip(2); - _globals->_player.setFrame(1); - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.setVisage(40); + g_globals->_player.setStrip(2); + g_globals->_player.setFrame(1); + g_globals->_player.animate(ANIM_MODE_5, this); break; case 7: - _globals->_soundHandler.play(77, this); + g_globals->_soundHandler.play(77, this); break; case 8: - _globals->_game->endGame(2300, 0); + g_globals->_game->endGame(2300, 0); remove(); break; case 9: @@ -4459,17 +4459,17 @@ void Scene2300::Action1::signal() { scene->_hotspot5.animate(ANIM_MODE_NONE, NULL); scene->_hotspot6.animate(ANIM_MODE_NONE, NULL); - _globals->_player.disableControl(); - _globals->_player.setVisage(2672); - _globals->_player._strip = 5; - _globals->_player._frame = 1; - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.disableControl(); + g_globals->_player.setVisage(2672); + g_globals->_player._strip = 5; + g_globals->_player._frame = 1; + g_globals->_player.animate(ANIM_MODE_5, this); break; case 10: - _globals->_player.setVisage(2674); - _globals->_player._strip = 5; - _globals->_player._frame = 1; - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.setVisage(2674); + g_globals->_player._strip = 5; + g_globals->_player._frame = 1; + g_globals->_player.animate(ANIM_MODE_5, this); break; case 11: scene->_soundHandler1.play(28); @@ -4483,17 +4483,17 @@ void Scene2300::Action1::signal() { scene->_hotspot5.fixPriority(20); scene->_hotspot6.fixPriority(20); - _globals->_player.setVisage(2672); - _globals->_player._strip = 5; - _globals->_player._frame = _globals->_player.getFrameCount(); - _globals->_player.animate(ANIM_MODE_6, this); + g_globals->_player.setVisage(2672); + g_globals->_player._strip = 5; + g_globals->_player._frame = g_globals->_player.getFrameCount(); + g_globals->_player.animate(ANIM_MODE_6, this); break; case 12: scene->_soundHandler1.play(77); - _globals->_player.setVisage(0); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setStrip(4); - _globals->_player._uiEnabled = false; + g_globals->_player.setVisage(0); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setStrip(4); + g_globals->_player._uiEnabled = false; setDelay(60); break; case 13: @@ -4506,7 +4506,7 @@ void Scene2300::Action1::signal() { case 15: { Common::Point pt1(101, 148); PlayerMover *mover1 = new PlayerMover(); - _globals->_player.addMover(mover1, &pt1, this); + g_globals->_player.addMover(mover1, &pt1, this); Common::Point pt2(scene->_hotspot5._position.x + 5, scene->_hotspot5._position.y + 5); NpcMover *mover2 = new NpcMover(); @@ -4514,7 +4514,7 @@ void Scene2300::Action1::signal() { break; } case 16: - _globals->_sceneManager.changeScene(2000); + g_globals->_sceneManager.changeScene(2000); remove(); break; } @@ -4522,29 +4522,29 @@ void Scene2300::Action1::signal() { void Scene2300::Action2::signal() { // Miranda tearing cables - Scene2300 *scene = (Scene2300 *)_globals->_sceneManager._scene; + Scene2300 *scene = (Scene2300 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(30); break; case 1: { Common::Point pt(153, 135); PlayerMover *mover = new PlayerMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 2: - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_events.setCursor(CURSOR_WALK); scene->_stripManager.start(2030, this); break; case 3: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); setDelay(600); break; case 4: { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_hotspot2.postInit(); scene->_hotspot2.setVisage(2801); @@ -4582,34 +4582,34 @@ void Scene2300::Action2::signal() { scene->_stripManager.start(2035, this); break; case 10: - _globals->_sceneManager.changeScene(2310); + g_globals->_sceneManager.changeScene(2310); break; } } void Scene2300::Action3::signal() { // Stunned Miranda - Scene2300 *scene = (Scene2300 *)_globals->_sceneManager._scene; + Scene2300 *scene = (Scene2300 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: { Common::Point pt(153, 135); PlayerMover *mover = new PlayerMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 1: - _globals->_player.disableControl(); - _globals->_player.setVisage(2672); - _globals->_player._strip = 2; - _globals->_player._frame = 1; - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.disableControl(); + g_globals->_player.setVisage(2672); + g_globals->_player._strip = 2; + g_globals->_player._frame = 1; + g_globals->_player.animate(ANIM_MODE_5, this); break; case 2: - _globals->_player.setVisage(2674); - _globals->_player._strip = 2; - _globals->_player._frame = 1; - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.setVisage(2674); + g_globals->_player._strip = 2; + g_globals->_player._frame = 1; + g_globals->_player.animate(ANIM_MODE_5, this); break; case 3: scene->_soundHandler1.play(97); @@ -4619,30 +4619,30 @@ void Scene2300::Action3::signal() { scene->_hotspot7._frame = 1; scene->_hotspot7.animate(ANIM_MODE_5, this); - _globals->_player.setVisage(2672); - _globals->_player._strip = 2; - _globals->_player._frame = _globals->_player.getFrameCount(); - _globals->_player.animate(ANIM_MODE_6, NULL); + g_globals->_player.setVisage(2672); + g_globals->_player._strip = 2; + g_globals->_player._frame = g_globals->_player.getFrameCount(); + g_globals->_player.animate(ANIM_MODE_6, NULL); break; case 4: scene->_soundHandler2.play(97); - _globals->_player.setVisage(0); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setStrip(1); + g_globals->_player.setVisage(0); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setStrip(1); scene->_stripManager.start(2034, this); break; case 5: setDelay(10); break; case 6: - _globals->_sceneManager.changeScene(2310); + g_globals->_sceneManager.changeScene(2310); break; } } void Scene2300::Action4::signal() { // Ennemies coming - Scene2300 *scene = (Scene2300 *)_globals->_sceneManager._scene; + Scene2300 *scene = (Scene2300 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -4681,12 +4681,12 @@ void Scene2300::Action4::signal() { void Scene2300::Hotspot5::doAction(int action) { // Ennemies - Scene2300 *scene = (Scene2300 *)_globals->_sceneManager._scene; + Scene2300 *scene = (Scene2300 *)g_globals->_sceneManager._scene; switch (action) { case OBJECT_STUNNER: - _globals->_player.disableControl(); - _globals->_player.addMover(NULL); + g_globals->_player.disableControl(); + g_globals->_player.addMover(NULL); scene->_action1.setActionIndex(9); scene->_action1.setDelay(1); break; @@ -4704,7 +4704,7 @@ void Scene2300::Hotspot5::doAction(int action) { void Scene2300::Hotspot7::doAction(int action) { // Miranda - Scene2300 *scene = (Scene2300 *)_globals->_sceneManager._scene; + Scene2300 *scene = (Scene2300 *)g_globals->_sceneManager._scene; switch (action) { case OBJECT_STUNNER: @@ -4749,8 +4749,8 @@ void Scene2300::postInit(SceneObjectList *OwnerList) { _hotspot8.setVisage(2301); _hotspot8.setPosition(Common::Point(288, 74)); - _globals->_soundHandler.play(96); - if (_globals->_sceneManager._previousScene == 2000) { + g_globals->_soundHandler.play(96); + if (g_globals->_sceneManager._previousScene == 2000) { _hotspot8.remove(); _hotspot9.postInit(); @@ -4766,13 +4766,13 @@ void Scene2300::postInit(SceneObjectList *OwnerList) { _hotspot10._frame = _hotspot10.getFrameCount(); _hotspot10.setPosition(Common::Point(292, 113)); - _globals->_player.postInit(); - _globals->_player.setVisage(0); - _globals->_player.setPosition(Common::Point(109, 139)); - _globals->_player.changeZoom(40); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.disableControl(); + g_globals->_player.postInit(); + g_globals->_player.setVisage(0); + g_globals->_player.setPosition(Common::Point(109, 139)); + g_globals->_player.changeZoom(40); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.disableControl(); _hotspot7.postInit(); _hotspot7.setVisage(2302); @@ -4782,7 +4782,7 @@ void Scene2300::postInit(SceneObjectList *OwnerList) { _soundHandler1.play(95); _soundHandler2.play(96); - _globals->_sceneItems.push_back(&_hotspot7); + g_globals->_sceneItems.push_back(&_hotspot7); setAction(&_action2); } else { @@ -4807,13 +4807,13 @@ void Scene2300::postInit(SceneObjectList *OwnerList) { _hotspot1.setPosition(Common::Point(255, 190)); _hotspot1.changeZoom(40); - _globals->_player.postInit(); - _globals->_player.setVisage(0); - _globals->_player.setPosition(Common::Point(203, 191)); - _globals->_player.changeZoom(40); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.disableControl(); + g_globals->_player.postInit(); + g_globals->_player.setVisage(0); + g_globals->_player.setPosition(Common::Point(203, 191)); + g_globals->_player.changeZoom(40); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.disableControl(); _hotspot5.postInit(); _hotspot5.setVisage(91); @@ -4829,7 +4829,7 @@ void Scene2300::postInit(SceneObjectList *OwnerList) { _hotspot6.changeZoom(40); _hotspot6.setObjectWrapper(new SceneObjectWrapper()); - _globals->_sceneItems.push_back(&_hotspot5); + g_globals->_sceneItems.push_back(&_hotspot5); setAction(&_action1); } @@ -4839,7 +4839,7 @@ void Scene2300::postInit(SceneObjectList *OwnerList) { _hotspot14._sceneRegionId = 11; _hotspot15.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); - _globals->_sceneItems.addItems(&_hotspot12, &_hotspot11, &_hotspot13, &_hotspot14, &_hotspot15, NULL); + g_globals->_sceneItems.addItems(&_hotspot12, &_hotspot11, &_hotspot13, &_hotspot14, &_hotspot15, NULL); } /*-------------------------------------------------------------------------- @@ -4893,20 +4893,20 @@ void Scene2310::postInit(SceneObjectList *OwnerList) { _wireList[idx].setPosition(pointList[idx]); } - _globals->_player.disableControl(); - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_player.disableControl(); + g_globals->_events.setCursor(CURSOR_WALK); - if (_vm->getFeatures() & GF_CD) - _pageIndex = _globals->_randomSource.getRandomNumber(14) + 2; + if (g_vm->getFeatures() & GF_CD) + _pageIndex = g_globals->_randomSource.getRandomNumber(14) + 2; else - _pageIndex = _globals->_randomSource.getRandomNumber(19) + 1; + _pageIndex = g_globals->_randomSource.getRandomNumber(19) + 1; signal(); } void Scene2310::signal() { switch (_sceneMode++) { case 0: { - Common::String fmtString = _resourceManager->getMessage(2300, 22); + Common::String fmtString = g_resourceManager->getMessage(2300, 22); Common::String msg = Common::String::format(fmtString.c_str(), _pageList[_pageIndex]._pageNumber); _sceneText._width = 280; @@ -4919,18 +4919,18 @@ void Scene2310::signal() { break; } case 1: { - Common::String msg = _resourceManager->getMessage(2300, 23); + Common::String msg = g_resourceManager->getMessage(2300, 23); _sceneText.setup(msg); _sceneText.fixPriority(255); _sceneText.setPosition(Common::Point(30, 170)); - _globals->_sceneObjects->draw(); - _globals->_events.waitForPress(); + g_globals->_sceneObjects->draw(); + g_globals->_events.waitForPress(); _sceneText.hide(); - _globals->_sceneObjects->draw(); + g_globals->_sceneObjects->draw(); - _globals->_sceneManager.changeScene(2200); + g_globals->_sceneManager.changeScene(2200); break; } } @@ -4966,11 +4966,11 @@ void Scene2310::process(Event &event) { if (idx != 5) { _wireList[idx].hide(); - _globals->_sceneObjects->draw(); + g_globals->_sceneObjects->draw(); _wireList[idx].setFrame(frameNum); _wireList[idx].show(); - _globals->_sceneObjects->draw(); + g_globals->_sceneObjects->draw(); } } else { // End the moving of the currently active wire @@ -5003,7 +5003,7 @@ void Scene2310::process(Event &event) { void Scene2310::dispatch() { if (_wireIndex != 5) { for (int idx = 0; idx < 5; ++idx) { - if (_rectList[idx].contains(_globals->_events._mousePos)) { + if (_rectList[idx].contains(g_globals->_events._mousePos)) { _wireList[_wireIndex].setFrame(idx + 2); return; } @@ -5028,12 +5028,12 @@ int Scene2310::findObject(int objIndex) { *--------------------------------------------------------------------------*/ void Scene2320::Action1::signal() { - Scene2320 *scene = (Scene2320 *)_globals->_sceneManager._scene; + Scene2320 *scene = (Scene2320 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: setDelay(10); - if (_globals->_sceneManager._previousScene == 2120) + if (g_globals->_sceneManager._previousScene == 2120) _actionIndex = 3; break; case 1: { @@ -5060,7 +5060,7 @@ void Scene2320::Action1::signal() { } void Scene2320::Action2::signal() { - Scene2320 *scene = (Scene2320 *)_globals->_sceneManager._scene; + Scene2320 *scene = (Scene2320 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: { @@ -5080,13 +5080,13 @@ void Scene2320::Action2::signal() { } void Scene2320::Action3::signal() { - Scene2320 *scene = (Scene2320 *)_globals->_sceneManager._scene; + Scene2320 *scene = (Scene2320 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: { Common::Point pt(320, 86); PlayerMover *mover = new PlayerMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 1: @@ -5096,12 +5096,12 @@ void Scene2320::Action3::signal() { case 2: { Common::Point pt(320, 79); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 3: - _globals->_player.fixPriority(scene->_hotspot6._priority - 1); - _globals->_player._strip = 3; + g_globals->_player.fixPriority(scene->_hotspot6._priority - 1); + g_globals->_player._strip = 3; setDelay(10); break; case 4: @@ -5112,12 +5112,12 @@ void Scene2320::Action3::signal() { scene->_area3.draw(true); _state = 0; - _globals->_events.setCursor(CURSOR_USE); + g_globals->_events.setCursor(CURSOR_USE); - while (!_state && !_vm->shouldQuit()) { + while (!_state && !g_vm->shouldQuit()) { // Wait for an event Event event; - if (!_globals->_events.getEvent(event)) { + if (!g_globals->_events.getEvent(event)) { g_system->updateScreen(); g_system->delayMillis(10); continue; @@ -5154,13 +5154,13 @@ void Scene2320::Action3::signal() { break; case 5: { if (_state == 2320) - _globals->_player.fixPriority(-1); + g_globals->_player.fixPriority(-1); else - _globals->_sceneManager.changeScene(_state); + g_globals->_sceneManager.changeScene(_state); Common::Point pt(320, 86); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 6: @@ -5168,7 +5168,7 @@ void Scene2320::Action3::signal() { scene->_hotspot6.animate(ANIM_MODE_6, this); break; case 7: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; } @@ -5176,28 +5176,28 @@ void Scene2320::Action3::signal() { void Scene2320::Action4::signal() { // Fly Cycle actions - Scene2320 *scene = (Scene2320 *)_globals->_sceneManager._scene; + Scene2320 *scene = (Scene2320 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(3); break; case 1: { Common::Point pt(213, 84); PlayerMover *mover = new PlayerMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 2: case 16: - _globals->_player.setVisage(2109); - _globals->_player.setStrip(2); - _globals->_player.setFrame(1); - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.setVisage(2109); + g_globals->_player.setStrip(2); + g_globals->_player.setFrame(1); + g_globals->_player.animate(ANIM_MODE_5, this); break; case 3: - _globals->_player.animate(ANIM_MODE_6, NULL); + g_globals->_player.animate(ANIM_MODE_6, NULL); setAction(&scene->_action2, this); break; case 4: { @@ -5222,63 +5222,63 @@ void Scene2320::Action4::signal() { } case 6: { scene->_hotspot16.fixPriority(-1); - _globals->_player.setVisage(0); - _globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setVisage(0); + g_globals->_player.animate(ANIM_MODE_1, NULL); Common::Point pt(233, 176); PlayerMover *mover = new PlayerMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 7: { Common::Point pt(291, 194); PlayerMover *mover = new PlayerMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 8: - _globals->_player.setStrip(5); - _globals->_player.setFrame(1); + g_globals->_player.setStrip(5); + g_globals->_player.setFrame(1); setDelay(13); break; case 9: // Quinn sits in the flycycle scene->_hotspot16.hide(); - _globals->_player.setVisage(2323); - _globals->_player.setPosition(Common::Point(303, 176)); - _globals->_player.setStrip(2); - _globals->_player.setFrame(1); - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.setVisage(2323); + g_globals->_player.setPosition(Common::Point(303, 176)); + g_globals->_player.setStrip(2); + g_globals->_player.setFrame(1); + g_globals->_player.animate(ANIM_MODE_5, this); break; case 10: - if (_globals->getFlag(109)) { - _globals->_soundHandler.play(40); - _globals->_soundHandler.holdAt(true); + if (g_globals->getFlag(109)) { + g_globals->_soundHandler.play(40); + g_globals->_soundHandler.holdAt(true); Common::Point pt(303, 240); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); } else { setDelay(3); } break; case 11: - if (_globals->getFlag(109)) { - _globals->_sceneManager.changeScene(7600); + if (g_globals->getFlag(109)) { + g_globals->_sceneManager.changeScene(7600); } else { SceneItem::display2(2320, 19); setDelay(3); } break; case 12: - _globals->_player.animate(ANIM_MODE_6, this); + g_globals->_player.animate(ANIM_MODE_6, this); break; case 13: - _globals->_player.setVisage(0); - _globals->_player.setPosition(Common::Point(291, 194)); - _globals->_player.setStrip(5); - _globals->_player.setFrame(1); - _globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setVisage(0); + g_globals->_player.setPosition(Common::Point(291, 194)); + g_globals->_player.setStrip(5); + g_globals->_player.setFrame(1); + g_globals->_player.animate(ANIM_MODE_1, NULL); scene->_hotspot16.show(); setDelay(3); @@ -5286,17 +5286,17 @@ void Scene2320::Action4::signal() { case 14: { Common::Point pt(233, 176); PlayerMover *mover = new PlayerMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 15: { Common::Point pt(213, 85); PlayerMover *mover = new PlayerMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 17: { - _globals->_player.animate(ANIM_MODE_6, NULL); + g_globals->_player.animate(ANIM_MODE_6, NULL); scene->_hotspot16.fixPriority(160); Common::Point pt(320, 121); @@ -5322,9 +5322,9 @@ void Scene2320::Action4::signal() { break; } case 20: - _globals->_player.enableControl(); - _globals->_player.setVisage(0); - _globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.enableControl(); + g_globals->_player.setVisage(0); + g_globals->_player.animate(ANIM_MODE_1, NULL); scene->_hotspot13.fixPriority(1); remove(); @@ -5333,11 +5333,11 @@ void Scene2320::Action4::signal() { } void Scene2320::Action5::signal() { - Scene2320 *scene = (Scene2320 *)_globals->_sceneManager._scene; + Scene2320 *scene = (Scene2320 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); ADD_PLAYER_MOVER(163, 126); break; case 1: @@ -5347,29 +5347,29 @@ void Scene2320::Action5::signal() { setDelay(2); break; case 3: - if (!_globals->getFlag(59)) + if (!g_globals->getFlag(59)) setDelay(10); else scene->_stripManager.start(2323, this); break; case 4: - _globals->_player.setVisage(2347); - _globals->_player.setStrip(1); - _globals->_player.setFrame(1); - _globals->_player.fixPriority(137); - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.setVisage(2347); + g_globals->_player.setStrip(1); + g_globals->_player.setFrame(1); + g_globals->_player.fixPriority(137); + g_globals->_player.animate(ANIM_MODE_5, this); break; case 5: - _globals->_player.setStrip(2); - _globals->_player.setFrame(1); - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.setStrip(2); + g_globals->_player.setFrame(1); + g_globals->_player.animate(ANIM_MODE_5, this); break; case 6: - if (_globals->getFlag(72)) - _globals->_sceneManager.changeScene(7000); - else if (_globals->getFlag(59)) - _globals->_sceneManager.changeScene(5000); - else if (!_globals->getFlag(43) || (RING_INVENTORY._ale._sceneNumber != 1)) + if (g_globals->getFlag(72)) + g_globals->_sceneManager.changeScene(7000); + else if (g_globals->getFlag(59)) + g_globals->_sceneManager.changeScene(5000); + else if (!g_globals->getFlag(43) || (RING_INVENTORY._ale._sceneNumber != 1)) setDelay(10); else { scene->_hotspot11.setAction(NULL); @@ -5381,7 +5381,7 @@ void Scene2320::Action5::signal() { NpcMover *mover = new NpcMover(); scene->_hotspot11.addMover(mover, &pt, NULL); - _globals->clearFlag(43); + g_globals->clearFlag(43); scene->_stripManager.start(2325, this); } break; @@ -5389,82 +5389,82 @@ void Scene2320::Action5::signal() { setDelay(10); break; case 8: - _globals->_sceneManager.changeScene(4000); + g_globals->_sceneManager.changeScene(4000); break; } } void Scene2320::Action6::signal() { - Scene2320 *scene = (Scene2320 *)_globals->_sceneManager._scene; + Scene2320 *scene = (Scene2320 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: setDelay(30); break; case 1: - _globals->_player.animate(ANIM_MODE_6, this); + g_globals->_player.animate(ANIM_MODE_6, this); break; case 2: - _globals->_player.setStrip(1); - _globals->_player.setFrame(1); - _globals->_player.animate(ANIM_MODE_6, this); + g_globals->_player.setStrip(1); + g_globals->_player.setFrame(1); + g_globals->_player.animate(ANIM_MODE_6, this); break; case 3: - _globals->_player.setVisage(0); - _globals->_player.setStrip(3); - _globals->_player.fixPriority(-1); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setVisage(0); + g_globals->_player.setStrip(3); + g_globals->_player.fixPriority(-1); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.animate(ANIM_MODE_1, NULL); setDelay(60); break; case 4: - if ((_globals->_sceneManager._previousScene != 4000) || _globals->getFlag(43)) + if ((g_globals->_sceneManager._previousScene != 4000) || g_globals->getFlag(43)) setDelay(3); - else if (_globals->getFlag(35)) { - _globals->setFlag(43); + else if (g_globals->getFlag(35)) { + g_globals->setFlag(43); scene->_stripManager.start(4200, this); - _globals->setFlag(69); - } else if (_globals->getFlag(36)) { + g_globals->setFlag(69); + } else if (g_globals->getFlag(36)) { setDelay(3); } else { - _globals->setFlag(43); + g_globals->setFlag(43); scene->_stripManager.start(4210, this); break; } break; case 5: - if (_globals->_sceneObjects->contains(&scene->_hotspot11)) { + if (g_globals->_sceneObjects->contains(&scene->_hotspot11)) { scene->_hotspot11.setAction(&scene->_action1); - if (_globals->_sceneObjects->contains(&scene->_hotspot10)) { + if (g_globals->_sceneObjects->contains(&scene->_hotspot10)) { ADD_MOVER(scene->_hotspot10, 491, 160); } else { setDelay(60); } - _globals->_sceneItems.push_front(&scene->_hotspot11); + g_globals->_sceneItems.push_front(&scene->_hotspot11); } else { setDelay(3); } break; case 6: - _globals->_events.setCursor(CURSOR_WALK); - _globals->_player.enableControl(); + g_globals->_events.setCursor(CURSOR_WALK); + g_globals->_player.enableControl(); remove(); break; } } void Scene2320::Action7::signal() { - Scene2320 *scene = (Scene2320 *)_globals->_sceneManager._scene; + Scene2320 *scene = (Scene2320 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: setDelay(30); break; case 1: - _globals->_soundHandler.play(162); + g_globals->_soundHandler.play(162); scene->_hotspot6.animate(ANIM_MODE_5, this); break; case 2: @@ -5473,8 +5473,8 @@ void Scene2320::Action7::signal() { scene->_hotspot11.fixPriority(-1); ADD_MOVER_NULL(scene->_hotspot11, 346, 85); - _globals->_player.fixPriority(-1); - ADD_MOVER(_globals->_player, 297, 89); + g_globals->_player.fixPriority(-1); + ADD_MOVER(g_globals->_player, 297, 89); break; case 3: ADD_PLAYER_MOVER(462, 182); @@ -5485,17 +5485,17 @@ void Scene2320::Action7::signal() { case 5: ADD_MOVER(scene->_hotspot11, 500, 164); ADD_MOVER(scene->_hotspot10, 382, 93); - _globals->_player.setStrip(3); + g_globals->_player.setStrip(3); break; case 6: ADD_MOVER_NULL(scene->_hotspot10, 491, 160); - ADD_MOVER(_globals->_player, 391, 88); + ADD_MOVER(g_globals->_player, 391, 88); break; case 7: ADD_PLAYER_MOVER(462, 182); break; case 8: - _globals->_player.setStrip(7); + g_globals->_player.setStrip(7); setDelay(15); break; case 9: @@ -5508,14 +5508,14 @@ void Scene2320::Action7::signal() { scene->_stripManager.start(6022, this); break; case 12: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); RING_INVENTORY._stasisBox._sceneNumber = 2320; break; } } void Scene2320::Action8::signal() { - Scene2320 *scene = (Scene2320 *)_globals->_sceneManager._scene; + Scene2320 *scene = (Scene2320 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -5525,24 +5525,24 @@ void Scene2320::Action8::signal() { ADD_PLAYER_MOVER(462, 182); break; case 2: - _globals->_player.setStrip(7); + g_globals->_player.setStrip(7); setDelay(5); break; case 3: - scene->_speakerGameText.setTextPos(Common::Point(_globals->_sceneManager._scene->_sceneBounds.left + 30, 10)); - scene->_stripManager.start(_globals->getFlag(75) ? 6030 : 2320, this); + scene->_speakerGameText.setTextPos(Common::Point(g_globals->_sceneManager._scene->_sceneBounds.left + 30, 10)); + scene->_stripManager.start(g_globals->getFlag(75) ? 6030 : 2320, this); break; case 4: - if (_globals->getFlag(75)) + if (g_globals->getFlag(75)) setDelay(3); else - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; case 5: RING_INVENTORY._stasisBox._sceneNumber = 2320; scene->_sceneMode = 2326; - scene->_speakerGameText.setTextPos(Common::Point(_globals->_sceneManager._scene->_sceneBounds.left + 30, 10)); - scene->setAction(&scene->_sequenceManager1, scene, 2326, &_globals->_player, &scene->_hotspot11, NULL); + scene->_speakerGameText.setTextPos(Common::Point(g_globals->_sceneManager._scene->_sceneBounds.left + 30, 10)); + scene->setAction(&scene->_sequenceManager1, scene, 2326, &g_globals->_player, &scene->_hotspot11, NULL); break; } } @@ -5550,16 +5550,16 @@ void Scene2320::Action8::signal() { /*--------------------------------------------------------------------------*/ void Scene2320::Hotspot5::doAction(int action) { - Scene2320 *scene = (Scene2320 *)_globals->_sceneManager._scene; + Scene2320 *scene = (Scene2320 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(2320, 13); break; case CURSOR_USE: - if (_globals->getFlag(70)) + if (g_globals->getFlag(70)) SceneItem::display2(2320, 33); - else if (_globals->getFlag(13)) + else if (g_globals->getFlag(13)) SceneItem::display2(2320, 18); else scene->setAction(&scene->_action5); @@ -5571,14 +5571,14 @@ void Scene2320::Hotspot5::doAction(int action) { } void Scene2320::Hotspot6::doAction(int action) { - Scene2320 *scene = (Scene2320 *)_globals->_sceneManager._scene; + Scene2320 *scene = (Scene2320 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(2320, 2); break; case CURSOR_USE: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->setAction(&scene->_action3); break; default: @@ -5588,7 +5588,7 @@ void Scene2320::Hotspot6::doAction(int action) { } void Scene2320::Hotspot8::doAction(int action) { - Scene2320 *scene = (Scene2320 *)_globals->_sceneManager._scene; + Scene2320 *scene = (Scene2320 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -5596,7 +5596,7 @@ void Scene2320::Hotspot8::doAction(int action) { break; case CURSOR_USE: scene->_sceneMode = 2336; - scene->setAction(&scene->_sequenceManager1, scene, 2336, &_globals->_player, this, NULL); + scene->setAction(&scene->_sequenceManager1, scene, 2336, &g_globals->_player, this, NULL); break; default: SceneHotspot::doAction(action); @@ -5606,21 +5606,21 @@ void Scene2320::Hotspot8::doAction(int action) { void Scene2320::Hotspot10::doAction(int action) { // Seeker - Scene2320 *scene = (Scene2320 *)_globals->_sceneManager._scene; + Scene2320 *scene = (Scene2320 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(2320, 26); break; case CURSOR_TALK: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 2329; - if (_globals->getFlag(13)) { + if (g_globals->getFlag(13)) { scene->_stripManager.start(2337, scene); - } else if (_globals->getFlag(70)) { + } else if (g_globals->getFlag(70)) { scene->setAction(&scene->_action8); - } else if (_globals->getFlag(109)) { + } else if (g_globals->getFlag(109)) { scene->setAction(&scene->_sequenceManager1, scene, 2337, NULL); } else if (!_state) { ++_state; @@ -5636,29 +5636,29 @@ void Scene2320::Hotspot10::doAction(int action) { } void Scene2320::Hotspot11::doAction(int action) { - Scene2320 *scene = (Scene2320 *)_globals->_sceneManager._scene; + Scene2320 *scene = (Scene2320 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(2320, 25); break; case CURSOR_TALK: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 2329; - if (_globals->getFlag(13)) { - _globals->_player.disableControl(); + if (g_globals->getFlag(13)) { + g_globals->_player.disableControl(); scene->_sceneMode = 5000; scene->_stripManager.start(2336, scene); - } else if (_globals->getFlag(70)) { + } else if (g_globals->getFlag(70)) { scene->setAction(&scene->_action8); } else { scene->_sceneMode = 2329; if (RING_INVENTORY._ale._sceneNumber == 1) { scene->setAction(&scene->_sequenceManager1, scene, 2329, NULL); - } else if (!_globals->getFlag(110)) { - _globals->setFlag(110); + } else if (!g_globals->getFlag(110)) { + g_globals->setFlag(110); scene->setAction(&scene->_sequenceManager1, scene, 2330, NULL); } else if (RING_INVENTORY._peg._sceneNumber != 1) { scene->setAction(&scene->_sequenceManager1, scene, 2331, NULL); @@ -5677,19 +5677,19 @@ void Scene2320::Hotspot11::doAction(int action) { } void Scene2320::Hotspot12::doAction(int action) { - Scene2320 *scene = (Scene2320 *)_globals->_sceneManager._scene; + Scene2320 *scene = (Scene2320 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(2320, 5); break; case CURSOR_USE: - if (_globals->getFlag(13)) + if (g_globals->getFlag(13)) SceneItem::display2(2320, 24); else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 2322; - scene->setAction(&scene->_sequenceManager1, scene, 2322, &_globals->_player, NULL); + scene->setAction(&scene->_sequenceManager1, scene, 2322, &g_globals->_player, NULL); } break; default: @@ -5700,23 +5700,23 @@ void Scene2320::Hotspot12::doAction(int action) { void Scene2320::Hotspot14::doAction(int action) { // Right Console - Scene2320 *scene = (Scene2320 *)_globals->_sceneManager._scene; + Scene2320 *scene = (Scene2320 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(2320, 17); break; case CURSOR_USE: - if (_globals->getFlag(24)) { - _globals->clearFlag(24); - _globals->_player.disableControl(); + if (g_globals->getFlag(24)) { + g_globals->clearFlag(24); + g_globals->_player.disableControl(); scene->_hotspot8.postInit(); scene->_hotspot8.setVisage(2345); scene->_hotspot8.setPosition(Common::Point(634, 65)); scene->_hotspot8.hide(); - _globals->_sceneItems.push_front(&scene->_hotspot8); + g_globals->_sceneItems.push_front(&scene->_hotspot8); RING_INVENTORY._waldos._sceneNumber = 2320; scene->_hotspot9.postInit(); @@ -5733,11 +5733,11 @@ void Scene2320::Hotspot14::doAction(int action) { scene->_hotspot16.hide(); scene->_sceneMode = 2324; - scene->setAction(&scene->_sequenceManager1, scene, 2324, &_globals->_player, &scene->_hotspot7, + scene->setAction(&scene->_sequenceManager1, scene, 2324, &g_globals->_player, &scene->_hotspot7, &scene->_hotspot8, &scene->_hotspot9, &scene->_hotspot16, NULL); - } else if (_globals->getFlag(13)) { + } else if (g_globals->getFlag(13)) { SceneItem::display2(2320, 24); - } else if (!_globals->getFlag(76)) { + } else if (!g_globals->getFlag(76)) { SceneItem::display2(2320, 28); } else if (!RING_INVENTORY._waldos._sceneNumber) { SceneItem::display2(2320, 27); @@ -5753,14 +5753,14 @@ void Scene2320::Hotspot14::doAction(int action) { void Scene2320::Hotspot15::doAction(int action) { // Left console (Flycycle console) - Scene2320 *scene = (Scene2320 *)_globals->_sceneManager._scene; + Scene2320 *scene = (Scene2320 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(2320, 16); break; case CURSOR_USE: - if (_globals->getFlag(13)) + if (g_globals->getFlag(13)) SceneItem::display2(2320, 24); else scene->setAction(&scene->_action4); @@ -5808,7 +5808,7 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_speakerGameText); _speakerMText._npc = &_hotspot11; - _speakerQText._npc = &_globals->_player; + _speakerQText._npc = &g_globals->_player; _hotspotPtr = &_hotspot10; _hotspot6.postInit(); @@ -5838,33 +5838,33 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { _hotspot8.setPosition(Common::Point(541, 103)); _hotspot8.fixPriority(201); - _globals->_sceneItems.push_back(&_hotspot8); + g_globals->_sceneItems.push_back(&_hotspot8); } - if (_globals->getFlag(43)) { + if (g_globals->getFlag(43)) { _hotspot11.postInit(); _hotspot11.setVisage(2705); _hotspot11._strip = 3; _hotspot11.setPosition(Common::Point(510, 156)); - _globals->_sceneItems.push_back(&_hotspot11); + g_globals->_sceneItems.push_back(&_hotspot11); _hotspot11._state = 0; _hotspot11.setAction(&_action1); } - _globals->_player.postInit(); - if (_globals->getFlag(13)) - _globals->_player.setVisage(2170); + g_globals->_player.postInit(); + if (g_globals->getFlag(13)) + g_globals->_player.setVisage(2170); else - _globals->_player.setVisage(0); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.setPosition(Common::Point(320, 79)); - _globals->_player.fixPriority(10); - _globals->_player.changeZoom(-1); - _globals->_player._moveDiff.y = 3; - _globals->_player.disableControl(); - - if (_globals->getFlag(114)) { + g_globals->_player.setVisage(0); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.setPosition(Common::Point(320, 79)); + g_globals->_player.fixPriority(10); + g_globals->_player.changeZoom(-1); + g_globals->_player._moveDiff.y = 3; + g_globals->_player.disableControl(); + + if (g_globals->getFlag(114)) { _hotspot10.postInit(); _hotspot10.setVisage(2806); _hotspot10.setPosition(Common::Point(481, 162)); @@ -5872,10 +5872,10 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { _hotspot10.setStrip(5); _hotspot10._state = 0; - _globals->_sceneItems.push_back(&_hotspot10); + g_globals->_sceneItems.push_back(&_hotspot10); } - if (_globals->getFlag(70)) { + if (g_globals->getFlag(70)) { _hotspot11.postInit(); _hotspot11.setVisage(2705); _hotspot11.setPosition(Common::Point(500, 164)); @@ -5886,20 +5886,20 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { _hotspot10.changeZoom(-1); _hotspot10.setStrip(5); - _globals->_sceneItems.addItems(&_hotspot11, &_hotspot10, NULL); + g_globals->_sceneItems.addItems(&_hotspot11, &_hotspot10, NULL); } - switch (_globals->_sceneManager._previousScene) { + switch (g_globals->_sceneManager._previousScene) { case 2120: - _globals->_soundHandler.play(160); - _globals->_soundHandler.holdAt(true); + g_globals->_soundHandler.play(160); + g_globals->_soundHandler.holdAt(true); - _globals->_player.fixPriority(-1); - _globals->_player.setPosition(Common::Point(389, 72)); - _globals->_player.enableControl(); + g_globals->_player.fixPriority(-1); + g_globals->_player.setPosition(Common::Point(389, 72)); + g_globals->_player.enableControl(); break; case 4000: - if (!_globals->getFlag(36) && !_globals->getFlag(43)) { + if (!g_globals->getFlag(36) && !g_globals->getFlag(43)) { _hotspot11.postInit(); _hotspot11.setVisage(2705); _hotspot11.setPosition(Common::Point(178, 118)); @@ -5909,25 +5909,25 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { case 4250: case 5000: case 7000: - _globals->_soundHandler.play(160); - _globals->_soundHandler.holdAt(true); - if ((_globals->_sceneManager._previousScene == 7000) && !_globals->getFlag(80)) - _globals->setFlag(36); - - _globals->_player.disableControl(); - _globals->_player.animate(ANIM_MODE_NONE, NULL); - _globals->_player.setObjectWrapper(NULL); - _globals->_player.setVisage(2347); - _globals->_player.setStrip(2); - _globals->_player.setFrame(5); - _globals->_player.fixPriority(137); - _globals->_player.setPosition(Common::Point(165, 132)); + g_globals->_soundHandler.play(160); + g_globals->_soundHandler.holdAt(true); + if ((g_globals->_sceneManager._previousScene == 7000) && !g_globals->getFlag(80)) + g_globals->setFlag(36); + + g_globals->_player.disableControl(); + g_globals->_player.animate(ANIM_MODE_NONE, NULL); + g_globals->_player.setObjectWrapper(NULL); + g_globals->_player.setVisage(2347); + g_globals->_player.setStrip(2); + g_globals->_player.setFrame(5); + g_globals->_player.fixPriority(137); + g_globals->_player.setPosition(Common::Point(165, 132)); setAction(&_action6); break; case 6100: - _globals->_soundHandler.play(160); - _globals->_soundHandler.holdAt(true); + g_globals->_soundHandler.play(160); + g_globals->_soundHandler.holdAt(true); _hotspot8.postInit(); _hotspot8.setVisage(2345); @@ -5935,19 +5935,19 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { _hotspot8.hide(); _sceneMode = 2325; - setAction(&_sequenceManager1, this, 2325, &_globals->_player, &_hotspot6, &_hotspot8, &_hotspot7, NULL); + setAction(&_sequenceManager1, this, 2325, &g_globals->_player, &_hotspot6, &_hotspot8, &_hotspot7, NULL); break; case 7600: - _globals->_soundHandler.play(160); - _globals->_soundHandler.holdAt(true); + g_globals->_soundHandler.play(160); + g_globals->_soundHandler.holdAt(true); _soundHandler.play(21); - _globals->_player.setVisage(2323); - _globals->_player.setStrip(2); - _globals->_player.setFrame(_globals->_player.getFrameCount()); - _globals->_player.setPosition(Common::Point(303, 176)); - _globals->_player.fixPriority(-1); - _globals->_player.disableControl(); + g_globals->_player.setVisage(2323); + g_globals->_player.setStrip(2); + g_globals->_player.setFrame(g_globals->_player.getFrameCount()); + g_globals->_player.setPosition(Common::Point(303, 176)); + g_globals->_player.fixPriority(-1); + g_globals->_player.disableControl(); _hotspot13.setPosition(Common::Point(319, 199)); @@ -5959,14 +5959,14 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { _hotspot16.hide(); _sceneMode = 2338; - setAction(&_sequenceManager1, this, 2338, &_globals->_player, &_hotspot16, &_hotspot13, NULL); + setAction(&_sequenceManager1, this, 2338, &g_globals->_player, &_hotspot16, &_hotspot13, NULL); break; default: - switch (_globals->_stripNum) { + switch (g_globals->_stripNum) { case 2101: - _globals->_player.disableControl(); - _globals->_player.setStrip(3); - _globals->_player.setPosition(Common::Point(307, 84)); + g_globals->_player.disableControl(); + g_globals->_player.setStrip(3); + g_globals->_player.setPosition(Common::Point(307, 84)); _hotspot11.postInit(); _hotspot11.setVisage(2705); @@ -5994,21 +5994,21 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { _hotspot8.hide(); _sceneMode = 2325; - setAction(&_sequenceManager1, this, 2325, &_globals->_player, &_hotspot6, &_hotspot8, &_hotspot7, NULL); + setAction(&_sequenceManager1, this, 2325, &g_globals->_player, &_hotspot6, &_hotspot8, &_hotspot7, NULL); break; default: - _globals->_soundHandler.play(160); - _globals->_soundHandler.holdAt(true); + g_globals->_soundHandler.play(160); + g_globals->_soundHandler.holdAt(true); _sceneMode = 2321; - _globals->_player.setStrip(3); - setAction(&_sequenceManager1, this, 2321, &_globals->_player, &_hotspot6, NULL); + g_globals->_player.setStrip(3); + setAction(&_sequenceManager1, this, 2321, &g_globals->_player, &_hotspot6, NULL); break; } } - _globals->_stripNum = 0; - _globals->_sceneManager._scene->_sceneBounds.center(_globals->_player._position); + g_globals->_stripNum = 0; + g_globals->_sceneManager._scene->_sceneBounds.center(g_globals->_player._position); loadScene(2320); _hotspot14._sceneRegionId = 8; @@ -6019,7 +6019,7 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { _hotspot5.setBounds(Rect(104, 122, 174, 157)); _hotspot15.setBounds(Rect(191, 53, 205, 63)); - _globals->_sceneItems.addItems(&_hotspot14, &_hotspot15, &_hotspot5, &_hotspot6, &_hotspot12, + g_globals->_sceneItems.addItems(&_hotspot14, &_hotspot15, &_hotspot5, &_hotspot6, &_hotspot12, &_hotspot13, &_hotspot4, &_hotspot3, &_hotspot2, &_hotspot1, NULL); } @@ -6033,40 +6033,40 @@ void Scene2320::signal() { case 2321: case 2327: case 2329: - if (_globals->getFlag(43) && !_hotspot11._action) + if (g_globals->getFlag(43) && !_hotspot11._action) _hotspot11.setAction(&_action1); - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; case 2322: - _globals->_sceneManager.changeScene(2120); + g_globals->_sceneManager.changeScene(2120); break; case 2323: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); break; case 2338: case 2324: _hotspot16.remove(); - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; case 2325: - _globals->setFlag(76); - _globals->clearFlag(70); - _globals->_stripNum = 6100; - _globals->_sceneManager.changeScene(2100); + g_globals->setFlag(76); + g_globals->clearFlag(70); + g_globals->_stripNum = 6100; + g_globals->_sceneManager.changeScene(2100); break; case 2326: - _globals->clearFlag(70); + g_globals->clearFlag(70); RING_INVENTORY._nullifier._sceneNumber = 1; - _globals->_stripNum = 2321; - _globals->_sceneManager.changeScene(2100); + g_globals->_stripNum = 2321; + g_globals->_sceneManager.changeScene(2100); break; case 2336: - _globals->setFlag(77); + g_globals->setFlag(77); RING_INVENTORY._waldos._sceneNumber = 1; _hotspot8.remove(); break; case 5000: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; } } @@ -6082,32 +6082,32 @@ void Scene2400::Action1::signal() { setDelay(60); break; case 1: - ADD_MOVER(_globals->_player, 160, 71); + ADD_MOVER(g_globals->_player, 160, 71); break; case 2: - ADD_MOVER(_globals->_player, 160, 360); + ADD_MOVER(g_globals->_player, 160, 360); break; case 3: - _globals->_player._moveDiff = Common::Point(1, 1); - ADD_MOVER(_globals->_player, 140, 375); + g_globals->_player._moveDiff = Common::Point(1, 1); + ADD_MOVER(g_globals->_player, 140, 375); break; case 4: - ADD_MOVER(_globals->_player, 87, 338); + ADD_MOVER(g_globals->_player, 87, 338); break; case 5: - _globals->_player.hide(); + g_globals->_player.hide(); setDelay(60); break; case 6: - _globals->_sceneManager.changeScene(4000); + g_globals->_sceneManager.changeScene(4000); break; } } void Scene2400::Action1::dispatch() { Action::dispatch(); - if ((_actionIndex == 4) && (_globals->_player._percent > 5)) - _globals->_player.changeZoom(_globals->_player._percent - 2); + if ((_actionIndex == 4) && (g_globals->_player._percent > 5)) + g_globals->_player.changeZoom(g_globals->_player._percent - 2); } /*--------------------------------------------------------------------------*/ @@ -6117,19 +6117,19 @@ void Scene2400::postInit(SceneObjectList *OwnerList) { Scene::postInit(); setZoomPercents(0, 100, 200, 100); - _globals->_player.postInit(); - _globals->_player.setVisage(2410); - _globals->_player.setPosition(Common::Point(340, -10)); - _globals->_player.animate(ANIM_MODE_2, NULL); - _globals->_player.disableControl(); + g_globals->_player.postInit(); + g_globals->_player.setVisage(2410); + g_globals->_player.setPosition(Common::Point(340, -10)); + g_globals->_player.animate(ANIM_MODE_2, NULL); + g_globals->_player.disableControl(); setAction(&_action1); - _globals->_sceneManager._scene->_sceneBounds.center(_globals->_player._position.x, _globals->_player._position.y); - _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); - _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; + g_globals->_sceneManager._scene->_sceneBounds.center(g_globals->_player._position.x, g_globals->_player._position.y); + g_globals->_sceneManager._scene->_sceneBounds.contain(g_globals->_sceneManager._scene->_backgroundBounds); + g_globals->_sceneOffset.x = (g_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; - _globals->_soundHandler.play(153); + g_globals->_soundHandler.play(153); } } // End of namespace Ringworld diff --git a/engines/tsage/ringworld/ringworld_scenes4.cpp b/engines/tsage/ringworld/ringworld_scenes4.cpp index 0f4c3e49a0..98bf0158e7 100644 --- a/engines/tsage/ringworld/ringworld_scenes4.cpp +++ b/engines/tsage/ringworld/ringworld_scenes4.cpp @@ -36,7 +36,7 @@ namespace Ringworld { *--------------------------------------------------------------------------*/ void Scene3500::Action1::signal() { - Scene3500 *scene = (Scene3500 *)_globals->_sceneManager._scene; + Scene3500 *scene = (Scene3500 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -49,13 +49,13 @@ void Scene3500::Action1::signal() { setDelay(3); break; case 3: - _globals->_sceneManager.changeScene(9999); + g_globals->_sceneManager.changeScene(9999); break; } } void Scene3500::Action2::signal() { - Scene3500 *scene = (Scene3500 *)_globals->_sceneManager._scene; + Scene3500 *scene = (Scene3500 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -68,7 +68,7 @@ void Scene3500::Action2::signal() { setDelay(3); break; case 3: - _globals->_sceneManager.changeScene(2012); + g_globals->_sceneManager.changeScene(2012); break; } } @@ -76,17 +76,17 @@ void Scene3500::Action2::signal() { /*--------------------------------------------------------------------------*/ void Scene3500::postInit(SceneObjectList *OwnerList) { - loadScene((_globals->_stripNum == 3600) ? 3600 : 3500); + loadScene((g_globals->_stripNum == 3600) ? 3600 : 3500); Scene::postInit(); _stripManager.addSpeaker(&_speakerQText); _stripManager.addSpeaker(&_speakerMText); _stripManager.addSpeaker(&_speakerSText); - _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); - _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.top / 160) * 160; + g_globals->_sceneManager._scene->_sceneBounds.contain(g_globals->_sceneManager._scene->_backgroundBounds); + g_globals->_sceneOffset.x = (g_globals->_sceneManager._scene->_sceneBounds.top / 160) * 160; - setAction((_globals->_stripNum == 3600) ? (Action *)&_action2 : (Action *)&_action1); + setAction((g_globals->_stripNum == 3600) ? (Action *)&_action2 : (Action *)&_action1); } /*-------------------------------------------------------------------------- @@ -102,7 +102,7 @@ Scene3700::Viewer::Viewer() { _frameList[0] = 1; for (int idx = 1; idx <= 3; ++idx) - _frameList[idx] = _globals->_randomSource.getRandomNumber(4) + 1; + _frameList[idx] = g_globals->_randomSource.getRandomNumber(4) + 1; _active = true; _countdownCtr = 0; @@ -132,7 +132,7 @@ void Scene3700::Viewer::dispatch() { int newFrame; do { - newFrame = _globals->_randomSource.getRandomNumber(4) + 1; + newFrame = g_globals->_randomSource.getRandomNumber(4) + 1; } while (newFrame == _frameList[2]); _frameList[1] = newFrame; @@ -146,27 +146,27 @@ void Scene3700::Viewer::reposition() { } void Scene3700::Viewer::draw() { - Region *priorityRegion = _globals->_sceneManager._scene->_priorities.find(1); + Region *priorityRegion = g_globals->_sceneManager._scene->_priorities.find(1); for (int idx = 0; idx < 4; ++idx) { Visage &v = (idx == 0) ? _images1 : _images2; GfxSurface img = v.getFrame(_frameList[idx]); Rect destRect = img.getBounds(); - destRect.resize(img, (_position.x - _globals->_sceneOffset.x), - (_position.y - _globals->_sceneOffset.y - _yDiff), _percentList[idx]); + destRect.resize(img, (_position.x - g_globals->_sceneOffset.x), + (_position.y - g_globals->_sceneOffset.y - _yDiff), _percentList[idx]); - destRect.translate(-_globals->_sceneManager._scene->_sceneBounds.left, - -_globals->_sceneManager._scene->_sceneBounds.top); + destRect.translate(-g_globals->_sceneManager._scene->_sceneBounds.left, + -g_globals->_sceneManager._scene->_sceneBounds.top); - _globals->gfxManager().copyFrom(img, destRect, priorityRegion); + g_globals->gfxManager().copyFrom(img, destRect, priorityRegion); } } /*--------------------------------------------------------------------------*/ void Scene3700::Action1::signal() { - Scene3700 *scene = (Scene3700 *)_globals->_sceneManager._scene; + Scene3700 *scene = (Scene3700 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -218,11 +218,11 @@ void Scene3700::Action1::signal() { case 8: scene->_hotspot1.remove(); scene->_hotspot2.show(); - _globals->setFlag(59); + g_globals->setFlag(59); setDelay(30); break; case 9: - _globals->_sceneManager.changeScene(2100); + g_globals->_sceneManager.changeScene(2100); break; } } @@ -246,7 +246,7 @@ void Scene3700::postInit(TsAGE::SceneObjectList *OwnerList) { _viewer.setPosition(Common::Point(195, 83)); setAction(&_action1); - _globals->_soundHandler.play(195); + g_globals->_soundHandler.play(195); } } // End of namespace Ringworld diff --git a/engines/tsage/ringworld/ringworld_scenes5.cpp b/engines/tsage/ringworld/ringworld_scenes5.cpp index 30093b7855..3cf1207e9e 100644 --- a/engines/tsage/ringworld/ringworld_scenes5.cpp +++ b/engines/tsage/ringworld/ringworld_scenes5.cpp @@ -37,7 +37,7 @@ namespace Ringworld { void Scene4000::Action1::signal() { // Quinn has the peg. Everybody enter the screen. - Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; + Scene4000 *scene = (Scene4000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: { @@ -52,10 +52,10 @@ void Scene4000::Action1::signal() { scene->_hotspot5.addMover(mover, &pt, this); RING_INVENTORY._ale._sceneNumber = 0; - _globals->clearFlag(42); - _globals->clearFlag(36); - _globals->clearFlag(43); - _globals->clearFlag(37); + g_globals->clearFlag(42); + g_globals->clearFlag(36); + g_globals->clearFlag(43); + g_globals->clearFlag(37); break; } case 1: { @@ -85,7 +85,7 @@ void Scene4000::Action1::signal() { ADD_PLAYER_MOVER_THIS(scene->_miranda, 266, 169); - ADD_PLAYER_MOVER_NULL(_globals->_player, 241, 155); + ADD_PLAYER_MOVER_NULL(g_globals->_player, 241, 155); break; } case 2: @@ -104,14 +104,14 @@ void Scene4000::Action1::signal() { ADD_MOVER_NULL(scene->_hotspot5, -40, 86); break; case 5: - _globals->_soundHandler.play(155); - _globals->setFlag(43); - _globals->setFlag(114); + g_globals->_soundHandler.play(155); + g_globals->setFlag(43); + g_globals->setFlag(114); scene->_stripManager.start(4430, this); break; case 6: ADD_PLAYER_MOVER_THIS(scene->_olo, 277, 175); - ADD_PLAYER_MOVER_NULL(_globals->_player, 258, 187); + ADD_PLAYER_MOVER_NULL(g_globals->_player, 258, 187); break; case 7: scene->_stripManager.start(4440, this); @@ -120,8 +120,8 @@ void Scene4000::Action1::signal() { setDelay(30); break; case 9: - _globals->setFlag(96); - _globals->_sceneManager.changeScene(4025); + g_globals->setFlag(96); + g_globals->_sceneManager.changeScene(4025); break; } } @@ -129,11 +129,11 @@ void Scene4000::Action1::signal() { void Scene4000::Action2::signal() { // Quinn, Seeker and Miranda walks down to the village // Then, they talk to Rock, and enter the priest hut - Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; + Scene4000 *scene = (Scene4000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - setAction(&scene->_sequenceManager1, this, 4001, &_globals->_player, NULL); + setAction(&scene->_sequenceManager1, this, 4001, &g_globals->_player, NULL); scene->_hotspot5.postInit(); scene->_hotspot5.setVisage(2801); @@ -146,13 +146,13 @@ void Scene4000::Action2::signal() { scene->_miranda.setAction(&scene->_sequenceManager2, NULL, 4002, &scene->_miranda, NULL); break; case 1: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_lander.remove(); ADD_MOVER(scene->_guardRock, scene->_hotspot5._position.x + 30, scene->_hotspot5._position.y - 10); break; case 2: - _globals->_player.checkAngle(&scene->_guardRock); + g_globals->_player.checkAngle(&scene->_guardRock); scene->_hotspot5.checkAngle(&scene->_guardRock); scene->_miranda.checkAngle(&scene->_guardRock); scene->_stripManager.start(4000, this); @@ -165,7 +165,7 @@ void Scene4000::Action2::signal() { ADD_MOVER(scene->_hotspot2, 116, 160); ADD_MOVER(scene->_hotspot5, 116, 160); - _globals->setFlag(37); + g_globals->setFlag(37); break; case 4: break; @@ -178,14 +178,14 @@ void Scene4000::Action2::signal() { ADD_PLAYER_MOVER_NULL(scene->_miranda, 210, 133); break; case 7: - _globals->_sceneManager.changeScene(4045); + g_globals->_sceneManager.changeScene(4045); break; } } void Scene4000::Action3::signal() { // The guard walks to the left and exits the screen - Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; + Scene4000 *scene = (Scene4000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -204,19 +204,19 @@ void Scene4000::Action3::signal() { void Scene4000::Action4::signal() { // Quinn ties the rope to the rock - Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; + Scene4000 *scene = (Scene4000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player._uiEnabled = false; - ADD_MOVER(_globals->_player, 257, 57); + g_globals->_player._uiEnabled = false; + ADD_MOVER(g_globals->_player, 257, 57); break; case 1: - _globals->_player.setVisage(4008); - _globals->_player.setPosition(Common::Point(258, 83)); - _globals->_player._frame = 1; - _globals->_player._strip = 3; - _globals->_player.animate(ANIM_MODE_4, 2, 1, this); + g_globals->_player.setVisage(4008); + g_globals->_player.setPosition(Common::Point(258, 83)); + g_globals->_player._frame = 1; + g_globals->_player._strip = 3; + g_globals->_player.animate(ANIM_MODE_4, 2, 1, this); break; case 2: scene->_rope.postInit(); @@ -226,16 +226,16 @@ void Scene4000::Action4::signal() { scene->_rope.setPosition(Common::Point(268, 44)); RING_INVENTORY._rope._sceneNumber = 4000; - _globals->_events.setCursor(CURSOR_USE); - _globals->_player.animate(ANIM_MODE_6, this); + g_globals->_events.setCursor(CURSOR_USE); + g_globals->_player.animate(ANIM_MODE_6, this); break; case 3: - _globals->_player.setVisage(2602); - _globals->_player.setPosition(Common::Point(257, 57)); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player._uiEnabled = true; + g_globals->_player.setVisage(2602); + g_globals->_player.setPosition(Common::Point(257, 57)); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player._uiEnabled = true; - _globals->setFlag(41); + g_globals->setFlag(41); remove(); break; } @@ -243,15 +243,15 @@ void Scene4000::Action4::signal() { void Scene4000::Action5::signal() { // Chat with Miranda - Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; + Scene4000 *scene = (Scene4000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(15); break; case 1: - scene->_stripManager.start(_globals->_stripNum, this); + scene->_stripManager.start(g_globals->_stripNum, this); break; case 2: setDelay(10); @@ -262,7 +262,7 @@ void Scene4000::Action5::signal() { scene->_hotspot8.setFrame2(-1); scene->_hotspot8.setAction(&scene->_action3); - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; } @@ -271,102 +271,102 @@ void Scene4000::Action5::signal() { void Scene4000::Action6::signal() { // Quinn and Miranda enter the screen and walk to the village. // Rock comes and notices the alcohol. They all enter his hut. - Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; + Scene4000 *scene = (Scene4000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(30); break; case 1: - setAction(&scene->_sequenceManager1, this, 4001, &_globals->_player, NULL); + setAction(&scene->_sequenceManager1, this, 4001, &g_globals->_player, NULL); - if (!_globals->getFlag(36)) + if (!g_globals->getFlag(36)) scene->_miranda.setAction(&scene->_sequenceManager2, NULL, 4002, &scene->_miranda, NULL); break; case 2: - _globals->_player.disableControl(); - ADD_MOVER(scene->_guardRock, _globals->_player._position.x + 30, _globals->_player._position.y - 5); + g_globals->_player.disableControl(); + ADD_MOVER(scene->_guardRock, g_globals->_player._position.x + 30, g_globals->_player._position.y - 5); break; case 3: - scene->_stripManager.start(_globals->getFlag(35) ? 4500 : 4502, this); + scene->_stripManager.start(g_globals->getFlag(35) ? 4500 : 4502, this); break; case 4: - _globals->clearFlag(35); + g_globals->clearFlag(35); ADD_MOVER_NULL(scene->_guardRock, 292, 138); ADD_PLAYER_MOVER(283, 147); - if (!_globals->getFlag(36)) + if (!g_globals->getFlag(36)) ADD_PLAYER_MOVER_NULL(scene->_miranda, 280, 150); RING_INVENTORY._ale._sceneNumber = 4100; break; case 5: - _globals->_sceneManager.changeScene(4100); + g_globals->_sceneManager.changeScene(4100); break; } } void Scene4000::Action7::signal() { // Climb down left Chimney using a rope - Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; + Scene4000 *scene = (Scene4000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_rope.setFrame(1); - ADD_MOVER(_globals->_player, 247, 53); + ADD_MOVER(g_globals->_player, 247, 53); break; case 1: - _globals->_player.setVisage(4008); - _globals->_player.setStrip(4); - _globals->_player.setFrame(1); - _globals->_player.fixPriority(16); - _globals->_player.setPosition(Common::Point(260, 55)); - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.setVisage(4008); + g_globals->_player.setStrip(4); + g_globals->_player.setFrame(1); + g_globals->_player.fixPriority(16); + g_globals->_player.setPosition(Common::Point(260, 55)); + g_globals->_player.animate(ANIM_MODE_5, this); break; case 2: - _globals->_sceneManager.changeScene(4050); + g_globals->_sceneManager.changeScene(4050); break; } } void Scene4000::Action8::signal() { // Climb down right Chimney using a rope - Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; + Scene4000 *scene = (Scene4000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); - if (_globals->getFlag(41)) + g_globals->_player.disableControl(); + if (g_globals->getFlag(41)) scene->_rope.setFrame(2); - ADD_MOVER(_globals->_player, 289, 53); + ADD_MOVER(g_globals->_player, 289, 53); break; case 1: - _globals->_player.setVisage(4008); - _globals->_player.setStrip(5); - _globals->_player.fixPriority(16); - _globals->_player.setFrame(1); - _globals->_player.setPosition(Common::Point(283, 52)); - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.setVisage(4008); + g_globals->_player.setStrip(5); + g_globals->_player.fixPriority(16); + g_globals->_player.setFrame(1); + g_globals->_player.setPosition(Common::Point(283, 52)); + g_globals->_player.animate(ANIM_MODE_5, this); break; case 2: - _globals->_player.remove(); + g_globals->_player.remove(); setDelay(60); break; case 3: - _globals->_soundHandler.play(170); + g_globals->_soundHandler.play(170); scene->_smoke2.setVisage(4000); scene->_smoke2.setStrip(6); scene->_smoke2.animate(ANIM_MODE_2, NULL); setDelay(60); break; case 4: - _globals->_soundHandler.play(77, this); + g_globals->_soundHandler.play(77, this); break; case 5: - _globals->_game->endGame(4000, 15); + g_globals->_game->endGame(4000, 15); remove(); break; } @@ -376,7 +376,7 @@ void Scene4000::Action9::signal() { // Villager animations switch (_actionIndex++) { case 0: - setDelay(_globals->_randomSource.getRandomNumber(119) + 240); + setDelay(g_globals->_randomSource.getRandomNumber(119) + 240); break; case 1: static_cast<SceneObject *>(_owner)->animate(ANIM_MODE_8, 1, this); @@ -389,7 +389,7 @@ void Scene4000::Action10::signal() { // Villager animations switch (_actionIndex++) { case 0: - setDelay(_globals->_randomSource.getRandomNumber(119) + 240); + setDelay(g_globals->_randomSource.getRandomNumber(119) + 240); break; case 1: static_cast<SceneObject *>(_owner)->animate(ANIM_MODE_8, 1, this); @@ -399,11 +399,11 @@ void Scene4000::Action10::signal() { } void Scene4000::Action11::signal() { - Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; + Scene4000 *scene = (Scene4000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); ADD_MOVER(scene->_lander, -30, 70); break; case 1: @@ -417,7 +417,7 @@ void Scene4000::Action11::signal() { scene->_hotspot5._moveDiff.x = 4; scene->_hotspot5.setPosition(Common::Point(-8, 88)); - setAction(&scene->_sequenceManager1, this, 4001, &_globals->_player, NULL); + setAction(&scene->_sequenceManager1, this, 4001, &g_globals->_player, NULL); scene->_miranda.setPosition(Common::Point(-210, 139)); scene->_miranda.setAction(&scene->_sequenceManager2, NULL, 4002, &scene->_miranda, NULL); @@ -434,33 +434,33 @@ void Scene4000::Action11::signal() { scene->_soundHandler1.stop(); scene->_forceField.remove(); - ADD_MOVER(_globals->_player, 340, 163); + ADD_MOVER(g_globals->_player, 340, 163); ADD_MOVER_NULL(scene->_miranda, 340, 169); ADD_MOVER_NULL(scene->_hotspot5, 340, 165); break; case 6: - _globals->_sceneManager.changeScene(4250); + g_globals->_sceneManager.changeScene(4250); break; } } void Scene4000::Action12::signal() { // Quinn enter Rock's hut - Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; + Scene4000 *scene = (Scene4000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(5); break; case 1: - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_events.setCursor(CURSOR_WALK); scene->_stripManager.start(4015, this); break; case 2: - _globals->setFlag(32); + g_globals->setFlag(32); if (scene->_stripManager._field2E8 == 275) { - _globals->setFlag(82); + g_globals->setFlag(82); ADD_MOVER_NULL(scene->_guardRock, 292, 138); ADD_PLAYER_MOVER(283, 147); } else { @@ -469,7 +469,7 @@ void Scene4000::Action12::signal() { break; case 3: if (scene->_stripManager._field2E8 == 275) { - _globals->_sceneManager.changeScene(4100); + g_globals->_sceneManager.changeScene(4100); } else { ADD_PLAYER_MOVER_THIS(scene->_guardRock, 300, 132); } @@ -479,8 +479,8 @@ void Scene4000::Action12::signal() { scene->_stripManager.start(4020, this); break; case 5: - _globals->setFlag(35); - _globals->_player.enableControl(); + g_globals->setFlag(35); + g_globals->_player.enableControl(); remove(); break; } @@ -488,11 +488,11 @@ void Scene4000::Action12::signal() { void Scene4000::Action13::signal() { // Lander is landing - Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; + Scene4000 *scene = (Scene4000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(3); break; case 1: @@ -502,7 +502,7 @@ void Scene4000::Action13::signal() { break; case 2: scene->_soundHandler2.release(); - _globals->_sceneManager.changeScene(4010); + g_globals->_sceneManager.changeScene(4010); break; } } @@ -510,7 +510,7 @@ void Scene4000::Action13::signal() { /*--------------------------------------------------------------------------*/ void Scene4000::Miranda::doAction(int action) { - Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; + Scene4000 *scene = (Scene4000 *)g_globals->_sceneManager._scene; switch (action) { case OBJECT_STUNNER: @@ -520,28 +520,28 @@ void Scene4000::Miranda::doAction(int action) { SceneItem::display2(4000, 29); break; case CURSOR_TALK: - if (_globals->getFlag(31)) { - if (!_globals->getFlag(111)) { - _globals->setFlag(111); - _globals->_stripNum = 4070; - } else if (!_globals->getFlag(33)) - _globals->_stripNum = 4094; - else if (!_globals->getFlag(112)) { - _globals->setFlag(112); - _globals->_stripNum = 4300; - } else if (!_globals->getFlag(113)) { - _globals->setFlag(113); - _globals->_stripNum = 4093; + if (g_globals->getFlag(31)) { + if (!g_globals->getFlag(111)) { + g_globals->setFlag(111); + g_globals->_stripNum = 4070; + } else if (!g_globals->getFlag(33)) + g_globals->_stripNum = 4094; + else if (!g_globals->getFlag(112)) { + g_globals->setFlag(112); + g_globals->_stripNum = 4300; + } else if (!g_globals->getFlag(113)) { + g_globals->setFlag(113); + g_globals->_stripNum = 4093; } else - _globals->_stripNum = 4094; + g_globals->_stripNum = 4094; } else { - if (!_globals->getFlag(33)) - _globals->_stripNum = 4094; - else if (!_globals->getFlag(112)) { - _globals->setFlag(112); - _globals->_stripNum = 4300; + if (!g_globals->getFlag(33)) + g_globals->_stripNum = 4094; + else if (!g_globals->getFlag(112)) { + g_globals->setFlag(112); + g_globals->_stripNum = 4300; } else - _globals->_stripNum = 4094; + g_globals->_stripNum = 4094; } scene->setAction(&scene->_action5); @@ -554,7 +554,7 @@ void Scene4000::Miranda::doAction(int action) { void Scene4000::Hotspot8::doAction(int action) { // Guard - Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; + Scene4000 *scene = (Scene4000 *)g_globals->_sceneManager._scene; switch (action) { case OBJECT_STUNNER: @@ -569,20 +569,20 @@ void Scene4000::Hotspot8::doAction(int action) { else { switch (_ctr) { case 0: - _globals->_stripNum = 4090; + g_globals->_stripNum = 4090; break; case 1: - _globals->_stripNum = 4091; + g_globals->_stripNum = 4091; break; case 2: - _globals->_stripNum = 4092; + g_globals->_stripNum = 4092; break; default: SceneItem::display2(4000, 34); break; } - if (_globals->_stripNum) { + if (g_globals->_stripNum) { setAction(NULL); addMover(NULL); ++_ctr; @@ -614,20 +614,20 @@ void Scene4000::GuardRock::doAction(int action) { } void Scene4000::Ladder::doAction(int action) { - Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; + Scene4000 *scene = (Scene4000 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(4000, 30); break; case CURSOR_USE: - _globals->_player.disableControl(); - if (_globals->getFlag(40)) { + g_globals->_player.disableControl(); + if (g_globals->getFlag(40)) { scene->_sceneMode = 4005; - scene->setAction(&scene->_sequenceManager1, scene, 4005, &_globals->_player, NULL); + scene->setAction(&scene->_sequenceManager1, scene, 4005, &g_globals->_player, NULL); } else { scene->_sceneMode = 4004; - scene->setAction(&scene->_sequenceManager1, scene, 4004, &_globals->_player, &scene->_ladder, NULL); + scene->setAction(&scene->_sequenceManager1, scene, 4004, &g_globals->_player, &scene->_ladder, NULL); } break; default: @@ -637,7 +637,7 @@ void Scene4000::Ladder::doAction(int action) { } void Scene4000::TheTech::doAction(int action) { - Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; + Scene4000 *scene = (Scene4000 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -650,15 +650,15 @@ void Scene4000::TheTech::doAction(int action) { SceneItem::display2(4000, 20); break; case CURSOR_USE: - if (_globals->getFlag(40)) + if (g_globals->getFlag(40)) SceneItem::display2(4000, 37); else { - _globals->_player.disableControl(); - if (_globals->_sceneObjects->contains(&scene->_miranda)) - _globals->clearFlag(96); + g_globals->_player.disableControl(); + if (g_globals->_sceneObjects->contains(&scene->_miranda)) + g_globals->clearFlag(96); scene->_sceneMode = 4012; - scene->setAction(&scene->_sequenceManager1, scene, 4012, &_globals->_player, NULL); + scene->setAction(&scene->_sequenceManager1, scene, 4012, &g_globals->_player, NULL); } break; default: @@ -669,14 +669,14 @@ void Scene4000::TheTech::doAction(int action) { void Scene4000::Hotspot13::doAction(int action) { // Rock between the two chimneys - Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; + Scene4000 *scene = (Scene4000 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(4000, 21); break; case OBJECT_ROPE: - if (_globals->getFlag(40)) + if (g_globals->getFlag(40)) scene->setAction(&scene->_action4); else SceneItem::display2(4000, 22); @@ -689,7 +689,7 @@ void Scene4000::Hotspot13::doAction(int action) { void Scene4000::Hotspot::doAction(int action) { // Wall between the two doors - Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; + Scene4000 *scene = (Scene4000 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -702,16 +702,16 @@ void Scene4000::Hotspot::doAction(int action) { SceneItem::display2(4000, 18); break; case OBJECT_LADDER: { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_ladder.postInit(); scene->_ladder.setVisage(4000); scene->_ladder.setStrip(5); scene->_ladder.setPosition(Common::Point(245, 147)); scene->_ladder.hide(); - _globals->_sceneItems.push_front(&scene->_ladder); + g_globals->_sceneItems.push_front(&scene->_ladder); - if (_globals->_sceneObjects->contains(&scene->_hotspot8)) { + if (g_globals->_sceneObjects->contains(&scene->_hotspot8)) { scene->_hotspot8.setAction(NULL); Common::Point pt(118, 145); NpcMover *mover = new NpcMover(); @@ -719,7 +719,7 @@ void Scene4000::Hotspot::doAction(int action) { } scene->_sceneMode = 4004; - scene->setAction(&scene->_sequenceManager1, scene, 4011, &_globals->_player, &scene->_ladder, NULL); + scene->setAction(&scene->_sequenceManager1, scene, 4011, &g_globals->_player, &scene->_ladder, NULL); break; } default: @@ -730,14 +730,14 @@ void Scene4000::Hotspot::doAction(int action) { void Scene4000::Hotspot17::doAction(int action) { // Left Chimney - Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; + Scene4000 *scene = (Scene4000 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(4000, 23); break; case CURSOR_USE: - if (_globals->getFlag(40)) + if (g_globals->getFlag(40)) scene->setAction(&scene->_action7); else SceneItem::display2(4000, 24); @@ -750,14 +750,14 @@ void Scene4000::Hotspot17::doAction(int action) { void Scene4000::Hotspot18::doAction(int action) { // Right Chimney - Scene4000 *scene = (Scene4000 *)_globals->_sceneManager._scene; + Scene4000 *scene = (Scene4000 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(4000, 36); break; case CURSOR_USE: - if (_globals->getFlag(40)) + if (g_globals->getFlag(40)) scene->setAction(&scene->_action8); else SceneItem::display2(4000, 24); @@ -772,7 +772,7 @@ void Scene4000::Hotspot23::doAction(int action) { // Door of the temple switch (action) { case CURSOR_LOOK: - SceneItem::display2(4000, _globals->getFlag(31) ? 10 : 9); + SceneItem::display2(4000, g_globals->getFlag(31) ? 10 : 9); break; default: SceneHotspot::doAction(action); @@ -817,7 +817,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _speakerSText._npc = &_hotspot5; _speakerMText._npc = &_miranda; _speakerPText._npc = &_olo; - _speakerQText._npc = &_globals->_player; + _speakerQText._npc = &g_globals->_player; _hotspot13.setBounds(Rect(263, 41, 278, 55)); _hotspot14.setBounds(Rect(96 /*140*/, 177, 140 /*96*/, 204)); @@ -868,7 +868,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _theTech.fixPriority(200); _theTech.setPosition(Common::Point(281, 176)); - if (_globals->getFlag(34)) { + if (g_globals->getFlag(34)) { _soundHandler1.play(156); _forceField.postInit(); @@ -878,16 +878,16 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _forceField.fixPriority(200); _forceField.animate(ANIM_MODE_8, 0, NULL); - _globals->_sceneItems.push_back(&_forceField); + g_globals->_sceneItems.push_back(&_forceField); } - _globals->_player.postInit(); - _globals->_player.setVisage(2602); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.setPosition(Common::Point(-28, 86)); + g_globals->_player.postInit(); + g_globals->_player.setVisage(2602); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.setPosition(Common::Point(-28, 86)); - if (!_globals->getFlag(36) && !_globals->getFlag(43)) { + if (!g_globals->getFlag(36) && !g_globals->getFlag(43)) { _miranda.postInit(); _miranda.setVisage(2701); _miranda.animate(ANIM_MODE_1, NULL); @@ -895,14 +895,14 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _miranda._moveDiff = Common::Point(4, 2); _miranda.setPosition(Common::Point(-210, 139)); - _globals->_sceneItems.push_back(&_miranda); + g_globals->_sceneItems.push_back(&_miranda); } - _globals->clearFlag(40); + g_globals->clearFlag(40); - switch (_globals->_sceneManager._previousScene) { + switch (g_globals->_sceneManager._previousScene) { case 2320: - _globals->_soundHandler.play(155); + g_globals->_soundHandler.play(155); if (RING_INVENTORY._ale._sceneNumber == 1) { _guardRock.postInit(); @@ -913,17 +913,17 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { setAction(&_action6); } else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneMode = 4001; - setAction(&_sequenceManager1, this, 4001, &_globals->_player, NULL); + setAction(&_sequenceManager1, this, 4001, &g_globals->_player, NULL); - if (!_globals->getFlag(36) && !_globals->getFlag(43)) + if (!g_globals->getFlag(36) && !g_globals->getFlag(43)) _miranda.setAction(&_sequenceManager2, NULL, 4002, &_miranda, NULL); } - if (_globals->getFlag(42)) + if (g_globals->getFlag(42)) _hotspot8.setAction(&_action3); - else if (_globals->getFlag(91)) + else if (g_globals->getFlag(91)) _hotspot8.remove(); break; @@ -950,12 +950,12 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { if (RING_INVENTORY._ladder._sceneNumber == 4000) _hotspot8.remove(); - _globals->_player.setPosition(Common::Point(260, 185)); + g_globals->_player.setPosition(Common::Point(260, 185)); - if (!_globals->getFlag(36) && !_globals->getFlag(43)) + if (!g_globals->getFlag(36) && !g_globals->getFlag(43)) _miranda.setPosition(Common::Point(246, 146)); - if (_globals->getFlag(96)) { + if (g_globals->getFlag(96)) { _olo.postInit(); _olo.setVisage(4006); _olo.animate(ANIM_MODE_1, NULL); @@ -963,7 +963,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _olo.setPosition(Common::Point(290, 163)); } - if (_globals->_stripNum == 4025) { + if (g_globals->_stripNum == 4025) { _soundHandler1.play(182); _forceField.remove(); @@ -974,9 +974,9 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _hotspot5._moveDiff.x = 4; _hotspot5.setPosition(Common::Point(-18, 86)); - _globals->_player.disableControl(); + g_globals->_player.disableControl(); - if (!_globals->getFlag(96)) { + if (!g_globals->getFlag(96)) { _olo.postInit(); _olo.setVisage(4006); _olo.animate(ANIM_MODE_1, NULL); @@ -990,17 +990,17 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _sceneMode = 4003; setAction(&_sequenceManager1, this, 4003, &_hotspot5, NULL); - } else if (_globals->getFlag(96)) { - _globals->_player.disableControl(); + } else if (g_globals->getFlag(96)) { + g_globals->_player.disableControl(); _sceneMode = 4013; setAction(&_sequenceManager1, this, 4013, &_olo, NULL); } - _globals->clearFlag(96); + g_globals->clearFlag(96); break; case 4045: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); if (RING_INVENTORY._ladder._sceneNumber != 4000) { _hotspot8.setVisage(4017); @@ -1009,13 +1009,13 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _hotspot8.setAction(&_action3); } - _globals->_player.setPosition(Common::Point(208, 153)); - if (!_globals->getFlag(36) && !_globals->getFlag(43)) + g_globals->_player.setPosition(Common::Point(208, 153)); + if (!g_globals->getFlag(36) && !g_globals->getFlag(43)) _miranda.setPosition(Common::Point(246, 146)); - if (_globals->getFlag(39)) { + if (g_globals->getFlag(39)) { // Ollo follows Quinn and gives explanations on the Tech. - _globals->clearFlag(39); + g_globals->clearFlag(39); _olo.postInit(); _olo.setVisage(4006); @@ -1024,14 +1024,14 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _olo.setPosition(Common::Point(219, 150)); _sceneMode = 4010; - _globals->_player.disableControl(); + g_globals->_player.disableControl(); // This is the buggy animation where Miranda comments the Tech even // if she's not in the room but in the lander. - setAction(&_sequenceManager1, this, 4010, &_globals->_player, &_olo, NULL); + setAction(&_sequenceManager1, this, 4010, &g_globals->_player, &_olo, NULL); } - if (_globals->_stripNum == 4000) { - _globals->_stripNum = 0; + if (g_globals->_stripNum == 4000) { + g_globals->_stripNum = 0; _guardRock.postInit(); _guardRock.setVisage(4001); @@ -1045,21 +1045,21 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { break; case 4050: - _globals->_soundHandler.play(155); - _globals->_player.disableControl(); + g_globals->_soundHandler.play(155); + g_globals->_player.disableControl(); - if (_globals->_stripNum == 4050) { - _globals->_player.setVisage(4008); - _globals->_player.setStrip(4); - _globals->_player.setFrame(_globals->_player.getFrameCount()); - _globals->_player.fixPriority(16); - _globals->_player.setPosition(Common::Point(260, 55)); + if (g_globals->_stripNum == 4050) { + g_globals->_player.setVisage(4008); + g_globals->_player.setStrip(4); + g_globals->_player.setFrame(g_globals->_player.getFrameCount()); + g_globals->_player.fixPriority(16); + g_globals->_player.setPosition(Common::Point(260, 55)); _sceneMode = 4007; - setAction(&_sequenceManager1, this, 4007, &_globals->_player, NULL); + setAction(&_sequenceManager1, this, 4007, &g_globals->_player, NULL); } else { - _globals->_player.setPosition(Common::Point(208, 153)); - _globals->_player.enableControl(); + g_globals->_player.setPosition(Common::Point(208, 153)); + g_globals->_player.enableControl(); } if (RING_INVENTORY._ladder._sceneNumber != 4000) @@ -1067,22 +1067,22 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { break; case 4100: - _globals->_player.enableControl(); - _globals->_player.setPosition(Common::Point(270, 155)); + g_globals->_player.enableControl(); + g_globals->_player.setPosition(Common::Point(270, 155)); - if (_globals->getFlag(42) && (RING_INVENTORY._ladder._sceneNumber != 4000)) { + if (g_globals->getFlag(42) && (RING_INVENTORY._ladder._sceneNumber != 4000)) { _hotspot8.setVisage(4017); _hotspot8.animate(ANIM_MODE_1, NULL); _hotspot8.setPosition(Common::Point(244, 151)); _hotspot8.setAction(&_action3); } - if (!_globals->getFlag(36) && !_globals->getFlag(43)) + if (!g_globals->getFlag(36) && !g_globals->getFlag(43)) _miranda.setPosition(Common::Point(246, 146)); break; default: - _globals->_soundHandler.play(155); + g_globals->_soundHandler.play(155); _lander.postInit(); _lander.setVisage(4002); @@ -1092,7 +1092,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _lander.setPosition(Common::Point(130, -1)); _lander.animate(ANIM_MODE_2, NULL); - if (_globals->_stripNum == 9000) { + if (g_globals->_stripNum == 9000) { _olo.postInit(); _olo.setVisage(4006); _olo.setPosition(Common::Point(235, 153)); @@ -1115,7 +1115,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _forceField.fixPriority(200); _forceField.animate(ANIM_MODE_8, 0, NULL); } else { - if (!_globals->getFlag(37)) { + if (!g_globals->getFlag(37)) { _hotspot2.postInit(); _hotspot2.setVisage(4018); _hotspot2._strip = 1; @@ -1136,7 +1136,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _ladder.setStrip(5); _ladder.setPosition(Common::Point(245, 147)); - _globals->_sceneItems.push_back(&_ladder); + g_globals->_sceneItems.push_back(&_ladder); } if (RING_INVENTORY._rope._sceneNumber == 4000) { @@ -1147,7 +1147,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _rope.setPosition(Common::Point(268, 44)); } - _globals->_sceneItems.addItems(&_hotspot8, &_hotspot17, &_hotspot18, &_hotspot14, &_hotspot15, + g_globals->_sceneItems.addItems(&_hotspot8, &_hotspot17, &_hotspot18, &_hotspot14, &_hotspot15, &_hotspot16, &_theTech, &_hotspot13, &_hotspot21, &_hotspot20, &_hotspot22, &_hotspot23, &_hotspot24, &_hotspot25, &_hotspot19, &_hotspot26, NULL); } @@ -1155,51 +1155,51 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { void Scene4000::signal() { switch (_sceneMode) { case 4010: - _globals->setFlag(38); + g_globals->setFlag(38); _olo.remove(); // Deliberate fall-through case 4001: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; case 4002: case 4011: break; case 4003: _sceneMode = 4014; - setAction(&_sequenceManager1, this, 4014, &_globals->_player, &_hotspot5, NULL); + setAction(&_sequenceManager1, this, 4014, &g_globals->_player, &_hotspot5, NULL); break; case 4004: RING_INVENTORY._ladder._sceneNumber = 4000; // Deliberate fall-through case 4007: - _globals->_player._uiEnabled = true; - _globals->_events.setCursor(CURSOR_USE); - _globals->setFlag(40); + g_globals->_player._uiEnabled = true; + g_globals->_events.setCursor(CURSOR_USE); + g_globals->setFlag(40); break; case 4005: - _globals->_player.enableControl(); - _globals->_events.setCursor(CURSOR_WALK); - _globals->clearFlag(40); + g_globals->_player.enableControl(); + g_globals->_events.setCursor(CURSOR_WALK); + g_globals->clearFlag(40); break; case 4006: - _globals->_sceneManager.changeScene(4045); + g_globals->_sceneManager.changeScene(4045); break; case 4008: - _globals->_sceneManager.changeScene(2320); + g_globals->_sceneManager.changeScene(2320); break; case 4009: - _globals->_sceneManager.changeScene(2200); + g_globals->_sceneManager.changeScene(2200); break; case 4012: - _globals->_player.checkAngle(&_theTech); - _globals->_sceneManager.changeScene(4025); + g_globals->_player.checkAngle(&_theTech); + g_globals->_sceneManager.changeScene(4025); break; case 4013: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); _olo.remove(); break; case 4014: - _globals->_sceneManager.changeScene(4250); + g_globals->_sceneManager.changeScene(4250); break; case 4015: ADD_MOVER_NULL(_miranda, 0, _miranda._position.y - 5); @@ -1210,14 +1210,14 @@ void Scene4000::signal() { void Scene4000::dispatch() { Scene::dispatch(); - if ((_globals->_player.getRegionIndex() == 10) || (_globals->_player.getRegionIndex() == 6)) - _globals->_player.fixPriority(200); - if (_globals->_player.getRegionIndex() == 11) - _globals->_player.fixPriority(-1); - if (_globals->_player.getRegionIndex() == 5) - _globals->_player.fixPriority(94); + if ((g_globals->_player.getRegionIndex() == 10) || (g_globals->_player.getRegionIndex() == 6)) + g_globals->_player.fixPriority(200); + if (g_globals->_player.getRegionIndex() == 11) + g_globals->_player.fixPriority(-1); + if (g_globals->_player.getRegionIndex() == 5) + g_globals->_player.fixPriority(94); - if (_globals->_sceneObjects->contains(&_hotspot5)) { + if (g_globals->_sceneObjects->contains(&_hotspot5)) { if ((_hotspot5.getRegionIndex() == 10) || (_hotspot5.getRegionIndex() == 6)) _hotspot5.fixPriority(200); if (_hotspot5.getRegionIndex() == 11) @@ -1226,10 +1226,10 @@ void Scene4000::dispatch() { _hotspot5.fixPriority(94); } - if (_globals->_sceneObjects->contains(&_miranda)) { + if (g_globals->_sceneObjects->contains(&_miranda)) { if (!_miranda._mover) - _miranda.checkAngle(&_globals->_player); - if (!_action && _globals->_player.getRegionIndex() == 23) { + _miranda.checkAngle(&g_globals->_player); + if (!_action && g_globals->_player.getRegionIndex() == 23) { ADD_MOVER_NULL(_miranda, 204, 186); } @@ -1242,30 +1242,30 @@ void Scene4000::dispatch() { } if (!_action) { - if ((RING_INVENTORY._peg._sceneNumber == 1) && _globals->getFlag(34) && - _globals->getFlag(37) && !_globals->getFlag(40)) { - _globals->_player.disableControl(); + if ((RING_INVENTORY._peg._sceneNumber == 1) && g_globals->getFlag(34) && + g_globals->getFlag(37) && !g_globals->getFlag(40)) { + g_globals->_player.disableControl(); _soundHandler1.play(177); - _globals->_soundHandler.play(178); + g_globals->_soundHandler.play(178); setAction(&_action1); } - if (_globals->_player.getRegionIndex() == 2) - _globals->_sceneManager.changeScene(4045); - if (_globals->_player.getRegionIndex() == 15) - _globals->_sceneManager.changeScene(4100); + if (g_globals->_player.getRegionIndex() == 2) + g_globals->_sceneManager.changeScene(4045); + if (g_globals->_player.getRegionIndex() == 15) + g_globals->_sceneManager.changeScene(4100); - if ((_globals->_player._position.x <= 5) && (_globals->_player._position.y < 100)) { - _globals->_player.disableControl(); + if ((g_globals->_player._position.x <= 5) && (g_globals->_player._position.y < 100)) { + g_globals->_player.disableControl(); - if (!_globals->_sceneObjects->contains(&_miranda) || (_miranda._position.y <= 100)) { + if (!g_globals->_sceneObjects->contains(&_miranda) || (_miranda._position.y <= 100)) { _sceneMode = 4008; - setAction(&_sequenceManager1, this, 4008, &_globals->_player, NULL); + setAction(&_sequenceManager1, this, 4008, &g_globals->_player, NULL); } else { _sceneMode = 4015; - _globals->_player.addMover(NULL); - setAction(&_sequenceManager1, this, 4015, &_globals->_player, &_miranda, NULL); + g_globals->_player.addMover(NULL); + setAction(&_sequenceManager1, this, 4015, &g_globals->_player, &_miranda, NULL); } } } @@ -1286,14 +1286,14 @@ void Scene4010::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_speakerMText); _speakerSText._npc = &_hotspot1; _speakerMText._npc = &_hotspot2; - _speakerQText._npc = &_globals->_player; + _speakerQText._npc = &g_globals->_player; - _globals->_player.postInit(); - _globals->_player.setVisage(0); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.setPosition(Common::Point(-38, 175)); - _globals->_player.changeZoom(75); + g_globals->_player.postInit(); + g_globals->_player.setVisage(0); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.setPosition(Common::Point(-38, 175)); + g_globals->_player.changeZoom(75); _hotspot2.postInit(); _hotspot2.setVisage(2705); @@ -1310,12 +1310,12 @@ void Scene4010::postInit(SceneObjectList *OwnerList) { _hotspot1.animate(ANIM_MODE_1, NULL); _hotspot1.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.disableControl(); - setAction(&_sequenceManager, this, 4017, &_globals->_player, &_hotspot1, &_hotspot2, NULL); + g_globals->_player.disableControl(); + setAction(&_sequenceManager, this, 4017, &g_globals->_player, &_hotspot1, &_hotspot2, NULL); } void Scene4010::signal() { - _globals->_sceneManager.changeScene(4000); + g_globals->_sceneManager.changeScene(4000); } /*-------------------------------------------------------------------------- @@ -1324,7 +1324,7 @@ void Scene4010::signal() { *--------------------------------------------------------------------------*/ void Scene4025::Action1::signal() { - Scene4025 *scene = (Scene4025 *)_globals->_sceneManager._scene; + Scene4025 *scene = (Scene4025 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -1364,15 +1364,15 @@ void Scene4025::Action1::signal() { break; case 2: - _globals->_player._uiEnabled = true; - _globals->_events.setCursor(CURSOR_USE); + g_globals->_player._uiEnabled = true; + g_globals->_events.setCursor(CURSOR_USE); remove(); break; } } void Scene4025::Action2::signal() { - Scene4025 *scene = (Scene4025 *)_globals->_sceneManager._scene; + Scene4025 *scene = (Scene4025 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -1408,8 +1408,8 @@ void Scene4025::Action2::signal() { scene->_armHotspot.animate(ANIM_MODE_5, this); break; case 2: - _globals->_player._uiEnabled = true; - _globals->_events.setCursor(CURSOR_USE); + g_globals->_player._uiEnabled = true; + g_globals->_events.setCursor(CURSOR_USE); remove(); break; } @@ -1418,14 +1418,14 @@ void Scene4025::Action2::signal() { void Scene4025::Action3::signal() { switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); - _globals->_scenePalette.addRotation(64, 111, -1); + g_globals->_player.disableControl(); + g_globals->_scenePalette.addRotation(64, 111, -1); setDelay(120); break; case 1: - _globals->clearFlag(34); - _globals->_stripNum = 4025; - _globals->_sceneManager.changeScene(4000); + g_globals->clearFlag(34); + g_globals->_stripNum = 4025; + g_globals->_sceneManager.changeScene(4000); break; } } @@ -1441,7 +1441,7 @@ void Scene4025::Hole::synchronize(Serializer &s) { } void Scene4025::Hole::doAction(int action) { - Scene4025 *scene = (Scene4025 *)_globals->_sceneManager._scene; + Scene4025 *scene = (Scene4025 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -1451,15 +1451,15 @@ void Scene4025::Hole::doAction(int action) { if (!scene->_pegPtr && !_pegPtr) { setAction(&scene->_sequenceManager, scene, 4028, NULL); } else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_holePtr = this; scene->setAction(&scene->_action2); } break; case OBJECT_PEG: if (!scene->_pegPtr2) { - _globals->_player.disableControl(); - _globals->_events.setCursor(CURSOR_USE); + g_globals->_player.disableControl(); + g_globals->_events.setCursor(CURSOR_USE); RING_INVENTORY._peg._sceneNumber = 4025; scene->_pegPtr = &scene->_peg5; @@ -1483,14 +1483,14 @@ void Scene4025::Peg::synchronize(Serializer &s) { } void Scene4025::Peg::doAction(int action) { - Scene4025 *scene = (Scene4025 *)_globals->_sceneManager._scene; + Scene4025 *scene = (Scene4025 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(4025, 1); break; case CURSOR_USE: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_pegPtr = this; scene->setAction(&scene->_action1); break; @@ -1509,7 +1509,7 @@ void Scene4025::postInit(SceneObjectList *OwnerList) { Scene::postInit(); setZoomPercents(0, 100, 200, 100); - _globals->_events.setCursor(CURSOR_USE); + g_globals->_events.setCursor(CURSOR_USE); _pegPtr = _pegPtr2 = NULL; _peg1.postInit(); @@ -1609,11 +1609,11 @@ void Scene4025::postInit(SceneObjectList *OwnerList) { _armHotspot.setStrip(3); _armHotspot.setFrame(4); - _globals->_sceneItems.addItems(&_hole1, &_hole2, &_hole3, &_hole4, &_hole5, + g_globals->_sceneItems.addItems(&_hole1, &_hole2, &_hole3, &_hole4, &_hole5, &_peg1, &_peg2, &_peg3, &_peg4, &_peg5, NULL); - _globals->_player._uiEnabled = true; - _globals->_player.disableControl(); + g_globals->_player._uiEnabled = true; + g_globals->_player.disableControl(); setAction(&_sequenceManager, this, 4026, NULL); } @@ -1625,7 +1625,7 @@ void Scene4025::synchronize(Serializer &s) { } void Scene4025::remove() { - _globals->_scenePalette.clearListeners(); + g_globals->_scenePalette.clearListeners(); Scene::remove(); } @@ -1638,10 +1638,10 @@ void Scene4025::signal() { _gfxButton._bounds.expandPanes(); } - _globals->_player._uiEnabled = true; + g_globals->_player._uiEnabled = true; } - _globals->_events.setCursor(CURSOR_USE); + g_globals->_events.setCursor(CURSOR_USE); } void Scene4025::process(Event &event) { @@ -1651,7 +1651,7 @@ void Scene4025::process(Event &event) { if (RING_INVENTORY._peg._sceneNumber == 4025) RING_INVENTORY._peg._sceneNumber = 1; - _globals->_sceneManager.changeScene(4000); + g_globals->_sceneManager.changeScene(4000); } } @@ -1669,15 +1669,15 @@ void Scene4025::dispatch() { *--------------------------------------------------------------------------*/ void Scene4045::Action1::signal() { - Scene4045 *scene = (Scene4045 *)_globals->_sceneManager._scene; + Scene4045 *scene = (Scene4045 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(60); break; case 1: - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_events.setCursor(CURSOR_WALK); scene->_stripManager.start(4040, this, scene); break; case 2: @@ -1691,52 +1691,52 @@ void Scene4045::Action1::signal() { scene->_hotspot4.animate(ANIM_MODE_6, this); break; case 5: - ADD_MOVER(_globals->_player, 150, 300); + ADD_MOVER(g_globals->_player, 150, 300); break; case 6: - _globals->_stripNum = 4000; - _globals->_sceneManager.changeScene(4000); + g_globals->_stripNum = 4000; + g_globals->_sceneManager.changeScene(4000); remove(); break; } } void Scene4045::Action2::signal() { - Scene4045 *scene = (Scene4045 *)_globals->_sceneManager._scene; + Scene4045 *scene = (Scene4045 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(15); break; case 1: - scene->_stripManager.start(_globals->_stripNum, this, scene); + scene->_stripManager.start(g_globals->_stripNum, this, scene); break; case 2: scene->_olloFace.animate(ANIM_MODE_NONE, NULL); setDelay(10); break; case 3: - if (_globals->getFlag(38)) { - _globals->_player.enableControl(); + if (g_globals->getFlag(38)) { + g_globals->_player.enableControl(); remove(); } else { - ADD_MOVER(_globals->_player, 150, 300); + ADD_MOVER(g_globals->_player, 150, 300); } break; case 4: - _globals->setFlag(39); - _globals->_sceneManager.changeScene(4000); + g_globals->setFlag(39); + g_globals->_sceneManager.changeScene(4000); break; } } void Scene4045::Action3::signal() { - Scene4045 *scene = (Scene4045 *)_globals->_sceneManager._scene; + Scene4045 *scene = (Scene4045 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_hotspot4.animate(ANIM_MODE_5, this); break; case 1: @@ -1745,10 +1745,10 @@ void Scene4045::Action3::signal() { case 2: scene->_hotspot4.animate(ANIM_MODE_6, NULL); scene->_olloFace.animate(ANIM_MODE_NONE, NULL); - ADD_MOVER(_globals->_player, 91, 1264); + ADD_MOVER(g_globals->_player, 91, 1264); break; case 3: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; } @@ -1757,7 +1757,7 @@ void Scene4045::Action3::signal() { /*--------------------------------------------------------------------------*/ void Scene4045::OlloStand::doAction(int action) { - Scene4045 *scene = (Scene4045 *)_globals->_sceneManager._scene; + Scene4045 *scene = (Scene4045 *)g_globals->_sceneManager._scene; switch (action) { case OBJECT_STUNNER: @@ -1774,20 +1774,20 @@ void Scene4045::OlloStand::doAction(int action) { setStrip(6); animate(ANIM_MODE_NONE, NULL); } - if (_globals->_player._position.y < 135) { + if (g_globals->_player._position.y < 135) { scene->_sceneMode = 4046; _numFrames = 10; - _globals->_player.disableControl(); + g_globals->_player.disableControl(); - scene->setAction(&scene->_sequenceManager, this, 4046, &_globals->_player, this, NULL); + scene->setAction(&scene->_sequenceManager, this, 4046, &g_globals->_player, this, NULL); } else { - if (!_globals->getFlag(31)) { - _globals->setFlag(31); - _globals->_stripNum = 4080; - } else if (!_globals->getFlag(38)) - _globals->_stripNum = 4060; + if (!g_globals->getFlag(31)) { + g_globals->setFlag(31); + g_globals->_stripNum = 4080; + } else if (!g_globals->getFlag(38)) + g_globals->_stripNum = 4060; else - _globals->_stripNum = 4503; + g_globals->_stripNum = 4503; scene->setAction(&scene->_action2); } @@ -1799,7 +1799,7 @@ void Scene4045::OlloStand::doAction(int action) { } void Scene4045::Miranda::doAction(int action) { - Scene4045 *scene = (Scene4045 *)_globals->_sceneManager._scene; + Scene4045 *scene = (Scene4045 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -1807,7 +1807,7 @@ void Scene4045::Miranda::doAction(int action) { break; case CURSOR_TALK: scene->_sceneMode = 4102; - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->setAction(&scene->_sequenceManager, scene, 4104, NULL); break; default: @@ -1817,22 +1817,22 @@ void Scene4045::Miranda::doAction(int action) { } void Scene4045::Necklace::doAction(int action) { - Scene4045 *scene = (Scene4045 *)_globals->_sceneManager._scene; + Scene4045 *scene = (Scene4045 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(4045, 17); break; case CURSOR_USE: - if (_globals->_player._position.y < 135) { + if (g_globals->_player._position.y < 135) { SceneItem::display2(4045, 16); RING_INVENTORY._peg._sceneNumber = 1; - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_events.setCursor(CURSOR_WALK); remove(); } else { scene->_sceneMode = 4047; - _globals->_player.disableControl(); - scene->setAction(&scene->_sequenceManager, scene, 4047, &_globals->_player, &scene->_olloStand, NULL); + g_globals->_player.disableControl(); + scene->setAction(&scene->_sequenceManager, scene, 4047, &g_globals->_player, &scene->_olloStand, NULL); } break; default: @@ -1877,13 +1877,13 @@ void Scene4045::postInit(SceneObjectList *OwnerList) { _flame.setPosition(Common::Point(47, 111)); _flame.animate(ANIM_MODE_2, NULL); _flame.fixPriority(156); - _globals->_sceneItems.push_back(&_flame); + g_globals->_sceneItems.push_back(&_flame); - _globals->_player.postInit(); - _globals->_player.setVisage(4200); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player._moveDiff = Common::Point(7, 4); + g_globals->_player.postInit(); + g_globals->_player.setVisage(4200); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player._moveDiff = Common::Point(7, 4); _olloStand.postInit(); _olloStand.setVisage(4051); @@ -1893,10 +1893,10 @@ void Scene4045::postInit(SceneObjectList *OwnerList) { _olloFace.setStrip(4); _olloFace.fixPriority(152); - if(_globals->_sceneManager._previousScene == 4050) { - _globals->_soundHandler.play(155); - _globals->_player.setPosition(Common::Point(72, 128)); - _globals->_player.enableControl(); + if(g_globals->_sceneManager._previousScene == 4050) { + g_globals->_soundHandler.play(155); + g_globals->_player.setPosition(Common::Point(72, 128)); + g_globals->_player.enableControl(); _olloStand.setStrip(5); _olloStand.setPosition(Common::Point(173, 99)); @@ -1910,13 +1910,13 @@ void Scene4045::postInit(SceneObjectList *OwnerList) { _necklace.setVisage(4045); _necklace.setStrip(2); _necklace.setPosition(Common::Point(108, 82)); - _globals->_sceneItems.push_back(&_necklace); + g_globals->_sceneItems.push_back(&_necklace); } } else { - _globals->_player.setPosition(Common::Point(108, 192)); - _globals->_player.setStrip(4); + g_globals->_player.setPosition(Common::Point(108, 192)); + g_globals->_player.setStrip(4); - if (!_globals->getFlag(36) && !_globals->getFlag(43)) { + if (!g_globals->getFlag(36) && !g_globals->getFlag(43)) { _miranda.postInit(); _miranda.setVisage(4102); _miranda.animate(ANIM_MODE_NONE, NULL); @@ -1925,10 +1925,10 @@ void Scene4045::postInit(SceneObjectList *OwnerList) { _miranda.changeZoom(-1); _miranda.setPosition(Common::Point(66, 209)); - _globals->_sceneItems.push_back(&_miranda); + g_globals->_sceneItems.push_back(&_miranda); } - if (_globals->getFlag(31)) { + if (g_globals->getFlag(31)) { // Olo asleep _olloStand.setVisage(4051); _olloStand.setStrip(5); @@ -1943,7 +1943,7 @@ void Scene4045::postInit(SceneObjectList *OwnerList) { _necklace.setVisage(4045); _necklace.setStrip(2); _necklace.setPosition(Common::Point(108, 82)); - _globals->_sceneItems.push_back(&_necklace); + g_globals->_sceneItems.push_back(&_necklace); } } else { _olloStand.setPosition(Common::Point(186, 149)); @@ -1955,14 +1955,14 @@ void Scene4045::postInit(SceneObjectList *OwnerList) { _hotspot4.setPosition(Common::Point(202, 80)); _olloFace.setPosition(Common::Point(192, 77)); - _globals->setFlag(31); + g_globals->setFlag(31); setAction(&_action1); - _globals->_player.disableControl(); + g_globals->_player.disableControl(); } } - _globals->_sceneItems.addItems(&_olloStand, &_hotspot7, &_hotspot8, &_hotspot9, &_hotspot10, + g_globals->_sceneItems.addItems(&_olloStand, &_hotspot7, &_hotspot8, &_hotspot9, &_hotspot10, &_hotspot13, &_hotspot11, &_hotspot12, &_hotspot14, NULL); } @@ -1984,34 +1984,34 @@ void Scene4045::signal() { _olloFace.animate(ANIM_MODE_NONE, NULL); break; case 4050: - _globals->_sceneManager.changeScene(4000); + g_globals->_sceneManager.changeScene(4000); break; case 4102: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; } } void Scene4045::dispatch() { if (!_action) { - if (_globals->_player.getRegionIndex() == 8) { - _globals->_player.addMover(NULL); + if (g_globals->_player.getRegionIndex() == 8) { + g_globals->_player.addMover(NULL); if (_olloStand._strip != 1) { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneMode = 4046; _olloStand._numFrames = 10; - setAction(&_sequenceManager, this, 4046, &_globals->_player, &_olloStand, NULL); + setAction(&_sequenceManager, this, 4046, &g_globals->_player, &_olloStand, NULL); } else { setAction(&_action3); } } - if (_globals->_player.getRegionIndex() == 10) - _globals->_sceneManager.changeScene(4050); - if (_globals->_player._position.y >= 196) { + if (g_globals->_player.getRegionIndex() == 10) + g_globals->_sceneManager.changeScene(4050); + if (g_globals->_player._position.y >= 196) { _sceneMode = 4050; - _globals->_player.disableControl(); - setAction(&_sequenceManager, this, 4105, &_globals->_player, NULL); + g_globals->_player.disableControl(); + setAction(&_sequenceManager, this, 4105, &g_globals->_player, NULL); } } @@ -2025,21 +2025,21 @@ void Scene4045::dispatch() { void Scene4050::Action1::signal() { // "Map" on the wall - Scene4050 *scene = (Scene4050 *)_globals->_sceneManager._scene; + Scene4050 *scene = (Scene4050 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(3); break; case 1: { Common::Point pt(204, 152); PlayerMover *mover = new PlayerMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 2: - _globals->_player.checkAngle(&scene->_hotspot17); + g_globals->_player.checkAngle(&scene->_hotspot17); scene->_hotspot14.postInit(); scene->_hotspot14.setVisage(4050); @@ -2049,11 +2049,11 @@ void Scene4050::Action1::signal() { setDelay(10); break; case 3: - _globals->_events.waitForPress(); - _globals->setFlag(45); + g_globals->_events.waitForPress(); + g_globals->setFlag(45); scene->_hotspot14.remove(); - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; } @@ -2063,34 +2063,34 @@ void Scene4050::Action2::signal() { // Climb down the rope switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(120); break; case 1: - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.animate(ANIM_MODE_5, this); break; case 2: - _globals->_player.setVisage(4202); - _globals->_player.changeZoom(100); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.setPosition(Common::Point(192, 130)); + g_globals->_player.setVisage(4202); + g_globals->_player.changeZoom(100); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.setPosition(Common::Point(192, 130)); - ADD_MOVER(_globals->_player, 215, 130); + ADD_MOVER(g_globals->_player, 215, 130); break; case 3: - _globals->_player.setVisage(4052); - _globals->_player.setStrip(5); - _globals->_player.setFrame(1); - _globals->_player.setPosition(Common::Point(236, 130)); - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.setVisage(4052); + g_globals->_player.setStrip(5); + g_globals->_player.setFrame(1); + g_globals->_player.setPosition(Common::Point(236, 130)); + g_globals->_player.animate(ANIM_MODE_5, this); break; case 4: - _globals->_player.setVisage(4202); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setPosition(Common::Point(210, 185)); - _globals->_player.fixPriority(-1); - _globals->_player.enableControl(); + g_globals->_player.setVisage(4202); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setPosition(Common::Point(210, 185)); + g_globals->_player.fixPriority(-1); + g_globals->_player.enableControl(); remove(); break; } @@ -2103,51 +2103,51 @@ void Scene4050::Action3::signal() { ADD_PLAYER_MOVER(210, 185); break; case 1: - _globals->_player.fixPriority(200); - _globals->_player.setVisage(4052); - _globals->_player.setStrip(5); - _globals->_player.changeZoom(100); - _globals->_player.setFrame(_globals->_player.getFrameCount()); - _globals->_player.setPosition(Common::Point(236, 130)); - _globals->_player.animate(ANIM_MODE_6, this); + g_globals->_player.fixPriority(200); + g_globals->_player.setVisage(4052); + g_globals->_player.setStrip(5); + g_globals->_player.changeZoom(100); + g_globals->_player.setFrame(g_globals->_player.getFrameCount()); + g_globals->_player.setPosition(Common::Point(236, 130)); + g_globals->_player.animate(ANIM_MODE_6, this); break; case 2: - _globals->_player.setVisage(4202); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.setPosition(Common::Point(215, 130)); - ADD_MOVER(_globals->_player, 212, 130); + g_globals->_player.setVisage(4202); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.setPosition(Common::Point(215, 130)); + ADD_MOVER(g_globals->_player, 212, 130); break; case 3: - _globals->_stripNum = 4050; - _globals->_sceneManager.changeScene(4000); + g_globals->_stripNum = 4050; + g_globals->_sceneManager.changeScene(4000); break; } } void Scene4050::Action4::signal() { - Scene4050 *scene = (Scene4050 *)_globals->_sceneManager._scene; + Scene4050 *scene = (Scene4050 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); - ADD_MOVER(_globals->_player, 189, 135); - _globals->_player.fixPriority(200); + g_globals->_player.disableControl(); + ADD_MOVER(g_globals->_player, 189, 135); + g_globals->_player.fixPriority(200); break; case 1: - _globals->_player._moveDiff.y = 3; - _globals->_player.setStrip2(3); - _globals->_player._frame = 1; - _globals->_player.setPosition(Common::Point(189, 129)); - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player._moveDiff.y = 3; + g_globals->_player.setStrip2(3); + g_globals->_player._frame = 1; + g_globals->_player.setPosition(Common::Point(189, 129)); + g_globals->_player.animate(ANIM_MODE_5, this); break; case 2: - _globals->_player.setVisage(4202); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.setPosition(Common::Point(192, 130)); - _globals->_player.changeZoom(100); - ADD_MOVER(_globals->_player, 215, 130); + g_globals->_player.setVisage(4202); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.setPosition(Common::Point(192, 130)); + g_globals->_player.changeZoom(100); + ADD_MOVER(g_globals->_player, 215, 130); scene->_hotspot16.postInit(); scene->_hotspot16.setVisage(4052); @@ -2157,18 +2157,18 @@ void Scene4050::Action4::signal() { ADD_MOVER(scene->_hotspot16, 172, 188); break; case 3: - _globals->_player.setVisage(4052); - _globals->_player.setStrip(5); - _globals->_player.setFrame(1); - _globals->_player.setPosition(Common::Point(238, 130)); - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.setVisage(4052); + g_globals->_player.setStrip(5); + g_globals->_player.setFrame(1); + g_globals->_player.setPosition(Common::Point(238, 130)); + g_globals->_player.animate(ANIM_MODE_5, this); break; case 4: - _globals->_player.setVisage(4052); - _globals->_player.setStrip(2); - _globals->_player.setFrame(1); - _globals->_player.setPosition(Common::Point(216, 184)); - _globals->_player.fixPriority(-1); + g_globals->_player.setVisage(4052); + g_globals->_player.setStrip(2); + g_globals->_player.setFrame(1); + g_globals->_player.setPosition(Common::Point(216, 184)); + g_globals->_player.fixPriority(-1); break; case 5: scene->_hotspot16.setStrip2(4); @@ -2177,12 +2177,12 @@ void Scene4050::Action4::signal() { break; case 6: scene->_hotspot16.animate(ANIM_MODE_5, NULL); - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.animate(ANIM_MODE_5, this); break; case 7: - _globals->_player.setVisage(4202); - _globals->_player.setStrip(6); - _globals->_player.setFrame(1); + g_globals->_player.setVisage(4202); + g_globals->_player.setStrip(6); + g_globals->_player.setFrame(1); scene->_stripManager.start(4051, this); break; @@ -2190,7 +2190,7 @@ void Scene4050::Action4::signal() { setDelay(15); break; case 9: - _globals->_sceneManager.changeScene(4000); + g_globals->_sceneManager.changeScene(4000); break; } } @@ -2198,14 +2198,14 @@ void Scene4050::Action4::signal() { /*--------------------------------------------------------------------------*/ void Scene4050::Hotspot15::doAction(int action) { - Scene4050 *scene = (Scene4050 *)_globals->_sceneManager._scene; + Scene4050 *scene = (Scene4050 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(4050, 14); break; case CURSOR_USE: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setAction(&scene->_action3); break; default: @@ -2215,7 +2215,7 @@ void Scene4050::Hotspot15::doAction(int action) { } void Scene4050::Hotspot17::doAction(int action) { - Scene4050 *scene = (Scene4050 *)_globals->_sceneManager._scene; + Scene4050 *scene = (Scene4050 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -2257,50 +2257,50 @@ void Scene4050::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_speakerQText); _stripManager.addSpeaker(&_speakerGameText); - _globals->_player.postInit(); + g_globals->_player.postInit(); - switch (_globals->_sceneManager._previousScene) { + switch (g_globals->_sceneManager._previousScene) { case 4000: - if (_globals->getFlag(41)) { + if (g_globals->getFlag(41)) { // Using a rope _hotspot15.postInit(); _hotspot15.setVisage(4054); _hotspot15.setPosition(Common::Point(206, 103)); - _globals->_sceneItems.push_back(&_hotspot15); + g_globals->_sceneItems.push_back(&_hotspot15); - _globals->_player.setVisage(4008); - _globals->_player.setPosition(Common::Point(206, 62)); - _globals->_player.changeZoom(130); - _globals->_player.fixPriority(200); - _globals->_player.setStrip(2); + g_globals->_player.setVisage(4008); + g_globals->_player.setPosition(Common::Point(206, 62)); + g_globals->_player.changeZoom(130); + g_globals->_player.fixPriority(200); + g_globals->_player.setStrip(2); setAction(&_action2); - _globals->_soundHandler.play(175); + g_globals->_soundHandler.play(175); } else { // Without the rope - _globals->_player.setVisage(5315); - _globals->_player.setPosition(Common::Point(189, 83)); - _globals->_player.changeZoom(130); - _globals->_player.setStrip2(2); - _globals->_player._moveDiff.y = 10; - _globals->_player.animate(ANIM_MODE_2, NULL); + g_globals->_player.setVisage(5315); + g_globals->_player.setPosition(Common::Point(189, 83)); + g_globals->_player.changeZoom(130); + g_globals->_player.setStrip2(2); + g_globals->_player._moveDiff.y = 10; + g_globals->_player.animate(ANIM_MODE_2, NULL); setAction(&_action4); - _globals->_soundHandler.play(176); + g_globals->_soundHandler.play(176); } break; case 4045: _hotspot15.postInit(); _hotspot15.setVisage(4054); _hotspot15.setPosition(Common::Point(206, 103)); - _globals->_sceneItems.push_back(&_hotspot15); + g_globals->_sceneItems.push_back(&_hotspot15); - _globals->_player.setVisage(4202); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.setPosition(Common::Point(193, 193)); + g_globals->_player.setVisage(4202); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.setPosition(Common::Point(193, 193)); - _globals->_soundHandler.play(175); + g_globals->_soundHandler.play(175); break; default: break; @@ -2329,25 +2329,25 @@ void Scene4050::postInit(SceneObjectList *OwnerList) { _hotspot11.setBounds(Rect(263, 105, 279, 147)); _hotspot12.setBounds(Rect(258, 154, 307, 180)); - _globals->_sceneItems.addItems(&_hotspot17, &_hotspot12, &_hotspot11, &_hotspot10, &_hotspot13, + g_globals->_sceneItems.addItems(&_hotspot17, &_hotspot12, &_hotspot11, &_hotspot10, &_hotspot13, &_hotspot2, &_hotspot3, &_hotspot4, &_hotspot5, &_hotspot6, &_hotspot8, &_hotspot9, &_hotspot7, &_hotspot1, NULL); } void Scene4050::signal() { if (_sceneMode == 4050) - _globals->_sceneManager.changeScene(4045); + g_globals->_sceneManager.changeScene(4045); } void Scene4050::dispatch() { if (!_action) { - if ((_globals->_player._canWalk) && (_globals->_player._position.y > 196)) { + if ((g_globals->_player._canWalk) && (g_globals->_player._position.y > 196)) { _sceneMode = 4050; - _globals->_player.disableControl(); + g_globals->_player.disableControl(); Common::Point pt(160, 275); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); } } Scene::dispatch(); @@ -2359,28 +2359,28 @@ void Scene4050::dispatch() { *--------------------------------------------------------------------------*/ void Scene4100::Action1::signal() { - Scene4100 *scene = (Scene4100 *)_globals->_sceneManager._scene; + Scene4100 *scene = (Scene4100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(10); break; case 1: - scene->_stripManager.start(_globals->_stripNum, this); + scene->_stripManager.start(g_globals->_stripNum, this); break; case 2: setDelay(30); break; case 3: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; } } void Scene4100::Action2::signal() { - Scene4100 *scene = (Scene4100 *)_globals->_sceneManager._scene; + Scene4100 *scene = (Scene4100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -2411,12 +2411,12 @@ void Scene4100::Action2::signal() { void Scene4100::Action3::signal() { - Scene4100 *scene = (Scene4100 *)_globals->_sceneManager._scene; + Scene4100 *scene = (Scene4100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->clearFlag(43); - _globals->setFlag(36); + g_globals->clearFlag(43); + g_globals->setFlag(36); setDelay(15); break; case 1: @@ -2432,7 +2432,7 @@ void Scene4100::Action3::signal() { setDelay(15); break; case 5: - _globals->_sceneManager.changeScene(4150); + g_globals->_sceneManager.changeScene(4150); break; default: break; @@ -2441,7 +2441,7 @@ void Scene4100::Action3::signal() { void Scene4100::Action4::signal() { // Rock getting drunk - Scene4100 *scene = (Scene4100 *)_globals->_sceneManager._scene; + Scene4100 *scene = (Scene4100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -2456,26 +2456,26 @@ void Scene4100::Action4::signal() { scene->_hotspot1.animate(ANIM_MODE_5, this); break; case 3: - _globals->clearFlag(43); - _globals->setFlag(42); + g_globals->clearFlag(43); + g_globals->setFlag(42); scene->_stripManager.start(4119, this); break; case 4: setDelay(15); break; case 5: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; } } void Scene4100::Action5::signal() { - Scene4100 *scene = (Scene4100 *)_globals->_sceneManager._scene; + Scene4100 *scene = (Scene4100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); ADD_PLAYER_MOVER(58, 151); break; case 1: @@ -2488,10 +2488,10 @@ void Scene4100::Action5::signal() { scene->_ladder.setPosition(Common::Point(49, 144)); RING_INVENTORY._ladder._sceneNumber = 4100; - _globals->_sceneItems.push_front(&scene->_ladder); + g_globals->_sceneItems.push_front(&scene->_ladder); } - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; } @@ -2499,16 +2499,16 @@ void Scene4100::Action5::signal() { void Scene4100::Action6::signal() { - Scene4100 *scene = (Scene4100 *)_globals->_sceneManager._scene; + Scene4100 *scene = (Scene4100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_stripManager.start(4103, this); ADD_PLAYER_MOVER(245, 167); break; case 1: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; } @@ -2517,39 +2517,39 @@ void Scene4100::Action6::signal() { /*--------------------------------------------------------------------------*/ void Scene4100::Hotspot1::doAction(int action) { - Scene4100 *scene = (Scene4100 *)_globals->_sceneManager._scene; + Scene4100 *scene = (Scene4100 *)g_globals->_sceneManager._scene; switch (action) { case OBJECT_STUNNER: SceneItem::display2(4100, 16); break; case OBJECT_ALE: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->setAction(&scene->_action3); break; case CURSOR_LOOK: - SceneItem::display2(4100, _globals->getFlag(42) ? 24 : 12); + SceneItem::display2(4100, g_globals->getFlag(42) ? 24 : 12); break; case CURSOR_USE: SceneItem::display2(4100, 22); break; case CURSOR_TALK: if (RING_INVENTORY._peg._sceneNumber == 1) { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 4109; scene->setAction(&scene->_sequenceManager, scene, 4109, NULL); - } else if (_globals->getFlag(42)) { + } else if (g_globals->getFlag(42)) { scene->_sceneMode = 4102; scene->setAction(&scene->_sequenceManager, scene, 4102, NULL); } else { - if (_globals->getFlag(33)) - _globals->_stripNum = 4077; - else if (_globals->getFlag(82)) { - _globals->clearFlag(82); - _globals->_stripNum = 4100; + if (g_globals->getFlag(33)) + g_globals->_stripNum = 4077; + else if (g_globals->getFlag(82)) { + g_globals->clearFlag(82); + g_globals->_stripNum = 4100; } else { - _globals->_stripNum = 4075; - _globals->setFlag(33); + g_globals->_stripNum = 4075; + g_globals->setFlag(33); } scene->setAction(&scene->_action1); @@ -2573,7 +2573,7 @@ void Scene4100::Hotspot2::doAction(int action) { } void Scene4100::Miranda::doAction(int action) { - Scene4100 *scene = (Scene4100 *)_globals->_sceneManager._scene; + Scene4100 *scene = (Scene4100 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -2590,15 +2590,15 @@ void Scene4100::Miranda::doAction(int action) { } void Scene4100::Ladder::doAction(int action) { - Scene4100 *scene = (Scene4100 *)_globals->_sceneManager._scene; + Scene4100 *scene = (Scene4100 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(4100, 2); break; case CURSOR_USE: - if (_globals->getFlag(42)) { - _globals->_player.disableControl(); + if (g_globals->getFlag(42)) { + g_globals->_player.disableControl(); scene->setAction(&scene->_action5); } else { scene->_sceneMode = 4102; @@ -2615,14 +2615,14 @@ void Scene4100::Ladder::doAction(int action) { Exit hotspot, South */ void Scene4100::Hotspot14::doAction(int action) { - Scene4100 *scene = (Scene4100 *)_globals->_sceneManager._scene; + Scene4100 *scene = (Scene4100 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(4100, 0); break; case OBJECT_LADDER: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->setAction(&scene->_action5); break; default: @@ -2659,13 +2659,13 @@ void Scene4100::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_speakerML); _stripManager.addSpeaker(&_speakerQR); - _globals->_player.postInit(); - _globals->_player.setVisage(4200); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setStrip(4); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.setPosition(Common::Point(88, 180)); - _globals->_player._moveDiff = Common::Point(7, 4); + g_globals->_player.postInit(); + g_globals->_player.setVisage(4200); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setStrip(4); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.setPosition(Common::Point(88, 180)); + g_globals->_player._moveDiff = Common::Point(7, 4); _hotspot1.postInit(); _hotspot1.setVisage(4102); @@ -2684,18 +2684,18 @@ void Scene4100::postInit(SceneObjectList *OwnerList) { _hotspot4.setStrip2(2); _hotspot4.setPosition(Common::Point(152, 167)); - if (_globals->getFlag(36)) { + if (g_globals->getFlag(36)) { _hotspot1.setVisage(4105); _hotspot1.setStrip(1); _hotspot1.setFrame(4); - } else if (!_globals->getFlag(43)) { + } else if (!g_globals->getFlag(43)) { _miranda.postInit(); _miranda.setVisage(4102); _miranda.setStrip2(3); _miranda.setFrame(2); _miranda.setPosition(Common::Point(65, 188)); - _globals->_sceneItems.push_back(&_miranda); + g_globals->_sceneItems.push_back(&_miranda); } if (RING_INVENTORY._ladder._sceneNumber == 4100) { @@ -2703,7 +2703,7 @@ void Scene4100::postInit(SceneObjectList *OwnerList) { _ladder.setVisage(4101); _ladder.setPosition(Common::Point(49, 144)); - _globals->_sceneItems.push_back(&_ladder); + g_globals->_sceneItems.push_back(&_ladder); } _hotspot14.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); @@ -2715,41 +2715,41 @@ void Scene4100::postInit(SceneObjectList *OwnerList) { _hotspot12.setBounds(Rect(229, 59, 256, 122)); _hotspot13.setBounds(Rect(255, 152, 286, 183)); - _globals->_sceneItems.addItems(&_hotspot3, &_hotspot1, &_hotspot13, &_hotspot12, &_hotspot4, + g_globals->_sceneItems.addItems(&_hotspot3, &_hotspot1, &_hotspot13, &_hotspot12, &_hotspot4, &_hotspot11, &_hotspot9, &_hotspot7, &_hotspot10, &_hotspot8, &_hotspot14, NULL); - if (_globals->_sceneManager._previousScene == 4150) { - _globals->_soundHandler.play(155); + if (g_globals->_sceneManager._previousScene == 4150) { + g_globals->_soundHandler.play(155); - if (!_globals->getFlag(42)) { + if (!g_globals->getFlag(42)) { _hotspot1.setVisage(4104); _hotspot1.setPosition(Common::Point(152, 118)); _hotspot1.setStrip2(-1); _hotspot1.setFrame2(-1); _hotspot1.setFrame(1); - _globals->_player.setStrip(2); - _globals->_player.disableControl(); + g_globals->_player.setStrip(2); + g_globals->_player.disableControl(); setAction(&_action4); - _globals->clearFlag(43); + g_globals->clearFlag(43); } else { // Workaround: In the original, the mouse is hidden when Quinn // goes back to scene 4150 then to scene 4100. This enables everything. - _globals->_player.enableControl(); + g_globals->_player.enableControl(); } - _globals->_player.setPosition(Common::Point(252, 139)); - _globals->_player.setStrip(2); + g_globals->_player.setPosition(Common::Point(252, 139)); + g_globals->_player.setStrip(2); } else { - if ((RING_INVENTORY._ale._sceneNumber == 4100) && !_globals->getFlag(42)) { - _globals->_player.disableControl(); + if ((RING_INVENTORY._ale._sceneNumber == 4100) && !g_globals->getFlag(42)) { + g_globals->_player.disableControl(); setAction(&_action3); } - if (_globals->getFlag(35)) { - _globals->_player.disableControl(); + if (g_globals->getFlag(35)) { + g_globals->_player.disableControl(); _sceneMode = 4101; - setAction(&_sequenceManager, this, 4101, &_globals->_player, NULL); + setAction(&_sequenceManager, this, 4101, &g_globals->_player, NULL); } } } @@ -2757,28 +2757,28 @@ void Scene4100::postInit(SceneObjectList *OwnerList) { void Scene4100::signal() { switch (_sceneMode) { case 4101: - _globals->_sceneManager.changeScene(4000); + g_globals->_sceneManager.changeScene(4000); break; case 4102: case 4103: case 4109: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; } } void Scene4100::dispatch() { if (!_action) { - if ((_globals->_player.getRegionIndex() == 15) && !_globals->getFlag(42)) + if ((g_globals->_player.getRegionIndex() == 15) && !g_globals->getFlag(42)) setAction(&_action6); - if (_globals->_player.getRegionIndex() == 8) - _globals->_sceneManager.changeScene(4150); + if (g_globals->_player.getRegionIndex() == 8) + g_globals->_sceneManager.changeScene(4150); - if (_globals->_player._position.y >= 196) { - _globals->_player.disableControl(); + if (g_globals->_player._position.y >= 196) { + g_globals->_player.disableControl(); _sceneMode = 4101; - setAction(&_sequenceManager, this, 4105, &_globals->_player, NULL); + setAction(&_sequenceManager, this, 4105, &g_globals->_player, NULL); } } @@ -2791,7 +2791,7 @@ void Scene4100::dispatch() { *--------------------------------------------------------------------------*/ void Scene4150::Action1::signal() { - Scene4150 *scene = (Scene4150 *)_globals->_sceneManager._scene; + Scene4150 *scene = (Scene4150 *)g_globals->_sceneManager._scene; byte adjustData[4] = {0, 0, 0, 0}; switch (_actionIndex++) { @@ -2809,7 +2809,7 @@ void Scene4150::Action1::signal() { break; case 4: { for (int idx = 100; idx >= 0; idx -= 5) { - _globals->_scenePalette.fade(adjustData, false, idx); + g_globals->_scenePalette.fade(adjustData, false, idx); g_system->updateScreen(); g_system->delayMillis(10); } @@ -2828,8 +2828,8 @@ void Scene4150::Action1::signal() { break; } case 5: - _globals->_scenePalette.loadPalette(4150); - _globals->_scenePalette.refresh(); + g_globals->_scenePalette.loadPalette(4150); + g_globals->_scenePalette.refresh(); setDelay(60); break; case 6: @@ -2837,7 +2837,7 @@ void Scene4150::Action1::signal() { break; case 7: for (int idx = 100; idx >= 0; idx -= 5) { - _globals->_scenePalette.fade(adjustData, false, idx); + g_globals->_scenePalette.fade(adjustData, false, idx); g_system->updateScreen(); g_system->delayMillis(10); } @@ -2849,28 +2849,28 @@ void Scene4150::Action1::signal() { scene->_hotspot1.setFrame(1); scene->_hotspot1.show(); - _globals->_player.setVisage(4200); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setStrip(3); - _globals->_player.setPosition(Common::Point(139, 166)); - _globals->_player._moveDiff = Common::Point(7, 3); - _globals->_player.show(); + g_globals->_player.setVisage(4200); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setStrip(3); + g_globals->_player.setPosition(Common::Point(139, 166)); + g_globals->_player._moveDiff = Common::Point(7, 3); + g_globals->_player.show(); setDelay(120); break; case 8: - _globals->_scenePalette.loadPalette(4150); - _globals->_scenePalette.refresh(); + g_globals->_scenePalette.loadPalette(4150); + g_globals->_scenePalette.refresh(); setDelay(30); break; case 9: scene->_stripManager.start(4523, this); break; case 10: - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player._moveDiff = Common::Point(7, 4); - _globals->_player.setStrip(3); - _globals->_player.enableControl(); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player._moveDiff = Common::Point(7, 4); + g_globals->_player.setStrip(3); + g_globals->_player.enableControl(); remove(); break; @@ -2878,7 +2878,7 @@ void Scene4150::Action1::signal() { } void Scene4150::Action2::signal() { - Scene4150 *scene = (Scene4150 *)_globals->_sceneManager._scene; + Scene4150 *scene = (Scene4150 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -2890,10 +2890,10 @@ void Scene4150::Action2::signal() { scene->_hotspot1.setFrame(1); scene->_hotspot1.animate(ANIM_MODE_5, this); - _globals->_player.animate(ANIM_MODE_5, NULL); + g_globals->_player.animate(ANIM_MODE_5, NULL); break; case 2: - _globals->_player.hide(); + g_globals->_player.hide(); scene->_hotspot1.setVisage(4153); scene->_hotspot1.setStrip(1); scene->_hotspot1.setFrame(1); @@ -2906,15 +2906,15 @@ void Scene4150::Action2::signal() { } void Scene4150::Action3::signal() { - Scene4150 *scene = (Scene4150 *)_globals->_sceneManager._scene; + Scene4150 *scene = (Scene4150 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(15); break; case 1: - _globals->_player.checkAngle(&scene->_hotspot3); + g_globals->_player.checkAngle(&scene->_hotspot3); if (RING_INVENTORY._rope._sceneNumber == 1) { scene->_hotspot3.postInit(); @@ -2922,13 +2922,13 @@ void Scene4150::Action3::signal() { scene->_hotspot3.setPosition(Common::Point(175, 70)); RING_INVENTORY._rope._sceneNumber = 4150; - _globals->_sceneItems.push_front(&scene->_hotspot3); + g_globals->_sceneItems.push_front(&scene->_hotspot3); } else { RING_INVENTORY._rope._sceneNumber = 1; scene->_hotspot3.remove(); } - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; } @@ -2937,7 +2937,7 @@ void Scene4150::Action3::signal() { /*--------------------------------------------------------------------------*/ void Scene4150::HotspotGroup1::doAction(int action) { - Scene4150 *scene = (Scene4150 *)_globals->_sceneManager._scene; + Scene4150 *scene = (Scene4150 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -2952,8 +2952,8 @@ void Scene4150::HotspotGroup1::doAction(int action) { void Scene4150::HotspotGroup3::doAction(int action) { switch (action) { case CURSOR_LOOK: - SceneItem::display2(4150, _globals->getFlag(46) ? 9 : 8); - _globals->setFlag(46); + SceneItem::display2(4150, g_globals->getFlag(46) ? 9 : 8); + g_globals->setFlag(46); break; case CURSOR_USE: SceneItem::display2(4150, 30); @@ -2964,8 +2964,8 @@ void Scene4150::HotspotGroup3::doAction(int action) { void Scene4150::HotspotGroup6::doAction(int action) { switch (action) { case CURSOR_LOOK: - SceneItem::display2(4150, _globals->getFlag(47) ? 16 : 15); - _globals->setFlag(47); + SceneItem::display2(4150, g_globals->getFlag(47) ? 16 : 15); + g_globals->setFlag(47); break; case CURSOR_USE: SceneItem::display2(4150, 31); @@ -2974,7 +2974,7 @@ void Scene4150::HotspotGroup6::doAction(int action) { } void Scene4150::Hotspot3::doAction(int action) { - Scene4150 *scene = (Scene4150 *)_globals->_sceneManager._scene; + Scene4150 *scene = (Scene4150 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -3031,31 +3031,31 @@ void Scene4150::postInit(SceneObjectList *OwnerList) { _hotspot1.postInit(); _hotspot1.setPosition(Common::Point(177, 201)); - if (_globals->getFlag(44)) { - _globals->_player.postInit(); - _globals->_player.setVisage(4200); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.setStrip(2); - _globals->_player.setPosition(Common::Point(328, 160)); - _globals->_player._moveDiff = Common::Point(7, 4); - _globals->_player.disableControl(); + if (g_globals->getFlag(44)) { + g_globals->_player.postInit(); + g_globals->_player.setVisage(4200); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.setStrip(2); + g_globals->_player.setPosition(Common::Point(328, 160)); + g_globals->_player._moveDiff = Common::Point(7, 4); + g_globals->_player.disableControl(); _sceneMode = 4151; - setAction(&_sequenceManager, this, 4151, &_globals->_player, NULL); + setAction(&_sequenceManager, this, 4151, &g_globals->_player, NULL); _hotspot1.setVisage(4157); _hotspot1.setPosition(Common::Point(177, 201)); } else { - _globals->_player.postInit(); - _globals->_player.setVisage(4154); - _globals->_player._canWalk = false; - _globals->_player.setPosition(Common::Point(198, 202)); - _globals->_player.disableControl(); + g_globals->_player.postInit(); + g_globals->_player.setVisage(4154); + g_globals->_player._canWalk = false; + g_globals->_player.setPosition(Common::Point(198, 202)); + g_globals->_player.disableControl(); _hotspot1.setVisage(4152); setAction(&_action1); - _globals->setFlag(44); + g_globals->setFlag(44); } if (RING_INVENTORY._rope._sceneNumber == 4150) { @@ -3063,10 +3063,10 @@ void Scene4150::postInit(SceneObjectList *OwnerList) { _hotspot3.setVisage(4150); _hotspot3.setPosition(Common::Point(175, 70)); - _globals->_sceneItems.push_back(&_hotspot3); + g_globals->_sceneItems.push_back(&_hotspot3); } - _globals->_sceneItems.push_back(&_hotspot1); + g_globals->_sceneItems.push_back(&_hotspot1); _hotspot5.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); _hotspot6.setBounds(Rect(28, 121, 80, 148)); @@ -3091,32 +3091,32 @@ void Scene4150::postInit(SceneObjectList *OwnerList) { _hotspot25.setBounds(Rect(183, 155, 316, 190)); _hotspot26.setBounds(Rect(98, 169, 238, 198)); - _globals->_sceneItems.addItems(&_hotspot24, &_hotspot23, &_hotspot13, &_hotspot25, + g_globals->_sceneItems.addItems(&_hotspot24, &_hotspot23, &_hotspot13, &_hotspot25, &_hotspot26, &_hotspot19, &_hotspot22, &_hotspot20, &_hotspot17, &_hotspot16, &_hotspot15, &_hotspot11, &_hotspot14, &_hotspot18, &_hotspot21, &_hotspot12, &_hotspot10, &_hotspot9, &_hotspot8, &_hotspot7, &_hotspot6, &_hotspot2, &_hotspot5, NULL); - _globals->_soundHandler.play(165); + g_globals->_soundHandler.play(165); _soundHandler.play(311); } void Scene4150::signal() { if (_sceneMode == 4151) - _globals->_player.enableControl(); + g_globals->_player.enableControl(); else if (_sceneMode == 4152) - _globals->_sceneManager.changeScene(4100); + g_globals->_sceneManager.changeScene(4100); } void Scene4150::dispatch() { Scene::dispatch(); - if (!_action && (_globals->_player._position.x >= 316)) { - _globals->_soundHandler.fadeOut(NULL); + if (!_action && (g_globals->_player._position.x >= 316)) { + g_globals->_soundHandler.fadeOut(NULL); _soundHandler.fadeOut(NULL); - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneMode = 4152; - setAction(&_sequenceManager, this, 4152, &_globals->_player, NULL); + setAction(&_sequenceManager, this, 4152, &g_globals->_player, NULL); } } @@ -3126,15 +3126,15 @@ void Scene4150::dispatch() { *--------------------------------------------------------------------------*/ void Scene4250::Action1::signal() { - Scene4250 *scene = (Scene4250 *)_globals->_sceneManager._scene; + Scene4250 *scene = (Scene4250 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(3); break; case 1: - ADD_MOVER_NULL(_globals->_player, 6, 190); + ADD_MOVER_NULL(g_globals->_player, 6, 190); ADD_MOVER_NULL(scene->_hotspot3, 9, 195); ADD_MOVER(scene->_hotspot1, 12, 185); break; @@ -3157,44 +3157,44 @@ void Scene4250::Action1::signal() { scene->_stripManager.start(4470, this); break; case 8: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; } } void Scene4250::Action2::signal() { - Scene4250 *scene = (Scene4250 *)_globals->_sceneManager._scene; + Scene4250 *scene = (Scene4250 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); ADD_PLAYER_MOVER(247, 182); break; case 1: - _globals->_player.setVisage(2670); - _globals->_player.changeZoom(50); - _globals->_player.setStrip(3); - _globals->_player.setFrame(1); - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.setVisage(2670); + g_globals->_player.changeZoom(50); + g_globals->_player.setStrip(3); + g_globals->_player.setFrame(1); + g_globals->_player.animate(ANIM_MODE_5, this); break; case 2: - if ((_globals->_stripNum == 9000) || (_globals->_stripNum == 4300)) { + if ((g_globals->_stripNum == 9000) || (g_globals->_stripNum == 4300)) { scene->_stripManager.start(4205, this); } else { scene->_stripManager.start(4490, this); } break; case 3: - _globals->_player.animate(ANIM_MODE_6, this); + g_globals->_player.animate(ANIM_MODE_6, this); break; case 4: - _globals->_player.setVisage(2602); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.changeZoom(70); + g_globals->_player.setVisage(2602); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.changeZoom(70); - if ((_globals->_stripNum == 9000) || (_globals->_stripNum == 4300)) { - _globals->_player.enableControl(); + if ((g_globals->_stripNum == 9000) || (g_globals->_stripNum == 4300)) { + g_globals->_player.enableControl(); remove(); } else { ADD_PLAYER_MOVER(6, 180); @@ -3208,19 +3208,19 @@ void Scene4250::Action2::signal() { ADD_MOVER_NULL(scene->_hotspot5, -30, 195); break; case 6: - _globals->clearFlag(59); - _globals->clearFlag(70); - _globals->clearFlag(37); - _globals->clearFlag(114); - _globals->clearFlag(36); - _globals->clearFlag(43); - _globals->_sceneManager.changeScene(2100); + g_globals->clearFlag(59); + g_globals->clearFlag(70); + g_globals->clearFlag(37); + g_globals->clearFlag(114); + g_globals->clearFlag(36); + g_globals->clearFlag(43); + g_globals->_sceneManager.changeScene(2100); break; } } void Scene4250::Action3::signal() { - Scene4250 *scene = (Scene4250 *)_globals->_sceneManager._scene; + Scene4250 *scene = (Scene4250 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -3230,46 +3230,46 @@ void Scene4250::Action3::signal() { scene->_stripManager.start(4480, this); break; case 2: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; } } void Scene4250::Action4::signal() { - Scene4250 *scene = (Scene4250 *)_globals->_sceneManager._scene; + Scene4250 *scene = (Scene4250 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(3); break; case 1: - _globals->_player.addMover(NULL); + g_globals->_player.addMover(NULL); scene->_stripManager.start((RING_INVENTORY._helmet._sceneNumber == 4250) ? 4259 : 4256, this); break; case 2: - ADD_PLAYER_MOVER(_globals->_player._position.x + 5, _globals->_player._position.y); + ADD_PLAYER_MOVER(g_globals->_player._position.x + 5, g_globals->_player._position.y); break; case 3: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; } } void Scene4250::Action5::signal() { - Scene4250 *scene = (Scene4250 *)_globals->_sceneManager._scene; + Scene4250 *scene = (Scene4250 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(3); break; case 1: scene->_hotspot4.fixPriority(195); scene->_hotspot1.fixPriority(105); - ADD_MOVER_NULL(_globals->_player, 6, 185); + ADD_MOVER_NULL(g_globals->_player, 6, 185); ADD_MOVER_NULL(scene->_hotspot4, 9, 190); ADD_MOVER(scene->_hotspot1, 12, 180); break; @@ -3282,7 +3282,7 @@ void Scene4250::Action5::signal() { scene->_hotspot4.fixPriority(-1); scene->_hotspot1.setStrip(5); scene->_hotspot4.setStrip(7); - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; } @@ -3291,15 +3291,15 @@ void Scene4250::Action5::signal() { /*--------------------------------------------------------------------------*/ void Scene4250::Hotspot1::doAction(int action) { - Scene4250 *scene = (Scene4250 *)_globals->_sceneManager._scene; + Scene4250 *scene = (Scene4250 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(4250, (RING_INVENTORY._helmet._sceneNumber == 4250) ? 19 : 14); break; case CURSOR_TALK: - _globals->_player.disableControl(); - if (!_globals->_sceneObjects->contains(&scene->_hotspot4)) { + g_globals->_player.disableControl(); + if (!g_globals->_sceneObjects->contains(&scene->_hotspot4)) { scene->setAction(&scene->_action3); } else { scene->_sceneMode = 4260; @@ -3308,7 +3308,7 @@ void Scene4250::Hotspot1::doAction(int action) { scene->setAction(&scene->_sequenceManager, scene, 4265, this, NULL); } else { scene->setAction(&scene->_sequenceManager, scene, - _globals->_sceneObjects->contains(&scene->_hotspot6) ? 4260 : 4262, this, NULL); + g_globals->_sceneObjects->contains(&scene->_hotspot6) ? 4260 : 4262, this, NULL); } } break; @@ -3332,7 +3332,7 @@ void Scene4250::Hotspot1::doAction(int action) { void Scene4250::Hotspot2::doAction(int action) { //Ship with stasis field - Scene4250 *scene = (Scene4250 *)_globals->_sceneManager._scene; + Scene4250 *scene = (Scene4250 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -3340,19 +3340,19 @@ void Scene4250::Hotspot2::doAction(int action) { SceneItem::display2(4250, 16); break; case OBJECT_SCANNER: - if ((_globals->_stripNum == 9000) || (_globals->_stripNum == 4300)) + if ((g_globals->_stripNum == 9000) || (g_globals->_stripNum == 4300)) scene->setAction(&scene->_action2); - else if (_globals->getFlag(55)) + else if (g_globals->getFlag(55)) SceneItem::display2(4250, 17); else { - _globals->setFlag(55); + g_globals->setFlag(55); scene->setAction(&scene->_action2); } break; case OBJECT_STASIS_NEGATOR: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 4252; - scene->setAction(&scene->_sequenceManager, scene, 4252, &_globals->_player, this, NULL); + scene->setAction(&scene->_sequenceManager, scene, 4252, &g_globals->_player, this, NULL); break; default: SceneHotspot::doAction(action); @@ -3361,7 +3361,7 @@ void Scene4250::Hotspot2::doAction(int action) { } void Scene4250::Hotspot4::doAction(int action) { - Scene4250 *scene = (Scene4250 *)_globals->_sceneManager._scene; + Scene4250 *scene = (Scene4250 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -3380,8 +3380,8 @@ void Scene4250::Hotspot4::doAction(int action) { SceneHotspot::doAction(action); break; case CURSOR_TALK: - _globals->_player.disableControl(); - if (!_globals->_sceneObjects->contains(&scene->_hotspot6)) { + g_globals->_player.disableControl(); + if (!g_globals->_sceneObjects->contains(&scene->_hotspot6)) { scene->_sceneMode = 4254; scene->setAction(&scene->_sequenceManager, scene, 4263, NULL); } else { @@ -3403,7 +3403,7 @@ void Scene4250::Hotspot4::doAction(int action) { } void Scene4250::Hotspot6::doAction(int action) { - Scene4250 *scene = (Scene4250 *)_globals->_sceneManager._scene; + Scene4250 *scene = (Scene4250 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -3416,17 +3416,17 @@ void Scene4250::Hotspot6::doAction(int action) { SceneItem::display2(4250, (RING_INVENTORY._helmet._sceneNumber == 4250) ? 20 : 3); break; case OBJECT_HELMET: - _globals->_soundHandler.play(354); - _globals->_player.disableControl(); + g_globals->_soundHandler.play(354); + g_globals->_player.disableControl(); RING_INVENTORY._helmet._sceneNumber = 4250; if (RING_INVENTORY._concentrator._sceneNumber == 1) { - if (_globals->getFlag(115)) { + if (g_globals->getFlag(115)) { scene->_sceneMode = 4269; scene->setAction(&scene->_sequenceManager, scene, 4269, this, NULL); } else { - _globals->setFlag(115); - _globals->_events.setCursor(CURSOR_WALK); + g_globals->setFlag(115); + g_globals->_events.setCursor(CURSOR_WALK); scene->_sceneMode = 4256; scene->setAction(&scene->_sequenceManager, scene, 4256, this, NULL); } @@ -3437,20 +3437,20 @@ void Scene4250::Hotspot6::doAction(int action) { scene->_sceneMode = 4268; scene->setAction(&scene->_sequenceManager, scene, 4268, this, NULL); } else { - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_events.setCursor(CURSOR_WALK); ADD_MOVER_NULL(scene->_hotspot1, 241, 169); scene->_sceneMode = 4261; - scene->setAction(&scene->_sequenceManager, scene, 4261, &_globals->_player, this, NULL); + scene->setAction(&scene->_sequenceManager, scene, 4261, &g_globals->_player, this, NULL); } break; case OBJECT_NULLIFIER: if (RING_INVENTORY._helmet._sceneNumber == 4250) { - _globals->_soundHandler.play(353); - _globals->_player.disableControl(); + g_globals->_soundHandler.play(353); + g_globals->_player.disableControl(); RING_INVENTORY._helmet._sceneNumber = 1; scene->_sceneMode = 4257; - scene->setAction(&scene->_sequenceManager, scene, 4257, &_globals->_player, this, NULL); + scene->setAction(&scene->_sequenceManager, scene, 4257, &g_globals->_player, this, NULL); } else { SceneItem::display2(4250, 4); } @@ -3459,7 +3459,7 @@ void Scene4250::Hotspot6::doAction(int action) { if (RING_INVENTORY._helmet._sceneNumber == 4250) doAction(OBJECT_HELMET); else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 4264; scene->setAction(&scene->_sequenceManager, scene, 4264, this, NULL); } @@ -3468,7 +3468,7 @@ void Scene4250::Hotspot6::doAction(int action) { if (RING_INVENTORY._helmet._sceneNumber == 4250) doAction(OBJECT_HELMET); else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); if ((RING_INVENTORY._items._sceneNumber != 1) || (RING_INVENTORY._concentrator._sceneNumber != 1)) { scene->_sceneMode = 4258; scene->setAction(&scene->_sequenceManager, scene, 4258, this, NULL); @@ -3480,7 +3480,7 @@ void Scene4250::Hotspot6::doAction(int action) { scene->_hotspot2.hide(); scene->_sceneMode = 4259; - scene->setAction(&scene->_sequenceManager, scene, 4259, &_globals->_player, this, &scene->_hotspot2, NULL); + scene->setAction(&scene->_sequenceManager, scene, 4259, &g_globals->_player, this, &scene->_hotspot2, NULL); } } break; @@ -3491,12 +3491,12 @@ void Scene4250::Hotspot6::doAction(int action) { } void Scene4250::Hotspot8::doAction(int action) { - Scene4250 *scene = (Scene4250 *)_globals->_sceneManager._scene; + Scene4250 *scene = (Scene4250 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: case CURSOR_USE: - _globals->_sceneManager.changeScene(4300); + g_globals->_sceneManager.changeScene(4300); break; case OBJECT_SCANNER: SceneItem::display2(4250, 24); @@ -3505,7 +3505,7 @@ void Scene4250::Hotspot8::doAction(int action) { SceneItem::display2(4250, 25); break; case OBJECT_STASIS_NEGATOR: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 4270; scene->setAction(&scene->_sequenceManager, scene, (RING_INVENTORY._helmet._sceneNumber == 4250) ? 4270 : 4271, NULL); @@ -3542,13 +3542,13 @@ void Scene4250::postInit(TsAGE::SceneObjectList *OwnerList) { _speakerPText.setTextPos(Common::Point(40, 100)); _hotspot8._sceneRegionId = 16; - _globals->_player.postInit(); - _globals->_player.setVisage(2602); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.setPosition(Common::Point(-13, 190)); - _globals->_player.changeZoom(-1); - _globals->_player._moveDiff = Common::Point(4, 1); + g_globals->_player.postInit(); + g_globals->_player.setVisage(2602); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.setPosition(Common::Point(-13, 190)); + g_globals->_player.changeZoom(-1); + g_globals->_player._moveDiff = Common::Point(4, 1); _hotspot1.postInit(); _hotspot1.setVisage(2801); @@ -3557,9 +3557,9 @@ void Scene4250::postInit(TsAGE::SceneObjectList *OwnerList) { _hotspot1.setPosition(Common::Point(-18, 185)); _hotspot1.changeZoom(-1); _hotspot1._moveDiff = Common::Point(4, 1); - _globals->_sceneItems.push_back(&_hotspot1); + g_globals->_sceneItems.push_back(&_hotspot1); - if (_globals->_sceneManager._previousScene == 4300) { + if (g_globals->_sceneManager._previousScene == 4300) { _hotspot5.postInit(); _hotspot5.setVisage(4250); _hotspot5.setPosition(Common::Point(268, 168)); @@ -3573,13 +3573,13 @@ void Scene4250::postInit(TsAGE::SceneObjectList *OwnerList) { _hotspot4.setStrip(2); _hotspot4._moveDiff = Common::Point(4, 1); _hotspot4.changeZoom(70); - _globals->_sceneItems.push_back(&_hotspot4); + g_globals->_sceneItems.push_back(&_hotspot4); _hotspot1.setPosition(Common::Point(197, 173)); _hotspot1.changeZoom(70); - _globals->_player.setPosition(Common::Point(252, 176)); - _globals->_player.changeZoom(70); + g_globals->_player.setPosition(Common::Point(252, 176)); + g_globals->_player.changeZoom(70); _hotspot6.postInit(); _hotspot6.setVisage(4302); @@ -3594,32 +3594,32 @@ void Scene4250::postInit(TsAGE::SceneObjectList *OwnerList) { _hotspot6.setFrame(_hotspot6.getFrameCount()); } - if (_globals->getFlag(98)) { - _globals->_sceneItems.push_front(&_hotspot6); + if (g_globals->getFlag(98)) { + g_globals->_sceneItems.push_front(&_hotspot6); } else { _hotspot6.hide(); - if ((_globals->_stripNum == 4300) || (_globals->_stripNum == 4301)) { - _globals->setFlag(98); - _globals->_player.setVisage(4302); - _globals->_player.setStrip(5); - _globals->_player.changeZoom(50); - _globals->_player.disableControl(); + if ((g_globals->_stripNum == 4300) || (g_globals->_stripNum == 4301)) { + g_globals->setFlag(98); + g_globals->_player.setVisage(4302); + g_globals->_player.setStrip(5); + g_globals->_player.changeZoom(50); + g_globals->_player.disableControl(); _hotspot4.setPosition(Common::Point(239, 195)); _sceneMode = 4253; - _globals->_sceneItems.push_front(&_hotspot6); + g_globals->_sceneItems.push_front(&_hotspot6); - setAction(&_sequenceManager, this, 4253, &_globals->_player, &_hotspot6, &_hotspot4, NULL); + setAction(&_sequenceManager, this, 4253, &g_globals->_player, &_hotspot6, &_hotspot4, NULL); } } - } else if (_globals->_stripNum == 9000) { + } else if (g_globals->_stripNum == 9000) { _hotspot4.postInit(); _hotspot4.setVisage(2701); _hotspot4.animate(ANIM_MODE_1, NULL); _hotspot4.setObjectWrapper(new SceneObjectWrapper()); _hotspot4.setPosition(Common::Point(-15, 195)); _hotspot4._moveDiff = Common::Point(4, 1); - _globals->_sceneItems.push_back(&_hotspot4); + g_globals->_sceneItems.push_back(&_hotspot4); setAction(&_action5); } else { @@ -3632,13 +3632,13 @@ void Scene4250::postInit(TsAGE::SceneObjectList *OwnerList) { _hotspot3._moveDiff = Common::Point(4, 1); setAction(&_action1); - _globals->clearFlag(43); - _globals->clearFlag(114); - _globals->clearFlag(36); + g_globals->clearFlag(43); + g_globals->clearFlag(114); + g_globals->clearFlag(36); } - if (_globals->getFlag(17)) { - _globals->_sceneItems.push_back(&_hotspot8); + if (g_globals->getFlag(17)) { + g_globals->_sceneItems.push_back(&_hotspot8); } else { _hotspot2.postInit(); _hotspot2.setVisage(4251); @@ -3647,27 +3647,27 @@ void Scene4250::postInit(TsAGE::SceneObjectList *OwnerList) { _hotspot2.setFrame(1); _hotspot2.setPosition(Common::Point(267, 172)); - _globals->_sceneItems.push_back(&_hotspot2); + g_globals->_sceneItems.push_back(&_hotspot2); } _hotspot7.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); - _globals->_sceneItems.push_back(&_hotspot7); - _globals->_soundHandler.play(185); + g_globals->_sceneItems.push_back(&_hotspot7); + g_globals->_soundHandler.play(185); } void Scene4250::signal() { switch (_sceneMode) { case 4252: - _globals->setFlag(17); - _globals->_sceneManager.changeScene(4301); + g_globals->setFlag(17); + g_globals->_sceneManager.changeScene(4301); break; case 4253: - if (_globals->_stripNum == 4301) { + if (g_globals->_stripNum == 4301) { _sceneMode = 4261; ADD_MOVER_NULL(_hotspot1, 241, 169); - setAction(&_sequenceManager, this, 4261, &_globals->_player, &_hotspot6, NULL); + setAction(&_sequenceManager, this, 4261, &g_globals->_player, &_hotspot6, NULL); } else { - _globals->_player.enableControl(); + g_globals->_player.enableControl(); } break; case 4254: @@ -3682,15 +3682,15 @@ void Scene4250::signal() { case 4268: case 4269: case 4270: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; case 4259: - _globals->_soundHandler.play(360); - _globals->_sceneManager.changeScene(9900); + g_globals->_soundHandler.play(360); + g_globals->_sceneManager.changeScene(9900); break; case 4261: RING_INVENTORY._keyDevice._sceneNumber = 1; - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; case 4255: case 4262: @@ -3701,13 +3701,13 @@ void Scene4250::signal() { } void Scene4250::dispatch() { - if (_globals->_player.getRegionIndex() == 8) - _globals->_player.changeZoom(90 - (_globals->_player._position.y - 153)); - if (_globals->_player.getRegionIndex() == 12) - _globals->_player.changeZoom(70); - if (_globals->_player.getRegionIndex() == 15) { - _globals->_player.changeZoom(-1); - _globals->_player.fixPriority(-1); + if (g_globals->_player.getRegionIndex() == 8) + g_globals->_player.changeZoom(90 - (g_globals->_player._position.y - 153)); + if (g_globals->_player.getRegionIndex() == 12) + g_globals->_player.changeZoom(70); + if (g_globals->_player.getRegionIndex() == 15) { + g_globals->_player.changeZoom(-1); + g_globals->_player.fixPriority(-1); } if (_hotspot1.getRegionIndex() == 8) @@ -3731,11 +3731,11 @@ void Scene4250::dispatch() { Scene::dispatch(); if (!_action) { - if (!_globals->getFlag(55) && (_globals->_player.getRegionIndex() == 12)) { + if (!g_globals->getFlag(55) && (g_globals->_player.getRegionIndex() == 12)) { setAction(&_action4); } - if (_globals->_sceneObjects->contains(&_hotspot6) && (_globals->_player.getRegionIndex() == 12)) + if (g_globals->_sceneObjects->contains(&_hotspot6) && (g_globals->_player.getRegionIndex() == 12)) setAction(&_action4); } } @@ -3746,17 +3746,17 @@ void Scene4250::dispatch() { *--------------------------------------------------------------------------*/ void Scene4300::Action1::signal() { - Scene4300 *scene = (Scene4300 *)_globals->_sceneManager._scene; + Scene4300 *scene = (Scene4300 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->setFlag(56); - _globals->_scenePalette.addRotation(240, 254, -1); + g_globals->setFlag(56); + g_globals->_scenePalette.addRotation(240, 254, -1); scene->_hotspot7.animate(ANIM_MODE_6, this); - _globals->_soundHandler.play(164); + g_globals->_soundHandler.play(164); break; case 1: - _globals->_soundHandler.play(340); + g_globals->_soundHandler.play(340); scene->_soundHandler1.play(341); scene->_hotspot1.remove(); setDelay(3); @@ -3795,10 +3795,10 @@ void Scene4300::Action1::signal() { scene->_stripManager.start(8015, this, scene); break; case 9: - _globals->_soundHandler.play(350); - _globals->_sceneManager._fadeMode = FADEMODE_GRADUAL; - _globals->_events.setCursor(CURSOR_USE); - _globals->_player.enableControl(); + g_globals->_soundHandler.play(350); + g_globals->_sceneManager._fadeMode = FADEMODE_GRADUAL; + g_globals->_events.setCursor(CURSOR_USE); + g_globals->_player.enableControl(); remove(); break; @@ -3806,7 +3806,7 @@ void Scene4300::Action1::signal() { } void Scene4300::Action2::signal() { - Scene4300 *scene = (Scene4300 *)_globals->_sceneManager._scene; + Scene4300 *scene = (Scene4300 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -3816,7 +3816,7 @@ void Scene4300::Action2::signal() { scene->_stripManager.start(8016, this, scene); break; case 2: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; } @@ -3841,11 +3841,11 @@ void Scene4300::Hotspot8::doAction(int action) { break; case OBJECT_KEY_DEVICE: RING_INVENTORY._keyDevice._sceneNumber = 4300; - _globals->_scenePalette.addRotation(240, 254, -1); + g_globals->_scenePalette.addRotation(240, 254, -1); animate(ANIM_MODE_5, NULL); - _globals->setFlag(99); - _globals->_sceneItems.push_back(this); + g_globals->setFlag(99); + g_globals->_sceneItems.push_back(this); break; default: SceneHotspot::doAction(action); @@ -3887,14 +3887,14 @@ void Scene4300::Hotspot9::doAction(int action) { void Scene4300::Hotspot10::doAction(int action) { // Alien - Scene4300 *scene = (Scene4300 *)_globals->_sceneManager._scene; + Scene4300 *scene = (Scene4300 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(4300, 2); break; case CURSOR_TALK: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->setAction(&scene->_action2); break; case OBJECT_SCANNER: @@ -3905,9 +3905,9 @@ void Scene4300::Hotspot10::doAction(int action) { break; case CURSOR_USE: case OBJECT_HELMET: - _globals->_stripNum = (action == CURSOR_USE) ? 4300 : 4301; - _globals->_events.setCursor(CURSOR_NONE); - _globals->_sceneManager.changeScene(4250); + g_globals->_stripNum = (action == CURSOR_USE) ? 4300 : 4301; + g_globals->_events.setCursor(CURSOR_NONE); + g_globals->_sceneManager.changeScene(4250); break; default: SceneHotspot::doAction(action); @@ -3916,11 +3916,11 @@ void Scene4300::Hotspot10::doAction(int action) { } void Scene4300::Hotspot15::signal() { - Scene4300 *scene = (Scene4300 *)_globals->_sceneManager._scene; + Scene4300 *scene = (Scene4300 *)g_globals->_sceneManager._scene; scene->_soundHandler2.play(345); - _strip = (_globals->_randomSource.getRandomNumber(6) < 2) ? 2 : 1; + _strip = (g_globals->_randomSource.getRandomNumber(6) < 2) ? 2 : 1; if ((RING_INVENTORY._stasisBox2._sceneNumber == 4300) || (RING_INVENTORY._concentrator._sceneNumber == 1)) { setStrip(1); @@ -3932,7 +3932,7 @@ void Scene4300::Hotspot15::signal() { } void Scene4300::Hotspot16::doAction(int action) { - Scene4300 *scene = (Scene4300 *)_globals->_sceneManager._scene; + Scene4300 *scene = (Scene4300 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -3960,7 +3960,7 @@ void Scene4300::Hotspot16::doAction(int action) { } void Scene4300::Hotspot17::doAction(int action) { - Scene4300 *scene = (Scene4300 *)_globals->_sceneManager._scene; + Scene4300 *scene = (Scene4300 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -3970,7 +3970,7 @@ void Scene4300::Hotspot17::doAction(int action) { if (RING_INVENTORY._stasisBox2._sceneNumber != 4300) SceneItem::display2(4300, 13); else { - _globals->_scenePalette.clearListeners(); + g_globals->_scenePalette.clearListeners(); remove(); SceneItem::display2(4300, 12); @@ -3985,7 +3985,7 @@ void Scene4300::Hotspot17::doAction(int action) { break; case OBJECT_STASIS_BOX2: scene->_soundHandler1.play(352); - _globals->_events.setCursor(CURSOR_USE); + g_globals->_events.setCursor(CURSOR_USE); scene->_sceneMode = 4303; scene->setAction(&scene->_sequenceManager, scene, 4303, this, NULL); @@ -4039,7 +4039,7 @@ void Scene4300::postInit(SceneObjectList *OwnerList) { _hotspot7.setPosition(Common::Point(90, 128)); _hotspot7.setVisage(4303); _hotspot7.fixPriority(250); - _globals->_sceneItems.push_back(&_hotspot7); + g_globals->_sceneItems.push_back(&_hotspot7); _hotspot9.setDetails(120, 49, 174, 91, 4300, -1, -1); @@ -4048,12 +4048,12 @@ void Scene4300::postInit(SceneObjectList *OwnerList) { _hotspot15.setPosition(Common::Point(149, 79)); _hotspot15.signal(); - if (!_globals->getFlag(99)) { + if (!g_globals->getFlag(99)) { _hotspot8.postInit(); _hotspot8.setVisage(4300); _hotspot8.setStrip(3); _hotspot8.setPosition(Common::Point(196, 47)); - _globals->_sceneItems.push_back(&_hotspot8); + g_globals->_sceneItems.push_back(&_hotspot8); } if (RING_INVENTORY._concentrator._sceneNumber == 4300) { @@ -4066,15 +4066,15 @@ void Scene4300::postInit(SceneObjectList *OwnerList) { if (RING_INVENTORY._stasisBox2._sceneNumber == 4300) _hotspot17.setFrame(_hotspot17.getFrameCount()); - _globals->_sceneItems.push_back(&_hotspot17); + g_globals->_sceneItems.push_back(&_hotspot17); } - if (!_globals->getFlag(98)) { + if (!g_globals->getFlag(98)) { _hotspot10.postInit(); _hotspot10.setVisage(4302); _hotspot10.setPosition(Common::Point(244, 179)); _hotspot10.fixPriority(100); - _globals->_sceneItems.push_back(&_hotspot10); + g_globals->_sceneItems.push_back(&_hotspot10); _hotspot12.postInit(); _hotspot12.setVisage(4302); @@ -4099,11 +4099,11 @@ void Scene4300::postInit(SceneObjectList *OwnerList) { _hotspot16.setPosition(Common::Point(169, 141)); _hotspot16.fixPriority(1); _hotspot16.setStrip(4); - _globals->_sceneItems.push_back(&_hotspot16); + g_globals->_sceneItems.push_back(&_hotspot16); } - if (_globals->_sceneManager._previousScene == 4301) { - _globals->_player.disableControl(); + if (g_globals->_sceneManager._previousScene == 4301) { + g_globals->_player.disableControl(); _hotspot7.setFrame(_hotspot7.getFrameCount()); _hotspot1.postInit(); @@ -4143,15 +4143,15 @@ void Scene4300::postInit(SceneObjectList *OwnerList) { setAction(&_action1); } else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneMode = 4304; setAction(&_sequenceManager, this, 4304, NULL); } _hotspot10.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); _hotspot19._sceneRegionId = 0; - _globals->_sceneItems.push_back(&_hotspot19); - _globals->_sceneItems.push_back(&_hotspot18); + g_globals->_sceneItems.push_back(&_hotspot19); + g_globals->_sceneItems.push_back(&_hotspot18); } void Scene4300::stripCallback(int v) { @@ -4167,7 +4167,7 @@ void Scene4300::stripCallback(int v) { } void Scene4300::remove() { - _globals->_scenePalette.clearListeners(); + g_globals->_scenePalette.clearListeners(); Scene::remove(); } @@ -4176,7 +4176,7 @@ void Scene4300::signal() { case 4302: RING_INVENTORY._items._sceneNumber = 1; _hotspot16.remove(); - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; case 4303: RING_INVENTORY._stasisBox2._sceneNumber = 4300; @@ -4195,8 +4195,8 @@ void Scene4300::signal() { _gfxButton.draw(); _gfxButton._bounds.expandPanes(); - _globals->_player.enableControl(); - _globals->_scenePalette.addRotation(240, 254, -1); + g_globals->_player.enableControl(); + g_globals->_scenePalette.addRotation(240, 254, -1); break; } } @@ -4209,7 +4209,7 @@ void Scene4300::dispatch() { void Scene4300::process(Event &event) { Scene::process(event); if (_gfxButton.process(event)) - _globals->_sceneManager.changeScene(4250); + g_globals->_sceneManager.changeScene(4250); } /*-------------------------------------------------------------------------- @@ -4225,8 +4225,8 @@ void Scene4301::Action1::synchronize(Serializer &s) { } void Scene4301::Action1::remove() { - Scene4301 *scene = (Scene4301 *)_globals->_sceneManager._scene; - _globals->_player.enableControl(); + Scene4301 *scene = (Scene4301 *)g_globals->_sceneManager._scene; + g_globals->_player.enableControl(); for (_state = 0; _state < 6; ++_state) _buttonList[_state].remove(); @@ -4239,7 +4239,7 @@ void Scene4301::Action1::remove() { } void Scene4301::Action1::signal() { - Scene4301 *scene = (Scene4301 *)_globals->_sceneManager._scene; + Scene4301 *scene = (Scene4301 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -4247,8 +4247,8 @@ void Scene4301::Action1::signal() { scene->_hotspot1.animate(ANIM_MODE_5, this); break; case 1: - _globals->_soundHandler.play(335); - _globals->_events.setCursor(CURSOR_USE); + g_globals->_soundHandler.play(335); + g_globals->_events.setCursor(CURSOR_USE); scene->_hotspot2.postInit(); scene->_hotspot2.setVisage(4303); @@ -4271,7 +4271,7 @@ void Scene4301::Action1::signal() { break; case 10: // Puzzle: Wrong code - _globals->_events.setCursor(CURSOR_NONE); + g_globals->_events.setCursor(CURSOR_NONE); scene->_soundHandler.play(337); if (scene->_hotspot3._flags & OBJFLAG_HIDE) scene->_hotspot3.show(); @@ -4292,11 +4292,11 @@ void Scene4301::Action1::signal() { _actionIndex = 2; _state = 0; - _globals->_events.setCursor(CURSOR_USE); + g_globals->_events.setCursor(CURSOR_USE); break; case 20: // Puzzle: Correct code - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_soundHandler.play(339); scene->_hotspot3._frame = 3; if (scene->_hotspot3._flags & OBJFLAG_HIDE) @@ -4319,7 +4319,7 @@ void Scene4301::Action1::signal() { void Scene4301::Action1::process(Event &event) { // Puzzle - Scene4301 *scene = (Scene4301 *)_globals->_sceneManager._scene; + Scene4301 *scene = (Scene4301 *)g_globals->_sceneManager._scene; Rect buttonsRect; Action::process(event); @@ -4374,10 +4374,10 @@ void Scene4301::Action1::process(Event &event) { void Scene4301::Hotspot4::doAction(int action) { // Hatch near door - Scene4301 *scene = (Scene4301 *)_globals->_sceneManager._scene; + Scene4301 *scene = (Scene4301 *)g_globals->_sceneManager._scene; if (action == CURSOR_USE) { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->setAction(&scene->_action1); } else { NamedHotspot::doAction(action); @@ -4407,7 +4407,7 @@ void Scene4301::Hotspot5::doAction(int action) { /*--------------------------------------------------------------------------*/ void Scene4301::postInit(SceneObjectList *OwnerList) { - _globals->setFlag(50); + g_globals->setFlag(50); loadScene(4301); Scene::postInit(); setZoomPercents(0, 100, 200, 100); @@ -4424,9 +4424,9 @@ void Scene4301::postInit(SceneObjectList *OwnerList) { _hotspot1.fixPriority(250); _hotspot5.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); - _globals->_sceneItems.push_back(&_hotspot5); + g_globals->_sceneItems.push_back(&_hotspot5); - _globals->_player.enableControl(); + g_globals->_player.enableControl(); } void Scene4301::dispatch() { @@ -4434,9 +4434,9 @@ void Scene4301::dispatch() { _action->dispatch(); } else if (_field68E) { _field68E = 0; - _globals->clearFlag(50); - _globals->_sceneManager._fadeMode = FADEMODE_NONE; - _globals->_sceneManager.setNewScene(4300); + g_globals->clearFlag(50); + g_globals->_sceneManager._fadeMode = FADEMODE_NONE; + g_globals->_sceneManager.setNewScene(4300); } } diff --git a/engines/tsage/ringworld/ringworld_scenes6.cpp b/engines/tsage/ringworld/ringworld_scenes6.cpp index f21ae59478..cd3415f511 100644 --- a/engines/tsage/ringworld/ringworld_scenes6.cpp +++ b/engines/tsage/ringworld/ringworld_scenes6.cpp @@ -36,7 +36,7 @@ namespace Ringworld { void Scene5000::Action1::signal() { // Ship landing - Scene5000 *scene = (Scene5000 *)_globals->_sceneManager._scene; + Scene5000 *scene = (Scene5000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -88,7 +88,7 @@ void Scene5000::Action1::signal() { } void Scene5000::Action1::dispatch() { - Scene5000 *scene = (Scene5000 *)_globals->_sceneManager._scene; + Scene5000 *scene = (Scene5000 *)g_globals->_sceneManager._scene; Action::dispatch(); if (_actionIndex == 3) { @@ -112,83 +112,83 @@ void Scene5000::Action1::dispatch() { } void Scene5000::Action2::signal() { - Scene5000 *scene = (Scene5000 *)_globals->_sceneManager._scene; + Scene5000 *scene = (Scene5000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.setPosition(Common::Point(217, 76)); + g_globals->_player.setPosition(Common::Point(217, 76)); setDelay(10); break; case 1: - _globals->_player.setStrip2(3); - _globals->_player.animate(ANIM_MODE_1, NULL); - ADD_MOVER(_globals->_player, 214, 89); + g_globals->_player.setStrip2(3); + g_globals->_player.animate(ANIM_MODE_1, NULL); + ADD_MOVER(g_globals->_player, 214, 89); break; case 2: - if (!_globals->getFlag(59)) + if (!g_globals->getFlag(59)) setAction(&scene->_action3, this); - _globals->_player.fixPriority(15); - ADD_MOVER(_globals->_player, 208, 100); + g_globals->_player.fixPriority(15); + ADD_MOVER(g_globals->_player, 208, 100); break; case 3: - ADD_MOVER(_globals->_player, 213, 98); + ADD_MOVER(g_globals->_player, 213, 98); break; case 4: - _globals->_player.fixPriority(20); - ADD_MOVER(_globals->_player, 215, 115); + g_globals->_player.fixPriority(20); + ADD_MOVER(g_globals->_player, 215, 115); break; case 5: - _globals->_player.changeZoom(47); - ADD_MOVER(_globals->_player, 220, 125); + g_globals->_player.changeZoom(47); + ADD_MOVER(g_globals->_player, 220, 125); break; case 6: - ADD_MOVER(_globals->_player, 229, 115); + ADD_MOVER(g_globals->_player, 229, 115); break; case 7: - _globals->_player.changeZoom(-1); - _globals->_player.fixPriority(35); - ADD_MOVER(_globals->_player, 201, 166); + g_globals->_player.changeZoom(-1); + g_globals->_player.fixPriority(35); + ADD_MOVER(g_globals->_player, 201, 166); break; case 8: - _globals->_player.updateZoom(); - ADD_MOVER(_globals->_player, 205, 146); + g_globals->_player.updateZoom(); + ADD_MOVER(g_globals->_player, 205, 146); break; case 9: - _globals->_player.changeZoom(-1); - _globals->_player.fixPriority(50); - ADD_MOVER(_globals->_player, 220, 182); + g_globals->_player.changeZoom(-1); + g_globals->_player.fixPriority(50); + ADD_MOVER(g_globals->_player, 220, 182); break; case 10: - _globals->_player.updateZoom(); - ADD_MOVER(_globals->_player, 208, 163); + g_globals->_player.updateZoom(); + ADD_MOVER(g_globals->_player, 208, 163); break; case 11: - _globals->_player.changeZoom(-1); - _globals->_player.setStrip2(-1); - _globals->_player.fixPriority(-1); - ADD_MOVER(_globals->_player, 208, 175); + g_globals->_player.changeZoom(-1); + g_globals->_player.setStrip2(-1); + g_globals->_player.fixPriority(-1); + ADD_MOVER(g_globals->_player, 208, 175); break; case 12: - _globals->_player.setStrip(8); - _globals->_player.setFrame(1); + g_globals->_player.setStrip(8); + g_globals->_player.setFrame(1); setDelay(10); break; case 13: - if (!_globals->_sceneObjects->contains(&scene->_hotspot7)) + if (!g_globals->_sceneObjects->contains(&scene->_hotspot7)) setDelay(10); break; case 14: setDelay(30); break; case 15: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; } } void Scene5000::Action3::signal() { - Scene5000 *scene = (Scene5000 *)_globals->_sceneManager._scene; + Scene5000 *scene = (Scene5000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -206,7 +206,7 @@ void Scene5000::Action3::signal() { scene->_hotspot7.animate(ANIM_MODE_1, NULL); ADD_MOVER(scene->_hotspot7, 214, 89); - _globals->_sceneItems.push_front(&scene->_hotspot7); + g_globals->_sceneItems.push_front(&scene->_hotspot7); break; case 2: scene->_hotspot7.changeZoom(-1); @@ -262,116 +262,116 @@ void Scene5000::Action3::signal() { } void Scene5000::Action4::signal() { - Scene5000 *scene = (Scene5000 *)_globals->_sceneManager._scene; + Scene5000 *scene = (Scene5000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: setDelay(1); break; case 1: - _globals->_player.fixPriority(50); - _globals->_player.setStrip2(4); - ADD_MOVER(_globals->_player, 210, 182); + g_globals->_player.fixPriority(50); + g_globals->_player.setStrip2(4); + ADD_MOVER(g_globals->_player, 210, 182); break; case 2: - ADD_MOVER(_globals->_player, 205, 146); + ADD_MOVER(g_globals->_player, 205, 146); break; case 3: - _globals->_player.fixPriority(35); - ADD_MOVER(_globals->_player, 201, 166); + g_globals->_player.fixPriority(35); + ADD_MOVER(g_globals->_player, 201, 166); break; case 4: - ADD_MOVER(_globals->_player, 229, 115); + ADD_MOVER(g_globals->_player, 229, 115); break; case 5: - _globals->_player.fixPriority(20); - _globals->_player.changeZoom(47); - ADD_MOVER(_globals->_player, 220, 125); + g_globals->_player.fixPriority(20); + g_globals->_player.changeZoom(47); + ADD_MOVER(g_globals->_player, 220, 125); break; case 6: - ADD_MOVER(_globals->_player, 215, 115); + ADD_MOVER(g_globals->_player, 215, 115); break; case 7: - _globals->_player.changeZoom(-1); - ADD_MOVER(_globals->_player, 213, 98); + g_globals->_player.changeZoom(-1); + ADD_MOVER(g_globals->_player, 213, 98); break; case 8: - _globals->_player.fixPriority(15); - ADD_MOVER(_globals->_player, 208, 100); + g_globals->_player.fixPriority(15); + ADD_MOVER(g_globals->_player, 208, 100); break; case 9: - ADD_MOVER(_globals->_player, 214, 89); + ADD_MOVER(g_globals->_player, 214, 89); break; case 10: - ADD_MOVER(_globals->_player, 217, 76); + ADD_MOVER(g_globals->_player, 217, 76); break; case 11: - _globals->_player.hide(); + g_globals->_player.hide(); setDelay(60); break; case 12: - if (!_globals->_sceneObjects->contains(&scene->_hotspot7)) - _globals->_sceneManager.changeScene(2320); + if (!g_globals->_sceneObjects->contains(&scene->_hotspot7)) + g_globals->_sceneManager.changeScene(2320); remove(); break; } } void Scene5000::Action5::signal() { - Scene5000 *scene = (Scene5000 *)_globals->_sceneManager._scene; + Scene5000 *scene = (Scene5000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); - ADD_MOVER(_globals->_player, 91, 155); + g_globals->_player.disableControl(); + ADD_MOVER(g_globals->_player, 91, 155); break; case 1: - _globals->_player.setVisage(2670); - _globals->_player._strip = 4; - _globals->_player._frame = 1; - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.setVisage(2670); + g_globals->_player._strip = 4; + g_globals->_player._frame = 1; + g_globals->_player.animate(ANIM_MODE_5, this); break; case 2: - SceneItem::display2(5000, _globals->_sceneObjects->contains(&scene->_hotspot7) ? 17 : 13); - _globals->_player.animate(ANIM_MODE_6, this); + SceneItem::display2(5000, g_globals->_sceneObjects->contains(&scene->_hotspot7) ? 17 : 13); + g_globals->_player.animate(ANIM_MODE_6, this); break; case 3: - _globals->_player.setVisage(0); - _globals->_player._strip = 8; - _globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setVisage(0); + g_globals->_player._strip = 8; + g_globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); } } void Scene5000::Action6::signal() { // Discussion between the hero and Seeker, then the hero goes back to the lander - Scene5000 *scene = (Scene5000 *)_globals->_sceneManager._scene; + Scene5000 *scene = (Scene5000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(3); break; case 1: - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_events.setCursor(CURSOR_WALK); scene->_stripManager.start(2150, this); break; case 2: - _globals->_events.setCursor(CURSOR_NONE); + g_globals->_events.setCursor(CURSOR_NONE); scene->setAction(&scene->_sequenceManager, this, 5001, &scene->_hotspot7, NULL); break; case 3: ADD_PLAYER_MOVER(208, 163); break; case 4: - _globals->_player.fixPriority(50); - _globals->_player.setStrip2(4); - ADD_MOVER(_globals->_player, 210, 182); + g_globals->_player.fixPriority(50); + g_globals->_player.setStrip2(4); + ADD_MOVER(g_globals->_player, 210, 182); break; case 5: - _globals->_sceneManager.changeScene(2100); + g_globals->_sceneManager.changeScene(2100); break; } } @@ -379,7 +379,7 @@ void Scene5000::Action6::signal() { /*--------------------------------------------------------------------------*/ void Scene5000::Hotspot7::doAction(int action) { - Scene5000 *scene = (Scene5000 *)_globals->_sceneManager._scene; + Scene5000 *scene = (Scene5000 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -396,7 +396,7 @@ void Scene5000::Hotspot7::doAction(int action) { void Scene5000::Hotspot8::doAction(int action) { // Cave - Scene5000 *scene = (Scene5000 *)_globals->_sceneManager._scene; + Scene5000 *scene = (Scene5000 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -415,9 +415,9 @@ void Scene5000::Hotspot8::doAction(int action) { } void Scene5000::HotspotGroup1::doAction(int action) { - Scene5000 *scene = (Scene5000 *)_globals->_sceneManager._scene; + Scene5000 *scene = (Scene5000 *)g_globals->_sceneManager._scene; - if (_globals->_sceneObjects->contains(&scene->_hotspot7)) + if (g_globals->_sceneObjects->contains(&scene->_hotspot7)) scene->setAction(&scene->_action6); else SceneItem::display2(5000, 11); @@ -446,13 +446,13 @@ void Scene5000::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_speakerSText); _stripManager.addSpeaker(&_speakerQText); - _globals->_player.postInit(); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.setVisage(0); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player._moveDiff = Common::Point(4, 2); - _globals->_player.changeZoom(-1); - _globals->_player.disableControl(); + g_globals->_player.postInit(); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.setVisage(0); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player._moveDiff = Common::Point(4, 2); + g_globals->_player.changeZoom(-1); + g_globals->_player.disableControl(); _hotspot1.postInit(); _hotspot1.setVisage(5001); @@ -518,14 +518,14 @@ void Scene5000::postInit(SceneObjectList *OwnerList) { _hotspot16.setBounds(Rect(0, 86, 319, 200)); _hotspot12.setBounds(Rect(230, 143, 244, 150)); - _globals->_sceneItems.addItems(&_hotspot9, &_hotspot10, &_hotspot11, &_hotspot8, &_hotspot13, + g_globals->_sceneItems.addItems(&_hotspot9, &_hotspot10, &_hotspot11, &_hotspot8, &_hotspot13, &_hotspot14, &_hotspot12, &_hotspot15, &_hotspot17, &_hotspot18, &_hotspot16, NULL); - switch (_globals->_sceneManager._previousScene) { + switch (g_globals->_sceneManager._previousScene) { case 1000: case 2100: case 2320: - if (_globals->getFlag(59)) { + if (g_globals->getFlag(59)) { _hotspot1.setPosition(Common::Point(233, 90)); _hotspot1.changeZoom(100); _hotspot1.show(); @@ -535,21 +535,21 @@ void Scene5000::postInit(SceneObjectList *OwnerList) { _hotspot5.setPosition(Common::Point(218, 76)); _hotspot5.show(); - _globals->_player.setPosition(Common::Point(217, -10)); - _globals->_player.disableControl(); + g_globals->_player.setPosition(Common::Point(217, -10)); + g_globals->_player.disableControl(); setAction(&_action2); } else { - _globals->_player.setPosition(Common::Point(217, -10)); + g_globals->_player.setPosition(Common::Point(217, -10)); _hotspot1.setPosition(Common::Point(320, -10)); - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setAction(&_action1); } break; default: - _globals->_player.disableControl(); - _globals->_player.setPosition(Common::Point(0, 146)); + g_globals->_player.disableControl(); + g_globals->_player.setPosition(Common::Point(0, 146)); _hotspot1.changeZoom(100); _hotspot1.setPosition(Common::Point(233, 90)); @@ -559,11 +559,11 @@ void Scene5000::postInit(SceneObjectList *OwnerList) { _hotspot5.show(); _sceneMode = 5004; - setAction(&_sequenceManager, this, 5004, &_globals->_player, NULL); + setAction(&_sequenceManager, this, 5004, &g_globals->_player, NULL); break; } - _globals->_soundHandler.play(190); + g_globals->_soundHandler.play(190); } void Scene5000::signal() { @@ -571,10 +571,10 @@ void Scene5000::signal() { case 5002: case 5003: case 5004: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; case 5005: - _globals->_sceneManager.changeScene(5100); + g_globals->_sceneManager.changeScene(5100); break; } } @@ -583,29 +583,29 @@ void Scene5000::dispatch() { Scene::dispatch(); if (!_action) { - if (!_globals->_sceneObjects->contains(&_hotspot7) && (_globals->_player.getRegionIndex() == 10)) { - _globals->_player.disableControl(); + if (!g_globals->_sceneObjects->contains(&_hotspot7) && (g_globals->_player.getRegionIndex() == 10)) { + g_globals->_player.disableControl(); _sceneMode = 5005; - setAction(&_sequenceManager, this, 5005, &_globals->_player, NULL); + setAction(&_sequenceManager, this, 5005, &g_globals->_player, NULL); } - if (_globals->_player.getRegionIndex() == 8) { - _globals->_player.disableControl(); + if (g_globals->_player.getRegionIndex() == 8) { + g_globals->_player.disableControl(); - if (_globals->_sceneObjects->contains(&_hotspot7)) { + if (g_globals->_sceneObjects->contains(&_hotspot7)) { _sceneMode = 5003; - _globals->_player.addMover(NULL); - setAction(&_sequenceManager, this, 5003, &_globals->_player, NULL); + g_globals->_player.addMover(NULL); + setAction(&_sequenceManager, this, 5003, &g_globals->_player, NULL); } else { setAction(&_action4); } } - if (_globals->_sceneObjects->contains(&_hotspot7) && (_globals->_player.getRegionIndex() == 15)) { + if (g_globals->_sceneObjects->contains(&_hotspot7) && (g_globals->_player.getRegionIndex() == 15)) { _sceneMode = 5002; - _globals->_player.disableControl(); - _globals->_player.addMover(NULL); - setAction(&_sequenceManager, this, 5002, &_globals->_player, NULL); + g_globals->_player.disableControl(); + g_globals->_player.addMover(NULL); + setAction(&_sequenceManager, this, 5002, &g_globals->_player, NULL); } } } @@ -617,26 +617,26 @@ void Scene5000::dispatch() { void Scene5100::Action1::signal() { // Quinn enters the cave for the first time - Scene5100 *scene = (Scene5100 *)_globals->_sceneManager._scene; + Scene5100 *scene = (Scene5100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: setDelay(5); break; case 1: - ADD_MOVER(_globals->_player, 1111, 165); + ADD_MOVER(g_globals->_player, 1111, 165); break; case 2: - _globals->_player.setStrip(6); - _globals->_player.setFrame(1); + g_globals->_player.setStrip(6); + g_globals->_player.setFrame(1); setDelay(60); break; case 3: - if (_globals->getFlag(10)) { - _globals->_player.enableControl(); + if (g_globals->getFlag(10)) { + g_globals->_player.enableControl(); remove(); } else { - _globals->setFlag(10); + g_globals->setFlag(10); scene->_stripManager.start(5102, this); } break; @@ -650,7 +650,7 @@ void Scene5100::Action1::signal() { scene->_hotspot5.animate(ANIM_MODE_1, NULL); scene->_hotspot5.fixPriority(10); - _globals->_sceneItems.push_front(&scene->_hotspot5); + g_globals->_sceneItems.push_front(&scene->_hotspot5); ADD_MOVER(scene->_hotspot5, 999, 14); break; case 5: @@ -659,7 +659,7 @@ void Scene5100::Action1::signal() { scene->_hotspot5.animate(ANIM_MODE_5, this); break; case 6: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; } @@ -667,11 +667,11 @@ void Scene5100::Action1::signal() { void Scene5100::Action2::signal() { // Quinn and Seeker exit the cave - Scene5100 *scene = (Scene5100 *)_globals->_sceneManager._scene; + Scene5100 *scene = (Scene5100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(5); break; case 1: @@ -693,13 +693,13 @@ void Scene5100::Action2::signal() { scene->_stripManager.start(5129, this); break; case 3: - if (_globals->_player._position.x >= 966) { + if (g_globals->_player._position.x >= 966) { ADD_PLAYER_MOVER_NULL(scene->_hotspot8, 1215, 155); } else { ADD_PLAYER_MOVER_NULL(scene->_hotspot8, 966, 185); } - if (_globals->_player._position.x >= 966) { + if (g_globals->_player._position.x >= 966) { setDelay(1); } else { ADD_PLAYER_MOVER(966, 190); @@ -710,40 +710,40 @@ void Scene5100::Action2::signal() { ADD_PLAYER_MOVER(1215, 155); break; case 5: - _globals->_sceneManager.changeScene(2100); + g_globals->_sceneManager.changeScene(2100); break; } } void Scene5100::Action3::signal() { // Quinns shots flesheater - Scene5100 *scene = (Scene5100 *)_globals->_sceneManager._scene; + Scene5100 *scene = (Scene5100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->setFlag(62); - _globals->_player.disableControl(); - _globals->_player.addMover(NULL); + g_globals->setFlag(62); + g_globals->_player.disableControl(); + g_globals->_player.addMover(NULL); scene->_hotspot2.addMover(NULL); scene->_hotspot3.addMover(NULL); - _globals->_player.setVisage(2672); + g_globals->_player.setVisage(2672); - if (static_cast<SceneObject *>(_owner)->_position.x >= _globals->_player._position.x) - _globals->_player._strip = 4; + if (static_cast<SceneObject *>(_owner)->_position.x >= g_globals->_player._position.x) + g_globals->_player._strip = 4; else - _globals->_player._strip = 3; - _globals->_player._frame = 1; - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player._strip = 3; + g_globals->_player._frame = 1; + g_globals->_player.animate(ANIM_MODE_5, this); break; case 1: - _globals->_player.setVisage(2674); - _globals->_player.setFrame(1); - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.setVisage(2674); + g_globals->_player.setFrame(1); + g_globals->_player.animate(ANIM_MODE_5, this); break; case 2: scene->_soundHandler.play(28); - if (static_cast<SceneObject *>(_owner)->_position.x < _globals->_player._position.x) { + if (static_cast<SceneObject *>(_owner)->_position.x < g_globals->_player._position.x) { scene->_hotspot2.setVisage(5130); scene->_hotspot2._strip = 1; scene->_hotspot2._frame = 1; @@ -764,35 +764,35 @@ void Scene5100::Action3::signal() { } - _globals->_player.setVisage(2672); - _globals->_player._frame = _globals->_player.getFrameCount(); - _globals->_player.animate(ANIM_MODE_6, this); + g_globals->_player.setVisage(2672); + g_globals->_player._frame = g_globals->_player.getFrameCount(); + g_globals->_player.animate(ANIM_MODE_6, this); break; case 3: break; case 4: SceneItem::display2(5100, 38); - _globals->_player.enableControl(); + g_globals->_player.enableControl(); - _globals->_player.setVisage(0); - _globals->_player._strip = 8; - _globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setVisage(0); + g_globals->_player._strip = 8; + g_globals->_player.animate(ANIM_MODE_1, NULL); remove(); break; } } void Scene5100::Action4::signal() { - Scene5100 *scene = (Scene5100 *)_globals->_sceneManager._scene; + Scene5100 *scene = (Scene5100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_soundHandler.play(208); SceneItem::display2(5100, 15); ObjectMover3 *mover = new ObjectMover3(); - scene->_hotspot2.addMover(mover, &_globals->_player, 20, this); + scene->_hotspot2.addMover(mover, &g_globals->_player, 20, this); break; } case 1: @@ -806,18 +806,18 @@ void Scene5100::Action4::signal() { setDelay(15); break; case 3: - _globals->_sceneManager.changeScene(5200); + g_globals->_sceneManager.changeScene(5200); break; } } void Scene5100::Action5::signal() { // Quinns forgot the statis box in the throne room, and goes back - Scene5100 *scene = (Scene5100 *)_globals->_sceneManager._scene; + Scene5100 *scene = (Scene5100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(60); break; case 1: @@ -828,7 +828,7 @@ void Scene5100::Action5::signal() { break; case 3: scene->_sceneMode = 5106; - scene->setAction(&scene->_sequenceManager, scene, 5106, &_globals->_player, &scene->_hotspot14, NULL); + scene->setAction(&scene->_sequenceManager, scene, 5106, &g_globals->_player, &scene->_hotspot14, NULL); break; } } @@ -837,11 +837,11 @@ void Scene5100::Action5::signal() { void Scene5100::HotspotGroup1::doAction(int action) { // Flesh Eaters - Scene5100 *scene = (Scene5100 *)_globals->_sceneManager._scene; + Scene5100 *scene = (Scene5100 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: - SceneItem::display2(5100, _globals->getFlag(62) ? 41 : 26); + SceneItem::display2(5100, g_globals->getFlag(62) ? 41 : 26); break; case CURSOR_USE: SceneItem::display2(5100, 11); @@ -850,7 +850,7 @@ void Scene5100::HotspotGroup1::doAction(int action) { SceneItem::display2(5100, 17); break; case OBJECT_STUNNER: - if (_globals->getFlag(62)) + if (g_globals->getFlag(62)) SceneItem::display2(5100, 42); else setAction(&scene->_action3); @@ -862,16 +862,16 @@ void Scene5100::HotspotGroup1::doAction(int action) { } void Scene5100::Hotspot4::doAction(int action) { - Scene5100 *scene = (Scene5100 *)_globals->_sceneManager._scene; + Scene5100 *scene = (Scene5100 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(5100, 31); break; case CURSOR_USE: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 5110; - scene->setAction(&scene->_sequenceManager, scene, 5110, &_globals->_player, this, &scene->_hotspot7, NULL); + scene->setAction(&scene->_sequenceManager, scene, 5110, &g_globals->_player, this, &scene->_hotspot7, NULL); break; case CURSOR_TALK: SceneItem::display2(5100, 34); @@ -890,11 +890,11 @@ void Scene5100::Hotspot4::doAction(int action) { void Scene5100::HotspotGroup2::doAction(int action) { // Bat - Scene5100 *scene = (Scene5100 *)_globals->_sceneManager._scene; + Scene5100 *scene = (Scene5100 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: - SceneItem::display2(5100, _globals->getFlag(108) ? 47 : 23); + SceneItem::display2(5100, g_globals->getFlag(108) ? 47 : 23); break; case CURSOR_USE: SceneItem::display2(5100, 29); @@ -903,7 +903,7 @@ void Scene5100::HotspotGroup2::doAction(int action) { if (_position.x >= 600) SceneItem::display2(5100, 28); else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 5114; scene->setAction(&scene->_sequenceManager, scene, 5114, NULL); } @@ -919,16 +919,16 @@ void Scene5100::HotspotGroup2::doAction(int action) { void Scene5100::Hotspot9::doAction(int action) { // Rope - Scene5100 *scene = (Scene5100 *)_globals->_sceneManager._scene; + Scene5100 *scene = (Scene5100 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(5100, 32); break; case CURSOR_USE: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 5117; - scene->setAction(&scene->_sequenceManager, scene, 5117, &_globals->_player, NULL); + scene->setAction(&scene->_sequenceManager, scene, 5117, &g_globals->_player, NULL); break; case OBJECT_STUNNER: SceneItem::display2(5100, 35); @@ -937,9 +937,9 @@ void Scene5100::Hotspot9::doAction(int action) { SceneItem::display2(5100, 44); break; case OBJECT_BONE: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 5116; - scene->setAction(&scene->_sequenceManager, scene, 5116, &_globals->_player, this, &scene->_hotspot10, + scene->setAction(&scene->_sequenceManager, scene, 5116, &g_globals->_player, this, &scene->_hotspot10, &scene->_hotspot4, NULL); break; default: @@ -950,19 +950,19 @@ void Scene5100::Hotspot9::doAction(int action) { void Scene5100::Hotspot17::doAction(int action) { // Rock blocking pit entrance - Scene5100 *scene = (Scene5100 *)_globals->_sceneManager._scene; + Scene5100 *scene = (Scene5100 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(5100, 18); break; case CURSOR_USE: - if (_globals->getFlag(67)) + if (g_globals->getFlag(67)) SceneItem::display2(5100, 19); else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 5101; - scene->setAction(&scene->_sequenceManager, scene, 5101, &_globals->_player, this, NULL); + scene->setAction(&scene->_sequenceManager, scene, 5101, &g_globals->_player, this, NULL); } break; default: @@ -974,7 +974,7 @@ void Scene5100::Hotspot17::doAction(int action) { void Scene5100::Hotspot18::doAction(int action) { switch (action) { case CURSOR_LOOK: - if (_globals->_sceneManager._previousScene != 5000) { + if (g_globals->_sceneManager._previousScene != 5000) { SceneItem::display2(5100, 3); } else { switch (_index1) { @@ -1016,21 +1016,21 @@ void Scene5100::Hotspot18::doAction(int action) { void Scene5100::Hotspot19::doAction(int action) { // Pillar - Scene5100 *scene = (Scene5100 *)_globals->_sceneManager._scene; + Scene5100 *scene = (Scene5100 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: - SceneItem::display2(5100, _globals->_sceneObjects->contains(&scene->_hotspot14) ? 27 : 20); + SceneItem::display2(5100, g_globals->_sceneObjects->contains(&scene->_hotspot14) ? 27 : 20); break; case CURSOR_USE: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 5106; - if (_globals->getFlag(66)) - scene->setAction(&scene->_sequenceManager, scene, 5113, &_globals->_player, NULL); + if (g_globals->getFlag(66)) + scene->setAction(&scene->_sequenceManager, scene, 5113, &g_globals->_player, NULL); else { - _globals->setFlag(66); - scene->setAction(&scene->_sequenceManager, scene, 5106, &_globals->_player, &scene->_hotspot14, NULL); + g_globals->setFlag(66); + scene->setAction(&scene->_sequenceManager, scene, 5106, &g_globals->_player, &scene->_hotspot14, NULL); } break; default: @@ -1040,21 +1040,21 @@ void Scene5100::Hotspot19::doAction(int action) { } void Scene5100::Hotspot20::doAction(int action) { - Scene5100 *scene = (Scene5100 *)_globals->_sceneManager._scene; + Scene5100 *scene = (Scene5100 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(5100, 21); break; case CURSOR_USE: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); - if (_globals->getFlag(67)) { + if (g_globals->getFlag(67)) { scene->_sceneMode = 5112; - scene->setAction(&scene->_sequenceManager, scene, 5112, &_globals->_player, NULL); + scene->setAction(&scene->_sequenceManager, scene, 5112, &g_globals->_player, NULL); } else { scene->_sceneMode = 5101; - scene->setAction(&scene->_sequenceManager, scene, 5106, &_globals->_player, &scene->_hotspot17, NULL); + scene->setAction(&scene->_sequenceManager, scene, 5106, &g_globals->_player, &scene->_hotspot17, NULL); } break; default: @@ -1080,17 +1080,17 @@ void Scene5100::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_speakerSText); _stripManager.addSpeaker(&_speakerGameText); _stripManager.addSpeaker(&_speakerBatText); - _speakerQText._npc = &_globals->_player; - _speakerMText._npc = &_globals->_player; + _speakerQText._npc = &g_globals->_player; + _speakerMText._npc = &g_globals->_player; _speakerSText._npc = &_hotspot8; - _globals->_player.postInit(); - _globals->_player.setVisage(0); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.disableControl(); + g_globals->_player.postInit(); + g_globals->_player.setVisage(0); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.disableControl(); - if ((!_globals->getFlag(66)) || (RING_INVENTORY._stasisBox._sceneNumber != 1)) { + if ((!g_globals->getFlag(66)) || (RING_INVENTORY._stasisBox._sceneNumber != 1)) { _hotspot14.postInit(); _hotspot14.setVisage(5101); _hotspot14.setPosition(Common::Point(498, 147)); @@ -1103,7 +1103,7 @@ void Scene5100::postInit(SceneObjectList *OwnerList) { _hotspot17._strip = 2; _hotspot17.fixPriority(200); - if (_globals->getFlag(67)) + if (g_globals->getFlag(67)) _hotspot17.setPosition(Common::Point(554, 192)); else _hotspot17.setPosition(Common::Point(539, 179)); @@ -1111,26 +1111,26 @@ void Scene5100::postInit(SceneObjectList *OwnerList) { _hotspot19.setBounds(Rect(488, 115, 508, 148)); _hotspot21.setBounds(Rect(1150, 85, 1173, 112)); _hotspot20.setBounds(Rect(517, 193, 562, 200)); - _globals->_sceneItems.addItems(&_hotspot19, &_hotspot21, NULL); + g_globals->_sceneItems.addItems(&_hotspot19, &_hotspot21, NULL); - if (_globals->getFlag(67)) { - _globals->_sceneItems.addItems(&_hotspot20, &_hotspot17, NULL); + if (g_globals->getFlag(67)) { + g_globals->_sceneItems.addItems(&_hotspot20, &_hotspot17, NULL); } else { - _globals->_sceneItems.addItems(&_hotspot17, &_hotspot20, NULL); + g_globals->_sceneItems.addItems(&_hotspot17, &_hotspot20, NULL); } - if (!_globals->getFlag(105)) { + if (!g_globals->getFlag(105)) { _hotspot4.postInit(); _hotspot4.setVisage(5363); _hotspot4.setPosition(Common::Point(1025, 65)); _hotspot4.setStrip(4); _hotspot4.animate(ANIM_MODE_7, 0, NULL);; - _globals->_sceneItems.push_back(&_hotspot4); + g_globals->_sceneItems.push_back(&_hotspot4); _hotspot9.postInit(); _hotspot9.setVisage(5363); _hotspot9.setPosition(Common::Point(966, 120)); - _globals->_sceneItems.push_back(&_hotspot9); + g_globals->_sceneItems.push_back(&_hotspot9); _hotspot10.postInit(); _hotspot10.setVisage(5363); @@ -1142,26 +1142,26 @@ void Scene5100::postInit(SceneObjectList *OwnerList) { _hotspot6.setPosition(Common::Point(1017, 34)); _hotspot6._strip = 4; _hotspot6._frame = _hotspot6.getFrameCount(); - _globals->_sceneItems.push_back(&_hotspot6); + g_globals->_sceneItems.push_back(&_hotspot6); } _hotspot16._sceneRegionId = 15; - _globals->_sceneItems.push_back(&_hotspot16); + g_globals->_sceneItems.push_back(&_hotspot16); - if (!_globals->getFlag(62)) { + if (!g_globals->getFlag(62)) { _hotspot2.postInit(); _hotspot2.setVisage(5110); _hotspot2.animate(ANIM_MODE_1, NULL); _hotspot2._moveDiff.x = 4; - _globals->_sceneItems.push_back(&_hotspot2); + g_globals->_sceneItems.push_back(&_hotspot2); _hotspot3.postInit(); _hotspot3.setVisage(5110); _hotspot3.animate(ANIM_MODE_1, NULL); _hotspot3._moveDiff.x = 4; - _globals->_sceneItems.push_back(&_hotspot3); + g_globals->_sceneItems.push_back(&_hotspot3); - if (_globals->getFlag(61)) { + if (g_globals->getFlag(61)) { _hotspot2.setPosition(Common::Point(483, 189)); _hotspot3.setPosition(Common::Point(811, 182)); } else { @@ -1170,35 +1170,35 @@ void Scene5100::postInit(SceneObjectList *OwnerList) { } } - if (_globals->getFlag(60) && (RING_INVENTORY._stasisBox._sceneNumber == 1) && - _globals->getFlag(107) && _globals->getFlag(67)) { + if (g_globals->getFlag(60) && (RING_INVENTORY._stasisBox._sceneNumber == 1) && + g_globals->getFlag(107) && g_globals->getFlag(67)) { _hotspot8.postInit(); _hotspot8.setVisage(2806); _hotspot8.setPosition(Common::Point(557, 178)); _hotspot8.animate(ANIM_MODE_1, NULL); _hotspot8.setObjectWrapper(new SceneObjectWrapper()); - _globals->clearFlag(59); + g_globals->clearFlag(59); } - switch (_globals->_sceneManager._previousScene) { + switch (g_globals->_sceneManager._previousScene) { case 5000: default: - _globals->_player.setPosition(Common::Point(1184, 160)); + g_globals->_player.setPosition(Common::Point(1184, 160)); setAction(&_action1); break; case 5200: - if (_globals->_stripNum == 5200) { - _globals->_player.setVisage(5101); - _globals->_player.fixPriority(200); - _globals->_player.setStrip(5); - _globals->_player.setFrame(1); - _globals->_player.setPosition(Common::Point(513, 199)); + if (g_globals->_stripNum == 5200) { + g_globals->_player.setVisage(5101); + g_globals->_player.fixPriority(200); + g_globals->_player.setStrip(5); + g_globals->_player.setFrame(1); + g_globals->_player.setPosition(Common::Point(513, 199)); _sceneMode = 5108; - setAction(&_sequenceManager, this, 5108, &_globals->_player, NULL); + setAction(&_sequenceManager, this, 5108, &g_globals->_player, NULL); } else { - _globals->_player.setPosition(Common::Point(20, 175)); + g_globals->_player.setPosition(Common::Point(20, 175)); _hotspot13.postInit(); _hotspot13.setVisage(5110); @@ -1213,7 +1213,7 @@ void Scene5100::postInit(SceneObjectList *OwnerList) { _hotspot11.animate(ANIM_MODE_1, NULL); ObjectMover2 *mover = new ObjectMover2(); - _hotspot11.addMover(mover, 15, 20, &_globals->_player); + _hotspot11.addMover(mover, 15, 20, &g_globals->_player); _hotspot12.postInit(); _hotspot12.setVisage(5110); @@ -1223,51 +1223,51 @@ void Scene5100::postInit(SceneObjectList *OwnerList) { _hotspot12.animate(ANIM_MODE_1, NULL); ObjectMover2 *mover2 = new ObjectMover2(); - _hotspot12.addMover(mover2, 25, 50, &_globals->_player); + _hotspot12.addMover(mover2, 25, 50, &g_globals->_player); _hotspot17.setPosition(Common::Point(554, 182)); - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneMode = 5105; - setAction(&_sequenceManager, this, 5105, &_globals->_player, NULL); + setAction(&_sequenceManager, this, 5105, &g_globals->_player, NULL); } break; case 5300: - switch (_globals->_stripNum) { + switch (g_globals->_stripNum) { case 5300: _sceneMode = 5111; - _globals->_player.setVisage(5101); - _globals->_player.setStrip(6); - _globals->_player.fixPriority(170); - _globals->_player.setPosition(Common::Point(1168, 110)); + g_globals->_player.setVisage(5101); + g_globals->_player.setStrip(6); + g_globals->_player.fixPriority(170); + g_globals->_player.setPosition(Common::Point(1168, 110)); - setAction(&_sequenceManager, this, 5111, &_globals->_player, NULL); + setAction(&_sequenceManager, this, 5111, &g_globals->_player, NULL); _hotspot8.setPosition(Common::Point(1107, 178)); break; case 5302: - _globals->_player.setPosition(Common::Point(512, 190)); + g_globals->_player.setPosition(Common::Point(512, 190)); - if (_globals->_sceneObjects->contains(&_hotspot8)) + if (g_globals->_sceneObjects->contains(&_hotspot8)) setAction(&_action2); else - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; case 5303: _hotspot8.setVisage(5102); _hotspot8.setPosition(Common::Point(533, 172)); - _globals->_player.setPosition(Common::Point(512, 190)); + g_globals->_player.setPosition(Common::Point(512, 190)); setAction(&_action2); break; } - if (_globals->getFlag(108)) { + if (g_globals->getFlag(108)) { _hotspot6.postInit(); _hotspot6.setVisage(5362); _hotspot6.setPosition(Common::Point(542, 19)); _hotspot6.setStrip(6); _hotspot6.setFrame(1); - _globals->_sceneItems.push_back(&_hotspot6); + g_globals->_sceneItems.push_back(&_hotspot6); } else if (RING_INVENTORY._vial._sceneNumber != 5100) { _hotspot6.postInit(); _hotspot6.setVisage(5362); @@ -1275,13 +1275,13 @@ void Scene5100::postInit(SceneObjectList *OwnerList) { _hotspot6.fixPriority(170); _hotspot6.setStrip(6); _hotspot6.setFrame(1); - _globals->_sceneItems.push_back(&_hotspot6); + g_globals->_sceneItems.push_back(&_hotspot6); } break; } _hotspot18.setBounds(Rect(0, 0, 1280, 200)); - _globals->_sceneItems.push_back(&_hotspot18); + g_globals->_sceneItems.push_back(&_hotspot18); _hotspot15.postInit(); _hotspot15.setVisage(5140); @@ -1289,41 +1289,41 @@ void Scene5100::postInit(SceneObjectList *OwnerList) { _hotspot15.setPosition(Common::Point(977, 173)); _hotspot15.fixPriority(1); - _globals->_sceneManager._scene->_sceneBounds.center(_globals->_player._position); + g_globals->_sceneManager._scene->_sceneBounds.center(g_globals->_player._position); loadScene(5100); - _globals->_soundHandler.play(205); + g_globals->_soundHandler.play(205); } void Scene5100::signal() { switch (_sceneMode) { case 5101: case 5112: - _globals->setFlag(67); - _globals->_sceneManager.changeScene(5300); + g_globals->setFlag(67); + g_globals->_sceneManager.changeScene(5300); break; case 5102: case 5114: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; case 5103: - if (_globals->getFlag(61)) { + if (g_globals->getFlag(61)) { SceneItem::display2(5100, 46); - _globals->_sceneManager.changeScene(5300); + g_globals->_sceneManager.changeScene(5300); } else { SceneItem::display2(5100, 45); - _globals->_sceneManager.changeScene(5200); + g_globals->_sceneManager.changeScene(5200); } break; case 5105: - _globals->_sceneManager.changeScene(5300); + g_globals->_sceneManager.changeScene(5300); break; case 5106: - _globals->_stripNum = 5111; - _globals->_sceneManager.changeScene(5200); + g_globals->_stripNum = 5111; + g_globals->_sceneManager.changeScene(5200); break; case 5108: - if (!_globals->getFlag(60)) - _globals->_player.enableControl(); + if (!g_globals->getFlag(60)) + g_globals->_player.enableControl(); else if (RING_INVENTORY._stasisBox._sceneNumber == 1) setAction(&_action2); else @@ -1331,78 +1331,78 @@ void Scene5100::signal() { break; case 5110: SceneItem::display2(5100, 30); - _globals->_player._angle = 325; - _globals->_player.enableControl(); + g_globals->_player._angle = 325; + g_globals->_player.enableControl(); break; case 5111: - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.setVisage(0); - _globals->_player.setStrip(6); - _globals->_player.fixPriority(-1); - _globals->_player.animate(ANIM_MODE_1, NULL); - - if ((RING_INVENTORY._vial._sceneNumber != 5100) && !_globals->getFlag(108)) { - _globals->setFlag(108); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.setVisage(0); + g_globals->_player.setStrip(6); + g_globals->_player.fixPriority(-1); + g_globals->_player.animate(ANIM_MODE_1, NULL); + + if ((RING_INVENTORY._vial._sceneNumber != 5100) && !g_globals->getFlag(108)) { + g_globals->setFlag(108); _sceneMode = 5130; - _globals->_player.disableControl(); + g_globals->_player.disableControl(); - _speakerBatText.setTextPos(Common::Point(_globals->_sceneManager._scene->_sceneBounds.left + 20, 30)); - setAction(&_sequenceManager, this, 5130, &_globals->_player, &_hotspot6, NULL); - } else if (_globals->_sceneObjects->contains(&_hotspot8)) { + _speakerBatText.setTextPos(Common::Point(g_globals->_sceneManager._scene->_sceneBounds.left + 20, 30)); + setAction(&_sequenceManager, this, 5130, &g_globals->_player, &_hotspot6, NULL); + } else if (g_globals->_sceneObjects->contains(&_hotspot8)) { setAction(&_action2); } else { - _globals->_player.enableControl(); + g_globals->_player.enableControl(); } break; case 5116: - _globals->setFlag(105); + g_globals->setFlag(105); RING_INVENTORY._bone._sceneNumber = 0; - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.setVisage(0); - _globals->_player.setStrip(6); - _globals->_player.fixPriority(-1); - _globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.setVisage(0); + g_globals->_player.setStrip(6); + g_globals->_player.fixPriority(-1); + g_globals->_player.animate(ANIM_MODE_1, NULL); // No break on purpose case 5117: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; case 5130: _hotspot6.setVisage(5362); _hotspot6.setPosition(Common::Point(542, 25)); _hotspot6.setStrip(6); _hotspot6.setFrame(1); - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; case 5150: - _globals->clearFlag(60); - _globals->_sceneManager.changeScene(5300); + g_globals->clearFlag(60); + g_globals->_sceneManager.changeScene(5300); break; } } void Scene5100::dispatch() { // Flesheater trap - if (_hotspot15._bounds.contains(_globals->_player._position) && !_globals->_player._visage) { - _globals->_player.disableControl(); - _globals->_player.addMover(NULL); + if (_hotspot15._bounds.contains(g_globals->_player._position) && !g_globals->_player._visage) { + g_globals->_player.disableControl(); + g_globals->_player.addMover(NULL); _soundHandler.play(207); _sceneMode = 5103; - setAction(&_sequenceManager, this, (_globals->_player._position.x >= 966) ? 5104 : 5103, - &_globals->_player, &_hotspot15, NULL); + setAction(&_sequenceManager, this, (g_globals->_player._position.x >= 966) ? 5104 : 5103, + &g_globals->_player, &_hotspot15, NULL); } - if (_globals->getFlag(61) && !_globals->getFlag(62) && - ((_globals->_player._position.x - _hotspot2._position.x) < 160) && - (_globals->_sceneManager._previousScene != 5200) && (_sceneMode != 5150)) { + if (g_globals->getFlag(61) && !g_globals->getFlag(62) && + ((g_globals->_player._position.x - _hotspot2._position.x) < 160) && + (g_globals->_sceneManager._previousScene != 5200) && (_sceneMode != 5150)) { setAction(NULL); _sceneMode = 5150; _soundHandler.play(208); if (RING_INVENTORY._vial._sceneNumber == 5100) { - _globals->_player.addMover(NULL); - _globals->_player.disableControl(); + g_globals->_player.addMover(NULL); + g_globals->_player.disableControl(); SceneItem::display2(5100, 39); } @@ -1410,28 +1410,28 @@ void Scene5100::dispatch() { _hotspot3.setStrip2(2); ObjectMover3 *mover1 = new ObjectMover3(); - _hotspot2.addMover(mover1, &_globals->_player, 20, this); + _hotspot2.addMover(mover1, &g_globals->_player, 20, this); ObjectMover3 *mover2 = new ObjectMover3(); - _hotspot3.addMover(mover2, &_globals->_player, 20, this); + _hotspot3.addMover(mover2, &g_globals->_player, 20, this); } if (!_action) { - if (((_globals->_player._position.x - _hotspot2._position.x) < 130) && !_globals->getFlag(61)) { - _globals->_player._canWalk = false; - _globals->_player.addMover(NULL); + if (((g_globals->_player._position.x - _hotspot2._position.x) < 130) && !g_globals->getFlag(61)) { + g_globals->_player._canWalk = false; + g_globals->_player.addMover(NULL); Common::Point pt(20, 25); PlayerMover2 *mover = new PlayerMover2(); - _hotspot3.addMover(mover, &pt, &_globals->_player); + _hotspot3.addMover(mover, &pt, &g_globals->_player); setAction(&_action4); } - if ((_globals->_sceneManager._scene->_backgroundBounds.right - 85) <= _globals->_player._position.x) - _globals->_sceneManager.changeScene(5000); + if ((g_globals->_sceneManager._scene->_backgroundBounds.right - 85) <= g_globals->_player._position.x) + g_globals->_sceneManager.changeScene(5000); - if (_globals->_player.getRegionIndex() == 8) { + if (g_globals->_player.getRegionIndex() == 8) { _sceneMode = 5114; - setAction(&_sequenceManager, this, 5115, &_globals->_player, NULL); + setAction(&_sequenceManager, this, 5115, &g_globals->_player, NULL); } } @@ -1444,11 +1444,11 @@ void Scene5100::dispatch() { *--------------------------------------------------------------------------*/ void Scene5200::Action1::signal() { - Scene5200 *scene = (Scene5200 *)_globals->_sceneManager._scene; + Scene5200 *scene = (Scene5200 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - setDelay(_globals->_randomSource.getRandomNumber(59) + 120); + setDelay(g_globals->_randomSource.getRandomNumber(59) + 120); break; case 1: scene->_hotspot3.animate(ANIM_MODE_8, 1, this); @@ -1459,30 +1459,30 @@ void Scene5200::Action1::signal() { void Scene5200::Action2::signal() { // Quinn obtains the stasis box from the flesheater throne room - Scene5200 *scene = (Scene5200 *)_globals->_sceneManager._scene; + Scene5200 *scene = (Scene5200 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); ADD_PLAYER_MOVER(92, 52); break; case 1: - _globals->_player.setVisage(5202); - _globals->_player._strip = 4; - _globals->_player._frame = 1; - _globals->_player.animate(ANIM_MODE_4, 3, 1, this); + g_globals->_player.setVisage(5202); + g_globals->_player._strip = 4; + g_globals->_player._frame = 1; + g_globals->_player.animate(ANIM_MODE_4, 3, 1, this); break; case 2: scene->_soundHandler.stop(); scene->_hotspot14.remove(); RING_INVENTORY._stasisBox._sceneNumber = 1; - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.animate(ANIM_MODE_5, this); break; case 3: - _globals->_player.setVisage(0); - _globals->_player._strip = 3; - _globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setVisage(0); + g_globals->_player._strip = 3; + g_globals->_player.animate(ANIM_MODE_1, NULL); scene->_hotspot8.animate(ANIM_MODE_2, NULL); ADD_MOVER(scene->_hotspot8, 141, 77); @@ -1495,7 +1495,7 @@ void Scene5200::Action2::signal() { scene->_hotspot8.animate(ANIM_MODE_5, this); break; case 5: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; } @@ -1504,28 +1504,28 @@ void Scene5200::Action2::signal() { void Scene5200::Action3::signal() { switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(5); break; case 1: ADD_PLAYER_MOVER(285, 62); break; case 2: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; } } void Scene5200::Action4::signal() { - Scene5200 *scene = (Scene5200 *)_globals->_sceneManager._scene; + Scene5200 *scene = (Scene5200 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: setDelay(120); break; case 1: - _globals->_soundHandler.play(209); + g_globals->_soundHandler.play(209); scene->_stripManager.start(5202, this, scene); break; case 2: @@ -1541,7 +1541,7 @@ void Scene5200::Action4::signal() { setDelay(60); break; case 6: - _globals->_sceneManager.changeScene(5100); + g_globals->_sceneManager.changeScene(5100); break; } } @@ -1584,7 +1584,7 @@ void Scene5200::Hotspot10::doAction(int action) { } void Scene5200::Hotspot14::doAction(int action) { - Scene5200 *scene = (Scene5200 *)_globals->_sceneManager._scene; + Scene5200 *scene = (Scene5200 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -1638,33 +1638,33 @@ void Scene5200::postInit(SceneObjectList *OwnerList) { _hotspot8._strip = 1; _hotspot8.setPosition(Common::Point(96, 53)); _hotspot8.fixPriority(90); - _globals->_sceneItems.push_back(&_hotspot14); + g_globals->_sceneItems.push_back(&_hotspot14); } - if (_globals->_stripNum == 5111) { + if (g_globals->_stripNum == 5111) { // Happens when the player enters the throne room via the secret passage, // after talking with the bat. No NPCs are around and the player can // obtain the stasis box. - _globals->_soundHandler.play(205); - _globals->_player.disableControl(); - - _globals->_player.postInit(); - _globals->_player.setVisage(0); - _globals->_player.changeZoom(75); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setStrip(1); - _globals->_player.setFrame(3); - _globals->_player.setPosition(Common::Point(307, 62)); + g_globals->_soundHandler.play(205); + g_globals->_player.disableControl(); + + g_globals->_player.postInit(); + g_globals->_player.setVisage(0); + g_globals->_player.changeZoom(75); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setStrip(1); + g_globals->_player.setFrame(3); + g_globals->_player.setPosition(Common::Point(307, 62)); setAction(&_action3); } else { // Happens when the player is captured by the flesh eaters the first time. - _globals->_player.postInit(); - _globals->_player.setVisage(2640); - _globals->_player._strip = 1; - _globals->_player._frame = 4; - _globals->_player.setPosition(Common::Point(105, 199)); + g_globals->_player.postInit(); + g_globals->_player.setVisage(2640); + g_globals->_player._strip = 1; + g_globals->_player._frame = 4; + g_globals->_player.setPosition(Common::Point(105, 199)); _hotspot5.postInit(); _hotspot5.setVisage(5210); @@ -1708,8 +1708,8 @@ void Scene5200::postInit(SceneObjectList *OwnerList) { _hotspot4.setPosition(Common::Point(146, 110)); _hotspot4.fixPriority(90); - _globals->_player.disableControl(); - _globals->setFlag(61); + g_globals->_player.disableControl(); + g_globals->setFlag(61); setAction(&_action4); } @@ -1720,8 +1720,8 @@ void Scene5200::postInit(SceneObjectList *OwnerList) { _hotspot12._sceneRegionId = 10; _hotspot13._sceneRegionId = 8; - _globals->_sceneItems.addItems(&_hotspot12, &_hotspot13, &_hotspot9, &_hotspot10, &_hotspot11, NULL); - _globals->_sceneManager._scene->_sceneBounds.center(_globals->_player._position); + g_globals->_sceneItems.addItems(&_hotspot12, &_hotspot13, &_hotspot9, &_hotspot10, &_hotspot11, NULL); + g_globals->_sceneManager._scene->_sceneBounds.center(g_globals->_player._position); loadScene(5200); } @@ -1739,9 +1739,9 @@ void Scene5200::stripCallback(int v) { void Scene5200::dispatch() { Scene::dispatch(); - if (!_action && (_globals->_player.getRegionIndex() == 12)) { - _globals->_stripNum = 5200; - _globals->_sceneManager.changeScene(5100); + if (!_action && (g_globals->_player.getRegionIndex() == 12)) { + g_globals->_stripNum = 5200; + g_globals->_sceneManager.changeScene(5100); } } @@ -1752,11 +1752,11 @@ void Scene5200::dispatch() { void Scene5300::Action1::signal() { // Seeker waking up - Scene5300 *scene = (Scene5300 *)_globals->_sceneManager._scene; + Scene5300 *scene = (Scene5300 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(3); break; case 1: @@ -1767,30 +1767,30 @@ void Scene5300::Action1::signal() { case 2: scene->_hotspot2.animate(ANIM_MODE_NONE, NULL); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setStrip2(-1); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - ADD_MOVER(_globals->_player, 85, 170); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setStrip2(-1); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + ADD_MOVER(g_globals->_player, 85, 170); break; case 3: scene->_hotspot2.fixPriority(-1); - _globals->_player.checkAngle(&scene->_hotspot2); + g_globals->_player.checkAngle(&scene->_hotspot2); setAction(&scene->_sequenceManager, this, 5305, &scene->_hotspot2, NULL); break; case 4: scene->_stripManager.start(5316, this); break; case 5: - if (!_globals->getFlag(106) || !_globals->getFlag(107) || (RING_INVENTORY._stasisBox._sceneNumber != 1)) { - _globals->_player.enableControl(); + if (!g_globals->getFlag(106) || !g_globals->getFlag(107) || (RING_INVENTORY._stasisBox._sceneNumber != 1)) { + g_globals->_player.enableControl(); remove(); } else { - _globals->setFlag(60); + g_globals->setFlag(60); scene->_hotspot2._numFrames = 10; - if (_globals->getFlag(67)) { + if (g_globals->getFlag(67)) { scene->_sceneMode = 5310; - scene->setAction(&scene->_sequenceManager, scene, 5310, &_globals->_player, &scene->_hotspot2, NULL); + scene->setAction(&scene->_sequenceManager, scene, 5310, &g_globals->_player, &scene->_hotspot2, NULL); } else { scene->_sceneMode = 5347; scene->setAction(&scene->_sequenceManager, scene, 5347, NULL); @@ -1801,46 +1801,46 @@ void Scene5300::Action1::signal() { } void Scene5300::Action2::signal() { - Scene5300 *scene = (Scene5300 *)_globals->_sceneManager._scene; + Scene5300 *scene = (Scene5300 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(60); break; case 1: - _globals->setFlag(60); + g_globals->setFlag(60); scene->_stripManager.start(5328, this); break; case 2: if (RING_INVENTORY._stasisBox._sceneNumber == 1) { - _globals->_stripNum = 5303; + g_globals->_stripNum = 5303; setDelay(5); } else { - _globals->_stripNum = 5302; + g_globals->_stripNum = 5302; scene->_stripManager.start(5329, this); } break; case 3: - _globals->_sceneManager.changeScene(5100); + g_globals->_sceneManager.changeScene(5100); remove(); break; } } void Scene5300::Action3::signal() { - Scene5300 *scene = (Scene5300 *)_globals->_sceneManager._scene; + Scene5300 *scene = (Scene5300 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(30); break; case 1: - scene->_stripManager.start(_globals->_stripNum, this); + scene->_stripManager.start(g_globals->_stripNum, this); break; case 2: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; } @@ -1849,14 +1849,14 @@ void Scene5300::Action3::signal() { /*--------------------------------------------------------------------------*/ void Scene5300::Hotspot1::doAction(int action) { - Scene5300 *scene = (Scene5300 *)_globals->_sceneManager._scene; + Scene5300 *scene = (Scene5300 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(5300, 24); break; case CURSOR_TALK: - _globals->_stripNum = 5312; + g_globals->_stripNum = 5312; scene->setAction(&scene->_action3); break; default: @@ -1866,37 +1866,37 @@ void Scene5300::Hotspot1::doAction(int action) { } void Scene5300::Hotspot2::doAction(int action) { // Seeker - Scene5300 *scene = (Scene5300 *)_globals->_sceneManager._scene; + Scene5300 *scene = (Scene5300 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(5300, 23); break; case CURSOR_USE: - if (!_globals->getFlag(106)) { - _globals->_player.disableControl(); + if (!g_globals->getFlag(106)) { + g_globals->_player.disableControl(); scene->_sceneMode = 5302; - scene->setAction(&scene->_sequenceManager, scene, 5302, &_globals->_player, NULL); + scene->setAction(&scene->_sequenceManager, scene, 5302, &g_globals->_player, NULL); } else { - SceneItem::display2(5300, _globals->getFlag(107) ? 25 : 20); + SceneItem::display2(5300, g_globals->getFlag(107) ? 25 : 20); } break; case CURSOR_TALK: - if (!_globals->getFlag(106)) { - _globals->_player.disableControl(); + if (!g_globals->getFlag(106)) { + g_globals->_player.disableControl(); scene->_sceneMode = 5302; - scene->setAction(&scene->_sequenceManager, scene, 5302, &_globals->_player, NULL); - } else if (!_globals->getFlag(107)) { + scene->setAction(&scene->_sequenceManager, scene, 5302, &g_globals->_player, NULL); + } else if (!g_globals->getFlag(107)) { SceneItem::display2(5300, 11); } else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); if (RING_INVENTORY._stasisBox._sceneNumber != 1) { scene->_sceneMode = 5316; scene->setAction(&scene->_sequenceManager, scene, 5316, NULL); } else { - _globals->setFlag(60); - if (_globals->getFlag(67)) { + g_globals->setFlag(60); + if (g_globals->getFlag(67)) { scene->_sceneMode = 5315; scene->setAction(&scene->_sequenceManager, scene, 5315, this, NULL); } else { @@ -1907,29 +1907,29 @@ void Scene5300::Hotspot2::doAction(int action) { } break; case OBJECT_SCANNER: - SceneItem::display2(5300, _globals->getFlag(107) ? 10 : 9); + SceneItem::display2(5300, g_globals->getFlag(107) ? 10 : 9); break; case OBJECT_MEDKIT: - if (_globals->getFlag(106)) + if (g_globals->getFlag(106)) SceneItem::display2(5300, 7); else { - _globals->setFlag(106); - _globals->_player.disableControl(); + g_globals->setFlag(106); + g_globals->_player.disableControl(); scene->_sceneMode = 5303; - scene->setAction(&scene->_sequenceManager, scene, 5303, &_globals->_player, NULL); + scene->setAction(&scene->_sequenceManager, scene, 5303, &g_globals->_player, NULL); } break; case OBJECT_VIAL: - if (_globals->getFlag(107)) { + if (g_globals->getFlag(107)) { SceneItem::display2(5300, 8); } else { RING_INVENTORY._vial._sceneNumber = 5300; - _globals->setFlag(107); - _globals->_player.disableControl(); + g_globals->setFlag(107); + g_globals->_player.disableControl(); scene->_sceneMode = 5304; - scene->setAction(&scene->_sequenceManager, scene, 5304, &_globals->_player, NULL); + scene->setAction(&scene->_sequenceManager, scene, 5304, &g_globals->_player, NULL); } break; default: @@ -1940,7 +1940,7 @@ void Scene5300::Hotspot2::doAction(int action) { void Scene5300::Hotspot5::doAction(int action) { // Sharp bone - Scene5300 *scene = (Scene5300 *)_globals->_sceneManager._scene; + Scene5300 *scene = (Scene5300 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -1948,10 +1948,10 @@ void Scene5300::Hotspot5::doAction(int action) { break; case CURSOR_USE: RING_INVENTORY._bone._sceneNumber = 1; - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 5309; - scene->setAction(&scene->_sequenceManager, scene, 5309, &_globals->_player, this, NULL); + scene->setAction(&scene->_sequenceManager, scene, 5309, &g_globals->_player, this, NULL); break; default: SceneHotspot::doAction(action); @@ -1961,26 +1961,26 @@ void Scene5300::Hotspot5::doAction(int action) { void Scene5300::Hotspot6::doAction(int action) { // Left Hole - Scene5300 *scene = (Scene5300 *)_globals->_sceneManager._scene; + Scene5300 *scene = (Scene5300 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: - if (!_globals->getFlag(105) || (RING_INVENTORY._vial._sceneNumber == 1)) + if (!g_globals->getFlag(105) || (RING_INVENTORY._vial._sceneNumber == 1)) SceneItem::display2(5300, 4); else SceneItem::display2(5300, 26); break; case CURSOR_USE: - if (!_globals->getFlag(105) || (RING_INVENTORY._vial._sceneNumber != 5100)) { - _globals->_player.disableControl(); + if (!g_globals->getFlag(105) || (RING_INVENTORY._vial._sceneNumber != 5100)) { + g_globals->_player.disableControl(); scene->_sceneMode = 5301; - scene->setAction(&scene->_sequenceManager, scene, 5301, &_globals->_player, NULL); + scene->setAction(&scene->_sequenceManager, scene, 5301, &g_globals->_player, NULL); } else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 5307; RING_INVENTORY._vial._sceneNumber = 1; - scene->setAction(&scene->_sequenceManager, scene, 5307, &scene->_hotspot1, &_globals->_player, + scene->setAction(&scene->_sequenceManager, scene, 5307, &scene->_hotspot1, &g_globals->_player, &scene->_hotspot4, NULL); } break; @@ -1993,19 +1993,19 @@ void Scene5300::Hotspot6::doAction(int action) { void Scene5300::Hotspot7::doAction(int action) { switch (action) { case CURSOR_LOOK: - if (_globals->getFlag(63)) + if (g_globals->getFlag(63)) SceneItem::display2(5300, 2); else { - _globals->setFlag(63); + g_globals->setFlag(63); SceneItem::display2(5300, 0); SceneItem::display2(5300, 1); } break; case CURSOR_USE: - if (_globals->getFlag(64)) + if (g_globals->getFlag(64)) SceneItem::display2(5300, 15); else { - _globals->setFlag(64); + g_globals->setFlag(64); SceneItem::display2(5300, 14); } break; @@ -2018,7 +2018,7 @@ void Scene5300::Hotspot7::doAction(int action) { void Scene5300::Hotspot8::doAction(int action) { switch (action) { case CURSOR_LOOK: - SceneItem::display2(5300, _globals->getFlag(65) ? 6 : 5); + SceneItem::display2(5300, g_globals->getFlag(65) ? 6 : 5); break; case CURSOR_USE: SceneItem::display2(5300, 18); @@ -2050,7 +2050,7 @@ void Scene5300::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_speakerSText); _stripManager.addSpeaker(&_speakerGameText); - if (_globals->getFlag(106) && _globals->getFlag(107)) { + if (g_globals->getFlag(106) && g_globals->getFlag(107)) { _hotspot2.postInit(); _hotspot2.setVisage(2806); _hotspot2.setObjectWrapper(new SceneObjectWrapper()); @@ -2077,13 +2077,13 @@ void Scene5300::postInit(SceneObjectList *OwnerList) { _hotspot4.animate(ANIM_MODE_2, NULL); _hotspot4.hide(); - if (_globals->getFlag(67)) { - _globals->_player.postInit(); - _globals->_player.setVisage(5316); - _globals->_player.setPosition(Common::Point(191, 27)); - _globals->_player.disableControl(); + if (g_globals->getFlag(67)) { + g_globals->_player.postInit(); + g_globals->_player.setVisage(5316); + g_globals->_player.setPosition(Common::Point(191, 27)); + g_globals->_player.disableControl(); - if (_globals->getFlag(107) && _globals->getFlag(106)) { + if (g_globals->getFlag(107) && g_globals->getFlag(106)) { _hotspot2.setVisage(2806); _hotspot2.postInit(); _hotspot2.setObjectWrapper(new SceneObjectWrapper()); @@ -2091,14 +2091,14 @@ void Scene5300::postInit(SceneObjectList *OwnerList) { setAction(&_action2); } else { - _globals->_player.setVisage(5315); - _globals->_player.setPosition(Common::Point(204, 86)); - _globals->_player.animate(ANIM_MODE_2, NULL); - _globals->_player.setStrip2(1); - _globals->_player._moveDiff.y = 12; + g_globals->_player.setVisage(5315); + g_globals->_player.setPosition(Common::Point(204, 86)); + g_globals->_player.animate(ANIM_MODE_2, NULL); + g_globals->_player.setStrip2(1); + g_globals->_player._moveDiff.y = 12; _sceneMode = 5308; - setAction(&_sequenceManager, this, 5308, &_globals->_player, NULL); + setAction(&_sequenceManager, this, 5308, &g_globals->_player, NULL); } } else { _hotspot3.postInit(); @@ -2107,16 +2107,16 @@ void Scene5300::postInit(SceneObjectList *OwnerList) { _hotspot3.fixPriority(1); _hotspot3.animate(ANIM_MODE_NONE, NULL); - _globals->_player.postInit(); - _globals->_player.setVisage(5315); - _globals->_player.setPosition(Common::Point(204, 86)); - _globals->_player.animate(ANIM_MODE_2, NULL); - _globals->_player.setStrip2(1); - _globals->_player._moveDiff.y = 12; - _globals->_player.disableControl(); + g_globals->_player.postInit(); + g_globals->_player.setVisage(5315); + g_globals->_player.setPosition(Common::Point(204, 86)); + g_globals->_player.animate(ANIM_MODE_2, NULL); + g_globals->_player.setStrip2(1); + g_globals->_player._moveDiff.y = 12; + g_globals->_player.disableControl(); _sceneMode = 5306; - setAction(&_sequenceManager, this, 5306, &_globals->_player, &_hotspot3, NULL); + setAction(&_sequenceManager, this, 5306, &g_globals->_player, &_hotspot3, NULL); } _field1B0A = 1; @@ -2125,22 +2125,22 @@ void Scene5300::postInit(SceneObjectList *OwnerList) { _hotspot5.setVisage(5301); _hotspot5.setStrip(2); _hotspot5.setPosition(Common::Point(190, 147)); - _globals->_sceneItems.push_back(&_hotspot5); + g_globals->_sceneItems.push_back(&_hotspot5); } _hotspot6.setBounds(Rect(74, 51, 114, 69)); _hotspot7.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); _hotspot8._sceneRegionId = 8; - _globals->_sceneItems.addItems(&_hotspot8, &_hotspot2, &_hotspot6, &_hotspot3, &_hotspot7, NULL); - _globals->_soundHandler.play(212); + g_globals->_sceneItems.addItems(&_hotspot8, &_hotspot2, &_hotspot6, &_hotspot3, &_hotspot7, NULL); + g_globals->_soundHandler.play(212); } void Scene5300::signal() { switch (_sceneMode) { case 5301: - _globals->_stripNum = 5300; - _globals->_sceneManager.changeScene(5100); + g_globals->_stripNum = 5300; + g_globals->_sceneManager.changeScene(5100); break; case 5307: _soundHandler.fadeOut(NULL); @@ -2149,31 +2149,31 @@ void Scene5300::signal() { case 5308: case 5316: case 5347: - _globals->_player.setStrip2(-1); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.enableControl(); + g_globals->_player.setStrip2(-1); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.enableControl(); break; case 5303: - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.enableControl(); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.enableControl(); - if (_globals->getFlag(107)) + if (g_globals->getFlag(107)) setAction(&_action1); else SceneItem::display2(5300, 28); break; case 5304: - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.enableControl(); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.enableControl(); - if (_globals->getFlag(106)) + if (g_globals->getFlag(106)) setAction(&_action1); else SceneItem::display2(5300, 28); break; case 5306: - _globals->clearFlag(67); - _globals->_player.setStrip2(-1); + g_globals->clearFlag(67); + g_globals->_player.setStrip2(-1); if ((RING_INVENTORY._vial._sceneNumber == 1) || (RING_INVENTORY._vial._sceneNumber == 5300)) _stripManager.start(5303, this); @@ -2183,7 +2183,7 @@ void Scene5300::signal() { break; case 5309: _hotspot5.remove(); - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; case 5310: _hotspot2.fixPriority(41); @@ -2192,8 +2192,8 @@ void Scene5300::signal() { setAction(&_sequenceManager, this, 5315, &_hotspot2, NULL); break; case 5315: - _globals->_stripNum = 5302; - _globals->_sceneManager.changeScene(5100); + g_globals->_stripNum = 5302; + g_globals->_sceneManager.changeScene(5100); break; } } diff --git a/engines/tsage/ringworld/ringworld_scenes8.cpp b/engines/tsage/ringworld/ringworld_scenes8.cpp index 5f1ff5cdca..f8fb8b01e7 100644 --- a/engines/tsage/ringworld/ringworld_scenes8.cpp +++ b/engines/tsage/ringworld/ringworld_scenes8.cpp @@ -51,11 +51,11 @@ void SceneObject7700::synchronize(Serializer &s) { void Scene7000::Action1::signal() { // Quinn walks from the lander to the seaside (action6) then discuss with Skeenar - Scene7000 *scene = (Scene7000 *)_globals->_sceneManager._scene; + Scene7000 *scene = (Scene7000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(3); break; case 1: @@ -69,7 +69,7 @@ void Scene7000::Action1::signal() { scene->_object1.animate(ANIM_MODE_5, this); scene->_object1.setPosition(Common::Point(151, 182)); scene->_object1.fixPriority(205); - _globals->_sceneItems.push_front(&scene->_object1); + g_globals->_sceneItems.push_front(&scene->_object1); break; case 3: scene->_object1._numFrames = 4; @@ -82,7 +82,7 @@ void Scene7000::Action1::signal() { setDelay(3); break; case 5: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; } @@ -91,25 +91,25 @@ void Scene7000::Action1::signal() { /*--------------------------------------------------------------------------*/ void Scene7000::Action2::signal() { - Scene7000 *scene = (Scene7000 *)_globals->_sceneManager._scene; + Scene7000 *scene = (Scene7000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(3); break; case 1: - _globals->_player.addMover(NULL); - _globals->_player.setVisage(7006); - _globals->_player.setStrip(1); - _globals->_player.setFrame(1); - _globals->_player.setPosition(Common::Point(_globals->_player._position.x, _globals->_player._position.y + 13)); - _globals->_player.changeZoom(68); - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.addMover(NULL); + g_globals->_player.setVisage(7006); + g_globals->_player.setStrip(1); + g_globals->_player.setFrame(1); + g_globals->_player.setPosition(Common::Point(g_globals->_player._position.x, g_globals->_player._position.y + 13)); + g_globals->_player.changeZoom(68); + g_globals->_player.animate(ANIM_MODE_5, this); scene->_object1.remove(); break; case 2: - _globals->_sceneManager.changeScene(7100); + g_globals->_sceneManager.changeScene(7100); remove(); break; } @@ -118,7 +118,7 @@ void Scene7000::Action2::signal() { /*--------------------------------------------------------------------------*/ void Scene7000::Action3::dispatch() { - Scene7000 *scene = (Scene7000 *)_globals->_sceneManager._scene; + Scene7000 *scene = (Scene7000 *)g_globals->_sceneManager._scene; Action::dispatch(); if (_actionIndex == 4) @@ -129,7 +129,7 @@ void Scene7000::Action3::dispatch() { void Scene7000::Action3::signal() { // Lander is landing - Scene7000 *scene = (Scene7000 *)_globals->_sceneManager._scene; + Scene7000 *scene = (Scene7000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -165,7 +165,7 @@ void Scene7000::Action3::signal() { } case 4: scene->_object4.remove(); - _globals->_sceneManager.changeScene(2100); + g_globals->_sceneManager.changeScene(2100); remove(); break; } @@ -174,11 +174,11 @@ void Scene7000::Action3::signal() { /*--------------------------------------------------------------------------*/ void Scene7000::Action4::signal() { - Scene7000 *scene = (Scene7000 *)_globals->_sceneManager._scene; + Scene7000 *scene = (Scene7000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_object1.animate(ANIM_MODE_6, this); break; case 1: @@ -186,7 +186,7 @@ void Scene7000::Action4::signal() { setDelay(300); break; case 2: - _globals->_soundHandler.play(252); + g_globals->_soundHandler.play(252); scene->_object1.show(); scene->_object1.setStrip(3); scene->_object1.setFrame(1); @@ -195,8 +195,8 @@ void Scene7000::Action4::signal() { case 3: scene->_object1.setStrip(4); scene->_object1.animate(ANIM_MODE_8, 0, NULL); - _globals->setFlag(81); - _globals->_player.enableControl(); + g_globals->setFlag(81); + g_globals->_player.enableControl(); remove(); break; } @@ -205,18 +205,18 @@ void Scene7000::Action4::signal() { /*--------------------------------------------------------------------------*/ void Scene7000::Action5::signal() { - Scene7000 *scene = (Scene7000 *)_globals->_sceneManager._scene; + Scene7000 *scene = (Scene7000 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: { NpcMover *playerMover = new NpcMover(); Common::Point pt(88, 121); - _globals->_player.addMover(playerMover, &pt, this); + g_globals->_player.addMover(playerMover, &pt, this); break; } case 1: - _globals->_player.checkAngle(&scene->_object1); - _globals->_soundHandler.play(252); + g_globals->_player.checkAngle(&scene->_object1); + g_globals->_soundHandler.play(252); scene->_object1.setStrip(2); scene->_stripManager.start(7015, this); break; @@ -229,34 +229,34 @@ void Scene7000::Action5::signal() { scene->_object1.remove(); NpcMover *mover = new NpcMover(); Common::Point pt(31, 94); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 4: { NpcMover *mover = new NpcMover(); Common::Point pt(11, 94); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 5: { - _globals->_player.fixPriority(10); + g_globals->_player.fixPriority(10); NpcMover *mover = new NpcMover(); Common::Point pt(11, 89); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 6: { NpcMover *mover = new NpcMover(); Common::Point pt(41, 89); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 7: - _globals->clearFlag(36); - _globals->clearFlag(37); - _globals->clearFlag(72); - _globals->clearFlag(13); - _globals->_sceneManager.changeScene(2100); + g_globals->clearFlag(36); + g_globals->clearFlag(37); + g_globals->clearFlag(72); + g_globals->clearFlag(13); + g_globals->_sceneManager.changeScene(2100); break; } } @@ -267,43 +267,43 @@ void Scene7000::Action6::signal() { // Quinn walks from the lander to the seaside switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(3); break; case 1: { NpcMover *mover = new NpcMover(); Common::Point pt(12, 91); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 2: { NpcMover *mover = new NpcMover(); Common::Point pt(8, 91); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 3: { NpcMover *mover = new NpcMover(); Common::Point pt(31, 96); - _globals->_player.addMover(mover, &pt, this); - _globals->_player.fixPriority(-1); + g_globals->_player.addMover(mover, &pt, this); + g_globals->_player.fixPriority(-1); break; } case 4: { NpcMover *mover = new NpcMover(); Common::Point pt(83, 117); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 5: { NpcMover *mover = new NpcMover(); Common::Point pt(95, 121); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 6: - _globals->_player.setStrip(3); - _globals->_player.setFrame(1); + g_globals->_player.setStrip(3); + g_globals->_player.setFrame(1); remove(); break; } @@ -314,7 +314,7 @@ void Scene7000::Action6::signal() { void Scene7000::Action7::signal() { switch (_actionIndex++) { case 0: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); setDelay(3); break; case 1: @@ -323,33 +323,33 @@ void Scene7000::Action7::signal() { case 2: { NpcMover *mover = new NpcMover(); Common::Point pt(31, 94); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 3: { NpcMover *mover = new NpcMover(); Common::Point pt(11, 94); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 4: { - _globals->_player.fixPriority(10); + g_globals->_player.fixPriority(10); NpcMover *mover = new NpcMover(); Common::Point pt(11, 89); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 5: { NpcMover *mover = new NpcMover(); Common::Point pt(41, 89); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 6: - if (_globals->getFlag(13)) - _globals->_sceneManager.changeScene(2280); + if (g_globals->getFlag(13)) + g_globals->_sceneManager.changeScene(2280); else - _globals->_sceneManager.changeScene(2320); + g_globals->_sceneManager.changeScene(2320); break; } } @@ -367,84 +367,84 @@ void Scene7000::Hotspot1::doAction(int action) { void Scene7000::Object1::doAction(int action) { // Skeenar - Scene7000 *scene = (Scene7000 *)_globals->_sceneManager._scene; + Scene7000 *scene = (Scene7000 *)g_globals->_sceneManager._scene; switch (action) { case OBJECT_TRANSLATOR: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); RING_INVENTORY._translator._sceneNumber = 7000; if ((RING_INVENTORY._waldos._sceneNumber != 7000) && (RING_INVENTORY._jar._sceneNumber != 7000)) { scene->_sceneMode = 7004; - scene->setAction(&scene->_sequenceManager, scene, 7004, &_globals->_player, this, NULL); + scene->setAction(&scene->_sequenceManager, scene, 7004, &g_globals->_player, this, NULL); } else if (RING_INVENTORY._waldos._sceneNumber != 7000) { scene->_sceneMode = 7011; - scene->setAction(&scene->_sequenceManager, scene, 7010, &_globals->_player, &scene->_object1, NULL); + scene->setAction(&scene->_sequenceManager, scene, 7010, &g_globals->_player, &scene->_object1, NULL); } else if (RING_INVENTORY._jar._sceneNumber != 7000) { scene->_sceneMode = 7012; - scene->setAction(&scene->_sequenceManager, scene, 7010, &_globals->_player, &scene->_object1, NULL); + scene->setAction(&scene->_sequenceManager, scene, 7010, &g_globals->_player, &scene->_object1, NULL); } else { scene->_sceneMode = 7015; - scene->setAction(&scene->_sequenceManager, scene, 7017, &_globals->_player, NULL); + scene->setAction(&scene->_sequenceManager, scene, 7017, &g_globals->_player, NULL); } break; case OBJECT_WALDOS: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); RING_INVENTORY._waldos._sceneNumber = 7000; if (RING_INVENTORY._translator._sceneNumber == 7000) { if (RING_INVENTORY._jar._sceneNumber == 7000) { scene->_sceneMode = 7015; - scene->setAction(&scene->_sequenceManager, scene, 7015, &_globals->_player, NULL); + scene->setAction(&scene->_sequenceManager, scene, 7015, &g_globals->_player, NULL); } else { scene->_sceneMode = 7006; - scene->setAction(&scene->_sequenceManager, scene, 7006, &_globals->_player, NULL); + scene->setAction(&scene->_sequenceManager, scene, 7006, &g_globals->_player, NULL); } } else { scene->_sceneMode = 7009; - scene->setAction(&scene->_sequenceManager, scene, 7009, &_globals->_player, NULL); + scene->setAction(&scene->_sequenceManager, scene, 7009, &g_globals->_player, NULL); } break; case OBJECT_JAR: - _globals->_player.disableControl(); + g_globals->_player.disableControl(); RING_INVENTORY._jar._sceneNumber = 7000; if (RING_INVENTORY._translator._sceneNumber == 7000) { if (RING_INVENTORY._waldos._sceneNumber != 7000) { scene->_sceneMode = 7007; - scene->setAction(&scene->_sequenceManager, scene, 7007, &_globals->_player, &scene->_object1, NULL); + scene->setAction(&scene->_sequenceManager, scene, 7007, &g_globals->_player, &scene->_object1, NULL); } else { scene->_sceneMode = 7015; - scene->setAction(&scene->_sequenceManager, scene, 7016, &_globals->_player, NULL); + scene->setAction(&scene->_sequenceManager, scene, 7016, &g_globals->_player, NULL); } } else { scene->_sceneMode = 7008; - scene->setAction(&scene->_sequenceManager, scene, 7008, &_globals->_player, NULL); + scene->setAction(&scene->_sequenceManager, scene, 7008, &g_globals->_player, NULL); } break; case CURSOR_LOOK: - if (_globals->getFlag(81)) + if (g_globals->getFlag(81)) SceneItem::display2(7000, 1); else SceneItem::display2(7000, 0); break; case CURSOR_USE: - if (_globals->getFlag(81)) { + if (g_globals->getFlag(81)) { RING_INVENTORY._stasisBox2._sceneNumber = 1; - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->setAction(&scene->_action5); } else { SceneItem::display2(7000, 5); } break; case CURSOR_TALK: - if (_globals->getFlag(81)) { + if (g_globals->getFlag(81)) { RING_INVENTORY._stasisBox2._sceneNumber = 1; - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->setAction(&scene->_action5); - } else if (_globals->getFlag(52)) { + } else if (g_globals->getFlag(52)) { scene->_sceneMode = 7005; scene->setAction(&scene->_sequenceManager, scene, 7013, NULL); - } else if (_globals->getFlag(13)) { + } else if (g_globals->getFlag(13)) { scene->_sceneMode = 7002; scene->setAction(&scene->_sequenceManager, scene, 7014, NULL); } else { @@ -461,25 +461,25 @@ void Scene7000::Object1::doAction(int action) { /*--------------------------------------------------------------------------*/ void Scene7000::dispatch() { - Scene7000 *scene = (Scene7000 *)_globals->_sceneManager._scene; + Scene7000 *scene = (Scene7000 *)g_globals->_sceneManager._scene; if (!_action) { - if (_globals->_sceneRegions.indexOf(_globals->_player._position) == 8) { - if (!_globals->getFlag(13)) { - _globals->_player.disableControl(); - _globals->_player.addMover(NULL); + if (g_globals->_sceneRegions.indexOf(g_globals->_player._position) == 8) { + if (!g_globals->getFlag(13)) { + g_globals->_player.disableControl(); + g_globals->_player.addMover(NULL); SceneItem::display2(7000, 3); _sceneMode = 7001; - setAction(&scene->_sequenceManager, this, 7001, &_globals->_player, NULL); - } else if (!_globals->getFlag(52)) { + setAction(&scene->_sequenceManager, this, 7001, &g_globals->_player, NULL); + } else if (!g_globals->getFlag(52)) { setAction(&_action2); } else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); _sceneMode = 7003; - setAction(&scene->_sequenceManager, this, 7003, &_globals->_player, NULL); + setAction(&scene->_sequenceManager, this, 7003, &g_globals->_player, NULL); } } - if (_globals->_sceneRegions.indexOf(_globals->_player._position) == 9) + if (g_globals->_sceneRegions.indexOf(g_globals->_player._position) == 9) scene->setAction(&scene->_action7); } Scene::dispatch(); @@ -498,7 +498,7 @@ void Scene7000::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_speakerQR); _speakerSKText._npc = &_object1; - _speakerQText._npc = &_globals->_player; + _speakerQText._npc = &g_globals->_player; _object5.postInit(); _object5.setVisage(7001); @@ -528,7 +528,7 @@ void Scene7000::postInit(SceneObjectList *OwnerList) { _object8.setPosition(Common::Point(176, 175)); _object8.fixPriority(1); - if (_globals->getFlag(72)) { + if (g_globals->getFlag(72)) { _object3.postInit(); _object3.setVisage(5001); _object3.setStrip2(1); @@ -538,7 +538,7 @@ void Scene7000::postInit(SceneObjectList *OwnerList) { _object1.postInit(); _object1.setVisage(7003); - if (_globals->getFlag(81)) + if (g_globals->getFlag(81)) _object1.setStrip(4); else _object1.setStrip(2); @@ -546,20 +546,20 @@ void Scene7000::postInit(SceneObjectList *OwnerList) { _object1._numFrames = 4; _object1.changeZoom(45); _object1.animate(ANIM_MODE_8, 0, NULL); - _globals->_sceneItems.push_back(&_object1); + g_globals->_sceneItems.push_back(&_object1); } _soundHandler.play(251); - if (_globals->_sceneManager._previousScene == 2100) { - if (_globals->getFlag(72)) { - _globals->_player.postInit(); - _globals->_player.setVisage(0); - _globals->_player.animate(ANIM_MODE_1, NULL); + if (g_globals->_sceneManager._previousScene == 2100) { + if (g_globals->getFlag(72)) { + g_globals->_player.postInit(); + g_globals->_player.setVisage(0); + g_globals->_player.animate(ANIM_MODE_1, NULL); SceneObjectWrapper *wrapper = new SceneObjectWrapper(); - _globals->_player.setObjectWrapper(wrapper); - _globals->_player.setPosition(Common::Point(57, 94)); - _globals->_player.changeZoom(-1); - _globals->_player.fixPriority(10); - if (_globals->getFlag(81)) { + g_globals->_player.setObjectWrapper(wrapper); + g_globals->_player.setPosition(Common::Point(57, 94)); + g_globals->_player.changeZoom(-1); + g_globals->_player.fixPriority(10); + if (g_globals->getFlag(81)) { setAction(&_action4); } else { _object1.setPosition(Common::Point(151, 182)); @@ -567,8 +567,8 @@ void Scene7000::postInit(SceneObjectList *OwnerList) { setAction(&_action1); } } else { - _globals->_soundHandler.play(250); - _globals->setFlag(72); + g_globals->_soundHandler.play(250); + g_globals->setFlag(72); _object3.postInit(); _object3.setVisage(5001); @@ -578,36 +578,36 @@ void Scene7000::postInit(SceneObjectList *OwnerList) { _object3.changeZoom(-1); setAction(&_action3); } - } else if (_globals->_sceneManager._previousScene == 2280) { - _globals->_player.postInit(); - _globals->_player.setVisage(2170); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.setPosition(Common::Point(57, 94)); - _globals->_player.changeZoom(-1); - _globals->_player.fixPriority(10); - _globals->_player.disableControl(); + } else if (g_globals->_sceneManager._previousScene == 2280) { + g_globals->_player.postInit(); + g_globals->_player.setVisage(2170); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.setPosition(Common::Point(57, 94)); + g_globals->_player.changeZoom(-1); + g_globals->_player.fixPriority(10); + g_globals->_player.disableControl(); _sceneMode = 7001; setAction(&_action6, this); - if (!_globals->getFlag(81)) { + if (!g_globals->getFlag(81)) { _object1.setPosition(Common::Point(151, 182)); _object1.changeZoom(100); } _object8.remove(); _object9.remove(); - } else if (_globals->_sceneManager._previousScene == 2320) { - _globals->_player.postInit(); - _globals->_player.setVisage(0); - _globals->_player.animate(ANIM_MODE_1, NULL); + } else if (g_globals->_sceneManager._previousScene == 2320) { + g_globals->_player.postInit(); + g_globals->_player.setVisage(0); + g_globals->_player.animate(ANIM_MODE_1, NULL); SceneObjectWrapper *wrapper = new SceneObjectWrapper(); - _globals->_player.setObjectWrapper(wrapper); - _globals->_player.setPosition(Common::Point(57, 94)); - _globals->_player.changeZoom(-1); - _globals->_player.fixPriority(10); + g_globals->_player.setObjectWrapper(wrapper); + g_globals->_player.setPosition(Common::Point(57, 94)); + g_globals->_player.changeZoom(-1); + g_globals->_player.fixPriority(10); _sceneMode = 7001; setAction(&_action6, this); } else { - _globals->setFlag(72); + g_globals->setFlag(72); _object3.postInit(); _object3.setVisage(5001); @@ -615,18 +615,18 @@ void Scene7000::postInit(SceneObjectList *OwnerList) { _object3.setPosition(Common::Point(307, 0)); _soundHandler.play(151); _soundHandler.holdAt(true); - _globals->_soundHandler.play(250); + g_globals->_soundHandler.play(250); setAction(&_action3); } _hotspot1.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); - _globals->_sceneItems.push_back(&_hotspot1); + g_globals->_sceneItems.push_back(&_hotspot1); } /*--------------------------------------------------------------------------*/ void Scene7000::signal() { - Scene7000 *scene = (Scene7000 *)_globals->_sceneManager._scene; + Scene7000 *scene = (Scene7000 *)g_globals->_sceneManager._scene; switch (_sceneMode) { case 7001: case 7002: @@ -636,19 +636,19 @@ void Scene7000::signal() { case 7007: case 7008: case 7009: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; case 7003: _sceneMode = 7001; - setAction(&scene->_sequenceManager, this, 7001, &_globals->_player, NULL); + setAction(&scene->_sequenceManager, this, 7001, &g_globals->_player, NULL); break; case 7011: _sceneMode = 7005; - setAction(&scene->_sequenceManager, this, 7005, &_globals->_player, NULL); + setAction(&scene->_sequenceManager, this, 7005, &g_globals->_player, NULL); break; case 7012: _sceneMode = 7005; - setAction(&scene->_sequenceManager, this, 7012, &_globals->_player, NULL); + setAction(&scene->_sequenceManager, this, 7012, &g_globals->_player, NULL); break; case 7015: setAction(&_action4); @@ -663,7 +663,7 @@ void Scene7000::signal() { *--------------------------------------------------------------------------*/ void Scene7100::Action3::signal() { - Scene7100 *scene = (Scene7100 *)_globals->_sceneManager._scene; + Scene7100 *scene = (Scene7100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -683,11 +683,11 @@ void Scene7100::Action3::signal() { } void Scene7100::Action4::signal() { - Scene7100 *scene = (Scene7100 *)_globals->_sceneManager._scene; + Scene7100 *scene = (Scene7100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - setDelay(_globals->_randomSource.getRandomNumber(1) + 1); + setDelay(g_globals->_randomSource.getRandomNumber(1) + 1); break; case 1: { scene->_object5.setStrip(3); @@ -711,7 +711,7 @@ void Scene7100::Action4::signal() { } void Scene7100::Action5::signal() { - Scene7100 *scene = (Scene7100 *)_globals->_sceneManager._scene; + Scene7100 *scene = (Scene7100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -746,7 +746,7 @@ void Scene7100::Action5::signal() { } void Scene7100::Action6::signal() { - Scene7100 *scene = (Scene7100 *)_globals->_sceneManager._scene; + Scene7100 *scene = (Scene7100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -801,7 +801,7 @@ void Scene7100::Action6::signal() { } void Scene7100::Action7::signal() { - Scene7100 *scene = (Scene7100 *)_globals->_sceneManager._scene; + Scene7100 *scene = (Scene7100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -829,7 +829,7 @@ void Scene7100::Action7::signal() { } void Scene7100::Action8::signal() { - Scene7100 *scene = (Scene7100 *)_globals->_sceneManager._scene; + Scene7100 *scene = (Scene7100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -927,7 +927,7 @@ void Scene7100::Action8::signal() { } void Scene7100::Action9::signal() { - Scene7100 *scene = (Scene7100 *)_globals->_sceneManager._scene; + Scene7100 *scene = (Scene7100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -972,7 +972,7 @@ void Scene7100::Action9::signal() { } void Scene7100::Action10::signal() { - Scene7100 *scene = (Scene7100 *)_globals->_sceneManager._scene; + Scene7100 *scene = (Scene7100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -992,7 +992,7 @@ void Scene7100::Action10::signal() { } void Scene7100::Action11::signal() { - Scene7100 *scene = (Scene7100 *)_globals->_sceneManager._scene; + Scene7100 *scene = (Scene7100 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -1001,19 +1001,19 @@ void Scene7100::Action11::signal() { case 1: { Common::Point pt(154, 175); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); ObjectMover2 *mover2 = new ObjectMover2(); - scene->_object1.addMover(mover2, 25, 35, &_globals->_player); + scene->_object1.addMover(mover2, 25, 35, &g_globals->_player); break; } case 2: { Common::Point pt(700, 155); NpcMover *mover = new NpcMover(); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 3: - _globals->_sceneManager.changeScene(7200); + g_globals->_sceneManager.changeScene(7200); remove(); break; } @@ -1119,14 +1119,14 @@ void Scene7100::postInit(SceneObjectList *OwnerList) { _object25.setAction(&_action10, NULL); // Swimmer 1 - _globals->_player.postInit(); - _globals->_player.setVisage(7101); - _globals->_player.animate(ANIM_MODE_2, NULL); - _globals->_player._moveDiff.x = 4; - _globals->_player._moveDiff.y = 2; - _globals->_player.setPosition(Common::Point(135, 135)); - _globals->_player.fixPriority(200); - _globals->_player.disableControl(); + g_globals->_player.postInit(); + g_globals->_player.setVisage(7101); + g_globals->_player.animate(ANIM_MODE_2, NULL); + g_globals->_player._moveDiff.x = 4; + g_globals->_player._moveDiff.y = 2; + g_globals->_player.setPosition(Common::Point(135, 135)); + g_globals->_player.fixPriority(200); + g_globals->_player.disableControl(); // Swimmer 2 _object1.postInit(); @@ -1139,7 +1139,7 @@ void Scene7100::postInit(SceneObjectList *OwnerList) { setAction(&_action11); _soundHandler1.play(270); _soundHandler2.play(275); - _globals->_soundHandler.play(270); + g_globals->_soundHandler.play(270); } /*-------------------------------------------------------------------------- * Scene 7200 - Underwater: Entering the cave @@ -1147,7 +1147,7 @@ void Scene7100::postInit(SceneObjectList *OwnerList) { *--------------------------------------------------------------------------*/ void Scene7200::Action1::signal() { - Scene7200 *scene = (Scene7200 *)_globals->_sceneManager._scene; + Scene7200 *scene = (Scene7200 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -1159,13 +1159,13 @@ void Scene7200::Action1::signal() { scene->_swimmer.addMover(mover1, &pt1, this); Common::Point pt2(207, 138); PlayerMover *mover2 = new PlayerMover(); - _globals->_player.addMover(mover2, &pt2, this); + g_globals->_player.addMover(mover2, &pt2, this); break; } case 2: break; case 3: - _globals->_sceneManager.changeScene(7300); + g_globals->_sceneManager.changeScene(7300); remove(); break; } @@ -1174,7 +1174,7 @@ void Scene7200::Action1::signal() { /*--------------------------------------------------------------------------*/ void Scene7200::Action2::signal() { - Scene7200 *scene = (Scene7200 *)_globals->_sceneManager._scene; + Scene7200 *scene = (Scene7200 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -1288,13 +1288,13 @@ void Scene7200::postInit(SceneObjectList *OwnerList) { _object9._numFrames = 3; // Orange swimmer - _globals->_player.postInit(); - _globals->_player.setVisage(7110); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.setZoom(50); - _globals->_player.setPosition(Common::Point(-18, 16)); - _globals->_player.disableControl(); + g_globals->_player.postInit(); + g_globals->_player.setVisage(7110); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.setZoom(50); + g_globals->_player.setPosition(Common::Point(-18, 16)); + g_globals->_player.disableControl(); _swimmer.postInit(); _swimmer.setVisage(7101); @@ -1313,7 +1313,7 @@ void Scene7200::postInit(SceneObjectList *OwnerList) { *--------------------------------------------------------------------------*/ void Scene7300::Action1::signal() { - Scene7300 *scene = (Scene7300 *)_globals->_sceneManager._scene; + Scene7300 *scene = (Scene7300 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -1327,18 +1327,18 @@ void Scene7300::Action1::signal() { case 4: { NpcMover *mover = new NpcMover(); Common::Point pt(102, 122); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 5: - _globals->_player.setStrip(2); - _globals->_player.setFrame(1); - _globals->_player.animate(ANIM_MODE_5, this); + g_globals->_player.setStrip(2); + g_globals->_player.setFrame(1); + g_globals->_player.animate(ANIM_MODE_5, this); break; case 6: - _globals->_player.setStrip(3); - _globals->_player._numFrames = 5; - _globals->_player.animate(ANIM_MODE_2, this); + g_globals->_player.setStrip(3); + g_globals->_player._numFrames = 5; + g_globals->_player.animate(ANIM_MODE_2, this); if (RING_INVENTORY._translator._sceneNumber == 1) scene->_stripManager.start(7310, this); else @@ -1346,10 +1346,10 @@ void Scene7300::Action1::signal() { break; case 7: setDelay(3); - _globals->_soundHandler.fadeOut(NULL); + g_globals->_soundHandler.fadeOut(NULL); break; case 8: - _globals->_sceneManager.changeScene(2280); + g_globals->_sceneManager.changeScene(2280); break; } } @@ -1357,7 +1357,7 @@ void Scene7300::Action1::signal() { /*--------------------------------------------------------------------------*/ void Scene7300::Action2::signal() { - Scene7300 *scene = (Scene7300 *)_globals->_sceneManager._scene; + Scene7300 *scene = (Scene7300 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -1365,7 +1365,7 @@ void Scene7300::Action2::signal() { break; case 1: NpcMover *mover1 = new NpcMover(); - Common::Point pt(_globals->_randomSource.getRandomNumber(3) + 203, _globals->_randomSource.getRandomNumber(3) + 96); + Common::Point pt(g_globals->_randomSource.getRandomNumber(3) + 203, g_globals->_randomSource.getRandomNumber(3) + 96); scene->_object3.addMover(mover1, &pt, this); _actionIndex = 0; break; @@ -1375,7 +1375,7 @@ void Scene7300::Action2::signal() { /*--------------------------------------------------------------------------*/ void Scene7300::Action3::signal() { - Scene7300 *scene = (Scene7300 *)_globals->_sceneManager._scene; + Scene7300 *scene = (Scene7300 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: @@ -1383,7 +1383,7 @@ void Scene7300::Action3::signal() { break; case 1: NpcMover *mover1 = new NpcMover(); - Common::Point pt(_globals->_randomSource.getRandomNumber(5) + 76, _globals->_randomSource.getRandomNumber(5) + 78); + Common::Point pt(g_globals->_randomSource.getRandomNumber(5) + 76, g_globals->_randomSource.getRandomNumber(5) + 78); scene->_object1.addMover(mover1, &pt, this); _actionIndex = 0; break; @@ -1406,7 +1406,7 @@ void Scene7300::Action4::signal() { /*--------------------------------------------------------------------------*/ void Scene7300::dispatch() { - Scene7300 *scene = (Scene7300 *)_globals->_sceneManager._scene; + Scene7300 *scene = (Scene7300 *)g_globals->_sceneManager._scene; scene->_object4.setPosition(Common::Point(scene->_object3._position.x + 15, scene->_object3._position.y + 61)); scene->_object2.setPosition(Common::Point(scene->_object1._position.x + 1, scene->_object1._position.y - 31)); @@ -1421,9 +1421,9 @@ void Scene7300::postInit(SceneObjectList *OwnerList) { Scene::postInit(); setZoomPercents(60, 85, 200, 100); - _globals->setFlag(52); - _globals->setFlag(24); - _globals->setFlag(109); + g_globals->setFlag(52); + g_globals->setFlag(24); + g_globals->setFlag(109); _stripManager.addSpeaker(&_speakerPOR); _stripManager.addSpeaker(&_speakerPOText); @@ -1450,11 +1450,11 @@ void Scene7300::postInit(SceneObjectList *OwnerList) { _object3._moveRate = 2; _object3.setAction(&_action2); - _globals->_player.postInit(); - _globals->_player.setVisage(7305); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setPosition(Common::Point(-100, 100)); - _globals->_player.disableControl(); + g_globals->_player.postInit(); + g_globals->_player.setVisage(7305); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setPosition(Common::Point(-100, 100)); + g_globals->_player.disableControl(); _object1.postInit(); _object1.setVisage(7312); @@ -1499,7 +1499,7 @@ void Scene7300::postInit(SceneObjectList *OwnerList) { _object8._numFrames = 2; setAction(&_action1); - _globals->_soundHandler.play(272); + g_globals->_soundHandler.play(272); } /*-------------------------------------------------------------------------- @@ -1515,11 +1515,11 @@ void Scene7600::Action1::signal() { case 1: { PlayerMover *mover = new PlayerMover(); Common::Point pt(389, 57); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 2: - _globals->_sceneManager.changeScene(7700); + g_globals->_sceneManager.changeScene(7700); break; } } @@ -1534,11 +1534,11 @@ void Scene7600::Action2::signal() { case 1: { NpcMover *mover = new NpcMover(); Common::Point pt(-30, 195); - _globals->_player.addMover(mover, &pt, this); + g_globals->_player.addMover(mover, &pt, this); break; } case 2: - _globals->_sceneManager.changeScene(2320); + g_globals->_sceneManager.changeScene(2320); remove(); break; } @@ -1585,23 +1585,23 @@ void Scene7600::postInit(SceneObjectList *OwnerList) { _object6.setPosition(Common::Point(379, 191)); _object6.fixPriority(1); - _globals->_player.postInit(); - _globals->_player.setVisage(2333); - _globals->_player.animate(ANIM_MODE_1, NULL); - _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.setStrip(1); - _globals->_player._moveDiff = Common::Point(16, 16); - _globals->_player.changeZoom(-1); - _globals->_player.disableControl(); - - if (_globals->_sceneManager._previousScene == 7700) { - _globals->_player.setPosition(Common::Point(389, 57)); + g_globals->_player.postInit(); + g_globals->_player.setVisage(2333); + g_globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.setObjectWrapper(new SceneObjectWrapper()); + g_globals->_player.setStrip(1); + g_globals->_player._moveDiff = Common::Point(16, 16); + g_globals->_player.changeZoom(-1); + g_globals->_player.disableControl(); + + if (g_globals->_sceneManager._previousScene == 7700) { + g_globals->_player.setPosition(Common::Point(389, 57)); setAction(&_action2); } else { - _globals->_player.setPosition(Common::Point(-50, 195)); + g_globals->_player.setPosition(Common::Point(-50, 195)); setAction(&_action1); } - _sceneBounds.center(_globals->_player._position.x, _globals->_player._position.y); + _sceneBounds.center(g_globals->_player._position.x, g_globals->_player._position.y); loadScene(7600); _soundHandler2.play(255); _soundHandler1.play(251); @@ -1618,11 +1618,11 @@ void Scene7700::Action1::signal() { case 0: { PlayerMover *mover1 = new PlayerMover(); Common::Point pt = Common::Point(fmtObj->_position.x, fmtObj->_position.y + 30); - _globals->_player.addMover(mover1, &pt, this); + g_globals->_player.addMover(mover1, &pt, this); break; } case 1: - _globals->_player.checkAngle(fmtObj); + g_globals->_player.checkAngle(fmtObj); if (fmtObj->_state == 0) fmtObj->animate(ANIM_MODE_5, this); else @@ -1635,11 +1635,11 @@ void Scene7700::Action1::signal() { } void Scene7700::Action2::signal() { - Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + Scene7700 *scene = (Scene7700 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: case 2: - setDelay(_globals->_randomSource.getRandomNumber(60) + 60); + setDelay(g_globals->_randomSource.getRandomNumber(60) + 60); break; case 1: scene->_prof.animate(ANIM_MODE_7, 0, NULL); @@ -1653,7 +1653,7 @@ void Scene7700::Action2::signal() { } void Scene7700::Action3::signal() { - Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + Scene7700 *scene = (Scene7700 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: scene->_object15.animate(ANIM_MODE_5, this); @@ -1675,14 +1675,14 @@ void Scene7700::Action3::signal() { scene->_object8._numFrames = 3; break; case 3: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; } } void Scene7700::Action4::signal() { - Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + Scene7700 *scene = (Scene7700 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 2: scene->_object13.remove(); @@ -1701,21 +1701,21 @@ void Scene7700::Action4::signal() { case 3: CursorMan.showMouse(true); SceneItem::display2(7700, 11); - _globals->_player.enableControl(); + g_globals->_player.enableControl(); remove(); break; } } void Scene7700::Action5::signal() { - Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + Scene7700 *scene = (Scene7700 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: - setDelay(_globals->_randomSource.getRandomNumber(240)); + setDelay(g_globals->_randomSource.getRandomNumber(240)); break; case 1: { - scene->_cloud.setFrame(_globals->_randomSource.getRandomNumber(1) + 1); - scene->_cloud.setPosition(Common::Point(133, 145 + _globals->_randomSource.getRandomNumber(54))); + scene->_cloud.setFrame(g_globals->_randomSource.getRandomNumber(1) + 1); + scene->_cloud.setPosition(Common::Point(133, 145 + g_globals->_randomSource.getRandomNumber(54))); Common::Point pt(360, scene->_cloud._position.y); NpcMover *mover = new NpcMover(); @@ -1727,7 +1727,7 @@ void Scene7700::Action5::signal() { } void Scene7700::Action6::signal() { - Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + Scene7700 *scene = (Scene7700 *)g_globals->_sceneManager._scene; switch (_actionIndex++) { case 0: setDelay(5); @@ -1773,7 +1773,7 @@ void Scene7700::SceneHotspot2::doAction(int action) { } void Scene7700::SceneHotspot3::doAction(int action) { - Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + Scene7700 *scene = (Scene7700 *)g_globals->_sceneManager._scene; switch (action) { case OBJECT_KEY: @@ -1787,13 +1787,13 @@ void Scene7700::SceneHotspot3::doAction(int action) { SceneItem::display2(7700, 53); break; case CURSOR_USE: - if (!_globals->getFlag(78)) { + if (!g_globals->getFlag(78)) { scene->_sceneMode = 7712; scene->setAction(&scene->_sequenceManager, scene, 7715, NULL); } else if (RING_INVENTORY._key._sceneNumber == 7700) { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 7705; - scene->setAction(&scene->_sequenceManager, scene, 7705, &_globals->_player, NULL); + scene->setAction(&scene->_sequenceManager, scene, 7705, &g_globals->_player, NULL); } break; default: @@ -1803,14 +1803,14 @@ void Scene7700::SceneHotspot3::doAction(int action) { } void Scene7700::SceneHotspot4::doAction(int action) { - Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + Scene7700 *scene = (Scene7700 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(7700, 12); break; case CURSOR_USE: - if (!_globals->getFlag(78)) { + if (!g_globals->getFlag(78)) { scene->_sceneMode = 7712; scene->setAction(&scene->_sequenceManager, scene, 7715, NULL); } else { @@ -1824,18 +1824,18 @@ void Scene7700::SceneHotspot4::doAction(int action) { } void Scene7700::SceneHotspot5::doAction(int action) { - Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + Scene7700 *scene = (Scene7700 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: SceneItem::display2(7700, 28); break; case CURSOR_USE: - if (_globals->getFlag(78)) { + if (g_globals->getFlag(78)) { if (RING_INVENTORY._paper._sceneNumber == 7700) { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 7708; - scene->setAction(&scene->_sequenceManager, scene, 7708, &_globals->_player, NULL); + scene->setAction(&scene->_sequenceManager, scene, 7708, &g_globals->_player, NULL); } } else { scene->_sceneMode = 7712; @@ -1868,7 +1868,7 @@ void Scene7700::SceneItem7::doAction(int action) { } void Scene7700::SceneHotspot8::doAction(int action) { - Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + Scene7700 *scene = (Scene7700 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -1894,7 +1894,7 @@ void Scene7700::SceneHotspot8::doAction(int action) { } void Scene7700::SceneHotspot9::doAction(int action) { - Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + Scene7700 *scene = (Scene7700 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -1919,7 +1919,7 @@ void Scene7700::SceneHotspot9::doAction(int action) { } else { scene->_field97B++; if (scene->_field97B == 3) { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->setAction(&scene->_action3); } } @@ -1937,13 +1937,13 @@ void Scene7700::SceneItem10::doAction(int action) { } void Scene7700::Object1::doAction(int action) { - Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + Scene7700 *scene = (Scene7700 *)g_globals->_sceneManager._scene; if (action == CURSOR_LOOK) { SceneItem::display2(7700, _lookLineNum); } else if (action == CURSOR_USE) { - if (_globals->getFlag(78)) { - _globals->_player.disableControl(); + if (g_globals->getFlag(78)) { + g_globals->_player.disableControl(); scene->setAction(&scene->_action1, this); } else { scene->_sceneMode = 7712; @@ -1975,20 +1975,20 @@ void Scene7700::Object1::signal() { } else { _state = 0; } - _globals->_player.enableControl(); + g_globals->_player.enableControl(); } void Scene7700::Object3::doAction(int action) { - Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + Scene7700 *scene = (Scene7700 *)g_globals->_sceneManager._scene; if (action == CURSOR_LOOK) { SceneItem::display2(7700, 34); } else if (action == CURSOR_USE) { - if (_globals->getFlag(78)) { + if (g_globals->getFlag(78)) { if (scene->_object3._frame == 1) { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 7707; - scene->setAction(&scene->_sequenceManager, scene, 7707, &_globals->_player, this, NULL); + scene->setAction(&scene->_sequenceManager, scene, 7707, &g_globals->_player, this, NULL); } else { SceneItem::display2(7700, 60); } @@ -2002,17 +2002,17 @@ void Scene7700::Object3::doAction(int action) { } void Scene7700::Object7::doAction(int action) { - Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + Scene7700 *scene = (Scene7700 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: - if (_globals->getFlag(78)) + if (g_globals->getFlag(78)) SceneItem::display2(7700, 45); else SceneItem::display2(7700, 44); break; case CURSOR_USE: - if (_globals->getFlag(78)) { + if (g_globals->getFlag(78)) { SceneItem::display2(7701, 41); } else { scene->_sceneMode = 7712; @@ -2020,10 +2020,10 @@ void Scene7700::Object7::doAction(int action) { } break; case CURSOR_TALK: - if (_globals->getFlag(78)) { + if (g_globals->getFlag(78)) { SceneItem::display2(7702, 1); } else { - _globals->_player.disableControl(); + g_globals->_player.disableControl(); if (_state == 0) { _state = 1; scene->_sceneMode = 7703; @@ -2035,13 +2035,13 @@ void Scene7700::Object7::doAction(int action) { } break; case OBJECT_STUNNER: - if (!_globals->getFlag(78)) { - _globals->_soundHandler.stop(); - _globals->setFlag(78); + if (!g_globals->getFlag(78)) { + g_globals->_soundHandler.stop(); + g_globals->setFlag(78); setAction(NULL); - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 7704; - scene->setAction(&scene->_sequenceManager, scene, 7704, &_globals->_player, this, NULL); + scene->setAction(&scene->_sequenceManager, scene, 7704, &g_globals->_player, this, NULL); } break; default: @@ -2051,7 +2051,7 @@ void Scene7700::Object7::doAction(int action) { } void Scene7700::Object8::doAction(int action) { - Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + Scene7700 *scene = (Scene7700 *)g_globals->_sceneManager._scene; if ((action == CURSOR_LOOK) || (action == CURSOR_USE)) { if (_strip == 3) { @@ -2071,10 +2071,10 @@ void Scene7700::Object8::doAction(int action) { scene->_gfxButton._bounds.center(140, 189); scene->_gfxButton.draw(); - _globals->_sceneItems.push_front(&scene->_sceneItem10); - _globals->_sceneItems.push_front(&scene->_object9); - _globals->_player._canWalk = false; - } else if (_globals->getFlag(78)) { + g_globals->_sceneItems.push_front(&scene->_sceneItem10); + g_globals->_sceneItems.push_front(&scene->_object9); + g_globals->_player._canWalk = false; + } else if (g_globals->getFlag(78)) { scene->_object15.postInit(); scene->_object15.setVisage(7701); scene->_object15.setPosition(Common::Point(140, 165)); @@ -2090,11 +2090,11 @@ void Scene7700::Object8::doAction(int action) { scene->_object19.setStrip(6); scene->_object19.setPosition(Common::Point(140, 192)); - _globals->_sceneItems.push_front(&scene->_sceneItem10); - _globals->_sceneItems.push_front(&scene->_sceneHotspot8); - _globals->_sceneItems.push_front(&scene->_sceneHotspot9); - _globals->_events.setCursor(CURSOR_WALK); - _globals->_player._canWalk = false; + g_globals->_sceneItems.push_front(&scene->_sceneItem10); + g_globals->_sceneItems.push_front(&scene->_sceneHotspot8); + g_globals->_sceneItems.push_front(&scene->_sceneHotspot9); + g_globals->_events.setCursor(CURSOR_WALK); + g_globals->_player._canWalk = false; } else { scene->setAction(&scene->_sequenceManager, scene, 7715, NULL); } @@ -2104,7 +2104,7 @@ void Scene7700::Object8::doAction(int action) { } void Scene7700::Object9::doAction(int action) { - Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + Scene7700 *scene = (Scene7700 *)g_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: @@ -2118,19 +2118,19 @@ void Scene7700::Object9::doAction(int action) { break; case OBJECT_KEY: if (_frame == 1) { - if (!_globals->getFlag(80)) { + if (!g_globals->getFlag(80)) { scene->_object10.postInit(); scene->_object10.setVisage(7701); scene->_object10.setStrip(4); scene->_object10.setPosition(Common::Point(159, 136)); - _globals->_sceneItems.push_front(&scene->_object10); + g_globals->_sceneItems.push_front(&scene->_object10); scene->_object10.fixPriority(240); } scene->_soundHandler.play(262); scene->_object14.animate(ANIM_MODE_5, NULL); } - _globals->_events.setCursor(CURSOR_WALK); + g_globals->_events.setCursor(CURSOR_WALK); break; default: SceneHotspot::doAction(action); @@ -2138,14 +2138,14 @@ void Scene7700::Object9::doAction(int action) { } void Scene7700::Object10::doAction(int action) { - Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + Scene7700 *scene = (Scene7700 *)g_globals->_sceneManager._scene; if (action == CURSOR_LOOK) { SceneItem::display2(7700, 50); } else if (action == CURSOR_USE) { - _globals->_player._canWalk = true; + g_globals->_player._canWalk = true; RING_INVENTORY._translator._sceneNumber = 1; - _globals->setFlag(80); + g_globals->setFlag(80); scene->_sceneItem10.remove(); scene->_gfxButton._bounds.expandPanes(); scene->_object14.remove(); @@ -2157,7 +2157,7 @@ void Scene7700::Object10::doAction(int action) { } void Scene7700::Object11::doAction(int action) { - Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + Scene7700 *scene = (Scene7700 *)g_globals->_sceneManager._scene; switch (action) { case OBJECT_SCANNER: @@ -2176,18 +2176,18 @@ void Scene7700::Object11::doAction(int action) { if (_frame != 1) { SceneItem::display2(7701, 8); } else { - _globals->setFlag(49); - _globals->_player.disableControl(); + g_globals->setFlag(49); + g_globals->_player.disableControl(); scene->_sceneMode = 7706; - scene->setAction(&scene->_sequenceManager, scene, 7706, &_globals->_player, this, NULL); + scene->setAction(&scene->_sequenceManager, scene, 7706, &g_globals->_player, this, NULL); } break; case OBJECT_EMPTY_JAR: RING_INVENTORY._emptyJar._sceneNumber = 0; RING_INVENTORY._jar._sceneNumber = 1; - _globals->_player.disableControl(); + g_globals->_player.disableControl(); scene->_sceneMode = 7710; - scene->setAction(&scene->_sequenceManager, scene, 7710, &_globals->_player, NULL); + scene->setAction(&scene->_sequenceManager, scene, 7710, &g_globals->_player, NULL); break; default: SceneHotspot::doAction(action); @@ -2195,14 +2195,14 @@ void Scene7700::Object11::doAction(int action) { } void Scene7700::Object12::doAction(int action) { - Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + Scene7700 *scene = (Scene7700 *)g_globals->_sceneManager._scene; if (action == CURSOR_LOOK) { SceneItem::display2(7700, 15); } else if (action == CURSOR_USE) { - if (_globals->getFlag(78)) { + if (g_globals->getFlag(78)) { scene->_sceneMode = 7713; - scene->setAction(&scene->_sequenceManager, scene, 7713, &_globals->_player, NULL); + scene->setAction(&scene->_sequenceManager, scene, 7713, &g_globals->_player, NULL); } else { scene->_sceneMode = 7712; scene->setAction(&scene->_sequenceManager, scene, 7715, NULL); @@ -2215,46 +2215,46 @@ void Scene7700::Object12::doAction(int action) { void Scene7700::signal() { switch (_sceneMode) { case 7701: - _globals->_player.fixPriority(-1); - _globals->_player.setStrip2(-1); - if (_globals->getFlag(78)) { - _globals->_player.enableControl(); + g_globals->_player.fixPriority(-1); + g_globals->_player.setStrip2(-1); + if (g_globals->getFlag(78)) { + g_globals->_player.enableControl(); } else { _sceneMode = 7711; setAction(&_sequenceManager, this, 7711, NULL); } break; case 7702: - _globals->_soundHandler.fadeOut(NULL); - _globals->_sceneManager.changeScene(7600); + g_globals->_soundHandler.fadeOut(NULL); + g_globals->_sceneManager.changeScene(7600); break; case 7703: case 7706: case 7707: case 7711: case 7712: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; case 7704: - _globals->_soundHandler.play(256); + g_globals->_soundHandler.play(256); _prof.setStrip2(4); _prof.setFrame2(1); _prof.setPosition(Common::Point(159, 87)); - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; case 7705: RING_INVENTORY._key._sceneNumber = 1; - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; case 7708: RING_INVENTORY._paper._sceneNumber = 1; - _globals->_player.enableControl(); + g_globals->_player.enableControl(); break; case 7709: - _globals->_events.setCursor(CURSOR_USE); + g_globals->_events.setCursor(CURSOR_USE); break; case 7710: - _globals->_player.enableControl(); + g_globals->_player.enableControl(); SceneItem::display2(7700, 62); break; case 7713: @@ -2269,23 +2269,23 @@ void Scene7700::signal() { void Scene7700::process(Event &event) { Scene::process(event); - if (contains<SceneItem *>(_globals->_sceneItems, &_sceneItem10)) { + if (contains<SceneItem *>(g_globals->_sceneItems, &_sceneItem10)) { if (_gfxButton.process(event)) { _sceneItem10.remove(); _object15.remove(); _object9.remove(); - if (_globals->_sceneObjects->contains(&_object10)) + if (g_globals->_sceneObjects->contains(&_object10)) _object10.remove(); - if (_globals->_sceneObjects->contains(&_object14)) + if (g_globals->_sceneObjects->contains(&_object14)) _object14.remove(); _object19.remove(); _gfxButton._bounds.expandPanes(); - _globals->_player._canWalk = true; + g_globals->_player._canWalk = true; } } if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_p)) { event.handled = true; - if (!_globals->_sceneObjects->contains(&_easterEgg1)) { + if (!g_globals->_sceneObjects->contains(&_easterEgg1)) { _easterEgg1.postInit(); _easterEgg1.setVisage(7708); _easterEgg1.setPosition(Common::Point(163, 50)); @@ -2297,15 +2297,15 @@ void Scene7700::process(Event &event) { } void Scene7700::dispatch() { - if ((_globals->_sceneRegions.indexOf(_globals->_player._position) == 6) || (_globals->_player._position.x < 10)) - _globals->_player.changeZoom(100 - ((_globals->_player._position.y - 68) / 2)); + if ((g_globals->_sceneRegions.indexOf(g_globals->_player._position) == 6) || (g_globals->_player._position.x < 10)) + g_globals->_player.changeZoom(100 - ((g_globals->_player._position.y - 68) / 2)); else - _globals->_player.changeZoom(-1); + g_globals->_player.changeZoom(-1); - if ((_action == 0) && (_globals->_sceneRegions.indexOf(_globals->_player._position) == 30)) { - _globals->_player.disableControl(); + if ((_action == 0) && (g_globals->_sceneRegions.indexOf(g_globals->_player._position) == 30)) { + g_globals->_player.disableControl(); _sceneMode = 7702; - setAction(&_sequenceManager, this, 7702, &_globals->_player, NULL); + setAction(&_sequenceManager, this, 7702, &g_globals->_player, NULL); } Scene::dispatch(); } @@ -2314,33 +2314,33 @@ void Scene7700::postInit(SceneObjectList *OwnerList) { loadScene(7700); Scene::postInit(); setZoomPercents(100, 80, 200, 100); - _globals->setFlag(53); + g_globals->setFlag(53); _field97B = 0; _field979 = 0; _field977 = 0; _stripManager.addSpeaker(&_speakerEText); _stripManager.addSpeaker(&_speakerQText); - _speakerQText._npc = &_globals->_player; + _speakerQText._npc = &g_globals->_player; _speakerEText._npc = &_prof; - _globals->_player.postInit(); - _globals->_player.setVisage(4201); - _globals->_player.animate(ANIM_MODE_1, NULL); + g_globals->_player.postInit(); + g_globals->_player.setVisage(4201); + g_globals->_player.animate(ANIM_MODE_1, NULL); SceneObjectWrapper *wrapper = new SceneObjectWrapper(); - _globals->_player.setObjectWrapper(wrapper); - _globals->_player.setPosition(Common::Point(-19, 68)); - _globals->_player.setStrip2(7); - _globals->_player.fixPriority(95); - _globals->_player.changeZoom(80); - _globals->_player._moveDiff.x = 6; - _globals->_player._moveDiff.y = 3; - _globals->_player.disableControl(); + g_globals->_player.setObjectWrapper(wrapper); + g_globals->_player.setPosition(Common::Point(-19, 68)); + g_globals->_player.setStrip2(7); + g_globals->_player.fixPriority(95); + g_globals->_player.changeZoom(80); + g_globals->_player._moveDiff.x = 6; + g_globals->_player._moveDiff.y = 3; + g_globals->_player.disableControl(); _prof.postInit(); _prof.setVisage(7706); - if (_globals->getFlag(78)) { + if (g_globals->getFlag(78)) { _prof.setStrip2(4); _prof.fixPriority(80); _prof.setPosition(Common::Point(159, 87)); @@ -2414,7 +2414,7 @@ void Scene7700::postInit(SceneObjectList *OwnerList) { _cork.setVisage(7703); _cork.setPosition(Common::Point(32, 128)); - if (_globals->getFlag(49)) + if (g_globals->getFlag(49)) _cork.setFrame(_cork.getFrameCount()); if (RING_INVENTORY._emptyJar._sceneNumber == 7700) { @@ -2422,7 +2422,7 @@ void Scene7700::postInit(SceneObjectList *OwnerList) { _emptyJar.setVisage(7700); _emptyJar.setStrip(8); _emptyJar.setPosition(Common::Point(189, 48)); - _globals->_sceneItems.addItems(&_emptyJar, NULL); + g_globals->_sceneItems.addItems(&_emptyJar, NULL); } _sceneHotspot1._sceneRegionId = 28; _sceneHotspot2._sceneRegionId = 6; @@ -2513,16 +2513,16 @@ void Scene7700::postInit(SceneObjectList *OwnerList) { _sceneHotspot36._useLineNum = 39; _sceneHotspot36._lookLineNum = 42; - _globals->_sceneItems.addItems(&_prof, &_sceneHotspot35, &_object8, &_sceneHotspot34, &_sceneHotspot33, &_sceneHotspot32, NULL); - _globals->_sceneItems.addItems(&_sceneHotspot31, &_sceneHotspot30, &_sceneHotspot29, &_sceneHotspot5, &_sceneHotspot28, &_sceneHotspot27, NULL); - _globals->_sceneItems.addItems(&_sceneHotspot26, &_sceneHotspot25, &_sceneHotspot24, &_sceneHotspot23, &_sceneHotspot22, &_sceneHotspot21, NULL); - _globals->_sceneItems.addItems(&_sceneHotspot20, &_sceneHotspot19, &_sceneHotspot18, &_sceneHotspot17, &_sceneHotspot4, &_sceneHotspot3, NULL); - _globals->_sceneItems.addItems(&_sceneHotspot16, &_sceneHotspot15, &_sceneHotspot2, &_sceneHotspot14, &_cork, &_sceneHotspot1, NULL); - _globals->_sceneItems.addItems(&_sceneHotspot13, &_sceneHotspot12, &_sceneHotspot11, &_object2, &_object1, &_object3, NULL); - _globals->_sceneItems.addItems(&_object6, &_object5, &_object4, &_sceneHotspot6, &_sceneHotspot36, &_sceneItem7, NULL); + g_globals->_sceneItems.addItems(&_prof, &_sceneHotspot35, &_object8, &_sceneHotspot34, &_sceneHotspot33, &_sceneHotspot32, NULL); + g_globals->_sceneItems.addItems(&_sceneHotspot31, &_sceneHotspot30, &_sceneHotspot29, &_sceneHotspot5, &_sceneHotspot28, &_sceneHotspot27, NULL); + g_globals->_sceneItems.addItems(&_sceneHotspot26, &_sceneHotspot25, &_sceneHotspot24, &_sceneHotspot23, &_sceneHotspot22, &_sceneHotspot21, NULL); + g_globals->_sceneItems.addItems(&_sceneHotspot20, &_sceneHotspot19, &_sceneHotspot18, &_sceneHotspot17, &_sceneHotspot4, &_sceneHotspot3, NULL); + g_globals->_sceneItems.addItems(&_sceneHotspot16, &_sceneHotspot15, &_sceneHotspot2, &_sceneHotspot14, &_cork, &_sceneHotspot1, NULL); + g_globals->_sceneItems.addItems(&_sceneHotspot13, &_sceneHotspot12, &_sceneHotspot11, &_object2, &_object1, &_object3, NULL); + g_globals->_sceneItems.addItems(&_object6, &_object5, &_object4, &_sceneHotspot6, &_sceneHotspot36, &_sceneItem7, NULL); _sceneMode = 7701; - setAction(&_sequenceManager, this, 7701, &_globals->_player, NULL); + setAction(&_sequenceManager, this, 7701, &g_globals->_player, NULL); _soundHandler.play(256); } diff --git a/engines/tsage/ringworld/ringworld_speakers.cpp b/engines/tsage/ringworld/ringworld_speakers.cpp index c56639a5b2..dc80df40a3 100644 --- a/engines/tsage/ringworld/ringworld_speakers.cpp +++ b/engines/tsage/ringworld/ringworld_speakers.cpp @@ -51,7 +51,7 @@ void SpeakerGText::setText(const Common::String &msg) { // Set the text Rect textRect; - _globals->gfxManager()._font.getStringBounds(msg.c_str(), textRect, _textWidth); + g_globals->gfxManager()._font.getStringBounds(msg.c_str(), textRect, _textWidth); textRect.center(_sceneObject._position.x, _sceneObject._position.y); _textPos.x = textRect.left; Speaker::setText(msg); @@ -74,13 +74,13 @@ SpeakerPOR::SpeakerPOR() { void SpeakerPOR::SpeakerAction1::signal(){ switch (_actionIndex++) { case 0: - setDelay(_globals->_randomSource.getRandomNumber(60) + 60); + setDelay(g_globals->_randomSource.getRandomNumber(60) + 60); break; case 1: static_cast<SceneObject *>(_owner)->animate(ANIM_MODE_5, this, NULL); break; case 2: - setDelay(_globals->_randomSource.getRandomNumber(10)); + setDelay(g_globals->_randomSource.getRandomNumber(10)); _actionIndex = 0; break; default: diff --git a/engines/tsage/saveload.cpp b/engines/tsage/saveload.cpp index 45e655037d..c261d091dd 100644 --- a/engines/tsage/saveload.cpp +++ b/engines/tsage/saveload.cpp @@ -32,14 +32,14 @@ namespace TsAGE { -Saver *_saver; +Saver *g_saver; SavedObject::SavedObject() { - _saver->addObject(this); + g_saver->addObject(this); } SavedObject::~SavedObject() { - _saver->removeObject(this); + g_saver->removeObject(this); } /*--------------------------------------------------------------------------*/ @@ -52,7 +52,7 @@ Saver::Saver() { Saver::~Saver() { // Internal validation that no saved object is still present int totalLost = 0; - for (SynchronizedList<SavedObject *>::iterator i = _saver->_objList.begin(); i != _saver->_objList.end(); ++i) { + for (SynchronizedList<SavedObject *>::iterator i = g_saver->_objList.begin(); i != g_saver->_objList.end(); ++i) { SavedObject *so = *i; if (so) ++totalLost; @@ -72,7 +72,7 @@ void Serializer::syncPointer(SavedObject **ptr, Common::Serializer::Version minV if (isSaving()) { // Get the object index for the given pointer and write it out if (*ptr) { - idx = _saver->blockIndexOf(*ptr); + idx = g_saver->blockIndexOf(*ptr); assert(idx > 0); } syncAsUint32LE(idx); @@ -82,7 +82,7 @@ void Serializer::syncPointer(SavedObject **ptr, Common::Serializer::Version minV *ptr = NULL; if (idx > 0) // For non-zero (null) pointers, create a record for later resolving it to an address - _saver->addSavedObjectPtr(ptr, idx); + g_saver->addSavedObjectPtr(ptr, idx); } } @@ -120,7 +120,7 @@ void Serializer::syncAsDouble(double &v) { Common::Error Saver::save(int slot, const Common::String &saveName) { assert(!getMacroRestoreFlag()); - Common::StackLock slock1(_globals->_soundManager._serverDisabledMutex); + Common::StackLock slock1(g_globals->_soundManager._serverDisabledMutex); // Signal any objects registered for notification _saveNotifiers.notify(false); @@ -130,7 +130,7 @@ Common::Error Saver::save(int slot, const Common::String &saveName) { _saveSlot = slot; // Set up the serializer - Common::OutSaveFile *saveFile = g_system->getSavefileManager()->openForSaving(_vm->generateSaveName(slot)); + Common::OutSaveFile *saveFile = g_system->getSavefileManager()->openForSaving(g_vm->generateSaveName(slot)); Serializer serializer(NULL, saveFile); serializer.setSaveVersion(TSAGE_SAVEGAME_VERSION); @@ -165,7 +165,7 @@ Common::Error Saver::save(int slot, const Common::String &saveName) { Common::Error Saver::restore(int slot) { assert(!getMacroRestoreFlag()); - Common::StackLock slock1(_globals->_soundManager._serverDisabledMutex); + Common::StackLock slock1(g_globals->_soundManager._serverDisabledMutex); // Signal any objects registered for notification _loadNotifiers.notify(false); @@ -176,7 +176,7 @@ Common::Error Saver::restore(int slot) { _unresolvedPtrs.clear(); // Set up the serializer - Common::InSaveFile *saveFile = g_system->getSavefileManager()->openForLoading(_vm->generateSaveName(slot)); + Common::InSaveFile *saveFile = g_system->getSavefileManager()->openForLoading(g_vm->generateSaveName(slot)); Serializer serializer(saveFile, NULL); // Read in the savegame header @@ -279,10 +279,10 @@ void Saver::writeSavegameHeader(Common::OutSaveFile *out, tSageSavegameHeader &h // Create a thumbnail and save it Graphics::Surface *thumb = new Graphics::Surface(); - Graphics::Surface s = _globals->_screenSurface.lockSurface(); + Graphics::Surface s = g_globals->_screenSurface.lockSurface(); ::createThumbnail(thumb, (const byte *)s.pixels, SCREEN_WIDTH, SCREEN_HEIGHT, thumbPalette); Graphics::saveThumbnail(*out, *thumb); - _globals->_screenSurface.unlockSurface(); + g_globals->_screenSurface.unlockSurface(); delete thumb; // Write out the save date/time @@ -293,7 +293,7 @@ void Saver::writeSavegameHeader(Common::OutSaveFile *out, tSageSavegameHeader &h out->writeSint16LE(td.tm_mday); out->writeSint16LE(td.tm_hour); out->writeSint16LE(td.tm_min); - out->writeUint32LE(_globals->_events.getFrameNumber()); + out->writeUint32LE(g_globals->_events.getFrameNumber()); } /** @@ -335,7 +335,7 @@ void Saver::removeObject(SavedObject *obj) { * Returns true if any savegames exist */ bool Saver::savegamesExist() const { - Common::String slot1Name = _vm->generateSaveName(1); + Common::String slot1Name = g_vm->generateSaveName(1); Common::InSaveFile *saveFile = g_system->getSavefileManager()->openForLoading(slot1Name); bool result = saveFile != NULL; diff --git a/engines/tsage/saveload.h b/engines/tsage/saveload.h index d0876d1cb6..52b23413d4 100644 --- a/engines/tsage/saveload.h +++ b/engines/tsage/saveload.h @@ -232,7 +232,7 @@ public: void listObjects(); }; -extern Saver *_saver; +extern Saver *g_saver; } // End of namespace TsAGE diff --git a/engines/tsage/scenes.cpp b/engines/tsage/scenes.cpp index 69985382bd..baa114218e 100644 --- a/engines/tsage/scenes.cpp +++ b/engines/tsage/scenes.cpp @@ -40,7 +40,7 @@ SceneManager::SceneManager() { _previousScene = 0; _fadeMode = FADEMODE_GRADUAL; _scrollerRect = Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); - _saver->addListener(this); + g_saver->addListener(this); _objectCount = 0; _loadMode = 0; } @@ -60,7 +60,7 @@ void SceneManager::checkScene() { _nextSceneNumber = -1; } - _globals->dispatchSounds(); + g_globals->dispatchSounds(); } void SceneManager::sceneChange() { @@ -73,16 +73,16 @@ void SceneManager::sceneChange() { } // Clear the scene objects - SynchronizedList<SceneObject *>::iterator io = _globals->_sceneObjects->begin(); - while (io != _globals->_sceneObjects->end()) { + SynchronizedList<SceneObject *>::iterator io = g_globals->_sceneObjects->begin(); + while (io != g_globals->_sceneObjects->end()) { SceneObject *sceneObj = *io; ++io; sceneObj->removeObject(); } // Clear the hotspot list - SynchronizedList<SceneItem *>::iterator ii = _globals->_sceneItems.begin(); - while (ii != _globals->_sceneItems.end()) { + SynchronizedList<SceneItem *>::iterator ii = g_globals->_sceneItems.begin(); + while (ii != g_globals->_sceneItems.end()) { SceneItem *sceneItem = *ii; ++ii; sceneItem->remove(); @@ -107,37 +107,37 @@ void SceneManager::sceneChange() { // Ensure that the same number of objects are registered now as when the scene started if (_objectCount > 0) { - assert(_objectCount == _saver->getObjectCount()); + assert(_objectCount == g_saver->getObjectCount()); } - _objectCount = _saver->getObjectCount(); - _globals->_sceneHandler->_delayTicks = 2; + _objectCount = g_saver->getObjectCount(); + g_globals->_sceneHandler->_delayTicks = 2; // Instantiate and set the new scene _scene = getNewScene(); - if (!_saver->getMacroRestoreFlag()) + if (!g_saver->getMacroRestoreFlag()) _scene->postInit(); else _scene->loadScene(activeScreenNumber); } Scene *SceneManager::getNewScene() { - return _globals->_game->createScene(_nextSceneNumber); + return g_globals->_game->createScene(_nextSceneNumber); } void SceneManager::fadeInIfNecessary() { if (_hasPalette) { uint32 adjustData = 0; for (int percent = 0; percent < 100; percent += 5) { - if (_globals->_sceneManager._fadeMode == FADEMODE_IMMEDIATE) + if (g_globals->_sceneManager._fadeMode == FADEMODE_IMMEDIATE) percent = 100; - _globals->_scenePalette.fade((const byte *)&adjustData, false, percent); + g_globals->_scenePalette.fade((const byte *)&adjustData, false, percent); g_system->updateScreen(); g_system->delayMillis(10); } - _globals->_scenePalette.refresh(); + g_globals->_scenePalette.refresh(); _hasPalette = false; } } @@ -147,7 +147,7 @@ void SceneManager::changeScene(int newSceneNumber) { // Fade out the scene ScenePalette scenePalette; uint32 adjustData = 0; - _globals->_scenePalette.clearListeners(); + g_globals->_scenePalette.clearListeners(); scenePalette.getPalette(); for (int percent = 100; percent >= 0; percent -= 5) { @@ -157,7 +157,7 @@ void SceneManager::changeScene(int newSceneNumber) { // Stop any objects that were animating SynchronizedList<SceneObject *>::iterator i; - for (i = _globals->_sceneObjects->begin(); i != _globals->_sceneObjects->end(); ++i) { + for (i = g_globals->_sceneObjects->begin(); i != g_globals->_sceneObjects->end(); ++i) { SceneObject *sceneObj = *i; Common::Point pt(0, 0); sceneObj->addMover(NULL, &pt); @@ -168,10 +168,10 @@ void SceneManager::changeScene(int newSceneNumber) { } // Blank out the screen - _globals->_screenSurface.fillRect(_globals->_screenSurface.getBounds(), 0); + g_globals->_screenSurface.fillRect(g_globals->_screenSurface.getBounds(), 0); // If there are any fading sounds, wait until fading is complete - while (_globals->_soundManager.isFading()) { + while (g_globals->_soundManager.isFading()) { g_system->delayMillis(10); } @@ -180,30 +180,30 @@ void SceneManager::changeScene(int newSceneNumber) { } void SceneManager::setup() { - _saver->addLoadNotifier(SceneManager::loadNotifier); + g_saver->addLoadNotifier(SceneManager::loadNotifier); setBackSurface(); } void SceneManager::setBackSurface() { - int size = _globals->_sceneManager._scene->_backgroundBounds.width() * - _globals->_sceneManager._scene->_backgroundBounds.height(); + int size = g_globals->_sceneManager._scene->_backgroundBounds.width() * + g_globals->_sceneManager._scene->_backgroundBounds.height(); if (size > 96000) { - if (_globals->_sceneManager._scene->_backgroundBounds.width() <= SCREEN_WIDTH) { + if (g_globals->_sceneManager._scene->_backgroundBounds.width() <= SCREEN_WIDTH) { // Standard size creation - _globals->_sceneManager._scene->_backSurface.create(SCREEN_WIDTH, SCREEN_HEIGHT * 3 / 2); - _globals->_sceneManager._scrollerRect = Rect(0, 30, SCREEN_WIDTH, SCREEN_HEIGHT - 30); + g_globals->_sceneManager._scene->_backSurface.create(SCREEN_WIDTH, SCREEN_HEIGHT * 3 / 2); + g_globals->_sceneManager._scrollerRect = Rect(0, 30, SCREEN_WIDTH, SCREEN_HEIGHT - 30); } else { // Wide screen needs extra space to allow for scrolling - _globals->_sceneManager._scene->_backSurface.create(SCREEN_WIDTH * 3 / 2, SCREEN_HEIGHT); - _globals->_sceneManager._scrollerRect = Rect(80, 0, SCREEN_WIDTH - 80, SCREEN_HEIGHT); + g_globals->_sceneManager._scene->_backSurface.create(SCREEN_WIDTH * 3 / 2, SCREEN_HEIGHT); + g_globals->_sceneManager._scrollerRect = Rect(80, 0, SCREEN_WIDTH - 80, SCREEN_HEIGHT); } } else { - _globals->_sceneManager._scene->_backSurface.create( - _globals->_sceneManager._scene->_backgroundBounds.width(), - _globals->_sceneManager._scene->_backgroundBounds.height() + g_globals->_sceneManager._scene->_backSurface.create( + g_globals->_sceneManager._scene->_backgroundBounds.width(), + g_globals->_sceneManager._scene->_backgroundBounds.height() ); - _globals->_sceneManager._scrollerRect = Rect(80, 20, SCREEN_WIDTH - 80, SCREEN_HEIGHT - 20); + g_globals->_sceneManager._scrollerRect = Rect(80, 20, SCREEN_WIDTH - 80, SCREEN_HEIGHT - 20); } } @@ -212,9 +212,9 @@ void SceneManager::saveListener(int saveMode) { void SceneManager::loadNotifier(bool postFlag) { if (postFlag) { - if (_globals->_sceneManager._scene->_activeScreenNumber != -1) - _globals->_sceneManager._scene->loadSceneData(_globals->_sceneManager._scene->_activeScreenNumber); - _globals->_sceneManager._hasPalette = true; + if (g_globals->_sceneManager._scene->_activeScreenNumber != -1) + g_globals->_sceneManager._scene->loadSceneData(g_globals->_sceneManager._scene->_activeScreenNumber); + g_globals->_sceneManager._hasPalette = true; } } @@ -226,17 +226,17 @@ void SceneManager::setBgOffset(const Common::Point &pt, int loadCount) { void SceneManager::listenerSynchronize(Serializer &s) { s.validate("SceneManager"); - if (s.isLoading() && !_globals->_sceneManager._scene) + if (s.isLoading() && !g_globals->_sceneManager._scene) // Loading a savegame straight from the launcher, so instantiate a blank placeholder scene // in order for the savegame loading to work correctly - _globals->_sceneManager._scene = new Scene(); + g_globals->_sceneManager._scene = new Scene(); // Depreciated: the background scene objects used to be located here uint32 unused = 0; s.syncAsUint32LE(unused); s.syncAsSint32LE(_sceneNumber); - s.syncAsUint16LE(_globals->_sceneManager._scene->_activeScreenNumber); + s.syncAsUint16LE(g_globals->_sceneManager._scene->_activeScreenNumber); if (s.isLoading()) { changeScene(_sceneNumber); @@ -247,8 +247,8 @@ void SceneManager::listenerSynchronize(Serializer &s) { } } - _globals->_sceneManager._scrollerRect.synchronize(s); - SYNC_POINTER(_globals->_scrollFollower); + g_globals->_sceneManager._scrollerRect.synchronize(s); + SYNC_POINTER(g_globals->_scrollFollower); s.syncAsSint16LE(_loadMode); } @@ -307,8 +307,8 @@ void Scene::dispatch() { void Scene::loadScene(int sceneNum) { debug(1, "loadScene(%d)", sceneNum); _screenNumber = sceneNum; - if (_globals->_scenePalette.loadPalette(sceneNum)) - _globals->_sceneManager._hasPalette = true; + if (g_globals->_scenePalette.loadPalette(sceneNum)) + g_globals->_sceneManager._hasPalette = true; loadSceneData(sceneNum); } @@ -317,19 +317,19 @@ void Scene::loadSceneData(int sceneNum) { _activeScreenNumber = sceneNum; // Get the basic scene size - byte *data = _resourceManager->getResource(RES_BITMAP, sceneNum, 9999); + byte *data = g_resourceManager->getResource(RES_BITMAP, sceneNum, 9999); _backgroundBounds = Rect(0, 0, READ_LE_UINT16(data), READ_LE_UINT16(data + 2)); - _globals->_sceneManager._scene->_sceneBounds.contain(_backgroundBounds); + g_globals->_sceneManager._scene->_sceneBounds.contain(_backgroundBounds); DEALLOCATE(data); // Set up a surface for storing the scene background SceneManager::setBackSurface(); // Load the data lists for the scene - _globals->_walkRegions.load(sceneNum); + g_globals->_walkRegions.load(sceneNum); // Load the item regions of the scene - _globals->_sceneRegions.load(sceneNum); + g_globals->_sceneRegions.load(sceneNum); // Load the priority regions _priorities.load(sceneNum); @@ -337,13 +337,13 @@ void Scene::loadSceneData(int sceneNum) { // Initialize the section enabled list Common::set_to(&_enabledSections[0], &_enabledSections[16 * 16], 0xffff); - _globals->_sceneOffset.x = (_sceneBounds.left / 160) * 160; - _globals->_sceneOffset.y = (_sceneBounds.top / 100) * 100; - _globals->_paneRefreshFlag[0] = 1; - _globals->_paneRefreshFlag[1] = 1; - _globals->_sceneManager._loadMode = 1; - _globals->_sceneManager._sceneLoadCount = 0; - _globals->_sceneManager._sceneBgOffset = Common::Point(0, 0); + g_globals->_sceneOffset.x = (_sceneBounds.left / 160) * 160; + g_globals->_sceneOffset.y = (_sceneBounds.top / 100) * 100; + g_globals->_paneRefreshFlag[0] = 1; + g_globals->_paneRefreshFlag[1] = 1; + g_globals->_sceneManager._loadMode = 1; + g_globals->_sceneManager._sceneLoadCount = 0; + g_globals->_sceneManager._sceneBgOffset = Common::Point(0, 0); // Load the background for the scene loadBackground(0, 0); @@ -355,35 +355,35 @@ void Scene::loadBackground(int xAmount, int yAmount) { _sceneBounds.contain(_backgroundBounds); _sceneBounds.left &= ~3; _sceneBounds.right &= ~3; - _globals->_sceneOffset.x &= ~3; + g_globals->_sceneOffset.x &= ~3; if ((_sceneBounds.top != _oldSceneBounds.top) || (_sceneBounds.left != _oldSceneBounds.left)) { - if (_globals->_sceneManager._loadMode == 0) { - _globals->_paneRefreshFlag[0] = 2; - _globals->_paneRefreshFlag[1] = 2; - _globals->_sceneManager._loadMode = 2; + if (g_globals->_sceneManager._loadMode == 0) { + g_globals->_paneRefreshFlag[0] = 2; + g_globals->_paneRefreshFlag[1] = 2; + g_globals->_sceneManager._loadMode = 2; } _oldSceneBounds = _sceneBounds; } - _globals->_sceneOffset.x = (_sceneBounds.left / 160) * 160; - _globals->_sceneOffset.y = (_sceneBounds.top / 100) * 100; + g_globals->_sceneOffset.x = (_sceneBounds.left / 160) * 160; + g_globals->_sceneOffset.y = (_sceneBounds.top / 100) * 100; if ((_backgroundBounds.width() / 160) == 3) - _globals->_sceneOffset.x = 0; + g_globals->_sceneOffset.x = 0; if ((_backgroundBounds.height() / 100) == 3) - _globals->_sceneOffset.y = 0; + g_globals->_sceneOffset.y = 0; - if ((_globals->_sceneOffset.x != _globals->_prevSceneOffset.x) || - (_globals->_sceneOffset.y != _globals->_prevSceneOffset.y)) { + if ((g_globals->_sceneOffset.x != g_globals->_prevSceneOffset.x) || + (g_globals->_sceneOffset.y != g_globals->_prevSceneOffset.y)) { // Change has happend, so refresh background - _globals->_prevSceneOffset = _globals->_sceneOffset; + g_globals->_prevSceneOffset = g_globals->_sceneOffset; refreshBackground(xAmount, yAmount); } } void Scene::refreshBackground(int xAmount, int yAmount) { - if (_globals->_sceneManager._scene->_activeScreenNumber == -1) + if (g_globals->_sceneManager._scene->_activeScreenNumber == -1) return; // Set the quadrant ranges @@ -428,7 +428,7 @@ void Scene::refreshBackground(int xAmount, int yAmount) { (xSectionSrc + 1) * 160, (ySectionSrc + 1) * 100); Rect destBounds(xSectionDest * 160, ySectionDest * 100, (xSectionDest + 1) * 160, (ySectionDest + 1) * 100); - if (_vm->getGameID() == GType_BlueForce) { + if (g_vm->getGameID() == GType_BlueForce) { // For Blue Force, if the scene has an interface area, exclude it from the copy srcBounds.bottom = MIN<int16>(srcBounds.bottom, BF_GLOBALS._interfaceY); destBounds.bottom = MIN<int16>(destBounds.bottom, BF_GLOBALS._interfaceY); @@ -460,7 +460,7 @@ void Scene::drawBackgroundObjects() { // Handle updating object priority if (!(obj->_flags & OBJFLAG_FIXED_PRIORITY)) { obj->_priority = MIN((int)obj->_position.y - 1, - (int)_globals->_sceneManager._scene->_backgroundBounds.bottom); + (int)g_globals->_sceneManager._scene->_backgroundBounds.bottom); } } @@ -513,35 +513,35 @@ void Scene::setZoomPercents(int yStart, int minPercent, int yEnd, int maxPercent void Game::restartGame() { if (MessageDialog::show(RESTART_MSG, CANCEL_BTN_STRING, RESTART_BTN_STRING) == 1) - _globals->_game->restart(); + g_globals->_game->restart(); } void Game::saveGame() { - if (!_vm->canSaveGameStateCurrently()) + if (!g_vm->canSaveGameStateCurrently()) MessageDialog::show(SAVING_NOT_ALLOWED_MSG, OK_BTN_STRING); else { // Show the save dialog - handleSaveLoad(true, _globals->_sceneHandler->_saveGameSlot, _globals->_sceneHandler->_saveName); + handleSaveLoad(true, g_globals->_sceneHandler->_saveGameSlot, g_globals->_sceneHandler->_saveName); } } void Game::restoreGame() { - if (!_vm->canLoadGameStateCurrently()) + if (!g_vm->canLoadGameStateCurrently()) MessageDialog::show(RESTORING_NOT_ALLOWED_MSG, OK_BTN_STRING); else { // Show the load dialog - handleSaveLoad(false, _globals->_sceneHandler->_loadGameSlot, _globals->_sceneHandler->_saveName); + handleSaveLoad(false, g_globals->_sceneHandler->_loadGameSlot, g_globals->_sceneHandler->_saveName); } } void Game::quitGame() { if (MessageDialog::show(QUIT_CONFIRM_MSG, CANCEL_BTN_STRING, QUIT_BTN_STRING) == 1) - _vm->quitGame(); + g_vm->quitGame(); } void Game::handleSaveLoad(bool saveFlag, int &saveSlot, Common::String &saveName) { const EnginePlugin *plugin = 0; - EngineMan.findGame(_vm->getGameId(), &plugin); + EngineMan.findGame(g_vm->getGameId(), &plugin); GUI::SaveLoadChooser *dialog; if (saveFlag) dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save")); @@ -569,7 +569,7 @@ void Game::execute() { activeFlag = true; } } - } while (activeFlag && !_vm->shouldQuit()); + } while (activeFlag && !g_vm->shouldQuit()); } } // End of namespace TsAGE diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index ce82ac2fc7..71e69283e7 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -54,7 +54,7 @@ SoundManager::SoundManager() { SoundManager::~SoundManager() { if (__sndmgrReady) { Common::StackLock slock(_serverDisabledMutex); - _vm->_mixer->stopAll(); + g_vm->_mixer->stopAll(); for (Common::List<Sound *>::iterator i = _soundList.begin(); i != _soundList.end(); ) { Sound *s = *i; @@ -84,9 +84,9 @@ SoundManager::~SoundManager() { void SoundManager::postInit() { if (!__sndmgrReady) { - _saver->addSaveNotifier(&SoundManager::saveNotifier); - _saver->addLoadNotifier(&SoundManager::loadNotifier); - _saver->addListener(this); + g_saver->addSaveNotifier(&SoundManager::saveNotifier); + g_saver->addLoadNotifier(&SoundManager::loadNotifier); + g_saver->addListener(this); // I originally separated the sound manager update method into a separate thread, since @@ -211,7 +211,7 @@ void SoundManager::installDriver(int driverNum) { case ROLAND_DRIVER_NUM: case ADLIB_DRIVER_NUM: { // Handle loading bank infomation - byte *bankData = _resourceManager->getResource(RES_BANK, driverNum, 0, true); + byte *bankData = g_resourceManager->getResource(RES_BANK, driverNum, 0, true); if (bankData) { // Install the patch bank data _sfInstallPatchBank(driver, bankData); @@ -1383,7 +1383,7 @@ void SoundManager::_sfUnInstallDriver(SoundDriver *driver) { } void SoundManager::_sfInstallPatchBank(SoundDriver *driver, const byte *bankData) { - driver->installPatch(bankData, _vm->_memoryManager.getSize(bankData)); + driver->installPatch(bankData, g_vm->_memoryManager.getSize(bankData)); } /** @@ -1536,7 +1536,7 @@ void Sound::play(int soundNum) { } void Sound::stop() { - _globals->_soundManager.removeFromPlayList(this); + g_globals->_soundManager.removeFromPlayList(this); _unPrime(); } @@ -1560,7 +1560,7 @@ void Sound::_prime(int soundResID, bool dontQueue) { // Sound number specified _isEmpty = false; _remoteReceiver = NULL; - byte *soundData = _resourceManager->getResource(RES_SOUND, soundResID, 0); + byte *soundData = g_resourceManager->getResource(RES_SOUND, soundResID, 0); _soundManager->checkResVersion(soundData); _group = _soundManager->determineGroup(soundData); _sndResPriority = _soundManager->extractPriority(soundData); @@ -1568,7 +1568,7 @@ void Sound::_prime(int soundResID, bool dontQueue) { _soundManager->extractTrackInfo(&_trackInfo, soundData, _group); for (int idx = 0; idx < _trackInfo._numTracks; ++idx) { - _channelData[idx] = _resourceManager->getResource(RES_SOUND, soundResID, _trackInfo._chunks[idx]); + _channelData[idx] = g_resourceManager->getResource(RES_SOUND, soundResID, _trackInfo._chunks[idx]); } DEALLOCATE(soundData); @@ -1667,7 +1667,7 @@ bool Sound::isMuted() const { } void Sound::pause(bool flag) { - Common::StackLock slock(_globals->_soundManager._serverSuspendedMutex); + Common::StackLock slock(g_globals->_soundManager._serverSuspendedMutex); if (flag) ++_pausedCount; @@ -1678,7 +1678,7 @@ void Sound::pause(bool flag) { } void Sound::mute(bool flag) { - Common::StackLock slock(_globals->_soundManager._serverSuspendedMutex); + Common::StackLock slock(g_globals->_soundManager._serverSuspendedMutex); if (flag) ++_mutedCount; @@ -1689,7 +1689,7 @@ void Sound::mute(bool flag) { } void Sound::fade(int fadeDest, int fadeSteps, int fadeTicks, bool stopAfterFadeFlag) { - Common::StackLock slock(_globals->_soundManager._serverSuspendedMutex); + Common::StackLock slock(g_globals->_soundManager._serverSuspendedMutex); if (fadeDest > 127) fadeDest = 127; @@ -1789,7 +1789,7 @@ void Sound::_soPrimeSound(bool dontQueue) { } void Sound::_soSetTimeIndex(uint timeIndex) { - Common::StackLock slock(_globals->_soundManager._serverSuspendedMutex); + Common::StackLock slock(g_globals->_soundManager._serverSuspendedMutex); if (timeIndex != _timer) { _soundManager->_soTimeIndexFlag = true; @@ -2392,13 +2392,13 @@ int Sound::_soFindSound(VoiceTypeStruct *vtStruct, int channelNum) { ASound::ASound(): EventHandler() { _action = NULL; _cueValue = -1; - if (_globals) - _globals->_sounds.push_back(this); + if (g_globals) + g_globals->_sounds.push_back(this); } ASound::~ASound() { - if (_globals) - _globals->_sounds.remove(this); + if (g_globals) + g_globals->_sounds.remove(this); } void ASound::synchronize(Serializer &s) { @@ -2544,7 +2544,7 @@ AdlibSoundDriver::AdlibSoundDriver(): SoundDriver() { _groupData.v2 = 0; _groupData.pData = &adlib_group_data[0]; - _mixer = _vm->_mixer; + _mixer = g_vm->_mixer; _sampleRate = _mixer->getOutputRate(); _opl = OPL::Config::create(); assert(_opl); @@ -2858,7 +2858,7 @@ SoundBlasterDriver::SoundBlasterDriver(): SoundDriver() { static byte const group_data[] = { 3, 1, 1, 0, 0xff }; _groupData.pData = group_data; - _mixer = _vm->_mixer; + _mixer = g_vm->_mixer; _sampleRate = _mixer->getOutputRate(); _audioStream = NULL; _channelData = NULL; @@ -2904,7 +2904,7 @@ void SoundBlasterDriver::playSound(const byte *channelData, int dataOffset, int _channelData = channelData + dataOffset; // Make a copy of the buffer - int dataSize = _vm->_memoryManager.getSize(channelData); + int dataSize = g_vm->_memoryManager.getSize(channelData); byte *soundData = (byte *)malloc(dataSize - dataOffset); Common::copy(_channelData, _channelData + (dataSize - dataOffset), soundData); diff --git a/engines/tsage/tsage.cpp b/engines/tsage/tsage.cpp index ca63c4c3e0..90fdecc90b 100644 --- a/engines/tsage/tsage.cpp +++ b/engines/tsage/tsage.cpp @@ -32,11 +32,11 @@ namespace TsAGE { -TSageEngine *_vm = NULL; +TSageEngine *g_vm = NULL; TSageEngine::TSageEngine(OSystem *system, const tSageGameDescription *gameDesc) : Engine(system), _gameDescription(gameDesc) { - _vm = this; + g_vm = this; DebugMan.addDebugChannel(kRingDebugScripts, "scripts", "Scripts debugging"); _debugger = new Debugger(); } @@ -61,27 +61,27 @@ bool TSageEngine::hasFeature(EngineFeature f) const { } void TSageEngine::initialize() { - _saver = new Saver(); + g_saver = new Saver(); // Set up the resource manager - _resourceManager = new ResourceManager(); - if (_vm->getFeatures() & GF_DEMO) { + g_resourceManager = new ResourceManager(); + if (g_vm->getFeatures() & GF_DEMO) { // Add the single library file associated with the demo - _resourceManager->addLib(getPrimaryFilename()); - _globals = new Globals(); - - } else if (_vm->getGameID() == GType_Ringworld) { - _resourceManager->addLib("RING.RLB"); - _resourceManager->addLib("TSAGE.RLB"); - _globals = new Globals(); - - } else if (_vm->getGameID() == GType_BlueForce) { - _resourceManager->addLib("BLUE.RLB"); - if (_vm->getFeatures() & GF_FLOPPY) { - _resourceManager->addLib("FILES.RLB"); - _resourceManager->addLib("TSAGE.RLB"); + g_resourceManager->addLib(getPrimaryFilename()); + g_globals = new Globals(); + + } else if (g_vm->getGameID() == GType_Ringworld) { + g_resourceManager->addLib("RING.RLB"); + g_resourceManager->addLib("TSAGE.RLB"); + g_globals = new Globals(); + + } else if (g_vm->getGameID() == GType_BlueForce) { + g_resourceManager->addLib("BLUE.RLB"); + if (g_vm->getFeatures() & GF_FLOPPY) { + g_resourceManager->addLib("FILES.RLB"); + g_resourceManager->addLib("TSAGE.RLB"); } - _globals = new BlueForce::BlueForceGlobals(); + g_globals = new BlueForce::BlueForceGlobals(); // Setup the user interface BF_GLOBALS._uiElements.setup(Common::Point(0, BF_INTERFACE_Y - 2)); @@ -90,26 +90,26 @@ void TSageEngine::initialize() { BF_GLOBALS.reset(); } - _globals->gfxManager().setDefaults(); + g_globals->gfxManager().setDefaults(); // Setup sound settings syncSoundSettings(); } void TSageEngine::deinitialize() { - delete _globals; - delete _resourceManager; - delete _saver; - _resourceManager = NULL; - _saver = NULL; + delete g_globals; + delete g_resourceManager; + delete g_saver; + g_resourceManager = NULL; + g_saver = NULL; } Common::Error TSageEngine::run() { // Basic initialisation initialize(); - _globals->_sceneHandler->registerHandler(); - _globals->_game->execute(); + g_globals->_sceneHandler->registerHandler(); + g_globals->_game->execute(); deinitialize(); return Common::kNoError; @@ -119,28 +119,28 @@ Common::Error TSageEngine::run() { * Returns true if it is currently okay to restore a game */ bool TSageEngine::canLoadGameStateCurrently() { - return (_globals->getFlag(50) == 0); + return (g_globals->getFlag(50) == 0); } /** * Returns true if it is currently okay to save the game */ bool TSageEngine::canSaveGameStateCurrently() { - return (_globals->getFlag(50) == 0); + return (g_globals->getFlag(50) == 0); } /** * Load the savegame at the specified slot index */ Common::Error TSageEngine::loadGameState(int slot) { - return _saver->restore(slot); + return g_saver->restore(slot); } /** * Save the game to the given slot index, and with the given name */ Common::Error TSageEngine::saveGameState(int slot, const Common::String &desc) { - return _saver->save(slot, desc); + return g_saver->save(slot, desc); } /** @@ -154,7 +154,7 @@ Common::String TSageEngine::generateSaveName(int slot) { void TSageEngine::syncSoundSettings() { Engine::syncSoundSettings(); - _globals->_soundManager.syncSounds(); + g_globals->_soundManager.syncSounds(); } bool TSageEngine::shouldQuit() { diff --git a/engines/tsage/tsage.h b/engines/tsage/tsage.h index 7bb3c7a989..a4e9240aee 100644 --- a/engines/tsage/tsage.h +++ b/engines/tsage/tsage.h @@ -94,11 +94,11 @@ public: void deinitialize(); }; -extern TSageEngine *_vm; +extern TSageEngine *g_vm; -#define ALLOCATE_HANDLE(x) _vm->_memoryManager.allocate(x) -#define ALLOCATE(x) _vm->_memoryManager.allocate2(x) -#define DEALLOCATE(x) _vm->_memoryManager.deallocate(x) +#define ALLOCATE_HANDLE(x) g_vm->_memoryManager.allocate(x) +#define ALLOCATE(x) g_vm->_memoryManager.allocate2(x) +#define DEALLOCATE(x) g_vm->_memoryManager.deallocate(x) } // End of namespace TsAGE |