diff options
Diffstat (limited to 'engines/tsage')
95 files changed, 10085 insertions, 9560 deletions
diff --git a/engines/tsage/blue_force/blueforce_dialogs.cpp b/engines/tsage/blue_force/blueforce_dialogs.cpp index 23701c9e5b..2f337ac549 100644 --- a/engines/tsage/blue_force/blueforce_dialogs.cpp +++ b/engines/tsage/blue_force/blueforce_dialogs.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/tsage/blue_force/blueforce_dialogs.h b/engines/tsage/blue_force/blueforce_dialogs.h index 76de7d19d9..77017db9d0 100644 --- a/engines/tsage/blue_force/blueforce_dialogs.h +++ b/engines/tsage/blue_force/blueforce_dialogs.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/tsage/blue_force/blueforce_logic.cpp b/engines/tsage/blue_force/blueforce_logic.cpp index 63f84d25e1..e6e71399dc 100644 --- a/engines/tsage/blue_force/blueforce_logic.cpp +++ b/engines/tsage/blue_force/blueforce_logic.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -454,9 +454,10 @@ void Timer::dispatch() { if (_endFrame) { uint32 frameNumber = BF_GLOBALS._events.getFrameNumber(); - if (frameNumber > _endFrame) + if (frameNumber > _endFrame) { // Timer has expired signal(); + } } } @@ -472,7 +473,8 @@ void Timer::set(uint32 delay, EventHandler *endHandler) { /*--------------------------------------------------------------------------*/ TimerExt::TimerExt(): Timer() { - _action = NULL; + _action = nullptr; + _newAction = nullptr; } void TimerExt::set(uint32 delay, EventHandler *endHandler, Action *newAction) { @@ -646,8 +648,6 @@ void FocusObject::postInit(SceneObjectList *OwnerList) { _lookLineNum = 43; _talkLineNum = 44; _useLineNum = -1; - _v90 = 0; - _v92 = 1; SceneExt *scene = (SceneExt *)BF_GLOBALS._sceneManager._scene; scene->_focusObject = this; @@ -656,8 +656,11 @@ void FocusObject::postInit(SceneObjectList *OwnerList) { void FocusObject::synchronize(Serializer &s) { NamedObject::synchronize(s); - s.syncAsSint16LE(_v90); - s.syncAsSint16LE(_v92); + if (s.getVersion() < 12) { + int useless = 0; + s.syncAsSint16LE(useless); + s.syncAsSint16LE(useless); + } } void FocusObject::remove() { @@ -703,7 +706,6 @@ SceneExt::SceneExt(): Scene() { _stripManager._onBegin = SceneExt::startStrip; _stripManager._onEnd = SceneExt::endStrip; - _field372 = _field37A = 0; _savedPlayerEnabled = false; _savedUiEnabled = false; _savedCanWalk = false; @@ -746,6 +748,7 @@ void SceneExt::process(Event &event) { void SceneExt::dispatch() { _timerList.dispatch(); + /* if (_field37A) { if ((--_field37A == 0) && BF_GLOBALS._dayNumber) { if (T2_GLOBALS._uiElements._active && BF_GLOBALS._player._enabled) { @@ -755,6 +758,7 @@ void SceneExt::dispatch() { _field37A = 0; } } + */ Scene::dispatch(); } @@ -762,8 +766,6 @@ void SceneExt::dispatch() { void SceneExt::loadScene(int sceneNum) { Scene::loadScene(sceneNum); - _v51C34.top = 0; - _v51C34.bottom = 300; BF_GLOBALS._sceneHandler->_delayTicks = 1; } @@ -831,7 +833,6 @@ void SceneExt::gunDisplay() { void SceneExt::startStrip() { SceneExt *scene = (SceneExt *)BF_GLOBALS._sceneManager._scene; - scene->_field372 = 1; scene->_savedPlayerEnabled = BF_GLOBALS._player._enabled; if (scene->_savedPlayerEnabled) { @@ -839,21 +840,20 @@ void SceneExt::startStrip() { scene->_savedCanWalk = BF_GLOBALS._player._canWalk; BF_GLOBALS._player.disableControl(); - if (!BF_GLOBALS._v50696 && T2_GLOBALS._uiElements._active) + if (T2_GLOBALS._uiElements._active) T2_GLOBALS._uiElements.hide(); } } void SceneExt::endStrip() { SceneExt *scene = (SceneExt *)BF_GLOBALS._sceneManager._scene; - scene->_field372 = 0; if (scene->_savedPlayerEnabled) { BF_GLOBALS._player.enableControl(); BF_GLOBALS._player._uiEnabled = scene->_savedUiEnabled; BF_GLOBALS._player._canWalk = scene->_savedCanWalk; - if (!BF_GLOBALS._v50696 && T2_GLOBALS._uiElements._active) + if (T2_GLOBALS._uiElements._active) T2_GLOBALS._uiElements.show(); } } @@ -865,38 +865,34 @@ void SceneExt::clearScreen() { /*--------------------------------------------------------------------------*/ PalettedScene::PalettedScene(): SceneExt() { - _field794 = 0; + _hasFader = false; } void PalettedScene::synchronize(Serializer &s) { SceneExt::synchronize(s); - s.syncAsSint16LE(_field794); + s.syncAsSint16LE(_hasFader); } void PalettedScene::postInit(SceneObjectList *OwnerList) { - _field794 = 0; - _palette._field412 = 1; + _hasFader = false; SceneExt::postInit(OwnerList); } void PalettedScene::remove() { SceneExt::remove(); - if (_field794 == 1) { + if (_hasFader) { for (SynchronizedList<SceneObject *>::iterator i = BF_GLOBALS._sceneObjects->begin(); i != BF_GLOBALS._sceneObjects->end(); ++i) (*i)->remove(); BF_GLOBALS._sceneObjects->draw(); BF_GLOBALS._scenePalette.loadPalette(2); - BF_GLOBALS._v51C44 = 1; BF_GLOBALS._sceneManager._hasPalette = true; } - - BF_GLOBALS._scenePalette._field412 = 0; } PaletteFader *PalettedScene::addFader(const byte *arrBufferRGB, int step, Action *action) { - _field794 = 1; + _hasFader = true; return BF_GLOBALS._scenePalette.addFader(arrBufferRGB, 1, step, action); } @@ -909,6 +905,7 @@ void PalettedScene::add2Faders(const byte *arrBufferRGB, int step, int paletteNu void PalettedScene::transition(const byte *arrBufferRGB, int percent, int paletteNum, Action *action, int fromColor1, int fromColor2, int toColor1, int toColor2, bool flag) { byte tmpPalette[768]; + memset(tmpPalette, 0, 768); _palette.loadPalette(paletteNum); _palette.loadPalette(2); @@ -1260,8 +1257,6 @@ void BlueForceInvObjectList::alterInventory(int mode) { setObjectScene(INV_TICKET_BOOK, 60); setObjectScene(INV_MIRANDA_CARD, 60); - BF_GLOBALS._v4CEC4 = 0; - switch (mode) { case 2: if (hasPrintout) diff --git a/engines/tsage/blue_force/blueforce_logic.h b/engines/tsage/blue_force/blueforce_logic.h index 59bc2b7a51..cb3c62dd3a 100644 --- a/engines/tsage/blue_force/blueforce_logic.h +++ b/engines/tsage/blue_force/blueforce_logic.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -139,14 +139,17 @@ public: class NamedObject2: public NamedObject { public: - int _v1, _v2; + int _talkCount; - NamedObject2() { _v1 = _v2 = 0; } + NamedObject2() { _talkCount = 0; } virtual Common::String getClassName() { return "NamedObject2"; } virtual void synchronize(Serializer &s) { NamedObject::synchronize(s); - s.syncAsSint16LE(_v1); - s.syncAsSint16LE(_v2); + if (s.getVersion() < 12) { + int useless = 0; + s.syncAsSint16LE(useless); + } + s.syncAsSint16LE(_talkCount); } }; @@ -177,7 +180,6 @@ public: class FocusObject: public NamedObject { public: - int _v90, _v92; GfxSurface _img; FocusObject(); @@ -196,16 +198,12 @@ private: static void endStrip(); public: AObjectArray _timerList, _objArray2; - int _field372; bool _savedPlayerEnabled; bool _savedUiEnabled; bool _savedCanWalk; - int _field37A; EventHandler *_focusObject; Visage _cursorVisage; - - Rect _v51C34; public: SceneExt(); @@ -228,7 +226,7 @@ public: class PalettedScene: public SceneExt { public: ScenePalette _palette; - int _field794; + bool _hasFader; public: PalettedScene(); diff --git a/engines/tsage/blue_force/blueforce_scenes0.cpp b/engines/tsage/blue_force/blueforce_scenes0.cpp index f1f00599e0..1e94e44b74 100644 --- a/engines/tsage/blue_force/blueforce_scenes0.cpp +++ b/engines/tsage/blue_force/blueforce_scenes0.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -343,7 +343,7 @@ void Scene50::synchronize(Serializer &s) { void Scene50::postInit(SceneObjectList *OwnerList) { SceneExt::postInit(); - BF_GLOBALS._interfaceY = 200; + BF_GLOBALS._interfaceY = SCREEN_HEIGHT; T2_GLOBALS._uiElements._active = false; BF_GLOBALS._player.postInit(); BF_GLOBALS._player.setVisage(830); @@ -419,6 +419,8 @@ void Scene50::postInit(SceneObjectList *OwnerList) { tooltip = &_location8; xp = 75; break; + default: + error("Unexpected tooltip value %d", selectedTooltip); } _timer.set(240, this); @@ -940,7 +942,6 @@ void Scene60::Action3::signal() { scene->_stripManager.start(71, this); break; case 2: - scene->_field1222 = true; BF_GLOBALS._player.enableControl(); remove(); break; @@ -954,7 +955,6 @@ Scene60::Scene60(): SceneExt() { _sceneNumber = 0; _visage = 0; _cursorId = CURSOR_NONE; - _field1222 = false; } void Scene60::synchronize(Serializer &s) { @@ -964,7 +964,10 @@ void Scene60::synchronize(Serializer &s) { s.syncAsSint16LE(_sceneNumber); s.syncAsSint16LE(_visage); s.syncAsSint16LE(_cursorId); - s.syncAsSint16LE(_field1222); + if (s.getVersion() < 11) { + int useless = 0; + s.syncAsSint16LE(useless); + } } void Scene60::postInit(SceneObjectList *OwnerList) { diff --git a/engines/tsage/blue_force/blueforce_scenes0.h b/engines/tsage/blue_force/blueforce_scenes0.h index dd502c5f30..c6f380338d 100644 --- a/engines/tsage/blue_force/blueforce_scenes0.h +++ b/engines/tsage/blue_force/blueforce_scenes0.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -174,8 +174,6 @@ public: int _sceneNumber; int _visage; CursorType _cursorId; - // TODO: Check if really useless in original - bool _field1222; Scene60(); virtual void synchronize(Serializer &s); diff --git a/engines/tsage/blue_force/blueforce_scenes1.cpp b/engines/tsage/blue_force/blueforce_scenes1.cpp index d26e34ae23..1cbebd140e 100644 --- a/engines/tsage/blue_force/blueforce_scenes1.cpp +++ b/engines/tsage/blue_force/blueforce_scenes1.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -176,7 +176,6 @@ void Scene100::postInit(SceneObjectList *OwnerList) { loadScene(101); } BF_GLOBALS._scenePalette.loadPalette(2); - BF_GLOBALS._v51C44 = 1; BF_GLOBALS._interfaceY = SCREEN_HEIGHT; g_globals->_player.postInit(); @@ -232,7 +231,6 @@ void Scene109::Action1::signal() { scene->_text.setup(BF_19840515, this); break; case 3: - BF_GLOBALS._v51C44 = 1; scene->loadScene(115); scene->_protaginist2.show(); @@ -246,7 +244,6 @@ void Scene109::Action1::signal() { scene->_beerSign.show(); scene->_beerSign.setAction(&scene->_action2); - BF_GLOBALS._v501FC = 170; setDelay(60); break; case 4: @@ -401,12 +398,10 @@ void Scene110::Action1::signal() { scene->_object6.show(); scene->_object9.show(); scene->_object10.show(); - BF_GLOBALS._v51C44 = 1; scene->loadScene(110); setDelay(10); break; case 2: - BF_GLOBALS._v51C44 = 1; scene->_object1.animate(ANIM_MODE_5, this); break; case 3: { @@ -1833,8 +1828,6 @@ void Scene125::Action2::signal() { setDelay(20); break; case 2: { - BF_GLOBALS._v501FA = 10; - BF_GLOBALS._v51C44 = 1; Common::Point destPos(202, 94); NpcMover *mover = new NpcMover(); BF_GLOBALS._player.addMover(mover, &destPos, this); @@ -2311,7 +2304,6 @@ void Scene140::Action1::signal() { setDelay(60); // No break on purpose case 13: - BF_GLOBALS._v51C44 = 1; BF_GLOBALS._sceneManager.changeScene(150); default: break; @@ -2337,9 +2329,6 @@ void Scene140::postInit(SceneObjectList *OwnerList) { _object1.changeZoom(100); _object1.hide(); - BF_GLOBALS._v5020C = 0; - BF_GLOBALS._v501F8 = 300; - BF_GLOBALS._v501FC = 90; BF_GLOBALS._sound1.play(7); _object2.setAction(&_action1); @@ -2640,7 +2629,6 @@ void Scene160::Action2::signal() { BF_GLOBALS._sound1.stop(); // End of hack - BF_GLOBALS._v51C44 = 1; BF_GLOBALS._sceneManager.changeScene(200); break; default: @@ -2788,9 +2776,6 @@ void Scene180::postInit(SceneObjectList *OwnerList) { setZoomPercents(121, 60, 125, 70); if ((BF_GLOBALS._bookmark == bLyleStoppedBy) && (BF_GLOBALS._dayNumber == 1)) { - BF_GLOBALS._v501FC = 87; - BF_GLOBALS._v501FA = _sceneBounds.left + 10; - // CHECKME: BF_GLOBALS._v50206 = 18; ?? _sceneMessage.setup(THE_NEXT_DAY); _sceneMode = 6; setAction(&_sceneMessage, this); @@ -2799,9 +2784,6 @@ void Scene180::postInit(SceneObjectList *OwnerList) { BF_GLOBALS._mapLocationId = 4; } else if (((BF_GLOBALS._bookmark == bDroppedOffLyle) && (BF_GLOBALS._dayNumber == 3)) || ((BF_GLOBALS._bookmark == bDoneAtLyles) && (BF_GLOBALS._dayNumber == 4))) { - BF_GLOBALS._v501FC = 87; - BF_GLOBALS._v501FA = _sceneBounds.left + 10; - // CHECKME: BF_GLOBALS._v50206 = 18; ?? _sceneMessage.setup(THE_NEXT_DAY); _sceneMode = 6; setAction(&_sceneMessage, this); diff --git a/engines/tsage/blue_force/blueforce_scenes1.h b/engines/tsage/blue_force/blueforce_scenes1.h index ddde200370..8b65c97bb2 100644 --- a/engines/tsage/blue_force/blueforce_scenes1.h +++ b/engines/tsage/blue_force/blueforce_scenes1.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/tsage/blue_force/blueforce_scenes2.cpp b/engines/tsage/blue_force/blueforce_scenes2.cpp index c992afe620..65ff85155f 100644 --- a/engines/tsage/blue_force/blueforce_scenes2.cpp +++ b/engines/tsage/blue_force/blueforce_scenes2.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -1603,7 +1603,6 @@ void Scene271::signal() { } break; case 12: - BF_GLOBALS._v51C44 = 0; BF_GLOBALS._sound1.changeSound(67); BF_GLOBALS._sceneManager.changeScene(280); break; @@ -1617,7 +1616,6 @@ void Scene271::signal() { _field2E16 = 1; break; case 2704: - BF_GLOBALS._v51C44 = 1; BF_GLOBALS._sound1.fadeOut2(NULL); BF_GLOBALS._sceneManager.changeScene(690); break; @@ -1649,7 +1647,6 @@ void Scene271::signal() { addFader((const byte *)&black, 2, this); break; case 2712: - BF_GLOBALS._v51C44 = 1; BF_GLOBALS._sound1.fadeOut2(NULL); BF_GLOBALS._sceneManager.changeScene(180); break; @@ -1657,7 +1654,6 @@ void Scene271::signal() { BF_GLOBALS._player.enableControl(); break; case 2714: - BF_GLOBALS._v51C44 = 1; BF_GLOBALS._sceneManager.changeScene(560); break; case 2715: @@ -1752,7 +1748,7 @@ void Scene280::Action1::signal() { case 1: scene->_jake.setStrip(2); scene->_jake.setFrame(1); - scene->_jake.animate(ANIM_MODE_8, NULL); + scene->_jake.animate(ANIM_MODE_8, 0, NULL); scene->_jake._numFrames = 5; scene->_stripManager.start(2800, this); diff --git a/engines/tsage/blue_force/blueforce_scenes2.h b/engines/tsage/blue_force/blueforce_scenes2.h index 17e749d7a1..6ae324517a 100644 --- a/engines/tsage/blue_force/blueforce_scenes2.h +++ b/engines/tsage/blue_force/blueforce_scenes2.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/tsage/blue_force/blueforce_scenes3.cpp b/engines/tsage/blue_force/blueforce_scenes3.cpp index 81e4af6e97..0f7324f5c8 100644 --- a/engines/tsage/blue_force/blueforce_scenes3.cpp +++ b/engines/tsage/blue_force/blueforce_scenes3.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -564,7 +564,6 @@ void Scene300::dispatch() { if ((BF_GLOBALS._player._position.y < 59) && (BF_GLOBALS._player._position.x > 137) && (_sceneMode != 6308) && (_sceneMode != 7308)) { - // The original was setting a useless global variable (removed) _sceneMode = 6308; BF_GLOBALS._player.disableControl(); ADD_MOVER(BF_GLOBALS._player, BF_GLOBALS._player._position.x + 20, @@ -967,7 +966,6 @@ void Scene315::Action1::signal() { /*--------------------------------------------------------------------------*/ Scene315::Scene315() { - BF_GLOBALS._v51C44 = 1; _field1B6C = _field139C = 0; if (BF_GLOBALS._dayNumber == 0) BF_GLOBALS._dayNumber = 1; @@ -977,12 +975,19 @@ Scene315::Scene315() { _doorOpened = false; _invGreenCount = _bookGreenCount = 0; _invGangCount = _bookGangCount = 0; + + _stripNumber = 0; + _field1398 = 0; + _currentCursor = INV_NONE; } void Scene315::synchronize(Serializer &s) { SceneExt::synchronize(s); - s.syncAsSint16LE(_field1390); + if (s.getVersion() < 11) { + int useless = 0; + s.syncAsSint16LE(useless); + } s.syncAsSint16LE(_stripNumber); s.syncAsSint16LE(_field1398); s.syncAsSint16LE(_invGreenCount); @@ -1399,7 +1404,7 @@ bool Scene325::Item1::startAction(CursorType action, Event &event) { void Scene325::postInit(SceneObjectList *OwnerList) { SceneExt::postInit(); loadScene(325); - BF_GLOBALS._interfaceY = 200; + BF_GLOBALS._interfaceY = SCREEN_HEIGHT; BF_GLOBALS.clearFlag(fCanDrawGun); if (BF_GLOBALS._dayNumber == 0) @@ -1973,12 +1978,7 @@ void Scene340::Action8::signal() { setDelay(6); break; - case 4: - remove(); - break; default: - // This is present in the original game - warning("Bugs"); remove(); break; } @@ -2868,9 +2868,9 @@ void Scene350::checkGun() { void Scene355::Doorway::synchronize(Serializer &s) { NamedObject::synchronize(s); - s.syncAsSint16LE(_v1); - s.syncAsSint16LE(_v2); - s.syncAsSint16LE(_v3); + s.syncAsSint16LE(_mode1356Count); + s.syncAsSint16LE(_talkCount); + s.syncAsSint16LE(_onDuty); } bool Scene355::Doorway::startAction(CursorType action, Event &event) { @@ -2890,9 +2890,9 @@ bool Scene355::Doorway::startAction(CursorType action, Event &event) { return true; case CURSOR_TALK: if (BF_GLOBALS._dayNumber >= 5) { - switch (_v2) { + switch (_talkCount) { case 0: - ++_v2; + ++_talkCount; BF_GLOBALS._sound1.play(109); BF_GLOBALS._player.disableControl(); scene->_sceneMode = 0; @@ -2920,7 +2920,7 @@ bool Scene355::Doorway::startAction(CursorType action, Event &event) { BF_GLOBALS._player.disableControl(); scene->_sceneMode = 3562; scene->setAction(&scene->_sequenceManager, scene, 3562, &BF_GLOBALS._player, NULL); - _v3 = !_v3 ? 1 : 0; + _onDuty = !_onDuty; return true; default: break; @@ -3355,14 +3355,14 @@ bool Scene355::Item11::startAction(CursorType action, Event &event) { return true; case CURSOR_TALK: if (BF_GLOBALS._dayNumber == 5) { - switch (scene->_doorway._v2) { + switch (scene->_doorway._talkCount) { case 0: BF_GLOBALS._player.disableControl(); scene->_sceneMode = 0; BF_GLOBALS.setFlag(fTookTrailerAmmo); scene->_stripManager.start(3575, scene); scene->_lyle._flag = 1; - scene->_doorway._v2 = 1; + scene->_doorway._talkCount = 1; break; case 1: BF_GLOBALS._player.disableControl(); @@ -3534,28 +3534,28 @@ void Scene355::postInit(SceneObjectList *OwnerList) { _doorway.setVisage(355); _doorway.setPosition(Common::Point(193, 105)); _doorway.fixPriority(18); - _doorway._v1 = 0; - _doorway._v3 = 0; + _doorway._mode1356Count = 0; + _doorway._onDuty = false; BF_GLOBALS._sceneItems.push_back(&_doorway); switch (BF_GLOBALS._dayNumber) { case 1: if (!BF_GLOBALS.getFlag(onDuty)) - _doorway._v3 = 1; + _doorway._onDuty = true; else if (BF_INVENTORY.getObjectScene(INV_GREENS_GUN) == 320) - _doorway._v3 = 1; + _doorway._onDuty = true; break; case 2: case 3: case 4: - _doorway._v3 = 1; + _doorway._onDuty = true; break; default: break; } if (BF_GLOBALS._dayNumber == 5) - _doorway._v2 = BF_GLOBALS.getFlag(fTookTrailerAmmo) ? 1 : 0; + _doorway._talkCount = BF_GLOBALS.getFlag(fTookTrailerAmmo) ? 1 : 0; _object8.postInit(); _object8.setVisage(355); @@ -3614,8 +3614,8 @@ void Scene355::postInit(SceneObjectList *OwnerList) { _object11.animate(ANIM_MODE_2); _doorway.setPosition(Common::Point(146, 107)); - _doorway._v3 = 0; - _doorway._v2 = 2; + _doorway._onDuty = false; + _doorway._talkCount = 2; _lyle._flag = 2; _green.postInit(); @@ -3713,16 +3713,16 @@ void Scene355::signal() { _stripManager.start(BF_GLOBALS.getFlag(fBackupIn350) ? 3559 : 3554, this); break; case 1356: - switch (_doorway._v1) { + switch (_doorway._mode1356Count) { case 0: - ++_doorway._v1; + ++_doorway._mode1356Count; _sceneMode = 9999; _stripManager.start(3550, this); break; case 1: _sceneMode = 9999; _stripManager.start(3551, this); - ++_doorway._v1; + ++_doorway._mode1356Count; break; default: break; @@ -3787,7 +3787,7 @@ void Scene355::signal() { T2_GLOBALS._uiElements.addScore(10); } - SceneItem::display2(355, !_doorway._v3 ? 24 : 25); + SceneItem::display2(355, !_doorway._onDuty ? 24 : 25); BF_GLOBALS._player.enableControl(); break; case 4550: @@ -3796,8 +3796,8 @@ void Scene355::signal() { BF_GLOBALS._sound1.play(90); BF_GLOBALS._player._regionBitList |= 0x10; - _doorway._v3 = 0; - _doorway._v2 = 2; + _doorway._onDuty = false; + _doorway._talkCount = 2; _lyle._flag = 2; BF_GLOBALS._player.enableControl(); break; @@ -3867,13 +3867,13 @@ void Scene355::signal() { case 9984: if (BF_GLOBALS._dayNumber == 5) { _sceneMode = 0; - switch (_doorway._v2) { + switch (_doorway._talkCount) { case 0: BF_GLOBALS._sound1.play(109); BF_GLOBALS.setFlag(fTookTrailerAmmo); _stripManager.start(3575, this); _lyle._flag = 1; - ++_doorway._v2; + ++_doorway._talkCount; break; case 1: _stripManager.start(3573, this); @@ -3884,7 +3884,7 @@ void Scene355::signal() { break; } } else if (BF_GLOBALS.getFlag(greenTaken) || (BF_GLOBALS._dayNumber > 1)) { - if (_doorway._v3) { + if (_doorway._onDuty) { SceneItem::display2(355, 23); _sceneMode = 0; signal(); @@ -4009,14 +4009,14 @@ void Scene355::signal() { } case 9997: _sceneMode = 9999; - _doorway._v1 = 2; + _doorway._mode1356Count = 2; _stripManager.start(3562, this); break; case 9998: error("Talkdoor state"); break; case 9999: - if (_doorway._v1 != 2) { + if (_doorway._mode1356Count != 2) { BF_GLOBALS._player.enableControl(); BF_GLOBALS._player._canWalk = false; } else if (BF_GLOBALS.getFlag(gunDrawn)) { @@ -4438,8 +4438,7 @@ void Scene360::postInit(SceneObjectList *OwnerList) { BF_GLOBALS._player._moveDiff.y = 4; BF_GLOBALS._player.enableControl(); - if ((BF_GLOBALS._sceneManager._previousScene == 355) || (BF_GLOBALS._sceneManager._previousScene != 370)) { - // The original was using there a useless variable (now removed) + if (BF_GLOBALS._sceneManager._previousScene != 370) { BF_GLOBALS._player.setPosition(Common::Point(253, 135)); BF_GLOBALS._player.setStrip(2); @@ -4527,7 +4526,7 @@ void Scene360::signal() { BF_GLOBALS._player.enableControl(); break; case 3608: - BF_GLOBALS._sceneManager.changeScene(355); + BF_GLOBALS._sceneManager.changeScene(355); break; case 3610: BF_GLOBALS._sceneManager.changeScene(666); @@ -4652,10 +4651,10 @@ bool Scene370::Green::startAction(CursorType action, Event &event) { switch (action) { case CURSOR_LOOK: - SceneItem::display2(370, (_v2 < 3) ? 10 : 0); + SceneItem::display2(370, (_talkCount < 3) ? 10 : 0); return true; case CURSOR_USE: - if (_v2 != 3) + if (_talkCount != 3) SceneItem::display2(370, 1); else if (BF_INVENTORY.getObjectScene(INV_HANDCUFFS) == 1) SceneItem::display2(370, 26); @@ -4671,14 +4670,14 @@ bool Scene370::Green::startAction(CursorType action, Event &event) { return true; case CURSOR_TALK: BF_GLOBALS._player.disableControl(); - switch (_v2) { + switch (_talkCount) { case 0: - ++_v2; + ++_talkCount; scene->_sceneMode = 3706; scene->setAction(&scene->_sequenceManager, scene, 3706, NULL); break; case 1: - ++_v2; + ++_talkCount; scene->_sceneMode = 3707; scene->_object5.postInit(); @@ -4690,7 +4689,7 @@ bool Scene370::Green::startAction(CursorType action, Event &event) { scene->setAction(&scene->_sequenceManager, scene, 3707, &scene->_harrison, &scene->_object5, NULL); break; case 2: - ++_v2; + ++_talkCount; scene->_sceneMode = 3708; scene->setAction(&scene->_sequenceManager, scene, 3708, this, &scene->_laura, &scene->_harrison, &scene->_object5, &scene->_greensGun, NULL); @@ -4716,7 +4715,7 @@ bool Scene370::Green::startAction(CursorType action, Event &event) { } return true; case INV_HANDCUFFS: - if (_v2 != 3) + if (_talkCount != 3) SceneItem::display2(370, 2); else { T2_GLOBALS._uiElements.addScore(50); @@ -4753,7 +4752,7 @@ bool Scene370::Harrison::startAction(CursorType action, Event &event) { SceneItem::display2(370, 8); return true; case CURSOR_TALK: - if (scene->_green._v2 != 3) { + if (scene->_green._talkCount != 3) { scene->_sceneMode = 3; scene->_stripManager.start(3714, scene); } else if ((BF_INVENTORY.getObjectScene(INV_GREENS_KNIFE) == 1) || diff --git a/engines/tsage/blue_force/blueforce_scenes3.h b/engines/tsage/blue_force/blueforce_scenes3.h index ea9d5f7311..e437fd3a92 100644 --- a/engines/tsage/blue_force/blueforce_scenes3.h +++ b/engines/tsage/blue_force/blueforce_scenes3.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -210,7 +210,6 @@ public: WestExit _westExit; SouthWestExit _swExit; Action1 _action1; - int _field1390; int _stripNumber; int _field1398; int _invGreenCount, _bookGreenCount, _invGangCount; @@ -494,9 +493,10 @@ class Scene355: public PalettedScene { /* Objects */ class Doorway: public NamedObject { public: - int _v1, _v2, _v3; + int _mode1356Count, _talkCount; + bool _onDuty; - Doorway() { _v1 = _v2 = _v3 = 0; } + Doorway() { _mode1356Count = _talkCount = 0; _onDuty = false; } virtual Common::String getClassName() { return "Scene355_Doorway"; } virtual void synchronize(Serializer &s); virtual bool startAction(CursorType action, Event &event); diff --git a/engines/tsage/blue_force/blueforce_scenes4.cpp b/engines/tsage/blue_force/blueforce_scenes4.cpp index a10f311791..50f8499b3b 100644 --- a/engines/tsage/blue_force/blueforce_scenes4.cpp +++ b/engines/tsage/blue_force/blueforce_scenes4.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -39,7 +39,7 @@ namespace BlueForce { void Scene410::Action1::signal() { Scene410 *scene = (Scene410 *)BF_GLOBALS._sceneManager._scene; - switch (scene->_field1FB6++) { + switch (scene->_action1Count++) { case 0: if (BF_GLOBALS.getFlag(fTalkedDriverNoBkup)) { setDelay(3); @@ -136,7 +136,7 @@ void Scene410::Action5::signal() { switch (_actionIndex++) { case 0: - if (scene->_field1FC4 == 0) { + if (!scene->_harrisonMovedFl) { ADD_PLAYER_MOVER(114, 133); } else { ADD_PLAYER_MOVER(195, 139); @@ -167,7 +167,7 @@ void Scene410::Action6::signal() { switch (_actionIndex++) { case 0: - if (scene->_field1FC4 == 0) { + if (!scene->_harrisonMovedFl) { ADD_PLAYER_MOVER(114, 133); } else { ADD_PLAYER_MOVER(126, 99); @@ -243,7 +243,7 @@ bool Scene410::Motorcycle::startAction(CursorType action, Event &event) { } else if (BF_GLOBALS.getFlag(fSearchedTruck) && !BF_GLOBALS._sceneObjects->contains(&scene->_harrison)) { scene->_sceneMode = 4103; scene->signal(); - } else if (scene->_field1FBC != 0) { + } else if (scene->_cuffedDriverFl) { SceneItem::display2(410, 12); } else { scene->_sceneMode = 4103; @@ -260,7 +260,7 @@ bool Scene410::TruckFront::startAction(CursorType action, Event &event) { switch (action) { case CURSOR_USE: - if ((BF_GLOBALS._bookmark < bStoppedFrankie) && (!scene->_field1FBC || !scene->_field1FBA)) + if ((BF_GLOBALS._bookmark < bStoppedFrankie) && (!scene->_cuffedDriverFl || !scene->_harrissonTalkFl)) break; else if (BF_GLOBALS.getFlag(fSearchedTruck)) SceneItem::display2(410, 13); @@ -293,11 +293,11 @@ bool Scene410::Driver::startAction(CursorType action, Event &event) { } else { SceneItem::display2(410, 7); } - } else if (!scene->_field1FBC) { + } else if (!scene->_cuffedDriverFl) { SceneItem::display2(410, 7); - } else if (!scene->_field1FC0) { + } else if (!scene->_getDriverFl) { scene->_sceneMode = 4124; - scene->_field1FC0 = 1; + scene->_getDriverFl = true; T2_GLOBALS._uiElements.addScore(30); scene->signal(); } else { @@ -309,13 +309,13 @@ bool Scene410::Driver::startAction(CursorType action, Event &event) { return true; case INV_HANDCUFFS: if (BF_GLOBALS.getFlag(fCalledBackup)) { - if ((scene->_talkCount < 5) || (scene->_field1FB6 < 1) || (scene->_field1FBC != 0)) + if ((scene->_talkCount < 5) || (scene->_action1Count < 1) || scene->_cuffedDriverFl) break; BF_GLOBALS._player.disableControl(); scene->_sceneMode = 4123; scene->_stripManager.start(4125, scene); - scene->_field1FBC = 1; + scene->_cuffedDriverFl = true; T2_GLOBALS._uiElements.addScore(30); } else { if (BF_GLOBALS.getFlag(fTalkedDriverNoBkup)) { @@ -328,14 +328,14 @@ bool Scene410::Driver::startAction(CursorType action, Event &event) { case INV_TICKET_BOOK: if (!BF_GLOBALS.getFlag(fDriverOutOfTruck)) { return startAction(CURSOR_TALK, event); - } else if (!scene->_field1FC4) { + } else if (!scene->_harrisonMovedFl) { BF_GLOBALS._player.disableControl(); scene->_sceneMode = 2; scene->setAction(&scene->_sequenceManager1, scene, 4120, &scene->_passenger, &BF_GLOBALS._player, NULL); - } else if ((scene->_field1FBC != 0) || (scene->_field1FC2 != 0)) { + } else if (scene->_cuffedDriverFl || scene->_driverOutOfTruckFl) { break; } else { - scene->_field1FC2 = 1; + scene->_driverOutOfTruckFl = true; T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS._player.disableControl(); scene->_sceneMode = 4127; @@ -343,7 +343,7 @@ bool Scene410::Driver::startAction(CursorType action, Event &event) { } return true; case INV_MIRANDA_CARD: - if (scene->_field1FBC == 0) + if (!scene->_cuffedDriverFl) return false; if (BF_GLOBALS.getFlag(readFrankRights)) { @@ -379,15 +379,15 @@ bool Scene410::Passenger::startAction(CursorType action, Event &event) { SET_Y, GLOBALS._sceneManager._scene->_sceneBounds.top + UI_INTERFACE_Y + 2, SET_FONT, 4, SET_BG_COLOR, 1, SET_FG_COLOR, 96, SET_EXT_BGCOLOR, 99, SET_EXT_FGCOLOR, 13, LIST_END); - } else if (!scene->_field1FBA) { + } else if (!scene->_harrissonTalkFl) { SceneItem::display(410, 5, SET_WIDTH, 300, SET_X, 10 + GLOBALS._sceneManager._scene->_sceneBounds.left, SET_Y, GLOBALS._sceneManager._scene->_sceneBounds.top + UI_INTERFACE_Y + 2, SET_FONT, 4, SET_BG_COLOR, 1, SET_FG_COLOR, 96, SET_EXT_BGCOLOR, 99, SET_EXT_FGCOLOR, 13, LIST_END); - } else if (!scene->_field1FBE) { + } else if (!scene->_cuffedPassengerFl) { scene->_sceneMode = 4121; - scene->_field1FBE = 1; + scene->_cuffedPassengerFl = true; T2_GLOBALS._uiElements.addScore(50); scene->signal(); } else @@ -398,7 +398,7 @@ bool Scene410::Passenger::startAction(CursorType action, Event &event) { return true; case INV_HANDCUFFS: if (BF_GLOBALS.getFlag(fCalledBackup)) { - if ((scene->_talkCount < 5) || (scene->_field1FBA != 0)) + if ((scene->_talkCount < 5) || (scene->_harrissonTalkFl)) break; BF_GLOBALS._player.disableControl(); @@ -413,7 +413,7 @@ bool Scene410::Passenger::startAction(CursorType action, Event &event) { } return true; case INV_MIRANDA_CARD: - if (!scene->_field1FBA) + if (!scene->_harrissonTalkFl) break; if (BF_GLOBALS.getFlag(readFrankRights)) { @@ -455,7 +455,7 @@ bool Scene410::Harrison::startAction(CursorType action, Event &event) { SET_FONT, 4, SET_BG_COLOR, 1, SET_FG_COLOR, 32, SET_EXT_BGCOLOR, 49, SET_EXT_FGCOLOR, 13, LIST_END); } - } else if ((scene->_field1FBA != 0) && (scene->_field1FBC != 0)) { + } else if (scene->_harrissonTalkFl && scene->_cuffedDriverFl) { BF_GLOBALS._player.disableControl(); scene->_sceneMode = 4112; scene->_stripManager.start(4113, scene); @@ -463,27 +463,27 @@ bool Scene410::Harrison::startAction(CursorType action, Event &event) { BF_GLOBALS.set2Flags(f1098Frankie); BF_GLOBALS.clearFlag(f1098Marina); } else if ((BF_INVENTORY.getObjectScene(INV_HANDCUFFS) == 1) || - (!scene->_field1FBA && (scene->_talkCount < 5))) { + (!scene->_harrissonTalkFl && (scene->_talkCount < 5))) { SceneItem::display(350, 13, SET_WIDTH, 300, SET_X, 10 + GLOBALS._sceneManager._scene->_sceneBounds.left, SET_Y, GLOBALS._sceneManager._scene->_sceneBounds.top + UI_INTERFACE_Y + 2, SET_FONT, 4, SET_BG_COLOR, 1, SET_FG_COLOR, 32, SET_EXT_BGCOLOR, 49, SET_EXT_FGCOLOR, 13, LIST_END); - } else if (!scene->_field1FBA) { + } else if (!scene->_harrissonTalkFl) { BF_GLOBALS._player.disableControl(); - scene->_field1FBA = 1; - scene->_field1FBE = 1; + scene->_harrissonTalkFl = true; + scene->_cuffedPassengerFl = true; BF_GLOBALS._walkRegions.enableRegion(22); scene->_sceneMode = 4122; scene->_stripManager.start(4112, scene); - } else if (scene->_field1FB6 < 1) { + } else if (scene->_action1Count < 1) { break; - } else if (scene->_field1FBC != 0) { + } else if (scene->_cuffedDriverFl) { error("Error - want to cuff driver, but he's cuffed already"); } else { BF_GLOBALS._player.disableControl(); - scene->_field1FBC = 1; - scene->_field1FC0 = 1; + scene->_cuffedDriverFl = true; + scene->_getDriverFl = true; BF_GLOBALS._walkRegions.enableRegion(22); scene->_sceneMode = 4109; scene->_stripManager.start(4112, scene); @@ -500,20 +500,24 @@ bool Scene410::Harrison::startAction(CursorType action, Event &event) { /*--------------------------------------------------------------------------*/ Scene410::Scene410(): SceneExt() { - _field1FB6 = _talkCount = _field1FBA = _field1FBC = 0; - _field1FBE = _field1FC0 = _field1FC2 = _field1FC4 = 0; + _cuffedDriverFl = _harrissonTalkFl = _driverOutOfTruckFl = false; + _harrisonMovedFl = false; + + _action1Count = _talkCount = 0; + _cuffedPassengerFl = false; + _getDriverFl = false; } void Scene410::synchronize(Serializer &s) { SceneExt::synchronize(s); - s.syncAsSint16LE(_field1FB6); + s.syncAsSint16LE(_action1Count); s.syncAsSint16LE(_talkCount); - s.syncAsSint16LE(_field1FBA); - s.syncAsSint16LE(_field1FBC); - s.syncAsSint16LE(_field1FBE); - s.syncAsSint16LE(_field1FC0); - s.syncAsSint16LE(_field1FC2); - s.syncAsSint16LE(_field1FC4); + s.syncAsSint16LE(_harrissonTalkFl); + s.syncAsSint16LE(_cuffedDriverFl); + s.syncAsSint16LE(_cuffedPassengerFl); + s.syncAsSint16LE(_getDriverFl); + s.syncAsSint16LE(_driverOutOfTruckFl); + s.syncAsSint16LE(_harrisonMovedFl); } void Scene410::postInit(SceneObjectList *OwnerList) { @@ -593,7 +597,7 @@ void Scene410::postInit(SceneObjectList *OwnerList) { _patrolCar.fixPriority(148); _patrolCar.setPosition(Common::Point(39, 168)); - _field1FC4 = 1; + _harrisonMovedFl = true; _sceneMode = 0; signal(); break; @@ -603,10 +607,10 @@ void Scene410::postInit(SceneObjectList *OwnerList) { _driver.remove(); _sceneMode = 0; } else { - _field1FC4 = BF_GLOBALS._v50CC8; - _field1FBA = BF_GLOBALS._v50CC2; - _talkCount = BF_GLOBALS._v50CC6; - _field1FB6 = BF_GLOBALS._v50CC4; + _harrisonMovedFl = BF_GLOBALS._scene410HarrisonMovedFl; + _harrissonTalkFl = BF_GLOBALS._scene410HarrisonTalkFl; + _talkCount = BF_GLOBALS._scene410TalkCount; + _action1Count = BF_GLOBALS._scene410Action1Count; _passenger.setVisage(418); _passenger.setStrip(6); @@ -617,7 +621,7 @@ void Scene410::postInit(SceneObjectList *OwnerList) { _passenger.setStrip(2); _passenger.setFrame(5); } - if (_field1FBA) { + if (_harrissonTalkFl) { _passenger.setVisage(415); _passenger.setStrip(6); _passenger.setFrame(8); @@ -651,7 +655,7 @@ void Scene410::postInit(SceneObjectList *OwnerList) { _patrolCar.setDetails(410, 8, 9, 10, 1, (SceneItem *)NULL); _patrolCar.fixPriority(148); - if (_field1FC4) { + if (_harrisonMovedFl) { _harrison.setPosition(Common::Point(108, 112)); _patrolCar.fixPriority(148); _patrolCar.setPosition(Common::Point(39, 168)); @@ -664,7 +668,7 @@ void Scene410::postInit(SceneObjectList *OwnerList) { _sceneMode = 0; } - _field1FC4 = 1; + _harrisonMovedFl = true; } break; case 50: @@ -686,10 +690,10 @@ void Scene410::signal() { BF_GLOBALS.set2Flags(f1097Frankie); BF_GLOBALS.clearFlag(f1097Marina); - BF_GLOBALS._v50CC8 = _field1FC4; - BF_GLOBALS._v50CC2 = _field1FBA; - BF_GLOBALS._v50CC6 = _talkCount; - BF_GLOBALS._v50CC4 = _field1FB6; + BF_GLOBALS._scene410HarrisonMovedFl = _harrisonMovedFl; + BF_GLOBALS._scene410HarrisonTalkFl = _harrissonTalkFl; + BF_GLOBALS._scene410TalkCount = _talkCount; + BF_GLOBALS._scene410Action1Count = _action1Count; BF_GLOBALS._sceneManager.changeScene(60); break; case 2: @@ -730,7 +734,7 @@ void Scene410::signal() { case 9: _sceneMode = 4106; _stripManager.start(4111, this); - _field1FBA = 1; + _harrissonTalkFl = true; BF_GLOBALS.setFlag(fCuffedFrankie); T2_GLOBALS._uiElements.addScore(30); break; @@ -760,7 +764,7 @@ void Scene410::signal() { break; case 4104: // After call for backup, patrol car is coming - _field1FC4 = 1; + _harrisonMovedFl = true; BF_GLOBALS._player.disableControl(); _sceneMode = 0; setAction(&_sequenceManager1, this, 4104, &_patrolCar, &_harrison, NULL); @@ -1432,21 +1436,21 @@ bool Scene450::Manager::startAction(CursorType action, Event &event) { } else { animate(ANIM_MODE_8, 1, NULL); - if (scene->_field19AC) { + if (scene->_managerCallsWeaselFl) { scene->_sceneMode = 2; - if (scene->_field19AE) { + if (scene->_talkManagerFl) { scene->_stripManager.start(4521, scene); } else { - scene->_field19AE = 1; + scene->_talkManagerFl = true; scene->_stripManager.start(4512, scene); } } else { scene->_sceneMode = 4506; - if (scene->_field19AE) { + if (scene->_talkManagerFl) { scene->setAction(&scene->_sequenceManager, scene, 4518, &BF_GLOBALS._player, this, NULL); } else { scene->_sceneMode = 4506; - scene->_field19AE = 1; + scene->_talkManagerFl = true; scene->setAction(&scene->_sequenceManager, scene, 4506, &BF_GLOBALS._player, this, NULL); } } @@ -1524,13 +1528,13 @@ bool Scene450::Exit::startAction(CursorType action, Event &event) { /*--------------------------------------------------------------------------*/ Scene450::Scene450(): SceneExt() { - _field19AC = _field19AE = 0; + _managerCallsWeaselFl = _talkManagerFl = false; } void Scene450::synchronize(Serializer &s) { SceneExt::synchronize(s); - s.syncAsSint16LE(_field19AC); - s.syncAsSint16LE(_field19AE); + s.syncAsSint16LE(_managerCallsWeaselFl); + s.syncAsSint16LE(_talkManagerFl); } void Scene450::postInit(SceneObjectList *OwnerList) { @@ -1654,7 +1658,7 @@ void Scene450::signal() { case 4510: case 4511: BF_GLOBALS.setFlag(fMgrCallsWeasel); - _field19AC = 1; + _managerCallsWeaselFl = true; _sceneMode = 4503; setAction(&_sequenceManager, this, 4503, &_weasel, &_door, &_manager, NULL); break; diff --git a/engines/tsage/blue_force/blueforce_scenes4.h b/engines/tsage/blue_force/blueforce_scenes4.h index 937c015a4c..9a6df24add 100644 --- a/engines/tsage/blue_force/blueforce_scenes4.h +++ b/engines/tsage/blue_force/blueforce_scenes4.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -116,9 +116,12 @@ public: SpeakerDriver _driverSpeaker; SpeakerShooter _shooterSpeaker; ASoundExt _sound1; - int _field1FB6, _talkCount, _field1FBA; - int _field1FBC, _field1FBE; - int _field1FC0, _field1FC2, _field1FC4; + int _action1Count, _talkCount; + bool _harrissonTalkFl; + bool _cuffedDriverFl; + bool _cuffedPassengerFl; + bool _getDriverFl; + bool _driverOutOfTruckFl, _harrisonMovedFl; Scene410(); virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -254,7 +257,8 @@ public: NamedObject _door, _counterDoor; Exit _exit; NamedHotspot _interior, _shelf, _counter; - int _field19AC, _field19AE; + bool _managerCallsWeaselFl; + bool _talkManagerFl; Scene450(); virtual void synchronize(Serializer &s); diff --git a/engines/tsage/blue_force/blueforce_scenes5.cpp b/engines/tsage/blue_force/blueforce_scenes5.cpp index 0cf487daa9..562facd000 100644 --- a/engines/tsage/blue_force/blueforce_scenes5.cpp +++ b/engines/tsage/blue_force/blueforce_scenes5.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -1623,7 +1623,7 @@ void Scene570::PasswordEntry::process(Event &event) { checkPassword(); remove(); - } else if ((key >= 32) || (key <= 126)) { + } else if ((key >= 32) && (key <= 126)) { // Valid character pressed if (_entryBuffer.size() < 10) _entryBuffer += (char)key; @@ -1772,12 +1772,12 @@ void Scene570::IconManager::refreshList() { } void Scene570::IconManager::addItem(Icon *item) { - item->_mode = _mode; _list.push_back(item); } Scene570::Icon::Icon(): NamedObject() { _iconId = _folderId = 0; + _parentFolderId = 0; } void Scene570::Icon::synchronize(Serializer &s) { @@ -1785,7 +1785,10 @@ void Scene570::Icon::synchronize(Serializer &s) { s.syncAsSint16LE(_iconId); s.syncAsSint16LE(_folderId); s.syncAsSint16LE(_parentFolderId); - s.syncAsSint16LE(_mode); + if (s.getVersion() < 11) { + int useless = 0; + s.syncAsSint16LE(useless); + } } void Scene570::Icon::remove() { @@ -1906,7 +1909,7 @@ bool Scene570::Icon::startAction(CursorType action, Event &event) { } } -void Scene570::Icon::setDetails(int iconId, int folderId, int parentFolderId, int unused, const Common::String &msg) { +void Scene570::Icon::setDetails(int iconId, int folderId, int parentFolderId, const Common::String &msg) { Scene570 *scene = (Scene570 *)BF_GLOBALS._sceneManager._scene; NamedObject::postInit(); @@ -2073,23 +2076,23 @@ void Scene570::signal() { _printerIcon.setDetails(570, 14, 15, -1, 2, (SceneItem *)NULL); _iconManager.setup(2); - _folder1.setDetails(1, 1, 0, 2, SCENE570_C_DRIVE); - _folder2.setDetails(1, 2, 1, 2, SCENE570_RING); - _folder3.setDetails(1, 3, 1, 2, SCENE570_PROTO); - _folder4.setDetails(1, 4, 1, 2, SCENE570_WACKY); + _folder1.setDetails(1, 1, 0, SCENE570_C_DRIVE); + _folder2.setDetails(1, 2, 1, SCENE570_RING); + _folder3.setDetails(1, 3, 1, SCENE570_PROTO); + _folder4.setDetails(1, 4, 1, SCENE570_WACKY); if (!BF_GLOBALS.getFlag(fDecryptedBluePrints)) - _icon1.setDetails(3, 5, 0, 2, SCENE570_COBB); - _icon2.setDetails(2, 7, 0, 2, SCENE570_LETTER); + _icon1.setDetails(3, 5, 0, SCENE570_COBB); + _icon2.setDetails(2, 7, 0, SCENE570_LETTER); if (BF_GLOBALS.getFlag(fDecryptedBluePrints)) - _icon3.setDetails(7, 6, 0, 2, SCENE570_COBB); + _icon3.setDetails(7, 6, 0, SCENE570_COBB); - _icon4.setDetails(6, 8, 1, 2, SCENE570_RINGEXE); - _icon5.setDetails(5, 9, 1, 2, SCENE570_RINGDATA); - _icon6.setDetails(6, 10, 2, 2, SCENE570_PROTOEXE); - _icon7.setDetails(5, 11, 2, 2, SCENE570_PROTODATA); - _icon8.setDetails(6, 12, 3, 2, SCENE570_WACKYEXE); - _icon9.setDetails(5, 13, 3, 2, SCENE570_WACKYDATA); + _icon4.setDetails(6, 8, 1, SCENE570_RINGEXE); + _icon5.setDetails(5, 9, 1, SCENE570_RINGDATA); + _icon6.setDetails(6, 10, 2, SCENE570_PROTOEXE); + _icon7.setDetails(5, 11, 2, SCENE570_PROTODATA); + _icon8.setDetails(6, 12, 3, SCENE570_WACKYEXE); + _icon9.setDetails(5, 13, 3, SCENE570_WACKYDATA); _iconManager.refreshList(); BF_GLOBALS._player.enableControl(); @@ -2104,7 +2107,7 @@ void Scene570::signal() { _object3.setFrame(1); _object3.fixPriority(1); - _icon3.setDetails(7, 6, 0, 2, SCENE570_COBB); + _icon3.setDetails(7, 6, 0, SCENE570_COBB); _iconManager.refreshList(); T2_GLOBALS._uiElements._active = true; T2_GLOBALS._uiElements.show(); diff --git a/engines/tsage/blue_force/blueforce_scenes5.h b/engines/tsage/blue_force/blueforce_scenes5.h index 56bf20c93b..7c5bbb3feb 100644 --- a/engines/tsage/blue_force/blueforce_scenes5.h +++ b/engines/tsage/blue_force/blueforce_scenes5.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -257,7 +257,7 @@ class Scene570: public SceneExt { class Icon: public NamedObject { public: SceneText _sceneText; - int _iconId, _folderId, _parentFolderId, _mode; + int _iconId, _folderId, _parentFolderId; Common::String _text; Icon(); @@ -266,7 +266,7 @@ class Scene570: public SceneExt { virtual void remove(); virtual bool startAction(CursorType action, Event &event); - void setDetails(int iconId, int folderId, int parentFolderId, int unused, const Common::String &msg); + void setDetails(int iconId, int folderId, int parentFolderId, const Common::String &msg); }; class IconManager: public EventHandler { public: diff --git a/engines/tsage/blue_force/blueforce_scenes6.cpp b/engines/tsage/blue_force/blueforce_scenes6.cpp index 9467df7917..92534d3095 100644 --- a/engines/tsage/blue_force/blueforce_scenes6.cpp +++ b/engines/tsage/blue_force/blueforce_scenes6.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -79,7 +79,6 @@ void Scene600::Action1::signal() { } BF_GLOBALS._screenSurface.fillRect(BF_GLOBALS._screenSurface.getBounds(), 0); - BF_GLOBALS._v51C44 = 1; scene->loadScene(999); setDelay(5); break; @@ -88,7 +87,6 @@ void Scene600::Action1::signal() { setDelay(5); break; case 7: - BF_GLOBALS._v51C44 = 0; remove(); break; default: @@ -275,7 +273,7 @@ bool Scene666::Item1::startAction(CursorType action, Event &event) { void Scene666::postInit(SceneObjectList *OwnerList) { BF_GLOBALS._sound1.play(27); SceneExt::postInit(); - BF_GLOBALS._interfaceY = 200; + BF_GLOBALS._interfaceY = SCREEN_HEIGHT; loadScene(999); BF_GLOBALS._screenSurface.fillRect(BF_GLOBALS._screenSurface.getBounds(), 0); diff --git a/engines/tsage/blue_force/blueforce_scenes6.h b/engines/tsage/blue_force/blueforce_scenes6.h index 3f9c14aa11..7ace22f5a6 100644 --- a/engines/tsage/blue_force/blueforce_scenes6.h +++ b/engines/tsage/blue_force/blueforce_scenes6.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/tsage/blue_force/blueforce_scenes7.cpp b/engines/tsage/blue_force/blueforce_scenes7.cpp index 4cdd2f3f15..268c755299 100644 --- a/engines/tsage/blue_force/blueforce_scenes7.cpp +++ b/engines/tsage/blue_force/blueforce_scenes7.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -148,7 +148,7 @@ void Scene710::postInit(SceneObjectList *OwnerList) { BF_GLOBALS._sound1.fadeSound(14); _soundExt1.fadeSound(48); - _v51C34.set(40, 0, 280, 240); + BF_GLOBALS._player.postInit(); BF_GLOBALS._player.hide(); BF_GLOBALS._player._moveDiff = Common::Point(4, 2); diff --git a/engines/tsage/blue_force/blueforce_scenes7.h b/engines/tsage/blue_force/blueforce_scenes7.h index 161d94cc2c..91fb4c5ab2 100644 --- a/engines/tsage/blue_force/blueforce_scenes7.h +++ b/engines/tsage/blue_force/blueforce_scenes7.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/tsage/blue_force/blueforce_scenes8.cpp b/engines/tsage/blue_force/blueforce_scenes8.cpp index 9a20788b6a..6855fd41b9 100644 --- a/engines/tsage/blue_force/blueforce_scenes8.cpp +++ b/engines/tsage/blue_force/blueforce_scenes8.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -577,17 +577,15 @@ bool Scene810::Lyle::startAction(CursorType action, Event &event) { if ((BF_GLOBALS.getFlag(shownLyleRapsheet)) || (BF_GLOBALS.getFlag(shownLyleCrate1))){ scene->_sceneMode = 8141; } else { - // Doublecheck on shownLyleCrate1 removed: useless scene->_sceneMode = 8144; } } else { if ((BF_GLOBALS.getFlag(shownLyleRapsheet)) || (BF_GLOBALS.getFlag(shownLyleCrate1))) { scene->_sceneMode = 8129; - } else { // if (BF_GLOBALS.getFlag(shownLyleCrate1)) { + } else { scene->_sceneMode = 8132; - // doublecheck Present in the original, may hide a bug in the original - //} else - // scene->_sceneMode = 8121; + // Double check on ShownLyleCrate1 present in the original, may hide a bug in the original + // The original was then setting _sceneMode 8121 } } } @@ -1071,7 +1069,6 @@ void Scene810::postInit(SceneObjectList *OwnerList) { setAction(&_sequenceManager1, this, 8107, &BF_GLOBALS._player, &_lyle, NULL); break; case 935: - BF_GLOBALS._v51C44 = 1; BF_GLOBALS._scenePalette.loadPalette(2); _lyle.remove(); @@ -1804,13 +1801,11 @@ void Scene830::signal() { _sceneMode = 832; BF_GLOBALS._scenePalette.clearListeners(); addFader((const byte *)&black, 5, this); - BF_GLOBALS._v51C44 = 0; break; case 12: _sceneMode = 831; BF_GLOBALS._scenePalette.clearListeners(); addFader((const byte *)&black, 5, this); - BF_GLOBALS._v51C44 = 0; break; case 13: BF_GLOBALS._sceneManager.changeScene(850); @@ -1963,7 +1958,7 @@ void Scene840::BoatKeysInset::postInit(SceneObjectList *OwnerList) { _waveKeys.setDetails(840, 53, 8, -1, 2, (SceneItem *)NULL); } - _v1B4 = _v1B6 = 0; + _usedRentalKeys = _usedWaveKeys = false; } void Scene840::BoatKeysInset::remove() { @@ -2072,7 +2067,7 @@ bool Scene840::BoatKeysInset::RentalKeys::startAction(CursorType action, Event & BF_INVENTORY.setObjectScene(INV_RENTAL_KEYS, 1); T2_GLOBALS._uiElements.addScore(30); - scene->_boatKeysInset._v1B4 = 1; + scene->_boatKeysInset._usedRentalKeys = true; remove(); } return true; @@ -2090,7 +2085,7 @@ bool Scene840::BoatKeysInset::WaveKeys::startAction(CursorType action, Event &ev SceneItem::display2(840, 56); BF_INVENTORY.setObjectScene(INV_WAVE_KEYS, 1); T2_GLOBALS._uiElements.addScore(50); - scene->_boatKeysInset._v1B6 = 1; + scene->_boatKeysInset._usedWaveKeys = true; remove(); } else { SceneItem::display2(840, 9); @@ -2101,6 +2096,15 @@ bool Scene840::BoatKeysInset::WaveKeys::startAction(CursorType action, Event &ev } } +void Scene840::BoatKeysInset::synchronize(Serializer &s) { + FocusObject::synchronize(s); + + if (s.getVersion() >= 12) { + s.syncAsSint16LE(_usedWaveKeys); + s.syncAsSint16LE(_usedRentalKeys); + } +} + bool Scene840::BoatKeys::startAction(CursorType action, Event &event) { Scene840 *scene = (Scene840 *)BF_GLOBALS._sceneManager._scene; @@ -2472,10 +2476,10 @@ void Scene840::signal() { _boatKeysInset.setDetails(840, 50, 8, 51); break; case 8412: - if (_boatKeysInset._v1B6) { + if (_boatKeysInset._usedWaveKeys) { _sceneMode = 8409; setAction(&_sequenceManager1, this, 8409, &BF_GLOBALS._player, &_carter, &_doors, NULL); - } else if (!_boatKeysInset._v1B4) { + } else if (!_boatKeysInset._usedRentalKeys) { BF_GLOBALS._player.enableControl(); } else { _sceneMode = 3; diff --git a/engines/tsage/blue_force/blueforce_scenes8.h b/engines/tsage/blue_force/blueforce_scenes8.h index ef5ef81563..140327e85d 100644 --- a/engines/tsage/blue_force/blueforce_scenes8.h +++ b/engines/tsage/blue_force/blueforce_scenes8.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -348,8 +348,9 @@ class Scene840: public PalettedScene { public: RentalKeys _rentalKeys; WaveKeys _waveKeys; - int _v1B4, _v1B6; + bool _usedRentalKeys,_usedWaveKeys; + virtual void synchronize(Serializer &s); virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void remove(); virtual void process(Event &event); diff --git a/engines/tsage/blue_force/blueforce_scenes9.cpp b/engines/tsage/blue_force/blueforce_scenes9.cpp index 52115b95fe..53000d6997 100644 --- a/engines/tsage/blue_force/blueforce_scenes9.cpp +++ b/engines/tsage/blue_force/blueforce_scenes9.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -516,7 +516,7 @@ void Scene900::postInit(SceneObjectList *OwnerList) { _door.setPosition(Common::Point(847, 45)); _door._flag = 1; - if ((BF_GLOBALS._sceneManager._previousScene == 880) || (BF_GLOBALS._sceneManager._previousScene != 910)) { + if (BF_GLOBALS._sceneManager._previousScene != 910) { BF_GLOBALS._walkRegions.disableRegion(26); BF_GLOBALS._player.disableControl(); if (BF_GLOBALS._bookmark == bFinishedWGreen) { @@ -840,14 +840,14 @@ bool Scene910::Nico::startAction(CursorType action, Event &event) { if (BF_GLOBALS._nico910State >= 4) return NamedObject::startAction(action, event); - if (BF_GLOBALS._v4CEE6 < 4) - BF_GLOBALS._v4CEE6++; + if (BF_GLOBALS._nico910Talk < 4) + BF_GLOBALS._nico910Talk++; - if (BF_GLOBALS._v4CEE6 == 2) { + if (BF_GLOBALS._nico910Talk == 2) { scene->_sceneMode = 13; scene->_stripManager.start(9105, scene); } else - scene->_stripManager.start(9103 + BF_GLOBALS._v4CEE6, &BF_GLOBALS._stripProxy); + scene->_stripManager.start(9103 + BF_GLOBALS._nico910Talk, &BF_GLOBALS._stripProxy); return true; break; case INV_COLT45: @@ -887,14 +887,14 @@ bool Scene910::Nico::startAction(CursorType action, Event &event) { if (BF_GLOBALS._nico910State >= 4) return NamedObject::startAction(action, event); - if (BF_GLOBALS._v4CEE6 < 4) - BF_GLOBALS._v4CEE6++; + if (BF_GLOBALS._nico910Talk < 4) + BF_GLOBALS._nico910Talk++; - if (BF_GLOBALS._v4CEE6 == 2) { + if (BF_GLOBALS._nico910Talk == 2) { scene->_sceneMode = 13; scene->_stripManager.start(9105, scene); } else - scene->_stripManager.start(9103 + BF_GLOBALS._v4CEE6, &BF_GLOBALS._stripProxy); + scene->_stripManager.start(9103 + BF_GLOBALS._nico910Talk, &BF_GLOBALS._stripProxy); return true; break; @@ -966,16 +966,16 @@ bool Scene910::Stuart::startAction(CursorType action, Event &event) { return true; break; case CURSOR_TALK: - if (BF_GLOBALS._v4CEE8 < 3) - BF_GLOBALS._v4CEE8++; + if (BF_GLOBALS._stuart910Talk < 3) + BF_GLOBALS._stuart910Talk++; - scene->_stripManager.start(9107 + BF_GLOBALS._v4CEE8, &BF_GLOBALS._stripProxy); + scene->_stripManager.start(9107 + BF_GLOBALS._stuart910Talk, &BF_GLOBALS._stripProxy); return true; break; case INV_COLT45: if ((BF_GLOBALS.getFlag(gunDrawn)) && (BF_GLOBALS.getFlag(fGunLoaded)) && (BF_GLOBALS.getHasBullets())){ BF_GLOBALS._player.disableControl(); - if (BF_GLOBALS._v4CEE4 == 2) { + if (BF_GLOBALS._stuart910State == 2) { scene->_sceneMode = 9132; scene->setAction(&scene->_sequenceManager1, scene, 9132, &scene->_stuart, NULL); return NamedObject::startAction(action, event); @@ -1422,6 +1422,10 @@ void Scene910::Object13::setupBreaker(int x, int y, int mode, int8 frameNumber) BF_GLOBALS._sceneItems.push_front(this); } +Scene910::Object25::Object25() { + _field90 = _field92 = 0; +} + void Scene910::Object25::synchronize(Serializer &s) { NamedObject::synchronize(s); s.syncAsSint16LE(_field90); @@ -1874,7 +1878,7 @@ bool Scene910::Item2::startAction(CursorType action, Event &event) { bool Scene910::Item3::startAction(CursorType action, Event &event) { Scene910 *scene = (Scene910 *)BF_GLOBALS._sceneManager._scene; - if ((action == CURSOR_TALK) && (BF_GLOBALS._nico910State == 4) && (BF_GLOBALS._v4CEE4 == 0)) { + if ((action == CURSOR_TALK) && (BF_GLOBALS._nico910State == 4) && (BF_GLOBALS._stuart910State == 0)) { BF_GLOBALS._player.disableControl(); scene->_sceneMode = 15; scene->_stripManager.start(9102, scene); @@ -1962,7 +1966,6 @@ void Scene910::postInit(SceneObjectList *OwnerList) { loadScene(910); BF_GLOBALS._sound1.changeSound(99); - BF_GLOBALS._v51C44 = 0; _stripManager.addSpeaker(&_gameTextSpeaker); _stripManager.addSpeaker(&_jakeJacketSpeaker); @@ -2054,7 +2057,7 @@ void Scene910::postInit(SceneObjectList *OwnerList) { || (BF_GLOBALS._sceneManager._previousScene == 300)) { BF_GLOBALS._sceneManager._previousScene = 900; BF_GLOBALS._nico910State = 0; - BF_GLOBALS._v4CEE4 = 0; + BF_GLOBALS._stuart910State = 0; } _field2DE0 = 0; @@ -2146,7 +2149,7 @@ void Scene910::postInit(SceneObjectList *OwnerList) { _nico.setVisage(913); _nico.setPosition(Common::Point(262, 124)); _nico.setStrip(6); - BF_GLOBALS._v4CEE6 = 0; + BF_GLOBALS._nico910Talk = 0; BF_GLOBALS._nico910State = 1; _nico.setDetails(910, 63, 64, 67, 5, &_item4); BF_GLOBALS._v4CECA = 2; @@ -2273,7 +2276,6 @@ void Scene910::signal() { break; case 10: BF_GLOBALS._player.disableControl(); - BF_GLOBALS._v51C44 = 0; BF_GLOBALS._sceneManager.changeScene(935); break; case 11: @@ -2307,12 +2309,11 @@ void Scene910::signal() { case 15: _stuart.postInit(); _stuart.setDetails(910, 66, 67, 68, 5, &_nico); - BF_GLOBALS._v4CEE8 = 0; + BF_GLOBALS._stuart910Talk = 0; _sceneMode = 9121; setAction(&_sequenceManager1, this, 9121, &_stuart, NULL); break; case 14: - BF_GLOBALS._v51C44 = 1; BF_GLOBALS._sceneManager.changeScene(940); break; case 16: @@ -2348,7 +2349,7 @@ void Scene910::signal() { case 18: BF_GLOBALS._player._strip = 7; BF_GLOBALS._player._frame = 1; - if (BF_GLOBALS._v4CEE4 == 3) { + if (BF_GLOBALS._stuart910State == 3) { if (_field2DE4 == 0) { _field2DE4 = 1; _sceneMode = 9142; @@ -2372,7 +2373,6 @@ void Scene910::signal() { break; case 19: BF_GLOBALS._deathReason = 14; - BF_GLOBALS._v51C44 = 1; BF_GLOBALS._sceneManager.changeScene(666); break; case 20: @@ -2388,7 +2388,6 @@ void Scene910::signal() { BF_GLOBALS.clearFlag(fGotPointsForSearchingDA); else BF_GLOBALS.setFlag(fGotPointsForSearchingDA); - BF_GLOBALS._v51C44 = 1; BF_GLOBALS._sceneManager.changeScene(900); break; case 9102: @@ -2461,7 +2460,7 @@ void Scene910::signal() { BF_GLOBALS._player.disableControl(); _nico.postInit(); _nico.setDetails(910, 63, 64, 65, 5, &_item4); - BF_GLOBALS._v4CEE6 = 0; + BF_GLOBALS._nico910Talk = 0; _shadow.postInit(); _action2.remove(); _sceneMode = 9116; @@ -2482,7 +2481,6 @@ void Scene910::signal() { // No break on purpose case 9137: BF_GLOBALS._deathReason = 16; - BF_GLOBALS._v51C44 = 1; BF_GLOBALS._sceneManager.changeScene(666); break; case 9119: @@ -2500,7 +2498,7 @@ void Scene910::signal() { break; case 9121: _item3.setDetails(7, 910, 96, 60, 61, 3); - BF_GLOBALS._v4CEE4 = 2; + BF_GLOBALS._stuart910State = 2; if (BF_GLOBALS._nico910State == 4) { _sceneMode = 20; _stripManager.start(9115, this); @@ -2584,7 +2582,7 @@ void Scene910::signal() { _yellowCord.hide(); _sceneMode = 9136; setAction(&_sequenceManager1, this, 9136, &BF_GLOBALS._player, &_stuart, &_yellowCord, NULL); - BF_GLOBALS._v4CEE4 = 3; + BF_GLOBALS._stuart910State = 3; break; case 11: _sceneMode = 9137; @@ -2607,13 +2605,13 @@ void Scene910::signal() { _stuart.postInit(); _nico.setDetails(910, 72, 73, 74, 3, (SceneItem *)NULL); _stuart.setDetails(910, 66, 67, 68, 5, &_nico); - BF_GLOBALS._v4CEE8 = 0; + BF_GLOBALS._stuart910Talk = 0; _sceneMode = 9121; setAction(&_sequenceManager1, this, 9121, &_stuart, NULL); break; case 9126: _sceneMode = 19; - if (BF_GLOBALS._v4CEE4 == 0) + if (BF_GLOBALS._stuart910State == 0) signal(); else _stripManager.start(9115, this); @@ -2622,7 +2620,6 @@ void Scene910::signal() { // No break on purpose case 9134: BF_GLOBALS._deathReason = 17; - BF_GLOBALS._v51C44 = 1; BF_GLOBALS._sceneManager.changeScene(666); break; case 9130: @@ -2633,14 +2630,12 @@ void Scene910::signal() { break; case 9132: BF_GLOBALS._player.enableControl(); - BF_GLOBALS._v4CEE4 = 4; + BF_GLOBALS._stuart910State = 4; BF_GLOBALS._deathReason = 13; - BF_GLOBALS._v51C44 = 1; BF_GLOBALS._sceneManager.changeScene(666); break; case 9135: BF_GLOBALS._deathReason = 15; - BF_GLOBALS._v51C44 = 1; BF_GLOBALS._sceneManager.changeScene(666); break; case 9136: @@ -2685,7 +2680,6 @@ void Scene910::signal() { break; case 9143: if (BF_GLOBALS._nico910State == 0) { - BF_GLOBALS._v51C44 = 1; BF_GLOBALS._sceneManager.changeScene(920); } else { SceneItem::display(910, 89, SET_WIDTH, 312, @@ -2704,7 +2698,6 @@ void Scene910::signal() { break; case 9148: BF_GLOBALS._deathReason = 23; - BF_GLOBALS._v51C44 = 1; BF_GLOBALS._sceneManager.changeScene(666); break; case 9149: @@ -2984,7 +2977,6 @@ bool Scene920::Item8::startAction(CursorType action, Event &event) { // On the other hand, it's not really important as just after the hero leaves the scene // so the variable is no longer used. // scene->_oldCoord = &scene; - _field10 = 1; } else { scene->_sceneMode = 9201; scene->setAction(&scene->_sequenceManager1, scene, 9201, &BF_GLOBALS._player, NULL); @@ -3577,7 +3569,7 @@ void Scene935::postInit(SceneObjectList *OwnerList) { PalettedScene::postInit(); loadScene(935); - BF_GLOBALS._interfaceY = 200; + BF_GLOBALS._interfaceY = SCREEN_HEIGHT; BF_GLOBALS._player.disableControl(); _visualSpeaker._textMode = ALIGN_CENTER; _visualSpeaker._hideObjects = false; @@ -3812,7 +3804,7 @@ void Scene940::postInit(SceneObjectList *OwnerList) { BF_GLOBALS._sound1.play(115); BF_GLOBALS._dayNumber = 6; - BF_GLOBALS._interfaceY = 200; + BF_GLOBALS._interfaceY = SCREEN_HEIGHT; T2_GLOBALS._uiElements._active = false; _gameTextSpeaker2._speakerName = "SENTTEXT"; diff --git a/engines/tsage/blue_force/blueforce_scenes9.h b/engines/tsage/blue_force/blueforce_scenes9.h index 74708b94de..52935debd4 100644 --- a/engines/tsage/blue_force/blueforce_scenes9.h +++ b/engines/tsage/blue_force/blueforce_scenes9.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -188,6 +188,7 @@ class Scene910: public PalettedScene { class Object25: public NamedObject { int _field90, _field92; public: + Object25(); void setupHiddenSwitch(int x, int y, int arg8, int argA); virtual void synchronize(Serializer &s); virtual bool startAction(CursorType action, Event &event); diff --git a/engines/tsage/blue_force/blueforce_speakers.cpp b/engines/tsage/blue_force/blueforce_speakers.cpp index 2a57616640..ea73cc9d7f 100644 --- a/engines/tsage/blue_force/blueforce_speakers.cpp +++ b/engines/tsage/blue_force/blueforce_speakers.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -63,8 +63,8 @@ void VisualSpeaker::synchronize(Serializer &s) { s.syncAsSint16LE(_offsetPos.y); } -void VisualSpeaker::proc12(Action *action) { - Speaker::proc12(action); +void VisualSpeaker::startSpeaking(Action *action) { + Speaker::startSpeaking(action); _textPos = Common::Point(_offsetPos.x + BF_GLOBALS._sceneManager._scene->_sceneBounds.left, _offsetPos.y + BF_GLOBALS._sceneManager._scene->_sceneBounds.top); _numFrames = 0; diff --git a/engines/tsage/blue_force/blueforce_speakers.h b/engines/tsage/blue_force/blueforce_speakers.h index e406a50fbe..dfe6f51039 100644 --- a/engines/tsage/blue_force/blueforce_speakers.h +++ b/engines/tsage/blue_force/blueforce_speakers.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -51,7 +51,7 @@ public: virtual Common::String getClassName() { return "VisualSpeaker"; } virtual void synchronize(Serializer &s); virtual void remove(); - virtual void proc12(Action *action); + virtual void startSpeaking(Action *action); virtual void setText(const Common::String &msg); }; diff --git a/engines/tsage/configure.engine b/engines/tsage/configure.engine new file mode 100644 index 0000000000..2b8edf8266 --- /dev/null +++ b/engines/tsage/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine tsage "TsAGE" yes diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp index 9e7d84105a..d1faca5dac 100644 --- a/engines/tsage/converse.cpp +++ b/engines/tsage/converse.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -449,8 +449,20 @@ int ConversationChoiceDialog::execute(const Common::StringArray &choiceList) { // Draw the dialog draw(); + g_globals->_events.showCursor(); + // Force the display of an arrow cursor during discussions in R2R + if (g_vm->getGameID() == GType_Ringworld2) + R2_GLOBALS._events.setCursor(CURSOR_ARROW); + + // WORKAROUND: On-screen dialogs are really meant to use a GfxManager instance + // for their lifetime, which prevents saving or loading. Since I don't want to spend a lot + // of time refactoring this already working dialog, fake it by putting a dummy gfxmanager at + // the end of the gfx manager list so as to prevent saving or loading + GfxManager gfxManager; + GLOBALS._gfxManagers.push_back(&gfxManager); + // Event handling loop Event event; while (!g_vm->shouldQuit()) { @@ -502,6 +514,7 @@ int ConversationChoiceDialog::execute(const Common::StringArray &choiceList) { // Remove the dialog remove(); + GLOBALS._gfxManagers.remove(&gfxManager); return _selectedIndex; } @@ -640,11 +653,11 @@ void StripManager::reset() { _delayFrames = 0; _owner = NULL; _endHandler = NULL; - _field2E6 = false; + _uselessFl = false; _stripNum = -1; - _obj44Index = 0; - _field2E8 = 0; - _field20 = 0; + _obj44ListIndex = 0; + _currObj44Id = 0; + _useless = 0; _activeSpeaker = NULL; _textShown = false; _callbackObject = NULL; @@ -688,14 +701,14 @@ void StripManager::synchronize(Serializer &s) { Action::synchronize(s); s.syncAsSint32LE(_stripNum); - s.syncAsSint32LE(_obj44Index); - s.syncAsSint32LE(_field20); + s.syncAsSint32LE(_obj44ListIndex); + s.syncAsSint32LE(_useless); s.syncAsSint32LE(_sceneNumber); _sceneBounds.synchronize(s); SYNC_POINTER(_activeSpeaker); s.syncAsByte(_textShown); - s.syncAsByte(_field2E6); - s.syncAsSint32LE(_field2E8); + s.syncAsByte(_uselessFl); + s.syncAsSint32LE(_currObj44Id); if (g_vm->getGameID() == GType_Ringworld2) s.syncAsSint16LE(_exitMode); @@ -727,10 +740,10 @@ void StripManager::synchronize(Serializer &s) { } void StripManager::remove() { - if (g_vm->getGameID() == GType_Ringworld2) { + if (g_vm->getGameID() == GType_Ringworld2) { for (uint i = 0; i < _speakerList.size(); ++i) { if (_activeSpeaker != _speakerList[i]) - _speakerList[i]->proc16(); + _speakerList[i]->stopSpeaking(); } } @@ -741,7 +754,7 @@ void StripManager::remove() { } if (_activeSpeaker) { - if (g_vm->getGameID() == GType_Ringworld2) + if (g_vm->getGameID() == GType_Ringworld2) static_cast<Ringworld2::VisualSpeaker *>(_activeSpeaker)->_speakerMode = 0xff; _activeSpeaker->remove(); } @@ -760,6 +773,15 @@ void StripManager::remove() { Action::remove(); } +void StripManager::dispatch() { + if (g_vm->getGameID() == GType_Ringworld2) { + if (_activeSpeaker) + _activeSpeaker->dispatch(); + } + + Action::dispatch(); +} + void StripManager::signal() { int strIndex = 0; @@ -768,14 +790,14 @@ void StripManager::signal() { _textShown = false; } - if (_obj44Index < 0) { + if (_obj44ListIndex < 0) { EventHandler *owner = _endHandler; - int stripNum = ABS(_obj44Index); + int stripNum = ABS(_obj44ListIndex); remove(); start(stripNum, owner); return; - } else if (_obj44Index == 10000) { + } else if (_obj44ListIndex == 10000) { // Reached end of strip EventHandler *endHandler = _endHandler; remove(); @@ -792,7 +814,7 @@ void StripManager::signal() { // Load the data for the strip load(); - Obj44 &obj44 = _obj44List[_obj44Index]; + Obj44 &obj44 = _obj44List[_obj44ListIndex]; if (g_vm->getGameID() == GType_Ringworld2) { // Return to Ringworld specific handling @@ -813,8 +835,8 @@ void StripManager::signal() { break; } } - - _field2E8 = obj44._id; + + _currObj44Id = obj44._id; Common::StringArray choiceList; // Build up a list of script entries @@ -827,7 +849,7 @@ void StripManager::signal() { int f16Index = _lookupList[obj44._field16[0] - 1]; int entryId = obj44._field16[f16Index]; - Obj0A &entry = obj44._list[idx]; + Obj0A &entry = obj44._list[idx]; if (entry._id == entryId) { // Get the next one choiceList.push_back((const char *)&_script[0] + entry._scriptOffset); @@ -855,7 +877,7 @@ void StripManager::signal() { // Get the next one const char *choiceStr = (const char *)&_script[0] + obj44._list[idx]._scriptOffset; - + if (!*choiceStr) { // Choice is empty assert(g_vm->getGameID() == GType_Ringworld2); @@ -863,7 +885,7 @@ void StripManager::signal() { if (obj44._list[1]._id) { // it's a reference to another list slot int listId = obj44._list[idx]._id; - + int obj44Idx = 0; while (_obj44List[obj44Idx]._id != listId) ++obj44Idx; @@ -873,7 +895,7 @@ void StripManager::signal() { // seems to be set to the R2_GLOBALS._stripManager_lookupList, so manually set it if (!_lookupList) _lookupList = R2_GLOBALS._stripManager_lookupList; - + int f16Index = _lookupList[_obj44List[obj44Idx]._field16[0] - 1]; listId = _obj44List[obj44Idx]._field16[f16Index]; @@ -908,7 +930,7 @@ void StripManager::signal() { // Get the user to select a conversation option strIndex = _choiceDialog.execute(choiceList); - if ((delayFlag || choiceList.size() != 1) && !_field2E6) + if ((delayFlag || choiceList.size() != 1) && !_uselessFl) _delayFrames = 1; else { Speaker *speakerP = getSpeaker((const char *)&_script[0] + obj44._speakerOffset); @@ -925,7 +947,7 @@ void StripManager::signal() { g_globals->_sceneManager._scene->loadScene(_sceneNumber); } - _activeSpeaker->proc12(this); + _activeSpeaker->startSpeaking(this); } if (_callbackObject) { @@ -939,11 +961,11 @@ void StripManager::signal() { if (g_vm->getGameID() == GType_Ringworld2) { Ringworld2::VisualSpeaker *speaker = static_cast<Ringworld2::VisualSpeaker *>(_activeSpeaker); - + if (speaker) { speaker->_speakerMode = obj44._speakerMode; if (!choiceList[strIndex].empty()) - speaker->proc15(); + speaker->animateSpeaker(); } if (!choiceList[strIndex].empty()) { @@ -953,7 +975,7 @@ void StripManager::signal() { _delayFrames = 1; } else { _delayFrames = 0; - speaker->proc15(); + speaker->animateSpeaker(); } } else { _textShown = true; @@ -961,10 +983,10 @@ void StripManager::signal() { } } - _obj44Index = getNewIndex(obj44._list[strIndex]._id); - if (_obj44Index == 10001) { + _obj44ListIndex = getNewIndex(obj44._list[strIndex]._id); + if (_obj44ListIndex == 10001) { MessageDialog::show("Strip Failure: Node not found", OK_BTN_STRING); - _obj44Index = 0; + _obj44ListIndex = 0; } } @@ -974,16 +996,16 @@ void StripManager::process(Event &event) { return; if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_ESCAPE)) { - if (_obj44Index != 10000) { - int currIndex = _obj44Index; - while (!_obj44List[_obj44Index]._list[1]._id) { - _obj44Index = getNewIndex(_obj44List[_obj44Index]._list[0]._id); - if ((_obj44Index < 0) || (_obj44Index == 10000)) + if (_obj44ListIndex != 10000) { + int currIndex = _obj44ListIndex; + while (!_obj44List[_obj44ListIndex]._list[1]._id) { + _obj44ListIndex = getNewIndex(_obj44List[_obj44ListIndex]._list[0]._id); + if ((_obj44ListIndex < 0) || (_obj44ListIndex == 10000)) break; - currIndex = _obj44Index; + currIndex = _obj44ListIndex; } - _field2E8 = _obj44List[currIndex]._id; + _currObj44Id = _obj44List[currIndex]._id; } // Signal the end of the strip @@ -1079,7 +1101,7 @@ void Speaker::remove() { SceneObjectList::deactivate(); } -void Speaker::proc12(Action *action) { +void Speaker::startSpeaking(Action *action) { _action = action; if (_newSceneNumber != -1) { _oldSceneNumber = g_globals->_sceneManager._sceneNumber; diff --git a/engines/tsage/converse.h b/engines/tsage/converse.h index 5aef0d8a7f..3f4d14f785 100644 --- a/engines/tsage/converse.h +++ b/engines/tsage/converse.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -91,10 +91,10 @@ public: virtual Common::String getClassName() { return "Speaker"; } virtual void synchronize(Serializer &s); virtual void remove(); - virtual void proc12(Action *action); + virtual void startSpeaking(Action *action); virtual void setText(const Common::String &msg); virtual void removeText(); - virtual void proc16() {} + virtual void stopSpeaking() {} void setTextPos(const Common::Point &pt) { _textPos = pt; } }; @@ -212,8 +212,8 @@ private: int getNewIndex(int newId); public: int _stripNum; - int _obj44Index; - int _field20; + int _obj44ListIndex; + int _useless; int _sceneNumber; Rect _sceneBounds; ConversationChoiceDialog _choiceDialog; @@ -221,8 +221,8 @@ public: StripCallback *_callbackObject; Speaker *_activeSpeaker; bool _textShown; - bool _field2E6; - int _field2E8; + bool _uselessFl; + int _currObj44Id; int _exitMode; Common::Array<Obj44> _obj44List; Common::Array<byte> _script; @@ -237,6 +237,7 @@ public: virtual void synchronize(Serializer &s); virtual void remove(); + virtual void dispatch(); virtual void signal(); virtual void process(Event &event); diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 3332b12cf6..f35aa583e2 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -860,6 +860,8 @@ void PlayerMover::doStepsOfNpcMovement(const Common::Point &srcPos, const Common int PlayerMover::calculateRestOfRoute(int *routeList, int srcRegion, int destRegion, bool &foundRoute) { // Make a copy of the provided route. The first entry is the size. int tempList[REGION_LIST_SIZE + 1]; + memset(tempList, 0, sizeof(tempList)); + foundRoute = false; for (int idx = 0; idx <= *routeList; ++idx) tempList[idx] = routeList[idx]; @@ -1151,6 +1153,13 @@ void PaletteRotation::signal() { if (flag) _currIndex = _start; } + + // Added in Return to Ringworld + if (_currIndex < _start) { + flag = decDuration(); + if (flag) + _currIndex = _end; + } break; case 2: _currIndex += _idxChange; @@ -1292,7 +1301,6 @@ ScenePalette::ScenePalette() { *palData++ = idx; } - _field412 = 0; _redColor = _greenColor = _blueColor = 0; _aquaColor = 0; _purpleColor = 0; @@ -1304,7 +1312,6 @@ ScenePalette::~ScenePalette() { } ScenePalette::ScenePalette(int paletteNum) { - _field412 = 0; _redColor = _greenColor = _blueColor = 0; _aquaColor = 0; _purpleColor = 0; @@ -1536,7 +1543,11 @@ void ScenePalette::synchronize(Serializer &s) { s.syncAsSint32LE(_colors.foreground); s.syncAsSint32LE(_colors.background); - s.syncAsSint32LE(_field412); + if (s.getVersion() < 12) { + int useless = 0; + s.syncAsSint32LE(useless); + } + s.syncAsByte(_redColor); s.syncAsByte(_greenColor); s.syncAsByte(_blueColor); @@ -1552,8 +1563,13 @@ void SceneItem::synchronize(Serializer &s) { _bounds.synchronize(s); s.syncString(_msg); - s.syncAsSint32LE(_fieldE); - s.syncAsSint32LE(_field10); + + if (s.getVersion() < 15) { + int useless = 0; + s.syncAsSint32LE(useless); + s.syncAsSint32LE(useless); + } + s.syncAsSint16LE(_position.x); s.syncAsSint32LE(_position.y); s.syncAsSint16LE(_yDiff); s.syncAsSint32LE(_sceneRegionId); @@ -1577,12 +1593,12 @@ bool SceneItem::startAction(CursorType action, Event &event) { } void SceneItem::doAction(int action) { - const char *msg = NULL; - if (g_vm->getGameID() == GType_Ringworld2) { Event dummyEvent; ((Ringworld2::SceneExt *)GLOBALS._sceneManager._scene)->display((CursorType)action, dummyEvent); } else { + const char *msg = NULL; + switch ((int)action) { case CURSOR_LOOK: msg = LOOK_SCENE_HOTSPOT; @@ -1619,7 +1635,8 @@ void SceneItem::display(int resNum, int lineNum, ...) { Common::String msg = (!resNum || (resNum == -1)) ? Common::String() : g_resourceManager->getMessage(resNum, lineNum); - if ((g_vm->getGameID() != GType_Ringworld) && T2_GLOBALS._uiElements._active) + if ((g_vm->getGameID() != GType_Ringworld) && (g_vm->getGameID() != GType_Ringworld2) + && T2_GLOBALS._uiElements._active) T2_GLOBALS._uiElements.hide(); if (g_globals->_sceneObjects->contains(&g_globals->_sceneText)) { @@ -1729,9 +1746,13 @@ void SceneItem::display(int resNum, int lineNum, ...) { font.setFontNumber(g_globals->_sceneText._fontNumber); font.getStringBounds(msg.c_str(), textRect, maxWidth); + Rect screenBounds = g_globals->gfxManager()._bounds; + if (g_vm->getGameID() == GType_Ringworld2) + screenBounds.collapse(20, 15); + // Center the text at the specified position, and then constrain it to be- textRect.center(pos.x, pos.y); - textRect.contain(g_globals->gfxManager()._bounds); + textRect.contain(screenBounds); if (centerText) { g_globals->_sceneText._color1 = g_globals->_sceneText._color2; @@ -1783,6 +1804,9 @@ void SceneItem::display(int resNum, int lineNum, ...) { if (!playList.empty()) { R2_GLOBALS._playStream.play(*playList.begin(), NULL); playList.pop_front(); + } else if (!(R2_GLOBALS._speechSubtitles & SPEECH_TEXT)) { + // If not showing text, don't both waiting for a click to end + break; } } } @@ -1794,7 +1818,8 @@ void SceneItem::display(int resNum, int lineNum, ...) { g_globals->_sceneText.remove(); } - if ((g_vm->getGameID() != GType_Ringworld) && T2_GLOBALS._uiElements._active) { + if ((g_vm->getGameID() != GType_Ringworld) && (g_vm->getGameID() != GType_Ringworld2) + && T2_GLOBALS._uiElements._active) { // Show user interface T2_GLOBALS._uiElements.show(); @@ -2092,14 +2117,14 @@ SceneObject::SceneObject() : SceneHotspot() { _shade = _oldShade = 0; _linkedActor = NULL; - _field8A = Common::Point(0, 0); + _actorDestPos = Common::Point(0, 0); _angle = 0; _xs = 0; _xe = 0; _endFrame = 0; - _field68 = 0; + _loopCount = 0; _regionIndex = 0; - _field9C = NULL; + _shadowMap = NULL; } SceneObject::SceneObject(const SceneObject &so) : SceneHotspot() { @@ -2346,7 +2371,7 @@ void SceneObject::animate(AnimateMode animMode, ...) { case ANIM_MODE_1: _frameChange = 1; - _field2E = _position; + _oldPosition = _position; _endAction = 0; break; @@ -2394,9 +2419,9 @@ void SceneObject::animate(AnimateMode animMode, ...) { case ANIM_MODE_9: if (_animateMode == ANIM_MODE_9 && g_vm->getGameID() == GType_Ringworld2) { _frameChange = -1; - _field2E = _position; + _oldPosition = _position; } else { - _field68 = va_arg(va, int); + _loopCount = va_arg(va, int); _endAction = va_arg(va, Action *); _frameChange = 1; _endFrame = getFrameCount(); @@ -2463,7 +2488,7 @@ void SceneObject::synchronize(Serializer &s) { s.syncAsUint32LE(_updateStartFrame); s.syncAsUint32LE(_walkStartFrame); - s.syncAsSint16LE(_field2E.x); s.syncAsSint16LE(_field2E.y); + s.syncAsSint16LE(_oldPosition.x); s.syncAsSint16LE(_oldPosition.y); s.syncAsSint16LE(_percent); s.syncAsSint16LE(_priority); s.syncAsSint16LE(_angle); @@ -2478,7 +2503,7 @@ void SceneObject::synchronize(Serializer &s) { SYNC_ENUM(_animateMode, AnimateMode); s.syncAsSint32LE(_frame); s.syncAsSint32LE(_endFrame); - s.syncAsSint32LE(_field68); + s.syncAsSint32LE(_loopCount); s.syncAsSint32LE(_frameChange); s.syncAsSint32LE(_numFrames); s.syncAsSint32LE(_regionIndex); @@ -2486,8 +2511,8 @@ void SceneObject::synchronize(Serializer &s) { s.syncAsSint16LE(_moveDiff.x); s.syncAsSint16LE(_moveDiff.y); s.syncAsSint32LE(_moveRate); if (g_vm->getGameID() == GType_Ringworld2) { - s.syncAsSint16LE(_field8A.x); - s.syncAsSint16LE(_field8A.y); + s.syncAsSint16LE(_actorDestPos.x); + s.syncAsSint16LE(_actorDestPos.y); } SYNC_POINTER(_endAction); s.syncAsUint32LE(_regionBitList); @@ -2504,7 +2529,7 @@ void SceneObject::postInit(SceneObjectList *OwnerList) { if (!OwnerList) OwnerList = g_globals->_sceneObjects; - bool isExisting = OwnerList->contains(this); + bool isExisting = OwnerList->contains(this); if (!isExisting || ((_flags & OBJFLAG_REMOVE) != 0)) { _percent = 100; _priority = 255; @@ -2565,9 +2590,9 @@ void SceneObject::dispatch() { case ANIM_MODE_1: if (isNoMover()) setFrame(1); - else if ((_field2E.x != _position.x) || (_field2E.y != _position.y)) { + else if ((_oldPosition.x != _position.x) || (_oldPosition.y != _position.y)) { setFrame(changeFrame()); - _field2E = _position; + _oldPosition = _position; } break; @@ -2610,7 +2635,7 @@ void SceneObject::dispatch() { _endFrame = 1; setFrame(changeFrame()); - } else if (!_field68 || (--_field68 > 0)) { + } else if (!_loopCount || (--_loopCount > 0)) { _frameChange = 1; _endFrame = getFrameCount(); @@ -2629,7 +2654,7 @@ void SceneObject::dispatch() { _frameChange = -1; _strip = ((_strip - 1) ^ 1) + 1; _endFrame = 1; - } else if ((_field68 == 0) || (--_field68 != 0)) { + } else if (!_loopCount || (--_loopCount > 0)) { _frameChange = 1; _endFrame = getFrameCount(); @@ -2696,12 +2721,23 @@ GfxSurface SceneObject::getFrame() { _visageImages.setVisage(_visage, _strip); GfxSurface frame = _visageImages.getFrame(_frame); + // Reset any centroid adjustment flags, in + frame._flags &= ~(FRAME_FLIP_CENTROID_X | FRAME_FLIP_CENTROID_Y); + + // For later games, check whether the appropriate object flags are set for flipping + if (g_vm->getGameID() != GType_Ringworld) { + if ((_flags & OBJFLAG_FLIP_CENTROID_X) || _visageImages._flipHoriz) + frame._flags |= FRAME_FLIP_CENTROID_X; + if ((_flags & OBJFLAG_FLIP_CENTROID_Y) || _visageImages._flipVert) + frame._flags |= FRAME_FLIP_CENTROID_Y; + } + // If shading is needed, post apply the shadiing onto the frame if ((g_vm->getGameID() == GType_Ringworld2) && (_shade >= 1)) { Graphics::Surface s = frame.lockSurface(); byte *p = (byte *)s.getPixels(); byte *endP = p + s.w * s.h; - + while (p < endP) { if (*p != frame._transColor) *p = R2_GLOBALS._fadePaletteMap[_shade - 1][*p]; @@ -2715,7 +2751,14 @@ GfxSurface SceneObject::getFrame() { } void SceneObject::reposition() { + if (g_vm->getGameID() == GType_Ringworld2) { + if (!(_flags & OBJFLAG_ZOOMED)) { + setZoom(g_globals->_sceneManager._scene->_zoomPercents[MIN(_position.y, (int16)255)]); + } + } + GfxSurface frame = getFrame(); + _bounds.resize(frame, _position.x, _position.y - _yDiff, _percent); _xs = _bounds.left; _xe = _bounds.right; @@ -2726,11 +2769,27 @@ void SceneObject::reposition() { */ void SceneObject::draw() { Rect destRect = _bounds; - destRect.translate(-g_globals->_sceneManager._scene->_sceneBounds.left, - -g_globals->_sceneManager._scene->_sceneBounds.top); - Region *priorityRegion = g_globals->_sceneManager._scene->_priorities.find(_priority); + Scene *scene = g_globals->_sceneManager._scene; + destRect.translate(-scene->_sceneBounds.left, -scene->_sceneBounds.top); GfxSurface frame = getFrame(); - g_globals->gfxManager().copyFrom(frame, destRect, priorityRegion); + Region *priorityRegion = scene->_priorities.find(_priority); + + if (g_vm->getGameID() == GType_Ringworld2) { + switch (_effect) { + case EFFECT_SHADOW_MAP: { + if (!_shadowMap) + _shadowMap = static_cast<Ringworld2::SceneExt *>(scene)->_shadowPaletteMap; + + GLOBALS.gfxManager().getSurface().copyFrom(frame, frame.getBounds(), + destRect, priorityRegion, _shadowMap); + return; + } + default: + break; + } + } + + GLOBALS.gfxManager().copyFrom(frame, destRect, priorityRegion); } /** @@ -2832,12 +2891,14 @@ void BackgroundSceneObject::setup2(int visage, int stripFrameNum, int frameNum, setFrame(frameNum); setPosition(Common::Point(posX, posY)); fixPriority(priority); + + _effect = effect; } void BackgroundSceneObject::copySceneToBackground() { GLOBALS._sceneManager._scene->_backSurface.copyFrom(g_globals->gfxManager().getSurface(), 0, 0); - // WORKAROUND: Since savegames don't store the active screen data, once we copy the + // WORKAROUND: Since savegames don't store the active screen data, once we copy the // foreground objects to the background, we have to prevent the scene being saved. if (g_vm->getGameID() == GType_Ringworld2) ((Ringworld2::SceneExt *)GLOBALS._sceneManager._scene)->_preventSaving = true; @@ -2848,7 +2909,6 @@ void BackgroundSceneObject::copySceneToBackground() { void SceneObjectList::draw() { Common::Array<SceneObject *> objList; int paneNum = 0; - int xAmount = 0, yAmount = 0; if (_objList.size() == 0) { // Alternate draw mode @@ -2875,6 +2935,7 @@ void SceneObjectList::draw() { 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; + int xAmount = 0, yAmount = 0; if (objPos.x >= scrollerRect.right) { xAmount = 8; @@ -2903,8 +2964,9 @@ void SceneObjectList::draw() { g_globals->_sceneManager._sceneBgOffset.y); } - // Set up the flag mask - uint32 flagMask = (paneNum == 0) ? OBJFLAG_PANE_0 : OBJFLAG_PANE_1; + // Set up the flag mask. Currently, paneNum is always set to 0, so the check is meaningless + // uint32 flagMask = (paneNum == 0) ? OBJFLAG_PANE_0 : OBJFLAG_PANE_1; + uint32 flagMask = OBJFLAG_PANE_0; // Initial loop to set up object list and update object position, priority, and flags for (SynchronizedList<SceneObject *>::iterator i = g_globals->_sceneObjects->begin(); @@ -3307,7 +3369,6 @@ Player::Player(): SceneObject() { _canWalk = false; _enabled = false; _uiEnabled = false; - _field8C = 0; // Return to Ringworld specific fields _characterIndex = R2_NONE; @@ -3326,15 +3387,11 @@ void Player::postInit(SceneObjectList *OwnerList) { _canWalk = true; _uiEnabled = true; _percent = 100; - _field8C = 10; - if (g_vm->getGameID() != GType_Ringworld2) - { + if (g_vm->getGameID() != GType_Ringworld2) { _moveDiff.x = 4; _moveDiff.y = 2; - } - else - { + } else { _moveDiff.x = 3; _moveDiff.y = 2; _effect = EFFECT_SHADED; @@ -3442,7 +3499,10 @@ void Player::synchronize(Serializer &s) { s.syncAsByte(_canWalk); s.syncAsByte(_uiEnabled); - s.syncAsSint16LE(_field8C); + if (s.getVersion() < 15) { + int useless = 0; + s.syncAsSint16LE(useless); + } if (g_vm->getGameID() != GType_Ringworld) s.syncAsByte(_enabled); @@ -4190,7 +4250,6 @@ double FloatSet::sqrt(FloatSet &floatSet) { GameHandler::GameHandler() : EventHandler() { _nextWaitCtr = 1; _waitCtr.setCtr(1); - _field14 = 10; } GameHandler::~GameHandler() { @@ -4212,7 +4271,11 @@ void GameHandler::synchronize(Serializer &s) { _lockCtr.synchronize(s); _waitCtr.synchronize(s); s.syncAsSint16LE(_nextWaitCtr); - s.syncAsSint16LE(_field14); + + if (s.getVersion() < 14) { + int useless = 0; + s.syncAsSint16LE(useless); + } } /*--------------------------------------------------------------------------*/ @@ -4324,7 +4387,7 @@ void SceneHandler::process(Event &event) { // Scan the item list to find one the mouse is within SynchronizedList<SceneItem *>::iterator i; for (i = g_globals->_sceneItems.begin(); i != g_globals->_sceneItems.end(); ++i) { - SceneItem *item = *i; + SceneItem *item = *i; if (item->contains(event.mousePos)) { // Pass the action to the item bool handled = item->startAction(g_globals->_events.getCursor(), event); diff --git a/engines/tsage/core.h b/engines/tsage/core.h index 2c88f6be79..8b1deadaeb 100644 --- a/engines/tsage/core.h +++ b/engines/tsage/core.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -358,7 +358,6 @@ public: byte _palette[256 * 3]; GfxColors _colors; SynchronizedList<PaletteModifier *> _listeners; - int _field412; uint8 _redColor; uint8 _greenColor; @@ -410,12 +409,11 @@ class SceneItem : public EventHandler { public: Rect _bounds; Common::String _msg; - int _fieldE, _field10; Common::Point _position; int _yDiff; int _sceneRegionId; public: - SceneItem() : EventHandler() { _msg = "Feature"; _action = NULL; _sceneRegionId = 0; _yDiff = 0; _fieldE = _field10 = 0;} + SceneItem() : EventHandler() { _msg = "Feature"; _action = NULL; _sceneRegionId = 0; _yDiff = 0;} virtual void synchronize(Serializer &s); virtual Common::String getClassName() { return "SceneItem"; } @@ -466,8 +464,9 @@ enum AnimateMode {ANIM_MODE_NONE = 0, ANIM_MODE_1 = 1, ANIM_MODE_2 = 2, ANIM_MOD ANIM_MODE_9 = 9 }; -enum Effect { EFFECT_NONE = 0, EFFECT_SHADED = 1, EFFECT_2 = 2, EFFECT_3 = 3, - EFFECT_4 = 4, EFFECT_5 = 5 }; +// Actor effect enumeration used in Return to Ringworld 2 +enum Effect { EFFECT_NONE = 0, EFFECT_SHADED = 1, EFFECT_SMOKE = 3, + EFFECT_SHADOW_MAP = 5, EFFECT_SHADED2 = 6 }; class SceneObject; @@ -514,7 +513,8 @@ public: enum ObjectFlags {OBJFLAG_FIXED_PRIORITY = 1, OBJFLAG_NO_UPDATES = 2, OBJFLAG_ZOOMED = 4, OBJFLAG_SUPPRESS_DISPATCH = 8, OBJFLAG_HIDE = 0x100, OBJFLAG_HIDING = 0x200, OBJFLAG_REMOVE = 0x400, OBJFLAG_CLONED = 0x800, OBJFLAG_CHECK_REGION = 0x1000, OBJFLAG_PANE_0 = 0x4000, OBJFLAG_PANE_1 = 0x8000, - OBJFLAG_PANES = OBJFLAG_PANE_0 | OBJFLAG_PANE_1 + OBJFLAG_PANES = OBJFLAG_PANE_0 | OBJFLAG_PANE_1, + OBJFLAG_FLIP_CENTROID_X = 0x10000, OBJFLAG_FLIP_CENTROID_Y = 0x20000 }; class SceneObject : public SceneHotspot { @@ -527,7 +527,7 @@ public: int changeFrame(); uint32 _updateStartFrame; uint32 _walkStartFrame; - Common::Point _field2E; + Common::Point _oldPosition; int _percent; int _priority; int _angle; @@ -540,19 +540,19 @@ public: AnimateMode _animateMode; int _frame; int _endFrame; - int _field68; + int _loopCount; int _frameChange; int _numFrames; int _regionIndex; EventHandler *_mover; Common::Point _moveDiff; int _moveRate; - Common::Point _field8A; + Common::Point _actorDestPos; Action *_endAction; uint32 _regionBitList; // Ringworld 2 specific fields - byte *_field9C; + byte *_shadowMap; int _shade, _oldShade; int _effect; SceneObject *_linkedActor; @@ -649,7 +649,6 @@ class Player : public SceneObject { public: bool _canWalk; bool _uiEnabled; - int _field8C; bool _enabled; // Return to Ringworld specific fields @@ -776,8 +775,6 @@ public: class ScenePriorities : public Common::List<Region> { public: int _resNum; - int _field14; - int _field16; Region _defaultPriorityRegion; public: void load(int resNum); @@ -883,7 +880,6 @@ public: RefCounter _lockCtr; RefCounter _waitCtr; int _nextWaitCtr; - int _field14; public: GameHandler(); virtual ~GameHandler(); diff --git a/engines/tsage/debugger.cpp b/engines/tsage/debugger.cpp index 82645f2d62..b647807f8a 100644 --- a/engines/tsage/debugger.cpp +++ b/engines/tsage/debugger.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -30,18 +30,19 @@ namespace TsAGE { Debugger::Debugger() : GUI::Debugger() { - DCmd_Register("continue", WRAP_METHOD(Debugger, Cmd_Exit)); - DCmd_Register("scene", WRAP_METHOD(Debugger, Cmd_Scene)); - DCmd_Register("walk_regions", WRAP_METHOD(Debugger, Cmd_WalkRegions)); - DCmd_Register("priority_regions", WRAP_METHOD(Debugger, Cmd_PriorityRegions)); - DCmd_Register("scene_regions", WRAP_METHOD(Debugger, Cmd_SceneRegions)); - DCmd_Register("setflag", WRAP_METHOD(Debugger, Cmd_SetFlag)); - DCmd_Register("getflag", WRAP_METHOD(Debugger, Cmd_GetFlag)); - DCmd_Register("clearflag", WRAP_METHOD(Debugger, Cmd_ClearFlag)); - DCmd_Register("listobjects", WRAP_METHOD(Debugger, Cmd_ListObjects)); - DCmd_Register("moveobject", WRAP_METHOD(Debugger, Cmd_MoveObject)); - DCmd_Register("hotspots", WRAP_METHOD(Debugger, Cmd_Hotspots)); - DCmd_Register("sound", WRAP_METHOD(Debugger, Cmd_Sound)); + registerCmd("continue", WRAP_METHOD(Debugger, cmdExit)); + registerCmd("scene", WRAP_METHOD(Debugger, Cmd_Scene)); + registerCmd("walk_regions", WRAP_METHOD(Debugger, Cmd_WalkRegions)); + registerCmd("priority_regions", WRAP_METHOD(Debugger, Cmd_PriorityRegions)); + registerCmd("scene_regions", WRAP_METHOD(Debugger, Cmd_SceneRegions)); + registerCmd("setflag", WRAP_METHOD(Debugger, Cmd_SetFlag)); + registerCmd("getflag", WRAP_METHOD(Debugger, Cmd_GetFlag)); + registerCmd("clearflag", WRAP_METHOD(Debugger, Cmd_ClearFlag)); + registerCmd("listobjects", WRAP_METHOD(Debugger, Cmd_ListObjects)); + registerCmd("moveobject", WRAP_METHOD(Debugger, Cmd_MoveObject)); + registerCmd("hotspots", WRAP_METHOD(Debugger, Cmd_Hotspots)); + registerCmd("sound", WRAP_METHOD(Debugger, Cmd_Sound)); + registerCmd("setdebug", WRAP_METHOD(Debugger, Cmd_SetDebug)); } static int strToInt(const char *s) { @@ -65,7 +66,7 @@ static int strToInt(const char *s) { */ bool Debugger::Cmd_Scene(int argc, const char **argv) { if (argc < 2) { - DebugPrintf("Usage: %s <scene number> [prior scene #]\n", argv[0]); + debugPrintf("Usage: %s <scene number> [prior scene #]\n", argv[0]); return true; } @@ -81,7 +82,7 @@ bool Debugger::Cmd_Scene(int argc, const char **argv) { */ bool Debugger::Cmd_WalkRegions(int argc, const char **argv) { if (argc != 1) { - DebugPrintf("Usage: %s\n", argv[0]); + debugPrintf("Usage: %s\n", argv[0]); return true; } @@ -119,8 +120,8 @@ bool Debugger::Cmd_WalkRegions(int argc, const char **argv) { // Mark the scene as requiring a full redraw g_globals->_paneRefreshFlag[0] = 2; - DebugPrintf("Total regions = %d\n", g_globals->_walkRegions._regionList.size()); - DebugPrintf("%s\n", regionsDesc.c_str()); + debugPrintf("Total regions = %d\n", g_globals->_walkRegions._regionList.size()); + debugPrintf("%s\n", regionsDesc.c_str()); return false; } @@ -171,8 +172,8 @@ bool Debugger::Cmd_PriorityRegions(int argc, const char **argv) { // Mark the scene as requiring a full redraw g_globals->_paneRefreshFlag[0] = 2; - DebugPrintf("Total regions = %d\n", count); - DebugPrintf("%s", regionsDesc.c_str()); + debugPrintf("Total regions = %d\n", count); + debugPrintf("%s", regionsDesc.c_str()); return true; } @@ -224,8 +225,8 @@ bool Debugger::Cmd_SceneRegions(int argc, const char **argv) { // Mark the scene as requiring a full redraw g_globals->_paneRefreshFlag[0] = 2; - DebugPrintf("Total regions = %d\n", count); - DebugPrintf("%s", regionsDesc.c_str()); + debugPrintf("Total regions = %d\n", count); + debugPrintf("%s", regionsDesc.c_str()); return true; } @@ -236,7 +237,7 @@ bool Debugger::Cmd_SceneRegions(int argc, const char **argv) { bool Debugger::Cmd_SetFlag(int argc, const char **argv) { // Check for a flag to set if (argc != 2) { - DebugPrintf("Usage: %s <flag number>\n", argv[0]); + debugPrintf("Usage: %s <flag number>\n", argv[0]); return true; } @@ -251,12 +252,12 @@ bool Debugger::Cmd_SetFlag(int argc, const char **argv) { bool Debugger::Cmd_GetFlag(int argc, const char **argv) { // Check for an flag to display if (argc != 2) { - DebugPrintf("Usage: %s <flag number>\n", argv[0]); + debugPrintf("Usage: %s <flag number>\n", argv[0]); return true; } int flagNum = strToInt(argv[1]); - DebugPrintf("Value: %d\n", g_globals->getFlag(flagNum)); + debugPrintf("Value: %d\n", g_globals->getFlag(flagNum)); return true; } @@ -266,7 +267,7 @@ bool Debugger::Cmd_GetFlag(int argc, const char **argv) { bool Debugger::Cmd_ClearFlag(int argc, const char **argv) { // Check for a flag to clear if (argc != 2) { - DebugPrintf("Usage: %s <flag number>\n", argv[0]); + debugPrintf("Usage: %s <flag number>\n", argv[0]); return true; } @@ -331,7 +332,7 @@ bool Debugger::Cmd_Hotspots(int argc, const char **argv) { */ bool Debugger::Cmd_Sound(int argc, const char **argv) { if (argc != 2) { - DebugPrintf("Usage: %s <sound number>\n", argv[0]); + debugPrintf("Usage: %s <sound number>\n", argv[0]); return true; } @@ -340,16 +341,24 @@ bool Debugger::Cmd_Sound(int argc, const char **argv) { return false; } +/** + * Activate internal debugger, when available + */ +bool Debugger::Cmd_SetDebug(int argc, const char **argv) { + debugPrintf("Not available in this game\n"); + return true; +} + /* * This command lists the objects available, and their ID */ bool DemoDebugger::Cmd_ListObjects(int argc, const char **argv) { - DebugPrintf("Not available in Demo\n"); + debugPrintf("Not available in Demo\n"); return true; } bool DemoDebugger::Cmd_MoveObject(int argc, const char **argv) { - DebugPrintf("Not available in Demo\n"); + debugPrintf("Not available in Demo\n"); return true; } @@ -358,44 +367,44 @@ bool DemoDebugger::Cmd_MoveObject(int argc, const char **argv) { */ bool RingworldDebugger::Cmd_ListObjects(int argc, const char **argv) { if (argc != 1) { - DebugPrintf("Usage: %s\n", argv[0]); + debugPrintf("Usage: %s\n", argv[0]); return true; } - DebugPrintf("Available objects for this game are:\n"); - DebugPrintf("0 - Stunner\n"); - DebugPrintf("1 - Scanner\n"); - DebugPrintf("2 - Stasis Box\n"); - DebugPrintf("3 - Info Disk\n"); - DebugPrintf("4 - Stasis Negator\n"); - DebugPrintf("5 - Key Device\n"); - DebugPrintf("6 - Medkit\n"); - DebugPrintf("7 - Ladder\n"); - DebugPrintf("8 - Rope\n"); - DebugPrintf("9 - Key\n"); - DebugPrintf("10 - Translator\n"); - DebugPrintf("11 - Ale\n"); - DebugPrintf("12 - Paper\n"); - DebugPrintf("13 - Waldos\n"); - DebugPrintf("14 - Stasis Box 2\n"); - DebugPrintf("15 - Ring\n"); - DebugPrintf("16 - Cloak\n"); - DebugPrintf("17 - Tunic\n"); - DebugPrintf("18 - Candle\n"); - DebugPrintf("19 - Straw\n"); - DebugPrintf("20 - Scimitar\n"); - DebugPrintf("21 - Sword\n"); - DebugPrintf("22 - Helmet\n"); - DebugPrintf("23 - Items\n"); - DebugPrintf("24 - Concentrator\n"); - DebugPrintf("25 - Nullifier\n"); - DebugPrintf("26 - Peg\n"); - DebugPrintf("27 - Vial\n"); - DebugPrintf("28 - Jacket\n"); - DebugPrintf("29 - Tunic 2\n"); - DebugPrintf("30 - Bone\n"); - DebugPrintf("31 - Empty Jar\n"); - DebugPrintf("32 - Jar\n"); + debugPrintf("Available objects for this game are:\n"); + debugPrintf("0 - Stunner\n"); + debugPrintf("1 - Scanner\n"); + debugPrintf("2 - Stasis Box\n"); + debugPrintf("3 - Info Disk\n"); + debugPrintf("4 - Stasis Negator\n"); + debugPrintf("5 - Key Device\n"); + debugPrintf("6 - Medkit\n"); + debugPrintf("7 - Ladder\n"); + debugPrintf("8 - Rope\n"); + debugPrintf("9 - Key\n"); + debugPrintf("10 - Translator\n"); + debugPrintf("11 - Ale\n"); + debugPrintf("12 - Paper\n"); + debugPrintf("13 - Waldos\n"); + debugPrintf("14 - Stasis Box 2\n"); + debugPrintf("15 - Ring\n"); + debugPrintf("16 - Cloak\n"); + debugPrintf("17 - Tunic\n"); + debugPrintf("18 - Candle\n"); + debugPrintf("19 - Straw\n"); + debugPrintf("20 - Scimitar\n"); + debugPrintf("21 - Sword\n"); + debugPrintf("22 - Helmet\n"); + debugPrintf("23 - Items\n"); + debugPrintf("24 - Concentrator\n"); + debugPrintf("25 - Nullifier\n"); + debugPrintf("26 - Peg\n"); + debugPrintf("27 - Vial\n"); + debugPrintf("28 - Jacket\n"); + debugPrintf("29 - Tunic 2\n"); + debugPrintf("30 - Bone\n"); + debugPrintf("31 - Empty Jar\n"); + debugPrintf("32 - Jar\n"); return true; } @@ -405,8 +414,8 @@ bool RingworldDebugger::Cmd_ListObjects(int argc, const char **argv) { bool RingworldDebugger::Cmd_MoveObject(int argc, const char **argv) { // Check for a flag to clear if ((argc < 2) || (argc > 3)){ - DebugPrintf("Usage: %s <object number> [<scene number>]\n", argv[0]); - DebugPrintf("If no scene is specified, the object will be added to inventory\n"); + debugPrintf("Usage: %s <object number> [<scene number>]\n", argv[0]); + debugPrintf("If no scene is specified, the object will be added to inventory\n"); return true; } @@ -516,7 +525,7 @@ bool RingworldDebugger::Cmd_MoveObject(int argc, const char **argv) { RING_INVENTORY._jar._sceneNumber = sceneNum; break; default: - DebugPrintf("Invalid object Id %s\n", argv[1]); + debugPrintf("Invalid object Id %s\n", argv[1]); break; } @@ -528,83 +537,83 @@ bool RingworldDebugger::Cmd_MoveObject(int argc, const char **argv) { */ bool BlueForceDebugger::Cmd_ListObjects(int argc, const char **argv) { if (argc != 1) { - DebugPrintf("Usage: %s\n", argv[0]); + debugPrintf("Usage: %s\n", argv[0]); return true; } - DebugPrintf("Available objects for this game are:\n"); - DebugPrintf("1 - INV_COLT45\n"); - DebugPrintf("2 - INV_AMMO_CLIP\n"); - DebugPrintf("3 - INV_SPARE_CLIP\n"); - DebugPrintf("4 - INV_HANDCUFFS\n"); - DebugPrintf("5 - INV_GREENS_GUN\n"); - DebugPrintf("6 - INV_TICKET_BOOK\n"); - DebugPrintf("7 - INV_MIRANDA_CARD\n"); - DebugPrintf("8 - INV_FOREST_RAP\n"); - DebugPrintf("9 - INV_GREEN_ID\n"); - DebugPrintf("10 - INV_BASEBALL_CARD\n"); - DebugPrintf("11 - INV_BOOKING_GREEN\n"); - DebugPrintf("12 - INV_FLARE\n"); - DebugPrintf("13 - INV_COBB_RAP\n"); - DebugPrintf("14 - INV_22_BULLET\n"); - DebugPrintf("15 - INV_AUTO_RIFLE\n"); - DebugPrintf("16 - INV_WIG\n"); - DebugPrintf("17 - INV_FRANKIE_ID\n"); - DebugPrintf("18 - INV_TYRONE_ID\n"); - DebugPrintf("19 - INV_22_SNUB\n"); - DebugPrintf("20 - INV_BOOKING_FRANKIE\n"); - DebugPrintf("21 - INV_BOOKING_GANG\n"); - DebugPrintf("22 - INV_FBI_TELETYPE\n"); - DebugPrintf("23 - INV_DA_NOTE\n"); - DebugPrintf("24 - INV_PRINT_OUT\n"); - DebugPrintf("25 - INV_WAREHOUSE_KEYS\n"); - DebugPrintf("26 - INV_CENTER_PUNCH\n"); - DebugPrintf("27 - INV_TRANQ_GUN\n"); - DebugPrintf("28 - INV_HOOK\n"); - DebugPrintf("29 - INV_RAGS\n"); - DebugPrintf("30 - INV_JAR\n"); - DebugPrintf("31 - INV_SCREWDRIVER\n"); - DebugPrintf("32 - INV_D_FLOPPY\n"); - DebugPrintf("33 - INV_BLANK_DISK\n"); - DebugPrintf("34 - INV_STICK\n"); - DebugPrintf("35 - INV_CRATE1\n"); - DebugPrintf("36 - INV_CRATE2\n"); - DebugPrintf("37 - INV_SHOEBOX\n"); - DebugPrintf("38 - INV_BADGE\n"); - DebugPrintf("39 - INV_RENTAL_COUPON\n"); - DebugPrintf("40 - INV_NICKEL\n"); - DebugPrintf("41 - INV_LYLE_CARD\n"); - DebugPrintf("42 - INV_CARTER_NOTE\n"); - DebugPrintf("43 - INV_MUG_SHOT\n"); - DebugPrintf("44 - INV_CLIPPING\n"); - DebugPrintf("45 - INV_MICROFILM \n"); - DebugPrintf("46 - INV_WAVE_KEYS\n"); - DebugPrintf("47 - INV_RENTAL_KEYS\n"); - DebugPrintf("48 - INV_NAPKIN\n"); - DebugPrintf("49 - INV_DMV_PRINTOUT\n"); - DebugPrintf("50 - INV_FISHING_NET\n"); - DebugPrintf("51 - INV_ID\n"); - DebugPrintf("52 - INV_9MM_BULLETS\n"); - DebugPrintf("53 - INV_SCHEDULE\n"); - DebugPrintf("54 - INV_GRENADES\n"); - DebugPrintf("55 - INV_YELLOW_CORD\n"); - DebugPrintf("56 - INV_HALF_YELLOW_CORD\n"); - DebugPrintf("57 - INV_BLACK_CORD\n"); - DebugPrintf("58 - INV_HALF_BLACK_CORD\n"); - DebugPrintf("59 - INV_WARRANT\n"); - DebugPrintf("60 - INV_JACKET\n"); - DebugPrintf("61 - INV_GREENS_KNIFE\n"); - DebugPrintf("62 - INV_DOG_WHISTLE\n"); - DebugPrintf("63 - INV_AMMO_BELT\n"); - DebugPrintf("64 - INV_CARAVAN_KEY\n"); + debugPrintf("Available objects for this game are:\n"); + debugPrintf("1 - INV_COLT45\n"); + debugPrintf("2 - INV_AMMO_CLIP\n"); + debugPrintf("3 - INV_SPARE_CLIP\n"); + debugPrintf("4 - INV_HANDCUFFS\n"); + debugPrintf("5 - INV_GREENS_GUN\n"); + debugPrintf("6 - INV_TICKET_BOOK\n"); + debugPrintf("7 - INV_MIRANDA_CARD\n"); + debugPrintf("8 - INV_FOREST_RAP\n"); + debugPrintf("9 - INV_GREEN_ID\n"); + debugPrintf("10 - INV_BASEBALL_CARD\n"); + debugPrintf("11 - INV_BOOKING_GREEN\n"); + debugPrintf("12 - INV_FLARE\n"); + debugPrintf("13 - INV_COBB_RAP\n"); + debugPrintf("14 - INV_22_BULLET\n"); + debugPrintf("15 - INV_AUTO_RIFLE\n"); + debugPrintf("16 - INV_WIG\n"); + debugPrintf("17 - INV_FRANKIE_ID\n"); + debugPrintf("18 - INV_TYRONE_ID\n"); + debugPrintf("19 - INV_22_SNUB\n"); + debugPrintf("20 - INV_BOOKING_FRANKIE\n"); + debugPrintf("21 - INV_BOOKING_GANG\n"); + debugPrintf("22 - INV_FBI_TELETYPE\n"); + debugPrintf("23 - INV_DA_NOTE\n"); + debugPrintf("24 - INV_PRINT_OUT\n"); + debugPrintf("25 - INV_WAREHOUSE_KEYS\n"); + debugPrintf("26 - INV_CENTER_PUNCH\n"); + debugPrintf("27 - INV_TRANQ_GUN\n"); + debugPrintf("28 - INV_HOOK\n"); + debugPrintf("29 - INV_RAGS\n"); + debugPrintf("30 - INV_JAR\n"); + debugPrintf("31 - INV_SCREWDRIVER\n"); + debugPrintf("32 - INV_D_FLOPPY\n"); + debugPrintf("33 - INV_BLANK_DISK\n"); + debugPrintf("34 - INV_STICK\n"); + debugPrintf("35 - INV_CRATE1\n"); + debugPrintf("36 - INV_CRATE2\n"); + debugPrintf("37 - INV_SHOEBOX\n"); + debugPrintf("38 - INV_BADGE\n"); + debugPrintf("39 - INV_RENTAL_COUPON\n"); + debugPrintf("40 - INV_NICKEL\n"); + debugPrintf("41 - INV_LYLE_CARD\n"); + debugPrintf("42 - INV_CARTER_NOTE\n"); + debugPrintf("43 - INV_MUG_SHOT\n"); + debugPrintf("44 - INV_CLIPPING\n"); + debugPrintf("45 - INV_MICROFILM \n"); + debugPrintf("46 - INV_WAVE_KEYS\n"); + debugPrintf("47 - INV_RENTAL_KEYS\n"); + debugPrintf("48 - INV_NAPKIN\n"); + debugPrintf("49 - INV_DMV_PRINTOUT\n"); + debugPrintf("50 - INV_FISHING_NET\n"); + debugPrintf("51 - INV_ID\n"); + debugPrintf("52 - INV_9MM_BULLETS\n"); + debugPrintf("53 - INV_SCHEDULE\n"); + debugPrintf("54 - INV_GRENADES\n"); + debugPrintf("55 - INV_YELLOW_CORD\n"); + debugPrintf("56 - INV_HALF_YELLOW_CORD\n"); + debugPrintf("57 - INV_BLACK_CORD\n"); + debugPrintf("58 - INV_HALF_BLACK_CORD\n"); + debugPrintf("59 - INV_WARRANT\n"); + debugPrintf("60 - INV_JACKET\n"); + debugPrintf("61 - INV_GREENS_KNIFE\n"); + debugPrintf("62 - INV_DOG_WHISTLE\n"); + debugPrintf("63 - INV_AMMO_BELT\n"); + debugPrintf("64 - INV_CARAVAN_KEY\n"); return true; } bool BlueForceDebugger::Cmd_MoveObject(int argc, const char **argv) { // Check for a flag to clear if ((argc < 2) || (argc > 3)){ - DebugPrintf("Usage: %s <object number> [<scene number>]\n", argv[0]); - DebugPrintf("If no scene is specified, the object will be added to inventory\n"); + debugPrintf("Usage: %s <object number> [<scene number>]\n", argv[0]); + debugPrintf("If no scene is specified, the object will be added to inventory\n"); return true; } @@ -616,7 +625,7 @@ bool BlueForceDebugger::Cmd_MoveObject(int argc, const char **argv) { if ((objNum > 0) && (objNum < 65)) BF_INVENTORY.setObjectScene(objNum, sceneNum); else - DebugPrintf("Invalid object Id %s\n", argv[1]); + debugPrintf("Invalid object Id %s\n", argv[1]); return true; } @@ -626,63 +635,63 @@ bool BlueForceDebugger::Cmd_MoveObject(int argc, const char **argv) { */ bool Ringworld2Debugger::Cmd_ListObjects(int argc, const char **argv) { if (argc != 1) { - DebugPrintf("Usage: %s\n", argv[0]); + debugPrintf("Usage: %s\n", argv[0]); return true; } - DebugPrintf("Available objects for this game are:\n"); - DebugPrintf("1 - R2_OPTO_DISK\n"); - DebugPrintf("2 - R2_2\n"); - DebugPrintf("3 - R2_NEGATOR_GUN\n"); - DebugPrintf("4 - R2_STEPPING_DISKS\n"); - DebugPrintf("5 - R2_5\n"); - DebugPrintf("6 - R2_6\n"); - DebugPrintf("7 - R2_7\n"); - DebugPrintf("8 - R2_8\n"); - DebugPrintf("9 - R2_9\n"); - DebugPrintf("10 - R2_10\n"); - DebugPrintf("11 - R2_11\n"); - DebugPrintf("12 - R2_12\n"); - DebugPrintf("13 - R2_13\n"); - DebugPrintf("14 - R2_14\n"); - DebugPrintf("15 - R2_15\n"); - DebugPrintf("16 - R2_16\n"); - DebugPrintf("17 - R2_17\n"); - DebugPrintf("18 - R2_18\n"); - DebugPrintf("19 - R2_19\n"); - DebugPrintf("20 - R2_20\n"); - DebugPrintf("21 - R2_21\n"); - DebugPrintf("22 - R2_22\n"); - DebugPrintf("23 - R2_23\n"); - DebugPrintf("24 - R2_24\n"); - DebugPrintf("25 - R2_25\n"); - DebugPrintf("26 - R2_26\n"); - DebugPrintf("27 - R2_27\n"); - DebugPrintf("28 - R2_28\n"); - DebugPrintf("29 - R2_29\n"); - DebugPrintf("30 - R2_30\n"); - DebugPrintf("31 - R2_31\n"); - DebugPrintf("32 - R2_32\n"); - DebugPrintf("33 - R2_33\n"); - DebugPrintf("34 - R2_34\n"); - DebugPrintf("35 - R2_35\n"); - DebugPrintf("36 - R2_36\n"); - DebugPrintf("37 - R2_37\n"); - DebugPrintf("38 - R2_38\n"); - DebugPrintf("39 - R2_39\n"); - DebugPrintf("40 - R2_40\n"); - DebugPrintf("41 - R2_41\n"); - DebugPrintf("42 - R2_42\n"); - DebugPrintf("43 - R2_43\n"); - DebugPrintf("44 - R2_44\n"); - DebugPrintf("45 - R2_45\n"); - DebugPrintf("46 - R2_46\n"); - DebugPrintf("47 - R2_47\n"); - DebugPrintf("48 - R2_48\n"); - DebugPrintf("49 - R2_49\n"); - DebugPrintf("50 - R2_50\n"); - DebugPrintf("51 - R2_51\n"); - DebugPrintf("52 - R2_52\n"); + debugPrintf("Available objects for this game are:\n"); + debugPrintf("1 - Scene %d - R2_OPTO_DISK\n", BF_INVENTORY.getObjectScene(1)); + debugPrintf("2 - Scene %d - R2_READER\n", BF_INVENTORY.getObjectScene(2)); + debugPrintf("3 - Scene %d - R2_NEGATOR_GUN\n", BF_INVENTORY.getObjectScene(3)); + debugPrintf("4 - Scene %d - R2_STEPPING_DISKS\n", BF_INVENTORY.getObjectScene(4)); + debugPrintf("5 - Scene %d - R2_ATTRACTOR_UNIT\n", BF_INVENTORY.getObjectScene(5)); + debugPrintf("6 - Scene %d - R2_SENSOR_PROBE\n", BF_INVENTORY.getObjectScene(6)); + debugPrintf("7 - Scene %d - R2_SONIC_STUNNER\n", BF_INVENTORY.getObjectScene(7)); + debugPrintf("8 - Scene %d - R2_CABLE_HARNESS\n", BF_INVENTORY.getObjectScene(8)); + debugPrintf("9 - Scene %d - R2_COM_SCANNER\n", BF_INVENTORY.getObjectScene(9)); + debugPrintf("10 - Scene %d - R2_SPENT_POWER_CAPSULE\n", BF_INVENTORY.getObjectScene(10)); + debugPrintf("11 - Scene %d - R2_CHARGED_POWER_CAPSULE\n", BF_INVENTORY.getObjectScene(11)); + debugPrintf("12 - Scene %d - R2_AEROSOL\n", BF_INVENTORY.getObjectScene(12)); + debugPrintf("13 - Scene %d - R2_REMOTE_CONTROL\n", BF_INVENTORY.getObjectScene(13)); + debugPrintf("14 - Scene %d - R2_OPTICAL_FIBER\n", BF_INVENTORY.getObjectScene(14)); + debugPrintf("15 - Scene %d - R2_CLAMP\n", BF_INVENTORY.getObjectScene(15)); + debugPrintf("16 - Scene %d - R2_ATTRACTOR_CABLE_HARNESS\n", BF_INVENTORY.getObjectScene(16)); + debugPrintf("17 - Scene %d - R2_FUEL_CELL\n", BF_INVENTORY.getObjectScene(17)); + debugPrintf("18 - Scene %d - R2_GYROSCOPE\n", BF_INVENTORY.getObjectScene(18)); + debugPrintf("19 - Scene %d - R2_AIRBAG\n", BF_INVENTORY.getObjectScene(19)); + debugPrintf("20 - Scene %d - R2_REBREATHER_TANK\n", BF_INVENTORY.getObjectScene(20)); + debugPrintf("21 - Scene %d - R2_RESERVE_REBREATHER_TANK\n", BF_INVENTORY.getObjectScene(21)); + debugPrintf("22 - Scene %d - R2_GUIDANCE_MODULE\n", BF_INVENTORY.getObjectScene(22)); + debugPrintf("23 - Scene %d - R2_THRUSTER_VALVE\n", BF_INVENTORY.getObjectScene(23)); + debugPrintf("24 - Scene %d - R2_BALLOON_BACKPACK\n", BF_INVENTORY.getObjectScene(24)); + debugPrintf("25 - Scene %d - R2_RADAR_MECHANISM\n", BF_INVENTORY.getObjectScene(25)); + debugPrintf("26 - Scene %d - R2_JOYSTICK\n", BF_INVENTORY.getObjectScene(26)); + debugPrintf("27 - Scene %d - R2_IGNITOR\n", BF_INVENTORY.getObjectScene(27)); + debugPrintf("28 - Scene %d - R2_DIAGNOSTICS_DISPLAY\n", BF_INVENTORY.getObjectScene(28)); + debugPrintf("29 - Scene %d - R2_GLASS_DOME\n", BF_INVENTORY.getObjectScene(29)); + debugPrintf("30 - Scene %d - R2_WICK_LAMP\n", BF_INVENTORY.getObjectScene(30)); + debugPrintf("31 - Scene %d - R2_SCRITH_KEY\n", BF_INVENTORY.getObjectScene(31)); + debugPrintf("32 - Scene %d - R2_TANNER_MASK\n", BF_INVENTORY.getObjectScene(32)); + debugPrintf("33 - Scene %d - R2_PURE_GRAIN_ALCOHOL\n", BF_INVENTORY.getObjectScene(33)); + debugPrintf("34 - Scene %d - R2_SAPPHIRE_BLUE\n", BF_INVENTORY.getObjectScene(34)); + debugPrintf("35 - Scene %d - R2_ANCIENT_SCROLLS\n", BF_INVENTORY.getObjectScene(35)); + debugPrintf("36 - Scene %d - R2_FLUTE\n", BF_INVENTORY.getObjectScene(36)); + debugPrintf("37 - Scene %d - R2_GUNPOWDER\n", BF_INVENTORY.getObjectScene(37)); + debugPrintf("38 - Scene %d - R2_NONAME\n", BF_INVENTORY.getObjectScene(38)); + debugPrintf("39 - Scene %d - R2_COM_SCANNER_2\n", BF_INVENTORY.getObjectScene(39)); + debugPrintf("40 - Scene %d - R2_SUPERCONDUCTOR_WIRE\n", BF_INVENTORY.getObjectScene(40)); + debugPrintf("41 - Scene %d - R2_PILLOW\n", BF_INVENTORY.getObjectScene(41)); + debugPrintf("42 - Scene %d - R2_FOOD_TRAY\n", BF_INVENTORY.getObjectScene(42)); + debugPrintf("43 - Scene %d - R2_LASER_HACKSAW\n", BF_INVENTORY.getObjectScene(43)); + debugPrintf("44 - Scene %d - R2_PHOTON_STUNNER\n", BF_INVENTORY.getObjectScene(44)); + debugPrintf("45 - Scene %d - R2_BATTERY\n", BF_INVENTORY.getObjectScene(45)); + debugPrintf("46 - Scene %d - R2_SOAKED_FACEMASK\n", BF_INVENTORY.getObjectScene(46)); + debugPrintf("47 - Scene %d - R2_LIGHT_BULB\n", BF_INVENTORY.getObjectScene(47)); + debugPrintf("48 - Scene %d - R2_ALCOHOL_LAMP\n", BF_INVENTORY.getObjectScene(48)); + debugPrintf("49 - Scene %d - R2_ALCOHOL_LAMP_2\n", BF_INVENTORY.getObjectScene(49)); + debugPrintf("50 - Scene %d - R2_ALCOHOL_LAMP_3\n", BF_INVENTORY.getObjectScene(50)); + debugPrintf("51 - Scene %d - R2_BROKEN_DISPLAY\n", BF_INVENTORY.getObjectScene(51)); + debugPrintf("52 - Scene %d - R2_TOOLBOX\n", BF_INVENTORY.getObjectScene(52)); return true; } @@ -690,8 +699,8 @@ bool Ringworld2Debugger::Cmd_ListObjects(int argc, const char **argv) { bool Ringworld2Debugger::Cmd_MoveObject(int argc, const char **argv) { // Check for a flag to clear if ((argc < 2) || (argc > 3)){ - DebugPrintf("Usage: %s <object number> [<scene number>]\n", argv[0]); - DebugPrintf("If no scene is specified, the object will be added to inventory\n"); + debugPrintf("Usage: %s <object number> [<scene number>]\n", argv[0]); + debugPrintf("If no scene is specified, the object will be added to inventory\n"); return true; } @@ -703,8 +712,23 @@ bool Ringworld2Debugger::Cmd_MoveObject(int argc, const char **argv) { if ((objNum > 0) && (objNum < 53)) R2_INVENTORY.setObjectScene(objNum, sceneNum); else - DebugPrintf("Invalid object Id %s\n", argv[1]); + debugPrintf("Invalid object Id %s\n", argv[1]); + + return true; +} + +/** + * Activate internal debugger, when available + */ +bool Ringworld2Debugger::Cmd_SetDebug(int argc, const char **argv) { + if (argc != 1) { + debugPrintf("Usage: %s\n", argv[0]); + return true; + } + // Set the internal debugger flag(s?) to true + // _debugCardGame is reset by scene1337::subPostInit() + R2_GLOBALS._debugCardGame = true; return true; } } // End of namespace TsAGE diff --git a/engines/tsage/debugger.h b/engines/tsage/debugger.h index bf826a3f77..610f45de64 100644 --- a/engines/tsage/debugger.h +++ b/engines/tsage/debugger.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -45,6 +45,7 @@ protected: bool Cmd_Sound(int argc, const char **argv); virtual bool Cmd_ListObjects(int argc, const char **argv) = 0; virtual bool Cmd_MoveObject(int argc, const char **argv) = 0; + virtual bool Cmd_SetDebug(int argc, const char **argv); }; class DemoDebugger : public Debugger { @@ -69,6 +70,7 @@ class Ringworld2Debugger : public Debugger { protected: virtual bool Cmd_ListObjects(int argc, const char **argv); virtual bool Cmd_MoveObject(int argc, const char **argv); + virtual bool Cmd_SetDebug(int argc, const char **argv); }; } // End of namespace TsAGE diff --git a/engines/tsage/detection.cpp b/engines/tsage/detection.cpp index a35d663b93..9d61b4d182 100644 --- a/engines/tsage/detection.cpp +++ b/engines/tsage/detection.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -75,7 +75,6 @@ class TSageMetaEngine : public AdvancedMetaEngine { public: TSageMetaEngine() : AdvancedMetaEngine(TsAGE::gameDescriptions, sizeof(TsAGE::tSageGameDescription), tSageGameTitles) { _singleid = "tsage"; - _guioptions = GUIO1(GUIO_NOSPEECH); } virtual const char *getName() const { @@ -130,10 +129,10 @@ public: if (in) { if (TsAGE::Saver::readSavegameHeader(in, header)) { - saveList.push_back(SaveStateDescriptor(slot, header.saveName)); + saveList.push_back(SaveStateDescriptor(slot, header._saveName)); - header.thumbnail->free(); - delete header.thumbnail; + header._thumbnail->free(); + delete header._thumbnail; } delete in; @@ -163,11 +162,11 @@ public: delete f; // Create the return descriptor - SaveStateDescriptor desc(slot, header.saveName); - desc.setThumbnail(header.thumbnail); - desc.setSaveDate(header.saveYear, header.saveMonth, header.saveDay); - desc.setSaveTime(header.saveHour, header.saveMinutes); - desc.setPlayTime(header.totalFrames * GAME_FRAME_TIME); + SaveStateDescriptor desc(slot, header._saveName); + desc.setThumbnail(header._thumbnail); + desc.setSaveDate(header._saveYear, header._saveMonth, header._saveDay); + desc.setSaveTime(header._saveHour, header._saveMinutes); + desc.setPlayTime(header._totalFrames * GAME_FRAME_TIME); return desc; } @@ -177,7 +176,7 @@ public: }; #if PLUGIN_ENABLED_DYNAMIC(TSAGE) -REGISTER_PLUGIN_DYNAMIC(TSAGE, PLUGIN_TYPE_ENGINE, TSageMetaEngine); + REGISTER_PLUGIN_DYNAMIC(TSAGE, PLUGIN_TYPE_ENGINE, TSageMetaEngine); #else -REGISTER_PLUGIN_STATIC(TSAGE, PLUGIN_TYPE_ENGINE, TSageMetaEngine); + REGISTER_PLUGIN_STATIC(TSAGE, PLUGIN_TYPE_ENGINE, TSageMetaEngine); #endif diff --git a/engines/tsage/detection_tables.h b/engines/tsage/detection_tables.h index b374dbc98b..da283a27e7 100644 --- a/engines/tsage/detection_tables.h +++ b/engines/tsage/detection_tables.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -165,13 +165,26 @@ static const tSageGameDescription gameDescriptions[] = { AD_ENTRY1s("r2rw.rlb", "df6c25622387007788ca36d99362c1f0", 47586928), Common::EN_ANY, Common::kPlatformDOS, - ADGF_CD | ADGF_UNSTABLE, + ADGF_CD | ADGF_TESTING, GUIO0() }, GType_Ringworld2, GF_CD | GF_ALT_REGIONS }, - + // Return to Ringworld - Demo + { + { + "ringworld2", + "CD Demo", + AD_ENTRY1s("r2rw.rlb", "c8e1a82c67c3caf57368eadde13dc15f", 32384464), + Common::EN_ANY, + Common::kPlatformDOS, + ADGF_CD | ADGF_TESTING, + GUIO0() + }, + GType_Ringworld2, + GF_CD | GF_ALT_REGIONS | GF_DEMO + }, { AD_TABLE_END_MARKER, 0, 0 } }; diff --git a/engines/tsage/dialogs.cpp b/engines/tsage/dialogs.cpp index 43833f53b9..dd4bc6aa86 100644 --- a/engines/tsage/dialogs.cpp +++ b/engines/tsage/dialogs.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/tsage/dialogs.h b/engines/tsage/dialogs.h index 33b55093d0..8ab37f6c93 100644 --- a/engines/tsage/dialogs.h +++ b/engines/tsage/dialogs.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/tsage/events.cpp b/engines/tsage/events.cpp index d2d8464763..0491c043a4 100644 --- a/engines/tsage/events.cpp +++ b/engines/tsage/events.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -71,7 +71,7 @@ bool EventsClass::pollEvent() { break; default: - break; + break; } return true; @@ -156,7 +156,7 @@ void EventsClass::setCursor(CursorType cursorType) { // No cursor g_globals->setFlag(122); - if ((g_vm->getFeatures() & GF_DEMO) || (g_vm->getGameID() != GType_Ringworld)) { + if ((g_vm->getGameID() != GType_Ringworld) || ((g_vm->getGameID() == GType_Ringworld) && (g_vm->getFeatures() & GF_DEMO))) { CursorMan.showMouse(false); return; } diff --git a/engines/tsage/events.h b/engines/tsage/events.h index 9ef4813e47..a3d96abef4 100644 --- a/engines/tsage/events.h +++ b/engines/tsage/events.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -90,7 +90,7 @@ enum CursorType { R2_ATTRACTOR_UNIT = 5, R2_SENSOR_PROBE = 6, R2_SONIC_STUNNER = 7, R2_CABLE_HARNESS = 8, R2_COM_SCANNER = 9, R2_SPENT_POWER_CAPSULE = 10, R2_CHARGED_POWER_CAPSULE = 11, R2_AEROSOL = 12, R2_REMOTE_CONTROL = 13, - R2_OPTICAL_FIBRE = 14, R2_CLAMP = 15, R2_ATTRACTOR_CABLE_HARNESS = 16, + R2_OPTICAL_FIBER = 14, R2_CLAMP = 15, R2_ATTRACTOR_CABLE_HARNESS = 16, R2_FUEL_CELL = 17, R2_GYROSCOPE = 18, R2_AIRBAG = 19, R2_REBREATHER_TANK = 20, R2_RESERVE_REBREATHER_TANK = 21, R2_GUIDANCE_MODULE = 22, R2_THRUSTER_VALVE = 23, R2_BALLOON_BACKPACK = 24, R2_RADAR_MECHANISM = 25, R2_JOYSTICK = 26, diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index ece6ae3eda..e75febfdbc 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -3,17 +3,17 @@ * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -26,6 +26,7 @@ #include "tsage/ringworld/ringworld_demo.h" #include "tsage/ringworld/ringworld_logic.h" #include "tsage/ringworld2/ringworld2_logic.h" +#include "tsage/ringworld2/ringworld2_scenes0.h" #include "tsage/staticres.h" namespace TsAGE { @@ -47,6 +48,11 @@ static SavedObject *classFactoryProc(const Common::String &className) { if (className == "SceneObjectWrapper") return new SceneObjectWrapper(); if (className == "PaletteRotation") return new PaletteRotation(); if (className == "PaletteFader") return new PaletteFader(); + if (className == "SceneText") return new SceneText(); + + // Return to Ringworld specific classes + if (className == "Scene205_Star") return new Ringworld2::Star(); + return NULL; } @@ -57,18 +63,41 @@ Globals::Globals() : _dialogCenter(160, 140), _gfxManagerInstance(_screenSurface reset(); _stripNum = 0; _gfxEdgeAdjust = 3; - - if (g_vm->getFeatures() & GF_DEMO) { - _gfxFontNumber = 0; - _gfxColors.background = 6; - _gfxColors.foreground = 0; - _fontColors.background = 255; - _fontColors.foreground = 6; - _dialogCenter.y = 80; - // Workaround in order to use later version of the engine - _color1 = _gfxColors.foreground; - _color2 = _gfxColors.foreground; - _color3 = _gfxColors.foreground; + _gfxFontNumber = 0; + + if (g_vm->getGameID() == GType_Ringworld) { + if (g_vm->getFeatures() & GF_DEMO) { + _gfxFontNumber = 0; + _gfxColors.background = 6; + _gfxColors.foreground = 0; + _fontColors.background = 255; + _fontColors.foreground = 6; + _dialogCenter.y = 80; + // Workaround in order to use later version of the engine + _color1 = _gfxColors.foreground; + _color2 = _gfxColors.foreground; + _color3 = _gfxColors.foreground; + } else if (g_vm->getFeatures() & GF_CD) { + _gfxFontNumber = 50; + _gfxColors.background = 53; + _gfxColors.foreground = 0; + _fontColors.background = 51; + _fontColors.foreground = 54; + _color1 = 18; + _color2 = 18; + _color3 = 18; + } else { + // Floppy version + _gfxFontNumber = 50; + _gfxColors.background = 53; + _gfxColors.foreground = 18; + _fontColors.background = 51; + _fontColors.foreground = 54; + // Workaround in order to use later version of the engine + _color1 = _gfxColors.foreground; + _color2 = _gfxColors.foreground; + _color3 = _gfxColors.foreground; + } } else if (g_vm->getGameID() == GType_BlueForce) { // Blue Force _gfxFontNumber = 0; @@ -88,26 +117,6 @@ Globals::Globals() : _dialogCenter(160, 140), _gfxManagerInstance(_screenSurface _color2 = 15; _color3 = 4; _dialogCenter.y = 100; - } else if ((g_vm->getGameID() == GType_Ringworld) && (g_vm->getFeatures() & GF_CD)) { - _gfxFontNumber = 50; - _gfxColors.background = 53; - _gfxColors.foreground = 0; - _fontColors.background = 51; - _fontColors.foreground = 54; - _color1 = 18; - _color2 = 18; - _color3 = 18; - } else { - // Ringworld - _gfxFontNumber = 50; - _gfxColors.background = 53; - _gfxColors.foreground = 18; - _fontColors.background = 51; - _fontColors.foreground = 54; - // Workaround in order to use later version of the engine - _color1 = _gfxColors.foreground; - _color2 = _gfxColors.foreground; - _color3 = _gfxColors.foreground; } _screenSurface.setScreenSurface(); _gfxManagers.push_back(&_gfxManagerInstance); @@ -119,8 +128,11 @@ Globals::Globals() : _dialogCenter(160, 140), _gfxManagerInstance(_screenSurface _sounds.push_back(&_soundHandler); _sounds.push_back(&_sequenceManager._soundHandler); - _scrollFollower = NULL; - _inventory = NULL; + _scrollFollower = nullptr; + + _inventory = nullptr; + _game = nullptr; + _sceneHandler = nullptr; switch (g_vm->getGameID()) { case GType_Ringworld: @@ -145,6 +157,7 @@ Globals::Globals() : _dialogCenter(160, 140), _gfxManagerInstance(_screenSurface _sceneHandler = new Ringworld2::SceneHandlerExt(); break; } + } Globals::~Globals() { @@ -204,6 +217,11 @@ void Globals::dispatchSounds() { /*--------------------------------------------------------------------------*/ +TsAGE2Globals::TsAGE2Globals() { + _onSelectItem = NULL; + _interfaceY = 0; +} + void TsAGE2Globals::reset() { Globals::reset(); @@ -224,15 +242,46 @@ void TsAGE2Globals::synchronize(Serializer &s) { namespace BlueForce { BlueForceGlobals::BlueForceGlobals(): TsAGE2Globals() { + _hiddenDoorStatus = 0; + _nico910State = 0; + _stuart910State = 0; + _nico910Talk = 0; + _stuart910Talk = 0; + _deziTopic = 0; + _deathReason = 0; + _driveFromScene = 300; + _driveToScene = 0; + _subFlagBitArr1 = 0; + _subFlagBitArr2 = 0; + _scene410HarrisonTalkFl = false; + _scene410Action1Count = 0; + _scene410TalkCount = 0; + _scene410HarrisonMovedFl = false; + _bookmark = bNone; + _mapLocationId = 1; + _clip1Bullets = 8; + _clip2Bullets = 8; + + _dayNumber = 0; + _tonyDialogCtr = 0; + _marinaWomanCtr = 0; + _kateDialogCtr = 0; + _v4CEB6 = 0; + _safeCombination = 0; + _gateStatus = 0; + _greenDay5TalkCtr = 0; + _v4CEC8 = 1; + _v4CECA = 0; + _v4CECC = 0; } void BlueForceGlobals::synchronize(Serializer &s) { TsAGE2Globals::synchronize(s); + int16 useless = 0; s.syncAsSint16LE(_dayNumber); if (s.getVersion() < 9) { - int tmpVar = 0; - s.syncAsSint16LE(tmpVar); + s.syncAsSint16LE(useless); } s.syncAsSint16LE(_tonyDialogCtr); s.syncAsSint16LE(_marinaWomanCtr); @@ -241,7 +290,8 @@ void BlueForceGlobals::synchronize(Serializer &s) { s.syncAsSint16LE(_safeCombination); s.syncAsSint16LE(_gateStatus); s.syncAsSint16LE(_greenDay5TalkCtr); - s.syncAsSint16LE(_v4CEC4); + if (s.getVersion() < 11) + s.syncAsSint16LE(useless); s.syncAsSint16LE(_v4CEC8); s.syncAsSint16LE(_v4CECA); s.syncAsSint16LE(_v4CECC); @@ -249,26 +299,30 @@ void BlueForceGlobals::synchronize(Serializer &s) { s.syncAsByte(_breakerBoxStatusArr[i]); s.syncAsSint16LE(_hiddenDoorStatus); s.syncAsSint16LE(_nico910State); - s.syncAsSint16LE(_v4CEE4); - s.syncAsSint16LE(_v4CEE6); - s.syncAsSint16LE(_v4CEE8); + s.syncAsSint16LE(_stuart910State); + s.syncAsSint16LE(_nico910Talk); + s.syncAsSint16LE(_stuart910Talk); s.syncAsSint16LE(_deziTopic); s.syncAsSint16LE(_deathReason); s.syncAsSint16LE(_driveFromScene); s.syncAsSint16LE(_driveToScene); - s.syncAsSint16LE(_v501F8); - s.syncAsSint16LE(_v501FA); - s.syncAsSint16LE(_v501FC); - s.syncAsSint16LE(_v5020C); - s.syncAsSint16LE(_v50696); + if (s.getVersion() < 11) { + s.syncAsSint16LE(useless); + s.syncAsSint16LE(useless); + s.syncAsSint16LE(useless); + s.syncAsSint16LE(useless); + s.syncAsSint16LE(useless); + } s.syncAsSint16LE(_subFlagBitArr1); s.syncAsSint16LE(_subFlagBitArr2); - s.syncAsSint16LE(_v50CC2); - s.syncAsSint16LE(_v50CC4); - s.syncAsSint16LE(_v50CC6); - s.syncAsSint16LE(_v50CC8); - s.syncAsSint16LE(_v51C42); - s.syncAsSint16LE(_v51C44); + s.syncAsSint16LE(_scene410HarrisonTalkFl); + s.syncAsSint16LE(_scene410Action1Count); + s.syncAsSint16LE(_scene410TalkCount); + s.syncAsSint16LE(_scene410HarrisonMovedFl); + if (s.getVersion() < 11) { + s.syncAsSint16LE(useless); + s.syncAsSint16LE(useless); + } s.syncAsSint16LE(_bookmark); s.syncAsSint16LE(_mapLocationId); s.syncAsSint16LE(_clip1Bullets); @@ -298,7 +352,6 @@ void BlueForceGlobals::reset() { _safeCombination = 0; _gateStatus = 0; _greenDay5TalkCtr = 0; - _v4CEC4 = 0; _v4CEC8 = 1; _v4CECA = 0; _v4CECC = 0; @@ -322,24 +375,17 @@ void BlueForceGlobals::reset() { _breakerBoxStatusArr[17] = 0; _hiddenDoorStatus = 0; _nico910State = 0; - _v4CEE4 = 0; - _v4CEE6 = 0; - _v4CEE8 = 0; + _stuart910State = 0; + _nico910Talk = 0; + _stuart910Talk = 0; _deziTopic = 0; _deathReason = 0; - _v501F8 = 0; - _v501FA = 0; - _v501FC = 0; - _v5020C = 0; - _v50696 = 0; _subFlagBitArr1 = 0; _subFlagBitArr2 = 0; - _v50CC2 = 0; - _v50CC4 = 0; - _v50CC6 = 0; - _v50CC8 = 0; - _v51C42 = 0; - _v51C44 = 1; + _scene410HarrisonTalkFl = false; + _scene410Action1Count = 0; + _scene410TalkCount = 0; + _scene410HarrisonMovedFl = false; _clip1Bullets = 8; _clip2Bullets = 8; } @@ -369,6 +415,53 @@ namespace Ringworld2 { Ringworld2Globals::Ringworld2Globals() { _scannerDialog = new ScannerDialog(); + _speechSubtitles = SPEECH_TEXT; + + // Register the inner sound objects for each of the global ASoundExt fields. + // Normally the ASound constructor would do this, but because they're fields + // of the globals, the g_globals reference isn't ready for them to use + _sounds.push_back(&_sound1); + _sounds.push_back(&_sound2); + _sounds.push_back(&_sound3); + _sounds.push_back(&_sound4); + + // Initialize fields + _stripModifier = 0; + _flubMazeArea = 1; + _flubMazeEntryDirection = 0; + _maze3800SceneNumb = 3800; + _landerSuitNumber = 2; + _desertStepsRemaining = 5; + _desertCorrectDirection = 0; + _desertPreviousDirection = 0; + _desertWrongDirCtr = -1; + _balloonAltitude = 5; + _scene1925CurrLevel = 0; + _walkwaySceneNumber = 0; + _mirandaJailState = 0; + _scientistConvIndex = 0; + _ductMazePanel1State = 1; + _ductMazePanel2State = 1; + _ductMazePanel3State = 1; + _scene180Mode = -1; + _v57709 = 0; + _v5780C = 0; + _mouseCursorId = 0; + _v57810 = 0; + + _fadePaletteFlag = false; + _insetUp = 0; + _frameEdgeColor = 2; + _animationCtr = 0; + _electromagnetChangeAmount = 0; + _electromagnetZoom = 0; + _tractorField = false; + _cableAttached = 0; + _foodCount = 0; + _rimLocation = 0; + _rimTransportLocation = 0; + + _debugCardGame = false; } Ringworld2Globals::~Ringworld2Globals() { @@ -397,21 +490,15 @@ void Ringworld2Globals::reset() { Common::fill(&_paletteMap[0], &_paletteMap[4096], 0); _fadePaletteFlag = false; - _v5589E.set(0, 0, 0, 0); - _v558B6.set(0, 0, 0, 0); - _v558C2 = 0; _animationCtr = 0; - _v5657C = 0; _electromagnetChangeAmount = 0; _electromagnetZoom = 0; - _v565E5 = 0; - _v565E7 = 0; - _v565E9 = -5; - _v565EB = 26; + _tractorField = false; + _cableAttached = 0; _foodCount = 0; _rimLocation = 0; _rimTransportLocation = 0; - _v565AE = 0; + _stripModifier = 0; _spillLocation[0] = 0; _spillLocation[1] = 3; _spillLocation[R2_SEEKER] = 5; @@ -427,7 +514,7 @@ void Ringworld2Globals::reset() { _spillLocation[12] = 27; _spillLocation[13] = 31; - // Initialise the vampire data within the Flub maze + // Initialize the vampire data within the Flub maze for (int i = 0; i < 18; i++) { _vampireData[i]._isAlive = true; _vampireData[i]._position = Common::Point(); @@ -451,7 +538,7 @@ void Ringworld2Globals::reset() { _vampireData[16]._shotsRequired = 1; _vampireData[17]._shotsRequired = 1; - _v566A6 = 3800; + _maze3800SceneNumb = 3800; _landerSuitNumber = 2; _flubMazeArea = 1; _flubMazeEntryDirection = 0; @@ -464,23 +551,20 @@ void Ringworld2Globals::reset() { _balloonAltitude = 5; _scene1925CurrLevel = 0; //_v56A9C _walkwaySceneNumber = 0; - _v56AA0 = 0; + _mirandaJailState = 0; _scientistConvIndex = 0; _ventCellPos = Common::Point(60, 660); - _v56AA6 = 1; - _v56AA7 = 1; - _v56AA8 = 1; - _v56AAB = 0; + _ductMazePanel1State = 1; + _ductMazePanel2State = 1; + _ductMazePanel3State = 1; _scene180Mode = -1; _v57709 = 0; _v5780C = 0; - _v5780E = 0; + _mouseCursorId = 0; _v57810 = 0; - _v57C2C = 0; _s1550PlayerArea[R2_QUINN] = Common::Point(27, 4); _s1550PlayerArea[R2_SEEKER] = Common::Point(27, 4); Common::fill(&_scannerFrequencies[0], &_scannerFrequencies[MAX_CHARACTERS], 1); - _speechSubtitles = SPEECH_VOICE | SPEECH_TEXT; _insetUp = 0; _frameEdgeColor = 2; Common::fill(&_stripManager_lookupList[0], &_stripManager_lookupList[12], 0); @@ -504,45 +588,35 @@ void Ringworld2Globals::reset() { _player._characterScene[R2_QUINN] = 100; _player._characterScene[R2_SEEKER] = 300; _player._characterScene[R2_MIRANDA] = 300; + + _debugCardGame = false; } void Ringworld2Globals::synchronize(Serializer &s) { TsAGE2Globals::synchronize(s); int i; - _v5589E.synchronize(s); - _v558B6.synchronize(s); - - s.syncAsSint16LE(_v558C2); s.syncAsSint16LE(_animationCtr); - s.syncAsSint16LE(_v5657C); s.syncAsSint16LE(_electromagnetChangeAmount); s.syncAsSint16LE(_electromagnetZoom); - s.syncAsSint16LE(_v565E5); - s.syncAsSint16LE(_v565E7); - s.syncAsSint16LE(_v565E9); - s.syncAsSint16LE(_v565EB); + s.syncAsSint16LE(_tractorField); + s.syncAsSint16LE(_cableAttached); s.syncAsSint16LE(_foodCount); s.syncAsSint32LE(_rimLocation); s.syncAsSint16LE(_rimTransportLocation); s.syncAsSint16LE(_landerSuitNumber); - s.syncAsSint16LE(_v566A6); + s.syncAsSint16LE(_maze3800SceneNumb); s.syncAsSint16LE(_desertWrongDirCtr); s.syncAsSint16LE(_scene1925CurrLevel); // _v56A9C s.syncAsSint16LE(_walkwaySceneNumber); s.syncAsSint16LE(_ventCellPos.x); s.syncAsSint16LE(_ventCellPos.y); - s.syncAsSint16LE(_v56AAB); s.syncAsSint16LE(_scene180Mode); s.syncAsSint16LE(_v57709); s.syncAsSint16LE(_v5780C); - s.syncAsSint16LE(_v5780E); + s.syncAsSint16LE(_mouseCursorId); s.syncAsSint16LE(_v57810); - s.syncAsSint16LE(_v57C2C); - s.syncAsSint16LE(_speechSubtitles); - byte temp = 0; - s.syncAsByte(temp); s.syncAsByte(_s1550PlayerArea[R2_QUINN].x); s.syncAsByte(_s1550PlayerArea[R2_SEEKER].x); s.syncAsByte(_s1550PlayerArea[R2_QUINN].y); @@ -551,17 +625,17 @@ void Ringworld2Globals::synchronize(Serializer &s) { for (i = 0; i < MAX_CHARACTERS; ++i) s.syncAsByte(_scannerFrequencies[i]); - s.syncAsByte(_v565AE); + s.syncAsByte(_stripModifier); s.syncAsByte(_flubMazeArea); s.syncAsByte(_flubMazeEntryDirection); s.syncAsByte(_desertStepsRemaining); s.syncAsByte(_desertCorrectDirection); s.syncAsByte(_desertPreviousDirection); - s.syncAsByte(_v56AA0); + s.syncAsByte(_mirandaJailState); s.syncAsByte(_scientistConvIndex); - s.syncAsByte(_v56AA6); - s.syncAsByte(_v56AA7); - s.syncAsByte(_v56AA8); + s.syncAsByte(_ductMazePanel1State); + s.syncAsByte(_ductMazePanel2State); + s.syncAsByte(_ductMazePanel3State); for (i = 0; i < 14; ++i) s.syncAsByte(_spillLocation[i]); @@ -580,7 +654,7 @@ void Ringworld2Globals::synchronize(Serializer &s) { s.syncAsSint16LE(_balloonPosition.x); s.syncAsSint16LE(_balloonPosition.y); - // Synchronise Flub maze vampire data + // Synchronize Flub maze vampire data for (i = 0; i < 18; ++i) { s.syncAsSint16LE(_vampireData[i]._isAlive); s.syncAsSint16LE(_vampireData[i]._shotsRequired); diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h index ad47f7f620..1194fe8b9c 100644 --- a/engines/tsage/globals.h +++ b/engines/tsage/globals.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -110,7 +110,7 @@ public: int _interfaceY; ASoundExt _inventorySound; - TsAGE2Globals() { _onSelectItem = NULL; } + TsAGE2Globals(); virtual void reset(); virtual void synchronize(Serializer &s); }; @@ -194,33 +194,25 @@ public: int _safeCombination; int _gateStatus; int _greenDay5TalkCtr; - int _v4CEC4; int _v4CEC8; int _v4CECA; int _v4CECC; int8 _breakerBoxStatusArr[18]; int _hiddenDoorStatus; int _nico910State; - int _v4CEE4; - int _v4CEE6; - int _v4CEE8; + int _stuart910State; + int _nico910Talk; + int _stuart910Talk; int _deziTopic; int _deathReason; int _driveFromScene; int _driveToScene; - int _v501F8; - int _v501FA; - int _v501FC; - int _v5020C; - int _v50696; uint8 _subFlagBitArr1; uint8 _subFlagBitArr2; - int _v50CC2; - int _v50CC4; - int _v50CC6; - int _v50CC8; - int _v51C42; - int _v51C44; + bool _scene410HarrisonTalkFl; + int _scene410Action1Count; + int _scene410TalkCount; + bool _scene410HarrisonMovedFl; Bookmark _bookmark; int _mapLocationId; int _clip1Bullets, _clip2Bullets; @@ -259,27 +251,21 @@ public: byte _fadePaletteMap[10][256]; byte _paletteMap[4096]; int _insetUp; - int _frameEdgeColor; // _v421e - Rect _v5589E; - Rect _v558B6; - int _v558C2; + int _frameEdgeColor; int _animationCtr; int _electromagnetChangeAmount; int _electromagnetZoom; - int _v565E5; - int _v565E7; - int _v565E9; - int _v565EB; + bool _tractorField; + bool _cableAttached; int _foodCount; int _rimLocation; int _rimTransportLocation; - int _v5657C; - byte _v565AE; + byte _stripModifier; byte _spillLocation[14]; VampireData _vampireData[18]; byte _flubMazeArea; byte _flubMazeEntryDirection; - int _v566A6; + int _maze3800SceneNumb; byte _landerSuitNumber; byte _desertStepsRemaining; byte _desertCorrectDirection; @@ -289,26 +275,24 @@ public: byte _balloonAltitude; int _scene1925CurrLevel; //_v56A9C int _walkwaySceneNumber; - byte _v56AA0; + byte _mirandaJailState; byte _scientistConvIndex; Common::Point _ventCellPos; - int _v56AA4; - byte _v56AA6; - byte _v56AA7; - byte _v56AA8; - int _v56AAB; + byte _ductMazePanel1State; + byte _ductMazePanel2State; + byte _ductMazePanel3State; int _scene180Mode; // _v575f7 int _v57709; int _v5780C; - int _v5780E; + int _mouseCursorId; int _v57810; - int _v57C2C; int _speechSubtitles; Common::Point _s1550PlayerArea[3]; // only used for Quinn and Seeker byte _scannerFrequencies[4]; byte _stripManager_lookupList[12]; byte _scene1550JunkLocations[508]; Common::Point _balloonPosition; + bool _debugCardGame; // moved from scene 1337 so it can be easily set in the debugger ScannerDialog *_scannerDialog; diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index 2395cc67ed..ce24c76290 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -68,11 +68,16 @@ GfxSurface surfaceFromRes(const byte *imgData) { Rect r(0, 0, READ_LE_UINT16(imgData), READ_LE_UINT16(imgData + 2)); GfxSurface s; s.create(r.width(), r.height()); - s._centroid.x = READ_LE_UINT16(imgData + 4); - s._centroid.y = READ_LE_UINT16(imgData + 6); s._transColor = *(imgData + 8); - bool rleEncoded = (imgData[9] & 2) != 0; + byte flags = imgData[9]; + s._flags = (g_vm->getGameID() != GType_Ringworld) ? flags : 0; + + bool rleEncoded = (flags & 2) != 0; + + // Figure out the centroid + s._centroid.x = READ_LE_UINT16(imgData + 4); + s._centroid.y = READ_LE_UINT16(imgData + 6); const byte *srcP = imgData + 10; Graphics::Surface destSurface = s.lockSurface(); @@ -184,8 +189,9 @@ void Rect::contain(const Rect &r) { * @percent Scaling percentage */ void Rect::resize(const GfxSurface &surface, int xp, int yp, int percent) { - int xe = surface.getBounds().width() * percent / 100; - int ye = surface.getBounds().height() * percent / 100; + const Rect &bounds = surface.getBounds(); + int xe = bounds.width() * percent / 100; + int ye = bounds.height() * percent / 100; this->set(0, 0, xe, ye); if (!right) ++right; @@ -193,8 +199,13 @@ void Rect::resize(const GfxSurface &surface, int xp, int yp, int percent) { this->moveTo(xp, yp); - int xd = surface._centroid.x * percent / 100; - int yd = surface._centroid.y * percent / 100; + int xa = (surface._flags & FRAME_FLIP_CENTROID_X) == 0 ? surface._centroid.x : + bounds.width() - (surface._centroid.x + 1); + int ya = (surface._flags & FRAME_FLIP_CENTROID_Y) == 0 ? surface._centroid.y : + bounds.height() - (surface._centroid.y + 1); + + int xd = xa * percent / 100; + int yd = ya * percent / 100; this->translate(-xd, -yd); } @@ -224,6 +235,7 @@ GfxSurface::GfxSurface() : _bounds(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) { _customSurface = NULL; _transColor = -1; _trackDirtyRects = false; + _flags = 0; } GfxSurface::GfxSurface(const GfxSurface &s) { @@ -407,6 +419,7 @@ GfxSurface &GfxSurface::operator=(const GfxSurface &s) { _bounds = s._bounds; _centroid = s._centroid; _transColor = s._transColor; + _flags = s._flags; if (_customSurface) { // Surface owns the internal data, so replicate it so new surface owns it's own @@ -559,9 +572,11 @@ static GfxSurface ResizeSurface(GfxSurface &src, int xSize, int ySize, int trans } /** - * Copys an area from one GfxSurface to another + * Copys an area from one GfxSurface to another. + * */ -void GfxSurface::copyFrom(GfxSurface &src, Rect srcBounds, Rect destBounds, Region *priorityRegion) { +void GfxSurface::copyFrom(GfxSurface &src, Rect srcBounds, Rect destBounds, + Region *priorityRegion, const byte *shadowMap) { GfxSurface srcImage; if (srcBounds.isEmpty()) return; @@ -591,20 +606,24 @@ void GfxSurface::copyFrom(GfxSurface &src, Rect srcBounds, Rect destBounds, Regi Graphics::Surface srcSurface = srcImage.lockSurface(); Graphics::Surface destSurface = lockSurface(); + // Get clipping area + Rect clipRect = !_clipRect.isEmpty() ? _clipRect : + Rect(0, 0, destSurface.w, destSurface.h); + // Adjust bounds to ensure destination will be on-screen int srcX = 0, srcY = 0; - if (destBounds.left < 0) { - srcX = -destBounds.left; - destBounds.left = 0; + if (destBounds.left < clipRect.left) { + srcX = clipRect.left - destBounds.left; + destBounds.left = clipRect.left; } - if (destBounds.top < 0) { - srcY = -destBounds.top; - destBounds.top = 0; + if (destBounds.top < clipRect.top) { + srcY = clipRect.top - destBounds.top; + destBounds.top = clipRect.top; } - if (destBounds.right > destSurface.w) - destBounds.right = destSurface.w; - if (destBounds.bottom > destSurface.h) - destBounds.bottom = destSurface.h; + if (destBounds.right > clipRect.right) + destBounds.right = clipRect.right; + if (destBounds.bottom > clipRect.bottom) + destBounds.bottom = clipRect.bottom; if (destBounds.isValidRect() && !((destBounds.right < 0) || (destBounds.bottom < 0) || (destBounds.left >= destSurface.w) || (destBounds.top >= destSurface.h))) { @@ -627,8 +646,15 @@ void GfxSurface::copyFrom(GfxSurface &src, Rect srcBounds, Rect destBounds, Regi if (!priorityRegion || !priorityRegion->contains(Common::Point( xp + g_globals->_sceneManager._scene->_sceneBounds.left, destBounds.top + y + g_globals->_sceneManager._scene->_sceneBounds.top))) { - if (*tempSrc != src._transColor) - *tempDest = *tempSrc; + if (*tempSrc != src._transColor) { + if (shadowMap) { + // Using a shadow map, so translate the dest pixel using the mapping array + *tempDest = shadowMap[*tempDest]; + } else { + // Otherwise, it's a standard pixel copy + *tempDest = *tempSrc; + } + } } ++tempSrc; ++tempDest; @@ -706,6 +732,11 @@ GfxElement::GfxElement() { _owner = NULL; _keycode = 0; _flags = 0; + + _fontNumber = 0; + _color1 = 0; + _color2 = 0; + _color3 = 0; } void GfxElement::setDefaults() { @@ -796,8 +827,8 @@ void GfxElement::drawFrame() { // Draw the edge frame // Outer frame border - surface.hLine(tempRect.left + 2, tempRect.top, tempRect.right - 2, 0); - surface.hLine(tempRect.left + 2, tempRect.bottom, tempRect.right - 2, 0); + surface.hLine(tempRect.left + 2, tempRect.top, tempRect.right - 2, 0); + surface.hLine(tempRect.left + 2, tempRect.bottom, tempRect.right - 2, 0); surface.vLine(tempRect.left, tempRect.top + 2, tempRect.bottom - 2, 0); surface.vLine(tempRect.right, tempRect.top + 2, tempRect.bottom - 2, 0); *((byte *)surface.getBasePtr(tempRect.left + 1, tempRect.top + 1)) = 0; @@ -806,8 +837,8 @@ void GfxElement::drawFrame() { *((byte *)surface.getBasePtr(tempRect.right - 1, tempRect.bottom - 1)) = 0; // Inner frame border - surface.hLine(tempRect.left + 2, tempRect.top + 1, tempRect.right - 2, R2_GLOBALS._frameEdgeColor); - surface.hLine(tempRect.left + 2, tempRect.bottom - 1, tempRect.right - 2, R2_GLOBALS._frameEdgeColor); + surface.hLine(tempRect.left + 2, tempRect.top + 1, tempRect.right - 2, R2_GLOBALS._frameEdgeColor); + surface.hLine(tempRect.left + 2, tempRect.bottom - 1, tempRect.right - 2, R2_GLOBALS._frameEdgeColor); surface.vLine(tempRect.left + 1, tempRect.top + 2, tempRect.bottom - 2, R2_GLOBALS._frameEdgeColor); surface.vLine(tempRect.right - 1, tempRect.top + 2, tempRect.bottom - 2, R2_GLOBALS._frameEdgeColor); *((byte *)surface.getBasePtr(tempRect.left + 2, tempRect.top + 2)) = R2_GLOBALS._frameEdgeColor; @@ -1198,6 +1229,8 @@ GfxButton *GfxDialog::execute(GfxButton *defaultButton) { selectedButton = defaultButton; breakFlag = true; break; + } else if (event.eventType == EVENT_KEYPRESS && handleKeypress(event, selectedButton)) { + breakFlag = true; } } } @@ -1214,8 +1247,9 @@ GfxButton *GfxDialog::execute(GfxButton *defaultButton) { } void GfxDialog::setPalette() { - if (g_vm->getGameID() == GType_BlueForce) { - g_globals->_scenePalette.loadPalette(2); + if (g_vm->getGameID() != GType_Ringworld) { + 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); @@ -1358,11 +1392,16 @@ void GfxManager::copyFrom(GfxSurface &src, const Rect &srcBounds, const Rect &de GfxFont::GfxFont() { - _fontNumber = (g_vm->getFeatures() & GF_DEMO) ? 0 : 50; + if ((g_vm->getGameID() == GType_Ringworld) && (g_vm->getFeatures() & GF_DEMO)) + _fontNumber = 0; + else + _fontNumber = 50; _numChars = 0; _bpp = 0; _fontData = NULL; _fillFlag = false; + + _gfxManager = nullptr; } GfxFont::~GfxFont() { @@ -1446,7 +1485,6 @@ int GfxFont::getStringFit(const char *&s, int maxWidth) { const char *nextWord = NULL; const char *sStart = s; int numChars = 1; - int strWidth = 1; char nextChar; for (;;) { @@ -1460,7 +1498,7 @@ int GfxFont::getStringFit(const char *&s, int maxWidth) { nextWord = s; } - strWidth = getStringWidth(sStart, numChars); + int strWidth = getStringWidth(sStart, numChars); if (strWidth > maxWidth) { if (nextWord) { s = nextWord; diff --git a/engines/tsage/graphics.h b/engines/tsage/graphics.h index 7239a99a68..d65d0bcf8b 100644 --- a/engines/tsage/graphics.h +++ b/engines/tsage/graphics.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -71,6 +71,8 @@ public: LineSlice(int xStart, int xEnd) { xs = xStart; xe = xEnd; } }; +enum FrameFlag { FRAME_FLIP_CENTROID_X = 4, FRAME_FLIP_CENTROID_Y = 8 }; + class GfxSurface { private: Graphics::Surface *_customSurface; @@ -88,6 +90,8 @@ private: public: Common::Point _centroid; int _transColor; + Rect _clipRect; + byte _flags; public: GfxSurface(); GfxSurface(const GfxSurface &s); @@ -104,7 +108,8 @@ public: void setBounds(const Rect &bounds) { _bounds = bounds; } const Rect &getBounds() const { return _bounds; } - void copyFrom(GfxSurface &src, Rect srcBounds, Rect destBounds, Region *priorityRegion = NULL); + void copyFrom(GfxSurface &src, Rect srcBounds, Rect destBounds, + Region *priorityRegion = NULL, const byte *shadowMap = NULL); void copyFrom(GfxSurface &src, Rect destBounds, Region *priorityRegion = NULL) { copyFrom(src, src.getBounds(), destBounds, priorityRegion); } @@ -338,6 +343,8 @@ public: virtual void draw(); static void setPalette(); + + virtual bool handleKeypress(Event &evt, GfxButton *&btn) { return false; } }; GfxSurface *surfaceGetArea(GfxSurface &src, const Rect &bounds); diff --git a/engines/tsage/resources.cpp b/engines/tsage/resources.cpp index 5987d78067..d4b922a1c3 100644 --- a/engines/tsage/resources.cpp +++ b/engines/tsage/resources.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/tsage/resources.h b/engines/tsage/resources.h index 45cecf8521..a7536a3c2d 100644 --- a/engines/tsage/resources.h +++ b/engines/tsage/resources.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/tsage/ringworld/ringworld_demo.cpp b/engines/tsage/ringworld/ringworld_demo.cpp index fedb19c804..cd2ab07a50 100644 --- a/engines/tsage/ringworld/ringworld_demo.cpp +++ b/engines/tsage/ringworld/ringworld_demo.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/tsage/ringworld/ringworld_demo.h b/engines/tsage/ringworld/ringworld_demo.h index 7c0ac39285..2b93a40049 100644 --- a/engines/tsage/ringworld/ringworld_demo.h +++ b/engines/tsage/ringworld/ringworld_demo.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/tsage/ringworld/ringworld_dialogs.cpp b/engines/tsage/ringworld/ringworld_dialogs.cpp index 4728e66cd9..226a943f08 100644 --- a/engines/tsage/ringworld/ringworld_dialogs.cpp +++ b/engines/tsage/ringworld/ringworld_dialogs.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -385,7 +385,6 @@ void InventoryDialog::execute() { if ((RING_INVENTORY._selectedItem) && RING_INVENTORY._selectedItem->inInventory()) RING_INVENTORY._selectedItem->setCursor(); - GfxElement *hiliteObj; bool lookFlag = false; _gfxManager.activate(); @@ -399,7 +398,7 @@ void InventoryDialog::execute() { if (g_vm->shouldQuit()) break; - hiliteObj = NULL; + GfxElement *hiliteObj = nullptr; if ((event.eventType == EVENT_BUTTON_DOWN) && !_bounds.contains(event.mousePos)) break; diff --git a/engines/tsage/ringworld/ringworld_dialogs.h b/engines/tsage/ringworld/ringworld_dialogs.h index b14b3f6d78..68ac0a05f9 100644 --- a/engines/tsage/ringworld/ringworld_dialogs.h +++ b/engines/tsage/ringworld/ringworld_dialogs.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/tsage/ringworld/ringworld_logic.cpp b/engines/tsage/ringworld/ringworld_logic.cpp index 0584570ac2..1d8293cffd 100644 --- a/engines/tsage/ringworld/ringworld_logic.cpp +++ b/engines/tsage/ringworld/ringworld_logic.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -270,6 +270,11 @@ bool DisplayObject::performAction(int action) { SceneArea::SceneArea() { _savedArea = NULL; _pt.x = _pt.y = 0; + + _resNum = 0; + _rlbNum = 0; + _subNum = 0; + _actionId = 0; } SceneArea::~SceneArea() { diff --git a/engines/tsage/ringworld/ringworld_logic.h b/engines/tsage/ringworld/ringworld_logic.h index e902ac127f..d384593989 100644 --- a/engines/tsage/ringworld/ringworld_logic.h +++ b/engines/tsage/ringworld/ringworld_logic.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/tsage/ringworld/ringworld_scenes1.cpp b/engines/tsage/ringworld/ringworld_scenes1.cpp index 89c07273fc..9eacc5ff10 100644 --- a/engines/tsage/ringworld/ringworld_scenes1.cpp +++ b/engines/tsage/ringworld/ringworld_scenes1.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -52,52 +52,52 @@ void Scene10::Action1::signal() { scene->_stripManager.start(11, this, scene); break; case 3: - scene->_object2.hide(); - scene->_object3.hide(); - scene->_object3.setAction(NULL); - scene->_object4.animate(ANIM_MODE_5, this); + scene->_veeshkaHead.hide(); + scene->_veeshkaRightArm.hide(); + scene->_veeshkaRightArm.setAction(NULL); + scene->_centurion.animate(ANIM_MODE_5, this); break; case 4: case 9: - scene->_object1.animate(ANIM_MODE_5, this); + scene->_veeshkaBody.animate(ANIM_MODE_5, this); break; case 5: - scene->_object2.setStrip(3); - scene->_object2.setFrame(1); - scene->_object2.setPosition(Common::Point(240, 51)); - scene->_object2.show(); + scene->_veeshkaHead.setStrip(3); + scene->_veeshkaHead.setFrame(1); + scene->_veeshkaHead.setPosition(Common::Point(240, 51)); + scene->_veeshkaHead.show(); - scene->_object3.setStrip(6); - scene->_object3.setFrame(1); - scene->_object3.setPosition(Common::Point(200, 76)); - scene->_object3._numFrames = 20; - scene->_object3.show(); + scene->_veeshkaRightArm.setStrip(6); + scene->_veeshkaRightArm.setFrame(1); + scene->_veeshkaRightArm.setPosition(Common::Point(200, 76)); + scene->_veeshkaRightArm._numFrames = 20; + scene->_veeshkaRightArm.show(); scene->_stripManager.start(12, this, scene); break; case 6: - scene->_object2.hide(); - scene->_object3.hide(); - scene->_object1.animate(ANIM_MODE_6, this); + scene->_veeshkaHead.hide(); + scene->_veeshkaRightArm.hide(); + scene->_veeshkaBody.animate(ANIM_MODE_6, this); break; case 7: - scene->_object3.show(); - scene->_object3.setStrip2(5); - scene->_object3._numFrames = 10; - scene->_object3.setPosition(Common::Point(180, 87)); - scene->_object3.setAction(&scene->_action2); + scene->_veeshkaRightArm.show(); + scene->_veeshkaRightArm.setStrip2(5); + scene->_veeshkaRightArm._numFrames = 10; + scene->_veeshkaRightArm.setPosition(Common::Point(180, 87)); + scene->_veeshkaRightArm.setAction(&scene->_action2); - scene->_object2.setStrip(4); - scene->_object2.setFrame(1); - scene->_object2.setPosition(Common::Point(204, 59)); - scene->_object2.show(); + scene->_veeshkaHead.setStrip(4); + scene->_veeshkaHead.setFrame(1); + scene->_veeshkaHead.setPosition(Common::Point(204, 59)); + scene->_veeshkaHead.show(); scene->_stripManager.start(13, this, scene); break; case 8: - scene->_object2.hide(); - scene->_object3.hide(); - scene->_object4.animate(ANIM_MODE_6, this); + scene->_veeshkaHead.hide(); + scene->_veeshkaRightArm.hide(); + scene->_centurion.animate(ANIM_MODE_6, this); break; case 10: g_globals->_soundHandler.fadeOut(this); @@ -109,6 +109,7 @@ void Scene10::Action1::signal() { } } +// Move Veeshka's fingers void Scene10::Action2::signal() { Scene10 *scene = (Scene10 *)g_globals->_sceneManager._scene; @@ -117,8 +118,8 @@ void Scene10::Action2::signal() { setDelay(g_globals->_randomSource.getRandomNumber(179)); break; case 1: - scene->_object3.setFrame(1); - scene->_object3.animate(ANIM_MODE_5, this); + scene->_veeshkaRightArm.setFrame(1); + scene->_veeshkaRightArm.animate(ANIM_MODE_5, this); _actionIndex = 0; break; } @@ -145,43 +146,43 @@ void Scene10::postInit(SceneObjectList *OwnerList) { _stripManager.setCallback(this); - _object1.postInit(); - _object1.setVisage(10); - _object1.setPosition(Common::Point(232, 90)); - _object1.fixPriority(1); - - _object2.postInit(); - _object2.setVisage(10); - _object2.setStrip(4); - _object2.setFrame(1); - _object2.setPosition(Common::Point(204, 59)); - _object2.fixPriority(198); - - _object3.postInit(); - _object3.setVisage(10); - _object3.setStrip2(5); - _object3.setPosition(Common::Point(180, 87)); - _object3.fixPriority(196); - _object3.setAction(&_action2); - - _object4.postInit(); - _object4.setVisage(10); - _object4.setStrip(2); - _object4.setPosition(Common::Point(0, 209)); - _object4.animate(ANIM_MODE_1, NULL); - - _object5.postInit(); - _object5.setVisage(11); - _object5.setPosition(Common::Point(107, 146)); - _object5.animate(ANIM_MODE_2, NULL); - _object5._numFrames = 5; - - _object6.postInit(); - _object6.setVisage(11); - _object6.setStrip(2); - _object6.setPosition(Common::Point(287, 149)); - _object6.animate(ANIM_MODE_2, NULL); - _object6._numFrames = 5; + _veeshkaBody.postInit(); + _veeshkaBody.setVisage(10); + _veeshkaBody.setPosition(Common::Point(232, 90)); + _veeshkaBody.fixPriority(1); + + _veeshkaHead.postInit(); + _veeshkaHead.setVisage(10); + _veeshkaHead.setStrip(4); + _veeshkaHead.setFrame(1); + _veeshkaHead.setPosition(Common::Point(204, 59)); + _veeshkaHead.fixPriority(198); + + _veeshkaRightArm.postInit(); + _veeshkaRightArm.setVisage(10); + _veeshkaRightArm.setStrip2(5); + _veeshkaRightArm.setPosition(Common::Point(180, 87)); + _veeshkaRightArm.fixPriority(196); + _veeshkaRightArm.setAction(&_action2); + + _centurion.postInit(); + _centurion.setVisage(10); + _centurion.setStrip(2); + _centurion.setPosition(Common::Point(0, 209)); + _centurion.animate(ANIM_MODE_1, NULL); + + _leftSmoke.postInit(); + _leftSmoke.setVisage(11); + _leftSmoke.setPosition(Common::Point(107, 146)); + _leftSmoke.animate(ANIM_MODE_2, NULL); + _leftSmoke._numFrames = 5; + + _rightSmoke.postInit(); + _rightSmoke.setVisage(11); + _rightSmoke.setStrip(2); + _rightSmoke.setPosition(Common::Point(287, 149)); + _rightSmoke.animate(ANIM_MODE_2, NULL); + _rightSmoke._numFrames = 5; g_globals->_sceneManager._scene->_sceneBounds.contain(g_globals->_sceneManager._scene->_backgroundBounds); g_globals->_sceneOffset.x = (g_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; @@ -193,14 +194,14 @@ void Scene10::postInit(SceneObjectList *OwnerList) { void Scene10::stripCallback(int v) { switch (v) { case 1: - _object2.animate(ANIM_MODE_7, -1, NULL); + _veeshkaHead.animate(ANIM_MODE_7, -1, NULL); break; case 2: - _object2.animate(ANIM_MODE_NONE); + _veeshkaHead.animate(ANIM_MODE_NONE); break; case 3: - _object2.animate(ANIM_MODE_7, -1, NULL); - _object3.animate(ANIM_MODE_5, NULL); + _veeshkaHead.animate(ANIM_MODE_7, -1, NULL); + _veeshkaRightArm.animate(ANIM_MODE_5, NULL); break; default: break; @@ -227,13 +228,13 @@ void Scene15::Action1::signal() { case 2: { SceneItem::display(15, 1, SET_Y, 20, SET_FONT, 2, SET_BG_COLOR, -1, SET_EXT_BGCOLOR, 7, SET_WIDTH, 320, SET_KEEP_ONSCREEN, 1, LIST_END); - scene->_object1.postInit(); - scene->_object1.setVisage(15); - scene->_object1.setPosition(Common::Point(160, -10)); - scene->_object1.animate(ANIM_MODE_2, NULL); + scene->_ship.postInit(); + scene->_ship.setVisage(15); + scene->_ship.setPosition(Common::Point(160, -10)); + scene->_ship.animate(ANIM_MODE_2, NULL); Common::Point pt(160, 100); NpcMover *mover = new NpcMover(); - scene->_object1.addMover(mover, &pt, this); + scene->_ship.addMover(mover, &pt, this); scene->_soundHandler.play(7); break; } @@ -247,8 +248,8 @@ void Scene15::Action1::signal() { void Scene15::Action1::dispatch() { Scene15 *scene = (Scene15 *)g_globals->_sceneManager._scene; - if (scene->_object1._position.y < 100) - scene->_object1.changeZoom(100 - scene->_object1._position.y); + if (scene->_ship._position.y < 100) + scene->_ship.changeZoom(100 - scene->_ship._position.y); Action::dispatch(); } @@ -307,9 +308,9 @@ void Scene20::Action2::signal() { Common::Point pt(455, 77); g_globals->_player.addMover(mover, &pt, this); ObjectMover2 *mover2 = new ObjectMover2(); - scene->_SceneObjectExt.addMover(mover2, 5, 10, &g_globals->_player); + scene->_assassinShip1.addMover(mover2, 5, 10, &g_globals->_player); ObjectMover2 *mover3 = new ObjectMover2(); - scene->_sceneObject3.addMover(mover3, 10, 15, &g_globals->_player); + scene->_assassinShip2.addMover(mover3, 10, 15, &g_globals->_player); break; } case 3: { @@ -369,9 +370,9 @@ void Scene20::Action3::signal() { Common::Point pt(615, 81); g_globals->_player.addMover(npcMover, &pt, this); ObjectMover2 *mover1 = new ObjectMover2(); - scene->_SceneObjectExt.addMover(mover1, 5, 10, &g_globals->_player); + scene->_assassinShip1.addMover(mover1, 5, 10, &g_globals->_player); ObjectMover2 *mover2 = new ObjectMover2(); - scene->_sceneObject3.addMover(mover2, 20, 25, &g_globals->_player); + scene->_assassinShip2.addMover(mover2, 20, 25, &g_globals->_player); break; } case 2: { @@ -382,8 +383,8 @@ void Scene20::Action3::signal() { } case 3: { g_globals->_player._moveDiff = Common::Point(10, 10); - scene->_SceneObjectExt._moveDiff = Common::Point(10, 10); - scene->_sceneObject3._moveDiff = Common::Point(10, 10); + scene->_assassinShip1._moveDiff = Common::Point(10, 10); + scene->_assassinShip2._moveDiff = Common::Point(10, 10); npcMover = new NpcMover(); Common::Point pt(445, 132); g_globals->_player.addMover(npcMover, &pt, this); @@ -427,73 +428,73 @@ void Scene20::Action4::signal() { Common::Point pt(486, 134); g_globals->_player.addMover(npcMover, &pt, this); ObjectMover2 *mover1 = new ObjectMover2(); - scene->_SceneObjectExt.addMover(mover1, 20, 35, &g_globals->_player); + scene->_assassinShip1.addMover(mover1, 20, 35, &g_globals->_player); break; } case 2: { g_globals->_player._moveDiff = Common::Point(12, 12); - scene->_SceneObjectExt._moveDiff = Common::Point(12, 12); + scene->_assassinShip1._moveDiff = Common::Point(12, 12); NpcMover *mover1 = new NpcMover(); Common::Point pt(486, 134); - scene->_sceneObject3.addMover(mover1, &pt, this); + scene->_assassinShip2.addMover(mover1, &pt, this); NpcMover *mover2 = new NpcMover(); pt = Common::Point(-15, 134); g_globals->_player.addMover(mover2, &pt, NULL); NpcMover *mover3 = new NpcMover(); pt = Common::Point(-15, 134); - scene->_SceneObjectExt.addMover(mover3, &pt, NULL); + scene->_assassinShip1.addMover(mover3, &pt, NULL); break; } case 3: { - scene->_sceneObject3._moveDiff = Common::Point(20, 20); + scene->_assassinShip2._moveDiff = Common::Point(20, 20); npcMover = new NpcMover(); Common::Point pt(320, 134); - scene->_sceneObject3.addMover(npcMover, &pt, this); + scene->_assassinShip2.addMover(npcMover, &pt, this); break; } case 4: { scene->_sound.play(28); - scene->_sceneObject4.postInit(); - scene->_sceneObject4.setVisage(21); - scene->_sceneObject4.setStrip(3); - scene->_sceneObject4.setPosition(Common::Point(scene->_sceneObject3._position.x - 36, - scene->_sceneObject3._position.y - 1)); - scene->_sceneObject4._moveDiff.x = 48; + scene->_laserShot1.postInit(); + scene->_laserShot1.setVisage(21); + scene->_laserShot1.setStrip(3); + Common::Point pt = Common::Point(scene->_assassinShip2._position.x - 36, scene->_assassinShip2._position.y - 1); + scene->_laserShot1.setPosition(pt); + scene->_laserShot1._moveDiff.x = 48; ObjectMover3 *mover = new ObjectMover3(); - scene->_sceneObject4.addMover(mover, &scene->_SceneObjectExt, 4, this); + scene->_laserShot1.addMover(mover, &scene->_assassinShip1, 4, this); break; } case 5: { scene->_sound.play(42); - scene->_sceneObject4.remove(); - scene->_SceneObjectExt.setVisage(21); - scene->_SceneObjectExt.setStrip(1); - scene->_SceneObjectExt.setFrame(1); - scene->_SceneObjectExt.animate(ANIM_MODE_5, NULL); + scene->_laserShot1.remove(); + scene->_assassinShip1.setVisage(21); + scene->_assassinShip1.setStrip(1); + scene->_assassinShip1.setFrame(1); + scene->_assassinShip1.animate(ANIM_MODE_5, NULL); - scene->_SceneObjectExt._moveDiff.x = 4; + scene->_assassinShip1._moveDiff.x = 4; NpcMover *mover1 = new NpcMover(); - Common::Point pt(scene->_SceneObjectExt._position.x - 12, scene->_SceneObjectExt._position.y + 5); - scene->_SceneObjectExt.addMover(mover1, &pt, NULL); + Common::Point pt(scene->_assassinShip1._position.x - 12, scene->_assassinShip1._position.y + 5); + scene->_assassinShip1.addMover(mover1, &pt, NULL); - scene->_sceneObject5.postInit(); - scene->_sceneObject5.setVisage(21); - scene->_sceneObject5.setStrip(3); - scene->_sceneObject5.setPosition(Common::Point(scene->_sceneObject3._position.x - 36, - scene->_sceneObject3._position.y - 1)); - scene->_sceneObject5._moveDiff.x = 48; + scene->_laserShot2.postInit(); + scene->_laserShot2.setVisage(21); + scene->_laserShot2.setStrip(3); + pt = Common::Point(scene->_assassinShip2._position.x - 36, scene->_assassinShip2._position.y - 1); + scene->_laserShot2.setPosition(pt); + scene->_laserShot2._moveDiff.x = 48; ObjectMover3 *mover = new ObjectMover3(); - scene->_sceneObject5.addMover(mover, &g_globals->_player, 4, this); + scene->_laserShot2.addMover(mover, &g_globals->_player, 4, this); break; } case 6: { scene->_sound.play(42); - scene->_SceneObjectExt.setStrip(2); - scene->_SceneObjectExt.animate(ANIM_MODE_2, NULL); + scene->_assassinShip1.setStrip(2); + scene->_assassinShip1.animate(ANIM_MODE_2, NULL); - scene->_sceneObject5.remove(); + scene->_laserShot2.remove(); g_globals->_player.setVisage(21); g_globals->_player.setStrip(1); g_globals->_player.setFrame(1); @@ -539,18 +540,18 @@ void Scene20::postInit(SceneObjectList *OwnerList) { g_globals->_player._moveDiff = Common::Point(10, 10); g_globals->_player.animate(ANIM_MODE_1, NULL); - _SceneObjectExt.postInit(); - _SceneObjectExt.setVisage(20); - _SceneObjectExt.setPosition(Common::Point(400, 69)); - _SceneObjectExt.animate(ANIM_MODE_1, NULL); + _assassinShip1.postInit(); + _assassinShip1.setVisage(20); + _assassinShip1.setPosition(Common::Point(400, 69)); + _assassinShip1.animate(ANIM_MODE_1, NULL); - _sceneObject3.postInit(); - _sceneObject3.setVisage(20); - _sceneObject3.setPosition(Common::Point(395, 69)); - _sceneObject3.animate(ANIM_MODE_1, NULL); + _assassinShip2.postInit(); + _assassinShip2.setVisage(20); + _assassinShip2.setPosition(Common::Point(395, 69)); + _assassinShip2.animate(ANIM_MODE_1, NULL); - _SceneObjectExt._moveDiff = Common::Point(10, 10); - _sceneObject3._moveDiff = Common::Point(10, 10); + _assassinShip1._moveDiff = Common::Point(10, 10); + _assassinShip2._moveDiff = Common::Point(10, 10); g_globals->_soundHandler.play(20); _sound.play(21); _sound.holdAt(true); @@ -567,16 +568,16 @@ void Scene20::postInit(SceneObjectList *OwnerList) { g_globals->_player.fixPriority(50); g_globals->_player.animate(ANIM_MODE_1, NULL); - _SceneObjectExt.postInit(); - _SceneObjectExt.setVisage(20); - _SceneObjectExt.setPosition(Common::Point(583, 79)); - _SceneObjectExt.animate(ANIM_MODE_1, NULL); + _assassinShip1.postInit(); + _assassinShip1.setVisage(20); + _assassinShip1.setPosition(Common::Point(583, 79)); + _assassinShip1.animate(ANIM_MODE_1, NULL); - _sceneObject3.postInit(); - _sceneObject3.setVisage(20); - _sceneObject3.setStrip2(2); - _sceneObject3.setPosition(Common::Point(595, 79)); - _sceneObject3.animate(ANIM_MODE_1, NULL); + _assassinShip2.postInit(); + _assassinShip2.setVisage(20); + _assassinShip2.setStrip2(2); + _assassinShip2.setPosition(Common::Point(595, 79)); + _assassinShip2.animate(ANIM_MODE_1, NULL); if ((g_globals->getFlag(120) && g_globals->getFlag(116)) || (g_globals->getFlag(117) && g_globals->getFlag(119))) { @@ -584,10 +585,10 @@ void Scene20::postInit(SceneObjectList *OwnerList) { setAction(&_action3); } else if (g_globals->getFlag(104)) { _sceneMode = 21; - setAction(&_sequenceManager, this, 21, &g_globals->_player, &_SceneObjectExt, NULL); + setAction(&_sequenceManager, this, 21, &g_globals->_player, &_assassinShip1, NULL); } else { // Failed evasion - _sceneObject3._moveDiff = Common::Point(8, 8); + _assassinShip2._moveDiff = Common::Point(8, 8); setAction(&_action4); } _sceneBounds.center(g_globals->_player._position.x, g_globals->_player._position.y); @@ -626,26 +627,37 @@ void Scene20::signal() { *--------------------------------------------------------------------------*/ void Scene30::BeamObject::doAction(int action) { - if (action == OBJECT_SCANNER) + switch (action) { + case OBJECT_SCANNER: display2(30, 14); - else if (action == CURSOR_LOOK) + break; + case CURSOR_LOOK: display2(30, 2); - else if (action == CURSOR_USE) { + break; + case CURSOR_USE: { Scene30 *parent = (Scene30 *)g_globals->_sceneManager._scene; parent->setAction(&parent->_beamAction); - } else + } + break; + default: SceneObject::doAction(action); + } } void Scene30::DoorObject::doAction(int action) { - if (action == OBJECT_SCANNER) + switch (action) { + case OBJECT_SCANNER: display2(30, 13); - else if (action == CURSOR_LOOK) + break; + case CURSOR_LOOK: display2(30, 1); - else if (action == CURSOR_USE) + break; + case CURSOR_USE: display2(30, 7); - else + break; + default: SceneObject::doAction(action); + } } void Scene30::BeamAction::signal() { @@ -963,16 +975,16 @@ void Scene40::Action1::signal() { scene->_doorway.hide(); scene->_dyingKzin.setPosition(Common::Point(296, 62)); g_globals->_player.animate(ANIM_MODE_5, NULL); - scene->_object1.setVisage(43); - scene->_object1.setStrip(3); - scene->_object1.animate(ANIM_MODE_5, NULL); - scene->_object2.hide(); - scene->_object3.hide(); + scene->_seeker.setVisage(43); + scene->_seeker.setStrip(3); + scene->_seeker.animate(ANIM_MODE_5, NULL); + scene->_seekerTail.hide(); + scene->_seekerHand.hide(); scene->_stripManager.start(45, this); break; case 4: - scene->_object2.remove(); - scene->_object3.remove(); + scene->_seekerTail.remove(); + scene->_seekerHand.remove(); scene->_assassin.setVisage(42); scene->_assassin.setStrip(2); scene->_assassin.setFrame(1); @@ -1049,10 +1061,10 @@ void Scene40::Action1::signal() { break; case 15: g_globals->_player.disableControl(); - scene->_object1.setVisage(40); - scene->_object1.setStrip(4); - scene->_object1.setFrame(1); - scene->_object1.animate(ANIM_MODE_5, NULL); + scene->_seeker.setVisage(40); + scene->_seeker.setStrip(4); + scene->_seeker.setFrame(1); + scene->_seeker.animate(ANIM_MODE_5, NULL); g_globals->_player.setVisage(40); g_globals->_player.setStrip(2); g_globals->_player.setFrame(1); @@ -1122,13 +1134,13 @@ void Scene40::Action2::signal() { } case 6: { g_globals->_player.setStrip(7); - scene->_object1.setVisage(2806); - scene->_object1.animate(ANIM_MODE_1, NULL); + scene->_seeker.setVisage(2806); + scene->_seeker.animate(ANIM_MODE_1, NULL); SceneObjectWrapper *wrapper = new SceneObjectWrapper(); - scene->_object1.setObjectWrapper(wrapper); + scene->_seeker.setObjectWrapper(wrapper); Common::Point pt(200, 190); NpcMover *mover = new NpcMover(); - scene->_object1.addMover(mover, &pt, this); + scene->_seeker.addMover(mover, &pt, this); break; } case 7: @@ -1137,12 +1149,12 @@ void Scene40::Action2::signal() { case 8: { Common::Point pt(170, 260); NpcMover *mover = new NpcMover(); - scene->_object1.addMover(mover, &pt, this); + scene->_seeker.addMover(mover, &pt, this); break; } case 9: scene->_dyingKzin.setAction(&scene->_action7); - scene->_object1.remove(); + scene->_seeker.remove(); g_globals->_stripNum = 88; g_globals->_events.setCursor(CURSOR_WALK); g_globals->_player.enableControl(); @@ -1202,6 +1214,7 @@ void Scene40::Action4::signal() { } } +// Animate the tail of Seeker, with random pauses void Scene40::Action5::signal() { Scene40 *scene = (Scene40 *)g_globals->_sceneManager._scene; @@ -1210,7 +1223,7 @@ void Scene40::Action5::signal() { setDelay(g_globals->_randomSource.getRandomNumber(119) + 120); break; case 1: - scene->_object2.animate(ANIM_MODE_8, 1, this); + scene->_seekerTail.animate(ANIM_MODE_8, 1, this); _actionIndex = 0; } } @@ -1220,17 +1233,17 @@ void Scene40::Action6::signal() { switch (_actionIndex++) { case 0: { - scene->_object1.postInit(); - scene->_object1.setVisage(16); - scene->_object1.setStrip2(6); - scene->_object1._moveDiff = Common::Point(40, 40); - scene->_object1.setPosition(Common::Point(313, 53)); - scene->_object1._moveRate = 60; + scene->_seeker.postInit(); + scene->_seeker.setVisage(16); + scene->_seeker.setStrip2(6); + scene->_seeker._moveDiff = Common::Point(40, 40); + scene->_seeker.setPosition(Common::Point(313, 53)); + scene->_seeker._moveRate = 60; Common::Point pt(141, 194); NpcMover *mover = new NpcMover(); - scene->_object1.addMover(mover, &pt, NULL); - scene->_object1.animate(ANIM_MODE_5, NULL); + scene->_seeker.addMover(mover, &pt, NULL); + scene->_seeker.animate(ANIM_MODE_5, NULL); scene->_doorway.postInit(); scene->_doorway.setVisage(46); @@ -1260,21 +1273,21 @@ void Scene40::Action7::signal() { setDelay(g_globals->_randomSource.getRandomNumber(499) + 500); break; case 1: - scene->_object7.postInit(); - scene->_object7.setVisage(46); + scene->_leftEntrance.postInit(); + scene->_leftEntrance.setVisage(46); if (g_globals->_randomSource.getRandomNumber(32767) >= 16384) { - scene->_object7.setStrip(3); - scene->_object7.setPosition(Common::Point(15, 185)); + scene->_leftEntrance.setStrip(3); + scene->_leftEntrance.setPosition(Common::Point(15, 185)); } else { - scene->_object7.setPosition(Common::Point(305, 61)); - scene->_object7.setFrame(15); + scene->_leftEntrance.setPosition(Common::Point(305, 61)); + scene->_leftEntrance.setFrame(15); } - scene->_object7.animate(ANIM_MODE_5, this); + scene->_leftEntrance.animate(ANIM_MODE_5, this); scene->_soundHandler.play(25); break; case 2: - scene->_object7.remove(); + scene->_leftEntrance.remove(); _actionIndex = 0; setDelay(60); break; @@ -1465,12 +1478,12 @@ void Scene40::Item6::doAction(int action) { /*--------------------------------------------------------------------------*/ Scene40::Scene40() : - _item1(2, OBJECT_SCANNER, 40, 24, OBJECT_STUNNER, 40, 25, CURSOR_LOOK, 40, 7, CURSOR_USE, 40, 16, LIST_END), - _item3(5, OBJECT_SCANNER, 40, 28, OBJECT_STUNNER, 40, 27, CURSOR_LOOK, 40, 2, CURSOR_USE, 40, 30, LIST_END), - _item4(6, OBJECT_SCANNER, 40, 31, OBJECT_STUNNER, 40, 32, CURSOR_LOOK, 40, 5, CURSOR_USE, 40, 33, LIST_END), - _item5(0, CURSOR_LOOK, 40, 11, LIST_END), - _item7(4, OBJECT_SCANNER, 40, 26, OBJECT_STUNNER, 40, 27, CURSOR_LOOK, 40, 9, CURSOR_USE, 40, 17, LIST_END), - _item8(8, OBJECT_SCANNER, 40, 39, OBJECT_STUNNER, 40, 40, CURSOR_LOOK, 40, 3, CURSOR_USE, 40, 41, LIST_END) { + _ball(2, OBJECT_SCANNER, 40, 24, OBJECT_STUNNER, 40, 25, CURSOR_LOOK, 40, 7, CURSOR_USE, 40, 16, LIST_END), + _window(5, OBJECT_SCANNER, 40, 28, OBJECT_STUNNER, 40, 27, CURSOR_LOOK, 40, 2, CURSOR_USE, 40, 30, LIST_END), + _entrance(6, OBJECT_SCANNER, 40, 31, OBJECT_STUNNER, 40, 32, CURSOR_LOOK, 40, 5, CURSOR_USE, 40, 33, LIST_END), + _background(0, CURSOR_LOOK, 40, 11, LIST_END), + _emerald(4, OBJECT_SCANNER, 40, 26, OBJECT_STUNNER, 40, 27, CURSOR_LOOK, 40, 9, CURSOR_USE, 40, 17, LIST_END), + _tree(8, OBJECT_SCANNER, 40, 39, OBJECT_STUNNER, 40, 40, CURSOR_LOOK, 40, 3, CURSOR_USE, 40, 41, LIST_END) { } void Scene40::postInit(SceneObjectList *OwnerList) { @@ -1489,7 +1502,7 @@ void Scene40::postInit(SceneObjectList *OwnerList) { _speakerGameText._color1 = 9; _speakerGameText.setTextPos(Common::Point(160, 30)); _speakerQText._npc = &g_globals->_player; - _speakerSText._npc = &_object1; + _speakerSText._npc = &_seeker; g_globals->_player.postInit(); g_globals->_player.setVisage(0); @@ -1502,23 +1515,24 @@ void Scene40::postInit(SceneObjectList *OwnerList) { g_globals->_soundHandler.play(24); g_globals->_player.setVisage(43); - _object1.postInit(); - _object1.setVisage(41); - _object1.setPosition(Common::Point(105, 220)); - _object2.postInit(); - _object2.setVisage(41); - _object2.setStrip(6); - _object2.fixPriority(200); - _object2.setPosition(Common::Point(94, 189)); - _object2.setAction(&_action5); - - _object3.postInit(); - _object3.setVisage(41); - _object3.setStrip(5); - _object3.fixPriority(205); - _object3.setPosition(Common::Point(110, 186)); - _object3._numFrames = 2; - _object3.animate(ANIM_MODE_8, NULL, NULL); + _seeker.postInit(); + _seeker.setVisage(41); + _seeker.setPosition(Common::Point(105, 220)); + + _seekerTail.postInit(); + _seekerTail.setVisage(41); + _seekerTail.setStrip(6); + _seekerTail.fixPriority(200); + _seekerTail.setPosition(Common::Point(94, 189)); + _seekerTail.setAction(&_action5); + + _seekerHand.postInit(); + _seekerHand.setVisage(41); + _seekerHand.setStrip(5); + _seekerHand.fixPriority(205); + _seekerHand.setPosition(Common::Point(110, 186)); + _seekerHand._numFrames = 2; + _seekerHand.animate(ANIM_MODE_8, NULL, NULL); _assassin.postInit(); _assassin.setPosition(Common::Point(-40, 191)); @@ -1563,12 +1577,12 @@ void Scene40::postInit(SceneObjectList *OwnerList) { setAction(&_action4); } - _item5.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); - _item6._sceneRegionId = 3; - _item2._sceneRegionId = 7; + _background.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); + _pedestal._sceneRegionId = 3; + _statue._sceneRegionId = 7; - g_globals->_sceneItems.addItems(&_dyingKzin, &_item8, &_item1, &_item2, &_item3, &_item4, - &_item6, &_item7, &_item5, NULL); + g_globals->_sceneItems.addItems(&_dyingKzin, &_tree, &_ball, &_statue, &_window, &_entrance, + &_pedestal, &_emerald, &_background, NULL); } void Scene40::signal() { @@ -1609,7 +1623,7 @@ void Scene50::Action1::signal() { scene->_stripManager.start(63, this); break; case 2: - if (scene->_stripManager._field2E8 != 107) { + if (scene->_stripManager._currObj44Id != 107) { g_globals->_player.enableControl(); remove(); } else { @@ -1691,7 +1705,7 @@ void Scene50::Object1::doAction(int action) { } } -void Scene50::Object2::doAction(int action) { +void Scene50::LeftFlyCycle::doAction(int action) { Scene50 *scene = (Scene50 *)g_globals->_sceneManager._scene; switch (action) { @@ -1715,7 +1729,7 @@ void Scene50::Object2::doAction(int action) { } } -void Scene50::Object3::doAction(int action) { +void Scene50::CenterFlyCycle::doAction(int action) { Scene50 *scene = (Scene50 *)g_globals->_sceneManager._scene; switch (action) { @@ -1743,7 +1757,7 @@ void Scene50::Object3::doAction(int action) { } } -void Scene50::Object4::doAction(int action) { +void Scene50::RightFlyCycle::doAction(int action) { Scene50 *scene = (Scene50 *)g_globals->_sceneManager._scene; switch (action) { @@ -1772,12 +1786,13 @@ void Scene50::Object4::doAction(int action) { /*--------------------------------------------------------------------------*/ Scene50::Scene50() : - _item0(0, CURSOR_LOOK, 50, 3, LIST_END), + _background(0, CURSOR_LOOK, 50, 3, LIST_END), _item1(0, OBJECT_SCANNER, 50, 15, CURSOR_USE, 50, 16, CURSOR_LOOK, 50, 3, LIST_END), - _item2(0, CURSOR_LOOK, 50, 7, LIST_END), - _item3(8, OBJECT_STUNNER, 50, 14, OBJECT_SCANNER, 50, 13, CURSOR_LOOK, 50, 3, LIST_END), - _item4(9, OBJECT_SCANNER, 40, 39, OBJECT_STUNNER, 40, 40, CURSOR_USE, 40, 41, CURSOR_LOOK, 50, 5, LIST_END), - _item5(10, OBJECT_SCANNER, 50, 17, OBJECT_STUNNER, 50, 18, CURSOR_LOOK, 50, 6, CURSOR_USE, 30, 8, LIST_END) { + _entrance(0, CURSOR_LOOK, 50, 7, LIST_END), + // The original was using dialog 50/3 for CURSOR_LOOK, which is too generic. + _bulwark(8, OBJECT_STUNNER, 50, 14, OBJECT_SCANNER, 50, 13, CURSOR_LOOK, 30, 0, LIST_END), + _tree(9, OBJECT_SCANNER, 40, 39, OBJECT_STUNNER, 40, 40, CURSOR_USE, 40, 41, CURSOR_LOOK, 50, 5, LIST_END), + _flagstones(10, OBJECT_SCANNER, 50, 17, OBJECT_STUNNER, 50, 18, CURSOR_LOOK, 50, 6, CURSOR_USE, 30, 8, LIST_END) { _doorwayRect = Rect(80, 108, 160, 112); } @@ -1806,25 +1821,25 @@ void Scene50::postInit(SceneObjectList *OwnerList) { g_globals->_player.setPosition(Common::Point(270, 143)); } - _object2.postInit(); - _object2.setVisage(2331); - _object2.setStrip(6); - _object2.setPosition(Common::Point(136, 192)); - _object2.fixPriority(200); + _leftFlyCycle.postInit(); + _leftFlyCycle.setVisage(2331); + _leftFlyCycle.setStrip(6); + _leftFlyCycle.setPosition(Common::Point(136, 192)); + _leftFlyCycle.fixPriority(200); - _object3.postInit(); - _object3.setVisage(2337); - _object3.setStrip(6); - _object3.setPosition(Common::Point(260, 180)); - _object3.fixPriority(200); + _centerFlyCycle.postInit(); + _centerFlyCycle.setVisage(2337); + _centerFlyCycle.setStrip(6); + _centerFlyCycle.setPosition(Common::Point(260, 180)); + _centerFlyCycle.fixPriority(200); - _object4.postInit(); - _object4.setVisage(2331); - _object4.setStrip(6); - _object4.setPosition(Common::Point(295, 144)); - _object4.fixPriority(178); + _rightFlyCycle.postInit(); + _rightFlyCycle.setVisage(2331); + _rightFlyCycle.setStrip(6); + _rightFlyCycle.setPosition(Common::Point(295, 144)); + _rightFlyCycle.fixPriority(178); - g_globals->_sceneItems.addItems(&_object2, &_object3, &_object4, NULL); + g_globals->_sceneItems.addItems(&_leftFlyCycle, &_centerFlyCycle, &_rightFlyCycle, NULL); if (!g_globals->getFlag(101)) { g_globals->_player.disableControl(); @@ -1840,8 +1855,8 @@ void Scene50::postInit(SceneObjectList *OwnerList) { } } - _item0.setBounds(Rect(200, 0, 320, 200)); - g_globals->_sceneItems.addItems(&_item3, &_item4, &_item5, &_item0, NULL); + _background.setBounds(Rect(0, 0, 320, 200)); + g_globals->_sceneItems.addItems(&_bulwark, &_tree, &_flagstones, &_background, NULL); } void Scene50::signal() { @@ -1928,8 +1943,8 @@ void Scene60::Action1::signal() { scene->_controlButton.remove(); scene->_slaveButton.remove(); scene->_masterButton.remove(); - scene->_item1.remove(); - scene->_item2.remove(); + scene->_diskDrive.remove(); + scene->_dashboard.remove(); scene->_nextButton.postInit(); scene->_nextButton.setVisage(65); @@ -2030,11 +2045,11 @@ void Scene60::Action2::signal() { /*--------------------------------------------------------------------------*/ void Scene60::PrevObject::doAction(int action) { - Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; - if (action == CURSOR_LOOK) { SceneItem::display2(60, 16); } else if (action == CURSOR_USE) { + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; + animate(ANIM_MODE_8, 1, NULL); if (scene->_action1.getActionIndex() > 5) { @@ -2048,11 +2063,11 @@ void Scene60::PrevObject::doAction(int action) { } void Scene60::NextObject::doAction(int action) { - Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; - if (action == CURSOR_LOOK) { SceneItem::display2(60, 17); } else if (action == CURSOR_USE) { + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; + animate(ANIM_MODE_8, 1, NULL); if (scene->_action1.getActionIndex() < 8) { @@ -2065,11 +2080,11 @@ void Scene60::NextObject::doAction(int action) { } void Scene60::ExitObject::doAction(int action) { - Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; - if (action == CURSOR_LOOK) { SceneItem::display2(60, 18); } else if (action == CURSOR_USE) { + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; + scene->_soundHandler3.play(36); animate(ANIM_MODE_8, 1, NULL); scene->_nextButton.remove(); @@ -2111,11 +2126,11 @@ void Scene60::ExitObject::doAction(int action) { if (scene->_masterButton._state) scene->_masterButton.setFrame(2); - g_globals->_sceneItems.push_front(&scene->_item1); + g_globals->_sceneItems.push_front(&scene->_diskDrive); 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); + g_globals->_sceneItems.push_back(&scene->_dashboard); g_globals->gfxManager()._font.setFontNumber(2); g_globals->_sceneText._fontNumber = 2; @@ -2130,11 +2145,11 @@ void Scene60::ExitObject::doAction(int action) { } void Scene60::MessageObject::doAction(int action) { - Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; - if (action == CURSOR_LOOK) { SceneItem::display2(60, 9); } else if (action == CURSOR_USE) { + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; + scene->_action1.setDelay(1); g_globals->setFlag(83); } else { @@ -2143,11 +2158,11 @@ void Scene60::MessageObject::doAction(int action) { } void Scene60::ControlObject::doAction(int action) { - Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; - if (action == CURSOR_LOOK) { SceneItem::display2(60, 11); } else if (action == CURSOR_USE) { + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; + if (_animateMode == ANIM_MODE_NONE) SceneItem::display2(60, 14); else if (!scene->_slaveButton._state) { @@ -2164,11 +2179,11 @@ void Scene60::ControlObject::doAction(int action) { } void Scene60::SlaveObject::doAction(int action) { - Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; - if (action == CURSOR_LOOK) { SceneItem::display2(60, 8); } else if (action == CURSOR_USE) { + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; + if (scene->_masterButton._state) scene->_sceneMode = 19; else if (_state) { @@ -2194,11 +2209,11 @@ void Scene60::SlaveObject::doAction(int action) { } void Scene60::MasterObject::doAction(int action) { - Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; - if (action == CURSOR_LOOK) { SceneItem::display2(60, 7); } else if (action == CURSOR_USE) { + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; + if (!scene->_controlButton._animateMode) scene->_sceneMode = 14; else if (scene->_slaveButton._state) @@ -2226,11 +2241,11 @@ void Scene60::MasterObject::doAction(int action) { } void Scene60::FloppyDrive::doAction(int action) { - Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; - if (action == CURSOR_LOOK) { SceneItem::display2(60, 13); } else if (action == CURSOR_USE) { + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; + g_globals->setFlag(!g_globals->_stripNum ? 118 : 121); scene->setAction(&scene->_action1); } else { @@ -2300,11 +2315,11 @@ void Scene60::Item::doAction(int action) { /*--------------------------------------------------------------------------*/ Scene60::Scene60() : - _item2(0, 12, 12), - _item3(8, 22, 23), - _item4(9, 24, 25), - _item5(10, 26, 27), - _item6(11, 28, 29) { + _dashboard(0, 12, 12), + _intercomm(8, 22, 23), + _viewScreen(9, 24, 25), + _speedControl(10, 26, 27), + _speaker(11, 28, 29) { } void Scene60::postInit(SceneObjectList *OwnerList) { @@ -2345,8 +2360,8 @@ void Scene60::postInit(SceneObjectList *OwnerList) { setAction(&_sequenceManager, this, 61, NULL); } - _item1.setBounds(Rect(130, 55, 174, 70)); - _item2.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); + _diskDrive.setBounds(Rect(130, 55, 174, 70)); + _dashboard.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); if (g_globals->_stripNum == 0) { if (g_globals->getFlag(117)) { @@ -2419,8 +2434,7 @@ void Scene60::postInit(SceneObjectList *OwnerList) { } } - g_globals->_sceneItems.addItems(&_item3, &_item4, &_item5, &_item6, - &_item1, &_item2, NULL); + g_globals->_sceneItems.addItems(&_intercomm, &_viewScreen, &_speedControl, &_speaker, &_diskDrive, &_dashboard, NULL); } void Scene60::signal() { @@ -2474,17 +2488,17 @@ void Scene90::Action1::signal() { case 3: { Common::Point pt(278, 191); NpcMover *mover = new NpcMover(); - scene->_object2.addMover(mover, &pt, this); + scene->_guard.addMover(mover, &pt, this); break; } case 4: - scene->_object2.setStrip(3); + scene->_guard.setStrip(3); setDelay(2); break; case 5: scene->_soundHandler2.play(58); - if (scene->_stripManager._field2E8 == 220) + if (scene->_stripManager._currObj44Id == 220) scene->_stripManager.start(91, this, scene); else { scene->_stripManager.start(g_globals->getFlag(104) ? 93 : 92, this, scene); @@ -2492,36 +2506,36 @@ void Scene90::Action1::signal() { } break; case 6: - scene->_object2.animate(ANIM_MODE_NONE); + scene->_guard.animate(ANIM_MODE_NONE); g_globals->_player._uiEnabled = true; break; case 7: - scene->_object2.animate(ANIM_MODE_NONE); + scene->_guard.animate(ANIM_MODE_NONE); g_globals->_soundHandler.play(56); - scene->_object3.animate(ANIM_MODE_5, this); + scene->_headGate.animate(ANIM_MODE_5, this); break; case 8: { Common::Point pt(215, 127); PlayerMover *mover = new PlayerMover(); - scene->_object5.addMover(mover, &pt, this); + scene->_quinnShip.addMover(mover, &pt, this); break; } case 9: { Common::Point pt1(215, 127); PlayerMover *mover1 = new PlayerMover(); - scene->_object1.addMover(mover1, &pt1, this); + scene->_seekerShip.addMover(mover1, &pt1, this); Common::Point pt2(86, 62); PlayerMover *mover2 = new PlayerMover(); - scene->_object5.addMover(mover2, &pt2, this); + scene->_quinnShip.addMover(mover2, &pt2, this); break; } case 10: { PlayerMover2 *mover = new PlayerMover2(); - scene->_object1.addMover(mover, 10, 15, &scene->_object5); + scene->_seekerShip.addMover(mover, 10, 15, &scene->_quinnShip); if (!g_globals->getFlag(104)) { mover = new PlayerMover2(); - scene->_object4.addMover(mover, 10, 15, &scene->_object1); + scene->_emptyShip.addMover(mover, 10, 15, &scene->_seekerShip); } setDelay(60); break; @@ -2529,7 +2543,7 @@ void Scene90::Action1::signal() { case 11: g_globals->_soundHandler.play(57); g_globals->_soundHandler.play(68); - scene->_object3.animate(ANIM_MODE_6, NULL); + scene->_headGate.animate(ANIM_MODE_6, NULL); 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); @@ -2544,7 +2558,7 @@ void Scene90::Action1::signal() { /*--------------------------------------------------------------------------*/ -void Scene90::Object1::doAction(int action) { +void Scene90::SeekerShip::doAction(int action) { Scene90 *scene = (Scene90 *)g_globals->_sceneManager._scene; switch (action) { @@ -2562,23 +2576,23 @@ void Scene90::Object1::doAction(int action) { } } -void Scene90::Object2::doAction(int action) { +void Scene90::Guard::doAction(int action) { Scene90 *scene = (Scene90 *)g_globals->_sceneManager._scene; switch (action) { case OBJECT_STUNNER: case CURSOR_USE: g_globals->_player.disableControl(); - scene->_object6.postInit(); - scene->_object6.setVisage(90); - scene->_object6.setStrip(6); - scene->_object6.setPosition(Common::Point(184, 210)); - scene->_object6.hide(); + scene->_bubble.postInit(); + scene->_bubble.setVisage(90); + scene->_bubble.setStrip(6); + scene->_bubble.setPosition(Common::Point(184, 210)); + scene->_bubble.hide(); scene->_sceneMode = 91; scene->_soundHandler1.play(59); scene->_soundHandler1.holdAt(true); - scene->setAction(&scene->_sequenceManager, scene, 91, this, &scene->_object6, NULL); + scene->setAction(&scene->_sequenceManager, scene, 91, this, &scene->_bubble, NULL); break; case CURSOR_LOOK: SceneItem::display2(90, 8); @@ -2596,21 +2610,21 @@ void Scene90::Object2::doAction(int action) { /*--------------------------------------------------------------------------*/ Scene90::Scene90() : - _item1(0, CURSOR_LOOK, 90, 9, LIST_END), - _item2(0, CURSOR_LOOK, 90, 10, LIST_END), - _item3(0, CURSOR_LOOK, 90, 11, LIST_END), - _object3(OBJECT_STUNNER, 90, 13, CURSOR_LOOK, 90, 12, CURSOR_USE, 90, 16, LIST_END), - _object4(CURSOR_LOOK, 90, 17, LIST_END), - _object5(CURSOR_LOOK, 90, 18, CURSOR_USE, 90, 19, LIST_END) { + _guardShack(0, CURSOR_LOOK, 90, 9, LIST_END), + _shed(0, CURSOR_LOOK, 90, 10, LIST_END), + _background(0, CURSOR_LOOK, 90, 11, LIST_END), + _headGate(OBJECT_STUNNER, 90, 13, CURSOR_LOOK, 90, 12, CURSOR_USE, 90, 16, LIST_END), + _emptyShip(CURSOR_LOOK, 90, 17, LIST_END), + _quinnShip(CURSOR_LOOK, 90, 18, CURSOR_USE, 90, 19, LIST_END) { } void Scene90::stripCallback(int v) { Scene90 *scene = (Scene90 *)g_globals->_sceneManager._scene; if (v == 1) - scene->_object2.animate(ANIM_MODE_7, 0, NULL); + scene->_guard.animate(ANIM_MODE_7, 0, NULL); else if (v == 2) - scene->_object2.animate(ANIM_MODE_NONE); + scene->_guard.animate(ANIM_MODE_NONE); } void Scene90::postInit(SceneObjectList *OwnerList) { @@ -2624,53 +2638,53 @@ void Scene90::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_speakerQL); _stripManager.addSpeaker(&_speakerSR); - _speakerMText._npc = &_object2; + _speakerMText._npc = &_guard; _speakerQText._textWidth = 160; - _speakerQText._npc = &_object5; - _speakerSText._npc = &_object1; - - _object5.postInit(); - _object5.setVisage(2333); - _object5.setObjectWrapper(new SceneObjectWrapper()); - _object5._strip = 7; - _object5._moveDiff = Common::Point(22, 22); - _object5.setPosition(Common::Point(151, 177)); - _object5.changeZoom(-1); - g_globals->_sceneItems.push_back(&_object5); - - _object1.postInit(); - _object1.setVisage(2337); - _object1.setObjectWrapper(new SceneObjectWrapper()); - _object1._strip = 4; - _object1._moveDiff = Common::Point(20, 20); - _object1.setPosition(Common::Point(212, 183)); - _object1.changeZoom(-1); - g_globals->_sceneItems.push_back(&_object1); + _speakerQText._npc = &_quinnShip; + _speakerSText._npc = &_seekerShip; + + _quinnShip.postInit(); + _quinnShip.setVisage(2333); + _quinnShip.setObjectWrapper(new SceneObjectWrapper()); + _quinnShip._strip = 7; + _quinnShip._moveDiff = Common::Point(22, 22); + _quinnShip.setPosition(Common::Point(151, 177)); + _quinnShip.changeZoom(-1); + g_globals->_sceneItems.push_back(&_quinnShip); + + _seekerShip.postInit(); + _seekerShip.setVisage(2337); + _seekerShip.setObjectWrapper(new SceneObjectWrapper()); + _seekerShip._strip = 4; + _seekerShip._moveDiff = Common::Point(20, 20); + _seekerShip.setPosition(Common::Point(212, 183)); + _seekerShip.changeZoom(-1); + g_globals->_sceneItems.push_back(&_seekerShip); if (!g_globals->getFlag(104)) { - _object4.postInit(); - _object4.setVisage(2331); - _object4.setObjectWrapper(new SceneObjectWrapper()); - _object4._strip = 4; - _object4._moveDiff = Common::Point(20, 20); - _object4.setPosition(Common::Point(251, 207)); - _object4.changeZoom(-1); - g_globals->_sceneItems.push_back(&_object4); - } - - _object2.postInit(); - _object2.setVisage(90); - _object2.animate(ANIM_MODE_1, NULL); - _object2.setPosition(Common::Point(315, 185)); - _object2._strip = 2; - 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); - g_globals->_sceneItems.push_back(&_object3); + _emptyShip.postInit(); + _emptyShip.setVisage(2331); + _emptyShip.setObjectWrapper(new SceneObjectWrapper()); + _emptyShip._strip = 4; + _emptyShip._moveDiff = Common::Point(20, 20); + _emptyShip.setPosition(Common::Point(251, 207)); + _emptyShip.changeZoom(-1); + g_globals->_sceneItems.push_back(&_emptyShip); + } + + _guard.postInit(); + _guard.setVisage(90); + _guard.animate(ANIM_MODE_1, NULL); + _guard.setPosition(Common::Point(315, 185)); + _guard._strip = 2; + g_globals->_sceneItems.push_back(&_guard); + + _headGate.postInit(); + _headGate.setVisage(90); + _headGate.animate(ANIM_MODE_1, NULL); + _headGate.setPosition(Common::Point(196, 181)); + _headGate.fixPriority(175); + g_globals->_sceneItems.push_back(&_headGate); g_globals->_player.disableControl(); g_globals->_soundHandler.play(55); @@ -2679,11 +2693,11 @@ void Scene90::postInit(SceneObjectList *OwnerList) { setAction(&_action1); - _item3.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); - _item1.setBounds(Rect(271, 65, 271, 186)); - _item2.setBounds(Rect(0, 17, 124, 77)); + _background.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); + _guardShack.setBounds(Rect(271, 65, 271, 186)); + _shed.setBounds(Rect(0, 17, 124, 77)); - g_globals->_sceneItems.addItems(&_item1, &_item2, &_item3, NULL); + g_globals->_sceneItems.addItems(&_guardShack, &_shed, &_background, NULL); } void Scene90::signal() { @@ -2700,7 +2714,7 @@ void Scene90::signal() { g_globals->_player.enableControl(); break; case 97: - _stripManager._field2E8 = 0; + _stripManager._currObj44Id = 0; _action1.setActionIndex(5); _action1.setDelay(1); break; @@ -2925,7 +2939,7 @@ void Scene6100::Action3::signal() { case 4: g_globals->setFlag(76); g_globals->_sceneManager.changeScene( - (scene->_stripManager._field2E8 == 135) ? 6100 : 2320); + (scene->_stripManager._currObj44Id == 135) ? 6100 : 2320); remove(); break; } diff --git a/engines/tsage/ringworld/ringworld_scenes1.h b/engines/tsage/ringworld/ringworld_scenes1.h index bb98c89a8c..9f6de58e30 100644 --- a/engines/tsage/ringworld/ringworld_scenes1.h +++ b/engines/tsage/ringworld/ringworld_scenes1.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -54,8 +54,12 @@ public: Speaker _speakerQText; Action1 _action1; Action2 _action2; - SceneObject _object1, _object2, _object3; - SceneObject _object4, _object5, _object6; + SceneObject _veeshkaBody; + SceneObject _veeshkaHead; + SceneObject _veeshkaRightArm; + SceneObject _centurion; + SceneObject _leftSmoke; + SceneObject _rightSmoke; virtual void stripCallback(int v); virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -70,7 +74,7 @@ class Scene15 : public Scene { }; public: Action1 _action1; - SceneObject _object1; + SceneObject _ship; ASound _soundHandler; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -102,7 +106,10 @@ public: Action2 _action2; Action3 _action3; Action4 _action4; - SceneObject _sceneObject1, _SceneObjectExt, _sceneObject3, _sceneObject4, _sceneObject5; + SceneObject _assassinShip1; + SceneObject _assassinShip2; + SceneObject _laserShot1; + SceneObject _laserShot2; ASound _sound; public: Scene20(); @@ -248,15 +255,21 @@ public: Action6 _action6; Action7 _action7; Action8 _action8; - SceneObject _object1, _object2, _object3; + SceneObject _seeker; + SceneObject _seekerTail; + SceneObject _seekerHand; DyingKzin _dyingKzin; Assassin _assassin; - SceneObject _doorway, _object7, _object8; - DisplayHotspot _item1; - Item2 _item2; - DisplayHotspot _item3, _item4, _item5; - Item6 _item6; - DisplayHotspot _item7, _item8; + SceneObject _doorway; + SceneObject _leftEntrance; + DisplayHotspot _ball; + Item2 _statue; + DisplayHotspot _window; + DisplayHotspot _entrance; + DisplayHotspot _background; + Item6 _pedestal; + DisplayHotspot _emerald; + DisplayHotspot _tree; Scene40(); virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -284,15 +297,15 @@ class Scene50 : public Scene { public: virtual void doAction(int action); }; - class Object2 : public SceneObject { + class LeftFlyCycle : public SceneObject { public: virtual void doAction(int action); }; - class Object3 : public SceneObject { + class CenterFlyCycle : public SceneObject { public: virtual void doAction(int action); }; - class Object4 : public SceneObject { + class RightFlyCycle : public SceneObject { public: virtual void doAction(int action); }; @@ -302,15 +315,18 @@ public: Action1 _action1; Action2 _action2; Action3 _action3; - Object1 _object1; - Object2 _object2; - Object3 _object3; - Object4 _object4; + LeftFlyCycle _leftFlyCycle; + CenterFlyCycle _centerFlyCycle; + RightFlyCycle _rightFlyCycle; Rect _doorwayRect; SpeakerSText _speakerSText; SpeakerQText _speakerQText; - DisplayHotspot _item0, _item1, _item2; - DisplayHotspot _item3, _item4, _item5; + DisplayHotspot _background; + DisplayHotspot _item1; + DisplayHotspot _entrance; + DisplayHotspot _bulwark; + DisplayHotspot _tree; + DisplayHotspot _flagstones; Scene50(); virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -392,8 +408,12 @@ public: MasterObject _masterButton; FloppyDrive _floppyDrive; SceneObject _redLights; - Item1 _item1; - Item _item2, _item3, _item4, _item5, _item6; + Item1 _diskDrive; + Item _dashboard; + Item _intercomm; + Item _viewScreen; + Item _speedControl; + Item _speaker; ASound _soundHandler1; ASound _soundHandler2; ASound _soundHandler3; @@ -409,11 +429,11 @@ class Scene90 : public Scene { public: virtual void signal(); }; - class Object1 : public SceneObject { + class SeekerShip : public SceneObject { public: virtual void doAction(int action); }; - class Object2 : public SceneObject { + class Guard : public SceneObject { public: virtual void doAction(int action); }; @@ -425,11 +445,15 @@ public: SpeakerSR _speakerSR; SpeakerMText _speakerMText; Action1 _action1; - Object1 _object1; - Object2 _object2; - DisplayObject _object3, _object4, _object5; - SceneObject _object6; - DisplayHotspot _item1, _item2, _item3; + SeekerShip _seekerShip; + Guard _guard; + DisplayObject _headGate; + DisplayObject _emptyShip; + DisplayObject _quinnShip; + SceneObject _bubble; + DisplayHotspot _guardShack; + DisplayHotspot _shed; + DisplayHotspot _background; ASound _soundHandler1, _soundHandler2; Scene90(); diff --git a/engines/tsage/ringworld/ringworld_scenes10.cpp b/engines/tsage/ringworld/ringworld_scenes10.cpp index f9a8e7996a..c4874c0f59 100644 --- a/engines/tsage/ringworld/ringworld_scenes10.cpp +++ b/engines/tsage/ringworld/ringworld_scenes10.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -1217,7 +1217,7 @@ void Scene9500::postInit(SceneObjectList *OwnerList) { g_globals->_events.setCursor(CURSOR_WALK); g_globals->_player.disableControl(); - if ((g_globals->_sceneManager._previousScene == 9200) || (g_globals->_sceneManager._previousScene != 9850)) { + if (g_globals->_sceneManager._previousScene != 9850) { _sceneMode = 0; if (RING_INVENTORY._helmet._sceneNumber != 1) { setAction(&_sequenceManager, this, 9501, &g_globals->_player, &_candle, NULL); @@ -1870,7 +1870,7 @@ void Scene9900::signal() { setAction(&_sequenceManager, this, 9908, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6); break; case 162: - warning("TBC: shutdown();"); + // shutdown(); g_globals->_game->quitGame(); break; case 9901: diff --git a/engines/tsage/ringworld/ringworld_scenes10.h b/engines/tsage/ringworld/ringworld_scenes10.h index 48859ab454..ff1a6e9070 100644 --- a/engines/tsage/ringworld/ringworld_scenes10.h +++ b/engines/tsage/ringworld/ringworld_scenes10.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/tsage/ringworld/ringworld_scenes2.cpp b/engines/tsage/ringworld/ringworld_scenes2.cpp index e07c9253e6..1140f6f3d1 100644 --- a/engines/tsage/ringworld/ringworld_scenes2.cpp +++ b/engines/tsage/ringworld/ringworld_scenes2.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/tsage/ringworld/ringworld_scenes2.h b/engines/tsage/ringworld/ringworld_scenes2.h index 382d9d4157..825cd04c17 100644 --- a/engines/tsage/ringworld/ringworld_scenes2.h +++ b/engines/tsage/ringworld/ringworld_scenes2.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/tsage/ringworld/ringworld_scenes3.cpp b/engines/tsage/ringworld/ringworld_scenes3.cpp index b2ed986331..d8556c691e 100644 --- a/engines/tsage/ringworld/ringworld_scenes3.cpp +++ b/engines/tsage/ringworld/ringworld_scenes3.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -799,7 +799,7 @@ void Scene2100::Action9::signal() { scene->_stripManager.start(6010, this); break; case 6: - if (scene->_stripManager._field2E8 != 165) + if (scene->_stripManager._currObj44Id != 165) setAction(&scene->_action10); else setAction(&scene->_action11); @@ -1010,7 +1010,7 @@ void Scene2100::Action12::signal() { scene->_stripManager.start(6052, this); break; case 8: - if (scene->_stripManager._field2E8 == 320) + if (scene->_stripManager._currObj44Id == 320) g_globals->setFlag(74); setDelay(30); break; @@ -2352,11 +2352,11 @@ void Scene2150::Action2::signal() { scene->_hotspot14.setStrip(6); scene->_hotspot14.setPosition(Common::Point(59, 54)); - if (scene->_stripManager._field2E8 == 15) { + if (scene->_stripManager._currObj44Id == 15) { scene->_hotspot14.setFrame(5); RING_INVENTORY._ale._sceneNumber = 1; } else { - scene->_hotspot14.setFrame(scene->_stripManager._field2E8 - 5); + scene->_hotspot14.setFrame(scene->_stripManager._currObj44Id - 5); } g_globals->_player.setFrame(1); @@ -3160,7 +3160,7 @@ void Scene2230::Action1::signal() { switch (_actionIndex++) { case 0: - switch (scene->_field30A) { + switch (scene->_sceneMode) { case 1: scene->setAction(&scene->_action3); break; @@ -3201,7 +3201,7 @@ void Scene2230::Action2::signal() { switch (_actionIndex++) { case 0: - switch (scene->_field30A) { + switch (scene->_sceneMode) { case 2: scene->setAction(&scene->_action6, this); break; @@ -3212,7 +3212,7 @@ void Scene2230::Action2::signal() { break; case 1: { g_globals->_player.disableControl(); - scene->_field30A = 1; + scene->_sceneMode = 1; g_globals->_player._regionBitList |= ~0x80; Common::Point pt(160, 96); NpcMover *mover = new NpcMover(); @@ -3262,7 +3262,7 @@ void Scene2230::Action3::signal() { break; case 2: g_globals->_player._regionBitList |= 0x80; - scene->_field30A = 0; + scene->_sceneMode = 0; g_globals->_player.setVisage(0); g_globals->_player.setStrip2(-1); @@ -3292,7 +3292,7 @@ void Scene2230::Action5::signal() { switch (_actionIndex++) { case 0: - switch (scene->_field30A) { + switch (scene->_sceneMode) { case 2: scene->setAction(&scene->_action3, this); break; @@ -3318,7 +3318,7 @@ void Scene2230::Action5::signal() { case 3: g_globals->_events.setCursor(CURSOR_USE); g_globals->_player._uiEnabled = true; - scene->_field30A = 2; + scene->_sceneMode = 2; remove(); break; } @@ -3335,7 +3335,7 @@ void Scene2230::Action6::signal() { g_globals->_player.animate(ANIM_MODE_5, this); break; case 1: - scene->_field30A = 0; + scene->_sceneMode = 0; g_globals->_player.setVisage(0); g_globals->_player._strip = 1; g_globals->_player._canWalk = true; @@ -3352,7 +3352,7 @@ void Scene2230::Action7::signal() { case 0: g_globals->_player.disableControl(); - switch (scene->_field30A) { + switch (scene->_sceneMode) { case 1: scene->setAction(&scene->_action3, this); break; @@ -3408,7 +3408,7 @@ void Scene2230::Action8::signal() { case 0: g_globals->_player.disableControl(); - switch (scene->_field30A) { + switch (scene->_sceneMode) { case 1: scene->setAction(&scene->_action3, this); break; @@ -3431,7 +3431,7 @@ void Scene2230::Action8::signal() { g_globals->_sceneItems.remove(&scene->_hotspot11); g_globals->_sceneItems.remove(&scene->_hotspot12); - switch (scene->_field30A) { + switch (scene->_sceneMode) { case 1: scene->setAction(&scene->_action3, this); break; @@ -3560,7 +3560,7 @@ void Scene2230::Hotspot6::doAction(int action) { } break; case CURSOR_USE: - if (scene->_field30A == 1) + if (scene->_sceneMode == 1) scene->setAction(&scene->_action3); else if (g_globals->getFlag(13)) SceneItem::display2(2230, 28); @@ -3586,7 +3586,7 @@ void Scene2230::Hotspot7::doAction(int action) { } break; case CURSOR_USE: - if (scene->_field30A == 2) + if (scene->_sceneMode == 2) scene->setAction(&scene->_action6); else if (g_globals->getFlag(13)) SceneItem::display2(2230, 29); @@ -3692,7 +3692,7 @@ void Scene2230::Hotspot12::doAction(int action) { /*--------------------------------------------------------------------------*/ Scene2230::Scene2230() : _hotspot9(0, CURSOR_LOOK, 2230, 16, CURSOR_USE, 2230, 18, LIST_END) { - _field30A = 0; + _sceneMode = 0; } void Scene2230::postInit(SceneObjectList *OwnerList) { @@ -3726,7 +3726,7 @@ void Scene2230::postInit(SceneObjectList *OwnerList) { g_globals->_player._regionBitList |= 0x80; g_globals->_player.changeZoom(-1); - _field30A = 0; + _sceneMode = 0; g_globals->_player.enableControl(); _hotspot5.setBounds(Rect(108, 34, 142, 76)); @@ -3748,7 +3748,7 @@ void Scene2230::postInit(SceneObjectList *OwnerList) { void Scene2230::synchronize(Serializer &s) { Scene::synchronize(s); _rect1.synchronize(s); - s.syncAsSint16LE(_field30A); + s.syncAsSint16LE(_sceneMode); } void Scene2230::dispatch() { @@ -4946,8 +4946,6 @@ void Scene2310::synchronize(Serializer &s) { } void Scene2310::process(Event &event) { - int frameNum = 0; - if (!event.handled && (event.eventType == EVENT_BUTTON_DOWN)) { int idx = 0; while (idx < 5) { @@ -4961,7 +4959,7 @@ void Scene2310::process(Event &event) { if (_wireIndex == 5) { // No wire is currently active, so start moving designated wire _wireIndex = idx; - frameNum = idx + 2; + int frameNum = idx + 2; if (event.mousePos.y > 105) idx = findObject(idx); diff --git a/engines/tsage/ringworld/ringworld_scenes3.h b/engines/tsage/ringworld/ringworld_scenes3.h index 682ef44fc6..a371f800b9 100644 --- a/engines/tsage/ringworld/ringworld_scenes3.h +++ b/engines/tsage/ringworld/ringworld_scenes3.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -579,7 +579,7 @@ public: Hotspot11 _hotspot11; Hotspot12 _hotspot12; Rect _rect1; - int _field30A; + int _sceneMode; Scene2230(); virtual void postInit(SceneObjectList *OwnerList = NULL); diff --git a/engines/tsage/ringworld/ringworld_scenes4.cpp b/engines/tsage/ringworld/ringworld_scenes4.cpp index 98bf0158e7..4d40b34eea 100644 --- a/engines/tsage/ringworld/ringworld_scenes4.cpp +++ b/engines/tsage/ringworld/ringworld_scenes4.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/tsage/ringworld/ringworld_scenes4.h b/engines/tsage/ringworld/ringworld_scenes4.h index 64706805bc..72913ea8f2 100644 --- a/engines/tsage/ringworld/ringworld_scenes4.h +++ b/engines/tsage/ringworld/ringworld_scenes4.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/tsage/ringworld/ringworld_scenes5.cpp b/engines/tsage/ringworld/ringworld_scenes5.cpp index 004ccbbb6d..cb8a89de80 100644 --- a/engines/tsage/ringworld/ringworld_scenes5.cpp +++ b/engines/tsage/ringworld/ringworld_scenes5.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -34,6 +34,9 @@ namespace Ringworld { * Scene 4000 - Village * *--------------------------------------------------------------------------*/ +Scene4000::Hotspot8::Hotspot8() : SceneObject() { + _ctr = 0; +} void Scene4000::Action1::signal() { // Quinn has the peg. Everybody enter the screen. @@ -459,7 +462,7 @@ void Scene4000::Action12::signal() { break; case 2: g_globals->setFlag(32); - if (scene->_stripManager._field2E8 == 275) { + if (scene->_stripManager._currObj44Id == 275) { g_globals->setFlag(82); ADD_MOVER_NULL(scene->_guardRock, 292, 138); ADD_PLAYER_MOVER(283, 147); @@ -468,7 +471,7 @@ void Scene4000::Action12::signal() { } break; case 3: - if (scene->_stripManager._field2E8 == 275) { + if (scene->_stripManager._currObj44Id == 275) { g_globals->_sceneManager.changeScene(4100); } else { ADD_PLAYER_MOVER_THIS(scene->_guardRock, 300, 132); @@ -4219,7 +4222,12 @@ void Scene4300::process(Event &event) { void Scene4301::Action1::synchronize(Serializer &s) { Action::synchronize(s); - s.syncAsSint16LE(_field34E); + + if (s.getVersion() < 14) { + int useless = 0; + s.syncAsSint16LE(useless); + } + for (int idx = 0; idx < 6; ++idx) s.syncAsSint16LE(_indexList[idx]); } @@ -4265,7 +4273,6 @@ void Scene4301::Action1::signal() { scene->_hotspot3.fixPriority(255); scene->_hotspot3.hide(); - _field34E = 0; _state = 0; _actionIndex = 2; break; diff --git a/engines/tsage/ringworld/ringworld_scenes5.h b/engines/tsage/ringworld/ringworld_scenes5.h index c93df2a1d8..3010c7b401 100644 --- a/engines/tsage/ringworld/ringworld_scenes5.h +++ b/engines/tsage/ringworld/ringworld_scenes5.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -99,6 +99,7 @@ class Scene4000 : public Scene { private: int _ctr; public: + Hotspot8(); virtual void synchronize(Serializer &s) { SceneObject::synchronize(s); s.syncAsUint16LE(_ctr); @@ -655,7 +656,6 @@ class Scene4301 : public Scene { class Action1 : public ActionExt { public: SceneObject _buttonList[6]; - int _field34E; int _indexList[6]; virtual void synchronize(Serializer &s); diff --git a/engines/tsage/ringworld/ringworld_scenes6.cpp b/engines/tsage/ringworld/ringworld_scenes6.cpp index 30a91b57aa..74f834c64f 100644 --- a/engines/tsage/ringworld/ringworld_scenes6.cpp +++ b/engines/tsage/ringworld/ringworld_scenes6.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -1608,8 +1608,6 @@ Scene5200::Scene5200() : void Scene5200::postInit(SceneObjectList *OwnerList) { Scene::postInit(); setZoomPercents(0, 150, 199, 150); - _fieldA = 5600; - _fieldE = 5100; _hotspot9._state = 0; _hotspot10._state = 0; @@ -2032,7 +2030,15 @@ void Scene5300::Hotspot8::doAction(int action) { /*--------------------------------------------------------------------------*/ Scene5300::Scene5300() : - _hotspot3(0, CURSOR_LOOK, 5300, 3, CURSOR_USE, 5300, 16, LIST_END) { + _hotspot3(0, CURSOR_LOOK, 5300, 3, CURSOR_USE, 5300, 16, LIST_END) { +} + +void Scene5300::synchronize(Serializer &s) { + Scene::synchronize(s); + if (s.getVersion() < 11) { + int useless = 0; + s.syncAsSint16LE(useless); + } } void Scene5300::postInit(SceneObjectList *OwnerList) { @@ -2119,7 +2125,6 @@ void Scene5300::postInit(SceneObjectList *OwnerList) { setAction(&_sequenceManager, this, 5306, &g_globals->_player, &_hotspot3, NULL); } - _field1B0A = 1; if (RING_INVENTORY._bone._sceneNumber == 5300) { _hotspot5.postInit(); _hotspot5.setVisage(5301); diff --git a/engines/tsage/ringworld/ringworld_scenes6.h b/engines/tsage/ringworld/ringworld_scenes6.h index bf353de415..fcc7f900ce 100644 --- a/engines/tsage/ringworld/ringworld_scenes6.h +++ b/engines/tsage/ringworld/ringworld_scenes6.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -318,15 +318,11 @@ public: Hotspot6 _hotspot6; Hotspot7 _hotspot7; Hotspot8 _hotspot8; - int _field1B0A; Scene5300(); virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void signal(); - virtual void synchronize(Serializer &s) { - Scene::synchronize(s); - s.syncAsSint16LE(_field1B0A); - } + virtual void synchronize(Serializer &s); }; } // End of namespace Ringworld diff --git a/engines/tsage/ringworld/ringworld_scenes8.cpp b/engines/tsage/ringworld/ringworld_scenes8.cpp index 9cb85a6930..60bd72e1ef 100644 --- a/engines/tsage/ringworld/ringworld_scenes8.cpp +++ b/engines/tsage/ringworld/ringworld_scenes8.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -30,6 +30,10 @@ namespace TsAGE { namespace Ringworld { +NamedHotspotMult::NamedHotspotMult() : SceneHotspot() { + _useLineNum = _lookLineNum = 0; +} + void NamedHotspotMult::synchronize(Serializer &s) { SceneHotspot::synchronize(s); s.syncAsSint16LE(_useLineNum); @@ -2533,6 +2537,10 @@ Scene7700::Scene7700() { _object5._state = 0; _object6._state = 0; _prof._state = 0; + + _seatCountLeft1 = 0; + _seatCountLeft2 = 0; + _seatCountRight = 0; } void Scene7700::synchronize(Serializer &s) { diff --git a/engines/tsage/ringworld/ringworld_scenes8.h b/engines/tsage/ringworld/ringworld_scenes8.h index b24f220f8c..ad5a91514e 100644 --- a/engines/tsage/ringworld/ringworld_scenes8.h +++ b/engines/tsage/ringworld/ringworld_scenes8.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -40,7 +40,7 @@ using namespace TsAGE; class NamedHotspotMult : public SceneHotspot { public: int _useLineNum, _lookLineNum; - NamedHotspotMult() : SceneHotspot() {} + NamedHotspotMult(); virtual Common::String getClassName() { return "NamedHotspotMult"; } virtual void synchronize(Serializer &s); diff --git a/engines/tsage/ringworld/ringworld_speakers.cpp b/engines/tsage/ringworld/ringworld_speakers.cpp index dc80df40a3..a4ce95928c 100644 --- a/engines/tsage/ringworld/ringworld_speakers.cpp +++ b/engines/tsage/ringworld/ringworld_speakers.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/tsage/ringworld/ringworld_speakers.h b/engines/tsage/ringworld/ringworld_speakers.h index 305984a184..59e25dc166 100644 --- a/engines/tsage/ringworld/ringworld_speakers.h +++ b/engines/tsage/ringworld/ringworld_speakers.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/tsage/ringworld2/ringworld2_dialogs.cpp b/engines/tsage/ringworld2/ringworld2_dialogs.cpp index 4ebbdd602d..99f88a1687 100644 --- a/engines/tsage/ringworld2/ringworld2_dialogs.cpp +++ b/engines/tsage/ringworld2/ringworld2_dialogs.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -50,6 +50,7 @@ RightClickDialog::RightClickDialog() : GfxDialog() { _btnList[5] = Common::Point(83, 47); // Set the palette and change the cursor + _previousCursor = R2_GLOBALS._events.getCursor(); R2_GLOBALS._events.setCursor(CURSOR_ARROW); setPalette(); @@ -136,7 +137,7 @@ bool RightClickDialog::process(Event &event) { return false; } -void RightClickDialog::execute() { +int RightClickDialog::execute() { // Draw the dialog draw(); @@ -157,7 +158,8 @@ void RightClickDialog::execute() { } // Execute the specified action - CursorType cursorNum = CURSOR_NONE; + CursorType cursorNum = _previousCursor; + int result = -1; switch (_selectedAction) { case 0: // Look action @@ -177,36 +179,42 @@ void RightClickDialog::execute() { break; case 4: // Change player - CharacterDialog::show(); + result = 0; break; case 5: // Options dialog + result = 1; break; } - if (cursorNum != CURSOR_NONE) - R2_GLOBALS._events.setCursor(cursorNum); - + R2_GLOBALS._events.setCursor(cursorNum); _gfxManager.deactivate(); + + return result; } /*--------------------------------------------------------------------------*/ void CharacterDialog::show() { CharacterDialog *dlg = new CharacterDialog(); + CursorType cursorNum = R2_GLOBALS._events.getCursor(); + + // Reset the current cursor + R2_GLOBALS._events.setCursor(CURSOR_ARROW); + dlg->draw(); // Make the default button the currently active character GfxButton *btn = NULL; int oldCharacter = R2_GLOBALS._player._characterIndex; switch (oldCharacter) { - case 1: + case R2_QUINN: btn = &dlg->_btnQuinn; break; - case 2: + case R2_SEEKER: btn = &dlg->_btnSeeker; break; - case 3: + case R2_MIRANDA: btn = &dlg->_btnMiranda; break; default: @@ -234,7 +242,7 @@ void CharacterDialog::show() { SceneExt *scene = (SceneExt *)R2_GLOBALS._sceneManager._scene; scene->saveCharacter(oldCharacter); - // Play the correctfrequency, if any, of the character being switched to's scanner device + // Play the correctfrequency, if any, of the character being switched to's scanner device if (R2_GLOBALS._player._characterScene[R2_NONE] != 300) { switch (R2_GLOBALS._scannerFrequencies[R2_GLOBALS._player._characterIndex] - 1) { case 0: @@ -314,7 +322,13 @@ void CharacterDialog::show() { // Change to whichever scene the newly selected character is in R2_GLOBALS._sceneManager.changeScene(R2_GLOBALS._player._characterScene[R2_GLOBALS._player._characterIndex]); - } + + // Force the reset the current cursor + R2_GLOBALS._events.setCursor(CURSOR_USE); + + } else + // Restore previous cursor + R2_GLOBALS._events.setCursor(cursorNum); } CharacterDialog::CharacterDialog() { @@ -344,14 +358,14 @@ CharacterDialog::CharacterDialog() { /*--------------------------------------------------------------------------*/ void HelpDialog::show() { - // Set the palette and change the cursor + // change the cursor R2_GLOBALS._events.setCursor(CURSOR_ARROW); // Create the dialog and draw it HelpDialog *dlg = new HelpDialog(); dlg->draw(); - // Show the character selection dialog + // Show the help dialog GfxButton *btn = dlg->execute(&dlg->_btnResume); // If a function button was selected, take care of it @@ -381,6 +395,8 @@ void HelpDialog::show() { // If a action button was selected, dispatch to handle it if (evt.kbd.keycode != Common::KEYCODE_INVALID) R2_GLOBALS._game->processEvent(evt); + else + R2_GLOBALS._events.setCursorFromFlag(); } HelpDialog::HelpDialog() { @@ -442,6 +458,36 @@ HelpDialog::HelpDialog() { setCenter(160, 100); } +bool HelpDialog::handleKeypress(Event &event, GfxButton *&btn) { + switch (event.kbd.keycode) { + case Common::KEYCODE_F2: + btn = &_btnList[0]; + break; + case Common::KEYCODE_F3: + btn = &_btnList[1]; + break; + case Common::KEYCODE_F4: + btn = &_btnList[2]; + break; + case Common::KEYCODE_F5: + btn = &_btnList[3]; + break; + case Common::KEYCODE_F7: + btn = &_btnList[4]; + break; + case Common::KEYCODE_F8: + btn = &_btnList[5]; + break; + case Common::KEYCODE_F10: + btn = &_btnList[6]; + break; + default: + return false; + } + + return true; +} + } // End of namespace Ringworld2 } // End of namespace TsAGE diff --git a/engines/tsage/ringworld2/ringworld2_dialogs.h b/engines/tsage/ringworld2/ringworld2_dialogs.h index 02a1aed81c..3d1e1ad48c 100644 --- a/engines/tsage/ringworld2/ringworld2_dialogs.h +++ b/engines/tsage/ringworld2/ringworld2_dialogs.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -50,13 +50,14 @@ private: int _highlightedAction; int _selectedAction; + CursorType _previousCursor; public: RightClickDialog(); ~RightClickDialog(); virtual void draw(); virtual bool process(Event &event); - void execute(); + int execute(); }; class CharacterDialog: public GfxDialog { @@ -82,6 +83,8 @@ public: virtual ~HelpDialog() {} static void show(); + + virtual bool handleKeypress(Event &event, GfxButton *&btn); }; } // End of namespace Ringworld2 diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 90df72ab32..99188c1ab6 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -65,8 +65,12 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { // Deck #2 - By Lift return new Scene200(); case 205: - // Star-field Credits - return new Scene205(); + if (g_vm->getFeatures() & GF_DEMO) + // End of Demo + return new Scene205Demo(); + else + // Star-field Credits + return new Scene205(); case 250: // Lift return new Scene250(); @@ -131,12 +135,13 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { // Cutscene - Ship return new Scene1525(); case 1530: - // Cutscene - Elevator + // Cutscene - Crashing on Rimwall return new Scene1530(); case 1550: // Spaceport return new Scene1550(); case 1575: + // Spaceport - unused ship scene return new Scene1575(); case 1580: // Inside wreck @@ -179,7 +184,7 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { // Spill Mountains: Balloon Launch Platform return new Scene2350(); case 2400: - // Spill Mountains: Large empty room + // Spill Mountains: Unused large empty room return new Scene2400(); case 2425: // Spill Mountains: The Hall of Records @@ -203,7 +208,7 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { // Spill Mountains: Inside crevasse return new Scene2455(); case 2500: - // Spill Mountains: Large Cave + // Spill Mountains: Large Ledge return new Scene2500(); case 2525: // Spill Mountains: Furnace room @@ -289,7 +294,7 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { // Confrontation return new Scene3400(); case 3500: - // Maze action sequencec + // Flub tube maze return new Scene3500(); case 3600: // Cutscene - walking at gunpoint @@ -335,13 +340,16 @@ SceneExt::SceneExt(): Scene() { _stripManager._onEnd = SceneExt::endStrip; for (int i = 0; i < 256; i++) - _field312[i] = 0; + _shadowPaletteMap[i] = 0; _savedPlayerEnabled = false; _savedUiEnabled = false; _savedCanWalk = false; _preventSaving = false; + // Reset screen clipping area + R2_GLOBALS._screenSurface._clipRect = Rect(); + // WORKAROUND: In the original, playing animations don't reset the global _animationCtr // counter as scene changes unless the playing animation explicitly finishes. For now, // to make inter-scene debugging easier, I'm explicitly resetting the _animationCtr @@ -352,7 +360,7 @@ SceneExt::SceneExt(): Scene() { void SceneExt::synchronize(Serializer &s) { Scene::synchronize(s); - s.syncBytes(&_field312[0], 256); + s.syncBytes(&_shadowPaletteMap[0], 256); _sceneAreas.synchronize(s); } @@ -364,15 +372,24 @@ void SceneExt::postInit(SceneObjectList *OwnerList) { // Initialize fields _action = NULL; - _field12 = 0; _sceneMode = 0; + static_cast<SceneHandlerExt *>(R2_GLOBALS._sceneHandler)->setupPaletteMaps(); + int prevScene = R2_GLOBALS._sceneManager._previousScene; int sceneNumber = R2_GLOBALS._sceneManager._sceneNumber; - if (((prevScene == -1) && (sceneNumber != 180) && (sceneNumber != 205) && (sceneNumber != 50)) + if (g_vm->getFeatures() & GF_DEMO) { + if (((prevScene == -1) && (sceneNumber != 180) && (sceneNumber != 205) && (sceneNumber != 50)) + || (prevScene == 0) || (sceneNumber == 600) + || ((prevScene == 205 || prevScene == 180) && (sceneNumber == 100))) { + R2_GLOBALS._uiElements._active = true; + R2_GLOBALS._uiElements.show(); + } else { + R2_GLOBALS._uiElements.updateInventory(); + } + } else if (((prevScene == -1) && (sceneNumber != 180) && (sceneNumber != 205) && (sceneNumber != 50)) || (sceneNumber == 50) || ((sceneNumber == 100) && (prevScene == 0 || prevScene == 180 || prevScene == 205))) { - static_cast<SceneHandlerExt *>(R2_GLOBALS._sceneHandler)->setupPaletteMaps(); R2_GLOBALS._uiElements._active = true; R2_GLOBALS._uiElements.show(); } else { @@ -385,7 +402,7 @@ void SceneExt::remove() { Scene::remove(); R2_GLOBALS._uiElements._active = true; - if (R2_GLOBALS._events.getCursor() >= EXITCURSOR_N && + if (R2_GLOBALS._events.getCursor() >= EXITCURSOR_N && R2_GLOBALS._events.getCursor() <= SHADECURSOR_DOWN) R2_GLOBALS._events.setCursor(CURSOR_WALK); } @@ -396,19 +413,6 @@ void SceneExt::process(Event &event) { } void SceneExt::dispatch() { -/* - _timerList.dispatch(); - - if (_field37A) { - if ((--_field37A == 0) && R2_GLOBALS._dayNumber) { - if (R2_GLOBALS._uiElements._active && R2_GLOBALS._player._enabled) { - R2_GLOBALS._uiElements.show(); - } - - _field37A = 0; - } - } -*/ Scene::dispatch(); } @@ -433,9 +437,9 @@ bool SceneExt::display(CursorType action, Event &event) { SceneItem::display2(5, 0); break; case R2_SONIC_STUNNER: - if ((R2_GLOBALS._scannerFrequencies[R2_QUINN] == 2) + if ((R2_GLOBALS._scannerFrequencies[R2_QUINN] == 2) || ((R2_GLOBALS._scannerFrequencies[R2_QUINN] == 1) && - (R2_GLOBALS._scannerFrequencies[R2_SEEKER] == 2) && + (R2_GLOBALS._scannerFrequencies[R2_SEEKER] == 2) && (R2_GLOBALS._sceneManager._previousScene == 300))) { R2_GLOBALS._sound4.stop(); R2_GLOBALS._sound3.play(46); @@ -557,14 +561,14 @@ void SceneExt::saveCharacter(int characterIndex) { void SceneExt::scalePalette(int RFactor, int GFactor, int BFactor) { byte *tmpPal = R2_GLOBALS._scenePalette._palette; byte newR, newG, newB; - int tmp, varC, varD = 0; + int tmp, varD = 0; for (int i = 0; i < 256; i++) { newR = (RFactor * tmpPal[(3 * i)]) / 100; newG = (GFactor * tmpPal[(3 * i) + 1]) / 100; newB = (BFactor * tmpPal[(3 * i) + 2]) / 100; - varC = 769; + int varC = 769; for (int j = 255; j >= 0; j--) { tmp = abs(tmpPal[(3 * j)] - newR); if (tmp >= varC) @@ -581,7 +585,7 @@ void SceneExt::scalePalette(int RFactor, int GFactor, int BFactor) { varC = tmp; varD = j; } - this->_field312[i] = varD; + this->_shadowPaletteMap[i] = varD; } } @@ -621,10 +625,14 @@ void SceneHandlerExt::process(Event &event) { SceneHandler::process(event); } +void SceneHandlerExt::dispatch() { + R2_GLOBALS._playStream.dispatch(); + SceneHandler::dispatch(); +} + void SceneHandlerExt::postLoad(int priorSceneBeforeLoad, int currentSceneBeforeLoad) { - if (priorSceneBeforeLoad == -1 || priorSceneBeforeLoad == 50 - || currentSceneBeforeLoad == 180 || priorSceneBeforeLoad == 205) - setupPaletteMaps(); + // Set up the shading maps used for showing the player in shadows + setupPaletteMaps(); if (currentSceneBeforeLoad == 2900) { R2_GLOBALS._gfxFontNumber = 50; @@ -806,7 +814,7 @@ Ringworld2InvObjectList::Ringworld2InvObjectList(): _chargedPowerCapsule(1, 12), _aerosol(1, 13), _remoteControl(1, 14), - _opticalFibre(1, 15), + _opticalFiber(1, 15), _clamp(1, 16), _attractorHarness(1, 17), _fuelCell(2, 2), @@ -861,7 +869,7 @@ Ringworld2InvObjectList::Ringworld2InvObjectList(): _itemList.push_back(&_chargedPowerCapsule); _itemList.push_back(&_aerosol); _itemList.push_back(&_remoteControl); - _itemList.push_back(&_opticalFibre); + _itemList.push_back(&_opticalFiber); _itemList.push_back(&_clamp); _itemList.push_back(&_attractorHarness); _itemList.push_back(&_fuelCell); @@ -925,7 +933,7 @@ void Ringworld2InvObjectList::reset() { setObjectScene(R2_CHARGED_POWER_CAPSULE, 400); setObjectScene(R2_AEROSOL, 500); setObjectScene(R2_REMOTE_CONTROL, 1550); - setObjectScene(R2_OPTICAL_FIBRE, 850); + setObjectScene(R2_OPTICAL_FIBER, 850); setObjectScene(R2_CLAMP, 850); setObjectScene(R2_ATTRACTOR_CABLE_HARNESS, 0); setObjectScene(R2_FUEL_CELL, 1550); @@ -1096,7 +1104,7 @@ void Ringworld2InvObjectList::selectDefault(int objectNumber) { Common::String line = Common::String::format("%.5s%.5s%.5s%.5s%s %s %s %s.", msg1.c_str(), msg2.c_str(), msg3.c_str(), msg4.c_str(), msg1.c_str() + 5, msg2.c_str() + 5, msg3.c_str() + 5, msg4.c_str() + 5); - + SceneItem::display(-1, -1, line.c_str(), SET_WIDTH, 280, SET_X, 160, @@ -1125,7 +1133,6 @@ void Ringworld2Game::start() { R2_GLOBALS._sceneHandler->_loadGameSlot = slot; else { // Switch to the first title screen - R2_GLOBALS._events.setCursor(CURSOR_WALK); R2_GLOBALS._uiElements._active = true; R2_GLOBALS._sceneManager.setNewScene(180); } @@ -1205,25 +1212,25 @@ void Ringworld2Game::processEvent(Event &event) { case Common::KEYCODE_F4: // F4 - Restart restartGame(); - g_globals->_events.setCursorFromFlag(); + R2_GLOBALS._events.setCursorFromFlag(); break; case Common::KEYCODE_F7: // F7 - Restore restoreGame(); - g_globals->_events.setCursorFromFlag(); + R2_GLOBALS._events.setCursorFromFlag(); break; case Common::KEYCODE_F8: // F8 - Credits - warning("TODO: Show Credits"); + R2_GLOBALS._sceneManager.changeScene(205); break; case Common::KEYCODE_F10: // F10 - Pause GfxDialog::setPalette(); MessageDialog::show(GAME_PAUSED_MSG, OK_BTN_STRING); - g_globals->_events.setCursorFromFlag(); + R2_GLOBALS._events.setCursorFromFlag(); break; default: @@ -1234,8 +1241,13 @@ void Ringworld2Game::processEvent(Event &event) { void Ringworld2Game::rightClick() { RightClickDialog *dlg = new RightClickDialog(); - dlg->execute(); + int option = dlg->execute(); delete dlg; + + if (option == 0) + CharacterDialog::show(); + else if (option == 1) + HelpDialog::show(); } /*--------------------------------------------------------------------------*/ @@ -1282,7 +1294,7 @@ void SceneActor::postInit(SceneObjectList *OwnerList) { void SceneActor::remove() { R2_GLOBALS._sceneItems.remove(this); - _field9C = NULL; + _shadowMap = NULL; _linkedActor = NULL; SceneObject::remove(); @@ -1323,26 +1335,6 @@ bool SceneActor::startAction(CursorType action, Event &event) { GfxSurface SceneActor::getFrame() { GfxSurface frame = SceneObject::getFrame(); - // TODO: Proper effects handling - switch (_effect) { - case EFFECT_NONE: - case EFFECT_5: - // TODO: Figure out purpose of setting image flags to 64, and getting - // scene priorities -1 or _shade - break; - case EFFECT_SHADED: - // TODO: Transposing using R2_GLOBALS._pixelArrayMap - break; - case EFFECT_2: - // No effect - break; - case EFFECT_4: - break; - default: - // TODO: Default effect - break; - } - return frame; } @@ -1353,6 +1345,7 @@ SceneArea::SceneArea(): SceneItem() { _insideArea = false; _savedCursorNum = CURSOR_NONE; _cursorState = 0; + _cursorNum = CURSOR_NONE; } void SceneArea::synchronize(Serializer &s) { @@ -1405,6 +1398,8 @@ void SceneArea::setDetails(const Rect &bounds, CursorType cursor) { SceneExit::SceneExit(): SceneArea() { _moving = false; _destPos = Common::Point(-1, -1); + + _sceneNumber = 0; } void SceneExit::synchronize(Serializer &s) { @@ -1431,7 +1426,7 @@ void SceneExit::process(Event &event) { if (!R2_GLOBALS._insetUp) { SceneArea::process(event); - if (_enabled) { + if (_enabled && R2_GLOBALS._player._enabled) { if (event.eventType == EVENT_BUTTON_DOWN) { if (!_bounds.contains(mousePos)) _moving = false; @@ -1479,7 +1474,7 @@ void SceneAreaObject::process(Event &event) { _savedCursorNum = R2_GLOBALS._events.getCursor(); R2_GLOBALS._events.setCursor(CURSOR_INVALID); } - + if (event.eventType == EVENT_BUTTON_DOWN) { event.handled = true; R2_GLOBALS._events.setCursor(_savedCursorNum); @@ -1516,7 +1511,7 @@ MazeUI::MazeUI() { _cellSize.x = _cellSize.y = 0; _mapOffset.x = _mapOffset.y = 0; _resNum = _cellsResNum = 0; - _frameCount = _resCount = _mapImagePitch = _unused = 0; + _frameCount = _resCount = _mapImagePitch = 0; } MazeUI::~MazeUI() { @@ -1532,7 +1527,9 @@ void MazeUI::synchronize(Serializer &s) { s.syncAsSint16LE(_mapOffset.x); s.syncAsSint16LE(_mapOffset.y); - s.syncAsSint16LE(_unused); + + int dummy = 0; + s.syncAsSint16LE(dummy); } void MazeUI::load(int resNum) { @@ -1617,12 +1614,13 @@ void MazeUI::draw() { (_cellSize.y - 1)) / _cellSize.y; // Loop to handle the cell rows of the visible display area one at a time - for (int yCtr = 0; yCtr < _cellsVisible.y; ++yCtr, yPos += ySize) { + for (int yCtr = 0; yCtr <= _cellsVisible.y; ++yCtr, yPos += ySize) { int cellY = _mapOffset.y / _cellSize.y + yCtr; // Loop to iterate through the horizontal visible cells to build up - // an entire cell high horizontal slice of the map - for (int xCtr = 0; xCtr < _cellsVisible.x; ++xCtr) { + // an entire cell high horizontal slice of the map, plus one extra cell + // to allow for partial cell scrolling on-screen on the left/right sides + for (int xCtr = 0; xCtr <= _cellsVisible.x; ++xCtr) { int cellX = _mapOffset.x / _cellSize.x + xCtr; // Get the type of content to display in the cell @@ -1722,6 +1720,12 @@ void AnimationSlice::load(Common::File &f) { AnimationSlices::AnimationSlices() { _pixelData = NULL; + + _dataSize = 0; + _dataSize2 = 0; + _slices->_sliceOffset = 0; + _slices->_drawMode = 0; + _slices->_secondaryIndex = 0; } AnimationSlices::~AnimationSlices() { @@ -1783,10 +1787,21 @@ AnimationPlayer::AnimationPlayer(): EventHandler() { _screenBounds = R2_GLOBALS._gfxManagerInstance._bounds; _rect1 = R2_GLOBALS._gfxManagerInstance._bounds; _paletteMode = ANIMPALMODE_REPLACE_PALETTE; - _field3A = 1; + _canSkip = true; _sliceHeight = 1; - _field58 = 1; _endAction = NULL; + + _sliceCurrent = nullptr; + _sliceNext = nullptr; + _animLoaded = false; + _objectMode = ANIMOBJMODE_1; + _dataNeeded = 0; + _playbackTick = 0; + _playbackTickPrior = 0; + _position = 0; + _nextSlicesPosition = 0; + _frameDelay = 0; + _gameFrame = 0; } AnimationPlayer::~AnimationPlayer() { @@ -1796,9 +1811,9 @@ AnimationPlayer::~AnimationPlayer() { void AnimationPlayer::synchronize(Serializer &s) { EventHandler::synchronize(s); - - // TODO: Implement saving for animation player state. Currently, I disable saving - // when an animation is active, so saving it's state would a "nice to have". + + // TODO: Implement saving for animation player state. Currently, I disable saving + // when an animation is active, so saving it's state would a "nice to have". } void AnimationPlayer::remove() { @@ -1809,8 +1824,7 @@ void AnimationPlayer::remove() { } void AnimationPlayer::process(Event &event) { - if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_ESCAPE) && - (_field3A)) { + if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_ESCAPE) && _canSkip) { // Move the current position to the end _position = _subData._duration; } @@ -1856,11 +1870,13 @@ bool AnimationPlayer::load(int animId, Action *endAction) { _playbackTickPrior = -1; _playbackTick = 0; - // The final multiplication is used to deliberately slow down playback, since the original - // was slowed down by the amount of time spent to decode and display the frames - _frameDelay = (60 / _subData._frameRate) * 8; + _frameDelay = (60 / _subData._frameRate); _gameFrame = R2_GLOBALS._events.getFrameNumber(); + // WORKAROUND: Slow down the title sequences to better match the original + if (animId <= 4 || animId == 15) + _frameDelay *= 8; + if (_subData._totalSize) { _dataNeeded = _subData._totalSize; } else { @@ -1929,7 +1945,7 @@ bool AnimationPlayer::load(int animId, Action *endAction) { } ++R2_GLOBALS._animationCtr; - _field38 = 1; + _animLoaded = true; return true; } @@ -2026,7 +2042,7 @@ void AnimationPlayer::drawFrame(int sliceIndex) { // Unlock the screen surface R2_GLOBALS._screenSurface.unlockSurface(); - if (_objectMode == 42) { + if (_objectMode == ANIMOBJMODE_42) { _screenBounds.expandPanes(); // Copy the drawn frame to the back surface @@ -2076,7 +2092,7 @@ bool AnimationPlayer::isCompleted() { } void AnimationPlayer::close() { - if (_field38) { + if (_animLoaded) { switch (_paletteMode) { case 0: R2_GLOBALS._scenePalette.replace(&_palette); @@ -2095,7 +2111,7 @@ void AnimationPlayer::close() { // Close the resource file _resourceFile.close(); - if (_objectMode != 42) { + if (_objectMode != ANIMOBJMODE_42) { // flip screen in original } @@ -2105,7 +2121,7 @@ void AnimationPlayer::close() { _animData1 = NULL; _animData2 = NULL; - _field38 = 0; + _animLoaded = false; if (g_globals != NULL) R2_GLOBALS._animationCtr = MAX(R2_GLOBALS._animationCtr - 1, 0); } @@ -2154,7 +2170,7 @@ void AnimationPlayer::getSlices() { AnimationPlayerExt::AnimationPlayerExt(): AnimationPlayer() { _isActive = false; - _field3A = 0; + _canSkip = false; } void AnimationPlayerExt::synchronize(Serializer &s) { @@ -2206,7 +2222,7 @@ void ModalWindow::process(Event &event) { } } -void ModalWindow::proc12(int visage, int stripFrameNum, int frameNum, int posX, int posY) { +void ModalWindow::setup2(int visage, int stripFrameNum, int frameNum, int posX, int posY) { Scene1200 *scene = (Scene1200 *)R2_GLOBALS._sceneManager._scene; _object1.postInit(); @@ -2219,7 +2235,7 @@ void ModalWindow::proc12(int visage, int stripFrameNum, int frameNum, int posX, _insetCount = R2_GLOBALS._insetUp; } -void ModalWindow::proc13(int resNum, int lookLineNum, int talkLineNum, int useLineNum) { +void ModalWindow::setup3(int resNum, int lookLineNum, int talkLineNum, int useLineNum) { _object1.setDetails(resNum, lookLineNum, talkLineNum, useLineNum, 2, (SceneItem *) NULL); } @@ -2263,7 +2279,7 @@ void ScannerDialog::Button::process(Event &event) { setFrame(2); _buttonDown = false; event.handled = true; - + reset(); } } @@ -2318,7 +2334,7 @@ void ScannerDialog::Button::reset() { case 1800: if (R2_GLOBALS._rimLocation < 1201) scanner._obj4.setup(4, 3, 3); - else if (R2_GLOBALS._rimLocation < 1201) + else if (R2_GLOBALS._rimLocation > 1201) scanner._obj4.setup(4, 3, 4); else scanner._obj4.setup(4, 3, 5); @@ -2478,15 +2494,15 @@ void ScannerDialog::remove() { ModalWindow::remove(); } -void ScannerDialog::proc12(int visage, int stripFrameNum, int frameNum, int posX, int posY) { +void ScannerDialog::setup2(int visage, int stripFrameNum, int frameNum, int posX, int posY) { // Stop player moving if currently doing so if (R2_GLOBALS._player._mover) R2_GLOBALS._player.addMover(NULL); R2_GLOBALS._events.setCursor(CURSOR_USE); - ModalWindow::proc12(visage, stripFrameNum, frameNum, posX, posY); + ModalWindow::setup2(visage, stripFrameNum, frameNum, posX, posY); - proc13(100, -1, -1, -1); + setup3(100, -1, -1, -1); _talkButton.setup(1); _scanButton.setup(2); _slider.setup(R2_GLOBALS._scannerFrequencies[R2_GLOBALS._player._characterIndex], 142, 124, 35, 5); diff --git a/engines/tsage/ringworld2/ringworld2_logic.h b/engines/tsage/ringworld2/ringworld2_logic.h index 5c8af8d884..31d801fa55 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.h +++ b/engines/tsage/ringworld2/ringworld2_logic.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -81,7 +81,7 @@ private: static void startStrip(); static void endStrip(); public: - byte _field312[256]; + byte _shadowPaletteMap[256]; bool _savedPlayerEnabled; bool _savedUiEnabled; bool _savedCanWalk; @@ -114,6 +114,7 @@ public: virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void process(Event &event); virtual void postLoad(int priorSceneBeforeLoad, int currentSceneBeforeLoad); + virtual void dispatch(); void setupPaletteMaps(); }; @@ -177,7 +178,7 @@ public: InvObject _chargedPowerCapsule; InvObject _aerosol; InvObject _remoteControl; - InvObject _opticalFibre; + InvObject _opticalFiber; InvObject _clamp; InvObject _attractorHarness; InvObject _fuelCell; @@ -307,7 +308,6 @@ public: int _frameCount; int _resCount; int _mapImagePitch; - int _unused; public: MazeUI(); virtual ~MazeUI(); @@ -407,11 +407,11 @@ public: AnimationData *_sliceNext; Common::File _resourceFile; Rect _rect1, _screenBounds; - int _field38; - int _field3A; + bool _animLoaded; + bool _canSkip; AnimationPaletteMode _paletteMode; AnimationObjectMode _objectMode; - int _field58, _sliceHeight; + int _sliceHeight; byte _palIndexes[256]; ScenePalette _palette; AnimationPlayerSubData _subData; @@ -461,8 +461,8 @@ public: virtual void synchronize(Serializer &s); virtual Common::String getClassName() { return "ModalWindow"; } virtual void process(Event &event); - virtual void proc12(int visage, int stripFrameNum, int frameNum, int posX, int posY); - virtual void proc13(int resNum, int lookLineNum, int talkLineNum, int useLineNum); + virtual void setup2(int visage, int stripFrameNum, int frameNum, int posX, int posY); + virtual void setup3(int resNum, int lookLineNum, int talkLineNum, int useLineNum); }; class ScannerDialog: public ModalWindow { @@ -515,7 +515,7 @@ public: virtual Common::String getClassName() { return "ScannerDialog"; } virtual void remove(); - void proc12(int visage, int stripFrameNum, int frameNum, int posX, int posY); + virtual void setup2(int visage, int stripFrameNum, int frameNum, int posX, int posY); }; } // End of namespace Ringworld2 diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.cpp b/engines/tsage/ringworld2/ringworld2_scenes0.cpp index 5e4b4e4191..b82565332a 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes0.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes0.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -116,7 +116,7 @@ bool Scene100::Table::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); if (_strip == 2) { scene->_sceneMode = 108; - scene->_object3.postInit(); + scene->_tableLocker.postInit(); scene->_stasisNegator.postInit(); if (R2_INVENTORY.getObjectScene(R2_NEGATOR_GUN) == 1) { @@ -126,11 +126,13 @@ bool Scene100::Table::startAction(CursorType action, Event &event) { scene->_stasisNegator.setDetails(100, 21, 22, 23, 2, (SceneItem *)NULL); } - scene->setAction(&scene->_sequenceManager2, scene, 108, this, &scene->_object3, + // Open table locker + scene->setAction(&scene->_sequenceManager2, scene, 108, this, &scene->_tableLocker, &scene->_stasisNegator, &R2_GLOBALS._player, NULL); } else { scene->_sceneMode = 109; - scene->setAction(&scene->_sequenceManager2, scene, 109, this, &scene->_object3, + // Close table locker + scene->setAction(&scene->_sequenceManager2, scene, 109, this, &scene->_tableLocker, &scene->_stasisNegator, &R2_GLOBALS._player, NULL); } return true; @@ -140,7 +142,7 @@ bool Scene100::Table::startAction(CursorType action, Event &event) { if (_strip == 2) { SceneItem::display2(100, 18); scene->_sceneMode = 102; - scene->_object3.postInit(); + scene->_tableLocker.postInit(); scene->_stasisNegator.postInit(); if (R2_INVENTORY.getObjectScene(R2_NEGATOR_GUN) == 1) { @@ -150,12 +152,12 @@ bool Scene100::Table::startAction(CursorType action, Event &event) { scene->_stasisNegator.setDetails(100, 21, 22, 23, 2, (SceneItem *)NULL); } - scene->setAction(&scene->_sequenceManager2, scene, 102, this, &scene->_object3, + scene->setAction(&scene->_sequenceManager2, scene, 102, this, &scene->_tableLocker, &scene->_stasisNegator, NULL); } else { SceneItem::display2(100, 19); scene->_sceneMode = 103; - scene->setAction(&scene->_sequenceManager2, scene, 103, this, &scene->_object3, + scene->setAction(&scene->_sequenceManager2, scene, 103, this, &scene->_tableLocker, &scene->_stasisNegator, NULL); } return true; @@ -165,22 +167,21 @@ bool Scene100::Table::startAction(CursorType action, Event &event) { } bool Scene100::StasisNegator::startAction(CursorType action, Event &event) { - Scene100 *scene = (Scene100 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_USE: + case CURSOR_USE: { + Scene100 *scene = (Scene100 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 107; scene->setAction(&scene->_sequenceManager1, scene, 107, &R2_GLOBALS._player, &scene->_stasisNegator, NULL); return true; + } default: return SceneActor::startAction(action, event); } } bool Scene100::DoorDisplay::startAction(CursorType action, Event &event) { - Scene100 *scene = (Scene100 *)R2_GLOBALS._sceneManager._scene; - switch (action) { case CURSOR_LOOK: SceneItem::display2(100, _state ? 24 : 25); @@ -188,25 +189,29 @@ bool Scene100::DoorDisplay::startAction(CursorType action, Event &event) { case CURSOR_TALK: SceneItem::display2(100, _state ? 26 : 27); return true; - case CURSOR_USE: + case CURSOR_USE: { + Scene100 *scene = (Scene100 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 110; scene->setAction(&scene->_sequenceManager1, scene, 110, &R2_GLOBALS._player, NULL); return true; + } default: return SceneActor::startAction(action, event); } } bool Scene100::SteppingDisks::startAction(CursorType action, Event &event) { - Scene100 *scene = (Scene100 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_USE: + case CURSOR_USE: { + Scene100 *scene = (Scene100 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 111; scene->setAction(&scene->_sequenceManager1, scene, 111, &R2_GLOBALS._player, this, NULL); return true; + } default: return SceneActor::startAction(action, event); } @@ -215,14 +220,15 @@ bool Scene100::SteppingDisks::startAction(CursorType action, Event &event) { /*--------------------------------------------------------------------------*/ bool Scene100::Terminal::startAction(CursorType action, Event &event) { - Scene100 *scene = (Scene100 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_USE: + case CURSOR_USE: { + Scene100 *scene = (Scene100 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 105; scene->setAction(&scene->_sequenceManager1, scene, 105, &R2_GLOBALS._player, this, NULL); return true; + } default: return NamedHotspot::startAction(action, event); } @@ -295,10 +301,10 @@ void Scene100::postInit(SceneObjectList *OwnerList) { switch (R2_GLOBALS._sceneManager._previousScene) { case 50: case 180: - _object5.postInit(); - _object4.postInit(); + _wardrobeColorAnim.postInit(); + _wardrobeTopAnim.postInit(); _sceneMode = 104; - setAction(&_sequenceManager1, this, 104, &R2_GLOBALS._player, &_wardrobe, &_object4, &_object5, NULL); + setAction(&_sequenceManager1, this, 104, &R2_GLOBALS._player, &_wardrobe, &_wardrobeTopAnim, &_wardrobeColorAnim, NULL); break; case 125: _sceneMode = 100; @@ -331,14 +337,14 @@ void Scene100::signal() { _table.setStrip(2); _table.setFrame(3); - _object3.remove(); + _tableLocker.remove(); _stasisNegator.remove(); R2_GLOBALS._player.enableControl(); break; case 104: _sceneMode = 0; - _object5.remove(); - _object4.remove(); + _wardrobeColorAnim.remove(); + _wardrobeTopAnim.remove(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); R2_GLOBALS._player._numFrames = 10; @@ -387,7 +393,7 @@ void Scene100::dispatch() { SceneExt::dispatch(); if ((_sceneMode == 101) && (_door._frame == 2) && (_table._strip == 5)) { - _table.setAction(&_sequenceManager2, NULL, 103, &_table, &_object3, &_stasisNegator, NULL); + _table.setAction(&_sequenceManager2, NULL, 103, &_table, &_tableLocker, &_stasisNegator, NULL); } } @@ -414,9 +420,9 @@ Scene125::Icon::Icon(): SceneActor() { void Scene125::Icon::postInit(SceneObjectList *OwnerList) { SceneObject::postInit(); - _object1.postInit(); - _object1.fixPriority(255); - _object1.hide(); + _glyph.postInit(); + _glyph.fixPriority(255); + _glyph.hide(); _sceneText1._color1 = 92; _sceneText1._color2 = 0; @@ -459,15 +465,15 @@ void Scene125::Icon::process(Event &event) { scene->_sound1.play(14); setFrame(2); - switch (_object1._strip) { + switch (_glyph._strip) { case 1: - _object1.setStrip(2); + _glyph.setStrip(2); break; case 3: - _object1.setStrip(4); + _glyph.setStrip(4); break; case 5: - _object1.setStrip(6); + _glyph.setStrip(6); break; default: break; @@ -486,15 +492,15 @@ void Scene125::Icon::process(Event &event) { if ((event.eventType == EVENT_BUTTON_UP) && _pressed) { setFrame(1); - switch (_object1._strip) { + switch (_glyph._strip) { case 2: - _object1.setStrip(1); + _glyph.setStrip(1); break; case 4: - _object1.setStrip(3); + _glyph.setStrip(3); break; case 6: - _object1.setStrip(5); + _glyph.setStrip(5); break; default: break; @@ -508,8 +514,6 @@ void Scene125::Icon::process(Event &event) { } void Scene125::Icon::setIcon(int id) { - Scene125 *scene = (Scene125 *)R2_GLOBALS._sceneManager._scene; - _lookLineNum = _iconId = id; SceneActor::_lookLineNum = id; @@ -517,9 +521,11 @@ void Scene125::Icon::setIcon(int id) { _sceneText2.remove(); if (_lookLineNum) { + Scene125 *scene = (Scene125 *)R2_GLOBALS._sceneManager._scene; + showIcon(); - _object1.setup(161, ((id - 1) / 10) * 2 + 1, ((id - 1) % 10) + 1); - _object1.setPosition(_position); + _glyph.setup(161, ((id - 1) / 10) * 2 + 1, ((id - 1) % 10) + 1); + _glyph.setPosition(_position); _sceneText1._fontNumber = scene->_iconFontNumber; _sceneText1.setup(CONSOLE125_MESSAGES[id]); @@ -562,16 +568,16 @@ void Scene125::Icon::setIcon(int id) { void Scene125::Icon::showIcon() { _sceneText1.show(); _sceneText2.show(); - _object1.show(); - _object2.show(); + _glyph.show(); + _horizLine.show(); show(); } void Scene125::Icon::hideIcon() { _sceneText1.hide(); _sceneText2.hide(); - _object1.hide(); - _object2.hide(); + _glyph.hide(); + _horizLine.hide(); hide(); } @@ -666,28 +672,28 @@ void Scene125::signal() { case 2: _icon1.setup(160, 1, 1); _icon1.setPosition(Common::Point(65, 17)); - _icon1._object2.postInit(); - _icon1._object2.setup(160, 7, 1); - _icon1._object2.setPosition(Common::Point(106, 41)); + _icon1._horizLine.postInit(); + _icon1._horizLine.setup(160, 7, 1); + _icon1._horizLine.setPosition(Common::Point(106, 41)); _icon2.setup(160, 1, 1); _icon2.setPosition(Common::Point(80, 32)); - _icon2._object2.postInit(); - _icon2._object2.setup(160, 7, 2); - _icon2._object2.setPosition(Common::Point(106, 56)); + _icon2._horizLine.postInit(); + _icon2._horizLine.setup(160, 7, 2); + _icon2._horizLine.setPosition(Common::Point(106, 56)); _icon3.setup(160, 1, 1); _icon3.setPosition(Common::Point(65, 47)); - _icon3._object2.postInit(); - _icon3._object2.setup(160, 7, 1); - _icon3._object2.setPosition(Common::Point(106, 71)); + _icon3._horizLine.postInit(); + _icon3._horizLine.setup(160, 7, 1); + _icon3._horizLine.setPosition(Common::Point(106, 71)); _icon4.setup(160, 1, 1); _icon4.setPosition(Common::Point(80, 62)); _icon4._sceneRegionId = 5; - _icon4._object2.postInit(); - _icon4._object2.setup(160, 7, 2); - _icon4._object2.setPosition(Common::Point(106, 86)); + _icon4._horizLine.postInit(); + _icon4._horizLine.setup(160, 7, 2); + _icon4._horizLine.setPosition(Common::Point(106, 86)); _icon5.postInit(); _icon5.setup(160, 1, 1); @@ -706,20 +712,23 @@ void Scene125::signal() { R2_GLOBALS._player._canWalk = false; break; case 10: - switch (_consoleMode) { + switch (_consoleMode) { case 12: _sceneMode = 129; - _object1.postInit(); - _object2.postInit(); - _object3.postInit(); + _starchart1.postInit(); + _starchart2.postInit(); + _starchart3.postInit(); if (R2_GLOBALS.getFlag(13)) { - _object4.postInit(); - setAction(&_sequenceManager, this, 130, &R2_GLOBALS._player, &_object1, &_object2, - &_object3, &_object4, NULL); + // Show starchart with Ringworld present + _starchart4.postInit(); + setAction(&_sequenceManager, this, 130, &R2_GLOBALS._player, &_starchart1, &_starchart2, + &_starchart3, &_starchart4, NULL); } else { - setAction(&_sequenceManager, this, 129, &R2_GLOBALS._player, &_object1, &_object2, &_object3, NULL); + // Show starchart without Ringworld + setAction(&_sequenceManager, this, 129, &R2_GLOBALS._player, &_starchart1, &_starchart2, + &_starchart3, NULL); } break; case 13: @@ -776,7 +785,7 @@ void Scene125::signal() { case 12: if (_soundCount > 0) --_soundCount; - if (!_soundCount || (R2_GLOBALS._speechSubtitles & SPEECH_VOICE)) { + if (!_soundCount || !(R2_GLOBALS._speechSubtitles & SPEECH_VOICE)) { _soundIndex = 0; R2_GLOBALS._playStream.stop(); } else { @@ -920,7 +929,7 @@ void Scene125::consoleAction(int id) { _icon4.setPosition(Common::Point(52, 107)); _icon4._sceneRegionId = 9; _icon4.setIcon(25); - _icon4._object2.hide(); + _icon4._horizLine.hide(); _icon6.setIcon(26); _sceneMode = 10; @@ -963,7 +972,7 @@ void Scene125::consoleAction(int id) { _icon4.setPosition(Common::Point(52, 107)); _icon4._sceneRegionId = 9; _icon4.setIcon(25); - _icon4._object2.hide(); + _icon4._horizLine.hide(); _icon6.setIcon(26); _sceneMode = 10; @@ -1047,7 +1056,7 @@ void Scene125::consoleAction(int id) { break; case 24: _icon4.setIcon(25); - _icon4._object2.hide(); + _icon4._horizLine.hide(); if (_consoleMode == 10) { setDetails(127, --_logIndex); @@ -1059,7 +1068,7 @@ void Scene125::consoleAction(int id) { break; case 25: _icon4.setIcon(25); - _icon4._object2.hide(); + _icon4._horizLine.hide(); if (_consoleMode == 10) { setDetails(127, ++_logIndex); @@ -1077,10 +1086,10 @@ void Scene125::consoleAction(int id) { _icon4.hideIcon(); R2_GLOBALS._player.hide(); - _object1.hide(); - _object2.hide(); - _object3.hide(); - _object4.hide(); + _starchart1.hide(); + _starchart2.hide(); + _starchart3.hide(); + _starchart4.hide(); _sceneMode = 11; _palette.loadPalette(160); @@ -1103,7 +1112,7 @@ void Scene125::consoleAction(int id) { _icon4.setPosition(Common::Point(52, 107)); _icon4._sceneRegionId = 9; _icon4.setIcon(25); - _icon4._object2.hide(); + _icon4._horizLine.hide(); _icon6.setIcon(26); _sceneMode = 10; @@ -1163,7 +1172,7 @@ void Scene125::setDetails(int resNum, int lineNum) { if ((_soundCount > 0) && (R2_GLOBALS._speechSubtitles & SPEECH_VOICE)) { _sceneMode = 12; - R2_GLOBALS._playStream.play(_soundIndexes[_soundIndex], this); + R2_GLOBALS._playStream.play(_soundIndexes[_soundIndex++], this); } } else { // Passed the start or end of the message set, so return to the menu @@ -1425,6 +1434,7 @@ Scene160::Scene160(): SceneExt() { void Scene160::postInit(SceneObjectList *OwnerList) { loadScene(4001); + R2_GLOBALS._uiElements._active = false; SceneExt::postInit(); R2_GLOBALS._player._uiEnabled = false; @@ -1446,6 +1456,8 @@ void Scene160::synchronize(Serializer &s) { s.syncAsSint16LE(_frameNumber); s.syncAsSint16LE(_yChange); s.syncAsSint16LE(_lineNum); + + _creditsList.synchronize(s); } void Scene160::remove() { @@ -1500,11 +1512,9 @@ void Scene180::Action1::signal() { /*--------------------------------------------------------------------------*/ Scene180::Scene180(): SceneExt() { - _field412 = 0; + _helpEnabled = false; _frameInc = 0; _frameNumber = R2_GLOBALS._events.getFrameNumber(); - _field480 = 1; - _field482 = -1; _fontNumber = R2_GLOBALS.gfxManager()._font._fontNumber; GfxFont font; @@ -1531,7 +1541,7 @@ void Scene180::postInit(SceneObjectList *OwnerList) { } void Scene180::remove() { - _stripManager._field2E8 = -1; + _stripManager._currObj44Id = -1; // _stripManager._field2EA = -1; SceneExt::remove(); @@ -1549,9 +1559,7 @@ void Scene180::synchronize(Serializer &s) { SceneExt::synchronize(s); s.syncAsSint16LE(_frameNumber); - s.syncAsSint16LE(_field412); - s.syncAsSint16LE(_field480); - s.syncAsSint16LE(_field482); + s.syncAsSint16LE(_helpEnabled); s.syncAsSint16LE(_frameInc); s.syncAsSint16LE(_fontNumber); s.syncAsSint16LE(_fontHeight); @@ -1566,7 +1574,7 @@ void Scene180::signal() { break; case 1: - _field412 = 1; + _helpEnabled = true; R2_GLOBALS._sceneManager._hasPalette = true; _animationPlayer._paletteMode = ANIMPALMODE_NONE; _animationPlayer._isActive = true; @@ -1604,7 +1612,8 @@ void Scene180::signal() { case 30: case 43: case 47: - _field412 = 0; + _helpEnabled = false; + R2_GLOBALS._screenSurface.fillRect(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT), 0); _palette.loadPalette(0); _palette.loadPalette(9998); R2_GLOBALS._scenePalette.addFader(_palette._palette, 256, 8, this); @@ -1617,7 +1626,7 @@ void Scene180::signal() { R2_GLOBALS._scene180Mode = 2; _animationPlayer.load(2); - _field412 = 1; + _helpEnabled = true; R2_GLOBALS._scenePalette.addFader(_animationPlayer._subData._palData, 256, 6, NULL); R2_GLOBALS._sound1.play(2); break; @@ -1654,7 +1663,7 @@ void Scene180::signal() { break; case 11: - _field412 = 1; + _helpEnabled = true; _door.postInit(); _shipDisplay.postInit(); setAction(&_sequenceManager, this, 4000, &_door, &_shipDisplay, NULL); @@ -1669,7 +1678,7 @@ void Scene180::signal() { case 24: case 26: case 46: - setSceneDelay((R2_GLOBALS._speechSubtitles & 1) ? 1 : 18); + setSceneDelay((R2_GLOBALS._speechSubtitles & SPEECH_TEXT) ? 1 : 18); break; case 13: @@ -1701,21 +1710,21 @@ void Scene180::signal() { break; case 27: - _field412 = 0; + _helpEnabled = false; _door.remove(); _shipDisplay.remove(); setSceneDelay(2); break; case 28: - _field412 = 0; + _helpEnabled = false; _palette.loadPalette(0); _palette.loadPalette(9998); R2_GLOBALS._scenePalette.addFader(_palette._palette, 256, 100, this); break; case 29: - _field412 = 1; + _helpEnabled = true; _animationPlayer._paletteMode = ANIMPALMODE_REPLACE_PALETTE; _animationPlayer._isActive = true; _animationPlayer._objectMode = ANIMOBJMODE_42; @@ -1744,23 +1753,23 @@ void Scene180::signal() { break; case 32: - _field412 = 1; + _helpEnabled = true; _teal.postInit(); _teal.setPosition(Common::Point(161, 97)); _teal.hide(); - _webbser.postInit(); - _webbser.setPosition(Common::Point(60, 96)); - _webbser.hide(); + _webbster.postInit(); + _webbster.setPosition(Common::Point(60, 96)); + _webbster.hide(); _stripManager.start(11, this); break; case 33: _teal.hide(); - _webbser.setup(76, 4, 1); - _webbser.setFrame(_webbser.getFrameCount()); + _webbster.setup(76, 4, 1); + _webbster.setFrame(_webbster.getFrameCount()); _shipDisplay.postInit(); _shipDisplay.setup(75, 1, 1); @@ -1772,7 +1781,7 @@ void Scene180::signal() { case 34: _teal.hide(); - _webbser.hide(); + _webbster.remove(); _dutyOfficer.postInit(); _dutyOfficer.setup(76, 2, 1); @@ -1794,7 +1803,7 @@ void Scene180::signal() { break; case 37: - _field412 = 0; + _helpEnabled = false; _dutyOfficer.remove(); _palette.loadPalette(9998); R2_GLOBALS._scenePalette.addFader(_palette._palette, 256, 8, this); @@ -1805,12 +1814,10 @@ void Scene180::signal() { _shipDisplay.setAction(NULL); _shipDisplay.remove(); - // TODO: Figure out why end action on sounds aren't firing. For now, I'm - // simply setting up a scene delay to ensure the signal() method gets - // called again after a brief delay - setSceneDelay(10); + _backSurface.fillRect(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT), 0); + R2_GLOBALS._screenSurface.fillRect(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT), 0); R2_GLOBALS._sound2.fadeOut2(NULL); - R2_GLOBALS._sound1.fadeOut2(NULL /* this */); + R2_GLOBALS._sound1.fadeOut2(this); break; case 39: @@ -1832,7 +1839,7 @@ void Scene180::signal() { break; case 41: - _field412 = 1; + _helpEnabled = true; _animationPlayer._isActive = true; break; @@ -1852,12 +1859,12 @@ void Scene180::signal() { break; case 45: - _field412 = 1; + _helpEnabled = true; _stripManager.start(28, this); break; case 48: - _field412 = 1; + _helpEnabled = true; _animationPlayer._paletteMode = ANIMPALMODE_NONE; _animationPlayer._isActive = true; _animationPlayer._objectMode = ANIMOBJMODE_1; @@ -1871,13 +1878,21 @@ void Scene180::signal() { case 49: R2_GLOBALS._scene180Mode = 15; R2_GLOBALS._paneRefreshFlag[0] = 3; + + _backSurface.fillRect(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT), 0); + R2_GLOBALS._screenSurface.fillRect(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT), 0); + setSceneDelay(1); break; case 50: R2_GLOBALS._scene180Mode = 0; - _field412 = 0; - R2_GLOBALS._sceneManager.changeScene(100); + _helpEnabled = false; + + // WORKAROUND: The original changed to scene 100 here, Quinn's Bedroom, + // but instead we're changing to the previously unused scene 50, which shows + // a closeup of Quinn in the floatation bed first + R2_GLOBALS._sceneManager.changeScene(50); break; } } @@ -1889,11 +1904,10 @@ void Scene180::setSceneDelay(int v) { void Scene180::process(Event &event) { if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_ESCAPE)) { - event.handled = 1; - if (!_field412) { - if (R2_GLOBALS._scenePalette._listeners.size() == 0) { + event.handled = true; + if (_helpEnabled) { + if (R2_GLOBALS._scenePalette._listeners.size() == 0) HelpDialog::show(); - } } } @@ -2002,9 +2016,9 @@ void Scene180::restore() { *--------------------------------------------------------------------------*/ bool Scene200::NorthDoor::startAction(CursorType action, Event &event) { - Scene200 *scene = (Scene200 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_USE) { + Scene200 *scene = (Scene200 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 202; scene->setAction(&scene->_sequenceManager, scene, 202, &R2_GLOBALS._player, this, NULL); @@ -2015,9 +2029,9 @@ bool Scene200::NorthDoor::startAction(CursorType action, Event &event) { } bool Scene200::EastDoor::startAction(CursorType action, Event &event) { - Scene200 *scene = (Scene200 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_USE) { + Scene200 *scene = (Scene200 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 200; scene->setAction(&scene->_sequenceManager, scene, 200, &R2_GLOBALS._player, this, NULL); @@ -2028,9 +2042,9 @@ bool Scene200::EastDoor::startAction(CursorType action, Event &event) { } bool Scene200::WestDoor::startAction(CursorType action, Event &event) { - Scene200 *scene = (Scene200 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_USE) { + Scene200 *scene = (Scene200 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 204; scene->setAction(&scene->_sequenceManager, scene, 204, &R2_GLOBALS._player, this, NULL); @@ -2340,12 +2354,21 @@ Scene205::Scene205(): SceneExt() { GfxFont font; font.setFontNumber(4); _fontHeight = font.getHeight(); + + for (int i = 0; i < 3; i++) { + _starList1[i] = nullptr; + _starList2[i] = nullptr; + } + + for (int i = 0; i < 4; i++) + _starList3[i] = nullptr; } void Scene205::postInit(SceneObjectList *OwnerList) { loadScene(4000); + R2_GLOBALS._uiElements._active = false; SceneExt::postInit(); - BF_GLOBALS._interfaceY = 200; + R2_GLOBALS._interfaceY = SCREEN_HEIGHT; R2_GLOBALS._player._uiEnabled = false; R2_GLOBALS._sound1.play(337); @@ -2360,11 +2383,11 @@ void Scene205::synchronize(Serializer &s) { SceneExt::synchronize(s); for (int idx = 0; idx < 3; ++idx) - SYNC_POINTER(_objList1[idx]); + SYNC_POINTER(_starList1[idx]); for (int idx = 0; idx < 3; ++idx) - SYNC_POINTER(_objList2[idx]); + SYNC_POINTER(_starList2[idx]); for (int idx = 0; idx < 4; ++idx) - SYNC_POINTER(_objList3[idx]); + SYNC_POINTER(_starList3[idx]); s.syncAsSint16LE(_textIndex); s.syncAsSint16LE(_lineNum); @@ -2386,9 +2409,9 @@ void Scene205::process(Event &event) { } void Scene205::dispatch() { - processList(_objList3, 4, Common::Rect(0, 0, 319, 200), 1, 1, 160, 100); - processList(_objList2, 3, Common::Rect(0, 0, 319, 200), 2, 2, 160, 100); - processList(_objList1, 3, Common::Rect(0, 0, 319, 200), 4, 3, 160, 100); + processList(_starList3, 4, Common::Rect(0, 0, 319, 200), 1, 1, 160, 100); + processList(_starList2, 3, Common::Rect(0, 0, 319, 200), 2, 2, 160, 100); + processList(_starList1, 3, Common::Rect(0, 0, 319, 200), 4, 3, 160, 100); Scene::dispatch(); } @@ -2400,10 +2423,10 @@ void Scene205::setup() { Common::Point(140, 149), Common::Point(91, 166), Common::Point(299, 46), Common::Point(314, 10) }; - // Set up the first object list + // Set up the first star list for (int idx = 0; idx < 3; ++idx) { - Object *obj = new Object(); - _objList1[idx] = obj; + Star *obj = new Star(); + _starList1[idx] = obj; obj->postInit(); obj->_flags |= OBJFLAG_CLONED; @@ -2416,10 +2439,10 @@ void Scene205::setup() { obj->fixPriority(12); } - // Setup the second object list + // Setup the second star list for (int idx = 0; idx < 3; ++idx) { - Object *obj = new Object(); - _objList2[idx] = obj; + Star *obj = new Star(); + _starList2[idx] = obj; obj->postInit(); obj->_flags |= OBJFLAG_CLONED; @@ -2432,10 +2455,10 @@ void Scene205::setup() { obj->fixPriority(11); } - // Setup the third object list + // Setup the third star list for (int idx = 0; idx < 4; ++idx) { - Object *obj = new Object(); - _objList3[idx] = obj; + Star *obj = new Star(); + _starList3[idx] = obj; obj->postInit(); obj->_flags |= OBJFLAG_CLONED; @@ -2452,10 +2475,10 @@ void Scene205::setup() { /** * Handles moving a group of stars in the scene background */ -void Scene205::processList(Object **ObjList, int count, const Common::Rect &bounds, +void Scene205::processList(Star **ObjList, int count, const Common::Rect &bounds, int xMultiply, int yMultiply, int xCenter, int yCenter) { for (int idx = 0; idx < count; ++idx) { - Object *obj = ObjList[idx]; + Star *obj = ObjList[idx]; Common::Point pt(obj->_position.x - xCenter, obj->_position.y - yCenter); if ((obj->_position.x <= 319) && (obj->_position.x >= 0) && @@ -2496,6 +2519,72 @@ void Scene205::handleText() { } /*-------------------------------------------------------------------------- + * Scene 205 Demo - End of Demo + * + *--------------------------------------------------------------------------*/ + +void Scene205Demo::Action1::signal() { + Scene205Demo *scene = (Scene205Demo *)R2_GLOBALS._sceneManager._scene; + + switch (_actionIndex++) { + case 0: + setDelay(2); + break; + case 1: + MessageDialog::show2(BUY_FULL_GAME_MSG, OK_BTN_STRING); + setDelay(1); + break; + case 2: + scene->leaveScene(); + break; + default: + break; + } +} + +/*--------------------------------------------------------------------------*/ + +void Scene205Demo::leaveScene() { + if (g_globals->getFlag(85)) + R2_GLOBALS._sceneManager.changeScene(160); + else + R2_GLOBALS._sceneManager.changeScene(R2_GLOBALS._sceneManager._previousScene); + + BF_GLOBALS._scenePalette.loadPalette(0); + BF_GLOBALS._scenePalette.refresh(); +} + +void Scene205Demo::postInit(SceneObjectList *OwnerList) { + R2_GLOBALS._sceneManager._hasPalette = true; + R2_GLOBALS._scenePalette.loadPalette(0); + + loadScene(1000); + R2_GLOBALS._uiElements._active = false; + R2_GLOBALS._player.enableControl(); + + SceneExt::postInit(); + + _sound1.play(337); + _stripManager.addSpeaker(&_animationPlayer); + + setAction(&_action1); +} + +void Scene205Demo::remove() { + R2_GLOBALS._sound1.fadeOut2(NULL); + SceneExt::remove(); +} + +void Scene205Demo::process(Event &event) { + if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_ESCAPE)) { + event.handled = true; + leaveScene(); + } else { + Scene::process(event); + } +} + +/*-------------------------------------------------------------------------- * Scene 250 - Lift * *--------------------------------------------------------------------------*/ @@ -2511,10 +2600,10 @@ void Scene250::Button::synchronize(Serializer &s) { } bool Scene250::Button::startAction(CursorType action, Event &event) { - Scene250 *scene = (Scene250 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_USE: + case CURSOR_USE: { + Scene250 *scene = (Scene250 *)R2_GLOBALS._sceneManager._scene; + if (scene->_destButtonY) { SceneItem::display2(250, 15); } else { @@ -2537,6 +2626,7 @@ bool Scene250::Button::startAction(CursorType action, Event &event) { } } return true; + } case CURSOR_LOOK: switch (_floorNumber) { @@ -2606,11 +2696,11 @@ void Scene250::synchronize(Serializer &s) { void Scene250::postInit(SceneObjectList *OwnerList) { loadScene(250); + R2_GLOBALS._uiElements._active = false; SceneExt::postInit(); - BF_GLOBALS._interfaceY = 200; + R2_GLOBALS._interfaceY = SCREEN_HEIGHT; R2_GLOBALS._player.postInit(); - R2_GLOBALS._uiElements._active = false; R2_GLOBALS._player.setVisage(10); R2_GLOBALS._player.hide(); R2_GLOBALS._player.enableControl(); @@ -2683,7 +2773,7 @@ void Scene250::signal() { case 2: if (_destButtonY - 12 == _currButtonY) _sceneMode = 4; - else + else _sceneMode = 3; signal(); @@ -2885,14 +2975,14 @@ void Scene300::Action3::signal() { void Scene300::Action4::signal() { - Scene300 *scene = (Scene300 *)R2_GLOBALS._sceneManager._scene; - if (!R2_GLOBALS._playStream.isPlaying()) { - scene->_object7.setStrip2(R2_GLOBALS._randomSource.getRandomNumber(2)); - scene->_object7.setFrame(1); + Scene300 *scene = (Scene300 *)R2_GLOBALS._sceneManager._scene; + + scene->_mirandaScreen.setStrip2(R2_GLOBALS._randomSource.getRandomNumber(2)); + scene->_mirandaScreen.setFrame(1); - scene->_object9.setStrip2(3); - scene->_object9.setFrame(1); + scene->_quinnScreen.setStrip2(3); + scene->_quinnScreen.setFrame(1); } setDelay(60 + R2_GLOBALS._randomSource.getRandomNumber(479)); @@ -2901,16 +2991,16 @@ void Scene300::Action4::signal() { /*--------------------------------------------------------------------------*/ bool Scene300::QuinnWorkstation::startAction(CursorType action, Event &event) { - Scene300 *scene = (Scene300 *)R2_GLOBALS._sceneManager._scene; - switch (action) { case CURSOR_USE: - if (R2_GLOBALS._player._characterIndex != 1) + if (R2_GLOBALS._player._characterIndex != R2_QUINN) SceneItem::display2(300, 46); else if (R2_GLOBALS.getFlag(44)) { R2_GLOBALS._player.setAction(NULL); R2_GLOBALS._sceneManager.changeScene(325); } else { + Scene300 *scene = (Scene300 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 306; scene->setAction(&scene->_sequenceManager1, scene, 306, &R2_GLOBALS._player, NULL); @@ -2934,7 +3024,7 @@ bool Scene300::QuinnWorkstation::startAction(CursorType action, Event &event) { bool Scene300::MirandaWorkstation::startAction(CursorType action, Event &event) { switch (action) { case CURSOR_USE: - if (R2_GLOBALS._player._characterIndex != 3) + if (R2_GLOBALS._player._characterIndex != R2_MIRANDA) SceneItem::display2(300, 49); else R2_GLOBALS._sceneManager.changeScene(325); @@ -2964,7 +3054,7 @@ bool Scene300::SeekerWorkstation::startAction(CursorType action, Event &event) { break; case CURSOR_USE: - if (R2_GLOBALS._player._characterIndex != 2) + if (R2_GLOBALS._player._characterIndex != R2_SEEKER) SceneItem::display2(300, 48); else R2_GLOBALS._sceneManager.changeScene(325); @@ -3131,10 +3221,10 @@ bool Scene300::Seeker::startAction(CursorType action, Event &event) { } bool Scene300::Quinn::startAction(CursorType action, Event &event) { - Scene300 *scene = (Scene300 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_TALK: + case CURSOR_TALK: { + Scene300 *scene = (Scene300 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_ARROW); scene->_sceneMode = 10; @@ -3156,18 +3246,18 @@ bool Scene300::Quinn::startAction(CursorType action, Event &event) { scene->_stripManager.start3(scene->_stripId, scene, R2_GLOBALS._stripManager_lookupList); return true; - + } default: return SceneActor::startAction(action, event); } } bool Scene300::Doorway::startAction(CursorType action, Event &event) { - Scene300 *scene = (Scene300 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_USE) { if ((R2_GLOBALS._player._characterIndex == R2_QUINN) && (!R2_GLOBALS.getFlag(44) || R2_GLOBALS._player._characterScene[R2_SEEKER] == 500)) { + Scene300 *scene = (Scene300 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 301; scene->setAction(&scene->_sequenceManager1, scene, 301, &R2_GLOBALS._player, this, NULL); @@ -3223,29 +3313,29 @@ void Scene300::postInit(SceneObjectList *OwnerList) { _rotation->_countdown = 1; if (R2_GLOBALS.getFlag(51) && !R2_GLOBALS.getFlag(25)) { - _object1.postInit(); - _object1.setup(301, 7, 2); - _object1.setPosition(Common::Point(65, 24)); + _atmosphereLeftWindow.postInit(); + _atmosphereLeftWindow.setup(301, 7, 2); + _atmosphereLeftWindow.setPosition(Common::Point(65, 24)); - _object2.postInit(); - _object2.setup(301, 8, 2); - _object2.setPosition(Common::Point(254, 24)); + _atmosphereRightWindow.postInit(); + _atmosphereRightWindow.setup(301, 8, 2); + _atmosphereRightWindow.setPosition(Common::Point(254, 24)); } _doorway.postInit(); _doorway.setVisage(300); _doorway.setPosition(Common::Point(159, 79)); - _object3.postInit(); - _object3.setup(300, 4, 1); - _object3.setPosition(Common::Point(84, 48)); - _object3.animate(ANIM_MODE_2, NULL); - _object3._numFrames = 5; + _leftVerticalBarsAnim.postInit(); + _leftVerticalBarsAnim.setup(300, 4, 1); + _leftVerticalBarsAnim.setPosition(Common::Point(84, 48)); + _leftVerticalBarsAnim.animate(ANIM_MODE_2, NULL); + _leftVerticalBarsAnim._numFrames = 5; - _object4.postInit(); - _object4.setup(300, 5, 1); - _object4.setPosition(Common::Point(236, 48)); - _object4.animate(ANIM_MODE_2, NULL); + _rightVerticalBarsAnim.postInit(); + _rightVerticalBarsAnim.setup(300, 5, 1); + _rightVerticalBarsAnim.setPosition(Common::Point(236, 48)); + _rightVerticalBarsAnim.animate(ANIM_MODE_2, NULL); _protocolDisplay.postInit(); _protocolDisplay.setup(300, 6, 1); @@ -3253,32 +3343,32 @@ void Scene300::postInit(SceneObjectList *OwnerList) { _protocolDisplay.animate(ANIM_MODE_7, 0, NULL); _protocolDisplay._numFrames = 5; - _object6.postInit(); - _object6.setup(300, 7, 1); - _object6.setPosition(Common::Point(214, 37)); - _object6.animate(ANIM_MODE_2, NULL); - _object6._numFrames = 3; - - _object7.postInit(); - _object7.setup(301, 1, 1); - _object7.setPosition(Common::Point(39, 97)); - _object7.fixPriority(124); - _object7.animate(ANIM_MODE_2, NULL); - _object7._numFrames = 5; - _object7.setAction(&_action4); - - _object8.postInit(); - _object8.setup(300, 8, 1); - _object8.setPosition(Common::Point(105, 37)); - _object8.animate(ANIM_MODE_2, NULL); - _object8._numFrames = 5; - - _object9.postInit(); - _object9.setup(301, 6, 1); - _object9.setPosition(Common::Point(274, 116)); - _object9.fixPriority(143); - _object9.animate(ANIM_MODE_2, NULL); - _object9._numFrames = 5; + _rightTextDisplay.postInit(); + _rightTextDisplay.setup(300, 7, 1); + _rightTextDisplay.setPosition(Common::Point(214, 37)); + _rightTextDisplay.animate(ANIM_MODE_2, NULL); + _rightTextDisplay._numFrames = 3; + + _mirandaScreen.postInit(); + _mirandaScreen.setup(301, 1, 1); + _mirandaScreen.setPosition(Common::Point(39, 97)); + _mirandaScreen.fixPriority(124); + _mirandaScreen.animate(ANIM_MODE_2, NULL); + _mirandaScreen._numFrames = 5; + _mirandaScreen.setAction(&_action4); + + _leftTextDisplay.postInit(); + _leftTextDisplay.setup(300, 8, 1); + _leftTextDisplay.setPosition(Common::Point(105, 37)); + _leftTextDisplay.animate(ANIM_MODE_2, NULL); + _leftTextDisplay._numFrames = 5; + + _quinnScreen.postInit(); + _quinnScreen.setup(301, 6, 1); + _quinnScreen.setPosition(Common::Point(274, 116)); + _quinnScreen.fixPriority(143); + _quinnScreen.animate(ANIM_MODE_2, NULL); + _quinnScreen._numFrames = 5; _quinnWorkstation1.setDetails(Rect(243, 148, 315, 167), 300, 30, 31, 32, 1, NULL); _mirandaWorkstation1.setDetails(Rect(4, 128, 69, 167), 300, 33, 31, 35, 1, NULL); @@ -3375,7 +3465,7 @@ void Scene300::postInit(SceneObjectList *OwnerList) { _background.setDetails(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT), 300, 0, -1, -1, 1, NULL); switch (R2_GLOBALS._player._characterIndex) { - case 1: + case R2_QUINN: _sceneMode = 300; switch (R2_GLOBALS._sceneManager._previousScene) { @@ -3393,10 +3483,13 @@ void Scene300::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS.getFlag(55)) { if (R2_GLOBALS.getFlag(57)) { + // Little hack to get the correct sentence order + R2_GLOBALS._stripManager_lookupList[8] = 2; + R2_GLOBALS.clearFlag(60); R2_GLOBALS._events.setCursor(CURSOR_ARROW); _sceneMode = 16; - _stripManager.start(404, this); + _stripManager.start3(404, this, R2_GLOBALS._stripManager_lookupList); } else { R2_GLOBALS._player.enableControl(); R2_GLOBALS._player._canWalk = false; @@ -3464,11 +3557,11 @@ void Scene300::postInit(SceneObjectList *OwnerList) { } break; - case 3: + case R2_MIRANDA: if (R2_GLOBALS._sceneManager._previousScene == 1500) { R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 3150; R2_GLOBALS._player._characterScene[R2_MIRANDA] = 3150; - R2_GLOBALS._player._effect = 0; + R2_GLOBALS._player._effect = EFFECT_NONE; R2_GLOBALS._player.setAction(NULL); R2_GLOBALS._player.disableControl(); @@ -3526,13 +3619,17 @@ void Scene300::signal() { R2_GLOBALS.setFlag(40); break; case 6: - R2_GLOBALS._sceneManager.changeScene(1000); + if (g_vm->getFeatures() & GF_DEMO) { + R2_GLOBALS.setFlag(85); + R2_GLOBALS._sceneManager.changeScene(205); + } else + R2_GLOBALS._sceneManager.changeScene(1000); break; default: break; } - _stripManager._field2E8 = 0; + _stripManager._currObj44Id = 0; switch (_stripId) { case 400: R2_GLOBALS._player.disableControl(); @@ -3545,7 +3642,7 @@ void Scene300::signal() { default: R2_GLOBALS._player.enableControl(CURSOR_TALK); - if ((R2_GLOBALS._player._characterIndex != 1) || R2_GLOBALS.getFlag(44)) + if ((R2_GLOBALS._player._characterIndex != R2_QUINN) || R2_GLOBALS.getFlag(44)) R2_GLOBALS._player._canWalk = false; break; } @@ -3587,8 +3684,14 @@ void Scene300::signal() { case 16: if (_stripManager._exitMode == 1) { - R2_GLOBALS._player.setAction(NULL); - R2_GLOBALS._sceneManager.changeScene(1000); + if (g_vm->getFeatures() & GF_DEMO) { + R2_GLOBALS._player.setAction(NULL); + R2_GLOBALS.setFlag(85); + R2_GLOBALS._sceneManager.changeScene(205); + } else { + R2_GLOBALS._player.setAction(NULL); + R2_GLOBALS._sceneManager.changeScene(1000); + } } else { R2_GLOBALS._player.setAction(&_action1); R2_GLOBALS._player.enableControl(CURSOR_TALK); @@ -3653,7 +3756,7 @@ void Scene300::signal() { case 313: _sceneMode = 14; - R2_GLOBALS._player._effect = 0; + R2_GLOBALS._player._effect = EFFECT_NONE; _seeker.setAction(&_sequenceManager3, this, 314, &_seeker, &_doorway, NULL); R2_GLOBALS._events.setCursor(CURSOR_ARROW); _stripManager.start(301, this); @@ -3662,7 +3765,7 @@ void Scene300::signal() { case 314: R2_GLOBALS._player.disableControl(); _sceneMode = 315; - R2_GLOBALS._player._effect = 1; + R2_GLOBALS._player._effect = EFFECT_SHADED; setAction(&_sequenceManager1, this, 315, &R2_GLOBALS._player, &_doorway, NULL); break; @@ -3673,7 +3776,7 @@ void Scene300::signal() { case 316: R2_GLOBALS._player._characterScene[R2_SEEKER] = 500; _seeker.remove(); - R2_GLOBALS._player.enableControl(CURSOR_CROSSHAIRS); + R2_GLOBALS._player.enableControl(CURSOR_WALK); break; case 317: @@ -3752,9 +3855,9 @@ Scene325::Icon::Icon(): SceneActor() { void Scene325::Icon::postInit(SceneObjectList *OwnerList) { SceneObject::postInit(); - _object1.postInit(); - _object1.fixPriority(21); - _object1.hide(); + _glyph.postInit(); + _glyph.fixPriority(21); + _glyph.hide(); _sceneText1._color1 = 92; _sceneText1._color2 = 0; @@ -3793,18 +3896,18 @@ void Scene325::Icon::process(Event &event) { scene->_sound1.play(14); setFrame(2); - switch (_object1._strip) { + switch (_glyph._strip) { case 1: - _object1.setStrip(2); + _glyph.setStrip(2); break; case 3: - _object1.setStrip(4); + _glyph.setStrip(4); break; case 5: - _object1.setStrip(6); + _glyph.setStrip(6); break; case 7: - _object1.setStrip(8); + _glyph.setStrip(8); break; default: break; @@ -3823,15 +3926,15 @@ void Scene325::Icon::process(Event &event) { if ((event.eventType == EVENT_BUTTON_UP) && _pressed) { setFrame(1); - switch (_object1._strip) { + switch (_glyph._strip) { case 2: - _object1.setStrip(1); + _glyph.setStrip(1); break; case 4: - _object1.setStrip(3); + _glyph.setStrip(3); break; case 6: - _object1.setStrip(5); + _glyph.setStrip(5); break; default: break; @@ -3845,8 +3948,6 @@ void Scene325::Icon::process(Event &event) { } void Scene325::Icon::setIcon(int id) { - Scene325 *scene = (Scene325 *)R2_GLOBALS._sceneManager._scene; - _lookLineNum = _iconId = id; SceneActor::_lookLineNum = id; @@ -3854,9 +3955,11 @@ void Scene325::Icon::setIcon(int id) { _sceneText2.remove(); if (_lookLineNum) { + Scene325 *scene = (Scene325 *)R2_GLOBALS._sceneManager._scene; + showIcon(); - _object1.setup(325, ((id - 1) / 10) * 2 + 1, ((id - 1) % 10) + 1); - _object1.setPosition(_position); + _glyph.setup(325, ((id - 1) / 10) * 2 + 1, ((id - 1) % 10) + 1); + _glyph.setPosition(_position); _sceneText1._fontNumber = scene->_iconFontNumber; _sceneText1.setup(CONSOLE325_MESSAGES[id]); @@ -3897,26 +4000,26 @@ void Scene325::Icon::setIcon(int id) { void Scene325::Icon::showIcon() { _sceneText1.show(); _sceneText2.show(); - _object1.show(); - _object2.show(); + _glyph.show(); + _horizLine.show(); show(); } void Scene325::Icon::hideIcon() { _sceneText1.hide(); _sceneText2.hide(); - _object1.hide(); - _object2.hide(); + _glyph.hide(); + _horizLine.hide(); hide(); } /*--------------------------------------------------------------------------*/ Scene325::Scene325(): SceneExt() { - _field412 = 7; + _consoleAction = 7; _iconFontNumber = 50; - _field416 = _field418 = 0; - _field41A = _field41C = _field41E = _scannerLocation = 0; + _databasePage = _priorConsoleAction = 0; + _moveCounter = _yChange = _yDirection = _scannerLocation = 0; _soundCount = _soundIndex = 0; for (int idx = 0; idx < 10; ++idx) @@ -3944,13 +4047,13 @@ void Scene325::postInit(SceneObjectList *OwnerList) { void Scene325::synchronize(Serializer &s) { SceneExt::synchronize(s); - s.syncAsSint16LE(_field412); + s.syncAsSint16LE(_consoleAction); s.syncAsSint16LE(_iconFontNumber); - s.syncAsSint16LE(_field416); - s.syncAsSint16LE(_field418); - s.syncAsSint16LE(_field41A); - s.syncAsSint16LE(_field41C); - s.syncAsSint16LE(_field41E); + s.syncAsSint16LE(_databasePage); + s.syncAsSint16LE(_priorConsoleAction); + s.syncAsSint16LE(_moveCounter); + s.syncAsSint16LE(_yChange); + s.syncAsSint16LE(_yDirection); s.syncAsSint16LE(_scannerLocation); s.syncAsSint16LE(_soundCount); s.syncAsSint16LE(_soundIndex); @@ -3983,28 +4086,28 @@ void Scene325::signal() { case 1: _icon1.setup(160, 1, 1); _icon1.setPosition(Common::Point(65, 17)); - _icon1._object2.postInit(); - _icon1._object2.setup(160, 7, 1); - _icon1._object2.setPosition(Common::Point(106, 41)); + _icon1._horizLine.postInit(); + _icon1._horizLine.setup(160, 7, 1); + _icon1._horizLine.setPosition(Common::Point(106, 41)); _icon2.setup(160, 1, 1); _icon2.setPosition(Common::Point(80, 32)); - _icon2._object2.postInit(); - _icon2._object2.setup(160, 7, 2); - _icon2._object2.setPosition(Common::Point(106, 56)); + _icon2._horizLine.postInit(); + _icon2._horizLine.setup(160, 7, 2); + _icon2._horizLine.setPosition(Common::Point(106, 56)); _icon3.setup(160, 1, 1); _icon3.setPosition(Common::Point(65, 47)); - _icon3._object2.postInit(); - _icon3._object2.setup(160, 7, 1); - _icon3._object2.setPosition(Common::Point(106, 71)); + _icon3._horizLine.postInit(); + _icon3._horizLine.setup(160, 7, 1); + _icon3._horizLine.setPosition(Common::Point(106, 71)); _icon4.setup(160, 1, 1); _icon4.setPosition(Common::Point(80, 62)); _icon4._sceneRegionId = 5; - _icon4._object2.postInit(); - _icon4._object2.setup(160, 7, 2); - _icon4._object2.setPosition(Common::Point(106, 86)); + _icon4._horizLine.postInit(); + _icon4._horizLine.setup(160, 7, 2); + _icon4._horizLine.setPosition(Common::Point(106, 86)); _icon5.postInit(); _icon5.setup(160, 1, 1); @@ -4023,103 +4126,118 @@ void Scene325::signal() { R2_GLOBALS._player._canWalk = false; break; case 9: - switch (_field412) { + // Fade to black for console sub-section: database, or starchart + switch (_consoleAction) { case 3: + // Starchart _sceneMode = 129; - _object1.postInit(); - _object2.postInit(); - _object3.postInit(); + _starGrid1.postInit(); + _starGrid2.postInit(); + _starGrid3.postInit(); if (R2_GLOBALS.getFlag(13)) { - _object4.postInit(); - setAction(&_sequenceManager1, this, 130, &R2_GLOBALS._player, &_object1, - &_object2, &_object3, &_object4, NULL); + // Show starchart with Ringworld present + _starGrid4.postInit(); + setAction(&_sequenceManager1, this, 130, &R2_GLOBALS._player, &_starGrid1, + &_starGrid2, &_starGrid3, &_starGrid4, NULL); } else { - setAction(&_sequenceManager1, this, 129, &R2_GLOBALS._player, &_object1, - &_object2, &_object3, NULL); + // Show starchart without Ringworld + setAction(&_sequenceManager1, this, 129, &R2_GLOBALS._player, &_starGrid1, + &_starGrid2, &_starGrid3, NULL); } break; case 17: case 18: case 19: case 20: { - int v = 10 - ((21 - _field412) * 2); + int v = 10 - ((21 - _consoleAction) * 2); if (R2_GLOBALS.getFlag(50)) --v; - if (_field418 == 5) + if (_priorConsoleAction == 5) v += 8; + if (R2_GLOBALS.getFlag(51) && (v == 2)) R2_GLOBALS.setFlag(57); if (R2_GLOBALS.getFlag(44) && !R2_GLOBALS.getFlag(51)) { if (v != 13) { + if (_priorConsoleAction == 6) { + // Fix for original game bug. + // The passive short scan geographical and astronomical sentences + // are inverted in the original game. + if (v == 6) + v = 8; + else if (v == 8) + v = 6; + } + setMessage(328, v); } else { _scannerLocation = 864; - _object12.postInit(); - _object12.setup(326, 4, 1); - _object12.setPosition(Common::Point(149, 128)); - _object12.fixPriority(20); - - _scannerTab.postInit(); - _scannerTab.setup(326, 4, 2); - _scannerTab.setPosition(Common::Point(149, 22 + (int)(_scannerLocation * ADJUST_FACTOR))); - _scannerTab.fixPriority(21); - - _object10.postInit(); - _object10.setup(326, 1, 1); - _object10.setPosition(Common::Point(210, 20)); - _object10.fixPriority(10); - - _object1.postInit(); - _object1.setup(326, 1, 1); - _object1.setPosition(Common::Point(210, 32)); - _object1.fixPriority(10); - - _object2.postInit(); - _object2.setup(326, 1, 1); - _object2.setPosition(Common::Point(210, 44)); - _object2.fixPriority(10); - - _object3.postInit(); - _object3.setup(326, 1, 1); - _object3.setPosition(Common::Point(210, 56)); - _object3.fixPriority(10); - - _object4.postInit(); - _object4.setup(326, 1, 1); - _object4.setPosition(Common::Point(210, 68)); - _object4.fixPriority(10); - - _object5.postInit(); - _object5.setup(326, 1, 1); - _object5.setPosition(Common::Point(210, 80)); - _object5.fixPriority(10); - - _object6.postInit(); - _object6.setup(326, 1, 1); - _object6.setPosition(Common::Point(210, 92)); - _object6.fixPriority(10); - - _object7.postInit(); - _object7.setup(326, 1, 1); - _object7.setPosition(Common::Point(210, 104)); - _object7.fixPriority(10); - - _object8.postInit(); - _object8.setup(326, 1, 1); - _object8.setPosition(Common::Point(210, 116)); - _object8.fixPriority(10); - - _object9.postInit(); - _object9.setup(326, 1, 1); - _object9.setPosition(Common::Point(210, 128)); - _object9.fixPriority(10); - - _object11.postInit(); - _object11.setup(326, 1, 1); - _object11.setPosition(Common::Point(210, 150)); - _object11.fixPriority(10); + _starGrid12.postInit(); + _starGrid12.setup(326, 4, 1); + _starGrid12.setPosition(Common::Point(149, 128)); + _starGrid12.fixPriority(20); + + _starGrid13.postInit(); + _starGrid13.setup(326, 4, 2); + _starGrid13.setPosition(Common::Point(149, 22 + (int)(_scannerLocation * ADJUST_FACTOR))); + _starGrid13.fixPriority(21); + + _starGrid10.postInit(); + _starGrid10.setup(326, 1, 1); + _starGrid10.setPosition(Common::Point(210, 20)); + _starGrid10.fixPriority(10); + + _starGrid1.postInit(); + _starGrid1.setup(326, 1, 1); + _starGrid1.setPosition(Common::Point(210, 32)); + _starGrid1.fixPriority(10); + + _starGrid2.postInit(); + _starGrid2.setup(326, 1, 1); + _starGrid2.setPosition(Common::Point(210, 44)); + _starGrid2.fixPriority(10); + + _starGrid3.postInit(); + _starGrid3.setup(326, 1, 1); + _starGrid3.setPosition(Common::Point(210, 56)); + _starGrid3.fixPriority(10); + + _starGrid4.postInit(); + _starGrid4.setup(326, 1, 1); + _starGrid4.setPosition(Common::Point(210, 68)); + _starGrid4.fixPriority(10); + + _starGrid5.postInit(); + _starGrid5.setup(326, 1, 1); + _starGrid5.setPosition(Common::Point(210, 80)); + _starGrid5.fixPriority(10); + + _starGrid6.postInit(); + _starGrid6.setup(326, 1, 1); + _starGrid6.setPosition(Common::Point(210, 92)); + _starGrid6.fixPriority(10); + + _starGrid7.postInit(); + _starGrid7.setup(326, 1, 1); + _starGrid7.setPosition(Common::Point(210, 104)); + _starGrid7.fixPriority(10); + + _starGrid8.postInit(); + _starGrid8.setup(326, 1, 1); + _starGrid8.setPosition(Common::Point(210, 116)); + _starGrid8.fixPriority(10); + + _starGrid9.postInit(); + _starGrid9.setup(326, 1, 1); + _starGrid9.setPosition(Common::Point(210, 128)); + _starGrid9.fixPriority(10); + + _starGrid11.postInit(); + _starGrid11.setup(326, 1, 1); + _starGrid11.setPosition(Common::Point(210, 150)); + _starGrid11.fixPriority(10); } } else if (R2_GLOBALS.getFlag(51)) { setMessage(329, (v == 12) ? 10 : v); @@ -4131,41 +4249,42 @@ void Scene325::signal() { case 21: _sceneMode = 129; - _object1.postInit(); - _object1.setup(327, 1, 1); - _object1.setPosition(Common::Point(170, 80)); - _object1.fixPriority(10); - _object1.animate(ANIM_MODE_5, NULL); + _starGrid1.postInit(); + _starGrid1.setup(327, 1, 1); + _starGrid1.setPosition(Common::Point(170, 80)); + _starGrid1.fixPriority(10); + _starGrid1.animate(ANIM_MODE_5, NULL); break; case 22: _sceneMode = 129; - _object1.postInit(); - _object1.setup(327, 2, 1); - _object1.setPosition(Common::Point(160, 80)); - _object1.fixPriority(10); - _object1.animate(ANIM_MODE_5, NULL); + _starGrid1.postInit(); + _starGrid1.setup(327, 2, 1); + _starGrid1.setPosition(Common::Point(160, 80)); + _starGrid1.fixPriority(10); + _starGrid1.animate(ANIM_MODE_5, NULL); break; case 24: R2_GLOBALS._player.enableControl(); R2_GLOBALS._player._canWalk = false; - _field416 = 37; - setMessage(128, _field416); + _databasePage = 37; + setMessage(128, _databasePage); break; case 25: R2_GLOBALS._player.enableControl(); R2_GLOBALS._player._canWalk = false; - _field416 = 68; - setMessage(128, _field416); + _databasePage = 68; + setMessage(128, _databasePage); break; case 26: R2_GLOBALS._player.enableControl(); R2_GLOBALS._player._canWalk = false; - _field416 = 105; - setMessage(128, _field416); + _databasePage = 105; + setMessage(128, _databasePage); break; default: - _field416 = 0; + _databasePage = 0; + setMessage(128, _databasePage); break; } @@ -4176,7 +4295,7 @@ void Scene325::signal() { R2_GLOBALS._player.enableControl(); R2_GLOBALS._player._canWalk = false; - if ((_field412 >= 17) && (_field412 <= 20)) { + if ((_consoleAction >= 17) && (_consoleAction <= 20)) { _icon5.setIcon(8); consoleAction(4); } else { @@ -4197,12 +4316,12 @@ void Scene325::signal() { if (_soundCount) --_soundCount; - if (!_soundCount || (R2_GLOBALS._speechSubtitles == 2)) { + if (!_soundCount || !(R2_GLOBALS._speechSubtitles & SPEECH_VOICE)) { _soundIndex = 0; R2_GLOBALS._playStream.stop(); } else { _sceneMode = 15; - R2_GLOBALS._playStream.play(_soundQueue[_soundIndex], this); + R2_GLOBALS._playStream.play(_soundQueue[_soundIndex++], this); } break; default: @@ -4227,7 +4346,7 @@ void Scene325::consoleAction(int id) { if (id == 7) _icon5.setIcon(9); - else if ((_field412 != 3) && ((_field412 < 17) || (_field412 > 26))) + else if ((_consoleAction != 3) && ((_consoleAction < 17) || (_consoleAction > 26))) _icon5.setIcon(8); switch (id - 1) { @@ -4236,10 +4355,12 @@ void Scene325::consoleAction(int id) { _icon2.setIcon(11); break; case 1: + // Database screen _icon1.setIcon(23); _icon2.setIcon(24); _icon3.setIcon(25); _icon4.setIcon(26); + break; case 2: case 16: case 17: @@ -4253,13 +4374,13 @@ void Scene325::consoleAction(int id) { _icon2.hideIcon(); _icon3.hideIcon(); - if (id == 2 || (id == 19 && _field418 == 5 && R2_GLOBALS.getFlag(50) && + if (id == 2 || (id == 19 && _priorConsoleAction == 5 && R2_GLOBALS.getFlag(50) && R2_GLOBALS.getFlag(44) && !R2_GLOBALS.getFlag(51))) { _icon5.setIcon(13); _icon4.setPosition(Common::Point(52, 107)); _icon4._sceneRegionId = 9; _icon4.setIcon(14); - _icon4._object2.hide(); + _icon4._horizLine.hide(); } else { _icon4.hideIcon(); @@ -4269,16 +4390,17 @@ void Scene325::consoleAction(int id) { _icon6.setIcon(12); _sceneMode = 10; _palette.loadPalette(161); - BF_GLOBALS._scenePalette.addFader(&_palette._palette[0], 256, 5, this); + R2_GLOBALS._scenePalette.addFader(&_palette._palette[0], 256, 5, this); break; case 22: case 23: case 24: case 25: + // Database sub-sections: A-G, N-O, P-S, T-Z R2_GLOBALS._player.disableControl(); consoleAction(2); - _field412 = id; + _consoleAction = id; _icon1.hideIcon(); _icon2.hideIcon(); _icon3.hideIcon(); @@ -4288,12 +4410,12 @@ void Scene325::consoleAction(int id) { _icon4.setPosition(Common::Point(52, 107)); _icon4._sceneRegionId = 9; _icon4.setIcon(14); - _icon4._object2.hide(); + _icon4._horizLine.hide(); _icon6.setIcon(12); _sceneMode = 10; _palette.loadPalette(161); - BF_GLOBALS._scenePalette.addFader(&_palette._palette[0], 256, 5, this); + R2_GLOBALS._scenePalette.addFader(&_palette._palette[0], 256, 5, this); break; case 11: @@ -4311,24 +4433,25 @@ void Scene325::consoleAction(int id) { _icon4._sceneRegionId = 5; _icon4.hideIcon(); - _object12.remove(); - _scannerTab.remove(); - _object10.remove(); - _object1.remove(); - _object2.remove(); - _object3.remove(); - _object4.remove(); - _object5.remove(); - _object6.remove(); - _object7.remove(); - _object8.remove(); - _object9.remove(); - _object11.remove(); + R2_GLOBALS._player.hide(); + _starGrid1.remove(); + _starGrid2.remove(); + _starGrid3.remove(); + _starGrid4.remove(); + _starGrid5.remove(); + _starGrid6.remove(); + _starGrid7.remove(); + _starGrid8.remove(); + _starGrid9.remove(); + _starGrid10.remove(); + _starGrid11.remove(); + _starGrid12.remove(); + _starGrid13.remove(); _palette.loadPalette(160); _sceneMode = 11; - BF_GLOBALS._scenePalette.addFader(&_palette._palette[0], 256, 5, this); + R2_GLOBALS._scenePalette.addFader(&_palette._palette[0], 256, 5, this); } break; @@ -4339,63 +4462,74 @@ void Scene325::consoleAction(int id) { break; case 4: case 5: - _field418 = id; + _priorConsoleAction = id; _icon1.setIcon(17); _icon2.setIcon(18); _icon3.setIcon(19); _icon4.setIcon(20); break; case 7: - consoleAction(((_field412 == 5) || (_field412 == 6) || (_field412 == 15)) ? 4 : 7); + consoleAction(((_consoleAction == 5) || (_consoleAction == 6) || (_consoleAction == 15)) ? 4 : 7); break; case 8: R2_GLOBALS._sceneManager.changeScene(300); + break; case 9: case 10: + // Set language: Interworld or Hero's Tongue _iconFontNumber = (id - 1) == 9 ? 50 : 52; _text1.remove(); _icon6.setIcon(7); + consoleAction(1); break; case 12: + // Page up button _icon4.setIcon(14); - _icon4._object2.hide(); + _icon4._horizLine.hide(); - switch (_field412) { + switch (_consoleAction) { case 17: case 18: case 19: case 20: if (_scannerLocation) { R2_GLOBALS._player.disableControl(); - _field41A = 1296; - _field41E = 1; + _moveCounter = 1296; + _yDirection = 1; } break; default: - setMessage(128, --_field416); + setMessage(128, --_databasePage); break; } return; case 13: + // Page down button _icon4.setIcon(14); - _icon4._object2.hide(); + _icon4._horizLine.hide(); - switch (_field412) { + switch (_consoleAction) { case 17: case 18: case 19: case 20: if (_scannerLocation < 1620) { R2_GLOBALS._player.disableControl(); - _field41A = 1296; - _field41E = -1; + _moveCounter = 1296; + _yDirection = -1; } break; + default: + setMessage(128, ++_databasePage); + break; } return; case 14: if (R2_GLOBALS.getFlag(55)) { - SceneItem::display2(329, 17); + consoleAction(4); + // Workaround for original game bug. + // Empty message crashing the game. It should be a warning message forbidding to switch to active scan + // SceneItem::display2(329, 17); } else { R2_GLOBALS.setFlag(50); consoleAction(4); @@ -4409,6 +4543,7 @@ void Scene325::consoleAction(int id) { break; case 6: default: + // Initial starting screen _icon1.setIcon(1); _icon2.setIcon(2); _icon3.setIcon(3); @@ -4418,7 +4553,7 @@ void Scene325::consoleAction(int id) { } if (id != 8) - _field412 = id; + _consoleAction = id; } void Scene325::process(Event &event) { @@ -4435,48 +4570,48 @@ void Scene325::process(Event &event) { } void Scene325::dispatch() { - if (_field41A) { - switch (_field41A) { + if (_moveCounter) { + switch (_moveCounter) { case 13: - _field41C = 1; + _yChange = 1; break; case 1296: R2_GLOBALS._sound3.play(87); - _field41C = 1; + _yChange = 1; break; case 33: case 1283: - _field41C = 2; + _yChange = 2; break; case 63: case 1263: - _field41C = 3; + _yChange = 3; break; case 103: case 1233: - _field41C = 4; + _yChange = 4; break; case 153: case 1193: - _field41C = 5; + _yChange = 5; break; case 213: case 1143: - _field41C = 6; + _yChange = 6; break; case 283: case 1083: - _field41C = 7; + _yChange = 7; break; case 1013: - _field41C = 8; + _yChange = 8; break; default: break; } - _field41A -= _field41C; - int yp = _field41E * _field41C + _object10._position.y; + _moveCounter -= _yChange; + int yp = _yDirection * _yChange + _starGrid10._position.y; bool flag = false; if (yp >= 30) { @@ -4489,51 +4624,51 @@ void Scene325::dispatch() { ++_scannerLocation; flag = true; } - _scannerTab.setPosition(Common::Point(149, 22 + (int)(_scannerLocation * ADJUST_FACTOR))); + _starGrid13.setPosition(Common::Point(149, 22 + (int)(_scannerLocation * ADJUST_FACTOR))); for (int idx = 0; idx < 4; ++idx) _objList[idx].remove(); if (flag) { int v = _scannerLocation - 758; - _object10.setFrame((v++ <= 0) ? 1 : v); - _object1.setFrame((v++ <= 0) ? 1 : v); - _object2.setFrame((v++ <= 0) ? 1 : v); - _object3.setFrame((v++ <= 0) ? 1 : v); - _object4.setFrame((v++ <= 0) ? 1 : v); - _object5.setFrame((v++ <= 0) ? 1 : v); - _object6.setFrame((v++ <= 0) ? 1 : v); - _object7.setFrame((v++ <= 0) ? 1 : v); - _object8.setFrame((v++ <= 0) ? 1 : v); - _object9.setFrame((v++ <= 0) ? 1 : v); - _object11.setFrame((v++ <= 0) ? 1 : v); - } - - _object10.setPosition(Common::Point(210, yp)); + _starGrid10.setFrame((v++ <= 0) ? 1 : v); + _starGrid1.setFrame((v++ <= 0) ? 1 : v); + _starGrid2.setFrame((v++ <= 0) ? 1 : v); + _starGrid3.setFrame((v++ <= 0) ? 1 : v); + _starGrid4.setFrame((v++ <= 0) ? 1 : v); + _starGrid5.setFrame((v++ <= 0) ? 1 : v); + _starGrid6.setFrame((v++ <= 0) ? 1 : v); + _starGrid7.setFrame((v++ <= 0) ? 1 : v); + _starGrid8.setFrame((v++ <= 0) ? 1 : v); + _starGrid9.setFrame((v++ <= 0) ? 1 : v); + _starGrid11.setFrame((v++ <= 0) ? 1 : v); + } + + _starGrid10.setPosition(Common::Point(210, yp)); yp += 12; - _object1.setPosition(Common::Point(210, yp)); + _starGrid1.setPosition(Common::Point(210, yp)); yp += 12; - _object2.setPosition(Common::Point(210, yp)); + _starGrid2.setPosition(Common::Point(210, yp)); yp += 12; - _object3.setPosition(Common::Point(210, yp)); + _starGrid3.setPosition(Common::Point(210, yp)); yp += 12; - _object4.setPosition(Common::Point(210, yp)); + _starGrid4.setPosition(Common::Point(210, yp)); yp += 12; - _object5.setPosition(Common::Point(210, yp)); + _starGrid5.setPosition(Common::Point(210, yp)); yp += 12; - _object6.setPosition(Common::Point(210, yp)); + _starGrid6.setPosition(Common::Point(210, yp)); yp += 12; - _object7.setPosition(Common::Point(210, yp)); + _starGrid7.setPosition(Common::Point(210, yp)); yp += 12; - _object8.setPosition(Common::Point(210, yp)); + _starGrid8.setPosition(Common::Point(210, yp)); yp += 12; - _object9.setPosition(Common::Point(210, yp)); + _starGrid9.setPosition(Common::Point(210, yp)); yp += 12; - _object11.setPosition(Common::Point(210, yp)); + _starGrid11.setPosition(Common::Point(210, yp)); - if (!_field41A) { + if (!_moveCounter) { R2_GLOBALS._sound3.stop(); - _field41C = 0; + _yChange = 0; if (_scannerLocation == 756) { R2_GLOBALS._player.disableControl(); @@ -4551,9 +4686,11 @@ void Scene325::dispatch() { } void Scene325::setMessage(int resNum, int lineNum) { - Common::String msg = g_resourceManager->getMessage(resNum, lineNum); + removeText(); + Common::String msg = g_resourceManager->getMessage(resNum, lineNum, true); if (!msg.empty()) { + // Found valid database entry to display Common::String msgText = parseMessage(msg); _text1._fontNumber = _iconFontNumber; @@ -4566,12 +4703,14 @@ void Scene325::setMessage(int resNum, int lineNum) { R2_GLOBALS._sceneObjects->draw(); - if ((_soundCount != 0) && (R2_GLOBALS._speechSubtitles != 2)) { + if ((_soundCount != 0) && (R2_GLOBALS._speechSubtitles & SPEECH_VOICE)) { _sceneMode = 15; R2_GLOBALS._playStream.play(_soundQueue[_soundIndex++], this); } } else { - _field412 = 13; + // No message for given database index, so we must have passed beyond + // the start or end of the database + _consoleAction = 13; R2_GLOBALS._player.disableControl(); R2_GLOBALS._player.hide(); @@ -4581,7 +4720,7 @@ void Scene325::setMessage(int resNum, int lineNum) { _palette.loadPalette(160); _sceneMode = 11; - BF_GLOBALS._scenePalette.addFader(&_palette._palette[0], 256, 5, this); + R2_GLOBALS._scenePalette.addFader(&_palette._palette[0], 256, 5, this); } } @@ -4603,15 +4742,16 @@ Common::String Scene325::parseMessage(const Common::String &msg) { return Common::String(msgP); } + /*-------------------------------------------------------------------------- * Scene 400 - Science Lab * *--------------------------------------------------------------------------*/ bool Scene400::Terminal::startAction(CursorType action, Event &event) { - Scene400 *scene = (Scene400 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_USE) { + Scene400 *scene = (Scene400 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 402; scene->setAction(&scene->_sequenceManager1, scene, 402, &R2_GLOBALS._player, this, NULL); @@ -4625,9 +4765,9 @@ bool Scene400::Terminal::startAction(CursorType action, Event &event) { /*--------------------------------------------------------------------------*/ bool Scene400::Door::startAction(CursorType action, Event &event) { - Scene400 *scene = (Scene400 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_USE) { + Scene400 *scene = (Scene400 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 401; scene->setAction(&scene->_sequenceManager1, scene, 401, &R2_GLOBALS._player, this, NULL); @@ -4639,9 +4779,9 @@ bool Scene400::Door::startAction(CursorType action, Event &event) { } bool Scene400::Reader::startAction(CursorType action, Event &event) { - Scene400 *scene = (Scene400 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_USE) { + Scene400 *scene = (Scene400 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 405; scene->setAction(&scene->_sequenceManager1, scene, 405, &R2_GLOBALS._player, this, NULL); @@ -4653,9 +4793,9 @@ bool Scene400::Reader::startAction(CursorType action, Event &event) { } bool Scene400::SensorProbe::startAction(CursorType action, Event &event) { - Scene400 *scene = (Scene400 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_USE) { + Scene400 *scene = (Scene400 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 404; scene->setAction(&scene->_sequenceManager1, scene, 404, &R2_GLOBALS._player, this, NULL); @@ -4667,9 +4807,9 @@ bool Scene400::SensorProbe::startAction(CursorType action, Event &event) { } bool Scene400::AttractorUnit::startAction(CursorType action, Event &event) { - Scene400 *scene = (Scene400 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_USE) { + Scene400 *scene = (Scene400 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 406; scene->setAction(&scene->_sequenceManager1, scene, 406, &R2_GLOBALS._player, this, NULL); @@ -4849,9 +4989,9 @@ Scene500::PanelDialog::Button::Button() { } bool Scene500::ControlPanel::startAction(CursorType action, Event &event) { - Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; - if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == R2_QUINN)) { + Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); if (R2_GLOBALS.getFlag(26)) { @@ -4871,9 +5011,9 @@ bool Scene500::ControlPanel::startAction(CursorType action, Event &event) { /*--------------------------------------------------------------------------*/ bool Scene500::Seeker::startAction(CursorType action, Event &event) { - Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_TALK) { + Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); if (R2_GLOBALS._player._characterIndex == R2_QUINN) { scene->_stripNumber = R2_GLOBALS.getFlag(26) ? 1101 : 1103; @@ -4944,9 +5084,9 @@ bool Scene500::Suit::startAction(CursorType action, Event &event) { } bool Scene500::Doorway::startAction(CursorType action, Event &event) { - Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; - if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == R2_QUINN)) { + Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); if (R2_GLOBALS.getFlag(26)) { @@ -4965,8 +5105,6 @@ bool Scene500::Doorway::startAction(CursorType action, Event &event) { } bool Scene500::OxygenTanks::startAction(CursorType action, Event &event) { - Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; - switch (action) { case CURSOR_LOOK: SceneItem::display2(500, R2_INVENTORY.getObjectScene(R2_REBREATHER_TANK) ? 50 : 49); @@ -4978,6 +5116,8 @@ bool Scene500::OxygenTanks::startAction(CursorType action, Event &event) { return true; } else if ((R2_INVENTORY.getObjectScene(R2_REBREATHER_TANK) != 1) && (R2_GLOBALS._player._characterIndex != R2_SEEKER) && !R2_GLOBALS.getFlag(28)) { + Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); if (_position.y == 120) { @@ -5001,9 +5141,9 @@ bool Scene500::OxygenTanks::startAction(CursorType action, Event &event) { } bool Scene500::AirLock::startAction(CursorType action, Event &event) { - Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; - if ((action == CURSOR_USE) && R2_GLOBALS.getFlag(26)) { + Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = (R2_GLOBALS._player._characterIndex == R2_QUINN) ? 521 : 522; scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, @@ -5048,9 +5188,9 @@ void Scene500::TransparentDoor::draw() { } bool Scene500::Aerosol::startAction(CursorType action, Event &event) { - Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_USE) { + Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 503; scene->setAction(&scene->_sequenceManager1, scene, 503, &R2_GLOBALS._player, this, NULL); @@ -5061,9 +5201,9 @@ bool Scene500::Aerosol::startAction(CursorType action, Event &event) { } bool Scene500::SonicStunner::startAction(CursorType action, Event &event) { - Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; - if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == R2_QUINN)) { + Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = R2_GLOBALS.getFlag(26) ? 520 : 502; scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, this, NULL); @@ -5074,9 +5214,9 @@ bool Scene500::SonicStunner::startAction(CursorType action, Event &event) { } bool Scene500::Locker1::startAction(CursorType action, Event &event) { - Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; - if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == R2_QUINN)) { + Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); if (R2_GLOBALS.getFlag(11)) @@ -5092,9 +5232,9 @@ bool Scene500::Locker1::startAction(CursorType action, Event &event) { } bool Scene500::Locker2::startAction(CursorType action, Event &event) { - Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; - if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == R2_QUINN)) { + Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); if (R2_GLOBALS.getFlag(12)) @@ -5111,7 +5251,7 @@ bool Scene500::Locker2::startAction(CursorType action, Event &event) { /*--------------------------------------------------------------------------*/ -void Scene500::PanelDialog::setDetails(int visage, int strip, int frameNumber, +void Scene500::PanelDialog::setDetails(int visage, int strip, int frameNumber, const Common::Point &pt) { SceneAreaObject::setDetails(visage, strip, frameNumber, pt); SceneAreaObject::setDetails(500, 43, 32, 45); @@ -5122,7 +5262,7 @@ void Scene500::PanelDialog::setDetails(int visage, int strip, int frameNumber, } void Scene500::PanelDialog::remove() { - Scene500 *scene = (Scene500 *)BF_GLOBALS._sceneManager._scene; + Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; scene->_sceneAreas.remove(&_button1); scene->_sceneAreas.remove(&_button2); scene->_sceneAreas.remove(&_button3); @@ -5167,7 +5307,7 @@ void Scene500::PanelDialog::Button::setupButton(int buttonId) { break; } - Scene500 *scene = (Scene500 *)BF_GLOBALS._sceneManager._scene; + Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; scene->_sceneAreas.push_front(this); } @@ -5179,7 +5319,7 @@ void Scene500::PanelDialog::Button::synchronize(Serializer &s) { } void Scene500::PanelDialog::Button::process(Event &event) { - if ((event.eventType == EVENT_BUTTON_DOWN) && + if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_USE) && _bounds.contains(event.mousePos) && !_buttonDown) { _buttonDown = true; @@ -5197,11 +5337,11 @@ void Scene500::PanelDialog::Button::process(Event &event) { } void Scene500::PanelDialog::Button::doButtonPress() { - Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; - if (R2_GLOBALS.getFlag(28)) { SceneItem::display2(500, 48); } else { + Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = _buttonId; @@ -5232,10 +5372,10 @@ void Scene500::PanelDialog::Button::doButtonPress() { &scene->_suit, &scene->_transparentDoor, NULL); } else { scene->_sound1.play(127); - scene->_suits.animate(ANIM_MODE_6, scene); + scene->_suits.animate(ANIM_MODE_5, scene); } break; - + case 3: if (R2_GLOBALS.getFlag(35)) { scene->_sceneMode = 509; @@ -5244,12 +5384,12 @@ void Scene500::PanelDialog::Button::doButtonPress() { } else { scene->_suit.postInit(); scene->_suit.hide(); - scene->_suit._effect = 1; + scene->_suit._effect = EFFECT_SHADED; scene->_suit.setDetails(500, -1, -1, -1, 2, (SceneItem *)NULL); scene->_suit.setup(502, R2_GLOBALS._landerSuitNumber + 2, 1); scene->setAction(&scene->_sequenceManager1, scene, 508, - &R2_GLOBALS._player, &scene->_suits, &scene->_suit, + &R2_GLOBALS._player, &scene->_suits, &scene->_suit, &scene->_transparentDoor, NULL); R2_GLOBALS.setFlag(35); } @@ -5279,14 +5419,14 @@ void Scene500::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._walkRegions.enableRegion(1); _seeker.postInit(); - _seeker._effect = 1; + _seeker._effect = EFFECT_SHADED; _seeker.setup(1505, 1, 1); _seeker._moveDiff.x = 5; _seeker.setPosition(Common::Point(42, 151)); _seeker.setDetails(500, 34, 35, 36, 1, (SceneItem *)NULL); } else if (R2_GLOBALS._player._characterScene[R2_QUINN] == 500) { _seeker.postInit(); - _seeker._effect = 1; + _seeker._effect = EFFECT_SHADED; _seeker.setup(R2_GLOBALS.getFlag(26) ? 1500 : 10, 1, 1); _seeker.setPosition(Common::Point(42, 151)); @@ -5361,7 +5501,7 @@ void Scene500::postInit(SceneObjectList *OwnerList) { } _suits.postInit(); - _suits._effect = 1; + _suits._effect = EFFECT_SHADED; _suits.setup(502, 1, 1); _suits.setPosition(Common::Point(258, 99)); _suits.fixPriority(50); @@ -5375,7 +5515,7 @@ void Scene500::postInit(SceneObjectList *OwnerList) { _transparentDoor.setup(500, 8, 7); _suit.postInit(); - _suit._effect = 1; + _suit._effect = EFFECT_SHADED; _suit.setPosition(Common::Point(247, 52)); _suit.setDetails(500, -1, -1, -1, 2, (SceneItem *)NULL); @@ -5548,7 +5688,7 @@ void Scene525::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._sound1.play(105); _actor1.postInit(); - _actor1._effect = 1; + _actor1._effect = EFFECT_SHADED; R2_GLOBALS._player.postInit(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); @@ -5570,7 +5710,7 @@ bool Scene600::CompartmentHotspot::startAction(CursorType action, Event &event) if ((action != R2_NEGATOR_GUN) || (!R2_GLOBALS.getFlag(5)) || (R2_GLOBALS.getFlag(8))) return SceneHotspot::startAction(action, event); - SceneItem::display(600, 32, SET_WIDTH, 280, SET_X, 160, SET_POS_MODE, ALIGN_CENTER, + SceneItem::display(600, 32, SET_WIDTH, 280, SET_X, 160, SET_POS_MODE, ALIGN_CENTER, SET_Y, 20, SET_EXT_BGCOLOR, 7, LIST_END); return true; } @@ -5580,13 +5720,13 @@ bool Scene600::EngineCompartment::startAction(CursorType action, Event &event) { return SceneHotspot::startAction(action, event); if ((R2_GLOBALS.getFlag(5)) && (!R2_GLOBALS.getFlag(8))) { - SceneItem::display(600, 32, SET_WIDTH, 280, SET_X, 160, SET_POS_MODE, ALIGN_CENTER, + SceneItem::display(600, 32, SET_WIDTH, 280, SET_X, 160, SET_POS_MODE, ALIGN_CENTER, SET_Y, 20, SET_EXT_BGCOLOR, 7, LIST_END); return true; } if (!R2_GLOBALS.getFlag(5)) { - SceneItem::display(600, 30, SET_WIDTH, 280, SET_X, 160, SET_POS_MODE, ALIGN_CENTER, + SceneItem::display(600, 30, SET_WIDTH, 280, SET_X, 160, SET_POS_MODE, ALIGN_CENTER, SET_Y, 20, SET_EXT_BGCOLOR, 7, LIST_END); return true; } @@ -5597,19 +5737,19 @@ bool Scene600::EngineCompartment::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); Scene600 *scene = (Scene600 *)R2_GLOBALS._sceneManager._scene; - + scene->_stasisArea.setup(603, 3, 1, 239, 54, 10); scene->_stasisField.postInit(); scene->_computer.postInit(); scene->_sceneMode = 612; scene->setAction(&scene->_sequenceManager1, scene, 612, &scene->_stasisField, &scene->_computer, &R2_GLOBALS._player, NULL); - + // WORKAROUND: For ScummVM, we use a SceneActor rather than BackgroundSceneObject // for the stasis field since it doesn't work properly. We override the priority for // the stasis field here so that the stasis field dissolve will show up scene->_stasisField.fixPriority(12); - + return true; } @@ -5628,24 +5768,47 @@ bool Scene600::Smoke::startAction(CursorType action, Event &event) { return false; } -GfxSurface Scene600::Smoke::getFrame() { - GfxSurface frame = SceneActor::getFrame(); +void Scene600::Smoke::draw() { + // Effect should always be active on smoke, but since the original had this + // check, include it here too + if (_effect == EFFECT_NONE) { + SceneActor::draw(); + return; + } - if (_effect) { - // Translate the frame using the scene's pixel map - byte *pixelMap = static_cast<Scene600 *>(R2_GLOBALS._sceneManager._scene)->_pixelMap; - Graphics::Surface surface = frame.lockSurface(); - byte *srcP = (byte *)surface.getPixels(); + // Determine the area of the screen to be updated + Rect destRect = _bounds; + destRect.translate(-g_globals->_sceneManager._scene->_sceneBounds.left, + -g_globals->_sceneManager._scene->_sceneBounds.top); - while (srcP < ((byte *)surface.getBasePtr(0, surface.h))) { - *srcP = pixelMap[*srcP]; - srcP++; - } + // Get the smoke frame, screen reference, and pixel palette translation map + GfxSurface frame = getFrame(); + Graphics::Surface s = frame.lockSurface(); + Graphics::Surface screen = g_globals->gfxManager().getSurface().lockSurface(); + byte *pixelMap = static_cast<Scene600 *>(R2_GLOBALS._sceneManager._scene)->_pixelMap; - frame.unlockSurface(); + // Loop through every pixel of the frame. Any pixel of the frame that's not a + // tranparency, get the same pixel from the screen background, and shade it using + // the scene's pixel translation map + for (int yp = 0; yp < s.h; ++yp) { + byte *frameSrcP = (byte *)s.getBasePtr(0, yp); + byte *screenP = (byte *)screen.getBasePtr(destRect.left, destRect.top + yp); + + for (int xp = 0; xp < s.w; ++xp, ++frameSrcP, ++screenP) { + if (*frameSrcP != frame._transColor) { + *frameSrcP = pixelMap[*screenP]; + } + } } - return frame; + // Finished updating the frame + frame.unlockSurface(); + g_globals->gfxManager().getSurface().unlockSurface(); + + // Draw the processed frame + Region *priorityRegion = g_globals->_sceneManager._scene->_priorities.find(_priority); + g_globals->gfxManager().copyFrom(frame, destRect, priorityRegion); + } bool Scene600::Doorway::startAction(CursorType action, Event &event) { @@ -5678,7 +5841,7 @@ bool Scene600::Doorway::startAction(CursorType action, Event &event) { } if ((R2_GLOBALS.getFlag(9)) && (R2_INVENTORY.getObjectScene(R2_COM_SCANNER) == 600)) - SceneItem::display(600, 31, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(600, 31, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); else { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 601; @@ -5696,7 +5859,7 @@ bool Scene600::Laser::startAction(CursorType action, Event &event) { // If laser is destroyed if (R2_GLOBALS.getFlag(6)) { if (R2_GLOBALS.getFlag(8)) { - SceneItem::display(600, 29, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(600, 29, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); return true; } else { R2_GLOBALS._player.disableControl(); @@ -5712,7 +5875,7 @@ bool Scene600::Laser::startAction(CursorType action, Event &event) { break; case R2_AEROSOL: if (R2_GLOBALS.getFlag(5)) { - SceneItem::display(600, 28, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(600, 28, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); return true; } else { R2_GLOBALS._player.disableControl(); @@ -5721,7 +5884,7 @@ bool Scene600::Laser::startAction(CursorType action, Event &event) { scene->_smoke.postInit(); scene->_smoke.setup(601, 3, 1); - scene->_smoke._effect = 3; + scene->_smoke._effect = EFFECT_SMOKE; scene->_smoke._moveDiff = Common::Point(1, 1); scene->_smoke._moveRate = 2; scene->_smoke._numFrames = 3; @@ -5762,13 +5925,13 @@ bool Scene600::Laser::startAction(CursorType action, Event &event) { } bool Scene600::Aerosol::startAction(CursorType action, Event &event) { - Scene600 *scene = (Scene600 *)R2_GLOBALS._sceneManager._scene; - // Only action cursors if (action < CURSOR_WALK) return false; if (action == CURSOR_USE) { + Scene600 *scene = (Scene600 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 614; scene->setAction(&scene->_sequenceManager1, scene, 614, &R2_GLOBALS._player, &scene->_aerosol, NULL); @@ -5902,7 +6065,7 @@ void Scene600::postInit(SceneObjectList *OwnerList) { _smoke._numFrames = 3; _smoke.animate(ANIM_MODE_2, NULL); _smoke.fixPriority(130); - _smoke._effect = 3; + _smoke._effect = EFFECT_SMOKE; _smoke.setDetails(600, 24, 25, 26, 1, (SceneItem *) NULL); _smoke.signal(); } @@ -5973,7 +6136,7 @@ void Scene600::signal() { R2_INVENTORY.setObjectScene(R2_AEROSOL, 600); R2_GLOBALS.setFlag(5); - _smoke._effect = 3; + _smoke._effect = EFFECT_SMOKE; _smoke.signal(); break; case 606: @@ -6002,6 +6165,7 @@ void Scene600::signal() { R2_GLOBALS._sceneItems.remove(&_engineCompartment); _computer.setDetails(600, 21, -1, 23, 4, &_engineCompartment); _engineCompartment.setDetails(600, 7, -1, -1, 3, (SceneItem *) NULL); + _quantumDrive._lookLineNum = 7; R2_GLOBALS._player.enableControl(CURSOR_USE); break; case 614: @@ -6026,7 +6190,7 @@ void Scene600::signal() { } void Scene600::process(Event &event) { - if (R2_GLOBALS._player._canWalk && (!R2_GLOBALS.getFlag(6)) && (event.eventType == EVENT_BUTTON_DOWN) + if (R2_GLOBALS._player._canWalk && (!R2_GLOBALS.getFlag(6)) && (event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_WALK)) { if (!_doorway.contains(event.mousePos) || (_doorway._frame <= 1)) { if (R2_GLOBALS.getFlag(5)) { @@ -6081,6 +6245,9 @@ void Scene600::dispatch() { * *--------------------------------------------------------------------------*/ +#define CABLE700_X 26 +#define CABLE700_Y -5 + Scene700::Scene700() { _rotation = NULL; } @@ -6129,14 +6296,14 @@ bool Scene700::HandGrip::startAction(CursorType action, Event &event) { } bool Scene700::LiftDoor::startAction(CursorType action, Event &event) { - Scene700 *scene = (Scene700 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); if (R2_GLOBALS._player._position.y <= 100) return false; + Scene700 *scene = (Scene700 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 701; scene->setAction(&scene->_sequenceManager, scene, 701, &R2_GLOBALS._player, this, NULL); @@ -6145,14 +6312,14 @@ bool Scene700::LiftDoor::startAction(CursorType action, Event &event) { } bool Scene700::SuitRoomDoor::startAction(CursorType action, Event &event) { - Scene700 *scene = (Scene700 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); if (R2_GLOBALS._player._position.y <= 100) return false; + Scene700 *scene = (Scene700 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 702; scene->setAction(&scene->_sequenceManager, scene, 702, &R2_GLOBALS._player, this, NULL); @@ -6161,14 +6328,14 @@ bool Scene700::SuitRoomDoor::startAction(CursorType action, Event &event) { } bool Scene700::ControlPanel::startAction(CursorType action, Event &event) { - Scene700 *scene = (Scene700 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); if (R2_GLOBALS._player._position.y <= 100) return false; + Scene700 *scene = (Scene700 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 704; scene->setAction(&scene->_sequenceManager, scene, 704, &R2_GLOBALS._player, this, NULL); @@ -6229,11 +6396,11 @@ bool Scene700::Cable::startAction(CursorType action, Event &event) { } bool Scene700::LoftDoor::startAction(CursorType action, Event &event) { - Scene700 *scene = (Scene700 *)R2_GLOBALS._sceneManager._scene; - if ((action != CURSOR_USE) || (R2_GLOBALS._player._position.y >= 100)) return SceneActor::startAction(action, event); + Scene700 *scene = (Scene700 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 1; Common::Point pt(_position.x, 69); @@ -6247,8 +6414,6 @@ void Scene700::postInit(SceneObjectList *OwnerList) { loadScene(700); if (R2_GLOBALS._sceneManager._previousScene == 900) _sceneBounds = Rect(160, 0, 480, 200); - - R2_GLOBALS._v558B6.set(60, 0, 260, 200); SceneExt::postInit(); _rotation = R2_GLOBALS._scenePalette.addRotation(237, 246, -1); @@ -6306,7 +6471,7 @@ void Scene700::postInit(SceneObjectList *OwnerList) { break; case 700: _cable.setup(701, 3, 1); - _cable.setPosition(Common::Point(356 - (R2_GLOBALS._v565EB * 8), 148 - (((R2_GLOBALS._v565E9 + 10) / 5) * 4))); + _cable.setPosition(Common::Point(356 - (CABLE700_X * 8), 148 - (((CABLE700_Y + 10) / 5) * 4))); _cable.setDetails(700, 37, -1, -1, 1, (SceneItem *) NULL); break; default: @@ -6316,7 +6481,7 @@ void Scene700::postInit(SceneObjectList *OwnerList) { case 700: switch (R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS)) { case 0: - if ((R2_GLOBALS._v565E5 != 0) && (R2_GLOBALS._electromagnetChangeAmount == 20) && (R2_GLOBALS._electromagnetZoom == 70)) + if (R2_GLOBALS._tractorField && (R2_GLOBALS._electromagnetChangeAmount == 20) && (R2_GLOBALS._electromagnetZoom == 70)) _cable.setup(701, 2, 1); else _cable.setup(701, 2, 8); @@ -6326,8 +6491,8 @@ void Scene700::postInit(SceneObjectList *OwnerList) { break; case 700: _cable.setup(701, 1, 8); - if (R2_GLOBALS._v565E7 == 0) { - _cable.setPosition(Common::Point(356 - (R2_GLOBALS._v565EB * 8), 148 - (((R2_GLOBALS._v565E9 + 10) / 5) * 4))); + if (!R2_GLOBALS._cableAttached) { + _cable.setPosition(Common::Point(356 - (CABLE700_X * 8), 148 - (((CABLE700_Y + 10) / 5) * 4))); } else { _cable.setup(701, 1, 1); _cable.setPosition(Common::Point(_electromagnet._position.x + 1, _electromagnet._position.y + 120)); @@ -6413,7 +6578,7 @@ void Scene700::signal() { _sceneMode = 2; R2_GLOBALS._player.setStrip(4); if (R2_GLOBALS._player._position.x != 164) { - SceneItem::display(700, 36, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(700, 36, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); R2_GLOBALS._player.enableControl(); } else { R2_GLOBALS._sound2.play(19); @@ -6475,12 +6640,12 @@ void Scene700::signal() { _sceneMode = 17; _cable.setup(701, 1, 8); _cable.setDetails(700, 38, -1, -1, 3, (SceneItem *) NULL); - if ((R2_GLOBALS._v565E5 != 0) && (_cable._position.x == _electromagnet._position.x + 1) && (_cable._position.x == 148 - (((R2_GLOBALS._electromagnetChangeAmount + 10) / 5) * 4))) { + if (R2_GLOBALS._tractorField && (_cable._position.x == _electromagnet._position.x + 1) && (_cable._position.x == 148 - (((R2_GLOBALS._electromagnetChangeAmount + 10) / 5) * 4))) { _cable.animate(ANIM_MODE_6, NULL); Common::Point pt(_cable._position.x, _electromagnet._position.y + 120); NpcMover *mover = new NpcMover(); _cable.addMover(mover, &pt, NULL); - R2_GLOBALS._v565E7 = 1; + R2_GLOBALS._cableAttached = true; } R2_GLOBALS._player.animate(ANIM_MODE_6, this); break; @@ -6500,7 +6665,7 @@ void Scene700::signal() { break; case 21: _cable.fixPriority(77); - if ((R2_GLOBALS._v565E5 != 0) && (R2_GLOBALS._electromagnetChangeAmount == 20) && (R2_GLOBALS._electromagnetZoom == 70)) + if (R2_GLOBALS._tractorField && (R2_GLOBALS._electromagnetChangeAmount == 20) && (R2_GLOBALS._electromagnetZoom == 70)) _cable.animate(ANIM_MODE_6, NULL); R2_INVENTORY.setObjectScene(R2_ATTRACTOR_CABLE_HARNESS, 700); @@ -6518,7 +6683,7 @@ void Scene700::signal() { case 706: _cable.setDetails(700, 38, -1, -1, 3, (SceneItem *) NULL); _cable.fixPriority(77); - if ((R2_GLOBALS._v565E5 != 0) && (R2_GLOBALS._electromagnetChangeAmount == 20) && (R2_GLOBALS._electromagnetZoom == 70)) + if (R2_GLOBALS._tractorField && (R2_GLOBALS._electromagnetChangeAmount == 20) && (R2_GLOBALS._electromagnetZoom == 70)) _cable.animate(ANIM_MODE_6, NULL); R2_INVENTORY.setObjectScene(R2_ATTRACTOR_UNIT, 0); R2_INVENTORY.setObjectScene(R2_ATTRACTOR_CABLE_HARNESS, 700); @@ -6546,11 +6711,11 @@ void Scene700::signal() { *--------------------------------------------------------------------------*/ bool Scene800::Button::startAction(CursorType action, Event &event) { - Scene800 *scene = (Scene800 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) { return NamedHotspot::startAction(action, event); } else { + Scene800 *scene = (Scene800 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 802; scene->setAction(&scene->_sequenceManager1, scene, 802, &R2_GLOBALS._player, &scene->_autodocCover, NULL); @@ -6559,19 +6724,19 @@ bool Scene800::Button::startAction(CursorType action, Event &event) { } bool Scene800::CableJunction::startAction(CursorType action, Event &event) { - Scene800 *scene = (Scene800 *)R2_GLOBALS._sceneManager._scene; - - if (action != R2_OPTICAL_FIBRE) { + if (action != R2_OPTICAL_FIBER) { return NamedHotspot::startAction(action, event); } else { + Scene800 *scene = (Scene800 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); - scene->_opticalFibre.postInit(); + scene->_opticalFiber.postInit(); scene->_sceneMode = 803; if (R2_INVENTORY.getObjectScene(R2_READER) == 800) - scene->setAction(&scene->_sequenceManager1, scene, 813, &R2_GLOBALS._player, &scene->_opticalFibre, &scene->_reader, NULL); + scene->setAction(&scene->_sequenceManager1, scene, 813, &R2_GLOBALS._player, &scene->_opticalFiber, &scene->_reader, NULL); else - scene->setAction(&scene->_sequenceManager1, scene, 803, &R2_GLOBALS._player, &scene->_opticalFibre, NULL); + scene->setAction(&scene->_sequenceManager1, scene, 803, &R2_GLOBALS._player, &scene->_opticalFiber, NULL); return true; } @@ -6589,8 +6754,8 @@ bool Scene800::DeviceSlot::startAction(CursorType action, Event &event) { _lookLineNum = 27; scene->_sceneMode = 809; - if (R2_INVENTORY.getObjectScene(R2_OPTICAL_FIBRE) == 800) - scene->setAction(&scene->_sequenceManager1, scene, 815, &R2_GLOBALS._player, &scene->_reader, &scene->_opticalFibre, NULL); + if (R2_INVENTORY.getObjectScene(R2_OPTICAL_FIBER) == 800) + scene->setAction(&scene->_sequenceManager1, scene, 815, &R2_GLOBALS._player, &scene->_reader, &scene->_opticalFiber, NULL); else scene->setAction(&scene->_sequenceManager1, scene, 809, &R2_GLOBALS._player, &scene->_reader, NULL); return true; @@ -6599,11 +6764,11 @@ bool Scene800::DeviceSlot::startAction(CursorType action, Event &event) { scene->_reader.postInit(); scene->_sceneMode = 804; - if (R2_INVENTORY.getObjectScene(R2_OPTICAL_FIBRE) == 800) { - scene->setAction(&scene->_sequenceManager1, scene, 814, &R2_GLOBALS._player, - &scene->_reader, &scene->_opticalFibre, NULL); + if (R2_INVENTORY.getObjectScene(R2_OPTICAL_FIBER) == 800) { + scene->setAction(&scene->_sequenceManager1, scene, 814, &R2_GLOBALS._player, + &scene->_reader, &scene->_opticalFiber, NULL); } else { - scene->setAction(&scene->_sequenceManager1, scene, 804, &R2_GLOBALS._player, + scene->setAction(&scene->_sequenceManager1, scene, 804, &R2_GLOBALS._player, &scene->_reader, NULL); } return true; @@ -6617,24 +6782,25 @@ bool Scene800::DeviceSlot::startAction(CursorType action, Event &event) { /*--------------------------------------------------------------------------*/ bool Scene800::Door::startAction(CursorType action, Event &event) { - Scene800 *scene = (Scene800 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_USE: + case CURSOR_USE: { + Scene800 *scene = (Scene800 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 801; scene->setAction(&scene->_sequenceManager1, scene, 801, &R2_GLOBALS._player, &scene->_door, NULL); return true; + } default: return SceneActor::startAction(action, event); } } bool Scene800::Tray::startAction(CursorType action, Event &event) { - Scene800 *scene = (Scene800 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_USE: + case CURSOR_USE: { + Scene800 *scene = (Scene800 *)R2_GLOBALS._sceneManager._scene; + if (!R2_GLOBALS.getFlag(10)) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 806; @@ -6649,16 +6815,17 @@ bool Scene800::Tray::startAction(CursorType action, Event &event) { scene->setAction(&scene->_sequenceManager1, scene, 807, &R2_GLOBALS._player, &scene->_tray, NULL); } return true; + } default: return SceneActor::startAction(action, event); } } bool Scene800::ComScanner::startAction(CursorType action, Event &event) { - Scene800 *scene = (Scene800 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_USE: + case CURSOR_USE: { + Scene800 *scene = (Scene800 *)R2_GLOBALS._sceneManager._scene; + if (scene->_cabinet._frame == 1) return false; @@ -6666,6 +6833,7 @@ bool Scene800::ComScanner::startAction(CursorType action, Event &event) { scene->_sceneMode = 811; scene->setAction(&scene->_sequenceManager1, scene, 811, &R2_GLOBALS._player, &scene->_comScanner, NULL); return true; + } case CURSOR_TALK: SceneItem::display2(800, 35); return true; @@ -6675,10 +6843,10 @@ bool Scene800::ComScanner::startAction(CursorType action, Event &event) { } bool Scene800::Cabinet::startAction(CursorType action, Event &event) { - Scene800 *scene = (Scene800 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_USE: + case CURSOR_USE: { + Scene800 *scene = (Scene800 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); if (scene->_cabinet._frame == 1) { @@ -6691,6 +6859,7 @@ bool Scene800::Cabinet::startAction(CursorType action, Event &event) { R2_GLOBALS.clearFlag(56); } return true; + } default: return SceneActor::startAction(action, event); } @@ -6713,22 +6882,22 @@ void Scene800::postInit(SceneObjectList *OwnerList) { _autodocCover.setPosition(Common::Point(119, 161)); _autodocCover.setDetails(800, 6, 7, -1, 1, (SceneItem *)NULL); - if (R2_INVENTORY.getObjectScene(R2_OPTICAL_FIBRE) == 800) { - _opticalFibre.postInit(); + if (R2_INVENTORY.getObjectScene(R2_OPTICAL_FIBER) == 800) { + _opticalFiber.postInit(); if (R2_INVENTORY.getObjectScene(R2_READER) == 800) - _opticalFibre.setup(800, 4, 1); + _opticalFiber.setup(800, 4, 1); else - _opticalFibre.setup(800, 7, 2); + _opticalFiber.setup(800, 7, 2); - _opticalFibre.setPosition(Common::Point(220, 124)); - _opticalFibre.fixPriority(140); + _opticalFiber.setPosition(Common::Point(220, 124)); + _opticalFiber.fixPriority(140); } if (R2_INVENTORY.getObjectScene(R2_READER) == 800) { _reader.postInit(); - if (R2_INVENTORY.getObjectScene(R2_OPTICAL_FIBRE) == 800) { - _opticalFibre.setup(800, 4, 1); + if (R2_INVENTORY.getObjectScene(R2_OPTICAL_FIBER) == 800) { + _opticalFiber.setup(800, 4, 1); _reader.hide(); } else { _reader.setup(800, 7, 1); @@ -6803,7 +6972,7 @@ void Scene800::signal() { break; case 803: R2_GLOBALS._player.enableControl(); - R2_INVENTORY.setObjectScene(R2_OPTICAL_FIBRE, 800); + R2_INVENTORY.setObjectScene(R2_OPTICAL_FIBER, 800); break; case 804: R2_GLOBALS._player.enableControl(); @@ -6844,21 +7013,19 @@ void Scene800::signal() { Scene825::Button::Button(): SceneObject() { _buttonId = 0; - _v2 = 0; _buttonDown = false; } void Scene825::Button::synchronize(Serializer &s) { SceneObject::synchronize(s); s.syncAsSint16LE(_buttonId); - s.syncAsSint16LE(_v2); s.syncAsSint16LE(_buttonDown); } void Scene825::Button::process(Event &event) { - Scene825 *scene = (Scene825 *)R2_GLOBALS._sceneManager._scene; - if (!event.handled) { + Scene825 *scene = (Scene825 *)R2_GLOBALS._sceneManager._scene; + if ((event.eventType == EVENT_BUTTON_DOWN) && _bounds.contains(event.mousePos) && !_buttonDown) { scene->_sound1.play(14); setFrame(2); @@ -6885,7 +7052,6 @@ bool Scene825::Button::startAction(CursorType action, Event &event) { void Scene825::Button::setButton(int buttonId) { SceneObject::postInit(); - _v2 = buttonId; _buttonDown = 0; _sceneText._color1 = 92; _sceneText._color2 = 0; @@ -6923,14 +7089,14 @@ void Scene825::Button::setButton(int buttonId) { } void Scene825::Button::setText(int textId) { - Scene825 *scene = (Scene825 *)R2_GLOBALS._sceneManager._scene; - _buttonId = textId; _lookLineNum = textId; _sceneText.remove(); - if (_buttonId != 0) + if (_buttonId != 0) { + Scene825 *scene = (Scene825 *)R2_GLOBALS._sceneManager._scene; _sceneText.setup(scene->_autodocItems[textId - 1]); + } } /*--------------------------------------------------------------------------*/ @@ -6954,12 +7120,12 @@ Scene825::Scene825(): SceneExt() { void Scene825::postInit(SceneObjectList *OwnerList) { loadScene(825); + R2_GLOBALS._uiElements._active = false; SceneExt::postInit(); - BF_GLOBALS._interfaceY = 200; + R2_GLOBALS._interfaceY = SCREEN_HEIGHT; R2_GLOBALS._player.postInit(); - R2_GLOBALS._uiElements._active = false; - R2_GLOBALS._player._effect = 0; + R2_GLOBALS._player._effect = EFFECT_NONE; R2_GLOBALS._player.setVisage(10); R2_GLOBALS._player.hide(); R2_GLOBALS._player.disableControl(); @@ -7102,7 +7268,7 @@ void Scene825::doButtonPress(int buttonId) { if (R2_GLOBALS.getFlag(4)) { if ((R2_INVENTORY.getObjectScene(R2_READER) != 800) || - (R2_INVENTORY.getObjectScene(R2_OPTICAL_FIBRE) != 800)) { + (R2_INVENTORY.getObjectScene(R2_OPTICAL_FIBER) != 800)) { _sceneText.setPosition(Common::Point(116, 75)); _sceneText.setup(ACCESS_CODE_REQUIRED); } else if (R2_INVENTORY.getObjectScene(R2_OPTO_DISK) != 800) { @@ -7119,7 +7285,7 @@ void Scene825::doButtonPress(int buttonId) { R2_GLOBALS.setFlag(2); if ((R2_INVENTORY.getObjectScene(R2_READER) != 800) || - (R2_INVENTORY.getObjectScene(R2_OPTICAL_FIBRE) != 800)) { + (R2_INVENTORY.getObjectScene(R2_OPTICAL_FIBER) != 800)) { _sceneText.setPosition(Common::Point(116, 75)); _sceneText.setup(ACCESS_CODE_REQUIRED); } else { @@ -7219,14 +7385,14 @@ void Scene825::doButtonPress(int buttonId) { *--------------------------------------------------------------------------*/ bool Scene850::Indicator::startAction(CursorType action, Event &event) { - Scene850 *scene = (Scene850 *)R2_GLOBALS._sceneManager._scene; - - if ((action != CURSOR_USE) || (R2_INVENTORY.getObjectScene(R2_OPTICAL_FIBRE) != 850)) + if ((action != CURSOR_USE) || (R2_INVENTORY.getObjectScene(R2_OPTICAL_FIBER) != 850)) return NamedHotspot::startAction(action, event); else { + Scene850 *scene = (Scene850 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 851; - scene->setAction(&scene->_sequenceManager1, scene, 851, &R2_GLOBALS._player, &scene->_fibre, NULL); + scene->setAction(&scene->_sequenceManager1, scene, 851, &R2_GLOBALS._player, &scene->_fiber, NULL); return true; } } @@ -7234,11 +7400,11 @@ bool Scene850::Indicator::startAction(CursorType action, Event &event) { /*--------------------------------------------------------------------------*/ bool Scene850::LiftDoor::startAction(CursorType action, Event &event) { - Scene850 *scene = (Scene850 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); else { + Scene850 *scene = (Scene850 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 202; scene->setAction(&scene->_sequenceManager1, scene, 202, &R2_GLOBALS._player, this, NULL); @@ -7247,11 +7413,11 @@ bool Scene850::LiftDoor::startAction(CursorType action, Event &event) { } bool Scene850::SickBayDoor::startAction(CursorType action, Event &event) { - Scene850 *scene = (Scene850 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); else { + Scene850 *scene = (Scene850 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 204; scene->setAction(&scene->_sequenceManager1, scene, 204, &R2_GLOBALS._player, this, NULL); @@ -7260,31 +7426,31 @@ bool Scene850::SickBayDoor::startAction(CursorType action, Event &event) { } bool Scene850::Clamp::startAction(CursorType action, Event &event) { - Scene850 *scene = (Scene850 *)R2_GLOBALS._sceneManager._scene; - if (!R2_GLOBALS.getFlag(7)) return false; else if (action != CURSOR_USE) return SceneActor::startAction(action, event); else { + Scene850 *scene = (Scene850 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_spark.postInit(); scene->_sceneMode = 850; - scene->setAction(&scene->_sequenceManager1, scene, 850, &R2_GLOBALS._player, this, + scene->setAction(&scene->_sequenceManager1, scene, 850, &R2_GLOBALS._player, this, &scene->_spark, NULL); return true; } } bool Scene850::Panel::startAction(CursorType action, Event &event) { - Scene850 *scene = (Scene850 *)R2_GLOBALS._sceneManager._scene; - if ((action != CURSOR_USE) || R2_GLOBALS.getFlag(7)) return SceneActor::startAction(action, event); else { + Scene850 *scene = (Scene850 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 852; - scene->setAction(&scene->_sequenceManager1, scene, 852, &R2_GLOBALS._player, + scene->setAction(&scene->_sequenceManager1, scene, 852, &R2_GLOBALS._player, this, &scene->_spark, NULL); return true; } @@ -7325,10 +7491,10 @@ void Scene850::postInit(SceneObjectList *OwnerList) { _panel.fixPriority(82); _panel.setDetails(850, 24, -1, -1, 1, (SceneItem *)NULL); - if (R2_INVENTORY.getObjectScene(R2_OPTICAL_FIBRE) == 850) { - _fibre.postInit(); - _fibre.setup(850, 6, 1); - _fibre.setPosition(Common::Point(280, 87)); + if (R2_INVENTORY.getObjectScene(R2_OPTICAL_FIBER) == 850) { + _fiber.postInit(); + _fiber.setup(850, 6, 1); + _fiber.setPosition(Common::Point(280, 87)); } R2_GLOBALS._player.postInit(); @@ -7375,8 +7541,8 @@ void Scene850::signal() { R2_GLOBALS._player.enableControl(); break; case 851: - R2_INVENTORY.setObjectScene(R2_OPTICAL_FIBRE, 1); - _fibre.remove(); + R2_INVENTORY.setObjectScene(R2_OPTICAL_FIBER, 1); + _fiber.remove(); R2_GLOBALS._player.enableControl(); break; case 852: @@ -7436,10 +7602,10 @@ bool Scene900::Button::startAction(CursorType action, Event &event) { scene->_sceneMode = 2; scene->signal(); } else if (scene->_controlsScreenNumber == 2) { - if (R2_GLOBALS._v565E5 == 0) { + if (!R2_GLOBALS._tractorField) { scene->_aSound1.play(30); setup(900, 3, 11); - R2_GLOBALS._v565E5 = 1; + R2_GLOBALS._tractorField = true; if ((R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) == 0) && (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS == 700)) && (R2_GLOBALS._electromagnetChangeAmount == 20) && (R2_GLOBALS._electromagnetZoom == 70) && (scene->_cable._animateMode != ANIM_MODE_6)) { scene->_cable.animate(ANIM_MODE_6, NULL); } else { @@ -7458,12 +7624,12 @@ bool Scene900::Button::startAction(CursorType action, Event &event) { } else { scene->_aSound1.play(53); setup(900, 3, 9); - R2_GLOBALS._v565E5 = 0; + R2_GLOBALS._tractorField = false; if ((R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) == 0) && (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS) == 700) && (scene->_cable._frame < 8) && (scene->_cable._animateMode != ANIM_MODE_5)) { scene->_cable.animate(ANIM_MODE_5, NULL); } else if ((R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) == 700) && (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS) == 700) && (scene->_cable._frame < 8)) { - R2_GLOBALS._v565E7 = 0; + R2_GLOBALS._cableAttached = false; if (scene->_cable._animateMode != 5) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 5; @@ -7514,11 +7680,11 @@ bool Scene900::Button::startAction(CursorType action, Event &event) { return true; break; case 8: - SceneItem::display(5, 11, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(5, 11, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); return true; break; case 9: - SceneItem::display(5, 12, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(5, 12, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); return true; break; default: @@ -7543,7 +7709,7 @@ bool Scene900::Button::startAction(CursorType action, Event &event) { } } else if (action == CURSOR_LOOK) { SceneItem::display(900, ((_buttonId == 2) && (scene->_controlsScreenNumber == 2)) ? 21 : _buttonId + 11, - SET_WIDTH, 280, SET_X, 160, SET_POS_MODE, 1, SET_Y, 20, SET_EXT_BGCOLOR, 7, -999); + SET_WIDTH, 280, SET_X, 160, SET_POS_MODE, 1, SET_Y, 20, SET_EXT_BGCOLOR, 7, LIST_END); return true; } else { return SceneActor::startAction(action, event); @@ -7570,7 +7736,7 @@ void Scene900::postInit(SceneObjectList *OwnerList) { _electromagnet.fixPriority(1); _electromagnet.setup(900, 1, 2); _electromagnet.setPosition(Common::Point(89, 0)); - _electromagnet._effect = 1; + _electromagnet._effect = EFFECT_SHADED; _electromagnet.setDetails(900, 6, -1, 8, 1, (SceneItem *) NULL); if ((R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) != 1) && (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS) != 1)) { @@ -7581,7 +7747,7 @@ void Scene900::postInit(SceneObjectList *OwnerList) { if (R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) == 0) { if (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS) != 700) { _cable.setup(901, 3, 2); - } else if ((R2_GLOBALS._v565E5 != 0) && (R2_GLOBALS._electromagnetChangeAmount == 20) && (R2_GLOBALS._electromagnetZoom == 70)) { + } else if (R2_GLOBALS._tractorField && (R2_GLOBALS._electromagnetChangeAmount == 20) && (R2_GLOBALS._electromagnetZoom == 70)) { _cable.setup(901, 2, 1); } else { _cable.setup(901, 2, 8); @@ -7590,11 +7756,11 @@ void Scene900::postInit(SceneObjectList *OwnerList) { _cable.setDetails(700, -1, -1, -1, 1, (SceneItem *) NULL); } else { _cable.setDetails(700, -1, -1, -1, 1, (SceneItem *) NULL); - if (R2_GLOBALS._v565E7 == 0) { + if (!R2_GLOBALS._cableAttached) { _cable.setup(901, 1, 8); // Original set two times the same values: skipped - _cable.setPosition(Common::Point((((100 - ((R2_GLOBALS._v565EB * 350) / 100)) * 49) / 100) + ((R2_GLOBALS._v565E9 * _electromagnet._percent * 6) / 100) + 89, 166 - (R2_GLOBALS._v565EB / 3))); - _cable.changeZoom(((100 - ((R2_GLOBALS._v565EB * 350) / 100) + 52) / 10) * 10); + _cable.setPosition(Common::Point((((100 - ((CABLE700_X * 350) / 100)) * 49) / 100) + ((CABLE700_Y * _electromagnet._percent * 6) / 100) + 89, 166 - (CABLE700_X / 3))); + _cable.changeZoom(((100 - ((CABLE700_X * 350) / 100) + 52) / 10) * 10); } } } @@ -7639,7 +7805,7 @@ void Scene900::signal() { _button3.remove(); _button2.initButton(2); - if (R2_GLOBALS._v565E5 == 0) + if (!R2_GLOBALS._tractorField) _button2.setup(900, 3, 9); else _button2.setup(900, 3, 11); @@ -7684,7 +7850,7 @@ void Scene900::signal() { _sceneMode = 0; R2_GLOBALS._player.enableControl(); R2_GLOBALS._player._canWalk = false; - R2_GLOBALS._v565E7 = 1; + R2_GLOBALS._cableAttached = true; break; case 900: R2_GLOBALS._player.enableControl(CURSOR_USE); @@ -7734,11 +7900,11 @@ void Scene900::dispatch() { } if (R2_GLOBALS._sceneObjects->contains(&_cable)) { - if ((R2_GLOBALS._v565E5 != 0) && (R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) == 0) && (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS) == 700) && (R2_GLOBALS._electromagnetChangeAmount == 20) && (R2_GLOBALS._electromagnetZoom == 70)) { + if (R2_GLOBALS._tractorField && (R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) == 0) && (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS) == 700) && (R2_GLOBALS._electromagnetChangeAmount == 20) && (R2_GLOBALS._electromagnetZoom == 70)) { if ((_cable._frame > 1) && (_cable._animateMode != ANIM_MODE_6)) _cable.animate(ANIM_MODE_6, NULL); } else { - if ((_cable._frame < 8) && (_cable._animateMode != ANIM_MODE_5) && (R2_GLOBALS._v565E7 == 0) && (R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) == 0) && (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS) == 700) && (_sceneMode != 4)) + if ((_cable._frame < 8) && (_cable._animateMode != ANIM_MODE_5) && !R2_GLOBALS._cableAttached && (R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) == 0) && (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS) == 700) && (_sceneMode != 4)) _cable.animate(ANIM_MODE_5, NULL); } } @@ -7746,7 +7912,7 @@ void Scene900::dispatch() { _electromagnet.changeZoom(100 - ((R2_GLOBALS._electromagnetZoom * 70) / 100)); _electromagnet.setPosition(Common::Point(((_electromagnet._percent * R2_GLOBALS._electromagnetChangeAmount * 6) / 100) + 89, R2_GLOBALS._electromagnetZoom)); - if ((R2_GLOBALS._sceneObjects->contains(&_cable)) && (R2_GLOBALS._v565E7 != 0) && (!_cable._mover) && (_cable._animateMode == ANIM_MODE_NONE)) { + if ((R2_GLOBALS._sceneObjects->contains(&_cable)) && R2_GLOBALS._cableAttached && (!_cable._mover) && (_cable._animateMode == ANIM_MODE_NONE)) { _cable.setPosition(Common::Point(_electromagnet._position.x + ((_electromagnet._percent * 49) / 100), _electromagnet._position.y + ((_electromagnet._percent * 3) / 10))); if (R2_GLOBALS._electromagnetZoom >= 75) { _cable.setup(901, 1, 1); diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.h b/engines/tsage/ringworld2/ringworld2_scenes0.h index fe42f1e33e..f50c9a92a2 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes0.h +++ b/engines/tsage/ringworld2/ringworld2_scenes0.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -85,7 +85,7 @@ class Scene100: public SceneExt { public: NamedHotspot _background, _duct, _bed, _desk; Terminal _terminal; - SceneActor _bedLights1, _bedLights2, _object3, _object4, _object5; + SceneActor _bedLights1, _bedLights2, _tableLocker, _wardrobeTopAnim, _wardrobeColorAnim; SceneActor _wardrobe; Door _door; Table _table; @@ -111,7 +111,7 @@ class Scene125: public SceneExt { public: int _lookLineNum, _iconId; bool _pressed; - SceneObject _object1, _object2; + SceneObject _glyph, _horizLine; SceneText _sceneText1, _sceneText2; Icon(); @@ -136,7 +136,8 @@ public: ASoundExt _sound1; NamedHotspot _background, _item2, _item3; DiskSlot _diskSlot; - SceneActor _object1, _object2, _object3, _object4, _food, _foodDispenser, _infoDisk; + SceneActor _starchart1, _starchart2, _starchart3, _starchart4; + SceneActor _food, _foodDispenser, _infoDisk; Icon _icon1, _icon2, _icon3, _icon4, _icon5, _icon6; SequenceManager _sequenceManager; SceneText _sceneText; @@ -175,7 +176,6 @@ public: ASound _sound1; Action1 _action1; int _frameNumber, _yChange; - SceneObject _object1, _object2, _object3; int _lineNum; SynchronizedList<SceneText *> _creditsList; public: @@ -201,7 +201,7 @@ public: SpeakerDutyOfficer180 _dutyOfficerSpeaker; SpeakerTeal180 _tealSpeaker; SpeakerGameText _gameTextSpeaker; - SceneActor _dutyOfficer, _teal, _webbser, _door, _shipDisplay; + SceneActor _dutyOfficer, _teal, _webbster, _door, _shipDisplay; ScenePalette _palette; SceneText _textList[20]; AnimationPlayerExt _animationPlayer; @@ -210,10 +210,9 @@ public: ASoundExt _sound1; int _frameNumber; - int _field412, _field480; - int _field482, _frameInc; + bool _helpEnabled; + int _frameInc; int _fontNumber, _fontHeight; - int _scene180Mode; public: Scene180(); @@ -263,6 +262,13 @@ public: virtual void signal(); }; +class Star: public SceneObject { +public: + int _x100, _y100; +public: + virtual Common::String getClassName() { return "Scene205_Star"; } +}; + class Scene205: public SceneExt { /* Actions */ class Action1: public Action { @@ -271,26 +277,18 @@ class Scene205: public SceneExt { public: virtual void signal(); }; - - /* Objects */ - class Object: public SceneObject { - public: - int _x100, _y100; - public: - // TODO: Check if this derives from DataManager? and flesh out - }; private: void setup(); - void processList(Object **ObjList, int count, const Common::Rect &bounds, + void processList(Star **ObjList, int count, const Common::Rect &bounds, int xMultiply, int yMultiply, int xCenter, int yCenter); void handleText(); public: AnimationPlayer _animationPlayer; int _fontHeight; SceneText _textList[15]; - Object *_objList1[3]; - Object *_objList2[3]; - Object *_objList3[4]; + Star *_starList1[3]; + Star *_starList2[3]; + Star *_starList3[4]; ASound _sound1; Action1 _action1; int _yp; @@ -306,6 +304,24 @@ public: virtual void dispatch(); }; +class Scene205Demo: public SceneExt { + /* Actions */ + class Action1: public Action { + public: + virtual void signal(); + }; +private: + void leaveScene(); +public: + VisualSpeaker _animationPlayer; + ASound _sound1; + Action1 _action1; +public: + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void remove(); + virtual void process(Event &event); +}; + class Scene250: public SceneExt { class Button: public SceneActor { public: @@ -402,8 +418,8 @@ public: QuinnWorkstation _quinnWorkstation1, _quinnWorkstation2; SeekerWorkstation _seekerWorkstation; MirandaWorkstation _mirandaWorkstation1, _mirandaWorkstation2; - SceneActor _object1, _object2, _object3, _object4, _protocolDisplay; - SceneActor _object6, _object7, _object8, _object9; + SceneActor _atmosphereLeftWindow, _atmosphereRightWindow, _leftVerticalBarsAnim, _rightVerticalBarsAnim, _protocolDisplay; + SceneActor _rightTextDisplay, _mirandaScreen, _leftTextDisplay, _quinnScreen; SceneActor _teal, _soldier, _object12; Doorway _doorway; Miranda _miranda; @@ -430,7 +446,7 @@ class Scene325: public SceneExt { public: int _lookLineNum, _iconId; bool _pressed; - SceneObject _object1, _object2; + SceneObject _glyph, _horizLine; SceneText _sceneText1, _sceneText2; Icon(); @@ -450,16 +466,17 @@ private: void setMessage(int resNum, int lineNum); Common::String parseMessage(const Common::String &msg); public: - int _field412, _iconFontNumber, _field416, _field418; - int _field41A, _field41C, _field41E, _scannerLocation; + int _consoleAction, _iconFontNumber, _databasePage, _priorConsoleAction; + int _moveCounter, _yChange, _yDirection, _scannerLocation; int _soundCount, _soundIndex; int _soundQueue[10]; SpeakerQuinn _quinnSpeaker; ScenePalette _palette; SceneHotspot _background, _terminal; - SceneObject _object1, _object2, _object3, _object4, _object5; - SceneObject _object6, _object7, _object8, _object9, _object10; - SceneObject _object11, _object12, _scannerTab; + SceneObject _starGrid1, _starGrid2, _starGrid3; // Both starchart & scan grid objects + SceneObject _starGrid4, _starGrid5, _starGrid6, _starGrid7; + SceneObject _starGrid8, _starGrid9, _starGrid10, _starGrid11; + SceneObject _starGrid12, _starGrid13; SceneObject _objList[4]; Icon _icon1, _icon2, _icon3, _icon4, _icon5, _icon6; ASoundExt _sound1; @@ -530,7 +547,7 @@ class Scene500: public SceneExt { int _buttonId; bool _buttonDown; - void doButtonPress(); + void doButtonPress(); public: Button(); virtual Common::String getClassName() { return "Scene500_Button"; } @@ -628,7 +645,6 @@ public: virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void signal(); - }; class Scene600 : public SceneExt { @@ -645,7 +661,7 @@ class Scene600 : public SceneExt { public: virtual void signal(); virtual bool startAction(CursorType action, Event &event); - virtual GfxSurface getFrame(); + virtual void draw(); }; class Doorway : public SceneActor { public: @@ -793,7 +809,7 @@ public: Button _button; CableJunction _cableJunction; DeviceSlot _deviceSlot; - SceneActor _autodocCover, _opticalFibre, _reader; + SceneActor _autodocCover, _opticalFiber, _reader; Door _door; Tray _tray; ComScanner _comScanner; @@ -808,7 +824,7 @@ class Scene825: public SceneExt { /* Objects */ class Button: public SceneObject { public: - int _buttonId, _v2; + int _buttonId; bool _buttonDown; SceneText _sceneText; public: @@ -869,7 +885,7 @@ public: NamedHotspot _background, _eastDoor, _compartment, _sickBayIndicator; NamedHotspot _liftControls; Indicator _indicator; - SceneActor _spark, _fibre; + SceneActor _spark, _fiber; LiftDoor _liftDoor; SickBayDoor _sickBayDoor; Clamp _clamp; diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index 0932c70f04..29646d1612 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -5,21 +5,23 @@ * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU GenWeral Public License + * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ +#include "graphics/cursorman.h" + #include "tsage/scenes.h" #include "tsage/tsage.h" #include "tsage/staticres.h" @@ -100,10 +102,10 @@ void Scene1000::remove() { void Scene1000::signal() { ScenePalette scenePalette1, scenePalette2; uint32 black = 0; - + switch (_sceneMode++) { case 0: - // TODO: Sort out values + // TODO: Determine correct colors R2_GLOBALS._gfxColors.foreground = 191; R2_GLOBALS._gfxColors.background = 144; R2_GLOBALS._fontColors.background = 224; @@ -117,7 +119,7 @@ void Scene1000::signal() { _animationPlayer.dispatch(); _forceCheckAnimationFl = true; - + R2_GLOBALS._scenePalette.fade((const byte *)&black, true, 0); for (int percent = 0; percent < 100; percent += 5) R2_GLOBALS._scenePalette.fade((const byte *)&black, true, percent); @@ -128,7 +130,7 @@ void Scene1000::signal() { case 1: R2_GLOBALS._sound1.fadeOut2(NULL); - // TODO: Sort out values + // TODO: Determine correct colors R2_GLOBALS._gfxColors.foreground = 191; R2_GLOBALS._gfxColors.background = 144; R2_GLOBALS._fontColors.background = 224; @@ -146,9 +148,9 @@ void Scene1000::signal() { break; case 2: - if (R2_GLOBALS._speechSubtitles & SPEECH_TEXT) { + if (R2_GLOBALS._speechSubtitles & SPEECH_TEXT) setAction(&_sequenceManager1, this, 1, &R2_GLOBALS._player, NULL); - } else { + else { if (++_animCounter < 3) _sceneMode = 2; @@ -157,7 +159,7 @@ void Scene1000::signal() { break; case 3: - // TODO: Sort out values + // TODO: Determine correct colors R2_GLOBALS._gfxColors.foreground = 191; R2_GLOBALS._gfxColors.background = 144; R2_GLOBALS._fontColors.background = 224; @@ -184,7 +186,7 @@ void Scene1000::signal() { break; case 4: - // TODO: Sort out values + // TODO: Determine correct colors R2_GLOBALS._gfxColors.foreground = 191; R2_GLOBALS._gfxColors.background = 144; R2_GLOBALS._fontColors.background = 224; @@ -334,7 +336,7 @@ void Scene1000::signal() { case 60: R2_GLOBALS._sound1.play(333); - + for (int percent = 100; percent >= 0; percent -= 5) R2_GLOBALS._scenePalette.fade((const byte *)&black, true, percent); @@ -443,7 +445,7 @@ void Scene1000::signal() { R2_GLOBALS._scenePalette.fade((const byte *)&black, 1, 0); for (int percent = 0; percent < 100; percent += 5) R2_GLOBALS._scenePalette.fade((const byte *)&black, true, percent); - break; + break; case 101: R2_GLOBALS._sound1.fadeOut2(NULL); @@ -463,9 +465,8 @@ void Scene1000::dispatch() { if (_sceneMode == 52) _animationPlayer._endAction = this; - } else { + } else _animationPlayer.dispatch(); - } } Scene::dispatch(); @@ -479,9 +480,9 @@ void Scene1000::dispatch() { void Scene1010::postInit(SceneObjectList *OwnerList) { loadScene(1010); - SceneExt::postInit(); - R2_GLOBALS._interfaceY = 200; R2_GLOBALS._uiElements._active = false; + SceneExt::postInit(); + R2_GLOBALS._interfaceY = SCREEN_HEIGHT; setZoomPercents(100, 1, 160, 100); R2_GLOBALS._player.postInit(); @@ -540,14 +541,13 @@ void Scene1010::signal() { void Scene1020::postInit(SceneObjectList *OwnerList) { loadScene(1020); + R2_GLOBALS._uiElements._active = false; SceneExt::postInit(); if (R2_GLOBALS._sceneManager._previousScene == 1010) _sceneBounds = Rect(160, 0, SCREEN_WIDTH + 160, 200); - R2_GLOBALS._interfaceY = 200; - R2_GLOBALS._v558B6.set(160, 0, 160, 161); - R2_GLOBALS._uiElements._active = false; + R2_GLOBALS._interfaceY = SCREEN_HEIGHT; R2_GLOBALS._player.postInit(); if (R2_GLOBALS._sceneManager._previousScene == 1010) { @@ -678,12 +678,13 @@ void Scene1100::synchronize(Serializer &s) { } bool Scene1100::Seeker::startAction(CursorType action, Event &event) { - Scene1100 *scene = (Scene1100 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_TALK) return SceneActor::startAction(action, event); + Scene1100 *scene = (Scene1100 *)R2_GLOBALS._sceneManager._scene; + if (R2_GLOBALS.getFlag(52)) { + // The trouper is dead R2_GLOBALS._player.disableControl(); if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->_nextStripNum = 327; @@ -692,15 +693,16 @@ bool Scene1100::Seeker::startAction(CursorType action, Event &event) { scene->_sceneMode = 53; scene->setAction(&scene->_sequenceManager1, scene, 1122, &R2_GLOBALS._player, NULL); } else { + // The trouper is not dead R2_GLOBALS._player.disableControl(); scene->_sceneMode = 55; - if (R2_GLOBALS._v565AE >= 3) { + if (R2_GLOBALS._stripModifier >= 3) { if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->_stripManager.start3(329, scene, R2_GLOBALS._stripManager_lookupList); else scene->_stripManager.start3(330, scene, R2_GLOBALS._stripManager_lookupList); } else { - ++R2_GLOBALS._v565AE; + ++R2_GLOBALS._stripModifier; R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->_stripManager.start3(304, scene, R2_GLOBALS._stripManager_lookupList); @@ -717,18 +719,19 @@ bool Scene1100::Trooper::startAction(CursorType action, Event &event) { switch (action) { case R2_NEGATOR_GUN: if (_visage == 1105) { + // Trooper wears the stasis shield R2_GLOBALS._player.disableControl(); scene->_sceneMode = 1114; scene->setAction(&scene->_sequenceManager1, scene, 1114, &R2_GLOBALS._player, &scene->_trooper, NULL); return true; - } else { + } else return SceneActor::startAction(action, event); - } break; case R2_SONIC_STUNNER: // No break on purpose case R2_PHOTON_STUNNER: if (_visage == 1105) { + // If trooper wears the stasis shield R2_GLOBALS._player.disableControl(); if (R2_GLOBALS._player._characterIndex == R2_QUINN) { scene->_sceneMode = 1112; @@ -739,17 +742,16 @@ bool Scene1100::Trooper::startAction(CursorType action, Event &event) { } return true; } else if (_strip == 2) { + // Trooper wears his black uniform R2_GLOBALS._player.disableControl(); scene->_sceneMode = 1113; - if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager1, scene, 1113, &R2_GLOBALS._player, &scene->_trooper, NULL); - } else { + else scene->setAction(&scene->_sequenceManager1, scene, 1118, &R2_GLOBALS._player, &scene->_trooper, NULL); - } return true; - } else { + } else return SceneActor::startAction(action, event); - } break; default: return SceneActor::startAction(action, event); @@ -758,9 +760,11 @@ bool Scene1100::Trooper::startAction(CursorType action, Event &event) { } bool Scene1100::Chief::startAction(CursorType action, Event &event) { - Scene1100 *scene = (Scene1100 *)R2_GLOBALS._sceneManager._scene; - + // CHECKME: Flag 54 is never set. Guess: the flag means "Chief is dead" if ((action == CURSOR_TALK) && (!R2_GLOBALS.getFlag(54)) && (R2_GLOBALS.getFlag(52))) { + // Talk to chief after the trooper dies + Scene1100 *scene = (Scene1100 *)R2_GLOBALS._sceneManager._scene; + scene->_nextStripNum = 0; R2_GLOBALS._player.disableControl(); scene->_sceneMode = 53; @@ -777,20 +781,14 @@ void Scene1100::postInit(SceneObjectList *OwnerList) { else loadScene(1100); - if ((R2_GLOBALS._sceneManager._previousScene == 1000) && (!R2_GLOBALS.getFlag(44))) { + if ((R2_GLOBALS._sceneManager._previousScene == 1000) && (!R2_GLOBALS.getFlag(44))) R2_GLOBALS._uiElements._active = false; - R2_GLOBALS._v5589E.left = 0; - R2_GLOBALS._v5589E.right = 200; - } if (R2_GLOBALS._player._characterScene[R2_QUINN] == 1100) R2_GLOBALS._sceneManager._previousScene = 1100; - if (R2_GLOBALS._sceneManager._previousScene == -1) { + if (R2_GLOBALS._sceneManager._previousScene == -1) R2_GLOBALS._uiElements._active = false; - R2_GLOBALS._v5589E.left = 0; - R2_GLOBALS._v5589E.right = 200; - } SceneExt::postInit(); @@ -847,6 +845,7 @@ void Scene1100::postInit(SceneObjectList *OwnerList) { _chief.setDetails(1100, 3, -1, -1, 1, (SceneItem *) NULL); _trooper.postInit(); + // Trooper wears his stasis shield _trooper.setup(1105, 3, 1); _trooper.setPosition(Common::Point(312, 165)); _trooper._numFrames = 5; @@ -868,8 +867,8 @@ void Scene1100::postInit(SceneObjectList *OwnerList) { _palette1.loadPalette(1101); R2_GLOBALS._player.postInit(); R2_GLOBALS._player.disableControl(); - R2_GLOBALS._player._effect = 5; - R2_GLOBALS._player._field9C = _field312; + R2_GLOBALS._player._effect = EFFECT_SHADOW_MAP; + R2_GLOBALS._player._shadowMap = _shadowPaletteMap; R2_GLOBALS._player.setup(1102, 3, 2); R2_GLOBALS._player.setObjectWrapper(NULL); R2_GLOBALS._player.setPosition(Common::Point(111,-20)); @@ -877,8 +876,8 @@ void Scene1100::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._moveRate = 30; R2_GLOBALS._player._moveDiff = Common::Point(16, 2); - _rightLandslide.setup2(1104, 2, 1, 175, 125, 102, 1); - _object2.setup2(1102, 5, 1, 216, 167, 1, 0); + _rightLandslide.setup2(1104, 2, 1, 175, 125, 102, EFFECT_SHADED); + _purplePlant.setup2(1102, 5, 1, 216, 167, 1, EFFECT_NONE); _leftImpacts.postInit(); _leftImpacts.setup(1113, 2, 1); @@ -894,8 +893,8 @@ void Scene1100::postInit(SceneObjectList *OwnerList) { _shipFormationShadow.setup(1102, 6, 2); _shipFormationShadow._moveRate = 30; _shipFormationShadow._moveDiff.x = 2; - _shipFormationShadow._effect = 5; - _shipFormationShadow._field9C = _field312; + _shipFormationShadow._effect = EFFECT_SHADOW_MAP; + _shipFormationShadow._shadowMap = _shadowPaletteMap; R2_GLOBALS._sound1.play(86); @@ -905,8 +904,10 @@ void Scene1100::postInit(SceneObjectList *OwnerList) { } else { _cloud.setPosition(Common::Point(180, 30)); if (R2_GLOBALS.getFlag(52)) + // Trooper is dead R2_GLOBALS._sound1.play(98); else + // Trooper is alive R2_GLOBALS._sound1.play(95); R2_GLOBALS._player.postInit(); @@ -915,6 +916,7 @@ void Scene1100::postInit(SceneObjectList *OwnerList) { _seeker.postInit(); if (R2_GLOBALS.getFlag(52)) { + // Trooper is dead if (R2_GLOBALS._player._characterIndex == R2_QUINN) { R2_GLOBALS._player.setup(19, 7, 1); _seeker.setup(29, 6, 1); @@ -926,6 +928,7 @@ void Scene1100::postInit(SceneObjectList *OwnerList) { _seeker.setPosition(Common::Point(237, 134)); R2_GLOBALS._player.enableControl(); } else { + // Trooper is alive if (R2_GLOBALS._player._characterIndex == R2_QUINN) { R2_GLOBALS._player.setup(1107, 2, 1); _seeker.setup(1107, 4, 1); @@ -957,16 +960,20 @@ void Scene1100::postInit(SceneObjectList *OwnerList) { _chief.setDetails(1100, 3, -1, -1, 1, (SceneItem *) NULL); if (!R2_GLOBALS.getFlag(52)) { + // If trooper is alive, initialize him _trooper.postInit(); if (R2_GLOBALS.getFlag(53)) + // Trooper wears his black uniform _trooper.setup(1106, 2, 4); else + // Trooper wears a stasis shield _trooper.setup(1105, 4, 4); _trooper.setPosition(Common::Point(17, 54)); _trooper._numFrames = 5; if (R2_GLOBALS.getFlag(53)) + // Trooper isn't wearing the stasis shield _trooper.setDetails(1100, 28, -1, -1, 1, (SceneItem *) NULL); else _trooper.setDetails(1100, 22, 23, 24, 1, (SceneItem *) NULL); @@ -1038,12 +1045,12 @@ void Scene1100::signal() { break; case 5: _runningGuy1.postInit(); - _runningGuy1._effect = 6; + _runningGuy1._effect = EFFECT_SHADED2; _runningGuy1.setup(1103, 3, 1); _runningGuy1._moveRate = 30; _runningGuy2.postInit(); - _runningGuy2._effect = 6; + _runningGuy2._effect = EFFECT_SHADED2; _runningGuy2.setup(1103, 4, 1); _runningGuy2._moveRate = 25; @@ -1063,7 +1070,7 @@ void Scene1100::signal() { setAction(&_sequenceManager1, this, 1103, &_chief, &_laserShot, NULL); break; case 8: - R2_GLOBALS._player._effect = 0; + R2_GLOBALS._player._effect = EFFECT_NONE; _animation.postInit(); setAction(&_sequenceManager1, this, 1105, &R2_GLOBALS._player, &_laserShot, &_animation, &_chief, NULL); break; @@ -1084,7 +1091,7 @@ void Scene1100::signal() { case 11: { setAction(&_sequenceManager1, this, 1106, &_animation, &_laserShot, &_leftImpacts, NULL); - R2_GLOBALS._player._effect = 5; + R2_GLOBALS._player._effect = EFFECT_SHADOW_MAP; R2_GLOBALS._player.setup(1102, 3, 2); R2_GLOBALS._player.setPosition(Common::Point(-50, 131)); R2_GLOBALS._sound2.play(84); @@ -1169,6 +1176,7 @@ void Scene1100::signal() { R2_GLOBALS._player._canWalk = false; break; case 51: + // Trooper no longer wears a statis shield R2_GLOBALS.setFlag(53); _trooper.setDetails(1100, 28, -1, -1, 3, (SceneItem *) NULL); @@ -1176,6 +1184,7 @@ void Scene1100::signal() { R2_GLOBALS._player._canWalk = false; break; case 52: + // Trooper is shot to death R2_GLOBALS._sound1.play(98); R2_GLOBALS.setFlag(52); R2_GLOBALS._player.disableControl(); @@ -1193,21 +1202,13 @@ void Scene1100::signal() { R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); if (_nextStripNum == 0) { R2_GLOBALS.setFlag(55); - if (R2_GLOBALS.getFlag(55)) { - if (R2_GLOBALS._player._characterIndex == R2_QUINN) - _stripManager.start(318, this); - else - _stripManager.start(323, this); - } else { - // This part is totally useless as flag 55 has been set right before the check - if (R2_GLOBALS._player._characterIndex == R2_QUINN) - _stripManager.start(317, this); - else - _stripManager.start(322, this); - } - } else { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) + _stripManager.start(318, this); + else + _stripManager.start(323, this); + } else _stripManager.start3(_nextStripNum, this, _stripManager._lookupList); - } + break; case 54: if (_stripManager._exitMode == 1) { @@ -1356,7 +1357,7 @@ void Scene1200::LaserPanel::Jumper::init(int state) { switch (_state) { case 1: - switch (R2_GLOBALS._v56AA6) { + switch (R2_GLOBALS._ductMazePanel1State) { case 1: setFrame2(2); setPosition(Common::Point(129, 101)); @@ -1370,7 +1371,7 @@ void Scene1200::LaserPanel::Jumper::init(int state) { } break; case 2: - switch (R2_GLOBALS._v56AA7) { + switch (R2_GLOBALS._ductMazePanel2State) { case 1: setFrame2(2); setPosition(Common::Point(152, 101)); @@ -1388,7 +1389,7 @@ void Scene1200::LaserPanel::Jumper::init(int state) { } break; case 3: - switch (R2_GLOBALS._v56AA8) { + switch (R2_GLOBALS._ductMazePanel3State) { case 1: setFrame2(3); setPosition(Common::Point(158, 95)); @@ -1415,22 +1416,22 @@ bool Scene1200::LaserPanel::Jumper::startAction(CursorType action, Event &event) R2_GLOBALS._sound2.play(260); switch (_state) { case 1: - if (R2_GLOBALS._v56AA6 == 1) { - R2_GLOBALS._v56AA6 = 2; + if (R2_GLOBALS._ductMazePanel1State == 1) { + R2_GLOBALS._ductMazePanel1State = 2; setFrame2(3); setPosition(Common::Point(135, 95)); } else { - R2_GLOBALS._v56AA6 = 1; + R2_GLOBALS._ductMazePanel1State = 1; setFrame2(2); setPosition(Common::Point(129, 101)); } break; case 2: - ++R2_GLOBALS._v56AA7; - if (R2_GLOBALS._v56AA7 == 4) - R2_GLOBALS._v56AA7 = 1; + ++R2_GLOBALS._ductMazePanel2State; + if (R2_GLOBALS._ductMazePanel2State == 4) + R2_GLOBALS._ductMazePanel2State = 1; - switch (R2_GLOBALS._v56AA7) { + switch (R2_GLOBALS._ductMazePanel2State) { case 1: setFrame2(2); setPosition(Common::Point(152, 101)); @@ -1448,12 +1449,12 @@ bool Scene1200::LaserPanel::Jumper::startAction(CursorType action, Event &event) } break; case 3: - if (R2_GLOBALS._v56AA8 == 1) { - R2_GLOBALS._v56AA8 = 2; + if (R2_GLOBALS._ductMazePanel3State == 1) { + R2_GLOBALS._ductMazePanel3State = 2; setFrame2(2); setPosition(Common::Point(175, 101)); } else { - R2_GLOBALS._v56AA8 = 1; + R2_GLOBALS._ductMazePanel3State = 1; setFrame2(3); setPosition(Common::Point(158, 95)); } @@ -1465,13 +1466,13 @@ bool Scene1200::LaserPanel::Jumper::startAction(CursorType action, Event &event) Scene1200 *scene = (Scene1200 *)R2_GLOBALS._sceneManager._scene; scene->_field418 = 0; - if ((R2_GLOBALS._v56AA6 == 1) && (R2_GLOBALS._v56AA7 == 1) && (R2_GLOBALS._v56AA8 == 1)) + if ((R2_GLOBALS._ductMazePanel1State == 1) && (R2_GLOBALS._ductMazePanel2State == 1) && (R2_GLOBALS._ductMazePanel3State == 1)) scene->_field418 = 1; - else if ((R2_GLOBALS._v56AA6 == 2) && (R2_GLOBALS._v56AA7 == 1) && (R2_GLOBALS._v56AA8 == 1)) + else if ((R2_GLOBALS._ductMazePanel1State == 2) && (R2_GLOBALS._ductMazePanel2State == 1) && (R2_GLOBALS._ductMazePanel3State == 1)) scene->_field418 = 2; - else if ((R2_GLOBALS._v56AA6 == 2) && (R2_GLOBALS._v56AA7 == 1) && (R2_GLOBALS._v56AA8 == 2)) + else if ((R2_GLOBALS._ductMazePanel1State == 2) && (R2_GLOBALS._ductMazePanel2State == 1) && (R2_GLOBALS._ductMazePanel3State == 2)) scene->_field418 = 3; - else if ((R2_GLOBALS._v56AA6 == 2) && (R2_GLOBALS._v56AA7 == 3) && (R2_GLOBALS._v56AA8 == 1)) + else if ((R2_GLOBALS._ductMazePanel1State == 2) && (R2_GLOBALS._ductMazePanel2State == 3) && (R2_GLOBALS._ductMazePanel3State == 1)) scene->_field418 = 4; return true; @@ -1482,8 +1483,8 @@ void Scene1200::LaserPanel::postInit(SceneObjectList *OwnerList) { scene->_field41A = 1; R2_GLOBALS._events.setCursor(CURSOR_USE); - proc12(1003, 1, 1, 100, 40); - proc13(1200, 11, -1, -1); + setup2(1003, 1, 1, 100, 40); + setup3(1200, 11, -1, -1); R2_GLOBALS._sound2.play(259); _jumper1.init(1); _jumper2.init(2); @@ -1520,13 +1521,13 @@ void Scene1200::postInit(SceneObjectList *OwnerList) { _field418 = 0; _field41A = 0; - if ((R2_GLOBALS._v56AA6 == 1) && (R2_GLOBALS._v56AA7 == 1) && (R2_GLOBALS._v56AA8 == 1)) + if ((R2_GLOBALS._ductMazePanel1State == 1) && (R2_GLOBALS._ductMazePanel2State == 1) && (R2_GLOBALS._ductMazePanel3State == 1)) _field418 = 1; - else if ((R2_GLOBALS._v56AA6 == 2) && (R2_GLOBALS._v56AA7 == 1) && (R2_GLOBALS._v56AA8 == 1)) + else if ((R2_GLOBALS._ductMazePanel1State == 2) && (R2_GLOBALS._ductMazePanel2State == 1) && (R2_GLOBALS._ductMazePanel3State == 1)) _field418 = 2; - else if ((R2_GLOBALS._v56AA6 == 2) && (R2_GLOBALS._v56AA7 == 1) && (R2_GLOBALS._v56AA8 == 2)) + else if ((R2_GLOBALS._ductMazePanel1State == 2) && (R2_GLOBALS._ductMazePanel2State == 1) && (R2_GLOBALS._ductMazePanel3State == 2)) _field418 = 3; - else if ((R2_GLOBALS._v56AA6 == 2) && (R2_GLOBALS._v56AA7 == 3) && (R2_GLOBALS._v56AA8 == 1)) + else if ((R2_GLOBALS._ductMazePanel1State == 2) && (R2_GLOBALS._ductMazePanel2State == 3) && (R2_GLOBALS._ductMazePanel3State == 1)) _field418 = 4; R2_GLOBALS._player.postInit(); @@ -1561,7 +1562,7 @@ void Scene1200::signal() { // No break on purpose case 1203: R2_GLOBALS._player.enableControl(); - warning("_eventManager.waitEvent()"); + // CHECKME: The original is calling _eventManager.waitEvent(); _sceneMode = 2; break; case 10: @@ -1783,7 +1784,7 @@ void Scene1200::signal() { R2_GLOBALS._player.animate(ANIM_MODE_6, this); break; default: - warning("_eventManager.waitEvent()"); + // CHECKME: The original is walling _eventManager.waitEvent(); _sceneMode = 2; break; } @@ -1852,10 +1853,10 @@ void Scene1200::process(Event &event) { if (R2_GLOBALS._scientistConvIndex >= 4) R2_GLOBALS._sceneManager.changeScene(3250); else - SceneItem::display(1200, 6, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); + SceneItem::display(1200, 6, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, LIST_END); break; default: - SceneItem::display(1200, 5, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); + SceneItem::display(1200, 5, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, LIST_END); break; } event.handled = true; @@ -1868,7 +1869,7 @@ void Scene1200::process(Event &event) { switch (cellPos.x) { case 3: // It was your cell. - SceneItem::display(1200, 8, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1200, 8, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); break; case 9: R2_GLOBALS._sceneManager.changeScene(3240); @@ -1878,7 +1879,7 @@ void Scene1200::process(Event &event) { R2_GLOBALS._sceneManager.changeScene(3210); else // A vent grill - SceneItem::display(1200, 10, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1200, 10, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); break; case 17: switch (cellPos.y) { @@ -1893,21 +1894,22 @@ void Scene1200::process(Event &event) { break; default: // A vent grill - SceneItem::display(1200, 10, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1200, 10, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); break; } + break; case 33: R2_GLOBALS._sceneManager.changeScene(3245); break; default: - SceneItem::display(1200, 10, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1200, 10, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); break; } } if (cellId > 36) { // "An anti-pest laser" event.handled = true; - SceneItem::display(1200, 9, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1200, 9, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); } break; case CURSOR_TALK: @@ -1944,9 +1946,8 @@ void Scene1200::process(Event &event) { return; break; } - } else { + } else return; - } } void Scene1200::dispatch() { @@ -2203,65 +2204,86 @@ void Scene1200::startCrawling(CrawlDirection dir) { * *--------------------------------------------------------------------------*/ -Scene1337::unkObj1337sub1::unkObj1337sub1() { - _field34 = 0; - _field36 = Common::Point(0, 0); +Scene1337::Card::Card() { + _cardId = 0; + _stationPos = Common::Point(0, 0); } -void Scene1337::unkObj1337sub1::synchronize(Serializer &s) { - warning("STUBBED: unkObj1337sub1::synchronize()"); +void Scene1337::Card::synchronize(Serializer &s) { + warning("STUBBED: Card::synchronize()"); } -Scene1337::unkObj1337_1::unkObj1337_1() { - _fieldB94 = Common::Point(0, 0); - _fieldB98 = Common::Point(0, 0); - _fieldB9C = Common::Point(0, 0); - _fieldBA0 = Common::Point(0, 0); - _fieldBA4 = 0; +bool Scene1337::Card::isIn(Common::Point pt) { + if ((_stationPos.x > pt.x) || (_stationPos.x + 24 < pt.x)) + return false; + + if ((_stationPos.y > pt.y) || (_stationPos.y + 24 < pt.y)) + return false; + + return true; } -void Scene1337::unkObj1337_1::synchronize(Serializer &s) { - warning("STUBBED: unkObj1337_1::synchronize()"); +Scene1337::GameBoardSide::GameBoardSide() { + _card1Pos = Common::Point(0, 0); + _card2Pos = Common::Point(0, 0); + _card3Pos = Common::Point(0, 0); + _card4Pos = Common::Point(0, 0); + _frameNum = 0; +} + +void Scene1337::GameBoardSide::synchronize(Serializer &s) { + warning("STUBBED: GameBoardSide::synchronize()"); } Scene1337::Scene1337() { _autoplay = false; - _field3E24 = 0; - _field3E26 = 0; + _cardsAvailableNumb = 0; + _currentDiscardIndex = 0; for (int i = 0; i < 100; i++) - _field3E28[i] = 0; + _availableCardsPile[i] = 0; + + _shuffleEndedFl = false; + _currentPlayerNumb = 0; + _actionIdx1 = 0; + _actionIdx2 = 0; + _showPlayerTurn = false; + _displayHelpFl = false; + _winnerId = -1; + _instructionsDisplayedFl = false; + _instructionsWaitCount = 0; - _field423C = 0; - _field423E = 0; - _field4240 = 0; - _field4242 = 0; - _field4244 = 0; - _field4246 = 0; - _field4248 = 0; - _field424A = 0; - _field424C = 0; - _field424E = 0; + _delayedFunction = nullptr; + _actionCard1 = nullptr; + _actionCard2 = nullptr; + _actionCard3 = nullptr; + + _cursorCurRes = 0; + _cursorCurStrip = 0; + _cursorCurFrame = 0; } void Scene1337::synchronize(Serializer &s) { warning("STUBBED: Scene1337::synchronize()"); } -void Scene1337::Action1337::subD18B5(int resNum, int stripNum, int frameNum) { - warning("STUBBED: Action1337::subD18B5()"); -} - -void Scene1337::Action1337::skipFrames(int32 skipCount) { +void Scene1337::Action1337::waitFrames(int32 frameCount) { uint32 firstFrameNumber = g_globals->_events.getFrameNumber(); - uint32 tmpFrameNumber = firstFrameNumber; + uint32 curFrame = firstFrameNumber; + uint32 destFrame = firstFrameNumber + frameCount; - while (tmpFrameNumber < firstFrameNumber + skipCount) - tmpFrameNumber = g_globals->_events.getFrameNumber(); + while ((curFrame < destFrame) && !g_vm->shouldQuit()) { + TsAGE::Event event; + g_globals->_events.getEvent(event); + curFrame = g_globals->_events.getFrameNumber(); + } - warning("_eventManager.waitEvent(-1)"); + // CHECKME: The original is calling _eventManager.waitEvent(); } +/** + * Display instructions + */ void Scene1337::Action1::signal() { Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene; @@ -2272,393 +2294,396 @@ void Scene1337::Action1::signal() { scene->actionDisplay(1331, 7, 159, 10, 1, 200, 0, 7, 0, 154, 154); scene->actionDisplay(1331, 8, 159, 10, 1, 200, 0, 7, 0, 154, 154); - scene->_arrunkObj1337[1]._arr2[0]._field34 = 2; - scene->_arrunkObj1337[1]._arr2[0]._object1.postInit(); - scene->_arrunkObj1337[1]._arr2[0]._object1.setVisage(1332); - scene->_arrunkObj1337[1]._arr2[0]._object1.setPosition(scene->_arrunkObj1337[1]._arr2[0]._field36, 0); - scene->_arrunkObj1337[1]._arr2[0]._object1.setStrip(2); - scene->_arrunkObj1337[1]._arr2[0]._object1.setFrame(scene->_arrunkObj1337[1]._arr2[0]._field34); - scene->_arrunkObj1337[1]._arr2[0]._object1.fixPriority(170); - scene->setAnimationInfo(&scene->_arrunkObj1337[1]._arr2[0]); - - scene->_arrunkObj1337[1]._arr2[1]._field34 = 3; - scene->_arrunkObj1337[1]._arr2[1]._object1.postInit(); - scene->_arrunkObj1337[1]._arr2[1]._object1.setVisage(1332); - scene->_arrunkObj1337[1]._arr2[1]._object1.setPosition(scene->_arrunkObj1337[1]._arr2[1]._field36, 0); - scene->_arrunkObj1337[1]._arr2[1]._object1.setStrip(2); - scene->_arrunkObj1337[1]._arr2[1]._object1.setFrame(scene->_arrunkObj1337[1]._arr2[1]._field34); - scene->_arrunkObj1337[1]._arr2[1]._object1.fixPriority(170); - scene->setAnimationInfo(&scene->_arrunkObj1337[1]._arr2[1]); - - scene->_arrunkObj1337[2]._arr2[0]._field34 = 4; - scene->_arrunkObj1337[2]._arr2[0]._object1.postInit(); - scene->_arrunkObj1337[2]._arr2[0]._object1.setVisage(1332); - scene->_arrunkObj1337[2]._arr2[0]._object1.setPosition(scene->_arrunkObj1337[2]._arr2[0]._field36, 0); - scene->_arrunkObj1337[2]._arr2[0]._object1.setStrip(2); - scene->_arrunkObj1337[2]._arr2[0]._object1.setFrame(scene->_arrunkObj1337[2]._arr2[0]._field34); - scene->_arrunkObj1337[2]._arr2[0]._object1.fixPriority(170); - scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr2[0]); - - scene->_arrunkObj1337[3]._arr2[0]._field34 = 5; - scene->_arrunkObj1337[3]._arr2[0]._object1.postInit(); - scene->_arrunkObj1337[3]._arr2[0]._object1.setVisage(1332); - scene->_arrunkObj1337[3]._arr2[0]._object1.setPosition(scene->_arrunkObj1337[3]._arr2[0]._field36, 0); - scene->_arrunkObj1337[3]._arr2[0]._object1.setStrip(2); - scene->_arrunkObj1337[3]._arr2[0]._object1.setFrame(scene->_arrunkObj1337[3]._arr2[0]._field34); - scene->_arrunkObj1337[3]._arr2[0]._object1.fixPriority(170); - scene->setAnimationInfo(&scene->_arrunkObj1337[3]._arr2[0]); - - scene->_arrunkObj1337[3]._arr2[1]._field34 = 6; - scene->_arrunkObj1337[3]._arr2[1]._object1.postInit(); - scene->_arrunkObj1337[3]._arr2[1]._object1.setVisage(1332); - scene->_arrunkObj1337[3]._arr2[1]._object1.setPosition(scene->_arrunkObj1337[3]._arr2[1]._field36, 0); - scene->_arrunkObj1337[3]._arr2[1]._object1.setStrip(2); - scene->_arrunkObj1337[3]._arr2[1]._object1.setFrame(scene->_arrunkObj1337[3]._arr2[1]._field34); - scene->_arrunkObj1337[3]._arr2[1]._object1.fixPriority(170); - scene->setAnimationInfo(&scene->_arrunkObj1337[3]._arr2[1]); - - scene->_arrunkObj1337[3]._arr2[2]._field34 = 7; - scene->_arrunkObj1337[3]._arr2[2]._object1.postInit(); - scene->_arrunkObj1337[3]._arr2[2]._object1.setVisage(1332); - scene->_arrunkObj1337[3]._arr2[2]._object1.setPosition(scene->_arrunkObj1337[3]._arr2[2]._field36, 0); - scene->_arrunkObj1337[3]._arr2[2]._object1.setStrip(2); - scene->_arrunkObj1337[3]._arr2[2]._object1.setFrame(scene->_arrunkObj1337[3]._arr2[2]._field34); - scene->_arrunkObj1337[3]._arr2[2]._object1.fixPriority(170); - scene->setAnimationInfo(&scene->_arrunkObj1337[3]._arr2[2]); - - scene->_arrunkObj1337[0]._arr2[0]._field34 = 8; - scene->_arrunkObj1337[0]._arr2[0]._object1.postInit(); - scene->_arrunkObj1337[0]._arr2[0]._object1.setVisage(1332); - scene->_arrunkObj1337[0]._arr2[0]._object1.setPosition(scene->_arrunkObj1337[0]._arr2[0]._field36, 0); - scene->_arrunkObj1337[0]._arr2[0]._object1.setStrip(2); - scene->_arrunkObj1337[0]._arr2[0]._object1.setFrame(scene->_arrunkObj1337[0]._arr2[0]._field34); - scene->_arrunkObj1337[0]._arr2[0]._object1.fixPriority(170); - scene->setAnimationInfo(&scene->_arrunkObj1337[0]._arr2[0]); - - scene->_arrunkObj1337[0]._arr2[1]._field34 = 9; - scene->_arrunkObj1337[0]._arr2[1]._object1.postInit(); - scene->_arrunkObj1337[0]._arr2[1]._object1.setVisage(1332); - scene->_arrunkObj1337[0]._arr2[1]._object1.setPosition(scene->_arrunkObj1337[0]._arr2[1]._field36, 0); - scene->_arrunkObj1337[0]._arr2[1]._object1.setStrip(2); - scene->_arrunkObj1337[0]._arr2[1]._object1.setFrame(scene->_arrunkObj1337[0]._arr2[1]._field34); - scene->_arrunkObj1337[0]._arr2[1]._object1.fixPriority(170); - scene->setAnimationInfo(&scene->_arrunkObj1337[0]._arr2[1]); + scene->_gameBoardSide[1]._outpostStation[0]._cardId = 2; + scene->_gameBoardSide[1]._outpostStation[0]._card.postInit(); + scene->_gameBoardSide[1]._outpostStation[0]._card.setVisage(1332); + scene->_gameBoardSide[1]._outpostStation[0]._card.setPosition(scene->_gameBoardSide[1]._outpostStation[0]._stationPos, 0); + scene->_gameBoardSide[1]._outpostStation[0]._card.setStrip(2); + scene->_gameBoardSide[1]._outpostStation[0]._card.setFrame(scene->_gameBoardSide[1]._outpostStation[0]._cardId); + scene->_gameBoardSide[1]._outpostStation[0]._card.fixPriority(170); + scene->setAnimationInfo(&scene->_gameBoardSide[1]._outpostStation[0]); + + scene->_gameBoardSide[1]._outpostStation[1]._cardId = 3; + scene->_gameBoardSide[1]._outpostStation[1]._card.postInit(); + scene->_gameBoardSide[1]._outpostStation[1]._card.setVisage(1332); + scene->_gameBoardSide[1]._outpostStation[1]._card.setPosition(scene->_gameBoardSide[1]._outpostStation[1]._stationPos, 0); + scene->_gameBoardSide[1]._outpostStation[1]._card.setStrip(2); + scene->_gameBoardSide[1]._outpostStation[1]._card.setFrame(scene->_gameBoardSide[1]._outpostStation[1]._cardId); + scene->_gameBoardSide[1]._outpostStation[1]._card.fixPriority(170); + scene->setAnimationInfo(&scene->_gameBoardSide[1]._outpostStation[1]); + + scene->_gameBoardSide[2]._outpostStation[0]._cardId = 4; + scene->_gameBoardSide[2]._outpostStation[0]._card.postInit(); + scene->_gameBoardSide[2]._outpostStation[0]._card.setVisage(1332); + scene->_gameBoardSide[2]._outpostStation[0]._card.setPosition(scene->_gameBoardSide[2]._outpostStation[0]._stationPos, 0); + scene->_gameBoardSide[2]._outpostStation[0]._card.setStrip(2); + scene->_gameBoardSide[2]._outpostStation[0]._card.setFrame(scene->_gameBoardSide[2]._outpostStation[0]._cardId); + scene->setAnimationInfo(&scene->_gameBoardSide[2]._outpostStation[0]); + + scene->_gameBoardSide[3]._outpostStation[0]._cardId = 5; + scene->_gameBoardSide[3]._outpostStation[0]._card.postInit(); + scene->_gameBoardSide[3]._outpostStation[0]._card.setVisage(1332); + scene->_gameBoardSide[3]._outpostStation[0]._card.setPosition(scene->_gameBoardSide[3]._outpostStation[0]._stationPos, 0); + scene->_gameBoardSide[3]._outpostStation[0]._card.setStrip(2); + scene->_gameBoardSide[3]._outpostStation[0]._card.setFrame(scene->_gameBoardSide[3]._outpostStation[0]._cardId); + scene->_gameBoardSide[3]._outpostStation[0]._card.fixPriority(170); + scene->setAnimationInfo(&scene->_gameBoardSide[3]._outpostStation[0]); + + scene->_gameBoardSide[3]._outpostStation[1]._cardId = 6; + scene->_gameBoardSide[3]._outpostStation[1]._card.postInit(); + scene->_gameBoardSide[3]._outpostStation[1]._card.setVisage(1332); + scene->_gameBoardSide[3]._outpostStation[1]._card.setPosition(scene->_gameBoardSide[3]._outpostStation[1]._stationPos, 0); + scene->_gameBoardSide[3]._outpostStation[1]._card.setStrip(2); + scene->_gameBoardSide[3]._outpostStation[1]._card.setFrame(scene->_gameBoardSide[3]._outpostStation[1]._cardId); + scene->_gameBoardSide[3]._outpostStation[1]._card.fixPriority(170); + scene->setAnimationInfo(&scene->_gameBoardSide[3]._outpostStation[1]); + + scene->_gameBoardSide[3]._outpostStation[2]._cardId = 7; + scene->_gameBoardSide[3]._outpostStation[2]._card.postInit(); + scene->_gameBoardSide[3]._outpostStation[2]._card.setVisage(1332); + scene->_gameBoardSide[3]._outpostStation[2]._card.setPosition(scene->_gameBoardSide[3]._outpostStation[2]._stationPos, 0); + scene->_gameBoardSide[3]._outpostStation[2]._card.setStrip(2); + scene->_gameBoardSide[3]._outpostStation[2]._card.setFrame(scene->_gameBoardSide[3]._outpostStation[2]._cardId); + scene->_gameBoardSide[3]._outpostStation[2]._card.fixPriority(170); + scene->setAnimationInfo(&scene->_gameBoardSide[3]._outpostStation[2]); + + scene->_gameBoardSide[0]._outpostStation[0]._cardId = 8; + scene->_gameBoardSide[0]._outpostStation[0]._card.postInit(); + scene->_gameBoardSide[0]._outpostStation[0]._card.setVisage(1332); + scene->_gameBoardSide[0]._outpostStation[0]._card.setPosition(scene->_gameBoardSide[0]._outpostStation[0]._stationPos, 0); + scene->_gameBoardSide[0]._outpostStation[0]._card.setStrip(2); + scene->_gameBoardSide[0]._outpostStation[0]._card.setFrame(scene->_gameBoardSide[0]._outpostStation[0]._cardId); + scene->_gameBoardSide[0]._outpostStation[0]._card.fixPriority(170); + scene->setAnimationInfo(&scene->_gameBoardSide[0]._outpostStation[0]); + + scene->_gameBoardSide[0]._outpostStation[1]._cardId = 9; + scene->_gameBoardSide[0]._outpostStation[1]._card.postInit(); + scene->_gameBoardSide[0]._outpostStation[1]._card.setVisage(1332); + scene->_gameBoardSide[0]._outpostStation[1]._card.setPosition(scene->_gameBoardSide[0]._outpostStation[1]._stationPos, 0); + scene->_gameBoardSide[0]._outpostStation[1]._card.setStrip(2); + scene->_gameBoardSide[0]._outpostStation[1]._card.setFrame(scene->_gameBoardSide[0]._outpostStation[1]._cardId); + scene->_gameBoardSide[0]._outpostStation[1]._card.fixPriority(170); + scene->setAnimationInfo(&scene->_gameBoardSide[0]._outpostStation[1]); R2_GLOBALS._sceneObjects->draw(); - skipFrames(60); + waitFrames(60); scene->actionDisplay(1331, 9, 159, 10, 1, 200, 0, 7, 0, 154, 154); - scene->_arrunkObj1337[2]._arr2[1]._field34 = 2; - scene->_arrunkObj1337[2]._arr2[1]._object1.postInit(); - scene->_arrunkObj1337[2]._arr2[1]._object1.setVisage(1332); - scene->_arrunkObj1337[2]._arr2[1]._object1.setPosition(scene->_arrunkObj1337[2]._arr2[1]._field36, 0); - scene->_arrunkObj1337[2]._arr2[1]._object1.setStrip(2); - scene->_arrunkObj1337[2]._arr2[1]._object1.setFrame(scene->_arrunkObj1337[2]._arr2[1]._field34); - scene->_arrunkObj1337[2]._arr2[1]._object1.fixPriority(170); - scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr2[1]); - - scene->_arrunkObj1337[2]._arr2[2]._field34 = 3; - scene->_arrunkObj1337[2]._arr2[2]._object1.postInit(); - scene->_arrunkObj1337[2]._arr2[2]._object1.setVisage(1332); - scene->_arrunkObj1337[2]._arr2[2]._object1.setPosition(scene->_arrunkObj1337[2]._arr2[2]._field36, 0); - scene->_arrunkObj1337[2]._arr2[2]._object1.setStrip(2); - scene->_arrunkObj1337[2]._arr2[2]._object1.setFrame(scene->_arrunkObj1337[2]._arr2[2]._field34); - scene->_arrunkObj1337[2]._arr2[2]._object1.fixPriority(170); - scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr2[2]); - - scene->_arrunkObj1337[2]._arr2[3]._field34 = 5; - scene->_arrunkObj1337[2]._arr2[3]._object1.postInit(); - scene->_arrunkObj1337[2]._arr2[3]._object1.setVisage(1332); - scene->_arrunkObj1337[2]._arr2[3]._object1.setPosition(scene->_arrunkObj1337[2]._arr2[3]._field36, 0); - scene->_arrunkObj1337[2]._arr2[3]._object1.setStrip(2); - scene->_arrunkObj1337[2]._arr2[3]._object1.setFrame(scene->_arrunkObj1337[2]._arr2[3]._field34); - scene->_arrunkObj1337[2]._arr2[3]._object1.fixPriority(170); - scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr2[3]); - - scene->_arrunkObj1337[2]._arr2[4]._field34 = 6; - scene->_arrunkObj1337[2]._arr2[4]._object1.postInit(); - scene->_arrunkObj1337[2]._arr2[4]._object1.setVisage(1332); - scene->_arrunkObj1337[2]._arr2[4]._object1.setPosition(scene->_arrunkObj1337[2]._arr2[4]._field36, 0); - scene->_arrunkObj1337[2]._arr2[4]._object1.setStrip(2); - scene->_arrunkObj1337[2]._arr2[4]._object1.setFrame(scene->_arrunkObj1337[2]._arr2[4]._field34); - scene->_arrunkObj1337[2]._arr2[4]._object1.fixPriority(170); - scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr2[4]); - - scene->_arrunkObj1337[2]._arr2[5]._field34 = 7; - scene->_arrunkObj1337[2]._arr2[5]._object1.postInit(); - scene->_arrunkObj1337[2]._arr2[5]._object1.setVisage(1332); - scene->_arrunkObj1337[2]._arr2[5]._object1.setPosition(scene->_arrunkObj1337[2]._arr2[5]._field36, 0); - scene->_arrunkObj1337[2]._arr2[5]._object1.setStrip(2); - scene->_arrunkObj1337[2]._arr2[5]._object1.setFrame(scene->_arrunkObj1337[2]._arr2[5]._field34); - scene->_arrunkObj1337[2]._arr2[5]._object1.fixPriority(170); - scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr2[5]); - - scene->_arrunkObj1337[2]._arr2[6]._field34 = 8; - scene->_arrunkObj1337[2]._arr2[6]._object1.postInit(); - scene->_arrunkObj1337[2]._arr2[6]._object1.setVisage(1332); - scene->_arrunkObj1337[2]._arr2[6]._object1.setPosition(scene->_arrunkObj1337[2]._arr2[6]._field36, 0); - scene->_arrunkObj1337[2]._arr2[6]._object1.setStrip(2); - scene->_arrunkObj1337[2]._arr2[6]._object1.setFrame(scene->_arrunkObj1337[2]._arr2[6]._field34); - scene->_arrunkObj1337[2]._arr2[6]._object1.fixPriority(170); - scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr2[6]); - - scene->_arrunkObj1337[2]._arr2[7]._field34 = 9; - scene->_arrunkObj1337[2]._arr2[7]._object1.postInit(); - scene->_arrunkObj1337[2]._arr2[7]._object1.setVisage(1332); - scene->_arrunkObj1337[2]._arr2[7]._object1.setPosition(scene->_arrunkObj1337[2]._arr2[7]._field36, 0); - scene->_arrunkObj1337[2]._arr2[7]._object1.setStrip(2); - scene->_arrunkObj1337[2]._arr2[7]._object1.setFrame(scene->_arrunkObj1337[2]._arr2[7]._field34); - scene->_arrunkObj1337[2]._arr2[7]._object1.fixPriority(170); - scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr2[7]); + scene->_gameBoardSide[2]._outpostStation[1]._cardId = 2; + scene->_gameBoardSide[2]._outpostStation[1]._card.postInit(); + scene->_gameBoardSide[2]._outpostStation[1]._card.setVisage(1332); + scene->_gameBoardSide[2]._outpostStation[1]._card.setPosition(scene->_gameBoardSide[2]._outpostStation[1]._stationPos, 0); + scene->_gameBoardSide[2]._outpostStation[1]._card.setStrip(2); + scene->_gameBoardSide[2]._outpostStation[1]._card.setFrame(scene->_gameBoardSide[2]._outpostStation[1]._cardId); + scene->_gameBoardSide[2]._outpostStation[1]._card.fixPriority(170); + scene->setAnimationInfo(&scene->_gameBoardSide[2]._outpostStation[1]); + + scene->_gameBoardSide[2]._outpostStation[2]._cardId = 3; + scene->_gameBoardSide[2]._outpostStation[2]._card.postInit(); + scene->_gameBoardSide[2]._outpostStation[2]._card.setVisage(1332); + scene->_gameBoardSide[2]._outpostStation[2]._card.setPosition(scene->_gameBoardSide[2]._outpostStation[2]._stationPos, 0); + scene->_gameBoardSide[2]._outpostStation[2]._card.setStrip(2); + scene->_gameBoardSide[2]._outpostStation[2]._card.setFrame(scene->_gameBoardSide[2]._outpostStation[2]._cardId); + scene->_gameBoardSide[2]._outpostStation[2]._card.fixPriority(170); + scene->setAnimationInfo(&scene->_gameBoardSide[2]._outpostStation[2]); + + scene->_gameBoardSide[2]._outpostStation[3]._cardId = 5; + scene->_gameBoardSide[2]._outpostStation[3]._card.postInit(); + scene->_gameBoardSide[2]._outpostStation[3]._card.setVisage(1332); + scene->_gameBoardSide[2]._outpostStation[3]._card.setPosition(scene->_gameBoardSide[2]._outpostStation[3]._stationPos, 0); + scene->_gameBoardSide[2]._outpostStation[3]._card.setStrip(2); + scene->_gameBoardSide[2]._outpostStation[3]._card.setFrame(scene->_gameBoardSide[2]._outpostStation[3]._cardId); + scene->_gameBoardSide[2]._outpostStation[3]._card.fixPriority(170); + scene->setAnimationInfo(&scene->_gameBoardSide[2]._outpostStation[3]); + + scene->_gameBoardSide[2]._outpostStation[4]._cardId = 6; + scene->_gameBoardSide[2]._outpostStation[4]._card.postInit(); + scene->_gameBoardSide[2]._outpostStation[4]._card.setVisage(1332); + scene->_gameBoardSide[2]._outpostStation[4]._card.setPosition(scene->_gameBoardSide[2]._outpostStation[4]._stationPos, 0); + scene->_gameBoardSide[2]._outpostStation[4]._card.setStrip(2); + scene->_gameBoardSide[2]._outpostStation[4]._card.setFrame(scene->_gameBoardSide[2]._outpostStation[4]._cardId); + scene->_gameBoardSide[2]._outpostStation[4]._card.fixPriority(170); + scene->setAnimationInfo(&scene->_gameBoardSide[2]._outpostStation[4]); + + scene->_gameBoardSide[2]._outpostStation[5]._cardId = 7; + scene->_gameBoardSide[2]._outpostStation[5]._card.postInit(); + scene->_gameBoardSide[2]._outpostStation[5]._card.setVisage(1332); + scene->_gameBoardSide[2]._outpostStation[5]._card.setPosition(scene->_gameBoardSide[2]._outpostStation[5]._stationPos, 0); + scene->_gameBoardSide[2]._outpostStation[5]._card.setStrip(2); + scene->_gameBoardSide[2]._outpostStation[5]._card.setFrame(scene->_gameBoardSide[2]._outpostStation[5]._cardId); + scene->_gameBoardSide[2]._outpostStation[5]._card.fixPriority(170); + scene->setAnimationInfo(&scene->_gameBoardSide[2]._outpostStation[5]); + + scene->_gameBoardSide[2]._outpostStation[6]._cardId = 8; + scene->_gameBoardSide[2]._outpostStation[6]._card.postInit(); + scene->_gameBoardSide[2]._outpostStation[6]._card.setVisage(1332); + scene->_gameBoardSide[2]._outpostStation[6]._card.setPosition(scene->_gameBoardSide[2]._outpostStation[6]._stationPos, 0); + scene->_gameBoardSide[2]._outpostStation[6]._card.setStrip(2); + scene->_gameBoardSide[2]._outpostStation[6]._card.setFrame(scene->_gameBoardSide[2]._outpostStation[6]._cardId); + scene->_gameBoardSide[2]._outpostStation[6]._card.fixPriority(170); + scene->setAnimationInfo(&scene->_gameBoardSide[2]._outpostStation[6]); + + scene->_gameBoardSide[2]._outpostStation[7]._cardId = 9; + scene->_gameBoardSide[2]._outpostStation[7]._card.postInit(); + scene->_gameBoardSide[2]._outpostStation[7]._card.setVisage(1332); + scene->_gameBoardSide[2]._outpostStation[7]._card.setPosition(scene->_gameBoardSide[2]._outpostStation[7]._stationPos, 0); + scene->_gameBoardSide[2]._outpostStation[7]._card.setStrip(2); + scene->_gameBoardSide[2]._outpostStation[7]._card.setFrame(scene->_gameBoardSide[2]._outpostStation[7]._cardId); + scene->_gameBoardSide[2]._outpostStation[7]._card.fixPriority(170); + scene->setAnimationInfo(&scene->_gameBoardSide[2]._outpostStation[7]); scene->_aSound1.play(62); R2_GLOBALS._sceneObjects->draw(); - skipFrames(120); - scene->_arrunkObj1337[2]._arr2[0]._object1.remove(); - scene->_arrunkObj1337[2]._arr2[1]._object1.remove(); - scene->_arrunkObj1337[2]._arr2[2]._object1.remove(); - scene->_arrunkObj1337[2]._arr2[3]._object1.remove(); - scene->_arrunkObj1337[2]._arr2[4]._object1.remove(); - scene->_arrunkObj1337[2]._arr2[5]._object1.remove(); - scene->_arrunkObj1337[2]._arr2[6]._object1.remove(); - scene->_arrunkObj1337[2]._arr2[7]._object1.remove(); - - scene->_arrunkObj1337[1]._arr2[0]._object1.remove(); - scene->_arrunkObj1337[1]._arr2[1]._object1.remove(); - - scene->_arrunkObj1337[3]._arr2[0]._object1.remove(); - scene->_arrunkObj1337[3]._arr2[1]._object1.remove(); - scene->_arrunkObj1337[3]._arr2[2]._object1.remove(); - - scene->_arrunkObj1337[0]._arr2[0]._object1.remove(); - scene->_arrunkObj1337[0]._arr2[1]._object1.remove(); - - scene->_background2.setup2(1332, 5, 1, 165, 95, 110, 1); - - scene->_arrunkObj1337[1]._arr1[0]._object1.postInit(); - scene->_arrunkObj1337[1]._arr1[0]._object1.setVisage(1332); - scene->_arrunkObj1337[1]._arr1[0]._object1.setPosition(scene->_arrunkObj1337[1]._arr1[0]._field36, 0); - scene->_arrunkObj1337[1]._arr1[0]._object1.setStrip(1); - scene->_arrunkObj1337[1]._arr1[0]._object1.setFrame(4); - scene->_arrunkObj1337[1]._arr1[0]._object1.fixPriority(170); - - scene->_arrunkObj1337[1]._arr1[1]._object1.postInit(); - scene->_arrunkObj1337[1]._arr1[1]._object1.setVisage(1332); - scene->_arrunkObj1337[1]._arr1[1]._object1.setPosition(scene->_arrunkObj1337[1]._arr1[1]._field36, 0); - scene->_arrunkObj1337[1]._arr1[1]._object1.setStrip(1); - scene->_arrunkObj1337[1]._arr1[1]._object1.setFrame(4); - scene->_arrunkObj1337[1]._arr1[1]._object1.fixPriority(170); - - scene->_arrunkObj1337[1]._arr1[2]._object1.postInit(); - scene->_arrunkObj1337[1]._arr1[2]._object1.setVisage(1332); - scene->_arrunkObj1337[1]._arr1[2]._object1.setPosition(scene->_arrunkObj1337[1]._arr1[2]._field36, 0); - scene->_arrunkObj1337[1]._arr1[2]._object1.setStrip(1); - scene->_arrunkObj1337[1]._arr1[2]._object1.setFrame(4); - scene->_arrunkObj1337[1]._arr1[2]._object1.fixPriority(170); - - scene->_arrunkObj1337[2]._arr1[0]._field34 = 30; - scene->_arrunkObj1337[2]._arr1[0]._object1.postInit(); - scene->_arrunkObj1337[2]._arr1[0]._object1.setVisage(1332); - scene->_arrunkObj1337[2]._arr1[0]._object1.setPosition(scene->_arrunkObj1337[2]._arr1[0]._field36, 0); - scene->_arrunkObj1337[2]._arr1[0]._object1.setStrip(1); - scene->_arrunkObj1337[2]._arr1[0]._object1.setFrame(2); - scene->_arrunkObj1337[2]._arr1[0]._object1.fixPriority(170); - scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr1[0]); - - scene->_arrunkObj1337[2]._arr1[1]._field34 = 16; - scene->_arrunkObj1337[2]._arr1[1]._object1.postInit(); - scene->_arrunkObj1337[2]._arr1[1]._object1.setVisage(1332); - scene->_arrunkObj1337[2]._arr1[1]._object1.setPosition(scene->_arrunkObj1337[2]._arr1[1]._field36, 0); - scene->_arrunkObj1337[2]._arr1[1]._object1.setStrip(1); - scene->_arrunkObj1337[2]._arr1[1]._object1.setFrame(2); - scene->_arrunkObj1337[2]._arr1[1]._object1.fixPriority(170); - scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr1[1]); - - scene->_arrunkObj1337[2]._arr1[2]._field34 = 1; - scene->_arrunkObj1337[2]._arr1[2]._object1.postInit(); - scene->_arrunkObj1337[2]._arr1[2]._object1.setVisage(1332); - scene->_arrunkObj1337[2]._arr1[2]._object1.setPosition(scene->_arrunkObj1337[2]._arr1[2]._field36, 0); - scene->_arrunkObj1337[2]._arr1[2]._object1.setStrip(1); - scene->_arrunkObj1337[2]._arr1[2]._object1.setFrame(2); - scene->_arrunkObj1337[2]._arr1[2]._object1.fixPriority(170); - scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr1[2]); - - scene->_arrunkObj1337[3]._arr1[0]._object1.postInit(); - scene->_arrunkObj1337[3]._arr1[0]._object1.setVisage(1332); - scene->_arrunkObj1337[3]._arr1[0]._object1.setPosition(scene->_arrunkObj1337[3]._arr1[0]._field36, 0); - scene->_arrunkObj1337[3]._arr1[0]._object1.setStrip(1); - scene->_arrunkObj1337[3]._arr1[0]._object1.setFrame(3); - scene->_arrunkObj1337[3]._arr1[0]._object1.fixPriority(170); - - scene->_arrunkObj1337[3]._arr1[1]._object1.postInit(); - scene->_arrunkObj1337[3]._arr1[1]._object1.setVisage(1332); - scene->_arrunkObj1337[3]._arr1[1]._object1.setPosition(scene->_arrunkObj1337[3]._arr1[1]._field36, 0); - scene->_arrunkObj1337[3]._arr1[1]._object1.setStrip(1); - scene->_arrunkObj1337[3]._arr1[1]._object1.setFrame(3); - scene->_arrunkObj1337[3]._arr1[1]._object1.fixPriority(170); - - scene->_arrunkObj1337[3]._arr1[2]._object1.postInit(); - scene->_arrunkObj1337[3]._arr1[2]._object1.setVisage(1332); - scene->_arrunkObj1337[3]._arr1[2]._object1.setPosition(scene->_arrunkObj1337[3]._arr1[2]._field36, 0); - scene->_arrunkObj1337[3]._arr1[2]._object1.setStrip(1); - scene->_arrunkObj1337[3]._arr1[2]._object1.setFrame(3); - scene->_arrunkObj1337[3]._arr1[2]._object1.fixPriority(170); - - scene->_arrunkObj1337[0]._arr1[0]._object1.postInit(); - scene->_arrunkObj1337[0]._arr1[0]._object1.setVisage(1332); - scene->_arrunkObj1337[0]._arr1[0]._object1.setPosition(scene->_arrunkObj1337[0]._arr1[0]._field36, 0); - scene->_arrunkObj1337[0]._arr1[0]._object1.setStrip(1); - scene->_arrunkObj1337[0]._arr1[0]._object1.setFrame(2); - scene->_arrunkObj1337[0]._arr1[0]._object1.fixPriority(170); - - scene->_arrunkObj1337[0]._arr1[1]._object1.postInit(); - scene->_arrunkObj1337[0]._arr1[1]._object1.setVisage(1332); - scene->_arrunkObj1337[0]._arr1[1]._object1.setPosition(scene->_arrunkObj1337[0]._arr1[1]._field36, 0); - scene->_arrunkObj1337[0]._arr1[1]._object1.setStrip(1); - scene->_arrunkObj1337[0]._arr1[1]._object1.setFrame(2); - scene->_arrunkObj1337[0]._arr1[1]._object1.fixPriority(170); - - scene->_arrunkObj1337[0]._arr1[2]._object1.postInit(); - scene->_arrunkObj1337[0]._arr1[2]._object1.setVisage(1332); - scene->_arrunkObj1337[0]._arr1[2]._object1.setPosition(scene->_arrunkObj1337[0]._arr1[2]._field36, 0); - scene->_arrunkObj1337[0]._arr1[2]._object1.setStrip(1); - scene->_arrunkObj1337[0]._arr1[2]._object1.setFrame(2); - scene->_arrunkObj1337[0]._arr1[2]._object1.fixPriority(170); + waitFrames(120); + scene->_gameBoardSide[2]._outpostStation[0]._card.remove(); + scene->_gameBoardSide[2]._outpostStation[1]._card.remove(); + scene->_gameBoardSide[2]._outpostStation[2]._card.remove(); + scene->_gameBoardSide[2]._outpostStation[3]._card.remove(); + scene->_gameBoardSide[2]._outpostStation[4]._card.remove(); + scene->_gameBoardSide[2]._outpostStation[5]._card.remove(); + scene->_gameBoardSide[2]._outpostStation[6]._card.remove(); + scene->_gameBoardSide[2]._outpostStation[7]._card.remove(); + + scene->_gameBoardSide[1]._outpostStation[0]._card.remove(); + scene->_gameBoardSide[1]._outpostStation[1]._card.remove(); + + scene->_gameBoardSide[3]._outpostStation[0]._card.remove(); + scene->_gameBoardSide[3]._outpostStation[1]._card.remove(); + scene->_gameBoardSide[3]._outpostStation[2]._card.remove(); + + scene->_gameBoardSide[0]._outpostStation[0]._card.remove(); + scene->_gameBoardSide[0]._outpostStation[1]._card.remove(); + + scene->_stockPile.setup(1332, 5, 1); + scene->_stockPile.setPosition(Common::Point(165, 95)); + scene->_stockPile.setPriority(110); + scene->_stockPile._effect = EFFECT_SHADED; + scene->_stockPile.show(); + + scene->_gameBoardSide[1]._handCard[0]._card.postInit(); + scene->_gameBoardSide[1]._handCard[0]._card.setVisage(1332); + scene->_gameBoardSide[1]._handCard[0]._card.setPosition(scene->_gameBoardSide[1]._handCard[0]._stationPos, 0); + scene->_gameBoardSide[1]._handCard[0]._card.setStrip(1); + scene->_gameBoardSide[1]._handCard[0]._card.setFrame(4); + scene->_gameBoardSide[1]._handCard[0]._card.fixPriority(170); + + scene->_gameBoardSide[1]._handCard[1]._card.postInit(); + scene->_gameBoardSide[1]._handCard[1]._card.setVisage(1332); + scene->_gameBoardSide[1]._handCard[1]._card.setPosition(scene->_gameBoardSide[1]._handCard[1]._stationPos, 0); + scene->_gameBoardSide[1]._handCard[1]._card.setStrip(1); + scene->_gameBoardSide[1]._handCard[1]._card.setFrame(4); + scene->_gameBoardSide[1]._handCard[1]._card.fixPriority(170); + + scene->_gameBoardSide[1]._handCard[2]._card.postInit(); + scene->_gameBoardSide[1]._handCard[2]._card.setVisage(1332); + scene->_gameBoardSide[1]._handCard[2]._card.setPosition(scene->_gameBoardSide[1]._handCard[2]._stationPos, 0); + scene->_gameBoardSide[1]._handCard[2]._card.setStrip(1); + scene->_gameBoardSide[1]._handCard[2]._card.setFrame(4); + scene->_gameBoardSide[1]._handCard[2]._card.fixPriority(170); + + scene->_gameBoardSide[2]._handCard[0]._cardId = 30; + scene->_gameBoardSide[2]._handCard[0]._card.postInit(); + scene->_gameBoardSide[2]._handCard[0]._card.setVisage(1332); + scene->_gameBoardSide[2]._handCard[0]._card.setPosition(scene->_gameBoardSide[2]._handCard[0]._stationPos, 0); + scene->_gameBoardSide[2]._handCard[0]._card.setStrip(1); + scene->_gameBoardSide[2]._handCard[0]._card.setFrame(2); + scene->_gameBoardSide[2]._handCard[0]._card.fixPriority(170); + scene->setAnimationInfo(&scene->_gameBoardSide[2]._handCard[0]); + + scene->_gameBoardSide[2]._handCard[1]._cardId = 16; + scene->_gameBoardSide[2]._handCard[1]._card.postInit(); + scene->_gameBoardSide[2]._handCard[1]._card.setVisage(1332); + scene->_gameBoardSide[2]._handCard[1]._card.setPosition(scene->_gameBoardSide[2]._handCard[1]._stationPos, 0); + scene->_gameBoardSide[2]._handCard[1]._card.setStrip(1); + scene->_gameBoardSide[2]._handCard[1]._card.setFrame(2); + scene->_gameBoardSide[2]._handCard[1]._card.fixPriority(170); + scene->setAnimationInfo(&scene->_gameBoardSide[2]._handCard[1]); + + scene->_gameBoardSide[2]._handCard[2]._cardId = 1; + scene->_gameBoardSide[2]._handCard[2]._card.postInit(); + scene->_gameBoardSide[2]._handCard[2]._card.setVisage(1332); + scene->_gameBoardSide[2]._handCard[2]._card.setPosition(scene->_gameBoardSide[2]._handCard[2]._stationPos, 0); + scene->_gameBoardSide[2]._handCard[2]._card.setStrip(1); + scene->_gameBoardSide[2]._handCard[2]._card.setFrame(2); + scene->_gameBoardSide[2]._handCard[2]._card.fixPriority(170); + scene->setAnimationInfo(&scene->_gameBoardSide[2]._handCard[2]); + + scene->_gameBoardSide[3]._handCard[0]._card.postInit(); + scene->_gameBoardSide[3]._handCard[0]._card.setVisage(1332); + scene->_gameBoardSide[3]._handCard[0]._card.setPosition(scene->_gameBoardSide[3]._handCard[0]._stationPos, 0); + scene->_gameBoardSide[3]._handCard[0]._card.setStrip(1); + scene->_gameBoardSide[3]._handCard[0]._card.setFrame(3); + scene->_gameBoardSide[3]._handCard[0]._card.fixPriority(170); + + scene->_gameBoardSide[3]._handCard[1]._card.postInit(); + scene->_gameBoardSide[3]._handCard[1]._card.setVisage(1332); + scene->_gameBoardSide[3]._handCard[1]._card.setPosition(scene->_gameBoardSide[3]._handCard[1]._stationPos, 0); + scene->_gameBoardSide[3]._handCard[1]._card.setStrip(1); + scene->_gameBoardSide[3]._handCard[1]._card.setFrame(3); + scene->_gameBoardSide[3]._handCard[1]._card.fixPriority(170); + + scene->_gameBoardSide[3]._handCard[2]._card.postInit(); + scene->_gameBoardSide[3]._handCard[2]._card.setVisage(1332); + scene->_gameBoardSide[3]._handCard[2]._card.setPosition(scene->_gameBoardSide[3]._handCard[2]._stationPos, 0); + scene->_gameBoardSide[3]._handCard[2]._card.setStrip(1); + scene->_gameBoardSide[3]._handCard[2]._card.setFrame(3); + scene->_gameBoardSide[3]._handCard[2]._card.fixPriority(170); + + scene->_gameBoardSide[0]._handCard[0]._card.postInit(); + scene->_gameBoardSide[0]._handCard[0]._card.setVisage(1332); + scene->_gameBoardSide[0]._handCard[0]._card.setPosition(scene->_gameBoardSide[0]._handCard[0]._stationPos, 0); + scene->_gameBoardSide[0]._handCard[0]._card.setStrip(1); + scene->_gameBoardSide[0]._handCard[0]._card.setFrame(2); + scene->_gameBoardSide[0]._handCard[0]._card.fixPriority(170); + + scene->_gameBoardSide[0]._handCard[1]._card.postInit(); + scene->_gameBoardSide[0]._handCard[1]._card.setVisage(1332); + scene->_gameBoardSide[0]._handCard[1]._card.setPosition(scene->_gameBoardSide[0]._handCard[1]._stationPos, 0); + scene->_gameBoardSide[0]._handCard[1]._card.setStrip(1); + scene->_gameBoardSide[0]._handCard[1]._card.setFrame(2); + scene->_gameBoardSide[0]._handCard[1]._card.fixPriority(170); + + scene->_gameBoardSide[0]._handCard[2]._card.postInit(); + scene->_gameBoardSide[0]._handCard[2]._card.setVisage(1332); + scene->_gameBoardSide[0]._handCard[2]._card.setPosition(scene->_gameBoardSide[0]._handCard[2]._stationPos, 0); + scene->_gameBoardSide[0]._handCard[2]._card.setStrip(1); + scene->_gameBoardSide[0]._handCard[2]._card.setFrame(2); + scene->_gameBoardSide[0]._handCard[2]._card.fixPriority(170); R2_GLOBALS._sceneObjects->draw(); scene->actionDisplay(1331, 10, 159, 10, 1, 200, 0, 7, 0, 154, 154); - scene->_item2._object1.setPosition(Common::Point(162, 95), 0); - scene->_item2._object1.show(); + scene->_animatedCard._card.setPosition(Common::Point(162, 95), 0); + scene->_animatedCard._card.show(); scene->_aSound2.play(61); Common::Point pt(91, 174); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &pt, this); + scene->_animatedCard._card.addMover(mover, &pt, this); } break; case 2: { - scene->_arrunkObj1337[2]._arr1[3]._field34 = 2; - scene->_arrunkObj1337[2]._arr1[3]._object1.postInit(); - scene->_arrunkObj1337[2]._arr1[3]._object1.setVisage(1332); - scene->_arrunkObj1337[2]._arr1[3]._object1.setPosition(scene->_arrunkObj1337[2]._arr1[3]._field36, 0); - scene->_arrunkObj1337[2]._arr1[3]._object1.setStrip(1); - scene->_arrunkObj1337[2]._arr1[3]._object1.setFrame(2); - scene->_arrunkObj1337[2]._arr1[3]._object1.fixPriority(170); + scene->_gameBoardSide[2]._handCard[3]._cardId = 2; + scene->_gameBoardSide[2]._handCard[3]._card.postInit(); + scene->_gameBoardSide[2]._handCard[3]._card.setVisage(1332); + scene->_gameBoardSide[2]._handCard[3]._card.setPosition(scene->_gameBoardSide[2]._handCard[3]._stationPos, 0); + scene->_gameBoardSide[2]._handCard[3]._card.setStrip(1); + scene->_gameBoardSide[2]._handCard[3]._card.setFrame(2); + scene->_gameBoardSide[2]._handCard[3]._card.fixPriority(170); - scene->_item2._object1.hide(); - scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr1[3]); + scene->_animatedCard._card.hide(); + scene->setAnimationInfo(&scene->_gameBoardSide[2]._handCard[3]); R2_GLOBALS._sceneObjects->draw(); - skipFrames(60); + waitFrames(60); scene->actionDisplay(1331, 11, 159, 10, 1, 200, 0, 7, 0, 154, 154); scene->actionDisplay(1331, 12, 159, 10, 1, 200, 0, 7, 0, 154, 154); - scene->_arrunkObj1337[2]._arr2[1]._field34 = 1; - scene->_arrunkObj1337[2]._arr2[1]._object1.postInit(); - scene->_arrunkObj1337[2]._arr2[1]._object1.setVisage(1332); - scene->_arrunkObj1337[2]._arr2[1]._object1.setPosition(scene->_arrunkObj1337[2]._arr2[1]._field36, 0); - scene->_arrunkObj1337[2]._arr2[1]._object1.hide(); + scene->_gameBoardSide[2]._outpostStation[1]._cardId = 1; + scene->_gameBoardSide[2]._outpostStation[1]._card.postInit(); + scene->_gameBoardSide[2]._outpostStation[1]._card.setVisage(1332); + scene->_gameBoardSide[2]._outpostStation[1]._card.setPosition(scene->_gameBoardSide[2]._outpostStation[1]._stationPos, 0); + scene->_gameBoardSide[2]._outpostStation[1]._card.hide(); - scene->_item2._object1.setStrip(scene->_arrunkObj1337[2]._arr1[2]._object1._strip); - scene->_item2._object1.setFrame(scene->_arrunkObj1337[2]._arr1[2]._object1._frame); - scene->_item2._object1.animate(ANIM_MODE_NONE, NULL); + scene->_animatedCard._card.setStrip(scene->_gameBoardSide[2]._handCard[2]._card._strip); + scene->_animatedCard._card.setFrame(scene->_gameBoardSide[2]._handCard[2]._card._frame); + scene->_animatedCard._card.animate(ANIM_MODE_NONE, NULL); - scene->_arrunkObj1337[2]._arr1[2]._field34 = 0; - scene->_arrunkObj1337[2]._arr1[2]._object1.remove(); + scene->_gameBoardSide[2]._handCard[2]._cardId = 0; + scene->_gameBoardSide[2]._handCard[2]._card.remove(); - scene->_item2._object1.setPosition(scene->_arrunkObj1337[2]._arr1[2]._field36, 0); - scene->_item2._object1.show(); + scene->_animatedCard._card.setPosition(scene->_gameBoardSide[2]._handCard[2]._stationPos, 0); + scene->_animatedCard._card.show(); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &scene->_arrunkObj1337[2]._arr2[1]._field36, this); + scene->_animatedCard._card.addMover(mover, &scene->_gameBoardSide[2]._outpostStation[1]._stationPos, this); } break; case 3: { - scene->_item2._object1.hide(); - scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr2[1]); + scene->_animatedCard._card.hide(); + scene->setAnimationInfo(&scene->_gameBoardSide[2]._outpostStation[1]); scene->_aSound1.play(59); R2_GLOBALS._sceneObjects->draw(); - skipFrames(60); + waitFrames(60); scene->actionDisplay(1331, 13, 159, 10, 1, 200, 0, 7, 0, 154, 154); - scene->_arrunkObj1337[2]._arr2[1]._field34 = scene->_arrunkObj1337[2]._arr1[3]._field34; + scene->_gameBoardSide[2]._outpostStation[1]._cardId = scene->_gameBoardSide[2]._handCard[3]._cardId; - scene->_item2._object1.setStrip(scene->_arrunkObj1337[2]._arr1[3]._object1._strip); - scene->_item2._object1.setFrame(scene->_arrunkObj1337[2]._arr1[3]._object1._frame); + scene->_animatedCard._card.setStrip(scene->_gameBoardSide[2]._handCard[3]._card._strip); + scene->_animatedCard._card.setFrame(scene->_gameBoardSide[2]._handCard[3]._card._frame); - scene->_arrunkObj1337[2]._arr1[3]._field34 = 0; - scene->_arrunkObj1337[2]._arr1[3]._object1.remove(); + scene->_gameBoardSide[2]._handCard[3]._cardId = 0; + scene->_gameBoardSide[2]._handCard[3]._card.remove(); - scene->_item2._object1.setPosition(scene->_arrunkObj1337[2]._arr1[3]._field36, 0); - scene->_item2._object1.show(); + scene->_animatedCard._card.setPosition(scene->_gameBoardSide[2]._handCard[3]._stationPos, 0); + scene->_animatedCard._card.show(); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &scene->_arrunkObj1337[2]._arr2[1]._field36, this); + scene->_animatedCard._card.addMover(mover, &scene->_gameBoardSide[2]._outpostStation[1]._stationPos, this); } break; case 4: { - scene->_item2._object1.hide(); - scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr2[1]); + scene->_animatedCard._card.hide(); + scene->setAnimationInfo(&scene->_gameBoardSide[2]._outpostStation[1]); scene->_aSound1.play(59); - scene->_item7._field34 = 1; - scene->_item7._object1.hide(); + scene->_discardPile._cardId = 1; + scene->_discardPile._card.hide(); - scene->_item2._object1.setStrip(5); - scene->_item2._object1.setFrame(1); - scene->_item2._object1.animate(ANIM_MODE_2, NULL); - scene->_item2._object1.setPosition(scene->_arrunkObj1337[2]._arr2[1]._field36, 0); - scene->_item2._object1.show(); + scene->_animatedCard._card.setStrip(5); + scene->_animatedCard._card.setFrame(1); + scene->_animatedCard._card.animate(ANIM_MODE_2, NULL); + scene->_animatedCard._card.setPosition(scene->_gameBoardSide[2]._outpostStation[1]._stationPos, 0); + scene->_animatedCard._card.show(); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &scene->_item7._field36, this); + scene->_animatedCard._card.addMover(mover, &scene->_discardPile._stationPos, this); } break; case 5: { - scene->_item2._object1.hide(); + scene->_animatedCard._card.hide(); - scene->_item7._object1.postInit(); - scene->_item7._object1.setVisage(1332); - scene->_item7._object1.setPosition(scene->_item7._field36, 0); - scene->setAnimationInfo(&scene->_item7); + scene->_discardPile._card.postInit(); + scene->_discardPile._card.setVisage(1332); + scene->_discardPile._card.setPosition(scene->_discardPile._stationPos, 0); + scene->setAnimationInfo(&scene->_discardPile); scene->_aSound2.play(61); R2_GLOBALS._sceneObjects->draw(); - skipFrames(60); + waitFrames(60); scene->actionDisplay(1331, 14, 159, 10, 1, 200, 0, 7, 0, 154, 154); - scene->_arrunkObj1337[2]._arr3[0]._object1.postInit(); - scene->_arrunkObj1337[2]._arr3[0]._object1.setVisage(1332); - scene->_arrunkObj1337[2]._arr3[0]._object1.setPosition(scene->_arrunkObj1337[2]._arr3[0]._field36, 0); - scene->_arrunkObj1337[2]._arr3[0]._object1.hide(); + scene->_gameBoardSide[2]._delayCard._card.postInit(); + scene->_gameBoardSide[2]._delayCard._card.setVisage(1332); + scene->_gameBoardSide[2]._delayCard._card.setPosition(scene->_gameBoardSide[2]._delayCard._stationPos, 0); + scene->_gameBoardSide[2]._delayCard._card.hide(); - scene->_arrunkObj1337[3]._arr1[2]._field34 = 0; - scene->_arrunkObj1337[3]._arr1[2].remove(); + scene->_gameBoardSide[3]._handCard[2]._cardId = 0; + scene->_gameBoardSide[3]._handCard[2].remove(); - scene->_item2._object1.setPosition(scene->_arrunkObj1337[3]._arr1[2]._field36, 0); - scene->_item2._object1.show(); + scene->_animatedCard._card.setPosition(scene->_gameBoardSide[3]._handCard[2]._stationPos, 0); + scene->_animatedCard._card.show(); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &scene->_arrunkObj1337[2]._arr3[0]._field36, this); + scene->_animatedCard._card.addMover(mover, &scene->_gameBoardSide[2]._delayCard._stationPos, this); } break; case 6: { - scene->_item2._object1.hide(); - scene->_arrunkObj1337[2]._arr3[0]._field34 = 21; - scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr3[0]); + scene->_animatedCard._card.hide(); + scene->_gameBoardSide[2]._delayCard._cardId = 21; + scene->setAnimationInfo(&scene->_gameBoardSide[2]._delayCard); scene->_aSound1.play(57); R2_GLOBALS._sceneObjects->draw(); - skipFrames(60); + waitFrames(60); scene->actionDisplay(1331, 15, 159, 10, 1, 200, 0, 7, 0, 154, 154); int tmpVal = 15; @@ -2667,89 +2692,89 @@ void Scene1337::Action1::signal() { for (i = 0; i <= 7; i++) { tmpVal += 29; - scene->_arrObject1[i].postInit(); - scene->_arrObject1[i].setVisage(1332); - scene->_arrObject1[i].setPosition(Common::Point(tmpVal, 90), 0); - scene->_arrObject1[i].setStrip(3); - scene->_arrObject1[i].fixPriority(190); - - scene->_arrObject2[i].postInit(); - scene->_arrObject2[i].setVisage(1332); - scene->_arrObject2[i].setPosition(Common::Point(tmpVal, 90), 0); - scene->_arrObject2[i].setStrip(7); - scene->_arrObject2[i].setFrame(1); - scene->_arrObject2[i].fixPriority(180); - } - - scene->_arrObject1[0].setFrame(1); - scene->_arrObject1[1].setFrame(3); - scene->_arrObject1[2].setFrame(6); - scene->_arrObject1[3].setFrame(8); - scene->_arrObject1[4].setFrame(9); - scene->_arrObject1[5].setFrame(10); - scene->_arrObject1[6].setFrame(11); - scene->_arrObject1[7].setFrame(12); + scene->_upperDisplayCard[i].postInit(); + scene->_upperDisplayCard[i].setVisage(1332); + scene->_upperDisplayCard[i].setPosition(Common::Point(tmpVal, 90), 0); + scene->_upperDisplayCard[i].setStrip(3); + scene->_upperDisplayCard[i].fixPriority(190); + + scene->_lowerDisplayCard[i].postInit(); + scene->_lowerDisplayCard[i].setVisage(1332); + scene->_lowerDisplayCard[i].setPosition(Common::Point(tmpVal, 90), 0); + scene->_lowerDisplayCard[i].setStrip(7); + scene->_lowerDisplayCard[i].setFrame(1); + scene->_lowerDisplayCard[i].fixPriority(180); + } + + scene->_upperDisplayCard[0].setFrame(1); + scene->_upperDisplayCard[1].setFrame(3); + scene->_upperDisplayCard[2].setFrame(6); + scene->_upperDisplayCard[3].setFrame(8); + scene->_upperDisplayCard[4].setFrame(9); + scene->_upperDisplayCard[5].setFrame(10); + scene->_upperDisplayCard[6].setFrame(11); + scene->_upperDisplayCard[7].setFrame(12); R2_GLOBALS._sceneObjects->draw(); - skipFrames(240); + waitFrames(240); - scene->_arrObject1[0].remove(); - scene->_arrObject1[1].remove(); - scene->_arrObject1[2].remove(); - scene->_arrObject1[3].remove(); - scene->_arrObject1[4].remove(); - scene->_arrObject1[5].remove(); - scene->_arrObject1[6].remove(); - scene->_arrObject1[7].remove(); + scene->_upperDisplayCard[0].remove(); + scene->_upperDisplayCard[1].remove(); + scene->_upperDisplayCard[2].remove(); + scene->_upperDisplayCard[3].remove(); + scene->_upperDisplayCard[4].remove(); + scene->_upperDisplayCard[5].remove(); + scene->_upperDisplayCard[6].remove(); + scene->_upperDisplayCard[7].remove(); - scene->_arrObject2[0].remove(); - scene->_arrObject2[1].remove(); - scene->_arrObject2[2].remove(); - scene->_arrObject2[3].remove(); - scene->_arrObject2[4].remove(); - scene->_arrObject2[5].remove(); - scene->_arrObject2[6].remove(); - scene->_arrObject2[7].remove(); + scene->_lowerDisplayCard[0].remove(); + scene->_lowerDisplayCard[1].remove(); + scene->_lowerDisplayCard[2].remove(); + scene->_lowerDisplayCard[3].remove(); + scene->_lowerDisplayCard[4].remove(); + scene->_lowerDisplayCard[5].remove(); + scene->_lowerDisplayCard[6].remove(); + scene->_lowerDisplayCard[7].remove(); - scene->_item7._field34 = scene->_arrunkObj1337[2]._arr3[0]._field34; + scene->_discardPile._cardId = scene->_gameBoardSide[2]._delayCard._cardId; - scene->_arrunkObj1337[2]._arr3[0]._field34 = 0; - scene->_arrunkObj1337[2]._arr3[0]._object1.remove(); + scene->_gameBoardSide[2]._delayCard._cardId = 0; + scene->_gameBoardSide[2]._delayCard._card.remove(); - scene->_item2._object1.setPosition(scene->_arrunkObj1337[2]._arr3[0]._field36, 0); - scene->_item2._object1.show(); + scene->_animatedCard._card.setPosition(scene->_gameBoardSide[2]._delayCard._stationPos, 0); + scene->_animatedCard._card.show(); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &scene->_item7._field36, this); + scene->_animatedCard._card.addMover(mover, &scene->_discardPile._stationPos, this); } break; case 7: { - scene->_item2._object1.hide(); - scene->setAnimationInfo(&scene->_item7); + scene->_animatedCard._card.hide(); + scene->setAnimationInfo(&scene->_discardPile); scene->_aSound2.play(61); R2_GLOBALS._sceneObjects->draw(); - scene->_arrunkObj1337[2]._arr3[0]._object1.postInit(); - scene->_arrunkObj1337[2]._arr3[0]._object1.setVisage(1332); - scene->_arrunkObj1337[2]._arr3[0]._object1.setPosition(scene->_arrunkObj1337[2]._arr3[0]._field36, 0); - scene->_arrunkObj1337[2]._arr3[0]._object1.hide(); + scene->_gameBoardSide[2]._delayCard._card.postInit(); + scene->_gameBoardSide[2]._delayCard._card.setVisage(1332); + scene->_gameBoardSide[2]._delayCard._card.setPosition(scene->_gameBoardSide[2]._delayCard._stationPos, 0); + scene->_gameBoardSide[2]._delayCard._card.hide(); - scene->_arrunkObj1337[3]._arr1[1]._field34 = 0; - scene->_arrunkObj1337[3]._arr1[1].remove(); + scene->_gameBoardSide[3]._handCard[1]._cardId = 0; + scene->_gameBoardSide[3]._handCard[1].remove(); - scene->_item2._object1.setPosition(scene->_arrunkObj1337[3]._arr1[1]._field36, 0); - scene->_item2._object1.show(); + scene->_animatedCard._card.setPosition(scene->_gameBoardSide[3]._handCard[1]._stationPos, 0); + scene->_animatedCard._card.show(); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &scene->_arrunkObj1337[2]._arr3[0]._field36, this); + scene->_animatedCard._card.addMover(mover, &scene->_gameBoardSide[2]._delayCard._stationPos, this); } break; case 8: { - scene->_item2._object1.hide(); - scene->_arrunkObj1337[2]._arr3[0]._field34 = 14; - scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr3[0]); + scene->_animatedCard._card.hide(); + scene->_gameBoardSide[2]._delayCard._cardId = 14; + scene->setAnimationInfo(&scene->_gameBoardSide[2]._delayCard); scene->_aSound1.play(57); R2_GLOBALS._sceneObjects->draw(); @@ -2760,219 +2785,219 @@ void Scene1337::Action1::signal() { for (i = 0; i <= 3; i++) { tmpVal += 29; - scene->_arrObject1[i].postInit(); - scene->_arrObject1[i].setVisage(1332); - scene->_arrObject1[i].setPosition(Common::Point(tmpVal, 71), 0); - scene->_arrObject1[i].setStrip(3); - scene->_arrObject1[i].fixPriority(190); + scene->_upperDisplayCard[i].postInit(); + scene->_upperDisplayCard[i].setVisage(1332); + scene->_upperDisplayCard[i].setPosition(Common::Point(tmpVal, 71), 0); + scene->_upperDisplayCard[i].setStrip(3); + scene->_upperDisplayCard[i].fixPriority(190); - scene->_arrObject2[i].postInit(); - scene->_arrObject2[i].setVisage(1332); - scene->_arrObject2[i].setPosition(Common::Point(tmpVal, 71), 0); - scene->_arrObject2[i].setStrip(7); - scene->_arrObject2[i].setFrame(1); - scene->_arrObject2[i].fixPriority(180); + scene->_lowerDisplayCard[i].postInit(); + scene->_lowerDisplayCard[i].setVisage(1332); + scene->_lowerDisplayCard[i].setPosition(Common::Point(tmpVal, 71), 0); + scene->_lowerDisplayCard[i].setStrip(7); + scene->_lowerDisplayCard[i].setFrame(1); + scene->_lowerDisplayCard[i].fixPriority(180); } - scene->_arrObject1[0].setFrame(2); - scene->_arrObject1[1].setFrame(5); - scene->_arrObject1[2].setFrame(7); - scene->_arrObject1[3].setFrame(15); + scene->_upperDisplayCard[0].setFrame(2); + scene->_upperDisplayCard[1].setFrame(5); + scene->_upperDisplayCard[2].setFrame(7); + scene->_upperDisplayCard[3].setFrame(15); R2_GLOBALS._sceneObjects->draw(); - skipFrames(240); + waitFrames(240); scene->actionDisplay(1331, 17, 159, 10, 1, 200, 0, 7, 0, 154, 154); tmpVal = 72; for (i = 4; i <= 7; i++) { tmpVal += 29; - scene->_arrObject1[i].postInit(); - scene->_arrObject1[i].setVisage(1332); - scene->_arrObject1[i].setPosition(Common::Point(tmpVal, 100), 0); - scene->_arrObject1[i].setStrip(4); - scene->_arrObject1[i].fixPriority(190); + scene->_upperDisplayCard[i].postInit(); + scene->_upperDisplayCard[i].setVisage(1332); + scene->_upperDisplayCard[i].setPosition(Common::Point(tmpVal, 100), 0); + scene->_upperDisplayCard[i].setStrip(4); + scene->_upperDisplayCard[i].fixPriority(190); - scene->_arrObject2[i].postInit(); - scene->_arrObject2[i].setVisage(1332); - scene->_arrObject2[i].setPosition(Common::Point(tmpVal, 100), 0); - scene->_arrObject2[i].setStrip(7); - scene->_arrObject2[i].setFrame(1); - scene->_arrObject2[i].fixPriority(180); + scene->_lowerDisplayCard[i].postInit(); + scene->_lowerDisplayCard[i].setVisage(1332); + scene->_lowerDisplayCard[i].setPosition(Common::Point(tmpVal, 100), 0); + scene->_lowerDisplayCard[i].setStrip(7); + scene->_lowerDisplayCard[i].setFrame(1); + scene->_lowerDisplayCard[i].fixPriority(180); } - scene->_arrObject1[4].setFrame(1); - scene->_arrObject1[5].setFrame(5); - scene->_arrObject1[6].setFrame(7); - scene->_arrObject1[7].setFrame(3); + scene->_upperDisplayCard[4].setFrame(1); + scene->_upperDisplayCard[5].setFrame(5); + scene->_upperDisplayCard[6].setFrame(7); + scene->_upperDisplayCard[7].setFrame(3); R2_GLOBALS._sceneObjects->draw(); - skipFrames(240); + waitFrames(240); - scene->_arrObject1[0].remove(); - scene->_arrObject1[1].remove(); - scene->_arrObject1[2].remove(); - scene->_arrObject1[3].remove(); - scene->_arrObject1[4].remove(); - scene->_arrObject1[5].remove(); - scene->_arrObject1[6].remove(); - scene->_arrObject1[7].remove(); + scene->_upperDisplayCard[0].remove(); + scene->_upperDisplayCard[1].remove(); + scene->_upperDisplayCard[2].remove(); + scene->_upperDisplayCard[3].remove(); + scene->_upperDisplayCard[4].remove(); + scene->_upperDisplayCard[5].remove(); + scene->_upperDisplayCard[6].remove(); + scene->_upperDisplayCard[7].remove(); - scene->_arrObject2[0].remove(); - scene->_arrObject2[1].remove(); - scene->_arrObject2[2].remove(); - scene->_arrObject2[3].remove(); - scene->_arrObject2[4].remove(); - scene->_arrObject2[5].remove(); - scene->_arrObject2[6].remove(); - scene->_arrObject2[7].remove(); + scene->_lowerDisplayCard[0].remove(); + scene->_lowerDisplayCard[1].remove(); + scene->_lowerDisplayCard[2].remove(); + scene->_lowerDisplayCard[3].remove(); + scene->_lowerDisplayCard[4].remove(); + scene->_lowerDisplayCard[5].remove(); + scene->_lowerDisplayCard[6].remove(); + scene->_lowerDisplayCard[7].remove(); - scene->_item7._field34 = scene->_arrunkObj1337[2]._arr1[0]._field34; + scene->_discardPile._cardId = scene->_gameBoardSide[2]._handCard[0]._cardId; - scene->_item2._object1.setStrip(scene->_arrunkObj1337[2]._arr1[0]._object1._strip); - scene->_item2._object1.setFrame(scene->_arrunkObj1337[2]._arr1[0]._object1._frame); - scene->_item2._object1.animate(ANIM_MODE_NONE, NULL); + scene->_animatedCard._card.setStrip(scene->_gameBoardSide[2]._handCard[0]._card._strip); + scene->_animatedCard._card.setFrame(scene->_gameBoardSide[2]._handCard[0]._card._frame); + scene->_animatedCard._card.animate(ANIM_MODE_NONE, NULL); - scene->_arrunkObj1337[2]._arr1[0]._field34 = 0; - scene->_arrunkObj1337[2]._arr1[0]._object1.remove(); + scene->_gameBoardSide[2]._handCard[0]._cardId = 0; + scene->_gameBoardSide[2]._handCard[0]._card.remove(); - scene->_item2._object1.setPosition(scene->_arrunkObj1337[2]._arr1[0]._field36, 0); - scene->_item2._object1.show(); + scene->_animatedCard._card.setPosition(scene->_gameBoardSide[2]._handCard[0]._stationPos, 0); + scene->_animatedCard._card.show(); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &scene->_arrunkObj1337[2]._arr3[0]._field36, this); + scene->_animatedCard._card.addMover(mover, &scene->_gameBoardSide[2]._delayCard._stationPos, this); } break; case 9: { scene->_aSound1.play(58); - scene->_arrunkObj1337[2]._arr3[0]._field34 = 0; - scene->_arrunkObj1337[2]._arr3[0].remove(); - scene->_item2._object1.setStrip(5); - scene->_item2._object1.setFrame(1); - scene->_item2._object1.animate(ANIM_MODE_2, NULL); - scene->_item2._object1.setPosition(scene->_arrunkObj1337[2]._arr3[0]._field36, 0); - scene->_item2._object1.show(); + scene->_gameBoardSide[2]._delayCard._cardId = 0; + scene->_gameBoardSide[2]._delayCard.remove(); + scene->_animatedCard._card.setStrip(5); + scene->_animatedCard._card.setFrame(1); + scene->_animatedCard._card.animate(ANIM_MODE_2, NULL); + scene->_animatedCard._card.setPosition(scene->_gameBoardSide[2]._delayCard._stationPos, 0); + scene->_animatedCard._card.show(); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &scene->_item7._field36, this); + scene->_animatedCard._card.addMover(mover, &scene->_discardPile._stationPos, this); } break; case 10: { - scene->_item2._object1.hide(); - scene->setAnimationInfo(&scene->_item7); + scene->_animatedCard._card.hide(); + scene->setAnimationInfo(&scene->_discardPile); scene->_aSound2.play(61); R2_GLOBALS._sceneObjects->draw(); scene->actionDisplay(1331, 18, 159, 10, 1, 200, 0, 7, 0, 154, 154); - scene->_arrObject1[0].postInit(); - scene->_arrObject1[0].setVisage(1332); - scene->_arrObject1[0].setPosition(Common::Point(131, 71), 0); - scene->_arrObject1[0].fixPriority(190); - scene->_arrObject1[0].setStrip(3); - scene->_arrObject1[0].setFrame(4); - - scene->_arrObject2[0].postInit(); - scene->_arrObject2[0].setVisage(1332); - scene->_arrObject2[0].setPosition(Common::Point(131, 71), 0); - scene->_arrObject2[0].setStrip(7); - scene->_arrObject2[0].setFrame(1); - scene->_arrObject2[0].fixPriority(180); - - scene->_arrObject1[1].postInit(); - scene->_arrObject1[1].setVisage(1332); - scene->_arrObject1[1].setPosition(Common::Point(160, 71), 0); - scene->_arrObject1[1].fixPriority(190); - scene->_arrObject1[1].setStrip(3); - scene->_arrObject1[1].setFrame(16); - - scene->_arrObject2[1].postInit(); - scene->_arrObject2[1].setVisage(1332); - scene->_arrObject2[1].setPosition(Common::Point(160, 71), 0); - scene->_arrObject2[1].setStrip(7); - scene->_arrObject2[1].setFrame(1); - scene->_arrObject2[1].fixPriority(180); - - scene->_arrObject1[2].postInit(); - scene->_arrObject1[2].setVisage(1332); - scene->_arrObject1[2].setPosition(Common::Point(131, 100), 0); - scene->_arrObject1[2].fixPriority(190); - scene->_arrObject1[2].setStrip(4); - scene->_arrObject1[2].setFrame(4); - - scene->_arrObject2[2].postInit(); - scene->_arrObject2[2].setVisage(1332); - scene->_arrObject2[2].setPosition(Common::Point(131, 100), 0); - scene->_arrObject2[2].setStrip(7); - scene->_arrObject2[2].setFrame(1); - scene->_arrObject2[2].fixPriority(180); - - scene->_arrObject1[3].postInit(); - scene->_arrObject1[3].setVisage(1332); - scene->_arrObject1[3].setPosition(Common::Point(160, 100), 0); - scene->_arrObject1[3].fixPriority(190); - scene->_arrObject1[3].setStrip(4); - scene->_arrObject1[3].setFrame(2); - - scene->_arrObject2[3].postInit(); - scene->_arrObject2[3].setVisage(1332); - scene->_arrObject2[3].setPosition(Common::Point(160, 100), 0); - scene->_arrObject2[3].setStrip(7); - scene->_arrObject2[3].setFrame(1); - scene->_arrObject2[3].fixPriority(180); + scene->_upperDisplayCard[0].postInit(); + scene->_upperDisplayCard[0].setVisage(1332); + scene->_upperDisplayCard[0].setPosition(Common::Point(131, 71), 0); + scene->_upperDisplayCard[0].fixPriority(190); + scene->_upperDisplayCard[0].setStrip(3); + scene->_upperDisplayCard[0].setFrame(4); + + scene->_lowerDisplayCard[0].postInit(); + scene->_lowerDisplayCard[0].setVisage(1332); + scene->_lowerDisplayCard[0].setPosition(Common::Point(131, 71), 0); + scene->_lowerDisplayCard[0].setStrip(7); + scene->_lowerDisplayCard[0].setFrame(1); + scene->_lowerDisplayCard[0].fixPriority(180); + + scene->_upperDisplayCard[1].postInit(); + scene->_upperDisplayCard[1].setVisage(1332); + scene->_upperDisplayCard[1].setPosition(Common::Point(160, 71), 0); + scene->_upperDisplayCard[1].fixPriority(190); + scene->_upperDisplayCard[1].setStrip(3); + scene->_upperDisplayCard[1].setFrame(16); + + scene->_lowerDisplayCard[1].postInit(); + scene->_lowerDisplayCard[1].setVisage(1332); + scene->_lowerDisplayCard[1].setPosition(Common::Point(160, 71), 0); + scene->_lowerDisplayCard[1].setStrip(7); + scene->_lowerDisplayCard[1].setFrame(1); + scene->_lowerDisplayCard[1].fixPriority(180); + + scene->_upperDisplayCard[2].postInit(); + scene->_upperDisplayCard[2].setVisage(1332); + scene->_upperDisplayCard[2].setPosition(Common::Point(131, 100), 0); + scene->_upperDisplayCard[2].fixPriority(190); + scene->_upperDisplayCard[2].setStrip(4); + scene->_upperDisplayCard[2].setFrame(4); + + scene->_lowerDisplayCard[2].postInit(); + scene->_lowerDisplayCard[2].setVisage(1332); + scene->_lowerDisplayCard[2].setPosition(Common::Point(131, 100), 0); + scene->_lowerDisplayCard[2].setStrip(7); + scene->_lowerDisplayCard[2].setFrame(1); + scene->_lowerDisplayCard[2].fixPriority(180); + + scene->_upperDisplayCard[3].postInit(); + scene->_upperDisplayCard[3].setVisage(1332); + scene->_upperDisplayCard[3].setPosition(Common::Point(160, 100), 0); + scene->_upperDisplayCard[3].fixPriority(190); + scene->_upperDisplayCard[3].setStrip(4); + scene->_upperDisplayCard[3].setFrame(2); + + scene->_lowerDisplayCard[3].postInit(); + scene->_lowerDisplayCard[3].setVisage(1332); + scene->_lowerDisplayCard[3].setPosition(Common::Point(160, 100), 0); + scene->_lowerDisplayCard[3].setStrip(7); + scene->_lowerDisplayCard[3].setFrame(1); + scene->_lowerDisplayCard[3].fixPriority(180); R2_GLOBALS._sceneObjects->draw(); - skipFrames(240); + waitFrames(240); - scene->_arrObject1[0].remove(); - scene->_arrObject1[1].remove(); - scene->_arrObject1[2].remove(); - scene->_arrObject1[3].remove(); + scene->_upperDisplayCard[0].remove(); + scene->_upperDisplayCard[1].remove(); + scene->_upperDisplayCard[2].remove(); + scene->_upperDisplayCard[3].remove(); - scene->_arrObject2[0].remove(); - scene->_arrObject2[1].remove(); - scene->_arrObject2[2].remove(); - scene->_arrObject2[3].remove(); + scene->_lowerDisplayCard[0].remove(); + scene->_lowerDisplayCard[1].remove(); + scene->_lowerDisplayCard[2].remove(); + scene->_lowerDisplayCard[3].remove(); - scene->_object1.setFrame(1); - scene->_object1.show(); - scene->_object1.animate(ANIM_MODE_2, NULL); + scene->_currentPlayerArrow.setFrame(1); + scene->_currentPlayerArrow.show(); + scene->_currentPlayerArrow.animate(ANIM_MODE_2, NULL); R2_GLOBALS._sceneObjects->draw(); scene->actionDisplay(1331, 19, 159, 10, 1, 220, 0, 7, 0, 154, 154); - scene->_object1.hide(); + scene->_currentPlayerArrow.hide(); scene->actionDisplay(1331, 20, 159, 10, 1, 220, 0, 7, 0, 154, 154); scene->actionDisplay(1331, 21, 159, 10, 1, 220, 0, 7, 0, 154, 154); - scene->_item7._field34 = scene->_arrunkObj1337[2]._arr1[1]._field34; + scene->_discardPile._cardId = scene->_gameBoardSide[2]._handCard[1]._cardId; - scene->_item2._object1.setStrip(scene->_arrunkObj1337[2]._arr1[1]._object1._strip); - scene->_item2._object1.setFrame(scene->_arrunkObj1337[2]._arr1[1]._object1._frame); - scene->_item2._object1.animate(ANIM_MODE_NONE, NULL); + scene->_animatedCard._card.setStrip(scene->_gameBoardSide[2]._handCard[1]._card._strip); + scene->_animatedCard._card.setFrame(scene->_gameBoardSide[2]._handCard[1]._card._frame); + scene->_animatedCard._card.animate(ANIM_MODE_NONE, NULL); - scene->_arrunkObj1337[2]._arr1[1]._field34 = 0; - scene->_arrunkObj1337[2]._arr1[1]._object1.remove(); + scene->_gameBoardSide[2]._handCard[1]._cardId = 0; + scene->_gameBoardSide[2]._handCard[1]._card.remove(); - scene->_item2._object1.setPosition(scene->_arrunkObj1337[2]._arr1[1]._field36, 0); - scene->_item2._object1.show(); + scene->_animatedCard._card.setPosition(scene->_gameBoardSide[2]._handCard[1]._stationPos, 0); + scene->_animatedCard._card.show(); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &scene->_item7._field36, this); + scene->_animatedCard._card.addMover(mover, &scene->_discardPile._stationPos, this); } break; case 11: { - scene->_item2._object1.hide(); - scene->setAnimationInfo(&scene->_item7); + scene->_animatedCard._card.hide(); + scene->setAnimationInfo(&scene->_discardPile); scene->_aSound2.play(61); - scene->_item2._object1.setStrip(5); - scene->_item2._object1.setFrame(1); - scene->_item2._object1.animate(ANIM_MODE_2, NULL); + scene->_animatedCard._card.setStrip(5); + scene->_animatedCard._card.setFrame(1); + scene->_animatedCard._card.animate(ANIM_MODE_2, NULL); R2_GLOBALS._sceneObjects->draw(); @@ -2980,40 +3005,40 @@ void Scene1337::Action1::signal() { int i = -1; for (i = 0; i <= 3; i ++) { - scene->_arrunkObj1337[3]._arr1[i]._field34 = 0; - scene->_arrunkObj1337[3]._arr1[i]._object1.remove(); + scene->_gameBoardSide[3]._handCard[i]._cardId = 0; + scene->_gameBoardSide[3]._handCard[i]._card.remove(); - scene->_arrunkObj1337[2]._arr1[i]._field34 = 0; - scene->_arrunkObj1337[2]._arr1[i]._object1.remove(); + scene->_gameBoardSide[2]._handCard[i]._cardId = 0; + scene->_gameBoardSide[2]._handCard[i]._card.remove(); - scene->_arrunkObj1337[0]._arr1[i]._field34 = 0; - scene->_arrunkObj1337[0]._arr1[i]._object1.remove(); + scene->_gameBoardSide[0]._handCard[i]._cardId = 0; + scene->_gameBoardSide[0]._handCard[i]._card.remove(); - scene->_arrunkObj1337[1]._arr1[i]._field34 = 0; - scene->_arrunkObj1337[1]._arr1[i]._object1.remove(); + scene->_gameBoardSide[1]._handCard[i]._cardId = 0; + scene->_gameBoardSide[1]._handCard[i]._card.remove(); } for (i = 0; i <= 7; i++) { - scene->_arrunkObj1337[3]._arr2[i]._field34 = 0; - scene->_arrunkObj1337[3]._arr2[i]._object1.remove(); + scene->_gameBoardSide[3]._outpostStation[i]._cardId = 0; + scene->_gameBoardSide[3]._outpostStation[i]._card.remove(); - scene->_arrunkObj1337[2]._arr2[i]._field34 = 0; - scene->_arrunkObj1337[2]._arr2[i]._object1.remove(); + scene->_gameBoardSide[2]._outpostStation[i]._cardId = 0; + scene->_gameBoardSide[2]._outpostStation[i]._card.remove(); - scene->_arrunkObj1337[0]._arr2[i]._field34 = 0; - scene->_arrunkObj1337[0]._arr2[i]._object1.remove(); + scene->_gameBoardSide[0]._outpostStation[i]._cardId = 0; + scene->_gameBoardSide[0]._outpostStation[i]._card.remove(); - scene->_arrunkObj1337[1]._arr2[i]._field34 = 0; - scene->_arrunkObj1337[1]._arr2[i]._object1.remove(); + scene->_gameBoardSide[1]._outpostStation[i]._cardId = 0; + scene->_gameBoardSide[1]._outpostStation[i]._card.remove(); } - scene->_arrunkObj1337[2]._arr3[0]._field34 = 0; - scene->_arrunkObj1337[2]._arr3[0]._object1.remove(); + scene->_gameBoardSide[2]._delayCard._cardId = 0; + scene->_gameBoardSide[2]._delayCard._card.remove(); - scene->_item7._field34 = 0; - scene->_item7._object1.remove(); + scene->_discardPile._cardId = 0; + scene->_discardPile._card.remove(); - scene->_background2.remove(); + scene->_stockPile.remove(); } // No break on purpose case 0: @@ -3029,473 +3054,484 @@ void Scene1337::Action1::signal() { } } +/** + * Shuffle cards animation + */ void Scene1337::Action2::signal() { Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene; switch (_actionIndex++) { case 0: - scene->_item3._object1.postInit(); - scene->_item3._object1.setVisage(1332); - scene->_item3._object1.setStrip(8); - scene->_item3._object1.setFrame(1); - scene->_item3._object1.fixPriority(300); - scene->_item3._object1.setPosition(Common::Point(156, 108)); + scene->_shuffleAnimation._card.postInit(); + scene->_shuffleAnimation._card.setVisage(1332); + scene->_shuffleAnimation._card.setStrip(8); + scene->_shuffleAnimation._card.setFrame(1); + scene->_shuffleAnimation._card.fixPriority(300); + scene->_shuffleAnimation._card.setPosition(Common::Point(156, 108)); - scene->_item7._object1.remove(); - scene->_item7._field34 = 0; + scene->_discardPile._card.remove(); + scene->_discardPile._cardId = 0; scene->_aSound1.play(60); - scene->_item3._object1.animate(ANIM_MODE_5, this); + scene->_shuffleAnimation._card.animate(ANIM_MODE_5, this); break; case 1: - scene->_item3._object1.setFrame(1); + scene->_shuffleAnimation._card.setFrame(1); scene->_aSound1.play(60); - scene->_item3._object1.animate(ANIM_MODE_5, this); + scene->_shuffleAnimation._card.animate(ANIM_MODE_5, this); break; case 2: { Common::Point pt(156, 108); NpcMover *mover = new NpcMover(); - scene->_item3._object1.addMover(mover, &pt, this); + scene->_shuffleAnimation._card.addMover(mover, &pt, this); } break; case 3: - scene->_item3._object1.remove(); - scene->_background2.setup2(1332, 5, 1, 162, 95, 110, 1); - scene->_field423C = 1; + scene->_shuffleAnimation._card.remove(); + scene->_stockPile.setup(1332, 5, 1); + scene->_stockPile.setPosition(Common::Point(162, 95)); + scene->_stockPile.setPriority(110); + scene->_stockPile._effect = EFFECT_SHADED; + scene->_stockPile.show(); + scene->_shuffleEndedFl = true; break; default: break; } } +/** + * Deal cards + */ void Scene1337::Action3::signal() { Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene; - scene->_item2._object1.setPosition(Common::Point(162, 95), 0); + scene->_animatedCard._card.setPosition(Common::Point(162, 95), 0); switch (_actionIndex++) { case 0: { - scene->_item2._object1._moveDiff = Common::Point(30, 30); - scene->_item2._object1.setVisage(1332); - scene->_item2._object1.setStrip(5); - scene->_item2._object1.setFrame(1); - scene->_item2._object1.fixPriority(400); - scene->_item2._object1.animate(ANIM_MODE_2, NULL); + scene->_animatedCard._card._moveDiff = Common::Point(30, 30); + scene->_animatedCard._card.setVisage(1332); + scene->_animatedCard._card.setStrip(5); + scene->_animatedCard._card.setFrame(1); + scene->_animatedCard._card.fixPriority(400); + scene->_animatedCard._card.animate(ANIM_MODE_2, NULL); scene->_aSound2.play(61); Common::Point pt(283, 146); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &pt, this); + scene->_animatedCard._card.addMover(mover, &pt, this); - scene->_item2._object1.show(); - scene->_arrunkObj1337[1]._arr1[0]._field34 = scene->_field3E28[scene->_field3E24]; + scene->_animatedCard._card.show(); + scene->_gameBoardSide[1]._handCard[0]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb]; } break; case 1: { - scene->_arrunkObj1337[1]._arr1[0]._object1.postInit(); - scene->_arrunkObj1337[1]._arr1[0]._object1._moveDiff = Common::Point(30, 30); - scene->_arrunkObj1337[1]._arr1[0]._object1.setVisage(1332); - scene->_arrunkObj1337[1]._arr1[0]._object1.setPosition(scene->_arrunkObj1337[1]._arr1[0]._field36, 0); - scene->_arrunkObj1337[1]._arr1[0]._object1.setStrip(1); - scene->_arrunkObj1337[1]._arr1[0]._object1.setFrame(4); - scene->_arrunkObj1337[1]._arr1[0]._object1.fixPriority(170); + scene->_gameBoardSide[1]._handCard[0]._card.postInit(); + scene->_gameBoardSide[1]._handCard[0]._card._moveDiff = Common::Point(30, 30); + scene->_gameBoardSide[1]._handCard[0]._card.setVisage(1332); + scene->_gameBoardSide[1]._handCard[0]._card.setPosition(scene->_gameBoardSide[1]._handCard[0]._stationPos, 0); + scene->_gameBoardSide[1]._handCard[0]._card.setStrip(1); + scene->_gameBoardSide[1]._handCard[0]._card.setFrame(4); + scene->_gameBoardSide[1]._handCard[0]._card.fixPriority(170); scene->_aSound2.play(61); Common::Point pt(10, 174); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &pt, this); + scene->_animatedCard._card.addMover(mover, &pt, this); - scene->_arrunkObj1337[2]._arr1[0]._field34 = scene->_field3E28[scene->_field3E24]; + scene->_gameBoardSide[2]._handCard[0]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb]; } break; case 2: { - scene->_arrunkObj1337[2]._arr1[0]._object1.postInit(); - scene->_arrunkObj1337[2]._arr1[0]._object1._moveDiff = Common::Point(30, 30); - scene->_arrunkObj1337[2]._arr1[0]._object1.setVisage(1332); - scene->_arrunkObj1337[2]._arr1[0]._object1.setPosition(scene->_arrunkObj1337[2]._arr1[0]._field36, 0); - scene->_arrunkObj1337[2]._arr1[0]._object1.fixPriority(170); - if (scene->_arrunkObj1337[2]._arr1[0]._field34 > 9) { - if (scene->_arrunkObj1337[2]._arr1[0]._field34 > 25) { - scene->_arrunkObj1337[2]._arr1[0]._object1.setStrip(4); - scene->_arrunkObj1337[2]._arr1[0]._object1.setFrame(scene->_arrunkObj1337[2]._arr1[0]._field34 - 25); - } else { - scene->_arrunkObj1337[2]._arr1[0]._object1.setStrip(3); - scene->_arrunkObj1337[2]._arr1[0]._object1.setFrame(scene->_arrunkObj1337[2]._arr1[0]._field34 - 9); - } + scene->_gameBoardSide[2]._handCard[0]._card.postInit(); + scene->_gameBoardSide[2]._handCard[0]._card._moveDiff = Common::Point(30, 30); + scene->_gameBoardSide[2]._handCard[0]._card.setVisage(1332); + scene->_gameBoardSide[2]._handCard[0]._card.setPosition(scene->_gameBoardSide[2]._handCard[0]._stationPos, 0); + scene->_gameBoardSide[2]._handCard[0]._card.fixPriority(170); + if (scene->_gameBoardSide[2]._handCard[0]._cardId > 25) { + scene->_gameBoardSide[2]._handCard[0]._card.setStrip(4); + scene->_gameBoardSide[2]._handCard[0]._card.setFrame(scene->_gameBoardSide[2]._handCard[0]._cardId - 25); + } else if (scene->_gameBoardSide[2]._handCard[0]._cardId > 9) { + scene->_gameBoardSide[2]._handCard[0]._card.setStrip(3); + scene->_gameBoardSide[2]._handCard[0]._card.setFrame(scene->_gameBoardSide[2]._handCard[0]._cardId - 9); } else { - scene->_arrunkObj1337[2]._arr1[0]._object1.setStrip(2); - scene->_arrunkObj1337[2]._arr1[0]._object1.setFrame(scene->_arrunkObj1337[2]._arr1[0]._field34); + scene->_gameBoardSide[2]._handCard[0]._card.setStrip(2); + scene->_gameBoardSide[2]._handCard[0]._card.setFrame(scene->_gameBoardSide[2]._handCard[0]._cardId); } scene->_aSound2.play(61); Common::Point pt(14, 14); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &pt, this); + scene->_animatedCard._card.addMover(mover, &pt, this); - scene->_arrunkObj1337[3]._arr1[0]._field34 = scene->_field3E28[scene->_field3E24]; + scene->_gameBoardSide[3]._handCard[0]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb]; } break; case 3: { - scene->_arrunkObj1337[3]._arr1[0]._object1.postInit(); - scene->_arrunkObj1337[3]._arr1[0]._object1._moveDiff = Common::Point(30, 30); - scene->_arrunkObj1337[3]._arr1[0]._object1.setVisage(1332); - scene->_arrunkObj1337[3]._arr1[0]._object1.setPosition(scene->_arrunkObj1337[3]._arr1[0]._field36, 0); - scene->_arrunkObj1337[3]._arr1[0]._object1.setStrip(1); - scene->_arrunkObj1337[3]._arr1[0]._object1.setFrame(3); - scene->_arrunkObj1337[3]._arr1[0]._object1.fixPriority(170); + scene->_gameBoardSide[3]._handCard[0]._card.postInit(); + scene->_gameBoardSide[3]._handCard[0]._card._moveDiff = Common::Point(30, 30); + scene->_gameBoardSide[3]._handCard[0]._card.setVisage(1332); + scene->_gameBoardSide[3]._handCard[0]._card.setPosition(scene->_gameBoardSide[3]._handCard[0]._stationPos, 0); + scene->_gameBoardSide[3]._handCard[0]._card.setStrip(1); + scene->_gameBoardSide[3]._handCard[0]._card.setFrame(3); + scene->_gameBoardSide[3]._handCard[0]._card.fixPriority(170); scene->_aSound2.play(61); Common::Point pt(280, 5); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &pt, this); + scene->_animatedCard._card.addMover(mover, &pt, this); - scene->_arrunkObj1337[0]._arr1[0]._field34 = scene->_field3E28[scene->_field3E24]; + scene->_gameBoardSide[0]._handCard[0]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb]; } break; case 4: { - scene->_arrunkObj1337[0]._arr1[0]._object1.postInit(); - scene->_arrunkObj1337[0]._arr1[0]._object1._moveDiff = Common::Point(30,30); - scene->_arrunkObj1337[0]._arr1[0]._object1.setVisage(1332); - scene->_arrunkObj1337[0]._arr1[0]._object1.setPosition(scene->_arrunkObj1337[0]._arr1[0]._field36, 0); - scene->_arrunkObj1337[0]._arr1[0]._object1.setStrip(5); - scene->_arrunkObj1337[0]._arr1[0]._object1.setFrame(1); - scene->_arrunkObj1337[0]._arr1[0]._object1.fixPriority(170); + scene->_gameBoardSide[0]._handCard[0]._card.postInit(); + scene->_gameBoardSide[0]._handCard[0]._card._moveDiff = Common::Point(30,30); + scene->_gameBoardSide[0]._handCard[0]._card.setVisage(1332); + scene->_gameBoardSide[0]._handCard[0]._card.setPosition(scene->_gameBoardSide[0]._handCard[0]._stationPos, 0); + scene->_gameBoardSide[0]._handCard[0]._card.setStrip(5); + scene->_gameBoardSide[0]._handCard[0]._card.setFrame(1); + scene->_gameBoardSide[0]._handCard[0]._card.fixPriority(170); scene->_aSound2.play(61); Common::Point pt(283, 124); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &pt, this); + scene->_animatedCard._card.addMover(mover, &pt, this); - scene->_arrunkObj1337[1]._arr1[1]._field34 = scene->_field3E28[scene->_field3E24]; + scene->_gameBoardSide[1]._handCard[1]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb]; } break; case 5: { - scene->_arrunkObj1337[1]._arr1[1]._object1.postInit(); - scene->_arrunkObj1337[1]._arr1[1]._object1._moveDiff = Common::Point(30, 30); - scene->_arrunkObj1337[1]._arr1[1]._object1.setVisage(1332); - scene->_arrunkObj1337[1]._arr1[1]._object1.setPosition(scene->_arrunkObj1337[1]._arr1[1]._field36, 0); - scene->_arrunkObj1337[1]._arr1[1]._object1.setStrip(1); - scene->_arrunkObj1337[1]._arr1[1]._object1.setFrame(4); - scene->_arrunkObj1337[1]._arr1[1]._object1.fixPriority(170); + scene->_gameBoardSide[1]._handCard[1]._card.postInit(); + scene->_gameBoardSide[1]._handCard[1]._card._moveDiff = Common::Point(30, 30); + scene->_gameBoardSide[1]._handCard[1]._card.setVisage(1332); + scene->_gameBoardSide[1]._handCard[1]._card.setPosition(scene->_gameBoardSide[1]._handCard[1]._stationPos, 0); + scene->_gameBoardSide[1]._handCard[1]._card.setStrip(1); + scene->_gameBoardSide[1]._handCard[1]._card.setFrame(4); + scene->_gameBoardSide[1]._handCard[1]._card.fixPriority(170); scene->_aSound2.play(61); Common::Point pt(37, 174); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &pt, this); + scene->_animatedCard._card.addMover(mover, &pt, this); - scene->_arrunkObj1337[2]._arr1[1]._field34 = scene->_field3E28[scene->_field3E24]; + scene->_gameBoardSide[2]._handCard[1]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb]; } break; case 6: { - scene->_arrunkObj1337[2]._arr1[1]._object1.postInit(); - scene->_arrunkObj1337[2]._arr1[1]._object1._moveDiff = Common::Point(30, 30); - scene->_arrunkObj1337[2]._arr1[1]._object1.setVisage(1332); - scene->_arrunkObj1337[2]._arr1[1]._object1.setPosition(scene->_arrunkObj1337[2]._arr1[1]._field36, 0); - scene->_arrunkObj1337[2]._arr1[1]._object1.fixPriority(170); - - if (scene->_arrunkObj1337[2]._arr1[1]._field34 > 9) { - if (scene->_arrunkObj1337[2]._arr1[1]._field34 > 25) { - scene->_arrunkObj1337[2]._arr1[1]._object1.setStrip(4); - scene->_arrunkObj1337[2]._arr1[1]._object1.setFrame(scene->_arrunkObj1337[2]._arr1[1]._field34 - 25); - } else { - scene->_arrunkObj1337[2]._arr1[1]._object1.setStrip(3); - scene->_arrunkObj1337[2]._arr1[1]._object1.setFrame(scene->_arrunkObj1337[2]._arr1[1]._field34 - 9); - } + scene->_gameBoardSide[2]._handCard[1]._card.postInit(); + scene->_gameBoardSide[2]._handCard[1]._card._moveDiff = Common::Point(30, 30); + scene->_gameBoardSide[2]._handCard[1]._card.setVisage(1332); + scene->_gameBoardSide[2]._handCard[1]._card.setPosition(scene->_gameBoardSide[2]._handCard[1]._stationPos, 0); + scene->_gameBoardSide[2]._handCard[1]._card.fixPriority(170); + + if (scene->_gameBoardSide[2]._handCard[1]._cardId > 25) { + scene->_gameBoardSide[2]._handCard[1]._card.setStrip(4); + scene->_gameBoardSide[2]._handCard[1]._card.setFrame(scene->_gameBoardSide[2]._handCard[1]._cardId - 25); + } else if (scene->_gameBoardSide[2]._handCard[1]._cardId > 9) { + scene->_gameBoardSide[2]._handCard[1]._card.setStrip(3); + scene->_gameBoardSide[2]._handCard[1]._card.setFrame(scene->_gameBoardSide[2]._handCard[1]._cardId - 9); } else { - scene->_arrunkObj1337[2]._arr1[1]._object1.setStrip(2); - scene->_arrunkObj1337[2]._arr1[1]._object1.setFrame(scene->_arrunkObj1337[2]._arr1[1]._field34); + scene->_gameBoardSide[2]._handCard[1]._card.setStrip(2); + scene->_gameBoardSide[2]._handCard[1]._card.setFrame(scene->_gameBoardSide[2]._handCard[1]._cardId); } scene->_aSound2.play(61); Common::Point pt(14, 36); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &pt, this); + scene->_animatedCard._card.addMover(mover, &pt, this); - scene->_arrunkObj1337[3]._arr1[1]._field34 = scene->_field3E28[scene->_field3E24]; + scene->_gameBoardSide[3]._handCard[1]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb]; } break; case 7: { - scene->_arrunkObj1337[3]._arr1[1]._object1.postInit(); - scene->_arrunkObj1337[3]._arr1[1]._object1._moveDiff = Common::Point(30, 30); - scene->_arrunkObj1337[3]._arr1[1]._object1.setVisage(1332); - scene->_arrunkObj1337[3]._arr1[1]._object1.setPosition(scene->_arrunkObj1337[3]._arr1[1]._field36); - scene->_arrunkObj1337[3]._arr1[1]._object1.setStrip(1); - scene->_arrunkObj1337[3]._arr1[1]._object1.setFrame(3); - scene->_arrunkObj1337[3]._arr1[1]._object1.fixPriority(170); + scene->_gameBoardSide[3]._handCard[1]._card.postInit(); + scene->_gameBoardSide[3]._handCard[1]._card._moveDiff = Common::Point(30, 30); + scene->_gameBoardSide[3]._handCard[1]._card.setVisage(1332); + scene->_gameBoardSide[3]._handCard[1]._card.setPosition(scene->_gameBoardSide[3]._handCard[1]._stationPos); + scene->_gameBoardSide[3]._handCard[1]._card.setStrip(1); + scene->_gameBoardSide[3]._handCard[1]._card.setFrame(3); + scene->_gameBoardSide[3]._handCard[1]._card.fixPriority(170); scene->_aSound2.play(61); Common::Point pt(253, 5); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &pt, this); + scene->_animatedCard._card.addMover(mover, &pt, this); - scene->_arrunkObj1337[0]._arr1[1]._field34 = scene->_field3E28[scene->_field3E24]; + scene->_gameBoardSide[0]._handCard[1]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb]; } break; case 8: { - scene->_arrunkObj1337[0]._arr1[1]._object1.postInit(); - scene->_arrunkObj1337[0]._arr1[1]._object1._moveDiff = Common::Point(30, 30); - scene->_arrunkObj1337[0]._arr1[1]._object1.setVisage(1332); - scene->_arrunkObj1337[0]._arr1[1]._object1.setPosition(scene->_arrunkObj1337[0]._arr1[1]._field36, 0); - scene->_arrunkObj1337[0]._arr1[1]._object1.setStrip(5); - scene->_arrunkObj1337[0]._arr1[1]._object1.setFrame(1); - scene->_arrunkObj1337[0]._arr1[1]._object1.fixPriority(170); + scene->_gameBoardSide[0]._handCard[1]._card.postInit(); + scene->_gameBoardSide[0]._handCard[1]._card._moveDiff = Common::Point(30, 30); + scene->_gameBoardSide[0]._handCard[1]._card.setVisage(1332); + scene->_gameBoardSide[0]._handCard[1]._card.setPosition(scene->_gameBoardSide[0]._handCard[1]._stationPos, 0); + scene->_gameBoardSide[0]._handCard[1]._card.setStrip(5); + scene->_gameBoardSide[0]._handCard[1]._card.setFrame(1); + scene->_gameBoardSide[0]._handCard[1]._card.fixPriority(170); scene->_aSound2.play(61); Common::Point pt(283, 102); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &pt, this); + scene->_animatedCard._card.addMover(mover, &pt, this); - scene->_arrunkObj1337[1]._arr1[2]._field34 = scene->_field3E28[scene->_field3E24]; + scene->_gameBoardSide[1]._handCard[2]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb]; } break; case 9: { - scene->_arrunkObj1337[1]._arr1[2]._object1.postInit(); - scene->_arrunkObj1337[1]._arr1[2]._object1._moveDiff = Common::Point(30, 30); - scene->_arrunkObj1337[1]._arr1[2]._object1.setVisage(1332); - scene->_arrunkObj1337[1]._arr1[2]._object1.setPosition(scene->_arrunkObj1337[1]._arr1[2]._field36, 0); - scene->_arrunkObj1337[1]._arr1[2]._object1.setStrip(1); - scene->_arrunkObj1337[1]._arr1[2]._object1.setFrame(4); - scene->_arrunkObj1337[1]._arr1[2]._object1.fixPriority(170); + scene->_gameBoardSide[1]._handCard[2]._card.postInit(); + scene->_gameBoardSide[1]._handCard[2]._card._moveDiff = Common::Point(30, 30); + scene->_gameBoardSide[1]._handCard[2]._card.setVisage(1332); + scene->_gameBoardSide[1]._handCard[2]._card.setPosition(scene->_gameBoardSide[1]._handCard[2]._stationPos, 0); + scene->_gameBoardSide[1]._handCard[2]._card.setStrip(1); + scene->_gameBoardSide[1]._handCard[2]._card.setFrame(4); + scene->_gameBoardSide[1]._handCard[2]._card.fixPriority(170); scene->_aSound2.play(61); Common::Point pt(64, 174); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &pt, this); + scene->_animatedCard._card.addMover(mover, &pt, this); - scene->_arrunkObj1337[2]._arr1[2]._field34 = scene->_field3E28[scene->_field3E24]; + scene->_gameBoardSide[2]._handCard[2]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb]; } break; case 10: { - scene->_arrunkObj1337[2]._arr1[2]._object1.postInit(); - scene->_arrunkObj1337[2]._arr1[2]._object1._moveDiff = Common::Point(30, 30); - scene->_arrunkObj1337[2]._arr1[2]._object1.setVisage(1332); - scene->_arrunkObj1337[2]._arr1[2]._object1.setPosition(scene->_arrunkObj1337[2]._arr1[2]._field36, 0); - scene->_arrunkObj1337[2]._arr1[2]._object1.fixPriority(170); - - if (scene->_arrunkObj1337[2]._arr1[2]._field34 > 9) { - if (scene->_arrunkObj1337[2]._arr1[2]._field34 > 25) { - scene->_arrunkObj1337[2]._arr1[2]._object1.setStrip(4); - scene->_arrunkObj1337[2]._arr1[2]._object1.setFrame(scene->_arrunkObj1337[2]._arr1[2]._field34 - 25); - } else { - scene->_arrunkObj1337[2]._arr1[2]._object1.setStrip(3); - scene->_arrunkObj1337[2]._arr1[2]._object1.setFrame(scene->_arrunkObj1337[2]._arr1[2]._field34 - 9); - } + scene->_gameBoardSide[2]._handCard[2]._card.postInit(); + scene->_gameBoardSide[2]._handCard[2]._card._moveDiff = Common::Point(30, 30); + scene->_gameBoardSide[2]._handCard[2]._card.setVisage(1332); + scene->_gameBoardSide[2]._handCard[2]._card.setPosition(scene->_gameBoardSide[2]._handCard[2]._stationPos, 0); + scene->_gameBoardSide[2]._handCard[2]._card.fixPriority(170); + + if (scene->_gameBoardSide[2]._handCard[2]._cardId > 25) { + scene->_gameBoardSide[2]._handCard[2]._card.setStrip(4); + scene->_gameBoardSide[2]._handCard[2]._card.setFrame(scene->_gameBoardSide[2]._handCard[2]._cardId - 25); + } else if (scene->_gameBoardSide[2]._handCard[2]._cardId > 9) { + scene->_gameBoardSide[2]._handCard[2]._card.setStrip(3); + scene->_gameBoardSide[2]._handCard[2]._card.setFrame(scene->_gameBoardSide[2]._handCard[2]._cardId - 9); } else { - scene->_arrunkObj1337[2]._arr1[2]._object1.setStrip(2); - scene->_arrunkObj1337[2]._arr1[2]._object1.setFrame(scene->_arrunkObj1337[2]._arr1[2]._field34); + scene->_gameBoardSide[2]._handCard[2]._card.setStrip(2); + scene->_gameBoardSide[2]._handCard[2]._card.setFrame(scene->_gameBoardSide[2]._handCard[2]._cardId); } scene->_aSound2.play(61); Common::Point pt(14, 58); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &pt, this); + scene->_animatedCard._card.addMover(mover, &pt, this); - scene->_arrunkObj1337[3]._arr1[2]._field34 = scene->_field3E28[scene->_field3E24]; + scene->_gameBoardSide[3]._handCard[2]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb]; } break; case 11: { - scene->_arrunkObj1337[3]._arr1[2]._object1.postInit(); - scene->_arrunkObj1337[3]._arr1[2]._object1._moveDiff = Common::Point(30, 30); - scene->_arrunkObj1337[3]._arr1[2]._object1.setVisage(1332); - scene->_arrunkObj1337[3]._arr1[2]._object1.setPosition(scene->_arrunkObj1337[3]._arr1[2]._field36, 0); - scene->_arrunkObj1337[3]._arr1[2]._object1.setStrip(1); - scene->_arrunkObj1337[3]._arr1[2]._object1.setFrame(3); - scene->_arrunkObj1337[3]._arr1[2]._object1.fixPriority(170); + scene->_gameBoardSide[3]._handCard[2]._card.postInit(); + scene->_gameBoardSide[3]._handCard[2]._card._moveDiff = Common::Point(30, 30); + scene->_gameBoardSide[3]._handCard[2]._card.setVisage(1332); + scene->_gameBoardSide[3]._handCard[2]._card.setPosition(scene->_gameBoardSide[3]._handCard[2]._stationPos, 0); + scene->_gameBoardSide[3]._handCard[2]._card.setStrip(1); + scene->_gameBoardSide[3]._handCard[2]._card.setFrame(3); + scene->_gameBoardSide[3]._handCard[2]._card.fixPriority(170); scene->_aSound2.play(61); Common::Point pt(226, 5); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &pt, this); + scene->_animatedCard._card.addMover(mover, &pt, this); - scene->_arrunkObj1337[0]._arr1[2]._field34 = scene->_field3E28[scene->_field3E24]; + scene->_gameBoardSide[0]._handCard[2]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb]; } break; case 12: - scene->_arrunkObj1337[0]._arr1[2]._object1.postInit(); - scene->_arrunkObj1337[0]._arr1[2]._object1._moveDiff = Common::Point(30, 30); - scene->_arrunkObj1337[0]._arr1[2]._object1.setVisage(1332); - scene->_arrunkObj1337[0]._arr1[2]._object1.setPosition(scene->_arrunkObj1337[0]._arr1[2]._field36, 0); - scene->_arrunkObj1337[0]._arr1[2]._object1.setStrip(5); - scene->_arrunkObj1337[0]._arr1[2]._object1.setFrame(1); - scene->_arrunkObj1337[0]._arr1[2]._object1.fixPriority(170); - scene->_arrunkObj1337[0]._arr1[2]._object1.hide(); + scene->_gameBoardSide[0]._handCard[2]._card.postInit(); + scene->_gameBoardSide[0]._handCard[2]._card._moveDiff = Common::Point(30, 30); + scene->_gameBoardSide[0]._handCard[2]._card.setVisage(1332); + scene->_gameBoardSide[0]._handCard[2]._card.setPosition(scene->_gameBoardSide[0]._handCard[2]._stationPos, 0); + scene->_gameBoardSide[0]._handCard[2]._card.setStrip(5); + scene->_gameBoardSide[0]._handCard[2]._card.setFrame(1); + scene->_gameBoardSide[0]._handCard[2]._card.fixPriority(170); + scene->_animatedCard._card.hide(); default: break; } if (_actionIndex > 12) { - scene->_field423E = 0; + scene->_currentPlayerNumb = 0; R2_GLOBALS._sceneObjects->draw(); scene->actionDisplay(1330, 0, 159, 10, 1, 200, 0, 7, 0, 154, 154); - scene->subC20F9(); + scene->handleNextTurn(); } else if (_actionIndex >= 1) { - scene->_field3E28[scene->_field3E24] = 0; - scene->_field3E24--; + scene->_availableCardsPile[scene->_cardsAvailableNumb] = 0; + scene->_cardsAvailableNumb--; } } +/** + * Action used to handle the other players' turn + */ void Scene1337::Action4::signal() { Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene; switch (_actionIndex++) { case 0: - if ((scene->_arrunkObj1337[scene->_field423E]._arr1[0]._field34 == 0) && (scene->subC264B(scene->_arrunkObj1337[scene->_field423E]._arr3[0]._field34))) { - if (scene->_field3E24 < 0) - scene->subC264B(scene->_arrunkObj1337[scene->_field423E]._arr3[0]._field34); - scene->_item2._object1.setPosition(Common::Point(162, 95), 0); - scene->_item2._object1.show(); + if ( (scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._cardId == 0) + && (!scene->isStationCard(scene->_gameBoardSide[scene->_currentPlayerNumb]._delayCard._cardId))) { + if (scene->_cardsAvailableNumb < 0) + scene->shuffleCards(); + scene->_animatedCard._card.setPosition(Common::Point(162, 95), 0); + scene->_animatedCard._card.show(); scene->_aSound2.play(61); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &scene->_arrunkObj1337[scene->_field423E]._fieldB94, this); + scene->_animatedCard._card.addMover(mover, &scene->_gameBoardSide[scene->_currentPlayerNumb]._card1Pos, this); - scene->_arrunkObj1337[scene->_field423E]._arr1[0]._field34 = scene->_field3E28[scene->_field3E24]; - scene->_field3E28[scene->_field3E24] = 0; - scene->_field3E24--; + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb]; + scene->_availableCardsPile[scene->_cardsAvailableNumb] = 0; + scene->_cardsAvailableNumb--; - if (scene->_field3E24 < 0) - scene->_background2.remove(); + if (scene->_cardsAvailableNumb < 0) + scene->_stockPile.remove(); } else { // Self call, forcing next actionIndex signal(); } break; case 1: - if ( ( scene->_item2._object1._position.x == scene->_arrunkObj1337[scene->_field423E]._fieldB94.x) - && ( scene->_item2._object1._position.y == scene->_arrunkObj1337[scene->_field423E]._fieldB94.y) ) { - scene->_arrunkObj1337[scene->_field423E]._arr1[0]._object1.postInit(); - scene->_arrunkObj1337[scene->_field423E]._arr1[0]._object1._moveDiff = Common::Point(30, 30); - scene->_arrunkObj1337[scene->_field423E]._arr1[0]._object1.setVisage(1332); - scene->_arrunkObj1337[scene->_field423E]._arr1[0]._object1.setPosition(scene->_arrunkObj1337[scene->_field423E]._arr1[0]._field36, 0); - scene->_arrunkObj1337[scene->_field423E]._arr1[0]._object1.setStrip(1); - scene->_arrunkObj1337[scene->_field423E]._arr1[0]._object1.setFrame(scene->_arrunkObj1337[scene->_field423E]._fieldBA4); - scene->_arrunkObj1337[scene->_field423E]._arr1[0]._object1.fixPriority(170); - } - - if ((scene->_field4248 == 1) || (scene->_field423E == 2)) - scene->setAnimationInfo(&scene->_arrunkObj1337[scene->_field423E]._arr1[0]); - - scene->_item2._object1.hide(); - if ((scene->_arrunkObj1337[scene->_field423E]._arr1[0]._field34 == 0) && (scene->subC264B(scene->_arrunkObj1337[scene->_field423E]._arr3[0]._field34 == 0))) { - if (scene->_field3E24 < 0) + if ( (scene->_animatedCard._card._position.x == scene->_gameBoardSide[scene->_currentPlayerNumb]._card1Pos.x) + && (scene->_animatedCard._card._position.y == scene->_gameBoardSide[scene->_currentPlayerNumb]._card1Pos.y) ) { + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._card.postInit(); + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._card._moveDiff = Common::Point(30, 30); + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._card.setVisage(1332); + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._card.setPosition(scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._stationPos, 0); + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._card.setStrip(1); + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._card.setFrame(scene->_gameBoardSide[scene->_currentPlayerNumb]._frameNum); + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._card.fixPriority(170); + } + + if ((R2_GLOBALS._debugCardGame) || (scene->_currentPlayerNumb == 2)) + scene->setAnimationInfo(&scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]); + + scene->_animatedCard._card.hide(); + if ( (scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._cardId == 0) + && (!scene->isStationCard(scene->_gameBoardSide[scene->_currentPlayerNumb]._delayCard._cardId))) { + if (scene->_cardsAvailableNumb < 0) scene->shuffleCards(); - scene->_item2._object1.setPosition(Common::Point(162, 95)); - scene->_item2._object1.show(); + scene->_animatedCard._card.setPosition(Common::Point(162, 95)); + scene->_animatedCard._card.show(); scene->_aSound2.play(61); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &scene->_arrunkObj1337[scene->_field423E]._fieldB98, this); + scene->_animatedCard._card.addMover(mover, &scene->_gameBoardSide[scene->_currentPlayerNumb]._card2Pos, this); - scene->_arrunkObj1337[scene->_field423E]._arr1[1]._field34 = scene->_field3E28[scene->_field3E24]; - scene->_field3E28[scene->_field3E24] = 0; - scene->_field3E24--; - if (scene->_field3E24 < 0) - scene->_background2.remove(); + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb]; + scene->_availableCardsPile[scene->_cardsAvailableNumb] = 0; + scene->_cardsAvailableNumb--; + if (scene->_cardsAvailableNumb < 0) + scene->_stockPile.remove(); } else signal(); break; case 2: - if ( ( scene->_item2._object1._position.x == scene->_arrunkObj1337[scene->_field423E]._fieldB98.x) - && ( scene->_item2._object1._position.y == scene->_arrunkObj1337[scene->_field423E]._fieldB98.y) ) { - scene->_arrunkObj1337[scene->_field423E]._arr1[1]._object1.postInit(); - scene->_arrunkObj1337[scene->_field423E]._arr1[1]._object1._moveDiff = Common::Point(30, 30); - scene->_arrunkObj1337[scene->_field423E]._arr1[1]._object1.setVisage(1332); - scene->_arrunkObj1337[scene->_field423E]._arr1[1]._object1.setPosition(scene->_arrunkObj1337[scene->_field423E]._arr1[1]._field36, 0); - scene->_arrunkObj1337[scene->_field423E]._arr1[1]._object1.setStrip(1); - scene->_arrunkObj1337[scene->_field423E]._arr1[1]._object1.setFrame(scene->_arrunkObj1337[scene->_field423E]._fieldBA4); - scene->_arrunkObj1337[scene->_field423E]._arr1[1]._object1.fixPriority(170); - } - - if ((scene->_field4248 == 1) || (scene->_field423E == 2)) - scene->setAnimationInfo(&scene->_arrunkObj1337[scene->_field423E]._arr1[1]); - - scene->_item2._object1.hide(); - if ((scene->_arrunkObj1337[scene->_field423E]._arr1[2]._field34 == 0) && (scene->subC264B(scene->_arrunkObj1337[scene->_field423E]._arr3[0]._field34 == 0))) { - if (scene->_field3E24 < 0) + if ( (scene->_animatedCard._card._position.x == scene->_gameBoardSide[scene->_currentPlayerNumb]._card2Pos.x) + && (scene->_animatedCard._card._position.y == scene->_gameBoardSide[scene->_currentPlayerNumb]._card2Pos.y) ) { + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]._card.postInit(); + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]._card._moveDiff = Common::Point(30, 30); + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]._card.setVisage(1332); + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]._card.setPosition(scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]._stationPos, 0); + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]._card.setStrip(1); + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]._card.setFrame(scene->_gameBoardSide[scene->_currentPlayerNumb]._frameNum); + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]._card.fixPriority(170); + } + + if ((R2_GLOBALS._debugCardGame) || (scene->_currentPlayerNumb == 2)) + scene->setAnimationInfo(&scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]); + + scene->_animatedCard._card.hide(); + if ( (scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._cardId == 0) + && (!scene->isStationCard(scene->_gameBoardSide[scene->_currentPlayerNumb]._delayCard._cardId))) { + if (scene->_cardsAvailableNumb < 0) scene->shuffleCards(); - scene->_item2._object1.setPosition(Common::Point(162, 95)); - scene->_item2._object1.show(); + scene->_animatedCard._card.setPosition(Common::Point(162, 95)); + scene->_animatedCard._card.show(); scene->_aSound2.play(61); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &scene->_arrunkObj1337[scene->_field423E]._fieldB9C, this); + scene->_animatedCard._card.addMover(mover, &scene->_gameBoardSide[scene->_currentPlayerNumb]._card3Pos, this); - scene->_arrunkObj1337[scene->_field423E]._arr1[2]._field34 = scene->_field3E28[scene->_field3E24]; - scene->_field3E28[scene->_field3E24] = 0; - scene->_field3E24--; - if (scene->_field3E24 < 0) - scene->_background2.remove(); + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb]; + scene->_availableCardsPile[scene->_cardsAvailableNumb] = 0; + scene->_cardsAvailableNumb--; + if (scene->_cardsAvailableNumb < 0) + scene->_stockPile.remove(); } else signal(); break; case 3: - if ( ( scene->_item2._object1._position.x == scene->_arrunkObj1337[scene->_field423E]._fieldB9C.x) - && ( scene->_item2._object1._position.y == scene->_arrunkObj1337[scene->_field423E]._fieldB9C.y) ) { - scene->_arrunkObj1337[scene->_field423E]._arr1[2]._object1.postInit(); - scene->_arrunkObj1337[scene->_field423E]._arr1[2]._object1._moveDiff = Common::Point(30, 30); - scene->_arrunkObj1337[scene->_field423E]._arr1[2]._object1.setVisage(1332); - scene->_arrunkObj1337[scene->_field423E]._arr1[2]._object1.setPosition(scene->_arrunkObj1337[scene->_field423E]._arr1[2]._field36, 0); - scene->_arrunkObj1337[scene->_field423E]._arr1[2]._object1.setStrip(1); - scene->_arrunkObj1337[scene->_field423E]._arr1[2]._object1.setFrame(scene->_arrunkObj1337[scene->_field423E]._fieldBA4); - scene->_arrunkObj1337[scene->_field423E]._arr1[2]._object1.fixPriority(170); - } - - if ((scene->_field4248 == 1) || (scene->_field423E == 2)) - scene->setAnimationInfo(&scene->_arrunkObj1337[scene->_field423E]._arr1[2]); - - scene->_item2._object1.hide(); - if ((scene->_arrunkObj1337[scene->_field423E]._arr1[3]._field34 == 0) && (scene->subC264B(scene->_arrunkObj1337[scene->_field423E]._arr3[0]._field34 == 0))) { - if (scene->_field3E24 < 0) + if ( (scene->_animatedCard._card._position.x == scene->_gameBoardSide[scene->_currentPlayerNumb]._card3Pos.x) + && (scene->_animatedCard._card._position.y == scene->_gameBoardSide[scene->_currentPlayerNumb]._card3Pos.y) ) { + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._card.postInit(); + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._card._moveDiff = Common::Point(30, 30); + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._card.setVisage(1332); + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._card.setPosition(scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._stationPos, 0); + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._card.setStrip(1); + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._card.setFrame(scene->_gameBoardSide[scene->_currentPlayerNumb]._frameNum); + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._card.fixPriority(170); + } + + if ((R2_GLOBALS._debugCardGame) || (scene->_currentPlayerNumb == 2)) + scene->setAnimationInfo(&scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]); + + scene->_animatedCard._card.hide(); + if ( (scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._cardId == 0) + && (!scene->isStationCard(scene->_gameBoardSide[scene->_currentPlayerNumb]._delayCard._cardId))) { + if (scene->_cardsAvailableNumb < 0) scene->shuffleCards(); - scene->_item2._object1.setPosition(Common::Point(162, 95)); - scene->_item2._object1.show(); + scene->_animatedCard._card.setPosition(Common::Point(162, 95)); + scene->_animatedCard._card.show(); scene->_aSound2.play(61); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &scene->_arrunkObj1337[scene->_field423E]._fieldBA0, this); + scene->_animatedCard._card.addMover(mover, &scene->_gameBoardSide[scene->_currentPlayerNumb]._card4Pos, this); - scene->_arrunkObj1337[scene->_field423E]._arr1[3]._field34 = scene->_field3E28[scene->_field3E24]; - scene->_field3E28[scene->_field3E24] = 0; - scene->_field3E24--; - if (scene->_field3E24 < 0) - scene->_background2.remove(); + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb]; + scene->_availableCardsPile[scene->_cardsAvailableNumb] = 0; + scene->_cardsAvailableNumb--; + if (scene->_cardsAvailableNumb < 0) + scene->_stockPile.remove(); } else signal(); break; case 4: - if ( ( scene->_item2._object1._position.x == scene->_arrunkObj1337[scene->_field423E]._fieldBA0.x) - && ( scene->_item2._object1._position.y == scene->_arrunkObj1337[scene->_field423E]._fieldBA0.y) ) { - scene->_arrunkObj1337[scene->_field423E]._arr1[3]._object1.postInit(); - scene->_arrunkObj1337[scene->_field423E]._arr1[3]._object1._moveDiff = Common::Point(30, 30); - scene->_arrunkObj1337[scene->_field423E]._arr1[3]._object1.setVisage(1332); - scene->_arrunkObj1337[scene->_field423E]._arr1[3]._object1.setPosition(scene->_arrunkObj1337[scene->_field423E]._arr1[3]._field36, 0); - scene->_arrunkObj1337[scene->_field423E]._arr1[3]._object1.setStrip(1); - scene->_arrunkObj1337[scene->_field423E]._arr1[3]._object1.setFrame(scene->_arrunkObj1337[scene->_field423E]._fieldBA4); - scene->_arrunkObj1337[scene->_field423E]._arr1[3]._object1.fixPriority(170); - } - - if ((scene->_field4248 == 1) || (scene->_field423E == 2)) - scene->setAnimationInfo(&scene->_arrunkObj1337[scene->_field423E]._arr1[3]); - - scene->_item2._object1.hide(); - switch (scene->_field423E) { + if ( (scene->_animatedCard._card._position.x == scene->_gameBoardSide[scene->_currentPlayerNumb]._card4Pos.x) + && (scene->_animatedCard._card._position.y == scene->_gameBoardSide[scene->_currentPlayerNumb]._card4Pos.y) ) { + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._card.postInit(); + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._card._moveDiff = Common::Point(30, 30); + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._card.setVisage(1332); + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._card.setPosition(scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._stationPos, 0); + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._card.setStrip(1); + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._card.setFrame(scene->_gameBoardSide[scene->_currentPlayerNumb]._frameNum); + scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._card.fixPriority(170); + } + + if ((R2_GLOBALS._debugCardGame) || (scene->_currentPlayerNumb == 2)) + scene->setAnimationInfo(&scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]); + + scene->_animatedCard._card.hide(); + switch (scene->_currentPlayerNumb) { case 0: - scene->subCF979(); + scene->handlePlayer0(); break; case 1: - scene->subCF31D(); + scene->handlePlayer1(); break; case 2: - scene->subD0281(); + scene->handleAutoplayPlayer2(); break; case 3: - scene->subC2C2F(); + scene->handlePlayer3(); break; default: break; @@ -3506,115 +3542,124 @@ void Scene1337::Action4::signal() { } } +/** + * Animations for discarding a card + */ void Scene1337::Action5::signal() { Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene; switch (_actionIndex++) { case 0: { - scene->_field3E28[scene->_field3E26] = scene->_field3EF0->_field34; - scene->_field3E26--; - if (!g_globals->_sceneObjects->contains(&scene->_item7._object1)) { - scene->_item7._object1.postInit(); - scene->_item7._object1.hide(); - scene->_item7._object1.setVisage(1332); - scene->_item7._object1.setPosition(scene->_item7._field36, 0); - scene->_item7._object1.fixPriority(170); - } - - scene->_item7._field34 = scene->_field3EF0->_field34; - scene->_field3EF0->_field34 = 0; - scene->_field3EF0->_object1.remove(); - - if (scene->_field3EF0 == &scene->_item6) { - subD18B5(5, 1, 4); + scene->_availableCardsPile[scene->_currentDiscardIndex] = scene->_actionCard1->_cardId; + scene->_currentDiscardIndex--; + if (!g_globals->_sceneObjects->contains(&scene->_discardPile._card)) { + // The first discarded card makes the pile appear + scene->_discardPile._card.postInit(); + scene->_discardPile._card.hide(); + scene->_discardPile._card.setVisage(1332); + scene->_discardPile._card.setPosition(scene->_discardPile._stationPos, 0); + scene->_discardPile._card.fixPriority(170); + } + + scene->_discardPile._cardId = scene->_actionCard1->_cardId; + scene->_actionCard1->_cardId = 0; + scene->_actionCard1->_card.remove(); + + if (scene->_actionCard1 == &scene->_selectedCard) { + scene->setCursorData(5, 1, 4); scene->subC4CEC(); } - scene->_item2._object1.setPosition(scene->_field3EF0->_field36, 0); - scene->_item2._object1.show(); + scene->_animatedCard._card.setPosition(scene->_actionCard1->_stationPos, 0); + scene->_animatedCard._card.show(); Common::Point pt(128, 95); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &pt, this); + scene->_animatedCard._card.addMover(mover, &pt, this); } break; case 1: - scene->_item2._object1.hide(); - scene->setAnimationInfo(&scene->_item7); + scene->_animatedCard._card.hide(); + scene->setAnimationInfo(&scene->_discardPile); scene->_aSound2.play(61); - scene->subC20F9(); + scene->handleNextTurn(); break; default: break; } } +/** + * Animations for playing a platform card + */ void Scene1337::Action6::signal() { Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene; switch (_actionIndex++) { case 0: { - scene->_field3EF4->_field34 = 1; - scene->_field3EF4->_object1.postInit(); - scene->_field3EF4->_object1.hide(); - scene->_field3EF4->_object1.setVisage(1332); - scene->_field3EF4->_object1.setPosition(scene->_field3EF4->_field36); - scene->_field3EF4->_object1.fixPriority(170); + scene->_actionCard2->_cardId = 1; + scene->_actionCard2->_card.postInit(); + scene->_actionCard2->_card.hide(); + scene->_actionCard2->_card.setVisage(1332); + scene->_actionCard2->_card.setPosition(scene->_actionCard2->_stationPos); + scene->_actionCard2->_card.fixPriority(170); - scene->_field3EF0->_field34 = 0; - scene->_field3EF0->_object1.remove(); + scene->_actionCard1->_cardId = 0; + scene->_actionCard1->_card.remove(); - scene->_item2._object1.setPosition(scene->_field3EF0->_field36); - scene->_item2._object1.show(); + scene->_animatedCard._card.setPosition(scene->_actionCard1->_stationPos); + scene->_animatedCard._card.show(); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &scene->_field3EF4->_field36, this); + scene->_animatedCard._card.addMover(mover, &scene->_actionCard2->_stationPos, this); } break; case 1: - scene->_item2._object1.hide(); - scene->setAnimationInfo(scene->_field3EF4); + scene->_animatedCard._card.hide(); + scene->setAnimationInfo(scene->_actionCard2); scene->_aSound1.play(59); - if (scene->_field3EF0 == &scene->_item6) { - subD18B5(5, 1, 4); + if (scene->_actionCard1 == &scene->_selectedCard) { + scene->setCursorData(5, 1, 4); scene->subC4CEC(); } - scene->subC20F9(); + scene->handleNextTurn(); break; default: break; } } +/** + * Upgrade platform to station by playing a station card on top of it + */ void Scene1337::Action7::signal() { Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene; switch (_actionIndex++) { case 0: { - scene->_field3EF4->_field34 = scene->_field3EF0->_field34; + scene->_actionCard2->_cardId = scene->_actionCard1->_cardId; - scene->_field3EF0->_field34 = 0; - scene->_field3EF0->_object1.remove(); + scene->_actionCard1->_cardId = 0; + scene->_actionCard1->_card.remove(); - scene->_item2._object1.setPosition(scene->_field3EF0->_field36, 0); - scene->_item2._object1.show(); + scene->_animatedCard._card.setPosition(scene->_actionCard1->_stationPos, 0); + scene->_animatedCard._card.show(); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &scene->_field3EF4->_field36, this); + scene->_animatedCard._card.addMover(mover, &scene->_actionCard2->_stationPos, this); } break; case 1: - if (scene->_field3EF0 == &scene->_item6) { - subD18B5(5, 1, 4); + if (scene->_actionCard1 == &scene->_selectedCard) { + scene->setCursorData(5, 1, 4); scene->subC4CEC(); } - scene->setAnimationInfo(scene->_field3EF4); + scene->setAnimationInfo(scene->_actionCard2); scene->_aSound1.play(59); - scene->_item5._field34 = 1; - scene->_item5._field36.x = scene->_field3EF4->_field36.x; - scene->_item5._field36.y = scene->_field3EF4->_field36.y; - scene->_item5._object1.postInit(); - scene->_item5._object1.hide(); - scene->_item5._object1._flags = 0x200; + scene->_discardedPlatformCard._cardId = 1; + scene->_discardedPlatformCard._stationPos = scene->_actionCard2->_stationPos; + scene->_discardedPlatformCard._card.postInit(); + scene->_discardedPlatformCard._card.hide(); + scene->_discardedPlatformCard._card._flags = OBJFLAG_HIDING; - scene->subC4A39(&scene->_item5); + scene->discardCard(&scene->_discardedPlatformCard); break; default: break; @@ -3626,112 +3671,114 @@ void Scene1337::Action8::signal() { switch (_actionIndex++) { case 0: { - scene->_field3E28[scene->_field3E26] = scene->_field3EF4->_field34; - scene->_field3E26--; + scene->_availableCardsPile[scene->_currentDiscardIndex] = scene->_actionCard2->_cardId; + scene->_currentDiscardIndex--; - scene->_field3EF4->_field34 = scene->_field3EF0->_field34; - scene->_field3EF0->_object1.remove(); + scene->_actionCard2->_cardId = scene->_actionCard1->_cardId; + scene->_actionCard1->_card.remove(); - scene->_item2._object1.setPosition(scene->_field3EF0->_field36, 0); - scene->_item2._object1.show(); + scene->_animatedCard._card.setPosition(scene->_actionCard1->_stationPos, 0); + scene->_animatedCard._card.show(); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &scene->_field3EF4->_field36, this); + scene->_animatedCard._card.addMover(mover, &scene->_actionCard2->_stationPos, this); } break; case 1: - scene->_item2._object1.hide(); + scene->_animatedCard._card.hide(); - if (scene->_field3EF0 == &scene->_item6) { - subD18B5(5, 1, 4); + if (scene->_actionCard1 == &scene->_selectedCard) { + scene->setCursorData(5, 1, 4); scene->subC4CEC(); } - scene->setAnimationInfo(scene->_field3EF4); + scene->setAnimationInfo(scene->_actionCard2); scene->_aSound1.play(58); - scene->subC4A39(scene->_field3EF4); + scene->discardCard(scene->_actionCard2); break; default: break; } } +// Play delay card void Scene1337::Action9::signal() { Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene; switch (_actionIndex++) { case 0: { - scene->_field3EF4->_field34 = scene->_field3EF0->_field34; - scene->_field3EF4->_object1.postInit(); - scene->_field3EF4->_object1.hide(); - scene->_field3EF4->_object1.setVisage(1332); - scene->_field3EF4->_object1.setPosition(scene->_field3EF4->_field36, 0); - scene->_field3EF4->_object1.fixPriority(170); + scene->_actionCard2->_cardId = scene->_actionCard1->_cardId; + scene->_actionCard2->_card.postInit(); + scene->_actionCard2->_card.hide(); + scene->_actionCard2->_card.setVisage(1332); + scene->_actionCard2->_card.setPosition(scene->_actionCard2->_stationPos, 0); + scene->_actionCard2->_card.fixPriority(170); - scene->_field3EF0->_field34 = 0; - scene->_field3EF0->_object1.remove(); + scene->_actionCard1->_cardId = 0; + scene->_actionCard1->_card.remove(); - scene->_item2._object1.setPosition(scene->_field3EF0->_field36, 0); - scene->_item2._object1.show(); + scene->_animatedCard._card.setPosition(scene->_actionCard1->_stationPos, 0); + scene->_animatedCard._card.show(); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &scene->_field3EF4->_field36, this); + scene->_animatedCard._card.addMover(mover, &scene->_actionCard2->_stationPos, this); } break; case 1: - scene->_item2._object1.hide(); - scene->setAnimationInfo(scene->_field3EF4); + scene->_animatedCard._card.hide(); + scene->setAnimationInfo(scene->_actionCard2); scene->_aSound1.play(57); - if (scene->_field3EF0 == &scene->_item6) { - subD18B5(5, 1, 4); + if (scene->_actionCard1 == &scene->_selectedCard) { + scene->setCursorData(5, 1, 4); scene->subC4CEC(); } - scene->subC20F9(); + scene->handleNextTurn(); break; default: break; } } +// Counter a trick with a card void Scene1337::Action10::signal() { Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene; switch (_actionIndex++) { case 0: { - scene->_field3EF8->_object1.postInit(); - scene->_field3EF8->_object1.hide(); - scene->_field3EF8->_object1.setVisage(1332); - scene->_field3EF8->_object1.setPosition(scene->_field3EF8->_field36, 0); - scene->_field3EF8->_object1.fixPriority(170); - scene->_field3EF8->_field34 = scene->_field3EF0->_field34; - - scene->_field3EF0->_field34 = 0; - scene->_field3EF0->_object1.remove(); - - if (scene->_field3EF0 == &scene->_item6) { - subD18B5(5, 1, 4); + scene->_actionCard3->_card.postInit(); + scene->_actionCard3->_card.hide(); + scene->_actionCard3->_card.setVisage(1332); + scene->_actionCard3->_card.setPosition(scene->_actionCard3->_stationPos, 0); + scene->_actionCard3->_card.fixPriority(170); + scene->_actionCard3->_cardId = scene->_actionCard1->_cardId; + + scene->_actionCard1->_cardId = 0; + scene->_actionCard1->_card.remove(); + + if (scene->_actionCard1 == &scene->_selectedCard) { + scene->setCursorData(5, 1, 4); scene->subC4CEC(); } - scene->_item2._object1.setPosition(scene->_field3EF0->_field36, 0); - scene->_item2._object1.show(); + scene->_animatedCard._card.setPosition(scene->_actionCard1->_stationPos, 0); + scene->_animatedCard._card.show(); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &scene->_field3EF8->_field36, this); + scene->_animatedCard._card.addMover(mover, &scene->_actionCard3->_stationPos, this); } break; case 1: { - scene->_item2._object1.hide(); - scene->setAnimationInfo(scene->_field3EF8); + scene->_animatedCard._card.hide(); + scene->setAnimationInfo(scene->_actionCard3); scene->_aSound1.play(57); bool found = false; int indexFound = -1; - switch (scene->_field4240) { + switch (scene->_actionIdx1) { case 0: for (indexFound = 0; indexFound < 3; indexFound++) { - if (scene->_arrunkObj1337[0]._arr1[indexFound]._field34 == 29) { + if (scene->_gameBoardSide[0]._handCard[indexFound]._cardId == 29) { found = true; break; } @@ -3739,7 +3786,7 @@ void Scene1337::Action10::signal() { break; case 1: for (indexFound = 0; indexFound < 3; indexFound++) { - if (scene->_arrunkObj1337[1]._arr1[indexFound]._field34 == 29) { + if (scene->_gameBoardSide[1]._handCard[indexFound]._cardId == 29) { found = true; break; } @@ -3747,7 +3794,7 @@ void Scene1337::Action10::signal() { break; case 2: for (indexFound = 0; indexFound < 3; indexFound++) { - if (scene->_arrunkObj1337[2]._arr1[indexFound]._field34 == 29) { + if (scene->_gameBoardSide[2]._handCard[indexFound]._cardId == 29) { found = true; break; } @@ -3755,7 +3802,7 @@ void Scene1337::Action10::signal() { break; case 3: for (indexFound = 0; indexFound < 3; indexFound++) { - if (scene->_arrunkObj1337[3]._arr1[indexFound]._field34 == 29) { + if (scene->_gameBoardSide[3]._handCard[indexFound]._cardId == 29) { found = true; break; } @@ -3768,13 +3815,13 @@ void Scene1337::Action10::signal() { bool found2 = false; if (found) { - switch (scene->_field4240) { + switch (scene->_actionIdx1) { case 0: - scene->subC51A0(&scene->_arrunkObj1337[0]._arr1[indexFound], scene->_field3EF8); + scene->subC51A0(&scene->_gameBoardSide[0]._handCard[indexFound], scene->_actionCard3); found2 = true; break; case 1: - scene->subC51A0(&scene->_arrunkObj1337[1]._arr1[indexFound], scene->_field3EF8); + scene->subC51A0(&scene->_gameBoardSide[1]._handCard[indexFound], scene->_actionCard3); found2 = true; break; case 2: @@ -3782,12 +3829,12 @@ void Scene1337::Action10::signal() { if (MessageDialog::show(USE_INTERCEPTOR, NO_MSG, YES_MSG) == 0) scene->subC4CEC(); else { - scene->subC51A0(&scene->_arrunkObj1337[2]._arr1[indexFound], scene->_field3EF8); + scene->subC51A0(&scene->_gameBoardSide[2]._handCard[indexFound], scene->_actionCard3); found2 = true; } break; case 3: - scene->subC51A0(&scene->_arrunkObj1337[3]._arr1[indexFound], scene->_field3EF8); + scene->subC51A0(&scene->_gameBoardSide[3]._handCard[indexFound], scene->_actionCard3); found2 = true; break; default: @@ -3798,17 +3845,17 @@ void Scene1337::Action10::signal() { if (!found2) break; - if (scene->_field4240 == 2) { + if (scene->_actionIdx1 == 2) { int j = 0; for (int i = 0; i <= 7; i++) { - if (scene->_arrunkObj1337[2]._arr2[i]._field34 != 0) + if (scene->_gameBoardSide[2]._outpostStation[i]._cardId != 0) ++j; } if (j <= 1) { for (int i = 0; i <= 7; i++) { - if (scene->_arrunkObj1337[2]._arr2[i]._field34 != 0) { - scene->_field3EF4 = &scene->_arrunkObj1337[2]._arr2[i]; + if (scene->_gameBoardSide[2]._outpostStation[i]._cardId != 0) { + scene->_actionCard2 = &scene->_gameBoardSide[2]._outpostStation[i]; break; } } @@ -3827,11 +3874,11 @@ void Scene1337::Action10::signal() { g_globals->_events.delay(g_globals->_sceneHandler->_delayTicks); } - scene->_item6._field36 = event.mousePos; + scene->_selectedCard._stationPos = event.mousePos; for (int i = 0; i <= 7; i++) { - if ((scene->subC2BF8(&scene->_arrunkObj1337[2]._arr2[i], scene->_item6._field36) != 0) && (scene->_arrunkObj1337[2]._arr2[i]._field34 != 0)) { - scene->_field3EF4 = &scene->_arrunkObj1337[2]._arr2[0]; + if (scene->_gameBoardSide[2]._outpostStation[i].isIn(scene->_selectedCard._stationPos) && (scene->_gameBoardSide[2]._outpostStation[i]._cardId != 0)) { + scene->_actionCard2 = &scene->_gameBoardSide[2]._outpostStation[0]; found2 = true; break; } @@ -3841,143 +3888,144 @@ void Scene1337::Action10::signal() { } } - scene->_field3E28[scene->_field3E26] = scene->_field3EF4->_field34; - scene->_field3E26--; - scene->_field3EF4->_field34 = 0; - scene->_field3EF4->_object1.remove(); + scene->_availableCardsPile[scene->_currentDiscardIndex] = scene->_actionCard2->_cardId; + scene->_currentDiscardIndex--; + scene->_actionCard2->_cardId = 0; + scene->_actionCard2->_card.remove(); - scene->_item2._object1.setPosition(scene->_field3EF4->_field36, 0); - scene->_item2._object1.show(); + scene->_animatedCard._card.setPosition(scene->_actionCard2->_stationPos, 0); + scene->_animatedCard._card.show(); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &scene->_field3EF8->_field36, this); + scene->_animatedCard._card.addMover(mover, &scene->_actionCard3->_stationPos, this); } break; case 2: - scene->_item2._object1.hide(); - scene->subC4A39(scene->_field3EF8); + scene->_animatedCard._card.hide(); + scene->discardCard(scene->_actionCard3); break; default: break; } } +// Use trick (card #25 - thieft ?) and pick a card from the opponent void Scene1337::Action11::signal() { Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene; - bool noAction = true; - switch (_actionIndex++) { case 0: { - scene->_field3EF4->_object1.postInit(); - scene->_field3EF4->_object1.hide(); - scene->_field3EF4->_object1.setVisage(1332); - scene->_field3EF4->_object1.setPosition(scene->_field3EF4->_field36, 0); - scene->_field3EF4->_object1.fixPriority(170); - scene->_field3EF4->_field34 = 25; - - if (scene->_field4240 == 2) { - scene->_item2._object1.setPosition(scene->_field3EF4->_field36, 0); - subD18B5(5, 1, 4); + scene->_actionCard2->_card.postInit(); + scene->_actionCard2->_card.hide(); + scene->_actionCard2->_card.setVisage(1332); + scene->_actionCard2->_card.setPosition(scene->_actionCard2->_stationPos, 0); + scene->_actionCard2->_card.fixPriority(170); + scene->_actionCard2->_cardId = 25; + + if (scene->_actionIdx1 == 2) { + scene->_animatedCard._card.setPosition(scene->_actionCard2->_stationPos, 0); + scene->setCursorData(5, 1, 4); } else { - scene->_field3EF0->_field34 = 0; - scene->_field3EF0->_object1.remove(); - scene->_item2._object1.setPosition(scene->_field3EF0->_field36, 0); + scene->_actionCard1->_cardId = 0; + scene->_actionCard1->_card.remove(); + scene->_animatedCard._card.setPosition(scene->_actionCard1->_stationPos, 0); } - scene->_item2._object1.show(); + scene->_animatedCard._card.show(); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &scene->_field3EF4->_field36, this); + scene->_animatedCard._card.addMover(mover, &scene->_actionCard2->_stationPos, this); } break; case 1: { - scene->_item2._object1.hide(); - scene->setAnimationInfo(scene->_field3EF4); + scene->_animatedCard._card.hide(); + scene->setAnimationInfo(scene->_actionCard2); scene->_aSound1.play(57); bool found = false; + bool noAction = true; + int i = -1; - switch (scene->_field4242) { + switch (scene->_actionIdx2) { case 0: for (i = 0; i <= 3; i++) { - if (scene->_arrunkObj1337[0]._arr1[i]._field34 == 27) { + if (scene->_gameBoardSide[0]._handCard[i]._cardId == 27) { found = true; break; } } - if ((found) && (scene->subC3E92(scene->_field4240) != -1)) { - scene->_field3EF0 = &scene->_arrunkObj1337[0]._arr1[i]; - scene->_field3EF4 = &scene->_arrunkObj1337[0]._arr4[0]; - if (scene->_field4240 != 0) { - int tmpVal = scene->subC3E92(scene->_field4240); - scene->_field3EF8 = &scene->_arrunkObj1337[scene->_field4240]._arr1[tmpVal]; + if ((found) && (scene->getFreeHandCard(scene->_actionIdx1) != -1)) { + scene->_actionCard1 = &scene->_gameBoardSide[0]._handCard[i]; + scene->_actionCard2 = &scene->_gameBoardSide[0]._emptyStationPos; + if (scene->_actionIdx1 != 0) { + int tmpVal = scene->getFreeHandCard(scene->_actionIdx1); + scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionIdx1]._handCard[tmpVal]; } - scene->_item1.setAction(&scene->_action12); + scene->_actionItem.setAction(&scene->_action12); noAction = false; } break; case 1: for (i = 0; i <= 3; i++) { - if (scene->_arrunkObj1337[1]._arr1[i]._field34 == 27) { + if (scene->_gameBoardSide[1]._handCard[i]._cardId == 27) { found = true; break; } } - if ((found) && (scene->subC3E92(scene->_field4240) != -1)) { - scene->_field3EF0 = &scene->_arrunkObj1337[1]._arr1[i]; - scene->_field3EF4 = &scene->_arrunkObj1337[1]._arr4[0]; - if (scene->_field4240 != 1) { - int tmpVal = scene->subC3E92(scene->_field4240); - scene->_field3EF8 = &scene->_arrunkObj1337[scene->_field4240]._arr1[tmpVal]; + if ((found) && (scene->getFreeHandCard(scene->_actionIdx1) != -1)) { + scene->_actionCard1 = &scene->_gameBoardSide[1]._handCard[i]; + scene->_actionCard2 = &scene->_gameBoardSide[1]._emptyStationPos; + if (scene->_actionIdx1 != 1) { + int tmpVal = scene->getFreeHandCard(scene->_actionIdx1); + scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionIdx1]._handCard[tmpVal]; } - scene->_item1.setAction(&scene->_action12); + scene->_actionItem.setAction(&scene->_action12); noAction = false; } break; case 2: for (i = 0; i <= 3; i++) { - if (scene->_arrunkObj1337[2]._arr1[i]._field34 == 27) { + if (scene->_gameBoardSide[2]._handCard[i]._cardId == 27) { found = true; break; } } - if ((found) && (scene->subC3E92(scene->_field4240) != -1)) { + if ((found) && (scene->getFreeHandCard(scene->_actionIdx1) != -1)) { scene->subC4CD2(); if (MessageDialog::show(USE_DOUBLE_AGENT, NO_MSG, YES_MSG) == 0) scene->subC4CEC(); else { scene->subC4CEC(); - scene->_field3EF0 = &scene->_arrunkObj1337[2]._arr1[i]; - scene->_field3EF4 = &scene->_arrunkObj1337[2]._arr4[0]; - if (scene->_field4240 != 2) { - int tmpVal = scene->subC3E92(scene->_field4240); - scene->_field3EF8 = &scene->_arrunkObj1337[scene->_field4240]._arr1[tmpVal]; + scene->_actionCard1 = &scene->_gameBoardSide[2]._handCard[i]; + scene->_actionCard2 = &scene->_gameBoardSide[2]._emptyStationPos; + if (scene->_actionIdx1 != 2) { + int tmpVal = scene->getFreeHandCard(scene->_actionIdx1); + scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionIdx1]._handCard[tmpVal]; } - scene->_item1.setAction(&scene->_action12); + scene->_actionItem.setAction(&scene->_action12); noAction = false; } } break; case 3: for (i = 0; i <= 3; i++) { - if (scene->_arrunkObj1337[3]._arr1[i]._field34 == 27) { + if (scene->_gameBoardSide[3]._handCard[i]._cardId == 27) { found = true; break; } } - if ((found) && (scene->subC3E92(scene->_field4240) != -1)) { - scene->_field3EF0 = &scene->_arrunkObj1337[3]._arr1[i]; - scene->_field3EF4 = &scene->_arrunkObj1337[3]._arr4[0]; - if (scene->_field4240 != 3) { - int tmpVal = scene->subC3E92(scene->_field4240); - scene->_field3EF8 = &scene->_arrunkObj1337[scene->_field4240]._arr1[tmpVal]; + if ((found) && (scene->getFreeHandCard(scene->_actionIdx1) != -1)) { + scene->_actionCard1 = &scene->_gameBoardSide[3]._handCard[i]; + scene->_actionCard2 = &scene->_gameBoardSide[3]._emptyStationPos; + if (scene->_actionIdx1 != 3) { + int tmpVal = scene->getFreeHandCard(scene->_actionIdx1); + scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionIdx1]._handCard[tmpVal]; } - scene->_item1.setAction(&scene->_action12); + scene->_actionItem.setAction(&scene->_action12); noAction = false; } break; @@ -3988,11 +4036,11 @@ void Scene1337::Action11::signal() { if (!noAction) return; - if (scene->_field4240 == 2) { + if (scene->_actionIdx1 == 2) { int count = 0; - if (scene->_field4242 != 2) { + if (scene->_actionIdx2 != 2) { for (i = 0; i <= 3; i++) { - if (scene->_arrunkObj1337[scene->_field4242]._arr1[i]._field34 == 0) + if (scene->_gameBoardSide[scene->_actionIdx2]._handCard[i]._cardId == 0) ++count; } } @@ -4002,7 +4050,7 @@ void Scene1337::Action11::signal() { found = false; while (!found) { - switch (scene->_field4242) { + switch (scene->_actionIdx2) { case 0: scene->actionDisplay(1330, 131, 159, 10, 1, 200, 0, 7, 0, 154, 154); break; @@ -4023,81 +4071,76 @@ void Scene1337::Action11::signal() { g_globals->_events.delay(g_globals->_sceneHandler->_delayTicks); } - scene->_item6._field36 = event.mousePos; + scene->_selectedCard._stationPos = event.mousePos; found = false; - if (scene->_field4242 != 2) { + if (scene->_actionIdx2 != 2) { for (i = 0; i <= 3; i++) { - if ((scene->subC2BF8(&scene->_arrunkObj1337[scene->_field4242]._arr1[i], scene->_item6._field36) != 0) && (scene->_arrunkObj1337[scene->_field4242]._arr1[i]._field34 != 0)) { - scene->_field3EF8 = &scene->_arrunkObj1337[scene->_field4242]._arr1[i]; + if (scene->_gameBoardSide[scene->_actionIdx2]._handCard[i].isIn(scene->_selectedCard._stationPos) && (scene->_gameBoardSide[scene->_actionIdx2]._handCard[i]._cardId != 0)) { + scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionIdx2]._handCard[i]; found = true; break; } } } } // while - scene->_field4246 = 1; + scene->_displayHelpFl = true; scene->subC4CEC(); - } else { - if (scene->_field4242 != 2) { - int tmpVal = scene->subC3E92(scene->_field4242); - scene->_field3EF8 = &scene->_arrunkObj1337[scene->_field4242]._arr1[tmpVal]; - } + } else if (scene->_actionIdx2 != 2) { + int tmpVal = scene->getFreeHandCard(scene->_actionIdx2); + scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionIdx2]._handCard[tmpVal]; } } - scene->_field3EF0->_object1.postInit(); - scene->_field3EF0->_object1.hide(); - scene->_field3EF0->_object1.setVisage(1332); - scene->_field3EF0->_object1.setPosition(scene->_field3EF0->_field36, 0); - scene->_field3EF0->_object1.fixPriority(170); - scene->_field3EF0->_object1.setStrip2(1); - scene->_field3EF0->_field34 = scene->_field3EF8->_field34; + scene->_actionCard1->_card.postInit(); + scene->_actionCard1->_card.hide(); + scene->_actionCard1->_card.setVisage(1332); + scene->_actionCard1->_card.setPosition(scene->_actionCard1->_stationPos, 0); + scene->_actionCard1->_card.fixPriority(170); + scene->_actionCard1->_card.setStrip2(1); + scene->_actionCard1->_cardId = scene->_actionCard3->_cardId; - scene->_field3EF8->_field34 = 0; - scene->_field3EF8->_object1.remove(); + scene->_actionCard3->_cardId = 0; + scene->_actionCard3->_card.remove(); - scene->_item2._object1.setPosition(scene->_field3EF8->_field36, 0); - scene->_item2._object1.show(); + scene->_animatedCard._card.setPosition(scene->_actionCard3->_stationPos, 0); + scene->_animatedCard._card.show(); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &scene->_field3EF0->_field36, this); + scene->_animatedCard._card.addMover(mover, &scene->_actionCard1->_stationPos, this); } break; case 2: - scene->_item2._object1.hide(); - switch (scene->_field4240) { + scene->_animatedCard._card.hide(); + switch (scene->_actionIdx1) { case 0: - scene->_field3EF0->_object1.setFrame(2); - scene->_field3EF0->_object1.show(); - scene->_field423E--; - scene->_field4244 = 0; + scene->_actionCard1->_card.setFrame2(2); + scene->_actionCard1->_card.show(); break; case 1: - scene->_field3EF0->_object1.setFrame(4); - scene->_field3EF0->_object1.show(); - scene->_field423E--; - scene->_field4244 = 0; + scene->_actionCard1->_card.setFrame2(4); + scene->_actionCard1->_card.show(); break; case 3: - scene->_field3EF0->_object1.setFrame(3); - scene->_field3EF0->_object1.show(); - scene->_field423E--; - scene->_field4244 = 0; + scene->_actionCard1->_card.setFrame2(3); + scene->_actionCard1->_card.show(); break; default: - scene->setAnimationInfo(scene->_field3EF0); + scene->setAnimationInfo(scene->_actionCard1); break; } - scene->subC4A39(scene->_field3EF4); + scene->_currentPlayerNumb--; + scene->_showPlayerTurn = false; + scene->discardCard(scene->_actionCard2); break; default: break; } } +// Pick a card in opponent hand void Scene1337::Action12::signal() { Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene; @@ -4106,40 +4149,42 @@ void Scene1337::Action12::signal() { signal(); break; case 1: { - scene->_field3E28[scene->_field3E26] = scene->_field3EF4->_field34; - scene->_field3EF4->_field34 = scene->_field3EF0->_field34; - scene->_field3EF0->_field34 = 0; - scene->_field3EF0->_object1.remove(); - scene->_item2._object1.setPosition(scene->_field3EF0->_field36, 0); - scene->_item2._object1.show(); + scene->_availableCardsPile[scene->_currentDiscardIndex] = scene->_actionCard2->_cardId; + scene->_currentDiscardIndex++; + scene->_actionCard2->_cardId = scene->_actionCard1->_cardId; + scene->_actionCard1->_cardId = 0; + scene->_actionCard1->_card.remove(); + scene->_animatedCard._card.setPosition(scene->_actionCard1->_stationPos, 0); + scene->_animatedCard._card.show(); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &scene->_field3EF4->_field36, this); + scene->_animatedCard._card.addMover(mover, &scene->_actionCard2->_stationPos, this); } break; case 2: - scene->_item2._object1.hide(); - scene->setAnimationInfo(scene->_field3EF4); + scene->_animatedCard._card.hide(); + scene->setAnimationInfo(scene->_actionCard2); scene->_aSound1.play(58); - if (scene->_field4242 == 2) { + if (scene->_actionIdx2 == 2) { int count = 0; int i = -1; - switch (scene->_field4240) { + switch (scene->_actionIdx1) { case 0: for (i = 0; i <= 3; i++) { - if (scene->_arrunkObj1337[0]._arr1[i]._field34 != 0) + if (scene->_gameBoardSide[0]._handCard[i]._cardId != 0) ++count; } break; case 1: for (i = 0; i <= 3; i++) { - if (scene->_arrunkObj1337[3]._arr1[i]._field34 != 0) + // The original game was counting in the hand of player 3, which is obviously wrong + if (scene->_gameBoardSide[1]._handCard[i]._cardId != 0) ++count; } break; case 3: for (i = 0; i <= 3; i++) { - if (scene->_arrunkObj1337[3]._arr1[i]._field34 != 0) + if (scene->_gameBoardSide[3]._handCard[i]._cardId != 0) ++count; } break; @@ -4153,7 +4198,7 @@ void Scene1337::Action12::signal() { bool found = false; while (!found) { - switch (scene->_field4240) { + switch (scene->_actionIdx1) { case 0: scene->actionDisplay(1330, 131, 159, 10, 1, 200, 0, 7, 0, 154, 154); break; @@ -4174,95 +4219,94 @@ void Scene1337::Action12::signal() { g_globals->_events.delay(g_globals->_sceneHandler->_delayTicks); } - scene->_item6._field36 = event.mousePos; + scene->_selectedCard._stationPos = event.mousePos; - if (scene->_field4240 == 0) { + if (scene->_actionIdx1 == 0) { for (i = 0; i <= 3; i++) { - if ((scene->subC2BF8(&scene->_arrunkObj1337[0]._arr1[i], scene->_item6._field36) != 0) && (scene->_arrunkObj1337[0]._arr1[i]._field34 != 0)) { + if (scene->_gameBoardSide[0]._handCard[i].isIn(scene->_selectedCard._stationPos) && (scene->_gameBoardSide[0]._handCard[i]._cardId != 0)) { found = true; - scene->_field3EF8 = &scene->_arrunkObj1337[0]._arr1[i]; + scene->_actionCard3 = &scene->_gameBoardSide[0]._handCard[i]; break; } } } - if (scene->_field4240 == 3) { + if (scene->_actionIdx1 == 3) { for (i = 0; i <= 3; i++) { - if ((scene->subC2BF8(&scene->_arrunkObj1337[3]._arr1[i], scene->_item6._field36) != 0) && (scene->_arrunkObj1337[3]._arr1[i]._field34 != 0)) { + if (scene->_gameBoardSide[3]._handCard[i].isIn(scene->_selectedCard._stationPos) && (scene->_gameBoardSide[3]._handCard[i]._cardId != 0)) { found = true; - scene->_field3EF8 = &scene->_arrunkObj1337[3]._arr1[i]; + scene->_actionCard3 = &scene->_gameBoardSide[3]._handCard[i]; break; } } } - if (scene->_field4240 == 1) { + if (scene->_actionIdx1 == 1) { for (i = 0; i <= 3; i++) { - if ((scene->subC2BF8(&scene->_arrunkObj1337[1]._arr1[i], scene->_item6._field36) != 0) && (scene->_arrunkObj1337[1]._arr1[i]._field34 != 0)) { + if (scene->_gameBoardSide[1]._handCard[i].isIn(scene->_selectedCard._stationPos) && (scene->_gameBoardSide[1]._handCard[i]._cardId != 0)) { found = true; - scene->_field3EF8 = &scene->_arrunkObj1337[1]._arr1[i]; + scene->_actionCard3 = &scene->_gameBoardSide[1]._handCard[i]; break; } } } } scene->subC4CEC(); - } else { - if (scene->_field4240 != 1) { - switch (scene->_field4240) { - case 0: - scene->_field3EF8 = &scene->_arrunkObj1337[0]._arr1[scene->subC3E92(0)]; - break; - case 3: - scene->_field3EF8 = &scene->_arrunkObj1337[3]._arr1[scene->subC3E92(3)]; - break; - default: - break; - } - } else { - scene->_field3EF8 = &scene->_arrunkObj1337[1]._arr1[scene->subC3E92(1)]; + } else if (scene->_actionIdx1 != 1) { + switch (scene->_actionIdx1) { + case 0: + scene->_actionCard3 = &scene->_gameBoardSide[0]._handCard[scene->getFreeHandCard(0)]; + break; + case 3: + scene->_actionCard3 = &scene->_gameBoardSide[3]._handCard[scene->getFreeHandCard(3)]; + break; + default: + break; } + } else { + scene->_actionCard3 = &scene->_gameBoardSide[1]._handCard[scene->getFreeHandCard(1)]; } - scene->_field3EF0->_object1.postInit(); - scene->_field3EF0->_object1.hide(); - scene->_field3EF0->_object1.setVisage(1332); - scene->_field3EF0->_object1.setPosition(scene->_field3EF0->_field36); - scene->_field3EF0->_object1.fixPriority(170); - scene->_field3EF0->_object1.setStrip2(1); - scene->_field3EF0->_field34 = scene->_field3EF8->_field34; + scene->_actionCard1->_card.postInit(); + scene->_actionCard1->_card.hide(); + scene->_actionCard1->_card.setVisage(1332); + scene->_actionCard1->_card.setPosition(scene->_actionCard1->_stationPos); + scene->_actionCard1->_card.fixPriority(170); + scene->_actionCard1->_card.setStrip2(1); + scene->_actionCard1->_cardId = scene->_actionCard3->_cardId; - scene->_field3EF8->_field34 = 0; - scene->_field3EF8->_object1.remove(); + scene->_actionCard3->_cardId = 0; + scene->_actionCard3->_card.remove(); - scene->_item2._object1.setPosition(scene->_field3EF8->_field36); - scene->_item2._object1.show(); + scene->_animatedCard._card.setPosition(scene->_actionCard3->_stationPos); + scene->_animatedCard._card.show(); scene->_aSound1.play(57); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &scene->_field3EF0->_field36, this); + scene->_animatedCard._card.addMover(mover, &scene->_actionCard1->_stationPos, this); } break; case 3: - scene->_item2._object1.hide(); - switch (scene->_field4242) { + scene->_animatedCard._card.hide(); + switch (scene->_actionIdx2) { case 0: - scene->_field3EF0->_object1.setFrame2(2); - scene->_field3EF0->_object1.show(); + scene->_actionCard1->_card.setFrame2(2); + scene->_actionCard1->_card.show(); break; case 1: - scene->_field3EF0->_object1.setFrame2(4); - scene->_field3EF0->_object1.show(); + scene->_actionCard1->_card.setFrame2(4); + scene->_actionCard1->_card.show(); break; case 3: - scene->_field3EF0->_object1.setFrame2(3); - scene->_field3EF0->_object1.show(); + scene->_actionCard1->_card.setFrame2(3); + scene->_actionCard1->_card.show(); break; default: - scene->setAnimationInfo(scene->_field3EF0); + scene->setAnimationInfo(scene->_actionCard1); break; } - scene->subC4A39(scene->_field3EF4); + scene->discardCard(scene->_actionCard2); + scene->handleNextTurn(); break; default: break; @@ -4274,29 +4318,29 @@ void Scene1337::Action13::signal() { switch (_actionIndex++) { case 0: { - scene->_field3E28[scene->_field3E26] = scene->_field3EF4->_field34; - scene->_field3E26--; + scene->_availableCardsPile[scene->_currentDiscardIndex] = scene->_actionCard2->_cardId; + scene->_currentDiscardIndex--; - scene->_field3EF4->_field34 = scene->_field3EF0->_field34; + scene->_actionCard2->_cardId = scene->_actionCard1->_cardId; - scene->_field3EF0->_field34 = 0; - scene->_field3EF0->_object1.remove(); + scene->_actionCard1->_cardId = 0; + scene->_actionCard1->_card.remove(); - scene->_item2._object1.setPosition(scene->_field3EF0->_field36, 0); - scene->_item2._object1.show(); + scene->_animatedCard._card.setPosition(scene->_actionCard1->_stationPos, 0); + scene->_animatedCard._card.show(); NpcMover *mover = new NpcMover(); - scene->_item2._object1.addMover(mover, &scene->_field3EF4->_field36, this); + scene->_animatedCard._card.addMover(mover, &scene->_actionCard2->_stationPos, this); } break; case 1: - scene->_item2._object1.hide(); - scene->setAnimationInfo(scene->_field3EF4); + scene->_animatedCard._card.hide(); + scene->setAnimationInfo(scene->_actionCard2); scene->_aSound1.play(58); signal(); break; case 2: - scene->subC4A39(scene->_field3EF4); + scene->discardCard(scene->_actionCard2); break; default: break; @@ -4307,119 +4351,123 @@ void Scene1337::postInit(SceneObjectList *OwnerList) { // In the original, may be found in subPostInit. // Without it, enableControl asserts loadScene(1330); + R2_GLOBALS._uiElements._active = false; SceneExt::postInit(); // // Hide the user interface - R2_GLOBALS._uiElements._active = false; - BF_GLOBALS._interfaceY = 200; + BF_GLOBALS._interfaceY = SCREEN_HEIGHT; + R2_GLOBALS._uiElements._visible = false; R2_GLOBALS._player.enableControl(); R2_GLOBALS._player._canWalk = false; - - _unkFctPtr412 = NULL; - - _field3EF0 = NULL; - _field3EF4 = NULL; - _field3EF8 = NULL; - - _arrunkObj1337[2]._arr1[0]._field36 = Common::Point(10, 174); - _arrunkObj1337[2]._arr1[1]._field36 = Common::Point(37, 174); - _arrunkObj1337[2]._arr1[2]._field36 = Common::Point(64, 174); - _arrunkObj1337[2]._arr1[3]._field36 = Common::Point(91, 174); - - _arrunkObj1337[2]._arr2[0]._field36 = Common::Point(119, 174); - _arrunkObj1337[2]._arr2[1]._field36 = Common::Point(119, 148); - _arrunkObj1337[2]._arr2[2]._field36 = Common::Point(119, 122); - _arrunkObj1337[2]._arr2[3]._field36 = Common::Point(145, 122); - _arrunkObj1337[2]._arr2[4]._field36 = Common::Point(171, 122); - _arrunkObj1337[2]._arr2[5]._field36 = Common::Point(171, 148); - _arrunkObj1337[2]._arr2[6]._field36 = Common::Point(171, 174); - _arrunkObj1337[2]._arr2[7]._field36 = Common::Point(145, 174); - - _arrunkObj1337[2]._arr3[0]._field36 = Common::Point(199, 174); - - _arrunkObj1337[2]._arr4[0]._field36 = Common::Point(145, 148); - - _arrunkObj1337[2]._fieldB94 = Common::Point(10, 174); - _arrunkObj1337[2]._fieldB98 = Common::Point(37, 174); - _arrunkObj1337[2]._fieldB9C = Common::Point(64, 174); - _arrunkObj1337[2]._fieldBA0 = Common::Point(91, 174); - _arrunkObj1337[2]._fieldBA4 = 2; - - _arrunkObj1337[3]._arr1[0]._field36 = Common::Point(14, 14); - _arrunkObj1337[3]._arr1[1]._field36 = Common::Point(14, 36); - _arrunkObj1337[3]._arr1[2]._field36 = Common::Point(14, 58); - _arrunkObj1337[3]._arr1[3]._field36 = Common::Point(14, 80); - - _arrunkObj1337[3]._arr2[0]._field36 = Common::Point(37, 66); - _arrunkObj1337[3]._arr2[1]._field36 = Common::Point(63, 66); - _arrunkObj1337[3]._arr2[2]._field36 = Common::Point(89, 66); - _arrunkObj1337[3]._arr2[3]._field36 = Common::Point(89, 92); - _arrunkObj1337[3]._arr2[4]._field36 = Common::Point(89, 118); - _arrunkObj1337[3]._arr2[5]._field36 = Common::Point(63, 118); - _arrunkObj1337[3]._arr2[6]._field36 = Common::Point(37, 118); - _arrunkObj1337[3]._arr2[7]._field36 = Common::Point(37, 92); - - _arrunkObj1337[3]._arr3[0]._field36 = Common::Point(37, 145); - - _arrunkObj1337[3]._arr4[0]._field36 = Common::Point(63, 92); - - _arrunkObj1337[3]._fieldB94 = Common::Point(14, 14); - _arrunkObj1337[3]._fieldB98 = Common::Point(14, 36); - _arrunkObj1337[3]._fieldB9C = Common::Point(14, 58); - _arrunkObj1337[3]._fieldBA0 = Common::Point(14, 80); - _arrunkObj1337[3]._fieldBA4 = 3; - - _arrunkObj1337[0]._arr1[0]._field36 = Common::Point(280, 5); - _arrunkObj1337[0]._arr1[1]._field36 = Common::Point(253, 5); - _arrunkObj1337[0]._arr1[2]._field36 = Common::Point(226, 5); - _arrunkObj1337[0]._arr1[3]._field36 = Common::Point(199, 5); - - _arrunkObj1337[0]._arr2[0]._field36 = Common::Point(171, 16); - _arrunkObj1337[0]._arr2[1]._field36 = Common::Point(171, 42); - _arrunkObj1337[0]._arr2[2]._field36 = Common::Point(171, 68); - _arrunkObj1337[0]._arr2[3]._field36 = Common::Point(145, 68); - _arrunkObj1337[0]._arr2[4]._field36 = Common::Point(119, 68); - _arrunkObj1337[0]._arr2[5]._field36 = Common::Point(119, 42); - _arrunkObj1337[0]._arr2[6]._field36 = Common::Point(119, 16); - _arrunkObj1337[0]._arr2[7]._field36 = Common::Point(145, 16); - - _arrunkObj1337[0]._arr3[0]._field36 = Common::Point(91, 16); - - _arrunkObj1337[0]._arr4[0]._field36 = Common::Point(145, 42); - - _arrunkObj1337[0]._fieldB94 = Common::Point(280, 5); - _arrunkObj1337[0]._fieldB98 = Common::Point(253, 5); - _arrunkObj1337[0]._fieldB9C = Common::Point(226, 5); - _arrunkObj1337[0]._fieldBA0 = Common::Point(199, 5); - _arrunkObj1337[0]._fieldBA4 = 2; - - _arrunkObj1337[1]._arr1[0]._field36 = Common::Point(283, 146); - _arrunkObj1337[1]._arr1[1]._field36 = Common::Point(283, 124); - _arrunkObj1337[1]._arr1[2]._field36 = Common::Point(283, 102); - _arrunkObj1337[1]._arr1[3]._field36 = Common::Point(283, 80); - - _arrunkObj1337[1]._arr2[0]._field36 = Common::Point(253, 122); - _arrunkObj1337[1]._arr2[1]._field36 = Common::Point(227, 122); - _arrunkObj1337[1]._arr2[2]._field36 = Common::Point(201, 122); - _arrunkObj1337[1]._arr2[3]._field36 = Common::Point(201, 96); - _arrunkObj1337[1]._arr2[4]._field36 = Common::Point(201, 70); - _arrunkObj1337[1]._arr2[5]._field36 = Common::Point(227, 70); - _arrunkObj1337[1]._arr2[6]._field36 = Common::Point(253, 70); - _arrunkObj1337[1]._arr2[7]._field36 = Common::Point(253, 96); - - _arrunkObj1337[1]._arr3[0]._field36 = Common::Point(253, 43); - - _arrunkObj1337[1]._arr4[0]._field36 = Common::Point(227, 96); - - _arrunkObj1337[1]._fieldB94 = Common::Point(283, 146); - _arrunkObj1337[1]._fieldB98 = Common::Point(283, 124); - _arrunkObj1337[1]._fieldB9C = Common::Point(283, 102); - _arrunkObj1337[1]._fieldBA0 = Common::Point(283, 80); - _arrunkObj1337[1]._fieldBA4 = 4; + R2_GLOBALS._player._uiEnabled = false; + + _delayedFunction = nullptr; + + _actionCard1 = nullptr; + _actionCard2 = nullptr; + _actionCard3 = nullptr; + + _gameBoardSide[2]._handCard[0]._stationPos = Common::Point(10, 174); + _gameBoardSide[2]._handCard[1]._stationPos = Common::Point(37, 174); + _gameBoardSide[2]._handCard[2]._stationPos = Common::Point(64, 174); + _gameBoardSide[2]._handCard[3]._stationPos = Common::Point(91, 174); + + _gameBoardSide[2]._outpostStation[0]._stationPos = Common::Point(119, 174); + _gameBoardSide[2]._outpostStation[1]._stationPos = Common::Point(119, 148); + _gameBoardSide[2]._outpostStation[2]._stationPos = Common::Point(119, 122); + _gameBoardSide[2]._outpostStation[3]._stationPos = Common::Point(145, 122); + _gameBoardSide[2]._outpostStation[4]._stationPos = Common::Point(171, 122); + _gameBoardSide[2]._outpostStation[5]._stationPos = Common::Point(171, 148); + _gameBoardSide[2]._outpostStation[6]._stationPos = Common::Point(171, 174); + _gameBoardSide[2]._outpostStation[7]._stationPos = Common::Point(145, 174); + + _gameBoardSide[2]._delayCard._stationPos = Common::Point(199, 174); + + _gameBoardSide[2]._emptyStationPos._stationPos = Common::Point(145, 148); + + _gameBoardSide[2]._card1Pos = Common::Point(10, 174); + _gameBoardSide[2]._card2Pos = Common::Point(37, 174); + _gameBoardSide[2]._card3Pos = Common::Point(64, 174); + _gameBoardSide[2]._card4Pos = Common::Point(91, 174); + _gameBoardSide[2]._frameNum = 2; + + _gameBoardSide[3]._handCard[0]._stationPos = Common::Point(14, 14); + _gameBoardSide[3]._handCard[1]._stationPos = Common::Point(14, 36); + _gameBoardSide[3]._handCard[2]._stationPos = Common::Point(14, 58); + _gameBoardSide[3]._handCard[3]._stationPos = Common::Point(14, 80); + + _gameBoardSide[3]._outpostStation[0]._stationPos = Common::Point(37, 66); + _gameBoardSide[3]._outpostStation[1]._stationPos = Common::Point(63, 66); + _gameBoardSide[3]._outpostStation[2]._stationPos = Common::Point(89, 66); + _gameBoardSide[3]._outpostStation[3]._stationPos = Common::Point(89, 92); + _gameBoardSide[3]._outpostStation[4]._stationPos = Common::Point(89, 118); + _gameBoardSide[3]._outpostStation[5]._stationPos = Common::Point(63, 118); + _gameBoardSide[3]._outpostStation[6]._stationPos = Common::Point(37, 118); + _gameBoardSide[3]._outpostStation[7]._stationPos = Common::Point(37, 92); + + _gameBoardSide[3]._delayCard._stationPos = Common::Point(37, 145); + + _gameBoardSide[3]._emptyStationPos._stationPos = Common::Point(63, 92); + + _gameBoardSide[3]._card1Pos = Common::Point(14, 14); + _gameBoardSide[3]._card2Pos = Common::Point(14, 36); + _gameBoardSide[3]._card3Pos = Common::Point(14, 58); + _gameBoardSide[3]._card4Pos = Common::Point(14, 80); + _gameBoardSide[3]._frameNum = 3; + + _gameBoardSide[0]._handCard[0]._stationPos = Common::Point(280, 5); + _gameBoardSide[0]._handCard[1]._stationPos = Common::Point(253, 5); + _gameBoardSide[0]._handCard[2]._stationPos = Common::Point(226, 5); + _gameBoardSide[0]._handCard[3]._stationPos = Common::Point(199, 5); + + _gameBoardSide[0]._outpostStation[0]._stationPos = Common::Point(171, 16); + _gameBoardSide[0]._outpostStation[1]._stationPos = Common::Point(171, 42); + _gameBoardSide[0]._outpostStation[2]._stationPos = Common::Point(171, 68); + _gameBoardSide[0]._outpostStation[3]._stationPos = Common::Point(145, 68); + _gameBoardSide[0]._outpostStation[4]._stationPos = Common::Point(119, 68); + _gameBoardSide[0]._outpostStation[5]._stationPos = Common::Point(119, 42); + _gameBoardSide[0]._outpostStation[6]._stationPos = Common::Point(119, 16); + _gameBoardSide[0]._outpostStation[7]._stationPos = Common::Point(145, 16); + + _gameBoardSide[0]._delayCard._stationPos = Common::Point(91, 16); + + _gameBoardSide[0]._emptyStationPos._stationPos = Common::Point(145, 42); + + _gameBoardSide[0]._card1Pos = Common::Point(280, 5); + _gameBoardSide[0]._card2Pos = Common::Point(253, 5); + _gameBoardSide[0]._card3Pos = Common::Point(226, 5); + _gameBoardSide[0]._card4Pos = Common::Point(199, 5); + _gameBoardSide[0]._frameNum = 2; + + _gameBoardSide[1]._handCard[0]._stationPos = Common::Point(283, 146); + _gameBoardSide[1]._handCard[1]._stationPos = Common::Point(283, 124); + _gameBoardSide[1]._handCard[2]._stationPos = Common::Point(283, 102); + _gameBoardSide[1]._handCard[3]._stationPos = Common::Point(283, 80); + + _gameBoardSide[1]._outpostStation[0]._stationPos = Common::Point(253, 122); + _gameBoardSide[1]._outpostStation[1]._stationPos = Common::Point(227, 122); + _gameBoardSide[1]._outpostStation[2]._stationPos = Common::Point(201, 122); + _gameBoardSide[1]._outpostStation[3]._stationPos = Common::Point(201, 96); + _gameBoardSide[1]._outpostStation[4]._stationPos = Common::Point(201, 70); + _gameBoardSide[1]._outpostStation[5]._stationPos = Common::Point(227, 70); + _gameBoardSide[1]._outpostStation[6]._stationPos = Common::Point(253, 70); + _gameBoardSide[1]._outpostStation[7]._stationPos = Common::Point(253, 96); + + _gameBoardSide[1]._delayCard._stationPos = Common::Point(253, 43); + + _gameBoardSide[1]._emptyStationPos._stationPos = Common::Point(227, 96); + + _gameBoardSide[1]._card1Pos = Common::Point(283, 146); + _gameBoardSide[1]._card2Pos = Common::Point(283, 124); + _gameBoardSide[1]._card3Pos = Common::Point(283, 102); + _gameBoardSide[1]._card4Pos = Common::Point(283, 80); + _gameBoardSide[1]._frameNum = 4; subPostInit(); + + _stockPile.postInit(); } void Scene1337::remove() { @@ -4429,25 +4477,26 @@ void Scene1337::remove() { } R2_GLOBALS._uiElements._active = true; + R2_GLOBALS._uiElements._visible = true; SceneExt::remove(); } void Scene1337::process(Event &event) { if (event.eventType == EVENT_BUTTON_DOWN) { - if (event.btnState != BTNSHIFT_RIGHT) { - subD183F(R2_GLOBALS._v5780E, 1); + if (event.btnState == BTNSHIFT_RIGHT) { + updateCursorId(R2_GLOBALS._mouseCursorId, true); event.handled = true; - } else if (_unkFctPtr412) { - FunctionPtrType tmpFctPtr = _unkFctPtr412; - _unkFctPtr412 = NULL; + } else if (_delayedFunction) { + FunctionPtrType tmpFctPtr = _delayedFunction; + _delayedFunction = nullptr; (this->*tmpFctPtr)(); event.handled = true; } } else if (event.eventType == EVENT_KEYPRESS) { if (event.kbd.keycode == Common::KEYCODE_SPACE) { - if (_unkFctPtr412) { - FunctionPtrType tmpFctPtr = _unkFctPtr412; - _unkFctPtr412 = NULL; + if (_delayedFunction) { + FunctionPtrType tmpFctPtr = _delayedFunction; + _delayedFunction = nullptr; (this->*tmpFctPtr)(); event.handled = true; } @@ -4460,82 +4509,85 @@ void Scene1337::process(Event &event) { } void Scene1337::dispatch() { - if (_field424C == 0) { - ++_field424E; - if (_field424E == 4) { - _field424C = 1; + if (!_instructionsDisplayedFl) { + ++_instructionsWaitCount; + if (_instructionsWaitCount == 4) { + _instructionsDisplayedFl = true; suggestInstructions(); } } + + // The following code is in the original in sceneHandler::process(), + // which is terrible as it's checked in every scene of the game. + setCursorData(5, _cursorCurStrip, _cursorCurFrame); + // + Scene::dispatch(); } -void Scene1337::actionDisplay(int resNum, int lineNum, int x, int y, int arg5, int width, int textMode, int fontNum, int colFG, int colBGExt, int colFGExt) { +void Scene1337::actionDisplay(int resNum, int lineNum, int x, int y, int keepOnScreen, int width, int textMode, int fontNum, int colFG, int colBGExt, int colFGExt) { // TODO: Check if it's normal that arg5 is unused and replaced by an hardcoded 0 value // May hide an original bug - SceneItem::display(resNum, lineNum, SET_X, x, SET_Y, y, SET_KEEP_ONSCREEN, 0, SET_WIDTH, width, SET_POS_MODE, -1, SET_TEXT_MODE, textMode, SET_FONT, fontNum, SET_FG_COLOR, colFG, SET_EXT_BGCOLOR, colBGExt, SET_EXT_FGCOLOR, colFGExt, LIST_END); + SceneItem::display(resNum, lineNum, SET_X, x, SET_Y, y, SET_KEEP_ONSCREEN, 0, + SET_WIDTH, width, SET_POS_MODE, -1, SET_TEXT_MODE, textMode, + SET_FONT, fontNum, SET_FG_COLOR, colFG, SET_EXT_BGCOLOR, colBGExt, + SET_EXT_FGCOLOR, colFGExt, LIST_END); } -void Scene1337::setAnimationInfo(unkObj1337sub1 *subObj) { - if (!subObj) +void Scene1337::setAnimationInfo(Card *card) { + if (!card) return; - if (subObj->_field34 > 9) { - if (subObj->_field34 > 25) { - subObj->_object1.setStrip2(4); - subObj->_object1.setFrame(subObj->_field34 - 25); - } else { - subObj->_object1.setStrip2(3); - subObj->_object1.setFrame(subObj->_field34 - 9); - } + if (card->_cardId > 25) { + card->_card.setStrip2(4); + card->_card.setFrame(card->_cardId - 25); + } else if (card->_cardId > 9) { + card->_card.setStrip2(3); + card->_card.setFrame(card->_cardId - 9); } else { - subObj->_object1.setStrip2(2); - subObj->_object1.setFrame(subObj->_field34); + card->_card.setStrip2(2); + card->_card.setFrame(card->_cardId); } - subObj->_object1.show(); + card->_card.show(); R2_GLOBALS._sceneObjects->draw(); } -void Scene1337::subC20E5() { - subC2586(); -} - -void Scene1337::subC20F9() { - switch (_field424A) { +void Scene1337::handleNextTurn() { + switch (_winnerId) { case -1: - ++_field423E; - if (_field423E == 3) - _field423E = 0; + ++_currentPlayerNumb; + if (_currentPlayerNumb > 3) + _currentPlayerNumb = 0; - if (_field4244 == 1) { - _object1.show(); - switch (_field423E) { + if (_showPlayerTurn) { + _currentPlayerArrow.show(); + switch (_currentPlayerNumb) { case 0: - _object1.setStrip(3); + _currentPlayerArrow.setStrip(3); break; case 1: - _object1.setStrip(4); + _currentPlayerArrow.setStrip(4); break; case 2: subD1975(174, 107); - _object1.setStrip(1); + _currentPlayerArrow.setStrip(1); break; case 3: subC4CEC(); - _object1.setStrip(2); + _currentPlayerArrow.setStrip(2); break; default: break; } if (!_autoplay) - _unkFctPtr412 = &Scene1337::subC20E5; + _delayedFunction = &Scene1337::handlePlayerTurn; else - subC20E5(); + handlePlayerTurn(); } else { - subC20E5(); + handlePlayerTurn(); } break; case 0: @@ -4574,38 +4626,38 @@ void Scene1337::subC20F9() { break; } - if (_field424A != -1) + if (_winnerId != -1) R2_GLOBALS._sceneManager.changeScene(125); } -void Scene1337::subC2586() { - if (_field4244 != 0) - _object1.hide(); +void Scene1337::handlePlayerTurn() { + if (_showPlayerTurn) + _currentPlayerArrow.hide(); - switch (_field423E) { + switch (_currentPlayerNumb) { case 2: subC4CD2(); - if (_field4246 == 1) + if (_displayHelpFl) actionDisplay(1330, 114, 159, 10, 1, 200, 0, 7, 0, 154, 154); - _field4246 = 0; + _displayHelpFl = false; // No break on purpose case 0: // No break on purpose case 1: // No break on purpose case 3: - _item1.setAction(&_action4); + _actionItem.setAction(&_action4); default: break; } - _field4244 = 1; + _showPlayerTurn = true; } -bool Scene1337::subC264B(int arg1) { - switch (arg1) { +bool Scene1337::isStationCard(int cardId) { + switch (cardId) { case 10: // No break on purpose case 12: @@ -4627,8 +4679,8 @@ bool Scene1337::subC264B(int arg1) { } } -bool Scene1337::subC2687(int arg1) { - switch (arg1) { +bool Scene1337::isStopConstructionCard(int cardId) { + switch (cardId) { case 11: // No break on purpose case 14: @@ -4642,43 +4694,42 @@ bool Scene1337::subC2687(int arg1) { } } -int Scene1337::subC26CB(int arg1, int arg2) { - if ((_arrunkObj1337[arg1]._arr1[arg2]._field34 > 1) && (_arrunkObj1337[arg1]._arr1[arg2]._field34 <= 9)) { - return arg2; - } +int Scene1337::getStationId(int playerId, int handCardId) { + if ((_gameBoardSide[playerId]._handCard[handCardId]._cardId > 1) && (_gameBoardSide[playerId]._handCard[handCardId]._cardId <= 9)) + return handCardId; return -1; } -int Scene1337::subC2719(int arg1) { +int Scene1337::findPlatformCardInHand(int playerId) { for (int i = 0; i <= 3; i++) { - if (_arrunkObj1337[arg1]._arr1[i]._field34 == 1) + if (_gameBoardSide[playerId]._handCard[i]._cardId == 1) return i; } return -1; } -int Scene1337::subC274D(int arg1) { +int Scene1337::findCard13InHand(int playerId) { for (int i = 0; i <= 3; i++) { - if (_arrunkObj1337[arg1]._arr1[i]._field34 == 13) + if (_gameBoardSide[playerId]._handCard[i]._cardId == 13) return i; } return -1; } -int Scene1337::subC2781(int arg1) { +int Scene1337::checkThieftCard(int playerId) { for (int i = 0; i <= 3; i++) { - if (_arrunkObj1337[arg1]._arr1[i]._field34 == 25) + if (_gameBoardSide[playerId]._handCard[i]._cardId == 25) return i; } return -1; } -int Scene1337::subC27B5(int arg1) { - switch (arg1) { +int Scene1337::isDelayCard(int cardId) { + switch (cardId) { case 11: // No break on purpose case 14: @@ -4686,7 +4737,7 @@ int Scene1337::subC27B5(int arg1) { case 16: // No break on purpose case 24: - return arg1; + return cardId; break; default: return -1; @@ -4694,8 +4745,8 @@ int Scene1337::subC27B5(int arg1) { } } -int Scene1337::subC27F9(int arg1) { - switch (arg1) { +int Scene1337::getStationCardId(int cardId) { + switch (cardId) { case 10: // No break on purpose case 12: @@ -4711,377 +4762,143 @@ int Scene1337::subC27F9(int arg1) { case 20: // No break on purpose case 21: - return arg1; + return cardId; default: return -1; } } -void Scene1337::subC2835(int arg1) { - int i; - bool found = false; - switch (arg1) { +void Scene1337::handlePlayer01Discard(int playerId) { + switch (playerId) { case 0: - for (i = 0; i <= 3; i++) { - if (subC27F9(_arrunkObj1337[arg1]._arr1[i]._field34) != -1) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if (getStationCardId(_gameBoardSide[playerId]._handCard[i]._cardId) != -1) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } - if (found) - break; - - for (i = 0; i <= 3; i++) { - if (subC27B5(_arrunkObj1337[arg1]._arr1[i]._field34) != -1) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if (isDelayCard(_gameBoardSide[playerId]._handCard[i]._cardId) != -1) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } - if (found) - break; - - for (i = 0; i <= 3; i++) { - if ((_arrunkObj1337[arg1]._arr1[i]._field34 > 1) && (_arrunkObj1337[arg1]._arr1[i]._field34 <= 9)) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if ((_gameBoardSide[playerId]._handCard[i]._cardId > 1) && (_gameBoardSide[playerId]._handCard[i]._cardId <= 9)) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } - if (found) - break; - - for (i = 0; i <= 3; i++) { - if ((_arrunkObj1337[arg1]._arr1[i]._field34 >= 26) && (_arrunkObj1337[arg1]._arr1[i]._field34 <= 33)) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if ((_gameBoardSide[playerId]._handCard[i]._cardId >= 26) && (_gameBoardSide[playerId]._handCard[i]._cardId <= 33)) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } - if (found) - break; - - for (i = 0; i <= 3; i++) { - if (_arrunkObj1337[arg1]._arr1[i]._field34 == 1) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if (_gameBoardSide[playerId]._handCard[i]._cardId == 1) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } - if (found) - break; - - for (i = 0; i <= 3; i++) { - if (_arrunkObj1337[arg1]._arr1[i]._field34 == 25) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if (_gameBoardSide[playerId]._handCard[i]._cardId == 25) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } - if (found) - break; - - for (i = 0; i <= 3; i++) { - if (_arrunkObj1337[arg1]._arr1[i]._field34 == 13) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if (_gameBoardSide[playerId]._handCard[i]._cardId == 13) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } break; case 1: - for (i = 0; i <= 3; i++) { - if ((_arrunkObj1337[arg1]._arr1[i]._field34 >= 26) && (_arrunkObj1337[arg1]._arr1[i]._field34 <= 33)) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if ((_gameBoardSide[playerId]._handCard[i]._cardId >= 26) && (_gameBoardSide[playerId]._handCard[i]._cardId <= 33)) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } - if (found) - break; - - for (i = 0; i <= 3; i++) { - if (_arrunkObj1337[arg1]._arr1[i]._field34 == 1) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if (_gameBoardSide[playerId]._handCard[i]._cardId == 1) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } - if (found) - break; - - for (i = 0; i <= 3; i++) { - if ((_arrunkObj1337[arg1]._arr1[i]._field34 > 1) && (_arrunkObj1337[arg1]._arr1[i]._field34 <= 9)) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if ((_gameBoardSide[playerId]._handCard[i]._cardId > 1) && (_gameBoardSide[playerId]._handCard[i]._cardId <= 9)) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } - if (found) - break; - - for (i = 0; i <= 3; i++) { - if (subC27F9(_arrunkObj1337[arg1]._arr1[i]._field34) != -1) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if (getStationCardId(_gameBoardSide[playerId]._handCard[i]._cardId) != -1) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } - if (found) - break; - - for (i = 0; i <= 3; i++) { - if (subC27B5(_arrunkObj1337[arg1]._arr1[i]._field34) != -1) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if (isDelayCard(_gameBoardSide[playerId]._handCard[i]._cardId) != -1) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } - if (found) - break; - - for (i = 0; i <= 3; i++) { - if (_arrunkObj1337[arg1]._arr1[i]._field34 == 25) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if (_gameBoardSide[playerId]._handCard[i]._cardId == 25) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } - if (found) - break; - - for (i = 0; i <= 3; i++) { - if (_arrunkObj1337[arg1]._arr1[i]._field34 == 13) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if (_gameBoardSide[playerId]._handCard[i]._cardId == 13) { + discardCard(&_gameBoardSide[playerId]._handCard[i]); + return; } } break; default: - return; - } - - subC4A39(&_arrunkObj1337[arg1]._arr1[i]); -} - -bool Scene1337::subC2BF8(unkObj1337sub1 *subObj1, Common::Point pt) { - if ((subObj1->_field36.x > pt.x) || (subObj1->_field36.x + 24 < pt.x)) - return false; - - if ((subObj1->_field36.y > pt.y) || (subObj1->_field36.y + 24 < pt.y)) - return false; - - return true; -} - -void Scene1337::subC2C2F() { - bool found = true; - - if (_arrunkObj1337[3]._arr3[0]._field34 != 0) { - switch (_arrunkObj1337[3]._arr3[0]._field34) { - case 10: - // No break on purpose - case 12: - // No break on purpose - case 15: - // No break on purpose - case 17: - // No break on purpose - case 18: - // No break on purpose - case 19: - // No break on purpose - case 20: - // No break on purpose - case 21: - subC4A39(&_arrunkObj1337[3]._arr3[0]); - found = false; - break; - default: - found = false; - int i; - for (i = 0; i <= 3; i++) { - if (subC3386(_arrunkObj1337[3]._arr3[0]._field34, _arrunkObj1337[3]._arr1[i]._field34)) { - found = true; - break; - } - } - - if (found) { - found = false; - subC34A1(&_arrunkObj1337[3]._arr1[i], &_arrunkObj1337[3]._arr3[0]); - } - break; - } - } - - if (!found) - return; - - int randIndx = R2_GLOBALS._randomSource.getRandomNumber(3); - - if (_arrunkObj1337[3]._arr1[randIndx]._field34 == 1) { - found = false; - - for (int i = 0; i <= 7; i++) { - if ((_arrunkObj1337[3]._arr2[i]._field34 == 0) && (!subC2687(_arrunkObj1337[3]._arr3[0]._field34))) { - subC340B(&_arrunkObj1337[3]._arr1[randIndx], &_arrunkObj1337[3]._arr2[i]); - found = true; - break; - } - } - - if (found) { - return; - } - } else if (_arrunkObj1337[3]._arr1[randIndx]._field34 <= 9) { - found = false; - - for (int i = 0; i <= 7; i++) { - if (_arrunkObj1337[3]._arr2[i]._field34 == _arrunkObj1337[3]._arr1[randIndx]._field34) { - found = true; - break; - } - } - - if (!found) { - for (int i = 0; i <= 7; i++) { - if ((_arrunkObj1337[3]._arr2[i]._field34 == 1) && (!subC2687(_arrunkObj1337[3]._arr3[i]._field34))) { - int tmpVal = 0; - - for (int j = 0; j <= 7; j++) { - if ((_arrunkObj1337[3]._arr2[j]._field34 > 1) && (_arrunkObj1337[3]._arr2[j]._field34 <= 9)) - ++tmpVal; - } - - if (tmpVal == 7) - _field424A = 3; - - subC33C0(&_arrunkObj1337[3]._arr1[randIndx], &_arrunkObj1337[3]._arr2[i]); - found = true; - break; - } - } - if (found) - return; - } - } else if (_arrunkObj1337[3]._arr1[randIndx]._field34 == 13) { - int tmpVal = subC331B(3); - - if (tmpVal != -1) { - subC358E(&_arrunkObj1337[3]._arr1[randIndx], tmpVal); - return; - } - } else if (_arrunkObj1337[3]._arr1[randIndx]._field34 == 25) { - int tmpVal = -1; - found = false; - int tmpRandIndx = R2_GLOBALS._randomSource.getRandomNumber(3); - - for (int i = 0; i <= 3; i++) { - if ( (tmpRandIndx != 3) - && ( (_arrunkObj1337[tmpRandIndx]._arr1[0]._field34 != 0) - || (_arrunkObj1337[tmpRandIndx]._arr1[1]._field34 != 0) - || (_arrunkObj1337[tmpRandIndx]._arr1[2]._field34 != 0) - || (_arrunkObj1337[tmpRandIndx]._arr1[3]._field34 != 0) )) { - tmpVal = tmpRandIndx; - break; - } - - ++tmpRandIndx; - if (tmpRandIndx > 3) - tmpRandIndx = 0; - } - - if (tmpVal != -1) { - subC318B(3, &_arrunkObj1337[3]._arr1[randIndx], tmpVal); - return; - } - } else { - switch (_arrunkObj1337[3]._arr1[randIndx]._field34) { - case 10: - // No break on purpose - case 11: - // No break on purpose - case 12: - // No break on purpose - case 14: - // No break on purpose - case 15: - // No break on purpose - case 16: - // No break on purpose - case 17: - // No break on purpose - case 18: - // No break on purpose - case 19: - // No break on purpose - case 20: - // No break on purpose - case 21: - // No break on purpose - case 24: { - int tmpVal = -1; - int tmpRandIndx = R2_GLOBALS._randomSource.getRandomNumber(3); - - for (int i = 0; i <= 3; i++) { - if (tmpRandIndx != 3) { - // The variables 'i' and 'j' are not used in the inner code of the loop. - // It's understandable for 'i', which helps making sure that tmpVal is used properly, - // but it's suspect for j - for (int j = 0; j <= 7; j++) { - if ((_arrunkObj1337[tmpRandIndx]._arr3[0]._field34 == 0) && (subC32B1(tmpRandIndx, _arrunkObj1337[3]._arr1[randIndx]._field34))) { - tmpVal = j; - } - } - } - - ++tmpRandIndx; - if (tmpRandIndx > 3) - tmpRandIndx = 0; - - if (tmpVal != -1) - break; - } - - if (tmpVal != -1) { - // Useless second identical check skipped - subC3456(&_arrunkObj1337[3]._arr1[randIndx], &_arrunkObj1337[tmpVal]._arr3[0]); - return; - } - } - default: - break; - } + break; } - - subC4A39(&_arrunkObj1337[3]._arr1[randIndx]); } -void Scene1337::subC318B(int arg1, unkObj1337sub1 *subObj1, int arg3) { - _field4240 = arg1; - _field4242 = arg3; +void Scene1337::playThieftCard(int playerId, Card *card, int victimId) { + _actionIdx1 = playerId; + _actionIdx2 = victimId; int randIndx; for (;;) { randIndx = R2_GLOBALS._randomSource.getRandomNumber(3); - if (_arrunkObj1337[arg3]._arr1[randIndx]._field34 != 0) + if (_gameBoardSide[victimId]._handCard[randIndx]._cardId != 0) break; } - _field3EF0 = subObj1; - _field3EF4 = &_arrunkObj1337[arg3]._arr4[0]; - _field3EF8 = &_arrunkObj1337[arg3]._arr1[randIndx]; + _actionCard1 = card; + _actionCard2 = &_gameBoardSide[victimId]._emptyStationPos; + _actionCard3 = &_gameBoardSide[victimId]._handCard[randIndx]; - _item1.setAction(&_action11); + _actionItem.setAction(&_action11); } -int Scene1337::subC3257(int arg1) { +int Scene1337::getPreventionCardId(int cardId) { int retVal; - switch (arg1) { + switch (cardId) { case 10: retVal = 2; break; @@ -5113,152 +4930,150 @@ int Scene1337::subC3257(int arg1) { return retVal; } -bool Scene1337::subC32B1(int arg1, int arg2) { +bool Scene1337::isAttackPossible(int victimId, int cardId) { + if (victimId < 0 || victimId >= ARRAYSIZE(_gameBoardSide)) + error("Scene1337::isAttackPossible() victimId:%d out of range 0 to %d", victimId, ARRAYSIZE(_gameBoardSide)-1); + for (int i = 0; i <= 7; i++) { - if (_arrunkObj1337[arg1]._arr2[i]._field34 != 0) { - int tmpVal = subC3257(arg2); - if (tmpVal == _arrunkObj1337[arg1]._arr2[i]._field34) + if (_gameBoardSide[victimId]._outpostStation[i]._cardId != 0) { + if (getPreventionCardId(cardId) == _gameBoardSide[victimId]._outpostStation[i]._cardId) return false; } } return true; } -int Scene1337::subC331B(int arg1) { - int randIndx = R2_GLOBALS._randomSource.getRandomNumber(3); +int Scene1337::getPlayerWithOutpost(int playerId) { + int randPlayerId = R2_GLOBALS._randomSource.getRandomNumber(3); for (int i = 0; i <= 3; i++) { - if (randIndx != arg1) { + if (randPlayerId != playerId) { for (int j = 0; j <= 7; j++) { - if (_arrunkObj1337[randIndx]._arr2[j]._field34 != 0) - return randIndx; + if (_gameBoardSide[randPlayerId]._outpostStation[j]._cardId != 0) + return randPlayerId; } } - if (arg1 == 1) { - randIndx--; - if (randIndx < 0) - randIndx = 3; + if (playerId == 1) { + randPlayerId--; + if (randPlayerId < 0) + randPlayerId = 3; } else { - ++randIndx; - if (randIndx > 3) - randIndx = 0; + ++randPlayerId; + if (randPlayerId > 3) + randPlayerId = 0; } } return -1; } -bool Scene1337::subC3386(int arg1, int arg2) { - if ((arg1 == 11) && (arg2 == 26)) +bool Scene1337::checkAntiDelayCard(int delayCardId, int cardId) { + if ((delayCardId == 11) && (cardId == 26)) return true; - if ((arg1 == 14) && (arg2 == 30)) + if ((delayCardId == 14) && (cardId == 30)) return true; - if ((arg1 == 16) && (arg2 == 32)) + if ((delayCardId == 16) && (cardId == 32)) return true; - if ((arg1 == 24) && (arg2 == 28)) + if ((delayCardId == 24) && (cardId == 28)) return true; return false; } -void Scene1337::subC33C0(unkObj1337sub1 *subObj1, unkObj1337sub1 *subObj2) { - _field3EF4 = subObj2; - _field3EF0 = subObj1; - _item1.setAction(&_action7); +void Scene1337::playStationCard(Card *station, Card *platform) { + _actionCard1 = station; + _actionCard2 = platform; + _actionItem.setAction(&_action7); } -int Scene1337::subC3E92(int arg1) { - if ( (_arrunkObj1337[arg1]._arr1[0]._field34 == 0) - && (_arrunkObj1337[arg1]._arr1[1]._field34 == 0) - && (_arrunkObj1337[arg1]._arr1[2]._field34 == 0) - && (_arrunkObj1337[arg1]._arr1[3]._field34 == 0)) +int Scene1337::getFreeHandCard(int playerId) { + if ( (_gameBoardSide[playerId]._handCard[0]._cardId == 0) + && (_gameBoardSide[playerId]._handCard[1]._cardId == 0) + && (_gameBoardSide[playerId]._handCard[2]._cardId == 0) + && (_gameBoardSide[playerId]._handCard[3]._cardId == 0)) return -1; int randIndx; for (;;) { randIndx = R2_GLOBALS._randomSource.getRandomNumber(3); - if (_arrunkObj1337[arg1]._arr1[randIndx]._field34 == 0) + if (_gameBoardSide[playerId]._handCard[randIndx]._cardId == 0) break; } return randIndx; } -void Scene1337::subC340B(unkObj1337sub1 *subObj1, unkObj1337sub1 *subObj2) { - _field3EF0 = subObj1; - _field3EF4 = subObj2; +void Scene1337::playPlatformCard(Card *card, Card *dest) { + _actionCard1 = card; + _actionCard2 = dest; - _item1.setAction(&_action6); + _actionItem.setAction(&_action6); } -void Scene1337::subC3456(unkObj1337sub1 *subObj1, unkObj1337sub1 *subObj2) { - _field3EF0 = subObj1; - _field3EF4 = subObj2; +void Scene1337::playDelayCard(Card *card, Card *dest) { + _actionCard1 = card; + _actionCard2 = dest; - _item1.setAction(&_action9); + _actionItem.setAction(&_action9); } -void Scene1337::subC34A1(unkObj1337sub1 *subObj1, unkObj1337sub1 *subObj2) { - _field3EF0 = subObj1; - _field3EF4 = subObj2; +void Scene1337::playAntiDelayCard(Card *card, Card *dest) { + _actionCard1 = card; + _actionCard2 = dest; - _item1.setAction(&_action8); + _actionItem.setAction(&_action8); + + handleNextTurn(); } -Scene1337::unkObj1337sub1 *Scene1337::subC34EC(int arg1) { - for (int i = 0; i <= 7; i++) { - if (_arrunkObj1337[arg1]._arr2[i]._field34 == 1) { - return &_arrunkObj1337[arg1]._arr2[i]; - } - } +Scene1337::Card *Scene1337::getStationCard(int playerId) { for (int i = 0; i <= 7; i++) { - if ((_arrunkObj1337[arg1]._arr2[i]._field34 != 0) && (_arrunkObj1337[arg1]._arr2[i]._field34 < 10)) { - return &_arrunkObj1337[arg1]._arr2[i]; - } + if ((_gameBoardSide[playerId]._outpostStation[i]._cardId >= 1) && (_gameBoardSide[playerId]._outpostStation[i]._cardId <= 9)) + return &_gameBoardSide[playerId]._outpostStation[i]; } - return NULL; + return nullptr; } -void Scene1337::subC358E(unkObj1337sub1 *subObj1, int arg2) { - _field3EF0 = subObj1; - _field3EF4 = subC34EC(arg2); - _field3EF8 = &_arrunkObj1337[arg2]._arr4[0]; - _field4240 = arg2; - _item1.setAction(&_action10); +void Scene1337::playCounterTrickCard(Card *card, int playerId) { + _actionCard1 = card; + _actionCard2 = getStationCard(playerId); + _actionCard3 = &_gameBoardSide[playerId]._emptyStationPos; + _actionIdx1 = playerId; + _actionItem.setAction(&_action10); + handleNextTurn(); } -void Scene1337::subC4A39(unkObj1337sub1 *subObj) { - _field3EF0 = subObj; +void Scene1337::discardCard(Card *card) { + _actionCard1 = card; - _item1.setAction(&_action5); + _actionItem.setAction(&_action5); } void Scene1337::subC4CD2() { if (R2_GLOBALS._v57709 > 0) { subD1917(); - subD1940(false); + subD1940(false); // _v5780C-- } } void Scene1337::subC4CEC() { - if (R2_GLOBALS._v57709 != 0) - return; - - subD18F5(); - subD1940(1); + if (R2_GLOBALS._v57709 == 0) { + subD18F5(); + subD1940(true); // _v5780C++ + } } -void Scene1337::subC51A0(unkObj1337sub1 *subObj1, unkObj1337sub1 *subObj2) { - _field3EF0 = subObj1; - _field3EF4 = subObj2; +void Scene1337::subC51A0(Card *subObj1, Card *subObj2) { + _actionCard1 = subObj1; + _actionCard2 = subObj2; - _item1.setAction(&_action13); + _actionItem.setAction(&_action13); } void Scene1337::displayDialog(int dialogNumb) { @@ -5362,8 +5177,8 @@ void Scene1337::displayDialog(int dialogNumb) { void Scene1337::subPostInit() { R2_GLOBALS._v57709 = 0; R2_GLOBALS._v5780C = 0; - subD183F(1, 0); - subD1940(true); + updateCursorId(1, false); + subD1940(true); // _v5780C++ subD18F5(); // loadScene(1330); @@ -5371,237 +5186,244 @@ void Scene1337::subPostInit() { R2_GLOBALS._scenePalette.addRotation(224, 235, 1); - _field3E28[0] = 1; - _field3E28[1] = 1; - _field3E28[2] = 1; - _field3E28[3] = 1; - _field3E28[4] = 1; - _field3E28[5] = 1; - _field3E28[6] = 1; - _field3E28[7] = 1; - _field3E28[8] = 26; - _field3E28[9] = 2; - _field3E28[10] = 2; - _field3E28[11] = 2; - _field3E28[12] = 2; - _field3E28[13] = 2; - _field3E28[14] = 26; - _field3E28[15] = 3; - _field3E28[16] = 3; - _field3E28[17] = 3; - _field3E28[18] = 3; - _field3E28[19] = 3; - _field3E28[20] = 28; - _field3E28[21] = 4; - _field3E28[22] = 4; - _field3E28[23] = 4; - _field3E28[24] = 4; - _field3E28[25] = 4; - _field3E28[26] = 28; - _field3E28[27] = 5; - _field3E28[28] = 5; - _field3E28[29] = 5; - _field3E28[30] = 5; - _field3E28[31] = 5; - _field3E28[32] = 30; - _field3E28[33] = 6; - _field3E28[34] = 6; - _field3E28[35] = 6; - _field3E28[36] = 6; - _field3E28[37] = 6; - _field3E28[38] = 30; - _field3E28[39] = 7; - _field3E28[40] = 7; - _field3E28[41] = 7; - _field3E28[42] = 7; - _field3E28[43] = 7; - _field3E28[44] = 32; - _field3E28[45] = 8; - _field3E28[46] = 8; - _field3E28[47] = 8; - _field3E28[48] = 8; - _field3E28[49] = 8; - _field3E28[50] = 32; - _field3E28[51] = 9; - _field3E28[52] = 9; - _field3E28[53] = 9; - _field3E28[54] = 9; - _field3E28[55] = 9; - _field3E28[56] = 10; - _field3E28[57] = 11; - _field3E28[58] = 12; - _field3E28[59] = 13; - _field3E28[60] = 13; - _field3E28[61] = 14; - _field3E28[62] = 15; - _field3E28[63] = 16; - _field3E28[64] = 17; - _field3E28[65] = 18; - _field3E28[66] = 19; - _field3E28[67] = 20; - _field3E28[68] = 21; - _field3E28[69] = 26; - _field3E28[70] = 28; - _field3E28[71] = 24; - _field3E28[72] = 25; - _field3E28[73] = 25; - _field3E28[74] = 25; - _field3E28[75] = 25; - _field3E28[76] = 26; - _field3E28[77] = 26; - _field3E28[78] = 26; - _field3E28[79] = 27; - _field3E28[80] = 27; - _field3E28[81] = 28; - _field3E28[82] = 28; - _field3E28[83] = 28; - _field3E28[84] = 29; - _field3E28[85] = 29; - _field3E28[86] = 29; - _field3E28[87] = 30; - _field3E28[88] = 30; - _field3E28[89] = 30; - _field3E28[90] = 30; - _field3E28[91] = 32; - _field3E28[92] = 1; - _field3E28[93] = 32; - _field3E28[94] = 32; - _field3E28[95] = 32; - _field3E28[96] = 1; - _field3E28[97] = 1; - _field3E28[98] = 1; - _field3E28[99] = 0; - - _field3E24 = 98; - _field3E26 = 98; - - _item7._field34 = 0; - _item7._field36 = Common::Point(128, 95); - - _item8._field34 = 0; - _item8._field36 = Common::Point(162, 95); - - _item6._field34 = 0; - - _item2._object1.postInit(); - _item2._object1.setVisage(1332); - _item2._object1.setStrip(5); - _item2._object1.setFrame(1); - _item2._object1._moveDiff = Common::Point(10, 10); - _item2._object1.fixPriority(400); - _item2._object1.setPosition(Common::Point(128, 95), 0); - _item2._object1.animate(ANIM_MODE_2, NULL); - _item2._object1.hide(); - - _object1.postInit(); - _object1.setVisage(1334); - _object1.setStrip(1); - _object1.setFrame(1); - _object1._numFrames = 12; - _object1.fixPriority(500); - _object1.setPosition(Common::Point(174, 107), 0); - _object1.animate(ANIM_MODE_2, NULL); - _object1.hide(); - - _field4244 = 1; - _field4246 = 0; - _field4248 = 0; - _field424A = -1; - - _background1.setup2(9531, 1, 1, 249, 168, 155, 0); + _availableCardsPile[0] = 1; + _availableCardsPile[1] = 1; + _availableCardsPile[2] = 1; + _availableCardsPile[3] = 1; + _availableCardsPile[4] = 1; + _availableCardsPile[5] = 1; + _availableCardsPile[6] = 1; + _availableCardsPile[7] = 1; + _availableCardsPile[8] = 26; + _availableCardsPile[9] = 2; + _availableCardsPile[10] = 2; + _availableCardsPile[11] = 2; + _availableCardsPile[12] = 2; + _availableCardsPile[13] = 2; + _availableCardsPile[14] = 26; + _availableCardsPile[15] = 3; + _availableCardsPile[16] = 3; + _availableCardsPile[17] = 3; + _availableCardsPile[18] = 3; + _availableCardsPile[19] = 3; + _availableCardsPile[20] = 28; + _availableCardsPile[21] = 4; + _availableCardsPile[22] = 4; + _availableCardsPile[23] = 4; + _availableCardsPile[24] = 4; + _availableCardsPile[25] = 4; + _availableCardsPile[26] = 28; + _availableCardsPile[27] = 5; + _availableCardsPile[28] = 5; + _availableCardsPile[29] = 5; + _availableCardsPile[30] = 5; + _availableCardsPile[31] = 5; + _availableCardsPile[32] = 30; + _availableCardsPile[33] = 6; + _availableCardsPile[34] = 6; + _availableCardsPile[35] = 6; + _availableCardsPile[36] = 6; + _availableCardsPile[37] = 6; + _availableCardsPile[38] = 30; + _availableCardsPile[39] = 7; + _availableCardsPile[40] = 7; + _availableCardsPile[41] = 7; + _availableCardsPile[42] = 7; + _availableCardsPile[43] = 7; + _availableCardsPile[44] = 32; + _availableCardsPile[45] = 8; + _availableCardsPile[46] = 8; + _availableCardsPile[47] = 8; + _availableCardsPile[48] = 8; + _availableCardsPile[49] = 8; + _availableCardsPile[50] = 32; + _availableCardsPile[51] = 9; + _availableCardsPile[52] = 9; + _availableCardsPile[53] = 9; + _availableCardsPile[54] = 9; + _availableCardsPile[55] = 9; + _availableCardsPile[56] = 10; + _availableCardsPile[57] = 11; + _availableCardsPile[58] = 12; + _availableCardsPile[59] = 13; + _availableCardsPile[60] = 13; + _availableCardsPile[61] = 14; + _availableCardsPile[62] = 15; + _availableCardsPile[63] = 16; + _availableCardsPile[64] = 17; + _availableCardsPile[65] = 18; + _availableCardsPile[66] = 19; + _availableCardsPile[67] = 20; + _availableCardsPile[68] = 21; + _availableCardsPile[69] = 26; + _availableCardsPile[70] = 28; + _availableCardsPile[71] = 24; + _availableCardsPile[72] = 25; + _availableCardsPile[73] = 25; + _availableCardsPile[74] = 25; + _availableCardsPile[75] = 25; + _availableCardsPile[76] = 26; + _availableCardsPile[77] = 26; + _availableCardsPile[78] = 26; + _availableCardsPile[79] = 27; + _availableCardsPile[80] = 27; + _availableCardsPile[81] = 28; + _availableCardsPile[82] = 28; + _availableCardsPile[83] = 28; + _availableCardsPile[84] = 29; + _availableCardsPile[85] = 29; + _availableCardsPile[86] = 29; + _availableCardsPile[87] = 30; + _availableCardsPile[88] = 30; + _availableCardsPile[89] = 30; + _availableCardsPile[90] = 30; + _availableCardsPile[91] = 32; + _availableCardsPile[92] = 1; + _availableCardsPile[93] = 32; + _availableCardsPile[94] = 32; + _availableCardsPile[95] = 32; + _availableCardsPile[96] = 1; + _availableCardsPile[97] = 1; + _availableCardsPile[98] = 1; + _availableCardsPile[99] = 0; + + _cardsAvailableNumb = 98; + _currentDiscardIndex = 98; // CHECKME: Would make more sense at pos 99 + + _discardPile._cardId = 0; + _discardPile._stationPos = Common::Point(128, 95); + + _stockCard._cardId = 0; + _stockCard._stationPos = Common::Point(162, 95); + + _selectedCard._cardId = 0; + + _animatedCard._card.postInit(); + _animatedCard._card.setVisage(1332); + _animatedCard._card.setStrip(5); + _animatedCard._card.setFrame(1); + _animatedCard._card._moveDiff = Common::Point(10, 10); + _animatedCard._card.fixPriority(400); + _animatedCard._card.setPosition(Common::Point(128, 95), 0); + _animatedCard._card.animate(ANIM_MODE_2, NULL); + _animatedCard._card.hide(); + + _currentPlayerArrow.postInit(); + _currentPlayerArrow.setVisage(1334); + _currentPlayerArrow.setStrip(1); + _currentPlayerArrow.setFrame(1); + _currentPlayerArrow._numFrames = 12; + _currentPlayerArrow.fixPriority(500); + _currentPlayerArrow.setPosition(Common::Point(174, 107), 0); + _currentPlayerArrow.animate(ANIM_MODE_2, NULL); + _currentPlayerArrow.hide(); + + _showPlayerTurn = true; + _displayHelpFl = false; + _winnerId = -1; + + _helpIcon.postInit(); + _helpIcon.setup(9531, 1, 1); + _helpIcon.setPosition(Common::Point(249, 168)); + _helpIcon.setPriority(155); + _helpIcon._effect = EFFECT_NONE; + _helpIcon.show(); _autoplay = false; - _field424C = 0; - _field424E = 0; + _instructionsDisplayedFl = false; + _instructionsWaitCount = 0; } void Scene1337::suggestInstructions() { if (R2_GLOBALS._v57709 > 0) subD1917(); + if (MessageDialog::show(NEED_INSTRUCTIONS, NO_MSG, YES_MSG) == 0) { if (R2_GLOBALS._v57709 == 0) subD18F5(); - subCCF26(); + dealCards(); } else { if (R2_GLOBALS._v57709 == 0) subD18F5(); - subCB59B(); + displayInstructions(); } } -void Scene1337::subCB59B() { - _item1.setAction(&_action1); +void Scene1337::displayInstructions() { + _actionItem.setAction(&_action1); } void Scene1337::shuffleCards() { R2_GLOBALS._sceneObjects->draw(); + // Remove holes in card pile for (int i = 0; i <= 98; i++) { - if (_field3E28[i] == 0) { + if (_availableCardsPile[i] == 0) { for (int j = i + 1; j <= 98; j ++) { - if (_field3E28[j] != 0) { - _field3E28[i] = _field3E28[j]; - _field3E28[j] = 0; + if (_availableCardsPile[j] != 0) { + _availableCardsPile[i] = _availableCardsPile[j]; + _availableCardsPile[j] = 0; break; } } } } + // Compute the number of available cards for (int i = 0; i <= 99; i ++) { - if (_field3E28[i] == 0) { - _field3E24 = i - 1; - _field3E26 = 98; + if (_availableCardsPile[i] == 0) { + // CHECKME: This will fail if i == 0, which shouldn't happen + // as we don't shuffle cards when no card is available. + _cardsAvailableNumb = i - 1; + _currentDiscardIndex = 98; // CHECKME: Would make more sense at pos 99 break; } } - // tmpVal is never modified in the original. It looks weird but it works: at the end, the cards are suffled! - int tmpVal = 0; - int randIndx; - int swap; for (int i = 0; i < 2000; i ++) { - randIndx = R2_GLOBALS._randomSource.getRandomNumber(_field3E24); - swap = _field3E28[tmpVal]; - _field3E28[tmpVal] = _field3E28[randIndx]; - _field3E28[randIndx] = swap; + int randIndx = R2_GLOBALS._randomSource.getRandomNumber(_cardsAvailableNumb); + int swap = _availableCardsPile[0]; + _availableCardsPile[0] = _availableCardsPile[randIndx]; + _availableCardsPile[randIndx] = swap; } - _field423C = 0; - _item2._object1.setAction(&_action2); + _shuffleEndedFl = false; + + // Shuffle cards + _animatedCard._card.setAction(&_action2); - while(_field423C == 0) { + while(!_shuffleEndedFl && !g_vm->shouldQuit()) { + g_globals->_sceneObjects->recurse(SceneHandler::dispatchObject); g_globals->_scenePalette.signalListeners(); R2_GLOBALS._sceneObjects->draw(); - warning("TODO: recurse on draw() and on signalListeners()?"); g_globals->_events.delay(g_globals->_sceneHandler->_delayTicks); - - // Hack to avoid eternal loop - // To be removed when the recurse is working properly - _field423C = 1; } } -void Scene1337::subCCF26() { - _item2._object1._moveDiff = Common::Point(30, 30); +void Scene1337::dealCards() { + _animatedCard._card._moveDiff = Common::Point(30, 30); shuffleCards(); - _item1.setAction(&_action3); + + // Deal cards + _actionItem.setAction(&_action3); } -void Scene1337::subCD193() { - warning("STUBBED: subCD193()"); + +void Scene1337::showOptionsDialog() { + // Display menu with "Auto Play", "New Game", "Quit" and "Continue" + OptionsDialog::show(); } -void Scene1337::subCDB90(int arg1, Common::Point pt) { - bool found = false; +void Scene1337::handleClick(int arg1, Common::Point pt) { int curReg = R2_GLOBALS._sceneRegions.indexOf(g_globals->_events._mousePos); if (arg1 == 3) { + bool found = false; int i; for (i = 0; i <= 7; i++) { - if ( (subC2BF8(&_arrunkObj1337[2]._arr2[i], pt)) - || (subC2BF8(&_arrunkObj1337[0]._arr2[i], pt)) - || (subC2BF8(&_arrunkObj1337[1]._arr2[i], pt)) - || (subC2BF8(&_arrunkObj1337[3]._arr2[i], pt)) ) { + if ( _gameBoardSide[2]._outpostStation[i].isIn(pt) + || _gameBoardSide[0]._outpostStation[i].isIn(pt) + || _gameBoardSide[1]._outpostStation[i].isIn(pt) + || _gameBoardSide[3]._outpostStation[i].isIn(pt) ) { found = true; break; } @@ -5610,124 +5432,114 @@ void Scene1337::subCDB90(int arg1, Common::Point pt) { if (found) { switch (curReg) { case 5: - if (_arrunkObj1337[2]._arr2[i]._field34 != 0) - displayDialog(_arrunkObj1337[2]._arr2[i]._field34); + if (_gameBoardSide[2]._outpostStation[i]._cardId != 0) + displayDialog(_gameBoardSide[2]._outpostStation[i]._cardId); else actionDisplay(1330, 20, 159, 10, 1, 200, 0, 7, 0, 154, 154); break; case 10: - if (_arrunkObj1337[3]._arr2[i]._field34 != 0) - displayDialog(_arrunkObj1337[3]._arr2[i]._field34); + if (_gameBoardSide[3]._outpostStation[i]._cardId != 0) + displayDialog(_gameBoardSide[3]._outpostStation[i]._cardId); else actionDisplay(1330, 22, 159, 10, 1, 200, 0, 7, 0, 154, 154); break; case 15: - if (_arrunkObj1337[0]._arr2[i]._field34 != 0) - displayDialog(_arrunkObj1337[0]._arr2[i]._field34); + if (_gameBoardSide[0]._outpostStation[i]._cardId != 0) + displayDialog(_gameBoardSide[0]._outpostStation[i]._cardId); else actionDisplay(1330, 21, 159, 10, 1, 200, 0, 7, 0, 154, 154); break; case 20: - if (_arrunkObj1337[1]._arr2[i]._field34 != 0) - displayDialog(_arrunkObj1337[1]._arr2[i]._field34); + if (_gameBoardSide[1]._outpostStation[i]._cardId != 0) + displayDialog(_gameBoardSide[1]._outpostStation[i]._cardId); else actionDisplay(1330, 23, 159, 10, 1, 200, 0, 7, 0, 154, 154); break; default: break; } - } else { - if ( (subC2BF8(&_arrunkObj1337[2]._arr3[0], pt)) - || (subC2BF8(&_arrunkObj1337[0]._arr3[0], pt)) - || (subC2BF8(&_arrunkObj1337[1]._arr3[0], pt)) - || (subC2BF8(&_arrunkObj1337[3]._arr3[0], pt)) ) { - found = true; + } else if ( _gameBoardSide[2]._delayCard.isIn(pt) + || _gameBoardSide[0]._delayCard.isIn(pt) + || _gameBoardSide[1]._delayCard.isIn(pt) + || _gameBoardSide[3]._delayCard.isIn(pt) ) { + switch (curReg) { + case 5: + if (_gameBoardSide[2]._delayCard._cardId != 0) + displayDialog(_gameBoardSide[2]._delayCard._cardId); + else + actionDisplay(1330, 10, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 10: + if (_gameBoardSide[3]._delayCard._cardId != 0) + displayDialog(_gameBoardSide[3]._delayCard._cardId); + else + actionDisplay(1330, 16, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 15: + if (_gameBoardSide[0]._delayCard._cardId != 0) + displayDialog(_gameBoardSide[0]._delayCard._cardId); + else + actionDisplay(1330, 13, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 20: + if (_gameBoardSide[1]._delayCard._cardId != 0) + displayDialog(_gameBoardSide[1]._delayCard._cardId); + else + actionDisplay(1330, 18, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + default: + break; } - - if (found) { - switch (curReg) { - case 5: - if (_arrunkObj1337[2]._arr3[0]._field34 != 0) - displayDialog(_arrunkObj1337[2]._arr3[0]._field34); - else - actionDisplay(1330, 10, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 10: - if (_arrunkObj1337[3]._arr3[0]._field34 != 0) - displayDialog(_arrunkObj1337[3]._arr3[0]._field34); - else - actionDisplay(1330, 16, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 15: - if (_arrunkObj1337[0]._arr3[0]._field34 != 0) - displayDialog(_arrunkObj1337[3]._arr3[0]._field34); - else - actionDisplay(1330, 13, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 20: - if (_arrunkObj1337[1]._arr3[0]._field34 != 0) - displayDialog(_arrunkObj1337[1]._arr3[0]._field34); - else - actionDisplay(1330, 18, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - default: - break; - } - } else { - if (subC2BF8(&_item7, pt)) { - if (_item7._field34 != 0) - displayDialog(_item7._field34); - else - actionDisplay(1330, 7, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else if (_background1._bounds.contains(pt)) { - actionDisplay(1330, 43, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else if (subC2BF8(&_item8, pt)) { - actionDisplay(1330, 4, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else if ( (subC2BF8(&_arrunkObj1337[2]._arr4[0], pt)) - || (subC2BF8(&_arrunkObj1337[3]._arr4[0], pt)) - || (subC2BF8(&_arrunkObj1337[0]._arr4[0], pt)) - || (subC2BF8(&_arrunkObj1337[1]._arr4[0], pt)) ) { - actionDisplay(1330, 32, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else { - if (subC2BF8(&_arrunkObj1337[2]._arr1[0], pt)) - displayDialog(_arrunkObj1337[2]._arr1[0]._field34); - else if (subC2BF8(&_arrunkObj1337[2]._arr1[1], pt)) - displayDialog(_arrunkObj1337[2]._arr1[1]._field34); - else if (subC2BF8(&_arrunkObj1337[2]._arr1[2], pt)) - displayDialog(_arrunkObj1337[2]._arr1[2]._field34); - else if (subC2BF8(&_arrunkObj1337[2]._arr1[3], pt)) - displayDialog(_arrunkObj1337[2]._arr1[3]._field34); - else if ((curReg >= 6) && (curReg <= 9)) - actionDisplay(1330, 29, 159, 10, 1, 200, 0, 7, 0, 154, 154); - else if ((curReg >= 11) && (curReg <= 14)) - actionDisplay(1330, 31, 159, 10, 1, 200, 0, 7, 0, 154, 154); - else if ((curReg >= 16) && (curReg <= 19)) - actionDisplay(1330, 30, 159, 10, 1, 200, 0, 7, 0, 154, 154); - else { - switch (curReg) { - case 0: - actionDisplay(1330, 2, 159, 134, 1, 200, 0, 7, 0, 105, 105); - break; - case 5: - actionDisplay(1330, 25, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 10: - actionDisplay(1330, 27, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 15: - actionDisplay(1330, 26, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 20: - actionDisplay(1330, 28, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 21: - actionDisplay(1330, 24, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - default: - break; - } - } - } + } else if (_discardPile.isIn(pt)) { + if (_discardPile._cardId != 0) + displayDialog(_discardPile._cardId); + else + actionDisplay(1330, 7, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } else if (_helpIcon._bounds.contains(pt)) + actionDisplay(1330, 43, 159, 10, 1, 200, 0, 7, 0, 154, 154); + else if (_stockCard.isIn(pt)) + actionDisplay(1330, 4, 159, 10, 1, 200, 0, 7, 0, 154, 154); + else if ( (_gameBoardSide[2]._emptyStationPos.isIn(pt)) + || (_gameBoardSide[3]._emptyStationPos.isIn(pt)) + || (_gameBoardSide[0]._emptyStationPos.isIn(pt)) + || (_gameBoardSide[1]._emptyStationPos.isIn(pt)) ) + actionDisplay(1330, 32, 159, 10, 1, 200, 0, 7, 0, 154, 154); + else if (_gameBoardSide[2]._handCard[0].isIn(pt)) + displayDialog(_gameBoardSide[2]._handCard[0]._cardId); + else if (_gameBoardSide[2]._handCard[1].isIn(pt)) + displayDialog(_gameBoardSide[2]._handCard[1]._cardId); + else if (_gameBoardSide[2]._handCard[2].isIn(pt)) + displayDialog(_gameBoardSide[2]._handCard[2]._cardId); + else if (_gameBoardSide[2]._handCard[3].isIn(pt)) + displayDialog(_gameBoardSide[2]._handCard[3]._cardId); + else if ((curReg >= 6) && (curReg <= 9)) + actionDisplay(1330, 29, 159, 10, 1, 200, 0, 7, 0, 154, 154); + else if ((curReg >= 11) && (curReg <= 14)) + actionDisplay(1330, 31, 159, 10, 1, 200, 0, 7, 0, 154, 154); + else if ((curReg >= 16) && (curReg <= 19)) + actionDisplay(1330, 30, 159, 10, 1, 200, 0, 7, 0, 154, 154); + else { + switch (curReg) { + case 0: + actionDisplay(1330, 2, 159, 134, 1, 200, 0, 7, 0, 105, 105); + break; + case 5: + actionDisplay(1330, 25, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 10: + actionDisplay(1330, 27, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 15: + actionDisplay(1330, 26, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 20: + actionDisplay(1330, 28, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 21: + actionDisplay(1330, 24, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + default: + break; } } } @@ -5736,8 +5548,8 @@ void Scene1337::subCDB90(int arg1, Common::Point pt) { return; for (int i = 0; i <= 7; i++) { - if (subC2BF8(&_arrunkObj1337[2]._arr2[i], pt)) { - switch (_arrunkObj1337[2]._arr2[i]._field34) { + if (_gameBoardSide[2]._outpostStation[i].isIn(pt)) { + switch (_gameBoardSide[2]._outpostStation[i]._cardId) { case 0: actionDisplay(1330, 11, 159, 10, 1, 200, 0, 7, 0, 154, 154); break; @@ -5748,10 +5560,10 @@ void Scene1337::subCDB90(int arg1, Common::Point pt) { actionDisplay(1330, 34, 159, 10, 1, 200, 0, 7, 0, 154, 154); break; } - found = true; - break; - } else if (subC2BF8(&_arrunkObj1337[0]._arr2[i], pt)) { - switch (_arrunkObj1337[0]._arr2[i]._field34) { + return; + } + if (_gameBoardSide[0]._outpostStation[i].isIn(pt)) { + switch (_gameBoardSide[0]._outpostStation[i]._cardId) { case 0: actionDisplay(1330, 11, 159, 10, 1, 200, 0, 7, 0, 154, 154); break; @@ -5759,10 +5571,10 @@ void Scene1337::subCDB90(int arg1, Common::Point pt) { actionDisplay(1330, 1, 159, 10, 1, 200, 0, 7, 0, 154, 154); break; } - found = true; - break; - } else if (subC2BF8(&_arrunkObj1337[1]._arr2[i], pt)) { - switch (_arrunkObj1337[1]._arr2[i]._field34) { + return; + } + if (_gameBoardSide[1]._outpostStation[i].isIn(pt)) { + switch (_gameBoardSide[1]._outpostStation[i]._cardId) { case 0: actionDisplay(1330, 146, 300, 99, 1, 136, 0, 7, 0, 117, 117); break; @@ -5770,10 +5582,10 @@ void Scene1337::subCDB90(int arg1, Common::Point pt) { actionDisplay(1330, 144, 300, 99, 1, 136, 0, 7, 0, 117, 117); break; } - found = true; - break; - } else if (subC2BF8(&_arrunkObj1337[3]._arr2[i], pt)) { - switch (_arrunkObj1337[3]._arr2[i]._field34) { + return; + } + if (_gameBoardSide[3]._outpostStation[i].isIn(pt)) { + switch (_gameBoardSide[3]._outpostStation[i]._cardId) { case 0: actionDisplay(1330, 147, 20, 99, 1, 136, 0, 7, 0, 172, 172); break; @@ -5781,73 +5593,64 @@ void Scene1337::subCDB90(int arg1, Common::Point pt) { actionDisplay(1330, 145, 20, 99, 1, 136, 0, 7, 0, 172, 172); break; } - found = true; - break; + return; } } - if (subC2BF8(&_arrunkObj1337[2]._arr3[0], pt)) { - if (_arrunkObj1337[0]._arr3[0]._field34 != 0) { + if (_gameBoardSide[2]._delayCard.isIn(pt)) { + // The original uses _gameBoardSide[0], which is obviously a bug. + if (_gameBoardSide[2]._delayCard._cardId != 0) actionDisplay(1330, 39, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else { + else actionDisplay(1330, 11, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } - found = true; - } - if (subC2BF8(&_arrunkObj1337[3]._arr3[0], pt)) { - if (_arrunkObj1337[3]._arr3[0]._field34 != 0) { + return; + } + if (_gameBoardSide[3]._delayCard.isIn(pt)) { + if (_gameBoardSide[3]._delayCard._cardId != 0) actionDisplay(1330, 145, 20, 99, 1, 136, 0, 7, 0, 172, 172); - } else { + else actionDisplay(1330, 147, 20, 99, 1, 136, 0, 7, 0, 172, 172); - } - found = true; - } - if (subC2BF8(&_arrunkObj1337[1]._arr3[0], pt)) { - if (_arrunkObj1337[1]._arr3[0]._field34 != 0) { + return; + } + if (_gameBoardSide[1]._delayCard.isIn(pt)) { + if (_gameBoardSide[1]._delayCard._cardId != 0) actionDisplay(1330, 144, 300, 99, 1, 136, 0, 7, 0, 117, 117); - } else { + else actionDisplay(1330, 146, 300, 99, 1, 136, 0, 7, 0, 117, 117); - } - found = true; - } - if (subC2BF8(&_arrunkObj1337[0]._arr3[0], pt)) { - if (_arrunkObj1337[0]._arr3[0]._field34 != 0) { + return; + } + if (_gameBoardSide[0]._delayCard.isIn(pt)) { + if (_gameBoardSide[0]._delayCard._cardId != 0) actionDisplay(1330, 1, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else { + else actionDisplay(1330, 11, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } - found = true; - } - if (subC2BF8(&_arrunkObj1337[3]._arr4[0], pt)) { + return; + } + if (_gameBoardSide[3]._emptyStationPos.isIn(pt)) { actionDisplay(1330, 147, 20, 99, 1, 136, 0, 7, 0, 172, 172); - found = true; + return; } - - if (subC2BF8(&_arrunkObj1337[1]._arr4[0], pt)) { + if (_gameBoardSide[1]._emptyStationPos.isIn(pt)) { actionDisplay(1330, 146, 300, 99, 1, 136, 0, 7, 0, 117, 117); - found = true; + return; } - - if (subC2BF8(&_arrunkObj1337[0]._arr4[0], pt)) { + if (_gameBoardSide[0]._emptyStationPos.isIn(pt)) { actionDisplay(1330, 11, 159, 10, 1, 200, 0, 7, 0, 154, 154); - found = true; - } - - if (found) return; + } - if (_background1._bounds.contains(pt)) { - subCD193(); + if (_helpIcon._bounds.contains(pt)) { + showOptionsDialog(); return; } - if (subC2BF8(&_item7, pt)) + if (_discardPile.isIn(pt)) actionDisplay(1330, 9, 159, 10, 1, 200, 0, 7, 0, 154, 154); - else if (subC2BF8(&_item8, pt)) + else if (_stockCard.isIn(pt)) actionDisplay(1330, 5, 159, 10, 1, 200, 0, 7, 0, 154, 154); else { switch (curReg) { @@ -5894,992 +5697,1090 @@ void Scene1337::subCDB90(int arg1, Common::Point pt) { } } -void Scene1337::subCF31D() { - int tmpVal = 1; - bool found; - int count; - - if (this->_arrunkObj1337[1]._arr3[0]._field34 != 0) { - switch (_arrunkObj1337[1]._arr3[0]._field34) { +void Scene1337::handlePlayer0() { + if (_gameBoardSide[0]._delayCard._cardId != 0) { + switch (_gameBoardSide[0]._delayCard._cardId) { case 10: - // No break on purpose + //No break on purpose case 12: - // No break on purpose + //No break on purpose case 15: - // No break on purpose + //No break on purpose case 17: - // No break on purpose + //No break on purpose case 18: - // No break on purpose + //No break on purpose case 19: - // No break on purpose + //No break on purpose case 20: - // No break on purpose + //No break on purpose case 21: - tmpVal = 0; - subC4A39(&_arrunkObj1337[1]._arr3[0]); + discardCard(&_gameBoardSide[0]._delayCard); break; default: - found = false; - int i; - for (i = 0; i <= 3; i++) { - if (subC3386(_arrunkObj1337[1]._arr3[0]._field34, _arrunkObj1337[1]._arr1[i]._field34)) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if (checkAntiDelayCard(_gameBoardSide[0]._delayCard._cardId, _gameBoardSide[0]._handCard[i]._cardId)) { + playAntiDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[0]._delayCard); + return; } } - if (found) { - tmpVal = 0; - subC34A1(&_arrunkObj1337[1]._arr1[i], &_arrunkObj1337[1]._arr3[0]); - } + break; } } - if (tmpVal != 1) - return; - - found = false; for (int i = 0; i <= 3; i++) { - int tmpIndx = subC26CB(1, i); - if (tmpIndx == -1) - break; + int tmpVal = getStationId(0, i); - tmpVal = 0; - for (int j = 0; j <= 7; j++) { - if (_arrunkObj1337[1]._arr2[j]._field34 == _arrunkObj1337[1]._arr1[tmpIndx]._field34) { - tmpVal = 1; - break; + if (tmpVal != -1) { + bool stationAlreadyPresentFl = false; + for (int j = 0; j <= 7; j++) { + if (_gameBoardSide[0]._outpostStation[j]._cardId == _gameBoardSide[0]._handCard[tmpVal]._cardId) { + stationAlreadyPresentFl = true; + break; + } } - } - if (tmpVal == 0) - break; - - for (int j = 0; j <= 7; j++) { - if (_arrunkObj1337[1]._arr2[j]._field34 == 1) { - if (!subC2687(_arrunkObj1337[1]._arr3[0]._field34)) { - count = 0; - for (int k = 0; k <= 7; k++) { - if ((_arrunkObj1337[1]._arr2[k]._field34 > 1) && (_arrunkObj1337[1]._arr2[k]._field34 <= 9)) - ++count; - } + if (!stationAlreadyPresentFl) { + for (int j = 0; j <= 7; j++) { + if ((_gameBoardSide[0]._outpostStation[j]._cardId == 1) && !isStopConstructionCard(_gameBoardSide[0]._delayCard._cardId)) { + int stationCount = 0; + for (int k = 0; k <= 7; k++) { + if ((_gameBoardSide[0]._outpostStation[k]._cardId > 1) && (_gameBoardSide[0]._outpostStation[k]._cardId <= 9)) { + ++stationCount; + } + } - if (count == 7) - _field424A = 1; + if (stationCount == 7) + _winnerId = 0; - subC33C0(&_arrunkObj1337[1]._arr1[tmpIndx], &_arrunkObj1337[1]._arr2[j]); - found = true; - break; + playStationCard(&_gameBoardSide[0]._handCard[tmpVal], &_gameBoardSide[0]._outpostStation[j]); + return; + } } } } } - if (found) - return; + int tmpVal = findPlatformCardInHand(0); - tmpVal = subC2719(1); if (tmpVal != -1) { for (int i = 0; i <= 7; i++) { - if ((_arrunkObj1337[1]._arr2[i]._field34 == 0) && (!subC2687(_arrunkObj1337[1]._arr3[0]._field34))) { - subC340B(&_arrunkObj1337[1]._arr1[tmpVal], &_arrunkObj1337[1]._arr2[i]); - found = true; - break; - } + if ((_gameBoardSide[0]._outpostStation[i]._cardId == 0) && !isStopConstructionCard(_gameBoardSide[0]._delayCard._cardId)) { + playPlatformCard(&_gameBoardSide[0]._handCard[tmpVal], &_gameBoardSide[0]._outpostStation[i]); + return; + } } } - if (found) - return; - - tmpVal = subC274D(1); - int tmpVal2 = subC331B(1); - - if ((tmpVal != -1) && ( tmpVal2 != -1)) { - subC358E(&_arrunkObj1337[1]._arr1[tmpVal], tmpVal2); - found = true; - } - - if (found) - return; - - tmpVal = subC2781(1); - if (tmpVal != -1) { - count = -1; - int rndVal = R2_GLOBALS._randomSource.getRandomNumber(3); - for (int i = 0; i <= 3; i++) { - if (rndVal != 1) { - if ( (_arrunkObj1337[rndVal]._arr1[0]._field34 != 0) - || (_arrunkObj1337[rndVal]._arr1[1]._field34 != 0) - || (_arrunkObj1337[rndVal]._arr1[2]._field34 != 0) - || (_arrunkObj1337[rndVal]._arr1[3]._field34 == 0)) { - count = rndVal; - break; - } - - rndVal--; - if (rndVal < 0) - rndVal = 3; + int card13Id = findCard13InHand(0); + if (card13Id != -1) { + for (int i = 0; i <= 7; i++) { + if (_gameBoardSide[2]._outpostStation[i]._cardId != 0) { + playCounterTrickCard(&_gameBoardSide[0]._handCard[card13Id], 2); + return; } } + } - if (count != -1) { - subC318B(1, &_arrunkObj1337[1]._arr1[tmpVal], count); - found = true; + int thieftId = checkThieftCard(0); + if (thieftId != -1) { + if ( (_gameBoardSide[2]._handCard[0]._cardId != 0) + || (_gameBoardSide[2]._handCard[1]._cardId != 0) + || (_gameBoardSide[2]._handCard[2]._cardId != 0) + || (_gameBoardSide[2]._handCard[3]._cardId != 0) ) { + playThieftCard(0, &_gameBoardSide[0]._handCard[thieftId], 2); + return; } } - if (found) - return; + for (int i = 0; i <= 3; i++) { + if ((isDelayCard(_gameBoardSide[0]._handCard[i]._cardId) != -1) + && (_gameBoardSide[2]._delayCard._cardId == 0) + && isAttackPossible(2, _gameBoardSide[0]._handCard[i]._cardId)) { + playDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[2]._delayCard); + return; + } + } - count = -1; - int i; - for (i = 0; i <= 3; i++) { - tmpVal = subC27B5(_arrunkObj1337[1]._arr1[i]._field34); - if (tmpVal != -1) { - int rndVal = R2_GLOBALS._randomSource.getRandomNumber(3); + for (int i = 0; i <= 3; i++) { + if ((getStationCardId(_gameBoardSide[0]._handCard[i]._cardId) != -1) + && (_gameBoardSide[2]._delayCard._cardId == 0) + && isAttackPossible(2, _gameBoardSide[0]._handCard[i]._cardId)) { + playDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[2]._delayCard); + return; + } + } - for (int j = 0; j <= 3; j++) { - if (tmpVal != 1) { - for (int k = 0; k <= 7; k++) { - // 'k' is not used in that loop. - // It looks suspicious. - if ((_arrunkObj1337[tmpVal]._arr3[0]._field34 == 0) && (subC32B1(tmpVal, _arrunkObj1337[1]._arr1[i]._field34))) { - count = tmpVal; - break; - } - } - } + card13Id = findCard13InHand(0); + int victimPlayerId = getPlayerWithOutpost(0); - if (count != -1) { - found = true; - break; - } else { - rndVal--; - if (rndVal < 0) - rndVal = 3; - } - } + if ((card13Id != -1) && (victimPlayerId != -1)) { + playCounterTrickCard(&_gameBoardSide[0]._handCard[card13Id], victimPlayerId); + return; + } - if (found) - break; + thieftId = checkThieftCard(0); + if (thieftId != -1) { + if ( (_gameBoardSide[1]._handCard[0]._cardId != 0) + || (_gameBoardSide[1]._handCard[1]._cardId != 0) + || (_gameBoardSide[1]._handCard[2]._cardId != 0) + || (_gameBoardSide[1]._handCard[3]._cardId != 0) ) { + playThieftCard(0, &_gameBoardSide[0]._handCard[thieftId], 1); + return; } } - if (found) { - if (count == -1) - return; + for (int i = 0; i <= 3; i++) { + if (getStationCardId(_gameBoardSide[0]._handCard[i]._cardId) != -1) { + if ((_gameBoardSide[1]._delayCard._cardId == 0) && isAttackPossible(1, _gameBoardSide[0]._handCard[i]._cardId)) { + playDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[1]._delayCard); + return; + } - subC3456(&_arrunkObj1337[1]._arr1[i], &_arrunkObj1337[count]._arr3[0]); - } else { - int j; - for (j = 0; j <= 3; j++) { - if (subC27F9(_arrunkObj1337[1]._arr1[j]._field34) != -1) { - count = -1; - int rndVal = R2_GLOBALS._randomSource.getRandomNumber(3); - for (int l = 0; l <= 3; l++) { - if (rndVal != 1) { - for (int m = 0; m <= 7; m++) { - // 'm' is not used in that loop. It looks suspicious. - if ((_arrunkObj1337[rndVal]._arr3[0]._field34 == 0) && (_arrunkObj1337[1]._arr1[j]._field34 == 1)) { - count = rndVal; - break; - } - } - } - if (count != -1) { - found = true; - break; - } else { - rndVal--; - if (rndVal < 0) - rndVal = 3; - } - } - if (found) - break; + if ((_gameBoardSide[3]._delayCard._cardId == 0) && isAttackPossible(3, _gameBoardSide[0]._handCard[i]._cardId)) { + playDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[3]._delayCard); + return; } } + } - if (found) { - if (count == -1) + for (int i = 0; i <= 3; i++) { + tmpVal = isDelayCard(_gameBoardSide[0]._handCard[i]._cardId); + if (tmpVal != -1) { + if ((_gameBoardSide[1]._delayCard._cardId == 0) && isAttackPossible(1, _gameBoardSide[0]._handCard[i]._cardId)) { + playDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[1]._delayCard); return; + } - subC3456(&_arrunkObj1337[1]._arr1[j], &_arrunkObj1337[count]._arr3[0]); - } else { - subC2835(1); + if ((_gameBoardSide[3]._delayCard._cardId == 0) && isAttackPossible(3, _gameBoardSide[0]._handCard[i]._cardId)) { + playDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[3]._delayCard); + return; + } } } + handlePlayer01Discard(0); } -void Scene1337::subCF979() { - bool found = true; - - if (_arrunkObj1337[0]._arr3[0]._field34 != 0) { - switch (_arrunkObj1337[0]._arr3[0]._field34) { +void Scene1337::handlePlayer1() { + if (this->_gameBoardSide[1]._delayCard._cardId != 0) { + switch (_gameBoardSide[1]._delayCard._cardId) { case 10: - //No break on purpose + // No break on purpose case 12: - //No break on purpose + // No break on purpose case 15: - //No break on purpose + // No break on purpose case 17: - //No break on purpose + // No break on purpose case 18: - //No break on purpose + // No break on purpose case 19: - //No break on purpose + // No break on purpose case 20: - //No break on purpose + // No break on purpose case 21: - subC4A39(&_arrunkObj1337[0]._arr3[0]); - found = false; - break; + discardCard(&_gameBoardSide[1]._delayCard); + return; default: - int i; - found = false; - - for (i = 0; i <= 3; i++) { - if (subC3386(_arrunkObj1337[0]._arr3[0]._field34, _arrunkObj1337[0]._arr1[i]._field34)) { - found = true; - break; + for (int i = 0; i <= 3; i++) { + if (checkAntiDelayCard(_gameBoardSide[1]._delayCard._cardId, _gameBoardSide[1]._handCard[i]._cardId)) { + playAntiDelayCard(&_gameBoardSide[1]._handCard[i], &_gameBoardSide[1]._delayCard); + return; } } - - if (found) { - found = false; - subC34A1(&_arrunkObj1337[0]._arr1[i], &_arrunkObj1337[0]._arr3[0]); - } break; } } - if (found) - return; - - int tmpVal; - found = false; for (int i = 0; i <= 3; i++) { - tmpVal = subC26CB(0, i); - - if (tmpVal != -1) { - bool flag = false; - for (int j = 0; j <= 7; j++) { - if (_arrunkObj1337[0]._arr2[j]._field34 == _arrunkObj1337[0]._arr1[tmpVal]._field34) { - flag = true; - break; - } - } - - if (!flag) { - for (int j = 0; j <= 7; j++) { - if ((_arrunkObj1337[0]._arr2[j]._field34 == 1) && (!subC2687(_arrunkObj1337[0]._arr3[0]._field34))) { - int count = 0; - for (int k = 0; k <= 7; k++) { - if ((_arrunkObj1337[0]._arr2[k]._field34 > 1) && (_arrunkObj1337[0]._arr2[k]._field34 <= 9)) { - ++count; - } - } - - if (count == 7) - _field424A = 0; + int tmpIndx = getStationId(1, i); + if (tmpIndx == -1) + break; - subC33C0(&_arrunkObj1337[0]._arr1[tmpVal], &_arrunkObj1337[0]._arr2[j]); - found = true; - } - } + int tmpVal = 0; + for (int j = 0; j <= 7; j++) { + if (_gameBoardSide[1]._outpostStation[j]._cardId == _gameBoardSide[1]._handCard[tmpIndx]._cardId) { + tmpVal = 1; + break; } } - if (found) + if (tmpVal == 0) break; - } - if (found) - return; + for (int j = 0; j <= 7; j++) { + if ((_gameBoardSide[1]._outpostStation[j]._cardId == 1) && !isStopConstructionCard(_gameBoardSide[1]._delayCard._cardId)) { + int stationCount = 0; + for (int k = 0; k <= 7; k++) { + if ((_gameBoardSide[1]._outpostStation[k]._cardId > 1) && (_gameBoardSide[1]._outpostStation[k]._cardId <= 9)) + ++stationCount; + } - found = false; - tmpVal = subC2719(0); + if (stationCount == 7) + _winnerId = 1; - if (tmpVal != -1) { - for (int i = 0; i <= 7; i++) { - if ((_arrunkObj1337[0]._arr2[i]._field34 == 0) && (!subC2687(_arrunkObj1337[0]._arr3[0]._field34))) { - subC340B(&_arrunkObj1337[0]._arr1[tmpVal], &_arrunkObj1337[0]._arr2[i]); - found = true; - break; + playStationCard(&_gameBoardSide[1]._handCard[tmpIndx], &_gameBoardSide[1]._outpostStation[j]); + return; } } } - if (found) - return; - - tmpVal = subC274D(0); - if (tmpVal != -1) { + int normalCardId = findPlatformCardInHand(1); + if (normalCardId != -1) { for (int i = 0; i <= 7; i++) { - if (_arrunkObj1337[2]._arr2[i]._field34 != 0) { - subC358E(&_arrunkObj1337[0]._arr1[tmpVal], 2); - found = true; - break; + if ((_gameBoardSide[1]._outpostStation[i]._cardId == 0) && !isStopConstructionCard(_gameBoardSide[1]._delayCard._cardId)) { + playPlatformCard(&_gameBoardSide[1]._handCard[normalCardId], &_gameBoardSide[1]._outpostStation[i]); + return; } } } - if (found) - return; - - tmpVal = subC2781(0); - if (tmpVal != -1) { - if ( (_arrunkObj1337[2]._arr1[0]._field34 != 0) - || (_arrunkObj1337[2]._arr1[1]._field34 != 0) - || (_arrunkObj1337[2]._arr1[2]._field34 != 0) - || (_arrunkObj1337[2]._arr1[3]._field34 != 0) ) { - subC318B(0, &_arrunkObj1337[0]._arr1[tmpVal], 2); - found = true; - } - } + int card13Id = findCard13InHand(1); + int tmpVal2 = getPlayerWithOutpost(1); - if (found) + if ((card13Id != -1) && (tmpVal2 != -1)) { + playCounterTrickCard(&_gameBoardSide[1]._handCard[card13Id], tmpVal2); return; + } - for (int i = 0; i <= 3; i++) { - if (subC27B5(_arrunkObj1337[0]._arr1[i]._field34) != -1) { - // The variable 'j' is not used in the inner code of the loop. It's suspect - for (int j = 0; j <= 7; j++) { - if ((_arrunkObj1337[2]._arr3[0]._field34 == 0) && (subC32B1(2, _arrunkObj1337[0]._arr1[i]._field34))) { - subC3456(&_arrunkObj1337[0]._arr1[i], &_arrunkObj1337[2]._arr3[0]); - found = true; - break; + int thieftId = checkThieftCard(1); + if (thieftId != -1) { + int playerIdFound = -1; + int rndVal = R2_GLOBALS._randomSource.getRandomNumber(3); + for (int i = 0; i <= 3; i++) { + if (rndVal != 1) { + if ( (_gameBoardSide[rndVal]._handCard[0]._cardId != 0) + || (_gameBoardSide[rndVal]._handCard[1]._cardId != 0) + || (_gameBoardSide[rndVal]._handCard[2]._cardId != 0) + || (_gameBoardSide[rndVal]._handCard[3]._cardId == 0)) { + playerIdFound = rndVal; + break; } } + // The original was only updating in the rndVal block, + // which was a bug as the checks were stopping at this point + rndVal--; + if (rndVal < 0) + rndVal = 3; + } - if (found) - break; + if (playerIdFound != -1) { + playThieftCard(1, &_gameBoardSide[1]._handCard[thieftId], playerIdFound); + return; } } - if (found) - return; + int count = -1; + int i; + for (i = 0; i <= 3; i++) { + int tmpVal = isDelayCard(_gameBoardSide[1]._handCard[i]._cardId); + if (tmpVal != -1) { + int rndVal = R2_GLOBALS._randomSource.getRandomNumber(3); - for (int i = 0; i <= 3; i++) { - if (subC27F9(_arrunkObj1337[0]._arr1[i]._field34) != -1) { - // The variable 'j' is not used in the inner code of the loop. It's suspect - for (int j = 0; j <= 7; j++) { - if ((_arrunkObj1337[2]._arr3[0]._field34 == 0) && (subC32B1(2, _arrunkObj1337[0]._arr1[i]._field34))) { - subC3456(&_arrunkObj1337[0]._arr1[i], &_arrunkObj1337[2]._arr3[0]); - found = true; + for (int j = 0; j <= 3; j++) { + //CHECKME: tmpVal or rndVal? + // FIXME: This is probably meant to be rndVal, but not clear... + if (tmpVal < 0 || tmpVal >= ARRAYSIZE(_gameBoardSide)) + error("Scene1337::handlePlayer1() tmpVal:%d out of range 0 to %d", tmpVal, ARRAYSIZE(_gameBoardSide)-1); + + if (tmpVal != 1) { + if ((_gameBoardSide[tmpVal]._delayCard._cardId == 0) && isAttackPossible(tmpVal, _gameBoardSide[1]._handCard[i]._cardId)) + count = tmpVal; } - } - if (found) - break; + if (count < 0 || count >= ARRAYSIZE(_gameBoardSide)) + error("Scene1337::handlePlayer1() count:%d out of range 0 to %d", count, ARRAYSIZE(_gameBoardSide)-1); + + if (count != -1) { + playDelayCard(&_gameBoardSide[1]._handCard[i], &_gameBoardSide[count]._delayCard); + return; + } else { + rndVal--; + if (rndVal < 0) + rndVal = 3; + } + } } } - if (found) - return; - - tmpVal = subC274D(0); - int tmpVal2 = subC331B(0); - - if ((tmpVal != -1) && (tmpVal2 != -1)) { - subC358E(&_arrunkObj1337[0]._arr1[tmpVal], tmpVal2); - found = true; + int j; + for (j = 0; j <= 3; j++) { + if (getStationCardId(_gameBoardSide[1]._handCard[j]._cardId) != -1) { + count = -1; + int rndVal = R2_GLOBALS._randomSource.getRandomNumber(3); + for (int l = 0; l <= 3; l++) { + if (rndVal != 1) { + if ((_gameBoardSide[rndVal]._delayCard._cardId == 0) && (_gameBoardSide[1]._handCard[j]._cardId == 1)) + count = rndVal; + } + if (count != -1) { + playDelayCard(&_gameBoardSide[1]._handCard[j], &_gameBoardSide[count]._delayCard); + return; + } else { + rndVal--; + if (rndVal < 0) + rndVal = 3; + } + } + } } - if (found) - return; + handlePlayer01Discard(1); +} - tmpVal = subC2781(0); - if (tmpVal != -1) { - if ( (_arrunkObj1337[1]._arr1[0]._field34 != 0) - || (_arrunkObj1337[1]._arr1[1]._field34 != 0) - || (_arrunkObj1337[1]._arr1[2]._field34 != 0) - || (_arrunkObj1337[1]._arr1[3]._field34 != 0) ) { - subC318B(0, &_arrunkObj1337[0]._arr1[tmpVal], 1); - found = true; +void Scene1337::handlePlayer3() { + if (_gameBoardSide[3]._delayCard._cardId != 0) { + switch (_gameBoardSide[3]._delayCard._cardId) { + case 10: + // No break on purpose + case 12: + // No break on purpose + case 15: + // No break on purpose + case 17: + // No break on purpose + case 18: + // No break on purpose + case 19: + // No break on purpose + case 20: + // No break on purpose + case 21: + discardCard(&_gameBoardSide[3]._delayCard); + return; + default: + for (int i = 0; i <= 3; i++) { + if (checkAntiDelayCard(_gameBoardSide[3]._delayCard._cardId, _gameBoardSide[3]._handCard[i]._cardId)) { + playAntiDelayCard(&_gameBoardSide[3]._handCard[i], &_gameBoardSide[3]._delayCard); + return; + } + } + break; } } - if (found) - return; + int randIndx = R2_GLOBALS._randomSource.getRandomNumber(3); - for (int i = 0; i <= 3; i++) { - tmpVal = subC27F9(_arrunkObj1337[0]._arr1[i]._field34); - if (tmpVal != -1) { - // The variable 'j' is not used in the inner code of the loop. It's suspect. - for (int j = 0; j <= 7; j++) { - if ((_arrunkObj1337[1]._arr3[0]._field34 == 0) && (subC32B1(1, _arrunkObj1337[0]._arr1[i]._field34))) { - subC3456(&_arrunkObj1337[0]._arr1[i], &_arrunkObj1337[1]._arr3[0]); - found = true; - } + if (_gameBoardSide[3]._handCard[randIndx]._cardId == 1) { + for (int i = 0; i <= 7; i++) { + if ((_gameBoardSide[3]._outpostStation[i]._cardId == 0) && !isStopConstructionCard(_gameBoardSide[3]._delayCard._cardId)) { + playPlatformCard(&_gameBoardSide[3]._handCard[randIndx], &_gameBoardSide[3]._outpostStation[i]); + return; } + } + } else if (_gameBoardSide[3]._handCard[randIndx]._cardId <= 9) { + for (int i = 0; i <= 7; i++) { + if (_gameBoardSide[3]._outpostStation[i]._cardId == _gameBoardSide[3]._handCard[randIndx]._cardId) { + discardCard(&_gameBoardSide[3]._handCard[randIndx]); + return; + } + } - if (!found) { - // The variable 'j' is not used in the inner code of the loop. It's suspect. + for (int i = 0; i <= 7; i++) { + if ((_gameBoardSide[3]._outpostStation[i]._cardId == 1) && !isStopConstructionCard(_gameBoardSide[3]._delayCard._cardId)) { + int stationCount = 0; for (int j = 0; j <= 7; j++) { - if ((_arrunkObj1337[3]._arr3[0]._field34 == 0) && (subC32B1(3, _arrunkObj1337[0]._arr1[i]._field34))) { - subC3456(&_arrunkObj1337[0]._arr1[i], &_arrunkObj1337[3]._arr3[0]); - found = true; - } + if ((_gameBoardSide[3]._outpostStation[j]._cardId > 1) && (_gameBoardSide[3]._outpostStation[j]._cardId <= 9)) + ++stationCount; } - } - if (found) - break; + if (stationCount == 7) + _winnerId = 3; + + playStationCard(&_gameBoardSide[3]._handCard[randIndx], &_gameBoardSide[3]._outpostStation[i]); + return; + } } - } + } else if (_gameBoardSide[3]._handCard[randIndx]._cardId == 13) { + int victimId = getPlayerWithOutpost(3); - if (found) - return; + if (victimId != -1) { + playCounterTrickCard(&_gameBoardSide[3]._handCard[randIndx], victimId); + return; + } + } else if (_gameBoardSide[3]._handCard[randIndx]._cardId == 25) { + int victimId = -1; + int tmpRandIndx = R2_GLOBALS._randomSource.getRandomNumber(3); - for (int i = 0; i <= 3; i++) { - tmpVal = subC27B5(_arrunkObj1337[0]._arr1[i]._field34); - if (tmpVal != -1) { - // The variable 'j' is not used in the inner code of the loop. It's suspect. - for (int j = 0; j <= 7; j++) { - if ((_arrunkObj1337[1]._arr3[0]._field34 == 0) && (subC32B1(1, _arrunkObj1337[0]._arr1[i]._field34))) { - subC3456(&_arrunkObj1337[0]._arr1[i], &_arrunkObj1337[1]._arr3[0]); - found = true; - } + for (int i = 0; i <= 3; i++) { + if ( (tmpRandIndx != 3) + && ( (_gameBoardSide[tmpRandIndx]._handCard[0]._cardId != 0) + || (_gameBoardSide[tmpRandIndx]._handCard[1]._cardId != 0) + || (_gameBoardSide[tmpRandIndx]._handCard[2]._cardId != 0) + || (_gameBoardSide[tmpRandIndx]._handCard[3]._cardId != 0) )) { + victimId = tmpRandIndx; + break; } - if (!found) { - // The variable 'j' is not used in the inner code of the loop. It's suspect. - for (int j = 0; j <= 7; j++) { - if ((_arrunkObj1337[3]._arr3[0]._field34 == 0) && (subC32B1(3, _arrunkObj1337[0]._arr1[i]._field34))) { - subC3456(&_arrunkObj1337[0]._arr1[i], &_arrunkObj1337[3]._arr3[0]); - found = true; - } + ++tmpRandIndx; + if (tmpRandIndx > 3) + tmpRandIndx = 0; + } + + if (victimId != -1) { + playThieftCard(3, &_gameBoardSide[3]._handCard[randIndx], victimId); + return; + } + } else { + switch (_gameBoardSide[3]._handCard[randIndx]._cardId) { + case 10: + // No break on purpose + case 11: + // No break on purpose + case 12: + // No break on purpose + case 14: + // No break on purpose + case 15: + // No break on purpose + case 16: + // No break on purpose + case 17: + // No break on purpose + case 18: + // No break on purpose + case 19: + // No break on purpose + case 20: + // No break on purpose + case 21: + // No break on purpose + case 24: { + int victimId = -1; + int tmpRandIndx = R2_GLOBALS._randomSource.getRandomNumber(3); + + for (int i = 0; i <= 3; i++) { + if (tmpRandIndx != 3) { + if ((_gameBoardSide[tmpRandIndx]._delayCard._cardId == 0) + && isAttackPossible(tmpRandIndx, _gameBoardSide[3]._handCard[randIndx]._cardId)) + victimId = tmpRandIndx; } + + ++tmpRandIndx; + if (tmpRandIndx > 3) + tmpRandIndx = 0; + + if (victimId != -1) + break; } - if (found) - break; + if (victimId != -1) { + // Useless second identical check skipped + playDelayCard(&_gameBoardSide[3]._handCard[randIndx], &_gameBoardSide[victimId]._delayCard); + return; + } + } + default: + break; } } - if (found) - return; - - subC2835(0); -} - -void Scene1337::subD026D() { - subD02CA(); + discardCard(&_gameBoardSide[3]._handCard[randIndx]); } -void Scene1337::subD0281() { - if (subC27F9(this->_arrunkObj1337[2]._arr3[0]._field34) == -1) - _unkFctPtr412 = &Scene1337::subD026D; +void Scene1337::handleAutoplayPlayer2() { + if (getStationCardId(this->_gameBoardSide[2]._delayCard._cardId) == -1) + _delayedFunction = &Scene1337::handlePlayer2; else - subC4A39(&_arrunkObj1337[2]._arr3[0]); + discardCard(&_gameBoardSide[2]._delayCard); } -void Scene1337::subD02CA() { - _item6._field36 = g_globals->_events._mousePos; +void Scene1337::handlePlayer2() { + _selectedCard._stationPos = g_globals->_events._mousePos; if (R2_GLOBALS._v57810 == 200) { - int di; - for (di = 0; di < 4; di++) { - if ((subC2BF8(&_arrunkObj1337[2]._arr1[di], _item6._field36) != 0) && (_arrunkObj1337[2]._arr1[di]._field34 != 0)) { - _item6._field34 = _arrunkObj1337[2]._arr1[di]._field34; - _item6._field36 = _arrunkObj1337[2]._arr1[di]._field36; - // _item6._actorName = _arrunkObj1337[2]._arr1[di]._actorName; - _item6._fieldE = _arrunkObj1337[2]._arr1[di]._fieldE; - _item6._field10 = _arrunkObj1337[2]._arr1[di]._field10; - warning("_item6._field12 = _arrunkObj1337[2]._arr1[di]._field12;"); - warning("_item6._field14 = _arrunkObj1337[2]._arr1[di]._field14;"); - warning("_item6._field16 = _arrunkObj1337[2]._arr1[di]._field16;"); - _item6._sceneRegionId = _arrunkObj1337[2]._arr1[di]._sceneRegionId; - _item6._position = _arrunkObj1337[2]._arr1[di]._position; - _item6._yDiff = _arrunkObj1337[2]._arr1[di]._yDiff; - _item6._bounds = _arrunkObj1337[2]._arr1[di]._bounds; - _item6._resNum = _arrunkObj1337[2]._arr1[di]._resNum; - _item6._lookLineNum = _arrunkObj1337[2]._arr1[di]._lookLineNum; - _item6._talkLineNum = _arrunkObj1337[2]._arr1[di]._talkLineNum; - _item6._useLineNum = _arrunkObj1337[2]._arr1[di]._useLineNum; - _item6._action = _arrunkObj1337[2]._arr1[di]._action; - warning("_item6._field0 = _arrunkObj1337[2]._arr1[di]._field0;"); - _item6._object1._updateStartFrame = _arrunkObj1337[2]._arr1[di]._object1._updateStartFrame; - _item6._object1._walkStartFrame = _arrunkObj1337[2]._arr1[di]._object1._walkStartFrame; + // Hand + int i; + for (i = 0; i < 4; i++) { + if ((_gameBoardSide[2]._handCard[i].isIn(_selectedCard._stationPos)) && (_gameBoardSide[2]._handCard[i]._cardId != 0)) { + Card *handcard = &_gameBoardSide[2]._handCard[i]; + _selectedCard._cardId = handcard->_cardId; + _selectedCard._stationPos = handcard->_stationPos; + //warning("_selectedCard._actorName = handcard->_actorName;"); + //warning("_selectedCard._fieldE = handcard->_fieldE;"); + //warning("_selectedCard._field10 = handcard->_field10;"); + //warning("_selectedCard._field12 = handcard->_field12;"); + //warning("_selectedCard._field14 = handcard->_field14;"); + //warning("_selectedCard._field16 = handcard->_field16;"); + _selectedCard._sceneRegionId = handcard->_sceneRegionId; + _selectedCard._position = handcard->_position; + _selectedCard._yDiff = handcard->_yDiff; + _selectedCard._bounds = handcard->_bounds; + _selectedCard._resNum = handcard->_resNum; + _selectedCard._lookLineNum = handcard->_lookLineNum; + _selectedCard._talkLineNum = handcard->_talkLineNum; + _selectedCard._useLineNum = handcard->_useLineNum; + _selectedCard._action = handcard->_action; + //warning("_selectedCard._field0 = handcard->_field0;"); + _selectedCard._card._updateStartFrame = handcard->_card._updateStartFrame; + _selectedCard._card._walkStartFrame = handcard->_card._walkStartFrame; // _field2E is named _field3C in R2R - _item6._object1._field2E = _arrunkObj1337[2]._arr1[di]._object1._field2E; - _item6._object1._percent = _arrunkObj1337[2]._arr1[di]._object1._percent; - _item6._object1._priority = _arrunkObj1337[2]._arr1[di]._object1._priority; - _item6._object1._angle = _arrunkObj1337[2]._arr1[di]._object1._angle; - _item6._object1._flags = _arrunkObj1337[2]._arr1[di]._object1._flags; - _item6._object1._xe = _arrunkObj1337[2]._arr1[di]._object1._xe; - _item6._object1._xs = _arrunkObj1337[2]._arr1[di]._object1._xs; - _item6._object1._paneRects[0] = _arrunkObj1337[2]._arr1[di]._object1._paneRects[0]; - _item6._object1._paneRects[1] = _arrunkObj1337[2]._arr1[di]._object1._paneRects[1]; - _item6._object1._visage = _arrunkObj1337[2]._arr1[di]._object1._visage; - _item6._object1._objectWrapper = _arrunkObj1337[2]._arr1[di]._object1._objectWrapper; - _item6._object1._strip = _arrunkObj1337[2]._arr1[di]._object1._strip; - _item6._object1._animateMode = _arrunkObj1337[2]._arr1[di]._object1._animateMode; - _item6._object1._frame = _arrunkObj1337[2]._arr1[di]._object1._frame; - _item6._object1._endFrame = _arrunkObj1337[2]._arr1[di]._object1._endFrame; + _selectedCard._card._oldPosition = handcard->_card._oldPosition; + _selectedCard._card._percent = handcard->_card._percent; + _selectedCard._card._priority = handcard->_card._priority; + _selectedCard._card._angle = handcard->_card._angle; + _selectedCard._card._flags = handcard->_card._flags; + _selectedCard._card._xe = handcard->_card._xe; + _selectedCard._card._xs = handcard->_card._xs; + _selectedCard._card._paneRects[0] = handcard->_card._paneRects[0]; + _selectedCard._card._paneRects[1] = handcard->_card._paneRects[1]; + _selectedCard._card._visage = handcard->_card._visage; + _selectedCard._card._objectWrapper = handcard->_card._objectWrapper; + _selectedCard._card._strip = handcard->_card._strip; + _selectedCard._card._animateMode = handcard->_card._animateMode; + _selectedCard._card._frame = handcard->_card._frame; + _selectedCard._card._endFrame = handcard->_card._endFrame; // _field68 is named _field76 in R2R - _item6._object1._field68 = _arrunkObj1337[2]._arr1[di]._object1._field68; - _item6._object1._frameChange = _arrunkObj1337[2]._arr1[di]._object1._frameChange; - _item6._object1._numFrames = _arrunkObj1337[2]._arr1[di]._object1._numFrames; - _item6._object1._regionIndex = _arrunkObj1337[2]._arr1[di]._object1._regionIndex; - _item6._object1._mover = _arrunkObj1337[2]._arr1[di]._object1._mover; - _item6._object1._moveDiff = _arrunkObj1337[2]._arr1[di]._object1._moveDiff; - _item6._object1._moveRate = _arrunkObj1337[2]._arr1[di]._object1._moveRate; - _item6._object1._field8A = _arrunkObj1337[2]._arr1[di]._object1._field8A; - _item6._object1._endAction = _arrunkObj1337[2]._arr1[di]._object1._endAction; - _item6._object1._regionBitList = _arrunkObj1337[2]._arr1[di]._object1._regionBitList; - // _item6._object1._actorName = _arrunkObj1337[2]._arr1[di]._object1._actorName; - _item6._object1._fieldE = _arrunkObj1337[2]._arr1[di]._object1._fieldE; - _item6._object1._field10 = _arrunkObj1337[2]._arr1[di]._object1._field10; - warning("_item6._object1._field12 = _arrunkObj1337[2]._arr1[di]._object1._field12;"); - warning("_item6._object1._field14 = _arrunkObj1337[2]._arr1[di]._object1._field14;"); - warning("_item6._object1._field16 = _arrunkObj1337[2]._arr1[di]._object1._field16;"); - _item6._object1 = _arrunkObj1337[2]._arr1[di]._object1; - } - } - - if (di == 4) { - subCDB90(1, _item6._field36); - subD0281(); + _selectedCard._card._loopCount = handcard->_card._loopCount; + _selectedCard._card._frameChange = handcard->_card._frameChange; + _selectedCard._card._numFrames = handcard->_card._numFrames; + _selectedCard._card._regionIndex = handcard->_card._regionIndex; + _selectedCard._card._mover = handcard->_card._mover; + _selectedCard._card._moveDiff = handcard->_card._moveDiff; + _selectedCard._card._moveRate = handcard->_card._moveRate; + _selectedCard._card._actorDestPos = handcard->_card._actorDestPos; + _selectedCard._card._endAction = handcard->_card._endAction; + _selectedCard._card._regionBitList = handcard->_card._regionBitList; + // _selectedCard._object1._actorName = handcard->_object1._actorName; + //warning("_selectedCard._card._fieldE = handcard->_card._fieldE;"); + //warning("_selectedCard._card._field10 = handcard->_card._field10;"); + //warning("_selectedCard._card._field12 = handcard->_card._field12;"); + //warning("_selectedCard._card._field14 = handcard->_card._field14;"); + //warning("_selectedCard._card._field16 = handcard->_card._field16;"); + + _gameBoardSide[2]._handCard[i]._cardId = 0; + _gameBoardSide[2]._handCard[i]._card.remove(); + break; + } + } + + if (i == 4) { + handleClick(1, _selectedCard._stationPos); + handleAutoplayPlayer2(); return; + } else { + setCursorData(1332, _selectedCard._card._strip, _selectedCard._card._frame); + R2_GLOBALS._sceneObjects->draw(); } } else if (R2_GLOBALS._v57810 == 300) { - subCDB90(3, _item6._field36); - subD0281(); + // Eye + handleClick(3, _selectedCard._stationPos); + handleAutoplayPlayer2(); return; } else { - subD1A48(R2_GLOBALS._v57810); - subD0281(); + // The original code is calling a function full of dead code. + // Only this message remains after a cleanup. + MessageDialog::show(WRONG_ANSWER_MSG, OK_BTN_STRING); + // + handleAutoplayPlayer2(); return; } - // That continues the block when R2_GLOBALS._v57810 == 200 and di != 4 - subD18B5(1332, _item6._object1._strip, _item6._object1._frame); - R2_GLOBALS._sceneObjects->draw(); Event event; - bool found = false; - bool found_di; + bool found; for (;;) { if ( ((g_globals->_events.getEvent(event, EVENT_BUTTON_DOWN)) && (event.btnState == BTNSHIFT_RIGHT)) || (g_globals->_events.getEvent(event, EVENT_KEYPRESS)) ){ - _item6._field36 = g_globals->_events._mousePos; - found_di = false; + _selectedCard._stationPos = g_globals->_events._mousePos; + found = false; for (int i = 0; i <= 3; i ++) { - if (subC2BF8(&_arrunkObj1337[2]._arr1[i], Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) { - if (_arrunkObj1337[2]._arr1[i]._field34 == 0) { - _arrunkObj1337[2]._arr1[i]._field34 = _item6._field34; - _arrunkObj1337[2]._arr1[i]._object1.postInit(); - _arrunkObj1337[2]._arr1[i]._object1.hide(); - _arrunkObj1337[2]._arr1[i]._object1.setVisage(1332); - _arrunkObj1337[2]._arr1[i]._object1.setPosition(_arrunkObj1337[2]._arr1[i]._field36, 0); - _arrunkObj1337[2]._arr1[i]._object1.fixPriority(170); - setAnimationInfo(&_arrunkObj1337[2]._arr1[i]); - subD18B5(5, 1, 4); - found = true; - _field423E--; - _field4244 = 0; - subC20F9(); + if (_gameBoardSide[2]._handCard[i].isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { + if (_gameBoardSide[2]._handCard[i]._cardId == 0) { + _gameBoardSide[2]._handCard[i]._cardId = _selectedCard._cardId; + _gameBoardSide[2]._handCard[i]._card.postInit(); + _gameBoardSide[2]._handCard[i]._card.hide(); + _gameBoardSide[2]._handCard[i]._card.setVisage(1332); + _gameBoardSide[2]._handCard[i]._card.setPosition(_gameBoardSide[2]._handCard[i]._stationPos, 0); + _gameBoardSide[2]._handCard[i]._card.fixPriority(170); + setAnimationInfo(&_gameBoardSide[2]._handCard[i]); + setCursorData(5, 1, 4); + _currentPlayerNumb--; + _showPlayerTurn = false; + handleNextTurn(); + return; } else { actionDisplay(1330, 127, 159, 10, 1, 200, 0, 7, 0, 154, 154); - found_di = true; + found = true; } break; } } - if ((!found) && (!found_di)) { - if (subC2BF8(&_item7, Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) { - subC4A39(&_item6); - } else if (!found) { - bool foundVar4; + if (!found) { + if (_discardPile.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { + discardCard(&_selectedCard); + return; + } else if (_selectedCard._cardId == 1) { + bool isInCardFl = false; int i; - if (_item6._field34 == 1) { - foundVar4 = false; - for (i = 0; i <= 7; i++) { - if (subC2BF8(&_arrunkObj1337[2]._arr2[i], Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) { - foundVar4 = true; - break; - } + for (i = 0; i <= 7; i++) { + if (_gameBoardSide[2]._outpostStation[i].isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { + isInCardFl = true; + break; } + } - if ((foundVar4) && (_arrunkObj1337[2]._arr2[i]._field34 == 0)) { - if (subC27B5(_arrunkObj1337[2]._arr3[0]._field34) != -1) { - actionDisplay(1330, 55, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else { - subC340B(&_item6, &_arrunkObj1337[2]._arr2[i]); - return; - } + if ((isInCardFl) && (_gameBoardSide[2]._outpostStation[i]._cardId == 0)) { + if (isDelayCard(_gameBoardSide[2]._delayCard._cardId) != -1) { + actionDisplay(1330, 55, 159, 10, 1, 200, 0, 7, 0, 154, 154); } else { - actionDisplay(1330, 56, 159, 10, 1, 200, 0, 7, 0, 154, 154); + playPlatformCard(&_selectedCard, &_gameBoardSide[2]._outpostStation[i]); + return; + } + } else { + actionDisplay(1330, 56, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } + } else if (_selectedCard._cardId <= 9) { + bool isInCardFl = false; + int i; + for (i = 0; i <= 7; i++) { + if (_gameBoardSide[2]._outpostStation[i].isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { + isInCardFl = true; + break; } - } else if (_item6._field34 <= 9) { - foundVar4 = false; - for (i = 0; i <= 7; i++) { - if (subC2BF8(&_arrunkObj1337[2]._arr2[i], Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) { - foundVar4 = true; + } + if ((isInCardFl) && (_gameBoardSide[2]._outpostStation[i]._cardId == 1)) { + isInCardFl = false; + for (int j = 0; j <= 7; j++) { + if (_selectedCard._cardId == _gameBoardSide[2]._outpostStation[j]._cardId) { + isInCardFl = true; break; } } - if ((foundVar4) && (_arrunkObj1337[2]._arr2[i]._field34 == 1)) { - foundVar4 = false; - int j; - for (j = 0; j <= 7; j++) { - if (_item6._field34 == _arrunkObj1337[2]._arr2[j]._field34) { - foundVar4 = true; - break; - } + if (isInCardFl) { + // This station is already in place + actionDisplay(1330, 34, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } else if (isDelayCard(_gameBoardSide[2]._delayCard._cardId) != -1) { + // You must eliminate your delay before you can play a station + actionDisplay(1330, 35, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } else { + int stationCount = 0; + for (int k = 0; k <= 7; k++) { + if ((_gameBoardSide[2]._outpostStation[k]._cardId > 1) && (_gameBoardSide[2]._outpostStation[k]._cardId <= 9)) + ++stationCount; } - if (foundVar4) { - actionDisplay(1330, 34, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else if (subC27B5(_arrunkObj1337[2]._arr3[0]._field34) != -1) { - actionDisplay(1330, 35, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else { - if (j == 7) - _field424A = 2; - subC33C0(&_item6, &_arrunkObj1337[2]._arr2[i]); - return; + if (stationCount == 7) + _winnerId = 2; + + playStationCard(&_selectedCard, &_gameBoardSide[2]._outpostStation[i]); + return; + } + } else { + actionDisplay(1330, 37, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } + } else if ((_selectedCard._cardId == 26) || (_selectedCard._cardId == 30) ||(_selectedCard._cardId == 32) || (_selectedCard._cardId == 28)) { + // Check anti-delay card + if (_gameBoardSide[2]._delayCard.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { + actionDisplay(1330, 42, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } else if (checkAntiDelayCard(_gameBoardSide[2]._delayCard._cardId, _selectedCard._cardId)) { + playAntiDelayCard(&_selectedCard, &_gameBoardSide[2]._delayCard); + return; + } else { + if (_gameBoardSide[2]._delayCard._cardId != 0) { + switch (_gameBoardSide[2]._delayCard._cardId) { + case 11: + actionDisplay(1330, 68, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 14: + actionDisplay(1330, 80, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 16: + actionDisplay(1330, 84, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 24: + actionDisplay(1330, 96, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + default: + break; } } else { - actionDisplay(1330, 37, 159, 10, 1, 200, 0, 7, 0, 154, 154); + actionDisplay(1330, 41, 159, 10, 1, 200, 0, 7, 0, 154, 154); } - } else { - if ((_item6._field34 == 26) || (_item6._field34 == 30) ||(_item6._field34 == 32) || (_item6._field34 == 28)) { - if (subC2BF8(&_arrunkObj1337[2]._arr3[0], Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) { - actionDisplay(1330, 42, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else if (!subC3386(_arrunkObj1337[2]._arr3[0]._field34, _item6._field34)) { - if (_arrunkObj1337[2]._arr3[0]._field34 != 0) { - switch (_arrunkObj1337[2]._arr3[0]._field34) { - case 11: - actionDisplay(1330, 68, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 14: - actionDisplay(1330, 80, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 16: - actionDisplay(1330, 84, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 24: - actionDisplay(1330, 96, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - default: - break; - } - } else { - actionDisplay(1330, 41, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } + } else if ((getStationCardId(_selectedCard._cardId) == -1) && (isDelayCard(_selectedCard._cardId) == -1)) { + if (_selectedCard._cardId == 13) { + if (_gameBoardSide[0]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { + for (int k = 0; k <= 7; k++) { + if (_gameBoardSide[0]._outpostStation[k]._cardId != 0) { + playCounterTrickCard(&_selectedCard, 0); + return; } - } else { - subC34A1(&_item6, &_arrunkObj1337[2]._arr3[0]); - return; } + actionDisplay(1330, 74, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } else if (_gameBoardSide[3]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { + for (int k = 0; k <= 7; k++) { + if (_gameBoardSide[3]._outpostStation[k]._cardId != 0) { + playCounterTrickCard(&_selectedCard, 3); + return; + } + } + actionDisplay(1330, 74, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } else if (_gameBoardSide[1]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { + for (int k = 0; k <= 7; k++) { + if (_gameBoardSide[1]._outpostStation[k]._cardId == 0) { + playCounterTrickCard(&_selectedCard, 1); + return; + } + } + actionDisplay(1330, 74, 159, 10, 1, 200, 0, 7, 0, 154, 154); } else { - if ((subC27F9(_item6._field34) == -1) && (subC27B5(_item6._field34) == -1)) { - if (_item6._field34 == 13) { - if (subC2BF8(&_arrunkObj1337[0]._arr4[0], Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) { - for (int k = 0; k <= 7; k++) { - if (_arrunkObj1337[0]._arr2[k]._field34 != 0) { - found = true; - subC358E(&_item6, 0); - } - } - - if (!found) - actionDisplay(1330, 74, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else if (subC2BF8(&_arrunkObj1337[3]._arr4[0], Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) { - for (int k = 0; k <= 7; k++) { - if (_arrunkObj1337[3]._arr2[k]._field34 != 0) { - found = true; - subC358E(&_item6, 3); - } - } - if (!found) - actionDisplay(1330, 74, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else if (subC2BF8(&_arrunkObj1337[1]._arr4[0], Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) { - for (int k = 0; k <= 7; k++) { - if (_arrunkObj1337[1]._arr2[k]._field34 == 0) { - found = true; - subC358E(&_item6, 1); - } - } - if (!found) - actionDisplay(1330, 74, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else { - actionDisplay(1330, 128, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } - } else if (_item6._field34 == 25) { + actionDisplay(1330, 128, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } + } else if (_selectedCard._cardId == 25) { + if (_gameBoardSide[0]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { + if ( (_gameBoardSide[0]._handCard[0]._cardId != 0) + || (_gameBoardSide[0]._handCard[1]._cardId != 0) + || (_gameBoardSide[0]._handCard[2]._cardId != 0) + || (_gameBoardSide[0]._handCard[3]._cardId != 0) ) { int k; - if (subC2BF8(&_arrunkObj1337[0]._arr4[0], Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) { - if ( (_arrunkObj1337[0]._arr1[0]._field34 != 0) - || (_arrunkObj1337[0]._arr1[1]._field34 != 0) - || (_arrunkObj1337[0]._arr1[2]._field34 != 0) - || (_arrunkObj1337[0]._arr1[3]._field34 != 0) ) { - for (k = 0; k <= 3; k++){ - if (_arrunkObj1337[2]._arr1[k]._field34 == 0) - break; - } - subC318B(2, &_arrunkObj1337[2]._arr1[k], 0); - return; - } else { - actionDisplay(1330, 99, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } - } else if (subC2BF8(&_arrunkObj1337[1]._arr4[0], Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) { - if ( (_arrunkObj1337[1]._arr1[0]._field34 != 0) - || (_arrunkObj1337[1]._arr1[1]._field34 != 0) - || (_arrunkObj1337[1]._arr1[2]._field34 != 0) - || (_arrunkObj1337[1]._arr1[3]._field34 != 0) ) { - for (k = 0; k <= 3; k++){ - if (_arrunkObj1337[2]._arr1[k]._field34 == 0) - break; - } - subC318B(2, &_arrunkObj1337[2]._arr1[k], 1); - return; - } else { - actionDisplay(1330, 99, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } - } - - if (subC2BF8(&_arrunkObj1337[3]._arr4[0], Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) { - if ( (_arrunkObj1337[3]._arr1[0]._field34 != 0) - || (_arrunkObj1337[3]._arr1[1]._field34 != 0) - || (_arrunkObj1337[3]._arr1[2]._field34 != 0) - || (_arrunkObj1337[3]._arr1[3]._field34 != 0) ) { - for (k = 0; k <= 3; k++){ - if (_arrunkObj1337[2]._arr1[k]._field34 == 0) - break; - } - subC318B(2, &_arrunkObj1337[2]._arr1[k], 3); - return; - } else { - actionDisplay(1330, 99, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } - } else { - actionDisplay(1330, 129, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } - } else if (_item6._field34 == 29) { - actionDisplay(1330, 136, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else if (_item6._field34 == 27) { - actionDisplay(1330, 137, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } - } else { - if (subC2BF8(&_arrunkObj1337[0]._arr3[0], Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) { - if (_arrunkObj1337[0]._arr3[0]._field34 != 0) { - actionDisplay(1330, 15, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else if (!subC32B1(0, _item6._field34)) { - switch (_item6._field34) { - case 10: - actionDisplay(1330, 66, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 12: - actionDisplay(1330, 70, 159, 10, 1, 200, 0, 7, 0, 154, 154); + for (k = 0; k <= 3; k++){ + if (_gameBoardSide[2]._handCard[k]._cardId == 0) break; - case 15: - actionDisplay(1330, 82, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 17: - actionDisplay(1330, 86, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 18: - actionDisplay(1330, 88, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 19: - actionDisplay(1330, 90, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 20: - actionDisplay(1330, 92, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 21: - actionDisplay(1330, 94, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - default: - break; - } - } else { - subC3456(&_item6, &_arrunkObj1337[0]._arr3[0]); - found = true; } - } else if (subC2BF8(&_arrunkObj1337[3]._arr3[0], Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) { - if (_arrunkObj1337[3]._arr3[0]._field34 != 0) { - actionDisplay(1330, 17, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else if (!subC32B1(3, _item6._field34)) { - switch (_item6._field34) { - case 10: - actionDisplay(1330, 66, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 12: - actionDisplay(1330, 70, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 15: - actionDisplay(1330, 82, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 17: - actionDisplay(1330, 86, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 18: - actionDisplay(1330, 88, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 19: - actionDisplay(1330, 90, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 20: - actionDisplay(1330, 92, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 21: - actionDisplay(1330, 94, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - default: + playThieftCard(2, &_gameBoardSide[2]._handCard[k], 0); + return; + } else { + actionDisplay(1330, 99, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } + } else if (_gameBoardSide[1]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { + if ( (_gameBoardSide[1]._handCard[0]._cardId != 0) + || (_gameBoardSide[1]._handCard[1]._cardId != 0) + || (_gameBoardSide[1]._handCard[2]._cardId != 0) + || (_gameBoardSide[1]._handCard[3]._cardId != 0) ) { + int k; + for (k = 0; k <= 3; k++){ + if (_gameBoardSide[2]._handCard[k]._cardId == 0) break; - } - } else { - subC3456(&_item6, &_arrunkObj1337[3]._arr3[0]); - found = true; } - } else if (subC2BF8(&_arrunkObj1337[1]._arr3[0], Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) { - if (_arrunkObj1337[1]._arr3[0]._field34 != 0) { - actionDisplay(1330, 19, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } else if (!subC32B1(1, _item6._field34)) { - switch (_item6._field34) { - case 10: - actionDisplay(1330, 66, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 12: - actionDisplay(1330, 70, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 15: - actionDisplay(1330, 82, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 17: - actionDisplay(1330, 86, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 18: - actionDisplay(1330, 88, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 19: - actionDisplay(1330, 90, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 20: - actionDisplay(1330, 92, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - case 21: - actionDisplay(1330, 94, 159, 10, 1, 200, 0, 7, 0, 154, 154); - break; - default: + playThieftCard(2, &_gameBoardSide[2]._handCard[k], 1); + return; + } else { + actionDisplay(1330, 99, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } + } + + if (_gameBoardSide[3]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { + if ( (_gameBoardSide[3]._handCard[0]._cardId != 0) + || (_gameBoardSide[3]._handCard[1]._cardId != 0) + || (_gameBoardSide[3]._handCard[2]._cardId != 0) + || (_gameBoardSide[3]._handCard[3]._cardId != 0) ) { + int k; + for (k = 0; k <= 3; k++){ + if (_gameBoardSide[2]._handCard[k]._cardId == 0) break; - } - } else { - subC3456(&_item6, &_arrunkObj1337[1]._arr3[0]); - found = true; } - } else { - actionDisplay(1330, 38, 159, 10, 1, 200, 0, 7, 0, 154, 154); - } + playThieftCard(2, &_gameBoardSide[2]._handCard[k], 3); + return; + } else { + actionDisplay(1330, 99, 159, 10, 1, 200, 0, 7, 0, 154, 154); } + } else { + actionDisplay(1330, 129, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } + } else if (_selectedCard._cardId == 29) { + // Interceptor cards are used to prevent collision + actionDisplay(1330, 136, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } else if (_selectedCard._cardId == 27) { + actionDisplay(1330, 137, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } + } else if (_gameBoardSide[0]._delayCard.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { + if (_gameBoardSide[0]._delayCard._cardId != 0) { + actionDisplay(1330, 15, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } else if (!isAttackPossible(0, _selectedCard._cardId)) { + switch (_selectedCard._cardId) { + case 10: + actionDisplay(1330, 66, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 12: + actionDisplay(1330, 70, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 15: + actionDisplay(1330, 82, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 17: + actionDisplay(1330, 86, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 18: + actionDisplay(1330, 88, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 19: + actionDisplay(1330, 90, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 20: + actionDisplay(1330, 92, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 21: + actionDisplay(1330, 94, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + default: + break; + } + } else { + playDelayCard(&_selectedCard, &_gameBoardSide[0]._delayCard); + return; + } + } else if (_gameBoardSide[3]._delayCard.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { + if (_gameBoardSide[3]._delayCard._cardId != 0) { + actionDisplay(1330, 17, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } else if (!isAttackPossible(3, _selectedCard._cardId)) { + switch (_selectedCard._cardId) { + case 10: + actionDisplay(1330, 66, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 12: + actionDisplay(1330, 70, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 15: + actionDisplay(1330, 82, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 17: + actionDisplay(1330, 86, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 18: + actionDisplay(1330, 88, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 19: + actionDisplay(1330, 90, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 20: + actionDisplay(1330, 92, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 21: + actionDisplay(1330, 94, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + default: + break; } + } else { + playDelayCard(&_selectedCard, &_gameBoardSide[3]._delayCard); + return; } + } else if (_gameBoardSide[1]._delayCard.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) { + if (_gameBoardSide[1]._delayCard._cardId != 0) { + actionDisplay(1330, 19, 159, 10, 1, 200, 0, 7, 0, 154, 154); + } else if (!isAttackPossible(1, _selectedCard._cardId)) { + switch (_selectedCard._cardId) { + case 10: + actionDisplay(1330, 66, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 12: + actionDisplay(1330, 70, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 15: + actionDisplay(1330, 82, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 17: + actionDisplay(1330, 86, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 18: + actionDisplay(1330, 88, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 19: + actionDisplay(1330, 90, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 20: + actionDisplay(1330, 92, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + case 21: + actionDisplay(1330, 94, 159, 10, 1, 200, 0, 7, 0, 154, 154); + break; + default: + break; + } + } else { + playDelayCard(&_selectedCard, &_gameBoardSide[1]._delayCard); + return; + } + } else { + actionDisplay(1330, 38, 159, 10, 1, 200, 0, 7, 0, 154, 154); } } - - if (found) - return; } else { g_globals->_scenePalette.signalListeners(); R2_GLOBALS._sceneObjects->draw(); g_globals->_events.delay(g_globals->_sceneHandler->_delayTicks); } + + g_globals->_sceneObjects->recurse(SceneHandler::dispatchObject); } } -void Scene1337::subD183F(int arg1, int arg2) { +void Scene1337::updateCursorId(int cursorId, bool updateFl) { if ((R2_GLOBALS._v57709 != 0) || (R2_GLOBALS._v5780C != 0)) return; - R2_GLOBALS._v5780E = arg1 + arg2; + R2_GLOBALS._mouseCursorId = cursorId; + + if (updateFl) { + R2_GLOBALS._mouseCursorId++; - if (arg2 != 0) { - if (R2_GLOBALS._v5780E < 1) - R2_GLOBALS._v5780E = 2; + if (R2_GLOBALS._mouseCursorId < 1) + R2_GLOBALS._mouseCursorId = 2; - if (R2_GLOBALS._v5780E > 2) - R2_GLOBALS._v5780E = 1; + if (R2_GLOBALS._mouseCursorId > 2) + R2_GLOBALS._mouseCursorId = 1; } - if (R2_GLOBALS._v5780E == 1) { + // The original was using an intermediate function to call setCursorData. + // It has been removed to improve readability + if (R2_GLOBALS._mouseCursorId == 1) { R2_GLOBALS._v57810 = 200; - subD195F(1, 4); - } else if (R2_GLOBALS._v5780E == 2) { + setCursorData(5, 1, 4); + } else if (R2_GLOBALS._mouseCursorId == 2) { R2_GLOBALS._v57810 = 300; - subD195F(1, 5); + setCursorData(5, 1, 5); } else { R2_GLOBALS._v57810 = 0; - subD195F(0, 0); + setCursorData(5, 0, 0); } } -void Scene1337::subD18B5(int resNum, int rlbNum, int arg3) { - warning("STUBBED lvl3 Scene1337::subD18B5()"); +void Scene1337::setCursorData(int resNum, int rlbNum, int frameNum) { + _cursorCurRes = resNum; + _cursorCurStrip = rlbNum; + _cursorCurFrame = frameNum; + + if (!frameNum) { + // Should be a hardcoded cursor displaying only a dot. + // FIXME: Use another cursor when possible + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + } else { + // TODO: The original was using some ressource caching, which was useless and complex + // and which has been removed. This cursor behavior clearly made intensive use of this caching... + // We now have to find a way to cache these cursor pointers and avoid loading them multiple times per seconds + uint size; + byte *cursor = g_resourceManager->getSubResource(resNum, rlbNum, frameNum, &size); + // Decode the cursor + GfxSurface s = surfaceFromRes(cursor); + + Graphics::Surface surface = s.lockSurface(); + const byte *cursorData = (const byte *)surface.getPixels(); + CursorMan.replaceCursor(cursorData, surface.w, surface.h, s._centroid.x, s._centroid.y, s._transColor); + s.unlockSurface(); + + DEALLOCATE(cursor); + } } -int Scene1337::subD18F5() { +void Scene1337::subD18F5() { if (R2_GLOBALS._v57709 == 0) - // The cursor looks... very dummy - // To be checked - warning("TODO: CursorManager.setData(R2_GLOBALS.off_57705)"); + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); ++R2_GLOBALS._v57709; - - return R2_GLOBALS._v57709; } -int Scene1337::subD1917() { +void Scene1337::subD1917() { if (R2_GLOBALS._v57709 != 0) { R2_GLOBALS._v57709--; - if (R2_GLOBALS._v57709 != 0) - warning("FIXME: subD195F(_width, _data);"); + if (R2_GLOBALS._v57709 != 0) { + // The original was using an intermediate function to call setCursorData. + // It has been removed to improve readability + setCursorData(5, _cursorCurStrip, _cursorCurFrame); + } } - - return R2_GLOBALS._v57709; } -int Scene1337::subD1940(bool flag) { +void Scene1337::subD1940(bool flag) { if (flag) ++R2_GLOBALS._v5780C; else if (R2_GLOBALS._v5780C != 0) --R2_GLOBALS._v5780C; - - return R2_GLOBALS._v5780C; -} - -void Scene1337::subD195F(int arg1, int arg2) { - subD18B5(5, arg1, arg2); } void Scene1337::subD1975(int arg1, int arg2) { warning("STUBBED lvl2 Scene1337::subD1975()"); } -void Scene1337::subD1A48(int arg1) { - int tmpVal = -1; +void Scene1337::OptionsDialog::show() { + OptionsDialog *dlg = new OptionsDialog(); + dlg->draw(); - switch (arg1) { - case 200: - tmpVal = 141; - break; - case 300: - tmpVal = 142; - break; - default: - MessageDialog::show(WRONG_ANSWER_MSG, OK_BTN_STRING); - break; - } + // Show the dialog + GfxButton *btn = dlg->execute(NULL); - if (tmpVal == -1) - return; + // Figure out the new selected character + if (btn == &dlg->_quitGame) + R2_GLOBALS._sceneManager.changeScene(125); + else if (btn == &dlg->_restartGame) + R2_GLOBALS._sceneManager.changeScene(1330); - actionDisplay(1330, tmpVal, -1, -1, 1, 220, 1, 5, 0, 105, 0); + // Remove the dialog + dlg->remove(); + delete dlg; +} + +Scene1337::OptionsDialog::OptionsDialog() { + // Set the elements text + Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene; + _autoplay.setText(scene->_autoplay ? AUTO_PLAY_ON : AUTO_PLAY_OFF); + _restartGame.setText(START_NEW_CARD_GAME); + _quitGame.setText(QUIT_CARD_GAME); + _continueGame.setText(CONTINUE_CARD_GAME); + + // Set position of the elements + _autoplay._bounds.moveTo(5, 2); + _restartGame._bounds.moveTo(5, _autoplay._bounds.bottom + 2); + _quitGame._bounds.moveTo(5, _restartGame._bounds.bottom + 2); + _continueGame._bounds.moveTo(5, _quitGame._bounds.bottom + 2); + + // Add the items to the dialog + addElements(&_autoplay, &_restartGame, &_quitGame, &_continueGame, NULL); + + // Set the dialog size and position + frame(); + _bounds.collapse(-6, -6); + setCenter(160, 100); +} + +GfxButton *Scene1337::OptionsDialog::execute(GfxButton *defaultButton) { + _gfxManager.activate(); + + // Event loop + GfxButton *selectedButton = NULL; + + bool breakFlag = false; + while (!g_vm->shouldQuit() && !breakFlag) { + Event event; + 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; + + for (GfxElementList::iterator i = _elements.begin(); i != _elements.end(); ++i) { + if ((*i)->process(event)) + selectedButton = static_cast<GfxButton *>(*i); + } + + if (selectedButton == &_autoplay) { + // Toggle Autoplay + selectedButton = NULL; + Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene; + scene->_autoplay = !scene->_autoplay; + + _autoplay.setText(scene->_autoplay ? AUTO_PLAY_ON : AUTO_PLAY_OFF); + _autoplay.draw(); + } else if (selectedButton) { + breakFlag = true; + break; + } else if (!event.handled) { + if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_ESCAPE)) { + selectedButton = NULL; + breakFlag = true; + break; + } + } + } + + g_system->delayMillis(10); + GLOBALS._screenSurface.updateScreen(); + } + + _gfxManager.deactivate(); + return selectedButton; } /*-------------------------------------------------------------------------- @@ -6890,69 +6791,69 @@ void Scene1337::subD1A48(int arg1) { void Scene1500::postInit(SceneObjectList *OwnerList) { loadScene(1500); R2_GLOBALS._uiElements._active = false; - R2_GLOBALS._v5589E.top = 0; - R2_GLOBALS._v5589E.bottom = 200; setZoomPercents(170, 13, 240, 100); SceneExt::postInit(); + R2_GLOBALS._interfaceY = SCREEN_HEIGHT; + scalePalette(65, 65, 65); R2_GLOBALS._player.postInit(); R2_GLOBALS._player.hide(); R2_GLOBALS._player.disableControl(); - _actor2.postInit(); - _actor2.setup(1401, 1, 1); - _actor2._effect = 5; - _actor2.fixPriority(10); - _actor2._field9C = _field312; + _starshipShadow.postInit(); + _starshipShadow.setup(1401, 1, 1); + _starshipShadow._effect = EFFECT_SHADOW_MAP; + _starshipShadow.fixPriority(10); + _starshipShadow._shadowMap = _shadowPaletteMap; - _actor1.postInit(); - _actor1.setup(1400, 1, 1); - _actor1._moveDiff = Common::Point(1, 1); - _actor1._linkedActor = &_actor2; + _starship.postInit(); + _starship.setup(1400, 1, 1); + _starship._moveDiff = Common::Point(1, 1); + _starship._linkedActor = &_starshipShadow; if (R2_GLOBALS._sceneManager._previousScene != 1010) { - _actor4.postInit(); - _actor4.setup(1401, 2, 1); - _actor4._effect = 5; - _actor4.fixPriority(10); - _actor4._field9C = _field312; + _smallShipShadow.postInit(); + _smallShipShadow.setup(1401, 2, 1); + _smallShipShadow._effect = EFFECT_SHADOW_MAP; + _smallShipShadow.fixPriority(10); + _smallShipShadow._shadowMap = _shadowPaletteMap; - _actor3.postInit(); - _actor3._moveRate = 30; - _actor3._moveDiff = Common::Point(1, 1); - _actor3._linkedActor = &_actor4; + _smallShip.postInit(); + _smallShip._moveRate = 30; + _smallShip._moveDiff = Common::Point(1, 1); + _smallShip._linkedActor = &_smallShipShadow; } if (R2_GLOBALS._sceneManager._previousScene == 300) { - _actor1.setPosition(Common::Point(189, 139), 5); + _starship.setPosition(Common::Point(189, 139), 5); - _actor3.setup(1400, 1, 2); - _actor3.setPosition(Common::Point(148, 108), 0); + _smallShip.setup(1400, 1, 2); + _smallShip.setPosition(Common::Point(148, 108), 0); _sceneMode = 20; R2_GLOBALS._sound1.play(110); } else if (R2_GLOBALS._sceneManager._previousScene == 1550) { - _actor1.setPosition(Common::Point(189, 139), 5); + _starship.setPosition(Common::Point(189, 139), 5); - _actor3.setup(1400, 2, 1); - _actor3.changeZoom(-1); - _actor3.setPosition(Common::Point(298, 258), 5); + _smallShip.setup(1400, 2, 1); + _smallShip.changeZoom(-1); + _smallShip.setPosition(Common::Point(298, 258), 5); _sceneMode = 10; R2_GLOBALS._sound1.play(106); } else { - _actor1.setPosition(Common::Point(289, 239), -30); + _starship.setPosition(Common::Point(289, 239), -30); _sceneMode = 0; R2_GLOBALS._sound1.play(102); } + signal(); } void Scene1500::remove() { - R2_GLOBALS._v5589E.top = 3; - R2_GLOBALS._v5589E.bottom = 168; R2_GLOBALS._uiElements._active = true; + R2_GLOBALS._uiElements._visible = true; SceneExt::remove(); } @@ -6964,8 +6865,8 @@ void Scene1500::signal() { setAction(&_sequenceManager, this, 1, &R2_GLOBALS._player, NULL); // No break on purpose case 1: - if (_actor1._yDiff < 50) { - _actor1.setPosition(Common::Point(289, 239), _actor1._yDiff + 1); + if (_starship._yDiff < 50) { + _starship.setPosition(Common::Point(289, 239), _starship._yDiff + 1); _sceneMode = 1; } setAction(&_sequenceManager, this, 1, &R2_GLOBALS._player, NULL); @@ -6973,12 +6874,12 @@ void Scene1500::signal() { case 2: { Common::Point pt(189, 139); NpcMover *mover = new NpcMover(); - _actor1.addMover(mover, &pt, this); + _starship.addMover(mover, &pt, this); } break; case 3: - if (_actor1._yDiff > 5) { - _actor1.setPosition(Common::Point(189, 139), _actor1._yDiff - 1); + if (_starship._yDiff > 5) { + _starship.setPosition(Common::Point(189, 139), _starship._yDiff - 1); _sceneMode = 3; } setAction(&_sequenceManager, this, 1, &R2_GLOBALS._player, NULL); @@ -6997,7 +6898,7 @@ void Scene1500::signal() { case 11: { Common::Point pt(148, 108); NpcMover *mover = new NpcMover(); - _actor3.addMover(mover, &pt, this); + _smallShip.addMover(mover, &pt, this); } break; case 12: @@ -7006,13 +6907,13 @@ void Scene1500::signal() { case 21: { Common::Point pt(-2, -42); NpcMover *mover = new NpcMover(); - _actor3.addMover(mover, &pt, NULL); + _smallShip.addMover(mover, &pt, NULL); signal(); } break; case 22: - if (_actor1._yDiff < 50) { - _actor1.setPosition(Common::Point(189, 139), _actor1._yDiff + 1); + if (_starship._yDiff < 50) { + _starship.setPosition(Common::Point(189, 139), _starship._yDiff + 1); _sceneMode = 22; } setAction(&_sequenceManager, this, 1, &R2_GLOBALS._player, NULL); @@ -7020,7 +6921,7 @@ void Scene1500::signal() { case 23: { Common::Point pt(-13, -61); NpcMover *mover = new NpcMover(); - _actor1.addMover(mover, &pt, this); + _starship.addMover(mover, &pt, this); } break; case 24: @@ -7033,9 +6934,9 @@ void Scene1500::signal() { void Scene1500::dispatch() { if (_sceneMode > 10) { - float yDiff = sqrt((float) (_actor3._position.x * _actor3._position.x) + (_actor3._position.y * _actor3._position.y)); + float yDiff = sqrt((float) (_smallShip._position.x * _smallShip._position.x) + (_smallShip._position.y * _smallShip._position.y)); if (yDiff > 6) - _actor3.setPosition(_actor3._position, (int) yDiff); + _smallShip.setPosition(_smallShip._position, (int) yDiff); } Scene::dispatch(); @@ -7085,7 +6986,7 @@ void Scene1525::signal() { } /*-------------------------------------------------------------------------- - * Scene 1530 - Cutscene - Elevator + * Scene 1530 - Cutscene - Crashing on Rimwall * *--------------------------------------------------------------------------*/ @@ -7099,6 +7000,7 @@ void Scene1530::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._uiElements._active = false; SceneExt::postInit(); + R2_GLOBALS._interfaceY = SCREEN_HEIGHT; _stripManager.addSpeaker(&_quinnSpeaker); _stripManager.addSpeaker(&_seekerSpeaker); @@ -7122,15 +7024,15 @@ void Scene1530::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._moveRate = 30; R2_GLOBALS._player._moveDiff = Common::Point(4, 1); - _actor2.postInit(); - _actor2.setup(1516, 7, 1); - _actor2.setPosition(Common::Point(121, 41)); - _actor2.animate(ANIM_MODE_2, NULL); + _leftReactor.postInit(); + _leftReactor.setup(1516, 7, 1); + _leftReactor.setPosition(Common::Point(121, 41)); + _leftReactor.animate(ANIM_MODE_2, NULL); - _actor3.postInit(); - _actor3.setup(1516, 8, 1); - _actor3.setPosition(Common::Point(107, 116)); - _actor3.animate(ANIM_MODE_2, NULL); + _rightReactor.postInit(); + _rightReactor.setup(1516, 8, 1); + _rightReactor.setPosition(Common::Point(107, 116)); + _rightReactor.animate(ANIM_MODE_2, NULL); R2_GLOBALS._player.disableControl(); Common::Point pt(480, 75); @@ -7140,14 +7042,14 @@ void Scene1530::postInit(SceneObjectList *OwnerList) { _sceneMode = 1; } else { - _actor1.postInit(); - _actor1._effect = 1; + _seeker.postInit(); + _seeker._effect = EFFECT_SHADED; R2_GLOBALS._player.postInit(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); R2_GLOBALS._player.disableControl(); - setAction(&_sequenceManager, this, 1530, &R2_GLOBALS._player, &_actor1, NULL); + setAction(&_sequenceManager, this, 1530, &R2_GLOBALS._player, &_seeker, NULL); _sceneMode = 2; } @@ -7180,8 +7082,8 @@ void Scene1530::dispatch() { int16 x = R2_GLOBALS._player._position.x; int16 y = R2_GLOBALS._player._position.y; - _actor2.setPosition(Common::Point(x - 39, y - 85)); - _actor3.setPosition(Common::Point(x - 53, y - 9)); + _leftReactor.setPosition(Common::Point(x - 39, y - 85)); + _rightReactor.setPosition(Common::Point(x - 53, y - 9)); Scene::dispatch(); } @@ -7192,13 +7094,12 @@ void Scene1530::dispatch() { *--------------------------------------------------------------------------*/ Scene1550::Junk::Junk() { - _fieldA4 = _junkNumber = 0; + _junkNumber = 0; } void Scene1550::Junk::synchronize(Serializer &s) { SceneActor::synchronize(s); - s.syncAsSint16LE(_fieldA4); s.syncAsSint16LE(_junkNumber); } @@ -7221,13 +7122,13 @@ bool Scene1550::Junk::startAction(CursorType action, Event &event) { if (_visage == 1561) { switch (_frame) { case 2: - SceneItem::display(1550, 23, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1550, 23, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); break; case 3: - SceneItem::display(1550, 26, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1550, 26, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); break; case 4: - SceneItem::display(1550, 35, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1550, 35, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); break; default: break; @@ -7235,13 +7136,13 @@ bool Scene1550::Junk::startAction(CursorType action, Event &event) { } else { switch ((((_strip - 1) * 5) + _frame) % 3) { case 0: - SceneItem::display(1550, 62, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1550, 62, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); break; case 1: - SceneItem::display(1550, 53, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1550, 53, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); break; case 2: - SceneItem::display(1550, 76, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1550, 76, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); break; default: break; @@ -7271,7 +7172,7 @@ bool Scene1550::ShipComponent::startAction(CursorType action, Event &event) { switch (action) { case CURSOR_USE: if (_componentId == 8) { - scene->_field412 = 1; + scene->_dontExit = true; R2_GLOBALS._player.disableControl(); if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->_sceneMode = 1576; @@ -7285,101 +7186,101 @@ bool Scene1550::ShipComponent::startAction(CursorType action, Event &event) { break; case CURSOR_LOOK: if (_componentId == 8) - SceneItem::display(1550, 75, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1550, 75, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); else if (_frame == 1) - SceneItem::display(1550, 70, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1550, 70, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); else - SceneItem::display(1550, 71, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1550, 71, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); return true; break; case R2_FUEL_CELL: - scene->_field412 = 1; + scene->_dontExit = true; if (_componentId == 6) { R2_GLOBALS._player.disableControl(); - scene->_landingStrut.postInit(); + scene->_wreckage2.postInit(); if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->_sceneMode = 1574; else scene->_sceneMode = 1582; - scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_shipComponents[5], &scene->_landingStrut, NULL); + scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_shipComponents[5], &scene->_wreckage2, NULL); return true; } return SceneActor::startAction(action, event); break; case R2_GYROSCOPE: - scene->_field412 = 1; + scene->_dontExit = true; if (_componentId == 3) { R2_GLOBALS._player.disableControl(); - scene->_landingStrut.postInit(); + scene->_wreckage2.postInit(); if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->_sceneMode = 1571; else scene->_sceneMode = 1581; - scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_shipComponents[2], &scene->_landingStrut, NULL); + scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_shipComponents[2], &scene->_wreckage2, NULL); return true; } return SceneActor::startAction(action, event); break; case R2_GUIDANCE_MODULE: - scene->_field412 = 1; + scene->_dontExit = true; if (_componentId == 1) { R2_GLOBALS._player.disableControl(); - scene->_landingStrut.postInit(); + scene->_wreckage2.postInit(); if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->_sceneMode = 1569; else scene->_sceneMode = 1579; - scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_shipComponents[0], &scene->_landingStrut, NULL); + scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_shipComponents[0], &scene->_wreckage2, NULL); return true; } return SceneActor::startAction(action, event); break; case R2_THRUSTER_VALVE: - scene->_field412 = 1; + scene->_dontExit = true; if (_componentId == 4) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 1572; - scene->_landingStrut.postInit(); - scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_shipComponents[3], &scene->_landingStrut, NULL); + scene->_wreckage2.postInit(); + scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_shipComponents[3], &scene->_wreckage2, NULL); return true; } return SceneActor::startAction(action, event); break; case R2_RADAR_MECHANISM: - scene->_field412 = 1; + scene->_dontExit = true; if (_componentId == 2) { R2_GLOBALS._player.disableControl(); - scene->_landingStrut.postInit(); + scene->_wreckage2.postInit(); if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->_sceneMode = 1570; else scene->_sceneMode = 1580; - scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_shipComponents[1], &scene->_landingStrut, NULL); + scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_shipComponents[1], &scene->_wreckage2, NULL); return true; } return SceneActor::startAction(action, event); break; case R2_IGNITOR: - scene->_field412 = 1; + scene->_dontExit = true; if (_componentId == 5) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 1573; - scene->_landingStrut.postInit(); - scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_shipComponents[4], &scene->_landingStrut, NULL); + scene->_wreckage2.postInit(); + scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_shipComponents[4], &scene->_wreckage2, NULL); return true; } return SceneActor::startAction(action, event); break; case R2_BATTERY: - scene->_field412 = 1; + scene->_dontExit = true; if (_componentId == 7) { R2_GLOBALS._player.disableControl(); - scene->_landingStrut.postInit(); + scene->_wreckage2.postInit(); if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->_sceneMode = 1575; else scene->_sceneMode = 1583; - scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_shipComponents[6], &scene->_landingStrut, NULL); + scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_shipComponents[6], &scene->_wreckage2, NULL); return true; } return SceneActor::startAction(action, event); @@ -7449,45 +7350,48 @@ void Scene1550::ShipComponent::setupShipComponent(int componentId) { setDetails(1550, 70, -1, -1, 2, (SceneItem *)NULL); } -Scene1550::UnkObj15503::UnkObj15503() { - _fieldA4 = 0; +Scene1550::DishControlsWindow::DishControl::DishControl() { + _controlId = 0; } -void Scene1550::UnkObj15503::synchronize(Serializer &s) { +void Scene1550::DishControlsWindow::DishControl::synchronize(Serializer &s) { SceneActor::synchronize(s); - s.syncAsSint16LE(_fieldA4); + s.syncAsSint16LE(_controlId); } -bool Scene1550::UnkObj15503::startAction(CursorType action, Event &event) { - Scene1550 *scene = (Scene1550 *)R2_GLOBALS._sceneManager._scene; - +bool Scene1550::DishControlsWindow::DishControl::startAction(CursorType action, Event &event) { if (action != CURSOR_USE) return SceneActor::startAction(action, event); - switch (_fieldA4) { + + Scene1550 *scene = (Scene1550 *)R2_GLOBALS._sceneManager._scene; + + switch (_controlId) { case 1: - if (scene->_actor13._frame == 5) { + // Button control + if (scene->_dish._frame == 5) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 25; - if (scene->_actor4._frame == 1) { - scene->setAction(&scene->_sequenceManager1, scene, 1560, &scene->_actor4, NULL); + if (scene->_walkway._frame == 1) { + scene->setAction(&scene->_sequenceManager1, scene, 1560, &scene->_walkway, NULL); R2_GLOBALS.setFlag(20); setFrame(2); } else { - scene->setAction(&scene->_sequenceManager1, scene, 1561, &scene->_actor4, NULL); + scene->setAction(&scene->_sequenceManager1, scene, 1561, &scene->_walkway, NULL); R2_GLOBALS.clearFlag(20); setFrame(1); } - scene->_unkArea1.remove(); + scene->_dishControlsWindow.remove(); } break; case 2: + // Lever control R2_GLOBALS._player.disableControl(); - if (scene->_actor13._frame == 1) { + if (scene->_dish._frame == 1) { scene->_sceneMode = 23; scene->setAction(&scene->_sequenceManager1, scene, 1560, this, NULL); } else { - if (scene->_actor4._frame == 1) + if (scene->_walkway._frame == 1) scene->_sceneMode = 24; else scene->_sceneMode = 22; @@ -7500,22 +7404,19 @@ bool Scene1550::UnkObj15503::startAction(CursorType action, Event &event) { return true; } -void Scene1550::UnkArea1550::remove() { +void Scene1550::DishControlsWindow::remove() { Scene1550 *scene = (Scene1550 *)R2_GLOBALS._sceneManager._scene; - _unkObj155031.remove(); - _unkObj155032.remove(); - // sub201EA is a common part with UnkArea1200 - R2_GLOBALS._sceneItems.remove((SceneItem *)this); - _areaActor.remove(); - SceneArea::remove(); - R2_GLOBALS._insetUp--; - // + _button.remove(); + _lever.remove(); + + ModalWindow::remove(); + if ((scene->_sceneMode >= 20) && (scene->_sceneMode <= 29)) return; R2_GLOBALS._player.disableControl(); - if (scene->_actor4._frame == 1) { + if (scene->_walkway._frame == 1) { scene->_sceneMode = 1559; scene->setAction(&scene->_sequenceManager1, scene, 1559, &R2_GLOBALS._player, NULL); } else { @@ -7524,91 +7425,40 @@ void Scene1550::UnkArea1550::remove() { } } -void Scene1550::UnkArea1550::process(Event &event) { -// This is a copy of Scene1200::LaserPanel::process - if (_field20 != R2_GLOBALS._insetUp) - return; +void Scene1550::DishControlsWindow::setup2(int visage, int stripFrameNum, int frameNum, + int posX, int posY) { + // Call inherited setup + ModalWindow::setup2(visage, stripFrameNum, frameNum, posX, posY); - CursorType cursor = R2_GLOBALS._events.getCursor(); - - if (_areaActor._bounds.contains(event.mousePos.x + g_globals->gfxManager()._bounds.left , event.mousePos.y)) { - if (cursor == _cursorNum) { - R2_GLOBALS._events.setCursor(_savedCursorNum); - } - } else if (event.mousePos.y < 168) { - if (cursor != _cursorNum) { - _savedCursorNum = cursor; - R2_GLOBALS._events.setCursor(CURSOR_INVALID); - } - if (event.eventType == EVENT_BUTTON_DOWN) { - event.handled = true; - R2_GLOBALS._events.setCursor(_savedCursorNum); - remove(); - } - } -} - -void Scene1550::UnkArea1550::proc12(int visage, int stripFrameNum, int frameNum, int posX, int posY) { - // UnkArea1200::proc12(); + // Further setup Scene1550 *scene = (Scene1550 *)R2_GLOBALS._sceneManager._scene; - - _areaActor.postInit(); - _areaActor.setup(visage, stripFrameNum, frameNum); - _areaActor.setPosition(Common::Point(posX, posY)); - _areaActor.fixPriority(250); - _cursorNum = CURSOR_INVALID; - scene->_sceneAreas.push_front(this); - ++R2_GLOBALS._insetUp; - _field20 = R2_GLOBALS._insetUp; - // - - proc13(1550, 67, -1, -1); - _unkObj155031.postInit(); - _unkObj155031._fieldA4 = 1; - if (scene->_actor4._frame == 1) - _unkObj155031.setup(1559, 3, 1); + setup3(1550, 67, -1, -1); + _button.postInit(); + _button._controlId = 1; + if (scene->_walkway._frame == 1) + _button.setup(1559, 3, 1); else - _unkObj155031.setup(1559, 3, 2); - _unkObj155031.setPosition(Common::Point(142, 79)); - _unkObj155031.fixPriority(251); - _unkObj155031.setDetails(1550, 68, -1, -1, 2, (SceneItem *) NULL); - - _unkObj155032.postInit(); - _unkObj155032._numFrames = 5; - _unkObj155032._fieldA4 = 2; - if (scene->_actor13._frame == 1) - _unkObj155032.setup(1559, 2, 1); - else - _unkObj155032.setup(1559, 2, 2); - _unkObj155032.setPosition(Common::Point(156, 103)); - _unkObj155032.fixPriority(251); - _unkObj155032.setDetails(1550, 69, -1, -1, 2, (SceneItem *) NULL); -} + _button.setup(1559, 3, 2); + _button.setPosition(Common::Point(142, 79)); + _button.fixPriority(251); + _button.setDetails(1550, 68, -1, -1, 2, (SceneItem *) NULL); -void Scene1550::UnkArea1550::proc13(int resNum, int lookLineNum, int talkLineNum, int useLineNum) { - // Copy of Scene1200::LaserPanel::proc13 - _areaActor.setDetails(resNum, lookLineNum, talkLineNum, useLineNum, 2, (SceneItem *) NULL); + _lever.postInit(); + _lever._numFrames = 5; + _lever._controlId = 2; + if (scene->_dish._frame == 1) + _lever.setup(1559, 2, 1); + else + _lever.setup(1559, 2, 5); + _lever.setPosition(Common::Point(156, 103)); + _lever.fixPriority(251); + _lever.setDetails(1550, 69, -1, -1, 2, (SceneItem *) NULL); } bool Scene1550::WorkingShip::startAction(CursorType action, Event &event) { return SceneHotspot::startAction(action, event); } -bool Scene1550::Hotspot3::startAction(CursorType action, Event &event) { - // Arrays related to this scene are all hacky in the origina: they are based on the impossibility to use Miranda - assert ((R2_GLOBALS._player._characterIndex == R2_QUINN) || (R2_GLOBALS._player._characterIndex == R2_SEEKER)); - // The original contains a debug message when CURSOR_TALK is used. - // This part is totally useless, we could remove it (and the entire function as well) - if (action == CURSOR_TALK) - warning("Location: %d/%d - %d", - R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x, - R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y, - scene1550AreaMap[(R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y * 30)] + - R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x); - - return SceneHotspot::startAction(action, event); -} - bool Scene1550::Wreckage::startAction(CursorType action, Event &event) { return SceneActor::startAction(action, event); } @@ -7624,23 +7474,23 @@ bool Scene1550::Companion::startAction(CursorType action, Event &event) { return true; } -bool Scene1550::Actor8::startAction(CursorType action, Event &event) { +bool Scene1550::AirBag::startAction(CursorType action, Event &event) { if (action != CURSOR_USE) return SceneActor::startAction(action, event); R2_GLOBALS._player.disableControl(); Scene1550 *scene = (Scene1550 *)R2_GLOBALS._sceneManager._scene; - scene->_field412 = 1; + scene->_dontExit = true; if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->_sceneMode = 1552; else scene->_sceneMode = 1588; - scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_actor8, NULL); + scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_airbag, NULL); return true; } -bool Scene1550::Actor9::startAction(CursorType action, Event &event) { +bool Scene1550::Joystick::startAction(CursorType action, Event &event) { Scene1550 *scene = (Scene1550 *)R2_GLOBALS._sceneManager._scene; switch (action) { @@ -7655,7 +7505,7 @@ bool Scene1550::Actor9::startAction(CursorType action, Event &event) { return true; break; case CURSOR_LOOK: - SceneItem::display(1550, 41, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1550, 41, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); return true; break; default: @@ -7663,7 +7513,7 @@ bool Scene1550::Actor9::startAction(CursorType action, Event &event) { } } -bool Scene1550::Actor10::startAction(CursorType action, Event &event) { +bool Scene1550::Gyroscope::startAction(CursorType action, Event &event) { if (action != CURSOR_USE) return SceneActor::startAction(action, event); @@ -7674,27 +7524,29 @@ bool Scene1550::Actor10::startAction(CursorType action, Event &event) { else scene->_sceneMode = 1589; - scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_actor10, NULL); + scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, + &scene->_gyroscope, NULL); return true; } -bool Scene1550::Actor11::startAction(CursorType action, Event &event) { +bool Scene1550::DiagnosticsDisplay::startAction(CursorType action, Event &event) { if (action != CURSOR_USE) return SceneActor::startAction(action, event); Scene1550 *scene = (Scene1550 *)R2_GLOBALS._sceneManager._scene; R2_GLOBALS._player.disableControl(); - scene->_field412 = 1; + scene->_dontExit = true; if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->_sceneMode = 1586; else scene->_sceneMode = 1587; - scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_actor11, NULL); + scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, + &scene->_diagnosticsDisplay, NULL); return true; } -bool Scene1550::Actor12::startAction(CursorType action, Event &event) { +bool Scene1550::DishTower::startAction(CursorType action, Event &event) { if (action != CURSOR_USE) return SceneActor::startAction(action, event); @@ -7706,10 +7558,10 @@ bool Scene1550::Actor12::startAction(CursorType action, Event &event) { scene->setAction(&scene->_sequenceManager1, scene, 1585, &R2_GLOBALS._player, NULL); } else { R2_GLOBALS._player.disableControl(); - switch(scene->_field415) { + switch(scene->_dishMode) { case 0: - scene->_actor13.fixPriority(168); - scene->_actor4.fixPriority(125); + scene->_dish.fixPriority(168); + scene->_walkway.fixPriority(125); scene->_sceneMode = 1558; scene->setAction(&scene->_sequenceManager1, scene, 1558, &R2_GLOBALS._player, NULL); break; @@ -7717,9 +7569,9 @@ bool Scene1550::Actor12::startAction(CursorType action, Event &event) { return SceneActor::startAction(action, event); break; case 2: - scene->_field415 = 1; + scene->_dishMode = 1; scene->_sceneMode = 1563; - scene->setAction(&scene->_sequenceManager1, scene, 1563, &R2_GLOBALS._player, &scene->_actor4, NULL); + scene->setAction(&scene->_sequenceManager1, scene, 1563, &R2_GLOBALS._player, &scene->_walkway, NULL); break; default: break; @@ -7729,12 +7581,12 @@ bool Scene1550::Actor12::startAction(CursorType action, Event &event) { } -bool Scene1550::Actor13::startAction(CursorType action, Event &event) { +bool Scene1550::Dish::startAction(CursorType action, Event &event) { Scene1550 *scene = (Scene1550 *)R2_GLOBALS._sceneManager._scene; switch (action) { case CURSOR_USE: - if (scene->_field415 != 2) + if (scene->_dishMode != 2) return SceneActor::startAction(action, event); if (R2_INVENTORY.getObjectScene(R2_BATTERY) == 1550) { @@ -7742,17 +7594,17 @@ bool Scene1550::Actor13::startAction(CursorType action, Event &event) { scene->_sceneMode = 1564; scene->setAction(&scene->_sequenceManager1, scene, 1564, &R2_GLOBALS._player, NULL); } else - SceneItem::display(1550, 64, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1550, 64, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); return true; break; case CURSOR_LOOK: - if (scene->_field415 != 2) + if (scene->_dishMode != 2) return SceneActor::startAction(action, event); if (R2_INVENTORY.getObjectScene(R2_BATTERY) == 1550) { - SceneItem::display(1550, 74, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1550, 74, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); } else - SceneItem::display(1550, 64, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1550, 64, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); return true; break; default: @@ -7761,26 +7613,28 @@ bool Scene1550::Actor13::startAction(CursorType action, Event &event) { } } +/*--------------------------------------------------------------------------*/ + Scene1550::Scene1550() { - _field412 = 0; - _field414 = 0; - _field415 = 0; - _field417 = 0; - _field419 = 0; + _dontExit = false; + _wallType = 0; + _dishMode = 0; + _sceneResourceId = 0; + _walkRegionsId = 0; } void Scene1550::synchronize(Serializer &s) { SceneExt::synchronize(s); - s.syncAsSint16LE(_field412); - s.syncAsByte(_field414); - s.syncAsSint16LE(_field415); - s.syncAsSint16LE(_field417); - s.syncAsSint16LE(_field419); + s.syncAsSint16LE(_dontExit); + s.syncAsByte(_wallType); + s.syncAsSint16LE(_dishMode); + s.syncAsSint16LE(_sceneResourceId); + s.syncAsSint16LE(_walkRegionsId); } void Scene1550::postInit(SceneObjectList *OwnerList) { - if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x == 9) && + if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x == 9) && (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y == 11)) // Exiting the intact spaceship loadScene(1234); @@ -7791,8 +7645,8 @@ void Scene1550::postInit(SceneObjectList *OwnerList) { scalePalette(65, 65, 65); setZoomPercents(30, 75, 170, 100); - _field417 = 1550; - _field419 = 0; + _sceneResourceId = 1550; + _walkRegionsId = 0; if (R2_GLOBALS._sceneManager._previousScene == -1) R2_GLOBALS.setFlag(16); @@ -7808,7 +7662,7 @@ void Scene1550::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_seekerSpeaker); R2_GLOBALS._player.postInit(); - R2_GLOBALS._player._effect = 6; + R2_GLOBALS._player._effect = EFFECT_SHADED2; if (R2_GLOBALS._player._characterIndex == R2_QUINN) R2_GLOBALS._player.setup(1500, 3, 1); @@ -7817,7 +7671,7 @@ void Scene1550::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._moveDiff = Common::Point(5, 3); - if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x == 9) && + if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x == 9) && (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y == 11)) R2_GLOBALS._player.setPosition(Common::Point(157, 135)); else @@ -7826,13 +7680,13 @@ void Scene1550::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); R2_GLOBALS._player.disableControl(); - _field414 = 0; + _wallType = 0; _companion.changeZoom(-1); R2_GLOBALS._player.changeZoom(-1); switch (R2_GLOBALS._sceneManager._previousScene) { case 1530: - R2_GLOBALS._v565AE = 0; + R2_GLOBALS._stripModifier = 0; // No break on purpose case 300: // No break on purpose @@ -7847,9 +7701,9 @@ void Scene1550::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.disableControl(); R2_GLOBALS._player.animate(ANIM_MODE_NONE, NULL); - _field412 = 1; + _dontExit = true; - _landingStrut.postInit(); + _wreckage2.postInit(); _shipComponents[7].setupShipComponent(8); _shipComponents[7].hide(); if (R2_GLOBALS._player._characterIndex == R2_QUINN) @@ -7857,7 +7711,7 @@ void Scene1550::postInit(SceneObjectList *OwnerList) { else _sceneMode = 1578; - setAction(&_sequenceManager1, this, _sceneMode, &R2_GLOBALS._player, &_landingStrut, &_shipComponents[7], NULL); + setAction(&_sequenceManager1, this, _sceneMode, &R2_GLOBALS._player, &_wreckage2, &_shipComponents[7], NULL); R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] = 1550; } else { R2_GLOBALS._player.enableControl(); @@ -7869,9 +7723,9 @@ void Scene1550::postInit(SceneObjectList *OwnerList) { enterArea(); - _shipHull.setDetails(16, 1550, 10, -1, -1); - _item2.setDetails(24, 1550, 10, -1, -1); - _item3.setDetails(Rect(0, 0, 320, 200), 1550, 0, 1, -1, 1, NULL); + _intactHull1.setDetails(16, 1550, 10, -1, -1); + _intactHull2.setDetails(24, 1550, 10, -1, -1); + _background.setDetails(Rect(0, 0, 320, 200), 1550, 0, 1, -1, 1, NULL); if ((R2_GLOBALS._sceneManager._previousScene == 1500) && (R2_GLOBALS.getFlag(16))) { _sceneMode = 70; @@ -7886,8 +7740,8 @@ void Scene1550::postInit(SceneObjectList *OwnerList) { _companion.changeZoom(77); _companion.setDetails(1550, -1, -1, -1, 2, (SceneItem *) NULL); - assert(_field419 >= 1550); - R2_GLOBALS._walkRegions.disableRegion(k5A750[_field419 - 1550]); + assert(_walkRegionsId >= 1550); + R2_GLOBALS._walkRegions.disableRegion(k5A750[_walkRegionsId - 1550]); setAction(&_sequenceManager1, this, 1590, &_companion, NULL); } else if ((_sceneMode != 1577) && (_sceneMode != 1578)) @@ -7903,8 +7757,7 @@ void Scene1550::signal() { case 5: // No break on purpose case 7: - _field412 = 0; - R2_GLOBALS._v56AAB = 0; + _dontExit = false; R2_GLOBALS._player.enableControl(CURSOR_WALK); break; case 20: @@ -7914,27 +7767,28 @@ void Scene1550::signal() { case 25: // No break on purpose case 1563: + // Show the communication dish controls window R2_GLOBALS.clearFlag(20); - _unkArea1.proc12(1559, 1, 1, 160, 125); + _dishControlsWindow.setup2(1559, 1, 1, 160, 125); R2_GLOBALS._player.enableControl(); _sceneMode = 0; break; case 22: - _unkArea1.remove(); + _dishControlsWindow.remove(); _sceneMode = 24; - setAction(&_sequenceManager1, this, 1561, &_actor4, NULL); + setAction(&_sequenceManager1, this, 1561, &_walkway, NULL); R2_GLOBALS.clearFlag(20); break; case 23: - _unkArea1.remove(); + _dishControlsWindow.remove(); _sceneMode = 20; - setAction(&_sequenceManager1, this, 1566, &_actor13, &_actor5, NULL); - R2_GLOBALS.setFlag(21); + setAction(&_sequenceManager1, this, 1566, &_dish, &_dishTowerShadow, NULL); + R2_GLOBALS.setFlag(19); break; case 24: - _unkArea1.remove(); + _dishControlsWindow.remove(); _sceneMode = 21; - setAction(&_sequenceManager1, this, 1567, &_actor13, &_actor5, NULL); + setAction(&_sequenceManager1, this, 1567, &_dish, &_dishTowerShadow, NULL); R2_GLOBALS.clearFlag(19); break; case 30: @@ -8007,7 +7861,7 @@ void Scene1550::signal() { R2_GLOBALS._player.enableControl(); break; case 50: - warning("STUB: sub_1D227()"); + // Removed (useless ?) call to sub_1D227 ++_sceneMode; setAction(&_sequenceManager1, this, 1591, &R2_GLOBALS._player, NULL); if (g_globals->_sceneObjects->contains(&_companion)) @@ -8030,18 +7884,20 @@ void Scene1550::signal() { _companion.changeZoom(-1); _sceneMode = 1592; if (R2_GLOBALS._player._characterIndex == R2_QUINN) - setAction(&_sequenceManager1, this, 1592, &R2_GLOBALS._player, &_companion, &_junk[0], &_actor9, NULL); + setAction(&_sequenceManager1, this, 1592, &R2_GLOBALS._player, &_companion, + &_junk[0], &_joystick, NULL); else - setAction(&_sequenceManager1, this, 1593, &R2_GLOBALS._player, &_companion, &_junk[0], &_actor9, NULL); + setAction(&_sequenceManager1, this, 1593, &R2_GLOBALS._player, &_companion, + &_junk[0], &_joystick, NULL); break; case 61: R2_GLOBALS._player.enableControl(CURSOR_USE); R2_GLOBALS._player._canWalk = false; - _field415 = 2; + _dishMode = 2; break; case 62: R2_GLOBALS._player.enableControl(CURSOR_TALK); - if (_field415 == 2) { + if (_dishMode == 2) { R2_GLOBALS._player.enableControl(CURSOR_USE); R2_GLOBALS._player._canWalk = false; } @@ -8058,33 +7914,33 @@ void Scene1550::signal() { _sceneMode = 60; R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); - if (R2_GLOBALS._v565AE >= 3) { + if (R2_GLOBALS._stripModifier >= 3) { if (R2_GLOBALS._player._characterIndex == R2_QUINN) _stripManager.start(572, this); else _stripManager.start(573, this); } else { - ++R2_GLOBALS._v565AE; + ++R2_GLOBALS._stripModifier; if (R2_GLOBALS._player._characterIndex == R2_QUINN) - _stripManager.start(499 + R2_GLOBALS._v565AE, this); + _stripManager.start(499 + R2_GLOBALS._stripModifier, this); else - _stripManager.start(502 + R2_GLOBALS._v565AE, this); + _stripManager.start(502 + R2_GLOBALS._stripModifier, this); } } else { _sceneMode = 60; R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); - if (R2_GLOBALS._v565AE >= 4) { + if (R2_GLOBALS._stripModifier >= 4) { if (R2_GLOBALS._player._characterIndex == R2_QUINN) _stripManager.start(572, this); else _stripManager.start(573, this); } else { - ++R2_GLOBALS._v565AE; + ++R2_GLOBALS._stripModifier; if (R2_GLOBALS._player._characterIndex == R2_QUINN) - _stripManager.start(563 + R2_GLOBALS._v565AE, this); + _stripManager.start(563 + R2_GLOBALS._stripModifier, this); else - _stripManager.start(567 + R2_GLOBALS._v565AE, this); + _stripManager.start(567 + R2_GLOBALS._stripModifier, this); } } break; @@ -8095,8 +7951,8 @@ void Scene1550::signal() { // No break on purpose case 1588: R2_INVENTORY.setObjectScene(R2_AIRBAG, R2_GLOBALS._player._characterIndex); - _actor8.remove(); - _field412 = 0; + _airbag.remove(); + _dontExit = false; R2_GLOBALS._player.enableControl(); break; case 1553: @@ -8104,33 +7960,33 @@ void Scene1550::signal() { break; case 1554: R2_GLOBALS._player.enableControl(); - _field412 = 0; + _dontExit = false; break; case 1555: // No break on purpose case 1589: R2_INVENTORY.setObjectScene(R2_GYROSCOPE, R2_GLOBALS._player._characterIndex); - _actor10.remove(); + _gyroscope.remove(); R2_GLOBALS._player.enableControl(); break; case 1558: - _actor13.fixPriority(124); - _field415 = 1; - _unkArea1.proc12(1559, 1, 1, 160, 125); + _dish.fixPriority(124); + _dishMode = 1; + _dishControlsWindow.setup2(1559, 1, 1, 160, 125); R2_GLOBALS._player.enableControl(); break; case 1559: - _actor13.fixPriority(168); - _actor4.fixPriority(169); + _dish.fixPriority(168); + _walkway.fixPriority(169); R2_GLOBALS._player.fixPriority(-1); R2_GLOBALS._player.changeZoom(-1); - _field415 = 0; + _dishMode = 0; R2_GLOBALS._player.enableControl(); break; case 1562: R2_GLOBALS._player.enableControl(); R2_GLOBALS._player._canWalk = false; - _field415 = 2; + _dishMode = 2; break; case 1564: R2_INVENTORY.setObjectScene(R2_BATTERY, 1); @@ -8144,52 +8000,52 @@ void Scene1550::signal() { case 1569: // No break on purpose case 1579: - _field412 = 0; - _landingStrut.remove(); + _dontExit = false; + _wreckage2.remove(); R2_INVENTORY.setObjectScene(R2_GUIDANCE_MODULE, 0); R2_GLOBALS._player.enableControl(); break; case 1570: // No break on purpose case 1580: - _field412 = 0; - _landingStrut.remove(); + _dontExit = false; + _wreckage2.remove(); R2_INVENTORY.setObjectScene(R2_RADAR_MECHANISM, 0); R2_GLOBALS._player.enableControl(); break; case 1571: // No break on purpose case 1581: - _field412 = 0; - _landingStrut.remove(); + _dontExit = false; + _wreckage2.remove(); R2_INVENTORY.setObjectScene(R2_GYROSCOPE, 0); R2_GLOBALS._player.enableControl(); break; case 1572: - _field412 = 0; - _landingStrut.remove(); + _dontExit = false; + _wreckage2.remove(); R2_INVENTORY.setObjectScene(R2_THRUSTER_VALVE, 0); R2_GLOBALS._player.enableControl(); break; case 1573: - _field412 = 0; - _landingStrut.remove(); + _dontExit = false; + _wreckage2.remove(); R2_INVENTORY.setObjectScene(R2_IGNITOR, 0); R2_GLOBALS._player.enableControl(); break; case 1574: // No break on purpose case 1582: - _field412 = 0; - _landingStrut.remove(); + _dontExit = false; + _wreckage2.remove(); R2_INVENTORY.setObjectScene(R2_FUEL_CELL, 0); R2_GLOBALS._player.enableControl(); break; case 1575: // No break on purpose case 1583: - _field412 = 0; - _landingStrut.remove(); + _dontExit = false; + _wreckage2.remove(); R2_INVENTORY.setObjectScene(R2_BATTERY, 0); R2_GLOBALS._player.enableControl(); break; @@ -8203,32 +8059,32 @@ void Scene1550::signal() { // No break on purpose case 1578: _sceneMode = 0; - _landingStrut.remove(); - _field412 = 0; + _wreckage2.remove(); + _dontExit = false; R2_GLOBALS._player.fixPriority(-1); R2_GLOBALS._player.enableControl(); break; case 1585: - SceneItem::display(1550, 66, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1550, 66, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); R2_GLOBALS._player.enableControl(); break; case 1586: // No break on purpose case 1587: R2_INVENTORY.setObjectScene(R2_DIAGNOSTICS_DISPLAY, R2_GLOBALS._player._characterIndex); - _landingStrut.remove(); - _field412 = 0; + _diagnosticsDisplay.remove(); + _dontExit = false; R2_GLOBALS._player.enableControl(); break; case 1592: - _actor9.remove(); + _joystick.remove(); R2_INVENTORY.setObjectScene(R2_JOYSTICK, 1); if (R2_GLOBALS._player._characterIndex == R2_QUINN) { R2_GLOBALS._s1550PlayerArea[R2_SEEKER] = R2_GLOBALS._s1550PlayerArea[R2_QUINN]; } else { R2_GLOBALS._s1550PlayerArea[R2_QUINN] = R2_GLOBALS._s1550PlayerArea[R2_SEEKER]; } - R2_GLOBALS._player.enableControl(); + R2_GLOBALS._player.enableControl(CURSOR_WALK); break; default: _sceneMode = 62; @@ -8241,14 +8097,14 @@ void Scene1550::process(Event &event) { if ((!R2_GLOBALS._player._canWalk) && (R2_GLOBALS._events.getCursor() == R2_NEGATOR_GUN) && (event.eventType == EVENT_BUTTON_DOWN) && (this->_screenNumber == 1234)) { int curReg = R2_GLOBALS._sceneRegions.indexOf(event.mousePos); if (curReg == 0) - _field412 = 1; + _dontExit = true; else if (((R2_GLOBALS._player._position.y < 90) && (event.mousePos.y > 90)) || ((R2_GLOBALS._player._position.y > 90) && (event.mousePos.y < 90))) - _field412 = 1; + _dontExit = true; else - _field412 = 0; + _dontExit = false; if ((curReg == 13) || (curReg == 14)) - _field412 = 0; + _dontExit = false; } Scene::process(event); @@ -8262,20 +8118,23 @@ void Scene1550::dispatch() { if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x == 15) && (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y == 16)) { R2_GLOBALS._player._shade = 0; - // Original game contains a switch based on an uninitialized variable. - // Until we understand what should really happen there, this code is unused on purpose + + // NOTE: Original game contains a switch based on an uninitialized variable. + // We're leaving this code here, but ifdef'ed out, in case we can ever figure out + // what the original programmers intended the value to come from +#if 0 int missingVariable = 0; switch (missingVariable) { case 144: // No break on purpose case 146: - _actor13._frame = 5; + _dish._frame = 5; R2_GLOBALS._player._shade = 3; break; case 148: // No break on purpose case 149: - _actor13._frame = 1; + _dish._frame = 1; // No break on purpose case 147: // No break on purpose @@ -8285,9 +8144,10 @@ void Scene1550::dispatch() { default: break; } +#endif } - if (_field412 != 0) + if (_dontExit) return; switch (R2_GLOBALS._player.getRegionIndex() - 11) { @@ -8297,7 +8157,7 @@ void Scene1550::dispatch() { // Exiting the top of the screen R2_GLOBALS._player.disableControl(); _sceneMode = 1; - _field412 = 1; + _dontExit = true; --R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y; enterArea(); @@ -8321,7 +8181,7 @@ void Scene1550::dispatch() { // Exiting the bottom of the screen R2_GLOBALS._player.disableControl(); _sceneMode = 3; - _field412 = 1; + _dontExit = true; ++R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y; enterArea(); @@ -8345,7 +8205,7 @@ void Scene1550::dispatch() { // Exiting the right of the screen R2_GLOBALS._player.disableControl(); _sceneMode = 5; - _field412 = 1; + _dontExit = true; ++R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x; enterArea(); @@ -8373,7 +8233,7 @@ void Scene1550::dispatch() { // Exiting to the left of the screen R2_GLOBALS._player.disableControl(); _sceneMode = 7; - _field412 = 1; + _dontExit = true; --R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x; enterArea(); @@ -8414,11 +8274,11 @@ void Scene1550::saveCharacter(int characterIndex) { SceneExt::saveCharacter(characterIndex); } -void Scene1550::SceneActor1550::subA4D14(int frameNumber, int strip) { +void Scene1550::Wall::setupWall(int frameNumber, int strip) { Scene1550 *scene = (Scene1550 *)R2_GLOBALS._sceneManager._scene; postInit(); - if (scene->_field414 == 2) + if (scene->_wallType == 2) setup(1551, strip, frameNumber); else setup(1554, strip, frameNumber); @@ -8529,7 +8389,7 @@ void Scene1550::SceneActor1550::subA4D14(int frameNumber, int strip) { switch (frameNumber) { case 2: fixPriority(2); - if (scene->_field414 == 2) + if (scene->_wallType == 2) setup(1553, 2, 1); else setup(1556, 2, 1); @@ -8554,7 +8414,7 @@ void Scene1550::SceneActor1550::subA4D14(int frameNumber, int strip) { case 4: if (frameNumber == 2) { fixPriority(250); - if (scene->_field414 == 2) + if (scene->_wallType == 2) setup(1553, 1, 1); else setup(1556, 1, 1); @@ -8599,17 +8459,14 @@ void Scene1550::SceneActor1550::subA4D14(int frameNumber, int strip) { } void Scene1550::enterArea() { - Rect tmpRect; - _field419 = 0; - _field415 = 0; + _walkRegionsId = 0; + _dishMode = 0; - tmpRect = R2_GLOBALS._v5589E; - - _actor14.remove(); + _wallCorner1.remove(); _westWall.remove(); _northWall.remove(); _southWall.remove(); - _actor16.remove(); + _wallCorner2.remove(); _eastWall.remove(); for (int i = 0; i < 8; ++i) @@ -8620,21 +8477,21 @@ void Scene1550::enterArea() { for (int i = 0; i < 8; ++i) _shipComponents[i].remove(); - _actor8.remove(); - _actor9.remove(); - _actor10.remove(); - _actor3.remove(); - _actor11.remove(); + _airbag.remove(); + _joystick.remove(); + _gyroscope.remove(); + _wreckage4.remove(); + _diagnosticsDisplay.remove(); if ((_sceneMode != 1577) && (_sceneMode != 1578)) - _landingStrut.remove(); + _wreckage2.remove(); - _actor2.remove(); + _wreckage3.remove(); _companion.remove(); - _actor13.remove(); - _actor5.remove(); - _actor12.remove(); - _actor4.remove(); + _dish.remove(); + _dishTowerShadow.remove(); + _dishTower.remove(); + _walkway.remove(); // Set up of special walk regions for certain areas switch (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y) { @@ -8642,11 +8499,11 @@ void Scene1550::enterArea() { switch (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x) { case 3: R2_GLOBALS._walkRegions.load(1554); - _field419 = 1554; + _walkRegionsId = 1554; break; case 4: R2_GLOBALS._walkRegions.load(1553); - _field419 = 1553; + _walkRegionsId = 1553; break; default: break; @@ -8658,7 +8515,7 @@ void Scene1550::enterArea() { if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x == 23) || (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x)) { if (!R2_GLOBALS.getFlag(16)) { R2_GLOBALS._walkRegions.load(1559); - _field419 = 1559; + _walkRegionsId = 1559; } } break; @@ -8666,11 +8523,11 @@ void Scene1550::enterArea() { switch (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x) { case 10: R2_GLOBALS._walkRegions.load(1555); - _field419 = 1555; + _walkRegionsId = 1555; break; case 11: R2_GLOBALS._walkRegions.load(1556); - _field419 = 1556; + _walkRegionsId = 1556; break; default: break; @@ -8680,11 +8537,11 @@ void Scene1550::enterArea() { switch (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x) { case 24: R2_GLOBALS._walkRegions.load(1558); - _field419 = 1558; + _walkRegionsId = 1558; break; case 25: R2_GLOBALS._walkRegions.load(1557); - _field419 = 1557; + _walkRegionsId = 1557; break; default: break; @@ -8694,15 +8551,15 @@ void Scene1550::enterArea() { switch (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x) { case 2: R2_GLOBALS._walkRegions.load(1552); - _field419 = 1552; + _walkRegionsId = 1552; break; case 3: R2_GLOBALS._walkRegions.load(1551); - _field419 = 1551; + _walkRegionsId = 1551; break; case 15: R2_GLOBALS._walkRegions.load(1575); - _field419 = 1575; + _walkRegionsId = 1575; default: break; } @@ -8713,13 +8570,15 @@ void Scene1550::enterArea() { int varA = 0; + // This section handles checks if the ARM spacecraft have not yet seized + // control of Lance of Truth. if (!R2_GLOBALS.getFlag(16)) { switch (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y - 2) { case 0: switch (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x - 22) { case 0: varA = 1553; - _northWall.subA4D14(6, 0); + _northWall.setupWall(6, 0); break; case 1: // No break on purpose @@ -8732,7 +8591,7 @@ void Scene1550::enterArea() { break; case 5: varA = 1553; - _northWall.subA4D14(6, 0); + _northWall.setupWall(6, 0); break; default: break; @@ -8744,11 +8603,11 @@ void Scene1550::enterArea() { switch (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x - 21) { case 0: varA = 1550; - _northWall.subA4D14(9, 0); + _northWall.setupWall(9, 0); break; case 1: varA = 1552; - _northWall.subA4D14(10, 0); + _northWall.setupWall(10, 0); break; case 2: // No break on purpose @@ -8761,11 +8620,11 @@ void Scene1550::enterArea() { break; case 6: varA = 1552; - _northWall.subA4D14(7, 0); + _northWall.setupWall(7, 0); break; case 7: varA = 1550; - _northWall.subA4D14(8, 0); + _northWall.setupWall(8, 0); break; default: break; @@ -8775,11 +8634,11 @@ void Scene1550::enterArea() { switch (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x - 21) { case 0: varA = 1550; - _northWall.subA4D14(4, 0); + _northWall.setupWall(4, 0); break; case 1: varA = 1550; - _northWall.subA4D14(3, 0); + _northWall.setupWall(3, 0); break; case 2: // No break on purpose @@ -8792,11 +8651,11 @@ void Scene1550::enterArea() { break; case 6: varA = 1550; - _northWall.subA4D14(2, 0); + _northWall.setupWall(2, 0); break; case 7: varA = 1550; - _northWall.subA4D14(1, 0); + _northWall.setupWall(1, 0); break; default: break; @@ -8805,41 +8664,44 @@ void Scene1550::enterArea() { default: break; } - if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y > 0) && (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x <= 29) && (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x >= 20) && (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y > 7)) { + if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y > 0) && + (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x <= 29) && + ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x < 20) || + (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y > 7))) { + // In an area where the cutscene can be triggered, so start it R2_GLOBALS.setFlag(16); R2_GLOBALS._sceneManager.changeScene(1500); } } - if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x == 9) && + if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x == 9) && (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y == 11)) { if (_screenNumber != 1234) { R2_GLOBALS._sceneManager._fadeMode = FADEMODE_IMMEDIATE; loadScene(1234); R2_GLOBALS._sceneManager._hasPalette = false; - _field414 = 0; - } - } else { - if (_screenNumber == 1234) { - R2_GLOBALS._sceneManager._fadeMode = FADEMODE_IMMEDIATE; - loadScene(1550); - R2_GLOBALS._sceneManager._hasPalette = false; + _wallType = 0; } + } else if (_screenNumber == 1234) { + R2_GLOBALS._sceneManager._fadeMode = FADEMODE_IMMEDIATE; + loadScene(1550); + R2_GLOBALS._sceneManager._hasPalette = false; } - if (R2_GLOBALS._sceneManager._sceneNumber == 1234) - _field419 = 1576; + if (_screenNumber == 1234) + _walkRegionsId = 1576; - if (_field414 == 0) { - _field414 = 1; + if (_wallType == 0) { + _wallType = 1; } else { - if (_field414 == 2) { - _field414 = 3; + if (_wallType == 2) { + _wallType = 3; } else { - _field414 = 2; + _wallType = 2; } if (R2_GLOBALS._sceneManager._sceneNumber == 1550){ +#if 0 warning("Mouse_hideIfNeeded()"); warning("gfx_set_pane_p"); for (int i = 3; i != 168; ++i) { @@ -8847,12 +8709,13 @@ void Scene1550::enterArea() { warning("missing for loop, to be implemented"); warning("gfx_draw_slice"); } - warning("Missing sub2957D()"); + warning("gfx_flip_screen()"); warning("gfx_set_pane_p()"); +#endif R2_GLOBALS._sceneManager._fadeMode = FADEMODE_IMMEDIATE; if (varA == 0) { - if (_field417 != 1550) { + if (_sceneResourceId != 1550) { g_globals->_scenePalette.loadPalette(1550); R2_GLOBALS._sceneManager._hasPalette = true; } @@ -8862,142 +8725,142 @@ void Scene1550::enterArea() { } if (R2_GLOBALS._sceneManager._hasPalette) - _field417 = varA; + _sceneResourceId = varA; - warning("sub_2C429()"); +// warning("sub_2C429()"); } } // Scene setup dependent on the type of cell specified in the scene map - switch (scene1550AreaMap[(R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y * 30) + + switch (scene1550AreaMap[(R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y * 30) + R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x]) { case 0: // Standard cell - if (_field419 == 0) { + if (_walkRegionsId == 0) { R2_GLOBALS._walkRegions.load(1550); - _field419 = 1550; + _walkRegionsId = 1550; } break; case 1: // North end of the spaceport - if (_field419 == 0) { + if (_walkRegionsId == 0) { R2_GLOBALS._walkRegions.load(1560); - _field419 = 1560; + _walkRegionsId = 1560; } - _actor14.subA4D14(2, 1); - _northWall.subA4D14(1, 3); - _actor16.subA4D14(2, 5); + _wallCorner1.setupWall(2, 1); + _northWall.setupWall(1, 3); + _wallCorner2.setupWall(2, 5); break; case 2: R2_GLOBALS._walkRegions.load(1561); - _field419 = 1561; - _actor14.subA4D14(2, 1); - _westWall.subA4D14(2, 2); - _northWall.subA4D14(1, 3); - _actor16.subA4D14(2, 5); + _walkRegionsId = 1561; + _wallCorner1.setupWall(2, 1); + _westWall.setupWall(2, 2); + _northWall.setupWall(1, 3); + _wallCorner2.setupWall(2, 5); break; case 3: R2_GLOBALS._walkRegions.load(1562); - _field419 = 1562; - _actor14.subA4D14(2, 1); - _northWall.subA4D14(1, 3); - _actor16.subA4D14(2, 5); - _eastWall.subA4D14(2, 6); + _walkRegionsId = 1562; + _wallCorner1.setupWall(2, 1); + _northWall.setupWall(1, 3); + _wallCorner2.setupWall(2, 5); + _eastWall.setupWall(2, 6); break; case 4: R2_GLOBALS._walkRegions.load(1563); - _field419 = 1563; - _northWall.subA4D14(2, 3); + _walkRegionsId = 1563; + _northWall.setupWall(2, 3); break; case 5: R2_GLOBALS._walkRegions.load(1564); - _field419 = 1564; - _southWall.subA4D14(2, 4); + _walkRegionsId = 1564; + _southWall.setupWall(2, 4); break; case 6: R2_GLOBALS._walkRegions.load(1565); - _field419 = 1565; - _actor14.subA4D14(1, 1); - _westWall.subA4D14(1, 2); - _northWall.subA4D14(3, 3); + _walkRegionsId = 1565; + _wallCorner1.setupWall(1, 1); + _westWall.setupWall(1, 2); + _northWall.setupWall(3, 3); break; case 7: R2_GLOBALS._walkRegions.load(1566); - _field419 = 1566; - _actor14.subA4D14(1, 1); - _westWall.subA4D14(1, 2); - _northWall.subA4D14(2, 4); + _walkRegionsId = 1566; + _wallCorner1.setupWall(1, 1); + _westWall.setupWall(1, 2); + _northWall.setupWall(2, 4); break; case 8: R2_GLOBALS._walkRegions.load(1567); - _field419 = 1567; - _westWall.subA4D14(5, 2); + _walkRegionsId = 1567; + _westWall.setupWall(5, 2); break; case 9: R2_GLOBALS._walkRegions.load(1568); - _field419 = 1568; - _westWall.subA4D14(4, 2); + _walkRegionsId = 1568; + _westWall.setupWall(4, 2); break; case 10: R2_GLOBALS._walkRegions.load(1569); - _field419 = 1569; - _actor14.subA4D14(3, 1); + _walkRegionsId = 1569; + _wallCorner1.setupWall(3, 1); break; case 11: R2_GLOBALS._walkRegions.load(1570); - _field419 = 1570; - _actor14.subA4D14(1, 1); - _westWall.subA4D14(1, 2); + _walkRegionsId = 1570; + _wallCorner1.setupWall(1, 1); + _westWall.setupWall(1, 2); break; case 12: R2_GLOBALS._walkRegions.load(1571); - _field419 = 1571; - _actor16.subA4D14(1, 5); - _eastWall.subA4D14(1, 6); + _walkRegionsId = 1571; + _wallCorner2.setupWall(1, 5); + _eastWall.setupWall(1, 6); break; case 13: R2_GLOBALS._walkRegions.load(1572); - _field419 = 1572; - _actor14.subA4D14(1, 1); - _westWall.subA4D14(1, 2); - _southWall.subA4D14(1, 4); + _walkRegionsId = 1572; + _wallCorner1.setupWall(1, 1); + _westWall.setupWall(1, 2); + _southWall.setupWall(1, 4); break; case 14: R2_GLOBALS._walkRegions.load(1573); - _field419 = 1573; - _southWall.subA4D14(1, 4); - _actor16.subA4D14(1, 5); - _eastWall.subA4D14(1, 6); + _walkRegionsId = 1573; + _southWall.setupWall(1, 4); + _wallCorner2.setupWall(1, 5); + _eastWall.setupWall(1, 6); break; case 15: // South wall R2_GLOBALS._walkRegions.load(1574); - _field419 = 1574; - _southWall.subA4D14(1, 4); + _walkRegionsId = 1574; + _southWall.setupWall(1, 4); break; case 16: R2_GLOBALS._walkRegions.load(1570); - _field419 = 1570; - _actor14.subA4D14(2, 1); - _westWall.subA4D14(2, 2); + _walkRegionsId = 1570; + _wallCorner1.setupWall(2, 1); + _westWall.setupWall(2, 2); break; case 17: R2_GLOBALS._walkRegions.load(1570); - _field419 = 1570; - _actor14.subA4D14(2, 1); - _westWall.subA4D14(3, 2); + _walkRegionsId = 1570; + _wallCorner1.setupWall(2, 1); + _westWall.setupWall(3, 2); break; case 18: R2_GLOBALS._walkRegions.load(1571); - _field419 = 1571; - _actor16.subA4D14(2, 5); - _eastWall.subA4D14(2, 6); + _walkRegionsId = 1571; + _wallCorner2.setupWall(2, 5); + _eastWall.setupWall(2, 6); break; case 19: R2_GLOBALS._walkRegions.load(1571); - _field419 = 1571; - _actor16.subA4D14(2, 5); - _eastWall.subA4D14(3, 6); + _walkRegionsId = 1571; + _wallCorner2.setupWall(2, 5); + _eastWall.setupWall(3, 6); break; default: break; @@ -9006,14 +8869,14 @@ void Scene1550::enterArea() { int di = 0; int tmpIdx = 0; for (int i = 0; i < 127 * 4; i += 4) { - if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x == R2_GLOBALS._scene1550JunkLocations[i]) && - (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y == R2_GLOBALS._scene1550JunkLocations[i + 1]) && + if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x == R2_GLOBALS._scene1550JunkLocations[i]) && + (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y == R2_GLOBALS._scene1550JunkLocations[i + 1]) && (R2_GLOBALS._scene1550JunkLocations[i + 2] != 0)) { tmpIdx = R2_GLOBALS._scene1550JunkLocations[i + 3]; _junk[di].postInit(); - _junk[di]._effect = 6; + _junk[di]._effect = EFFECT_SHADED2; _junk[di]._shade = 0; - _junk[di]._fieldA4 = tmpIdx; + //_junk[di]._junkState = tmpIdx; _junk[di]._junkNumber = i; _junk[di].setDetails(1550, 62, -1, 63, 2, (SceneItem *) NULL); if (R2_GLOBALS._scene1550JunkLocations[i + 2] == 41) { @@ -9027,11 +8890,11 @@ void Scene1550::enterArea() { R2_GLOBALS._walkRegions.disableRegion(scene1550JunkRegions[7]); if (R2_INVENTORY.getObjectScene(R2_JOYSTICK) == 1550) { - _actor9.postInit(); - _actor9.setup(1562, 3, 1); - _actor9.setPosition(Common::Point(150, 70)); - _actor9.fixPriority(10); - _actor9.setDetails(1550, 41, -1, 42, 2, (SceneItem *) NULL); + _joystick.postInit(); + _joystick.setup(1562, 3, 1); + _joystick.setPosition(Common::Point(150, 70)); + _joystick.fixPriority(10); + _joystick.setDetails(1550, 41, -1, 42, 2, (SceneItem *) NULL); } } else { if (R2_GLOBALS._scene1550JunkLocations[i + 2] > 40) { @@ -9041,7 +8904,7 @@ void Scene1550::enterArea() { _junk[di].changeZoom(-1); _junk[di].setup(1552, ((R2_GLOBALS._scene1550JunkLocations[i + 2] - 1) / 5) + 1, ((R2_GLOBALS._scene1550JunkLocations[i + 2] - 1) % 5) + 1); } - _junk[di].setPosition(Common::Point(k5A72E[tmpIdx], k5A73F[tmpIdx])); + _junk[di].setPosition(Common::Point(scene1550JunkX[tmpIdx], scene1550JunkY[tmpIdx])); if (scene1550JunkRegions[tmpIdx] != 0) R2_GLOBALS._walkRegions.disableRegion(scene1550JunkRegions[tmpIdx]); di++; @@ -9049,195 +8912,195 @@ void Scene1550::enterArea() { } } - for (int i = 0; i < 15 * 3; i++) { - if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x == k5A79B[i]) - && (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y == k5A79B[i + 1])) { - tmpIdx = k5A79B[i + 2]; - switch (tmpIdx - 1) { - case 0: + // Loop for detecting and setting up certain special areas within the map + for (int i = 0; i < 15 * 3; i += 3) { + if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x == scene1550SpecialAreas[i]) + && (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y == scene1550SpecialAreas[i + 1])) { + int areaType = scene1550SpecialAreas[i + 2]; + switch (areaType) { + case 1: if (!R2_GLOBALS.getFlag(16)) { - _landingStrut.postInit(); + _wreckage2.postInit(); if (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y == 3) - _landingStrut.setup(1555, 2, 1); + _wreckage2.setup(1555, 2, 1); else - _landingStrut.setup(1555, 1, 1); - _landingStrut.setPosition(Common::Point(150, 100)); - _landingStrut.fixPriority(92); - _landingStrut.setDetails(1550, 73, -1, -1, 2, (SceneItem *) NULL); + _wreckage2.setup(1555, 1, 1); + _wreckage2.setPosition(Common::Point(150, 100)); + _wreckage2.fixPriority(92); + _wreckage2.setDetails(1550, 73, -1, -1, 2, (SceneItem *) NULL); } break; - case 1: - _actor13.postInit(); - warning("_actor13._actorName = \"dish\";"); + case 2: + _dish.postInit(); if (R2_GLOBALS.getFlag(19)) - _actor13.setup(1556, 3, 5); + _dish.setup(1556, 3, 5); else - _actor13.setup(1556, 3, 1); - _actor13.changeZoom(95); - _actor13.setPosition(Common::Point(165, 83)); - _actor13.fixPriority(168); - _actor13.setDetails(1550, 17, -1, 19, 2, (SceneItem *) NULL); - - _actor12.postInit(); - _actor12.setup(1556, 4, 1); - _actor12.setPosition(Common::Point(191, 123)); - _actor12.changeZoom(95); - _actor12.setDetails(1550, 65, -1, 66, 2, (SceneItem *) NULL); - - _actor5.postInit(); - _actor5._numFrames = 5; + _dish.setup(1556, 3, 1); + _dish.changeZoom(95); + _dish.setPosition(Common::Point(165, 83)); + _dish.fixPriority(168); + _dish.setDetails(1550, 17, -1, 19, 2, (SceneItem *) NULL); + + _dishTower.postInit(); + _dishTower.setup(1556, 4, 1); + _dishTower.setPosition(Common::Point(191, 123)); + _dishTower.changeZoom(95); + _dishTower.setDetails(1550, 65, -1, 66, 2, (SceneItem *) NULL); + + _dishTowerShadow.postInit(); + _dishTowerShadow._numFrames = 5; if (R2_GLOBALS.getFlag(19)) - _actor5.setup(1556, 8, 5); + _dishTowerShadow.setup(1556, 8, 5); else - _actor5.setup(1556, 8, 1); + _dishTowerShadow.setup(1556, 8, 1); - _actor5.setPosition(Common::Point(156, 151)); - _actor5.fixPriority(10); + _dishTowerShadow.setPosition(Common::Point(156, 151)); + _dishTowerShadow.fixPriority(10); - _actor4.postInit(); + _walkway.postInit(); if (R2_GLOBALS.getFlag(20)) - _actor4.setup(1558, 3, 10); + _walkway.setup(1558, 3, 10); else - _actor4.setup(1558, 3, 1); + _walkway.setup(1558, 3, 1); - _actor4.setPosition(Common::Point(172, 48)); - _actor4.fixPriority(169); + _walkway.setPosition(Common::Point(172, 48)); + _walkway.fixPriority(169); R2_GLOBALS._walkRegions.disableRegion(scene1550JunkRegions[15]); break; - case 2: + case 3: _wreckage.postInit(); _wreckage.setup(1550, 1, 1); _wreckage.setPosition(Common::Point(259, 55)); _wreckage.fixPriority(133); _wreckage.setDetails(1550, 9, -1, -1, 2, (SceneItem *) NULL); - _landingStrut.postInit(); - _landingStrut.setup(1550, 1, 2); - _landingStrut.setPosition(Common::Point(259, 133)); - _landingStrut.fixPriority(105); - _landingStrut.setDetails(1550, 9, -1, -1, 2, (SceneItem *) NULL); + _wreckage2.postInit(); + _wreckage2.setup(1550, 1, 2); + _wreckage2.setPosition(Common::Point(259, 133)); + _wreckage2.fixPriority(105); + _wreckage2.setDetails(1550, 9, -1, -1, 2, (SceneItem *) NULL); if (R2_INVENTORY.getObjectScene(R2_GYROSCOPE) == 1550) { - _actor10.postInit(); - _actor10.setup(1550, 7, 2); - _actor10.setPosition(Common::Point(227, 30)); - _actor10.fixPriority(130); - _actor10.setDetails(1550, 29, -1, 63, 2, (SceneItem *) NULL); + _gyroscope.postInit(); + _gyroscope.setup(1550, 7, 2); + _gyroscope.setPosition(Common::Point(227, 30)); + _gyroscope.fixPriority(130); + _gyroscope.setDetails(1550, 29, -1, 63, 2, (SceneItem *) NULL); } break; - case 3: + case 4: _wreckage.postInit(); _wreckage.setup(1550, 1, 4); _wreckage.setPosition(Common::Point(76, 131)); _wreckage.fixPriority(10); _wreckage.setDetails(1550, 9, -1, -1, 2, (SceneItem *) NULL); - _landingStrut.postInit(); - _landingStrut.setup(1550, 1, 3); - _landingStrut.setPosition(Common::Point(76, 64)); - _landingStrut.setDetails(1550, 9, -1, -1, 2, (SceneItem *) NULL); + _wreckage2.postInit(); + _wreckage2.setup(1550, 1, 3); + _wreckage2.setPosition(Common::Point(76, 64)); + _wreckage2.setDetails(1550, 9, -1, -1, 2, (SceneItem *) NULL); if (R2_INVENTORY.getObjectScene(R2_DIAGNOSTICS_DISPLAY) == 1550) { - _actor11.postInit(); - _actor11.setup(1504, 4, 1); - _actor11.setPosition(Common::Point(49, 35)); - _actor11.animate(ANIM_MODE_2, NULL); - _actor11._numFrames = 4; - _actor11.fixPriority(65); - _actor11.setDetails(1550, 14, 15, 63, 2, (SceneItem *) NULL); + _diagnosticsDisplay.postInit(); + _diagnosticsDisplay.setup(1504, 4, 1); + _diagnosticsDisplay.setPosition(Common::Point(49, 35)); + _diagnosticsDisplay.animate(ANIM_MODE_2, NULL); + _diagnosticsDisplay._numFrames = 4; + _diagnosticsDisplay.fixPriority(65); + _diagnosticsDisplay.setDetails(1550, 14, 15, 63, 2, (SceneItem *) NULL); } if (R2_INVENTORY.getObjectScene(R2_AIRBAG) == 1550) { - _actor8.postInit(); - _actor8.setup(1550, 7, 1); - _actor8.setPosition(Common::Point(45, 44)); - _actor8.fixPriority(150); - _actor8.setDetails(1550, 44, -1, 63, 2, (SceneItem *) NULL); + _airbag.postInit(); + _airbag.setup(1550, 7, 1); + _airbag.setPosition(Common::Point(45, 44)); + _airbag.fixPriority(150); + _airbag.setDetails(1550, 44, -1, 63, 2, (SceneItem *) NULL); } break; - case 4: + case 5: _wreckage.postInit(); _wreckage.setup(1550, 2, 4); _wreckage.setPosition(Common::Point(243, 131)); _wreckage.fixPriority(10); _wreckage.setDetails(1550, 9, -1, -1, 2, (SceneItem *) NULL); - _landingStrut.postInit(); - _landingStrut.setup(1550, 2, 3); - _landingStrut.setPosition(Common::Point(243, 64)); - _landingStrut.setDetails(1550, 9, -1, -1, 2, (SceneItem *) NULL); + _wreckage2.postInit(); + _wreckage2.setup(1550, 2, 3); + _wreckage2.setPosition(Common::Point(243, 64)); + _wreckage2.setDetails(1550, 9, -1, -1, 2, (SceneItem *) NULL); break; - case 5: + case 6: _wreckage.postInit(); _wreckage.setup(1550, 2, 1); _wreckage.setPosition(Common::Point(60, 55)); _wreckage.fixPriority(133); _wreckage.setDetails(1550, 9, -1, -1, 2, (SceneItem *) NULL); - _landingStrut.postInit(); - _landingStrut.setup(1550, 2, 2); - _landingStrut.setPosition(Common::Point(60, 133)); - _landingStrut.fixPriority(106); - _landingStrut.setDetails(1550, 9, -1, -1, 2, (SceneItem *) NULL); + _wreckage2.postInit(); + _wreckage2.setup(1550, 2, 2); + _wreckage2.setPosition(Common::Point(60, 133)); + _wreckage2.fixPriority(106); + _wreckage2.setDetails(1550, 9, -1, -1, 2, (SceneItem *) NULL); break; - case 6: + case 7: _wreckage.postInit(); _wreckage.setup(1550, 3, 1); _wreckage.setPosition(Common::Point(281, 132)); _wreckage.setDetails(1550, 56, -1, -1, 2, (SceneItem *) NULL); break; - case 7: + case 8: _wreckage.postInit(); _wreckage.setup(1550, 3, 2); _wreckage.setPosition(Common::Point(57, 96)); _wreckage.fixPriority(70); _wreckage.setDetails(1550, 56, -1, -1, 2, (SceneItem *) NULL); - _landingStrut.postInit(); - _landingStrut.setup(1550, 3, 3); - _landingStrut.setPosition(Common::Point(145, 88)); - _landingStrut.fixPriority(55); - _landingStrut.setDetails(1550, 56, -1, -1, 2, (SceneItem *) NULL); - - _actor2.postInit(); - _actor2.setup(1550, 3, 4); - _actor2.setPosition(Common::Point(64, 137)); - _actor2.fixPriority(115); - _actor2.setDetails(1550, 56, -1, -1, 2, (SceneItem *) NULL); - - _actor3.postInit(); - _actor3.setup(1550, 5, 1); - _actor3.setPosition(Common::Point(60, 90)); - _actor3.fixPriority(45); + _wreckage2.postInit(); + _wreckage2.setup(1550, 3, 3); + _wreckage2.setPosition(Common::Point(145, 88)); + _wreckage2.fixPriority(55); + _wreckage2.setDetails(1550, 56, -1, -1, 2, (SceneItem *) NULL); + + _wreckage3.postInit(); + _wreckage3.setup(1550, 3, 4); + _wreckage3.setPosition(Common::Point(64, 137)); + _wreckage3.fixPriority(115); + _wreckage3.setDetails(1550, 56, -1, -1, 2, (SceneItem *) NULL); + + _wreckage4.postInit(); + _wreckage4.setup(1550, 5, 1); + _wreckage4.setPosition(Common::Point(60, 90)); + _wreckage4.fixPriority(45); break; - case 8: + case 9: _wreckage.postInit(); _wreckage.setup(1550, 4, 2); _wreckage.setPosition(Common::Point(262, 96)); _wreckage.fixPriority(70); _wreckage.setDetails(1550, 56, -1, -1, 2, (SceneItem *) NULL); - _landingStrut.postInit(); - _landingStrut.setup(1550, 4, 3); - _landingStrut.setPosition(Common::Point(174, 88)); - _landingStrut.fixPriority(55); - _landingStrut.setDetails(1550, 56, -1, -1, 2, (SceneItem *) NULL); - - _actor2.postInit(); - _actor2.setup(1550, 4, 4); - _actor2.setPosition(Common::Point(255, 137)); - _actor2.fixPriority(115); - _actor2.setDetails(1550, 56, -1, -1, 2, (SceneItem *) NULL); - - _actor3.postInit(); - _actor3.setup(1550, 6, 1); - _actor3.setPosition(Common::Point(259, 90)); - _actor3.fixPriority(45); + _wreckage2.postInit(); + _wreckage2.setup(1550, 4, 3); + _wreckage2.setPosition(Common::Point(174, 88)); + _wreckage2.fixPriority(55); + _wreckage2.setDetails(1550, 56, -1, -1, 2, (SceneItem *) NULL); + + _wreckage3.postInit(); + _wreckage3.setup(1550, 4, 4); + _wreckage3.setPosition(Common::Point(255, 137)); + _wreckage3.fixPriority(115); + _wreckage3.setDetails(1550, 56, -1, -1, 2, (SceneItem *) NULL); + + _wreckage4.postInit(); + _wreckage4.setup(1550, 6, 1); + _wreckage4.setPosition(Common::Point(259, 90)); + _wreckage4.fixPriority(45); break; - case 9: + case 10: _wreckage.postInit(); _wreckage.setup(1550, 4, 1); _wreckage.setPosition(Common::Point(38, 132)); _wreckage.setDetails(1550, 56, -1, -1, 2, (SceneItem *) NULL); break; - case 11: + case 12: // Intact ship _shipComponents[7].setupShipComponent(8); _shipComponents[0].setupShipComponent(1); @@ -9247,6 +9110,7 @@ void Scene1550::enterArea() { _shipComponents[4].setupShipComponent(5); _shipComponents[5].setupShipComponent(6); _shipComponents[6].setupShipComponent(7); + break; default: break; } @@ -9255,12 +9119,12 @@ void Scene1550::enterArea() { if (R2_GLOBALS._s1550PlayerArea[R2_QUINN] == R2_GLOBALS._s1550PlayerArea[R2_SEEKER]) { _companion.postInit(); - _companion._effect = 7; + _companion._effect = EFFECT_SHADED2; _companion.changeZoom(-1); - assert((_field419 >= 1550) && (_field419 <= 2008)); - R2_GLOBALS._walkRegions.disableRegion(k5A750[_field419 - 1550]); - _companion.setPosition(Common::Point(k5A72E[k5A76D[_field419 - 1550]], k5A73F[k5A76D[_field419 - 1550]] + 8)); + assert((_walkRegionsId >= 1550) && (_walkRegionsId <= 2008)); + R2_GLOBALS._walkRegions.disableRegion(k5A750[_walkRegionsId - 1550]); + _companion.setPosition(Common::Point(scene1550JunkX[k5A76D[_walkRegionsId - 1550]], scene1550JunkY[k5A76D[_walkRegionsId - 1550]] + 8)); if (R2_GLOBALS._player._characterIndex == R2_QUINN) { if (R2_GLOBALS._player._characterScene[R2_SEEKER] == 1580) { _companion.setup(1516, 3, 17); @@ -9289,178 +9153,206 @@ void Scene1550::enterArea() { } /*-------------------------------------------------------------------------- - * Scene 1575 - + * Scene 1575 - Spaceport - unused ship scene * *--------------------------------------------------------------------------*/ -Scene1575::Scene1575() { - _field412 = 0; - _field414 = 0; - _field416 = 0; - _field418 = 0; - _field41A = 0; +Scene1575::Button::Button() { + _buttonId = 0; + _pressed = false; } -void Scene1575::synchronize(Serializer &s) { - SceneExt::synchronize(s); +void Scene1575::Button::synchronize(Serializer &s) { + NamedHotspot::synchronize(s); - s.syncAsSint16LE(_field412); - s.syncAsSint16LE(_field414); - s.syncAsSint16LE(_field416); - s.syncAsSint16LE(_field418); - s.syncAsSint16LE(_field41A); + s.syncAsSint16LE(_buttonId); + s.syncAsSint16LE(_pressed); } -Scene1575::Hotspot1::Hotspot1() { - _field34 = 0; - _field36 = 0; -} +void Scene1575::Button::process(Event &event) { + Scene1575 *scene = (Scene1575 *)R2_GLOBALS._sceneManager._scene; + bool isInBounds = _bounds.contains(event.mousePos); + CursorType cursor = R2_GLOBALS._events.getCursor(); -void Scene1575::Hotspot1::synchronize(Serializer &s) { - NamedHotspot::synchronize(s); + if ((event.eventType == EVENT_BUTTON_DOWN && cursor == CURSOR_USE && isInBounds) || + (_pressed && _buttonId != 1 && event.eventType == EVENT_BUTTON_UP && isInBounds)) { + // Button pressed + _pressed = true; + Common::Point pos = scene->_actor1._position; + event.handled = true; - s.syncAsSint16LE(_field34); - s.syncAsSint16LE(_field36); -} + if (!R2_GLOBALS.getFlag(18) || _buttonId <= 1 || _buttonId >= 6) { + switch (_buttonId) { + case 1: + if (R2_GLOBALS.getFlag(18)) { + scene->_actor14.hide(); + scene->_actor15.hide(); + R2_GLOBALS.clearFlag(18); + } else if ((scene->_actor12._position.x == 85) && (scene->_actor12._position.y == 123)) { + scene->_actor14.show(); + scene->_actor15.show(); + R2_GLOBALS.setFlag(18); + } else { + SceneItem::display("That's probably not a good thing, ya know!"); + } + break; + case 2: + if (scene->_field41A < 780) { + if (pos.x > 54) + pos.x -= 65; + pos.x += 2; + scene->_field41A += 2; + + for (int i = 0; i < 17; i++) + scene->_arrActor[i].setPosition(Common::Point(scene->_arrActor[i]._position.x + 2, scene->_arrActor[i]._position.y)); + + scene->_actor13.setPosition(Common::Point(scene->_actor13._position.x + 2, scene->_actor13._position.y)); + scene->_actor12.setPosition(Common::Point(scene->_actor12._position.x + 2, scene->_actor12._position.y)); + scene->_actor1.setPosition(Common::Point(pos.x, pos.y)); + scene->_actor2.setPosition(Common::Point(pos.x + 65, pos.y)); + scene->_actor3.setPosition(Common::Point(pos.x + 130, pos.y)); + } + break; + case 3: + if (scene->_field41A > 0) { + if (pos.x < -8) + pos.x += 65; + + pos.x -= 2; + scene->_field41A -= 2; + for (int i = 0; i < 17; i++) + scene->_arrActor[i].setPosition(Common::Point(scene->_arrActor[i]._position.x - 2, scene->_arrActor[i]._position.y)); + + scene->_actor13.setPosition(Common::Point(scene->_actor13._position.x - 2, scene->_actor13._position.y)); + scene->_actor12.setPosition(Common::Point(scene->_actor12._position.x - 2, scene->_actor12._position.y)); + scene->_actor1.setPosition(Common::Point(pos.x, pos.y)); + scene->_actor2.setPosition(Common::Point(pos.x + 65, pos.y)); + scene->_actor3.setPosition(Common::Point(pos.x + 130, pos.y)); + } + break; + case 4: { + if (pos.y < 176) { + ++pos.y; + for (int i = 0; i < 17; ++i) + scene->_arrActor[i].setPosition(Common::Point(scene->_arrActor[i]._position.x, scene->_arrActor[i]._position.y + 1)); + + scene->_actor13.setPosition(Common::Point(scene->_actor13._position.x, scene->_actor13._position.y + 1)); + scene->_actor12.setPosition(Common::Point(scene->_actor12._position.x, scene->_actor12._position.y + 1)); + scene->_actor1.setPosition(Common::Point(pos.x, pos.y)); + scene->_actor2.setPosition(Common::Point(pos.x + 65, pos.y)); + scene->_actor3.setPosition(Common::Point(pos.x + 130, pos.y)); + } + } + break; + case 5: { + if (pos.y > 145) { + --pos.y; + for (int i = 0; i < 17; ++i) + scene->_arrActor[i].setPosition(Common::Point(scene->_arrActor[i]._position.x, scene->_arrActor[i]._position.y - 1)); + + scene->_actor13.setPosition(Common::Point(scene->_actor13._position.x, scene->_actor13._position.y - 1)); + scene->_actor12.setPosition(Common::Point(scene->_actor12._position.x, scene->_actor12._position.y - 1)); + scene->_actor1.setPosition(Common::Point(pos.x, pos.y)); + scene->_actor2.setPosition(Common::Point(pos.x + 65, pos.y)); + scene->_actor3.setPosition(Common::Point(pos.x + 130, pos.y)); + } + } + break; + case 6: + R2_GLOBALS._sceneManager.changeScene(1550); + break; + default: + break; + } -void Scene1575::Hotspot1::process(Event &event) { - if ((event.eventType != EVENT_BUTTON_DOWN) || (R2_GLOBALS._events.getCursor() != R2_STEPPING_DISKS) || (!_bounds.contains(event.mousePos))) { - if (_field36 == 0) - return; - if ((_field34 == 1) || (event.eventType == EVENT_BUTTON_UP) || (!_bounds.contains(event.mousePos))) { - _field36 = 0; - return; - } - } - _field36 = 1; - Scene1575 *scene = (Scene1575 *)R2_GLOBALS._sceneManager._scene; + int j = 0; + for (int i = 0; i < 17; i++) { + if (scene->_arrActor[i]._bounds.contains(85, 116)) + j = i; + } - event.handled = true; - if (R2_GLOBALS.getFlag(18) && (_field34 > 1) && (_field34 < 6)) { - warning("sub1A03B(\"Better not move the laser while it\'s firing!\", 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999);"); - return; - } - int di = scene->_actor1._position.x; + if (scene->_actor13._bounds.contains(85, 116)) + j = 18; - switch (_field34 - 1) { - case 0: - if (R2_GLOBALS.getFlag(18)) { - scene->_actor14.hide(); - scene->_actor15.hide(); - R2_GLOBALS.clearFlag(18); - } else if ((scene->_actor12._position.x == 85) && (scene->_actor12._position.y == 123)) { - scene->_actor14.show(); - scene->_actor15.show(); - R2_GLOBALS.setFlag(18); + if (scene->_actor12._bounds.contains(85, 116)) + j = 19; + + if (j) + scene->_actor11.show(); + else + scene->_actor11.hide(); } else { - warning("sub1A03B(\"That\'s probably not a good thing, ya know!\", 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999);"); + SceneItem::display("Better not move the laser while it's firing!"); } - break; - case 1: - if (scene->_field41A < 780) { - if (di > 54) - di -= 65; - di += 2; - scene->_field41A += 2; + } else { + _pressed = false; + } +} - for (int i = 0; i < 17; i++) - scene->_arrActor[i].setPosition(Common::Point(scene->_arrActor[i]._position.x + 2, scene->_arrActor[i]._position.y)); +bool Scene1575::Button::startAction(CursorType action, Event &event) { + if (action == CURSOR_USE) + return false; + return SceneHotspot::startAction(action, event); +} - scene->_actor13.setPosition(Common::Point(scene->_actor13._position.x + 2, scene->_actor13._position.y)); - scene->_actor12.setPosition(Common::Point(scene->_actor12._position.x + 2, scene->_actor12._position.y)); - scene->_actor1.setPosition(Common::Point(di, scene->_actor1._position.y)); - scene->_actor2.setPosition(Common::Point(di + 65, scene->_actor1._position.y)); - scene->_actor3.setPosition(Common::Point(di + 130, scene->_actor1._position.y)); - } +void Scene1575::Button::initButton(int buttonId) { + _buttonId = buttonId; + _pressed = false; + EventHandler::postInit(); + + switch (_buttonId) { + case 1: + setDetails(Rect(53, 165, 117, 190), -1, -1, -1, 2, 1, NULL); break; case 2: - if (scene->_field41A > 0) { - if (di < -8) - di += 65; - - di -= 2; - scene->_field41A -= 2; - for (int i = 0; i < 17; i++) - scene->_arrActor[i].setPosition(Common::Point(scene->_arrActor[i]._position.x - 2, scene->_arrActor[i]._position.y)); - - scene->_actor13.setPosition(Common::Point(scene->_actor13._position.x - 2, scene->_actor13._position.y)); - scene->_actor12.setPosition(Common::Point(scene->_actor12._position.x - 2, scene->_actor12._position.y)); - scene->_actor1.setPosition(Common::Point(di, scene->_actor1._position.y)); - scene->_actor2.setPosition(Common::Point(di + 65, scene->_actor1._position.y)); - scene->_actor3.setPosition(Common::Point(di + 130, scene->_actor1._position.y)); - } + setDetails(Rect(151, 142, 189, 161), -1, -1, -1, 2, 1, NULL); break; - case 3: { - int tmpPosY = scene->_actor1._position.y; - if (tmpPosY < 176) { - ++tmpPosY; - for (int i = 0; i < 17; ++i) - scene->_arrActor[i].setPosition(Common::Point(scene->_arrActor[i]._position.x, scene->_arrActor[i]._position.y + 1)); - - scene->_actor13.setPosition(Common::Point(scene->_actor13._position.x, scene->_actor13._position.y + 1)); - scene->_actor12.setPosition(Common::Point(scene->_actor12._position.x, scene->_actor12._position.y + 1)); - scene->_actor1.setPosition(Common::Point(di, scene->_actor1._position.y)); - scene->_actor2.setPosition(Common::Point(di + 65, scene->_actor1._position.y)); - scene->_actor3.setPosition(Common::Point(di + 130, scene->_actor1._position.y)); - } - } + case 3: + setDetails(Rect(225, 142, 263, 161), -1, -1, -1, 2, 1, NULL); break; - case 4: { - int tmpPosY = scene->_actor1._position.y; - if (tmpPosY > 145) { - tmpPosY--; - for (int i = 0; i < 17; ++i) - scene->_arrActor[i].setPosition(Common::Point(scene->_arrActor[i]._position.x, scene->_arrActor[i]._position.y - 1)); - - scene->_actor13.setPosition(Common::Point(scene->_actor13._position.x, scene->_actor13._position.y - 1)); - scene->_actor12.setPosition(Common::Point(scene->_actor12._position.x, scene->_actor12._position.y - 1)); - scene->_actor1.setPosition(Common::Point(di, scene->_actor1._position.y)); - scene->_actor2.setPosition(Common::Point(di + 65, scene->_actor1._position.y)); - scene->_actor3.setPosition(Common::Point(di + 130, scene->_actor1._position.y)); - } - } + case 4: + setDetails(Rect(188, 122, 226, 140), -1, -1, -1, 2, 1, NULL); break; case 5: - R2_GLOBALS._sceneManager.changeScene(1550); + setDetails(Rect(188, 162, 226, 180), -1, -1, -1, 2, 1, NULL); + break; + case 6: + setDetails(Rect(269, 169, 301, 185), -1, -1, -1, 2, 1, NULL); break; default: break; } +} - int j = 0; - for (int i = 0; i < 17; i++) { - if (scene->_arrActor[i]._bounds.contains(85, 116)) - j = i; - } - - if (scene->_actor13._bounds.contains(85, 116)) - j = 18; - - if (scene->_actor12._bounds.contains(85, 116)) - j = 19; +/*--------------------------------------------------------------------------*/ - if (j) - scene->_actor11.show(); - else - scene->_actor11.hide(); +Scene1575::Scene1575() { + _field412 = 0; + _field414 = 390; + _field416 = 0; + _field418 = 0; + _field41A = 0; } -bool Scene1575::Hotspot1::startAction(CursorType action, Event &event) { - if (action == CURSOR_USE) - return false; - return SceneHotspot::startAction(action, event); +void Scene1575::synchronize(Serializer &s) { + SceneExt::synchronize(s); + + s.syncAsSint16LE(_field412); + s.syncAsSint16LE(_field414); + s.syncAsSint16LE(_field416); + s.syncAsSint16LE(_field418); + s.syncAsSint16LE(_field41A); } -void Scene1575::Hotspot1::subA910D(int indx) { - warning("STUB: Scene1575:Hotspot1::subA910D(%d)", indx); +double hypotenuse(double v1, double v2) { + return sqrt(v1 * v1 + v2 * v2); } void Scene1575::postInit(SceneObjectList *OwnerList) { loadScene(1575); R2_GLOBALS._uiElements._active = false; - R2_GLOBALS._v5589E = Rect(0, 0, 320, 200); SceneExt::postInit(); - _field414 = 390; + R2_GLOBALS._interfaceY = SCREEN_HEIGHT; _actor1.postInit(); _actor1.setup(1575, 1, 1); @@ -9479,8 +9371,17 @@ void Scene1575::postInit(SceneObjectList *OwnerList) { for (int i = 0; i < 17; i++) { _arrActor[i].postInit(); - _arrActor[i].setup(1575, 2, k5A7F6[(3 * i) + 2]); - warning("TODO: immense pile of floating operations"); + _arrActor[i].setup(1575, 2, k5A7F6[3 * i + 2]); + + double v1 = hypotenuse(2.0, 3 - k5A7F6[3 * i]); + v1 += hypotenuse(2.0, 3 - k5A7F6[3 * i + 1]); + int yp = (int)(sqrt(v1) * 75.0 / 17.0 - 161.0); + + int angle = R2_GLOBALS._gfxManagerInstance.getAngle( + Common::Point(3, 16), Common::Point(k5A7F6[3 * i], k5A7F6[3 * i + 1])); + int xp = angle * 78 / 9 - 319; + + _arrActor[i].setPosition(Common::Point(xp, yp)); _arrActor[i].fixPriority(6); } @@ -9512,12 +9413,13 @@ void Scene1575::postInit(SceneObjectList *OwnerList) { _actor10.setup(1575, 3, 2); _actor10.setPosition(Common::Point(287, 91)); - _item1.subA910D(1); - _item1.subA910D(2); - _item1.subA910D(3); - _item1.subA910D(4); - _item1.subA910D(5); - _item1.subA910D(6); + // Initialize buttons + _button1.initButton(1); + _button2.initButton(2); + _button3.initButton(3); + _button4.initButton(4); + _button5.initButton(5); + _button6.initButton(6); _actor11.postInit(); _actor11.setup(1575, 4, 2); @@ -9545,6 +9447,7 @@ void Scene1575::postInit(SceneObjectList *OwnerList) { _actor13.postInit(); _actor13.setup(1575, 2, 4); + // TODO warning("TODO: another immense pile of floating operations"); _actor12.postInit(); @@ -9570,8 +9473,6 @@ void Scene1575::postInit(SceneObjectList *OwnerList) { void Scene1575::remove() { SceneExt::remove(); - R2_GLOBALS._v5589E.top = 3; - R2_GLOBALS._v5589E.bottom = 168; R2_GLOBALS._uiElements._active = true; } @@ -9583,7 +9484,6 @@ void Scene1575::process(Event &event) { Scene::process(event); g_globals->_sceneObjects->recurse(SceneHandler::dispatchObject); - warning("TODO: check Scene1575::process"); } void Scene1575::dispatch() { @@ -9675,25 +9575,22 @@ void Scene1575::dispatch() { *--------------------------------------------------------------------------*/ Scene1580::Scene1580() { - _field412 = 0; } void Scene1580::synchronize(Serializer &s) { SceneExt::synchronize(s); - - s.syncAsSint16LE(_field412); } -bool Scene1580::Hotspot1::startAction(CursorType action, Event &event) { - Scene1580 *scene = (Scene1580 *)R2_GLOBALS._sceneManager._scene; - +bool Scene1580::JoystickPlug::startAction(CursorType action, Event &event) { if (action == R2_JOYSTICK) { + Scene1580 *scene = (Scene1580 *)R2_GLOBALS._sceneManager._scene; + R2_INVENTORY.setObjectScene(R2_JOYSTICK, 1580); - R2_GLOBALS._sceneItems.remove(&scene->_item1); - scene->_actor2.postInit(); - scene->_actor2.setup(1580, 1, 4); - scene->_actor2.setPosition(Common::Point(159, 163)); - scene->_actor2.setDetails(1550, 78, -1, -1, 2, (SceneItem *) NULL); + R2_GLOBALS._sceneItems.remove(&scene->_joystickPlug); + scene->_joystick.postInit(); + scene->_joystick.setup(1580, 1, 4); + scene->_joystick.setPosition(Common::Point(159, 163)); + scene->_joystick.setDetails(1550, 78, -1, -1, 2, (SceneItem *) NULL); scene->_arrActor[5].remove(); @@ -9703,29 +9600,29 @@ bool Scene1580::Hotspot1::startAction(CursorType action, Event &event) { return SceneHotspot::startAction(action, event); } -bool Scene1580::Hotspot2::startAction(CursorType action, Event &event) { - Scene1580 *scene = (Scene1580 *)R2_GLOBALS._sceneManager._scene; - +bool Scene1580::ScreenSlot::startAction(CursorType action, Event &event) { if (action == R2_DIAGNOSTICS_DISPLAY) { + Scene1580 *scene = (Scene1580 *)R2_GLOBALS._sceneManager._scene; + R2_INVENTORY.setObjectScene(R2_DIAGNOSTICS_DISPLAY, 1580); R2_GLOBALS._player.disableControl(); - R2_GLOBALS._sceneItems.remove(&scene->_item2); + R2_GLOBALS._sceneItems.remove(&scene->_screenSlot); - scene->_actor3.postInit(); - scene->_actor3.setup(1580, 1, 1); - scene->_actor3.setPosition(Common::Point(124, 108)); - scene->_actor3.fixPriority(10); + scene->_screen.postInit(); + scene->_screen.setup(1580, 1, 1); + scene->_screen.setPosition(Common::Point(124, 108)); + scene->_screen.fixPriority(10); if (R2_INVENTORY.getObjectScene(R2_JOYSTICK) == 1580) - scene->_actor3.setDetails(1550, 14, -1, -1, 5, &scene->_actor2); + scene->_screen.setDetails(1550, 14, -1, -1, 5, &scene->_joystick); else - scene->_actor3.setDetails(1550, 14, -1, -1, 2, (SceneItem *)NULL); + scene->_screen.setDetails(1550, 14, -1, -1, 2, (SceneItem *)NULL); - scene->_actor1.postInit(); - scene->_actor1.setup(1580, 3, 1); - scene->_actor1.setPosition(Common::Point(124, 109)); - scene->_actor1.fixPriority(20); - scene->_field412 = 1; + scene->_screenDisplay.postInit(); + scene->_screenDisplay.setup(1580, 3, 1); + scene->_screenDisplay.setPosition(Common::Point(124, 109)); + scene->_screenDisplay.fixPriority(20); + //scene->_field412 = 1; scene->_sceneMode = 10; scene->setAction(&scene->_sequenceManager, scene, 1, &R2_GLOBALS._player, NULL); @@ -9735,7 +9632,7 @@ bool Scene1580::Hotspot2::startAction(CursorType action, Event &event) { return SceneHotspot::startAction(action, event); } -bool Scene1580::Actor2::startAction(CursorType action, Event &event) { +bool Scene1580::Joystick::startAction(CursorType action, Event &event) { if ( (action == CURSOR_USE) && (R2_INVENTORY.getObjectScene(R2_DIAGNOSTICS_DISPLAY) == 1580) && (R2_INVENTORY.getObjectScene(R2_FUEL_CELL) == 0) && (R2_INVENTORY.getObjectScene(R2_GUIDANCE_MODULE) == 0) && (R2_INVENTORY.getObjectScene(R2_RADAR_MECHANISM) == 0) && (R2_INVENTORY.getObjectScene(R2_GYROSCOPE) == 0) @@ -9755,13 +9652,13 @@ bool Scene1580::Actor2::startAction(CursorType action, Event &event) { return SceneActor::startAction(action, event); } -bool Scene1580::Actor3::startAction(CursorType action, Event &event) { +bool Scene1580::Screen::startAction(CursorType action, Event &event) { if ((action == CURSOR_USE) && (R2_INVENTORY.getObjectScene(R2_BROKEN_DISPLAY) == 1580)) { Scene1580 *scene = (Scene1580 *)R2_GLOBALS._sceneManager._scene; R2_INVENTORY.setObjectScene(R2_BROKEN_DISPLAY, R2_GLOBALS._player._characterIndex); - scene->_item2.setDetails(Rect(69, 29, 177, 108), 1550, 82, -1, -1, 2, NULL); - scene->_actor1.remove(); + scene->_screenSlot.setDetails(Rect(69, 29, 177, 108), 1550, 82, -1, -1, 2, NULL); + scene->_screenDisplay.remove(); remove(); return true; } @@ -9769,21 +9666,21 @@ bool Scene1580::Actor3::startAction(CursorType action, Event &event) { return SceneActor::startAction(action, event); } -bool Scene1580::Actor4::startAction(CursorType action, Event &event) { +bool Scene1580::StorageCompartment::startAction(CursorType action, Event &event) { if (action != CURSOR_USE) return SceneActor::startAction(action, event); Scene1580 *scene = (Scene1580 *)R2_GLOBALS._sceneManager._scene; R2_GLOBALS._player.disableControl(); - R2_GLOBALS._sceneItems.remove(&scene->_actor4); + R2_GLOBALS._sceneItems.remove(&scene->_storageCompartment); scene->_sceneMode = 0; animate(ANIM_MODE_5, scene); return true; } -bool Scene1580::Actor5::startAction(CursorType action, Event &event) { +bool Scene1580::HatchButton::startAction(CursorType action, Event &event) { if (action != CURSOR_USE) return SceneActor::startAction(action, event); @@ -9797,7 +9694,7 @@ bool Scene1580::Actor5::startAction(CursorType action, Event &event) { return true; } -bool Scene1580::Actor6::startAction(CursorType action, Event &event) { +bool Scene1580::ThrusterValve::startAction(CursorType action, Event &event) { Scene1580 *scene = (Scene1580 *)R2_GLOBALS._sceneManager._scene; switch (action) { @@ -9829,7 +9726,7 @@ bool Scene1580::Actor6::startAction(CursorType action, Event &event) { return SceneActor::startAction(action, event); } -bool Scene1580::Actor7::startAction(CursorType action, Event &event) { +bool Scene1580::Ignitor::startAction(CursorType action, Event &event) { Scene1580 *scene = (Scene1580 *)R2_GLOBALS._sceneManager._scene; switch (action) { @@ -9865,7 +9762,6 @@ void Scene1580::postInit(SceneObjectList *OwnerList) { loadScene(1580); R2_GLOBALS._sceneManager._fadeMode = FADEMODE_GRADUAL; SceneExt::postInit(); - _field412 = 0; _stripManager.setColors(60, 255); _stripManager.setFontNumber(3); @@ -9876,89 +9772,89 @@ void Scene1580::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.disableControl(); if (R2_INVENTORY.getObjectScene(R2_JOYSTICK) == 1580) { - _actor2.postInit(); - _actor2.setup(1580, 1, 4); - _actor2.setPosition(Common::Point(159, 163)); - _actor2.setDetails(1550, 78, -1, -1, 1, (SceneItem *) NULL); + _joystick.postInit(); + _joystick.setup(1580, 1, 4); + _joystick.setPosition(Common::Point(159, 163)); + _joystick.setDetails(1550, 78, -1, -1, 1, (SceneItem *) NULL); } else { - _item1.setDetails(Rect(141, 148, 179, 167), 1550, 79, -1, -1, 1, NULL); + _joystickPlug.setDetails(Rect(141, 148, 179, 167), 1550, 79, -1, -1, 1, NULL); } if (R2_INVENTORY.getObjectScene(R2_BROKEN_DISPLAY) == 1580) { - _actor3.postInit(); - _actor3.setup(1580, 1, 1); - _actor3.setPosition(Common::Point(124, 108)); - _actor3.fixPriority(10); - _actor3.setDetails(1550, 13, -1, -1, 1, (SceneItem *) NULL); - - _actor1.postInit(); - _actor1.setup(1580, 1, 3); - _actor1.setPosition(Common::Point(124, 96)); - _actor1.fixPriority(20); + _screen.postInit(); + _screen.setup(1580, 1, 1); + _screen.setPosition(Common::Point(124, 108)); + _screen.fixPriority(10); + _screen.setDetails(1550, 13, -1, -1, 1, (SceneItem *) NULL); + + _screenDisplay.postInit(); + _screenDisplay.setup(1580, 1, 3); + _screenDisplay.setPosition(Common::Point(124, 96)); + _screenDisplay.fixPriority(20); } else if (R2_INVENTORY.getObjectScene(R2_DIAGNOSTICS_DISPLAY) == 1580) { - _actor3.postInit(); - _actor3.setup(1580, 1, 1); - _actor3.setPosition(Common::Point(124, 108)); - _actor3.fixPriority(10); - _actor3.setDetails(1550, 14, -1, -1, 1, (SceneItem *) NULL); + _screen.postInit(); + _screen.setup(1580, 1, 1); + _screen.setPosition(Common::Point(124, 108)); + _screen.fixPriority(10); + _screen.setDetails(1550, 14, -1, -1, 1, (SceneItem *) NULL); - _actor1.postInit(); - _actor1.setup(1580, 3, 1); - _actor1.setPosition(Common::Point(124, 109)); - _actor1.fixPriority(20); + _screenDisplay.postInit(); + _screenDisplay.setup(1580, 3, 1); + _screenDisplay.setPosition(Common::Point(124, 109)); + _screenDisplay.fixPriority(20); _sceneMode = 10; } else { - _item2.setDetails(Rect(69, 29, 177, 108), 1550, 82, -1, -1, 1, NULL); + _screenSlot.setDetails(Rect(69, 29, 177, 108), 1550, 82, -1, -1, 1, NULL); } - _actor4.postInit(); + _storageCompartment.postInit(); if (R2_GLOBALS.getFlag(58) == 0) { - _actor4.setup(1580, 5, 1); - _actor4.setDetails(1550, 80, -1, -1, 1, (SceneItem *) NULL); + _storageCompartment.setup(1580, 5, 1); + _storageCompartment.setDetails(1550, 80, -1, -1, 1, (SceneItem *) NULL); } else { - _actor4.setup(1580, 5, 6); + _storageCompartment.setup(1580, 5, 6); } - _actor4.setPosition(Common::Point(216, 108)); - _actor4.fixPriority(100); + _storageCompartment.setPosition(Common::Point(216, 108)); + _storageCompartment.fixPriority(100); + + _hatchButton.postInit(); + _hatchButton.setup(1580, 4, 1); + _hatchButton.setPosition(Common::Point(291, 147)); + _hatchButton.fixPriority(100); + _hatchButton.setDetails(1550, 81, -1, -1, 1, (SceneItem *) NULL); - _actor5.postInit(); - _actor5.setup(1580, 4, 1); - _actor5.setPosition(Common::Point(291, 147)); - _actor5.fixPriority(100); - _actor5.setDetails(1550, 81, -1, -1, 1, (SceneItem *) NULL); - if (R2_INVENTORY.getObjectScene(R2_THRUSTER_VALVE) == 1580) { - _actor6.postInit(); - _actor6.setup(1580, 6, 2); - _actor6.setPosition(Common::Point(222, 108)); - _actor6.fixPriority(50); - _actor6.setDetails(1550, 32, -1, 34, 1, (SceneItem *) NULL); + _thrusterValve.postInit(); + _thrusterValve.setup(1580, 6, 2); + _thrusterValve.setPosition(Common::Point(222, 108)); + _thrusterValve.fixPriority(50); + _thrusterValve.setDetails(1550, 32, -1, 34, 1, (SceneItem *) NULL); } if (R2_INVENTORY.getObjectScene(R2_IGNITOR) == 1580) { - _actor7.postInit(); - _actor7.setup(1580, 6, 1); - _actor7.setPosition(Common::Point(195, 108)); - _actor7.fixPriority(50); - _actor7.setDetails(1550, 38, -1, 34, 1, (SceneItem *) NULL); + _ignitor.postInit(); + _ignitor.setup(1580, 6, 1); + _ignitor.setPosition(Common::Point(195, 108)); + _ignitor.fixPriority(50); + _ignitor.setDetails(1550, 38, -1, 34, 1, (SceneItem *) NULL); } R2_GLOBALS._player.postInit(); R2_GLOBALS._player.hide(); setAction(&_sequenceManager, this, 1, &R2_GLOBALS._player, NULL); - _item3.setDetails(Rect(0, 0, 320, 200), 1550, 50, -1, -1, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 1550, 50, -1, -1, 1, NULL); } void Scene1580::signal() { switch (_sceneMode++) { case 10: - _actor1.animate(ANIM_MODE_5, this); + _screenDisplay.animate(ANIM_MODE_5, this); break; case 11: - _actor1.setup(1580, 1, 2); - _actor1.setPosition(Common::Point(124, 94)); + _screenDisplay.setup(1580, 1, 2); + _screenDisplay.setPosition(Common::Point(124, 94)); if (R2_INVENTORY.getObjectScene(R2_GYROSCOPE) != 0) { _arrActor[0].postInit(); @@ -10037,19 +9933,16 @@ bool Scene1625::Wire::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 1631; - scene->_actor3.postInit(); - scene->setAction(&scene->_sequenceManager, scene, 1631, &scene->_actor3, &scene->_wire, NULL); + scene->_mirandaMouth.postInit(); + scene->setAction(&scene->_sequenceManager, scene, 1631, &scene->_mirandaMouth, &scene->_wire, NULL); return true; } Scene1625::Scene1625() { - _field412 = 0; } void Scene1625::synchronize(Serializer &s) { SceneExt::synchronize(s); - - s.syncAsSint16LE(_field412); } void Scene1625::postInit(SceneObjectList *OwnerList) { @@ -10069,10 +9962,10 @@ void Scene1625::postInit(SceneObjectList *OwnerList) { _wire.setPosition(Common::Point(206, 133)); _wire.setDetails(1625, 0, -1, -1, 1, (SceneItem *) NULL); - _actor5.postInit(); - _actor5.setup(1625, 8, 1); - _actor5.setPosition(Common::Point(190, 131)); - _actor5.setDetails(1625, 6, -1, 2, 1, (SceneItem *) NULL); + _wristRestraints.postInit(); + _wristRestraints.setup(1625, 8, 1); + _wristRestraints.setPosition(Common::Point(190, 131)); + _wristRestraints.setDetails(1625, 6, -1, 2, 1, (SceneItem *) NULL); if (R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] == 1625) { if (!R2_GLOBALS.getFlag(83)) { @@ -10084,18 +9977,18 @@ void Scene1625::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.enableControl(); R2_GLOBALS._player._canWalk = false; } else { - _actor1.postInit(); - _actor1.fixPriority(10); + _teal.postInit(); + _teal.fixPriority(10); - _actor6.postInit(); + _tealRightArm.postInit(); R2_GLOBALS._player.disableControl(); _sceneMode = 1625; - setAction(&_sequenceManager, this, 1625, &_actor1, &_actor6, NULL); + setAction(&_sequenceManager, this, 1625, &_teal, &_tealRightArm, NULL); } R2_GLOBALS._sound1.play(245); - _item1.setDetails(Rect(0, 0, 320, 200), 1625, 12, -1, -1, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 1625, 12, -1, -1, 1, NULL); R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 1625; R2_GLOBALS._player._characterScene[R2_MIRANDA] = 1625; } @@ -10130,11 +10023,11 @@ void Scene1625::signal() { switch (_stripManager._exitMode) { case 1: _sceneMode = 1627; - setAction(&_sequenceManager, this, 1627, &_actor3, &_glass, NULL); + setAction(&_sequenceManager, this, 1627, &_mirandaMouth, &_glass, NULL); break; case 2: _sceneMode = 1629; - setAction(&_sequenceManager, this, 1629, &_tealHead, &_actor5, NULL); + setAction(&_sequenceManager, this, 1629, &_tealHead, &_wristRestraints, NULL); break; case 4: R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 3150; @@ -10145,7 +10038,7 @@ void Scene1625::signal() { case 5: _sceneMode = 1628; _tealHead.remove(); - setAction(&_sequenceManager, this, 1628, &_actor3, &_glass, NULL); + setAction(&_sequenceManager, this, 1628, &_mirandaMouth, &_glass, NULL); break; case 6: _glass.postInit(); @@ -10159,24 +10052,24 @@ void Scene1625::signal() { break; case 8: _sceneMode = 1635; - setAction(&_sequenceManager, this, 1635, &_actor3, &_actor5, NULL); + setAction(&_sequenceManager, this, 1635, &_mirandaMouth, &_wristRestraints, NULL); break; case 9: _glass.postInit(); _glass.setDetails(1625, -1, -1, -1, 2, (SceneItem *) NULL); _sceneMode = 1634; - setAction(&_sequenceManager, this, 1634, &_actor3, &_actor5, NULL); + setAction(&_sequenceManager, this, 1634, &_mirandaMouth, &_wristRestraints, NULL); break; case 3: // No break on purpose default: _sceneMode = 1630; _tealHead.remove(); - setAction(&_sequenceManager, this, 1630, &_actor1, &_actor6, NULL); + setAction(&_sequenceManager, this, 1630, &_teal, &_tealRightArm, NULL); break; } - _field412 = _stripManager._field2E8; - _stripManager._field2E8 = 0; + //_field412 = _stripManager._field2E8; + _stripManager._currObj44Id = 0; break; case 1625: _tealHead.postInit(); @@ -10191,18 +10084,18 @@ void Scene1625::signal() { _tealHead.setPosition(Common::Point(68, 68)); _tealHead.show(); - _actor3.postInit(); - _actor3.setup(1627, 3, 1); - _actor3.setPosition(Common::Point(196, 65)); + _mirandaMouth.postInit(); + _mirandaMouth.setup(1627, 3, 1); + _mirandaMouth.setPosition(Common::Point(196, 65)); _sceneMode = 99; R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); _stripManager.start(832, this); break; case 1627: - _actor3.setup(1627, 3, 1); - _actor3.setPosition(Common::Point(196, 65)); - _actor3.show(); + _mirandaMouth.setup(1627, 3, 1); + _mirandaMouth.setPosition(Common::Point(196, 65)); + _mirandaMouth.show(); _sceneMode = 99; R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); @@ -10214,9 +10107,9 @@ void Scene1625::signal() { _tealHead.setup(1627, 1, 1); _tealHead.setPosition(Common::Point(68, 68)); - _actor3.setup(1627, 3, 1); - _actor3.setPosition(Common::Point(196, 65)); - _actor3.show(); + _mirandaMouth.setup(1627, 3, 1); + _mirandaMouth.setPosition(Common::Point(196, 65)); + _mirandaMouth.show(); _sceneMode = 99; R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); @@ -10236,21 +10129,21 @@ void Scene1625::signal() { R2_GLOBALS._player._canWalk = true; break; case 1631: - _actor3.setup(1627, 3, 1); - _actor3.setPosition(Common::Point(196, 65)); - _actor3.show(); + _mirandaMouth.setup(1627, 3, 1); + _mirandaMouth.setPosition(Common::Point(196, 65)); + _mirandaMouth.show(); _wire.remove(); - _actor1.postInit(); - _actor1.fixPriority(10); + _teal.postInit(); + _teal.fixPriority(10); - _actor6.postInit(); + _tealRightArm.postInit(); R2_INVENTORY.setObjectScene(R2_SUPERCONDUCTOR_WIRE, 3); _sceneMode = 14; - setAction(&_sequenceManager, this, 1625, &_actor1, &_actor6, NULL); + setAction(&_sequenceManager, this, 1625, &_teal, &_tealRightArm, NULL); break; case 1632: _tealHead.setup(1627, 1, 1); @@ -10273,9 +10166,9 @@ void Scene1625::signal() { _stripManager.start(836, this); break; case 1635: - _actor3.setup(1627, 3, 1); - _actor3.setPosition(Common::Point(196, 65)); - _actor3.show(); + _mirandaMouth.setup(1627, 3, 1); + _mirandaMouth.setPosition(Common::Point(196, 65)); + _mirandaMouth.show(); _sceneMode = 99; R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); @@ -10299,21 +10192,13 @@ void Scene1625::process(Event &event) { *--------------------------------------------------------------------------*/ Scene1700::Scene1700() { - _field77A = 0; - _field77C = 0; + _walkFlag = 0; } void Scene1700::synchronize(Serializer &s) { SceneExt::synchronize(s); - s.syncAsSint16LE(_field77A); - s.syncAsSint16LE(_field77C); -} - -bool Scene1700::Item2::startAction(CursorType action, Event &event) { - // The original contains a debug trace. It's currently skipped. - // TODO: either add the debug trace, or remove this function and associated class - return SceneHotspot::startAction(action, event); + s.syncAsSint16LE(_walkFlag); } bool Scene1700::RimTransport::startAction(CursorType action, Event &event) { @@ -10323,7 +10208,6 @@ bool Scene1700::RimTransport::startAction(CursorType action, Event &event) { Scene1700 *scene = (Scene1700 *)R2_GLOBALS._sceneManager._scene; R2_GLOBALS._player.disableControl(); - R2_GLOBALS._v558B6.set(80, 0, 240, 200); scene->_sceneMode = 4; Common::Point pt(271, 90); @@ -10333,7 +10217,7 @@ bool Scene1700::RimTransport::startAction(CursorType action, Event &event) { return true; } -bool Scene1700::Actor12::startAction(CursorType action, Event &event) { +bool Scene1700::Companion::startAction(CursorType action, Event &event) { if (action != CURSOR_TALK) return SceneActor::startAction(action, event); @@ -10391,23 +10275,14 @@ void Scene1700::enterArea() { _westPlatform.remove(); _rimTransportDoor.remove(); _rimTransport.remove(); - + if (_sceneMode != 40) { _ledgeHopper.remove(); - _actor10.remove(); + _hatch.remove(); } - warning("tmpRect = _v5589E;"); - warning("Mouse_hideIfNeeded"); - warning("set_pane_p(_paneNumber);"); - warning("Big loop calling gfx_draw_slice_p"); - - if (_field77A == 0) - _field77A = 1; - else - _field77A = 0; - - warning("set_pane_p(_paneNumber);"); + // The original had manual code here to redraw the background manually when + // changing areas within the scene. Which seems to be totally redundant. if (_sceneMode != 40 && R2_GLOBALS._rimLocation == 0) { // Crashed ledge hopper @@ -10463,7 +10338,7 @@ void Scene1700::enterArea() { // Rim transport vechile located R2_GLOBALS._rimTransportLocation = R2_GLOBALS._rimLocation; if (!R2_GLOBALS.getFlag(15)) - _field77C = 1; + _walkFlag = true; _rimTransport.postInit(); _rimTransport.setup(1700, 3, 1); @@ -10503,44 +10378,44 @@ void Scene1700::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._moveDiff = Common::Point(3, 1); } - _actor12.postInit(); - _actor12.animate(ANIM_MODE_1, NULL); - _actor12.setObjectWrapper(new SceneObjectWrapper()); + _companion.postInit(); + _companion.animate(ANIM_MODE_1, NULL); + _companion.setObjectWrapper(new SceneObjectWrapper()); if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - _actor12.setVisage(1506); - _actor12._moveDiff = Common::Point(3, 1); - _actor12.setDetails(9002, 1, -1, -1, 1, (SceneItem *) NULL); + _companion.setVisage(1506); + _companion._moveDiff = Common::Point(3, 1); + _companion.setDetails(9002, 1, -1, -1, 1, (SceneItem *) NULL); } else { - _actor12.setVisage(1501); - _actor12._moveDiff = Common::Point(2, 1); - _actor12.setDetails(9001, 1, -1, -1, 1, (SceneItem *) NULL); + _companion.setVisage(1501); + _companion._moveDiff = Common::Point(2, 1); + _companion.setDetails(9001, 1, -1, -1, 1, (SceneItem *) NULL); } R2_GLOBALS._sound1.play(134); - _actor1.postInit(); - _actor1.fixPriority(10); + _playerShadow.postInit(); + _playerShadow.fixPriority(10); if (R2_GLOBALS._player._characterIndex == R2_QUINN) - _actor1.setVisage(1112); + _playerShadow.setVisage(1112); else - _actor1.setVisage(1111); + _playerShadow.setVisage(1111); - _actor1._effect = 5; - _actor1._field9C = _field312; - R2_GLOBALS._player._linkedActor = &_actor1; + _playerShadow._effect = EFFECT_SHADOW_MAP; + _playerShadow._shadowMap = _shadowPaletteMap; + R2_GLOBALS._player._linkedActor = &_playerShadow; - _actor2.postInit(); - _actor2.fixPriority(10); + _companionShadow.postInit(); + _companionShadow.fixPriority(10); if (R2_GLOBALS._player._characterIndex == R2_QUINN) - _actor2.setVisage(1111); + _companionShadow.setVisage(1111); else - _actor2.setVisage(1112); + _companionShadow.setVisage(1112); - _actor2._effect = 5; - _actor2._field9C = _field312; - _actor12._linkedActor = &_actor2; + _companionShadow._effect = EFFECT_SHADOW_MAP; + _companionShadow._shadowMap = _shadowPaletteMap; + _companion._linkedActor = &_companionShadow; R2_GLOBALS._sound1.play(134); @@ -10549,60 +10424,59 @@ void Scene1700::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._characterIndex = R2_QUINN; R2_GLOBALS._player.disableControl(); R2_GLOBALS._player.hide(); - _actor12.hide(); + _companion.hide(); - _actor10.postInit(); - warning("_actor10._actorName = \"hatch\";"); - _actor10.hide(); + _hatch.postInit(); + _hatch.hide(); _ledgeHopper.postInit(); _ledgeHopper.setup(1701, 1, 1); _ledgeHopper.setPosition(Common::Point(220, 137)); _ledgeHopper.setDetails(1700, 6, -1, -1, 1, (SceneItem *) NULL); - _actor1.hide(); - _actor2.hide(); + _playerShadow.hide(); + _companionShadow.hide(); R2_GLOBALS._events.setCursor(CURSOR_WALK); _stripManager.start(539, this); _sceneMode = 40; break; case 1750: { R2_GLOBALS._player.setPosition(Common::Point(282, 121)); - _actor12.setPosition(Common::Point(282, 139)); + _companion.setPosition(Common::Point(282, 139)); _sceneMode = 8; Common::Point pt(262, 101); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); Common::Point pt2(262, 119); NpcMover *mover2 = new NpcMover(); - _actor12.addMover(mover2, &pt2, this); + _companion.addMover(mover2, &pt2, this); } break; case 1800: { R2_GLOBALS._player.disableControl(); R2_GLOBALS._player.setPosition(Common::Point(0, 86)); - _actor12.setPosition(Common::Point(0, 64)); + _companion.setPosition(Common::Point(0, 64)); _sceneMode = 7; R2_GLOBALS._player.setObjectWrapper(NULL); R2_GLOBALS._player._strip = 1; Common::Point pt(64, 86); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); - _actor12.setObjectWrapper(NULL); - _actor12._strip = 1; + _companion.setObjectWrapper(NULL); + _companion._strip = 1; Common::Point pt2(77, 64); NpcMover *mover2 = new NpcMover(); - _actor12.addMover(mover2, &pt2, NULL); + _companion.addMover(mover2, &pt2, NULL); } break; default: if (R2_GLOBALS._player._characterIndex == R2_QUINN) { R2_GLOBALS._player.setPosition(Common::Point(109, 160)); - _actor12.setPosition(Common::Point(156, 160)); + _companion.setPosition(Common::Point(156, 160)); R2_GLOBALS._walkRegions.disableRegion(15); } else { R2_GLOBALS._player.setPosition(Common::Point(156, 160)); - _actor12.setPosition(Common::Point(109, 160)); + _companion.setPosition(Common::Point(109, 160)); R2_GLOBALS._walkRegions.disableRegion(17); } _sceneMode = 50; @@ -10614,10 +10488,10 @@ void Scene1700::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._oldCharacterScene[R2_QUINN] = 1700; R2_GLOBALS._player._oldCharacterScene[R2_SEEKER] = 1700; - R2_GLOBALS._v558B6.set(20, 0, 320, 200); enterArea(); - _item1.setDetails(1, 1700, 3, -1, -1); - _item2.setDetails(Rect(0, 0, 480, 200), 1700, 0, -1, -1, 1, NULL); + + _surface.setDetails(1, 1700, 3, -1, -1); + _background.setDetails(Rect(0, 0, 480, 200), 1700, 0, -1, -1, 1, NULL); } void Scene1700::remove() { @@ -10638,16 +10512,16 @@ void Scene1700::signal() { R2_GLOBALS._player.addMover(mover, &pt, this); if (R2_GLOBALS._player._position.x < 132) { - _actor12.setPosition(Common::Point(156, 170)); + _companion.setPosition(Common::Point(156, 170)); Common::Point pt2(156, 160); NpcMover *mover2 = new NpcMover(); - _actor12.addMover(mover2, &pt2, NULL); + _companion.addMover(mover2, &pt2, NULL); R2_GLOBALS._walkRegions.disableRegion(15); } else { - _actor12.setPosition(Common::Point(109, 170)); + _companion.setPosition(Common::Point(109, 170)); Common::Point pt3(109, 160); NpcMover *mover3 = new NpcMover(); - _actor12.addMover(mover3, &pt3, NULL); + _companion.addMover(mover3, &pt3, NULL); R2_GLOBALS._walkRegions.disableRegion(17); } } @@ -10663,26 +10537,26 @@ void Scene1700::signal() { R2_GLOBALS._player.addMover(mover, &pt, this); if (R2_GLOBALS._player._position.x >= 171) { - _actor12.setPosition(Common::Point(155, 0)); + _companion.setPosition(Common::Point(155, 0)); Common::Point pt2(155, 10); NpcMover *mover2 = new NpcMover(); - _actor12.addMover(mover2, &pt2, NULL); + _companion.addMover(mover2, &pt2, NULL); R2_GLOBALS._walkRegions.disableRegion(15); } else { - _actor12.setPosition(Common::Point(188, 0)); + _companion.setPosition(Common::Point(188, 0)); Common::Point pt3(188, 10); NpcMover *mover3 = new NpcMover(); - _actor12.addMover(mover3, &pt3, NULL); + _companion.addMover(mover3, &pt3, NULL); R2_GLOBALS._walkRegions.disableRegion(17); } } break; case 3: - if (_field77C == 0) { + if (!_walkFlag) { R2_GLOBALS._player.enableControl(CURSOR_WALK); } else { R2_GLOBALS.setFlag(15); - _field77C = 0; + _walkFlag = false; _sceneMode = 31; R2_GLOBALS._events.setCursor(CURSOR_WALK); if (R2_GLOBALS._player._characterIndex == R2_QUINN) @@ -10695,7 +10569,7 @@ void Scene1700::signal() { _sceneMode = 5; Common::Point pt(271, 90); PlayerMover *mover = new PlayerMover(); - _actor12.addMover(mover, &pt, NULL); + _companion.addMover(mover, &pt, NULL); if (R2_GLOBALS._player._characterIndex == R2_QUINN) setAction(&_sequenceManager, this, 1700, &R2_GLOBALS._player, &_rimTransportDoor, NULL); else @@ -10711,14 +10585,14 @@ void Scene1700::signal() { case 7: R2_GLOBALS._player.setObjectWrapper(new SceneObjectWrapper()); R2_GLOBALS._player._strip = 1; - _actor12.setObjectWrapper(new SceneObjectWrapper()); - _actor12._strip = 1; + _companion.setObjectWrapper(new SceneObjectWrapper()); + _companion._strip = 1; R2_GLOBALS._player.enableControl(CURSOR_WALK); R2_GLOBALS._walkRegions.disableRegion(14); break; case 8: R2_GLOBALS._player._strip = 2; - _actor12._strip = 1; + _companion._strip = 1; R2_GLOBALS._player.enableControl(CURSOR_WALK); R2_GLOBALS._walkRegions.disableRegion(12); break; @@ -10732,13 +10606,13 @@ void Scene1700::signal() { _stripManager.start(541, this); break; case 31: - R2_GLOBALS._v56AAB = 0; R2_GLOBALS._player.enableControl(CURSOR_TALK); break; case 40: R2_GLOBALS._player.disableControl(); _sceneMode = 1704; - setAction(&_sequenceManager, this, 1704, &R2_GLOBALS._player, &_actor12, &_actor10, &_ledgeHopper, &_actor1, &_actor2, NULL); + setAction(&_sequenceManager, this, 1704, &R2_GLOBALS._player, &_companion, + &_hatch, &_ledgeHopper, &_playerShadow, &_companionShadow, NULL); break; case 50: if (R2_GLOBALS._player._characterIndex == R2_QUINN) @@ -10866,13 +10740,8 @@ void Scene1750::SpeedSlider::calculateSlider() { scene->_speed = scene->_direction * tmpVar2; } -void Scene1750::SpeedSlider::remove() { - // Function kept to match IDA. Could be removed. - SceneActor::remove(); -} - void Scene1750::SpeedSlider::process(Event &event) { - if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_USE) && + if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_USE) && (_bounds.contains(event.mousePos))) { _mouseDown = true; event.eventType = EVENT_NONE; @@ -10909,12 +10778,14 @@ bool Scene1750::SpeedSlider::startAction(CursorType action, Event &event) { Scene1750::Scene1750() { _direction = 0; - _field413 = 0; + _speedCurrent = 0; _speed = 0; - _field417 = 0; - _field419 = 0; - _field41B = 0; - _field41D = 0; + _speedDelta = 0; + _rotationSegment = 0; + _rotationSegCurrent = 0; + _newRotation = 0; + + _rotation = nullptr; } void Scene1750::synchronize(Serializer &s) { @@ -10922,20 +10793,21 @@ void Scene1750::synchronize(Serializer &s) { SYNC_POINTER(_rotation); s.syncAsSint16LE(_direction); - s.syncAsSint16LE(_field413); + s.syncAsSint16LE(_speedCurrent); s.syncAsSint16LE(_speed); - s.syncAsSint16LE(_field417); - s.syncAsSint16LE(_field419); - s.syncAsSint16LE(_field41B); - s.syncAsSint16LE(_field41D); + s.syncAsSint16LE(_speedDelta); + s.syncAsSint16LE(_rotationSegment); + s.syncAsSint16LE(_rotationSegCurrent); + s.syncAsSint16LE(_newRotation); } void Scene1750::postInit(SceneObjectList *OwnerList) { loadScene(1750); R2_GLOBALS._sound1.play(115); R2_GLOBALS._uiElements._active = false; - R2_GLOBALS._v5589E.set(0, 0, 320, 200); + SceneExt::postInit(); + R2_GLOBALS._interfaceY = SCREEN_HEIGHT; R2_GLOBALS._player._characterScene[R2_QUINN] = 1750; R2_GLOBALS._player._characterScene[R2_SEEKER] = 1750; @@ -10985,28 +10857,28 @@ void Scene1750::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.hide(); R2_GLOBALS._player.enableControl(); - _actor3.postInit(); - _actor3.setup(1750, 3, 1); - _actor3.setPosition(Common::Point(49, 185)); - _actor3.fixPriority(7); - _actor3.setDetails(1750, 30, -1, -1, 1, (SceneItem *) NULL); + _radarSweep.postInit(); + _radarSweep.setup(1750, 3, 1); + _radarSweep.setPosition(Common::Point(49, 185)); + _radarSweep.fixPriority(7); + _radarSweep.setDetails(1750, 30, -1, -1, 1, (SceneItem *) NULL); - _actor1.postInit(); - _actor1.setup(1750, 2, 1); - _actor1.setPosition(Common::Point(35, ((_rotation->_currIndex - 218) % 4) + ((R2_GLOBALS._rimLocation % 800) * 4) - 1440)); - _actor1.fixPriority(8); + _scannerIcon.postInit(); + _scannerIcon.setup(1750, 2, 1); + _scannerIcon.setPosition(Common::Point(35, ((_rotation->_currIndex - 218) % 4) + ((R2_GLOBALS._rimLocation % 800) * 4) - 1440)); + _scannerIcon.fixPriority(8); - _actor2.postInit(); - _actor2.setup(1750, 1, 4); + _redLights.postInit(); + _redLights.setup(1750, 1, 4); - int tmpVar = abs(_actor1._position.y - 158) / 100; + int tmpVar = ABS(_scannerIcon._position.y - 158) / 100; if (tmpVar >= 8) - _actor2.hide(); - else if (_actor1._position.y <= 158) - _actor2.setPosition(Common::Point(137, (tmpVar * 7) + 122)); + _redLights.hide(); + else if (_scannerIcon._position.y <= 158) + _redLights.setPosition(Common::Point(137, (tmpVar * 7) + 122)); else - _actor2.setPosition(Common::Point(148, (tmpVar * 7) + 122)); + _redLights.setPosition(Common::Point(148, (tmpVar * 7) + 122)); _speedSlider.setupSlider(1, 286, 143, 41, 15); _speedSlider.setDetails(1750, 24, 1, -1, 1, (SceneItem *) NULL); @@ -11031,12 +10903,12 @@ void Scene1750::postInit(SceneObjectList *OwnerList) { _exitButton.setDetails(1750, 27, 1, -1, 1, (SceneItem *) NULL); _direction = 1; // Forward by default - _field417 = 0; - _field413 = 0; + _speedDelta = 0; + _speedCurrent = 0; _speed = 0; - _field419 = ((_rotation->_currIndex - 218) / 4) % 4; + _rotationSegment = ((_rotation->_currIndex - 218) / 4) % 4; - _redLights.setDetails(Rect(129, 112, 155, 175), 1750, 21, -1, -1, 1, NULL); + _redLightsDescr.setDetails(Rect(129, 112, 155, 175), 1750, 21, -1, -1, 1, NULL); _greenLights.setDetails(Rect(93, 122, 126, 172), 1750, 15, -1, -1, 1, NULL); _frontView.setDetails(Rect(3, 3, 157, 99), 1750, 9, -1, -1, 1, NULL); _rearView.setDetails(Rect(162, 3, 316, 99), 1750, 12, -1, -1, 1, NULL); @@ -11054,8 +10926,6 @@ void Scene1750::remove() { SceneExt::remove(); R2_GLOBALS._sound1.fadeOut2(NULL); - R2_GLOBALS._v5589E.top = 3; - R2_GLOBALS._v5589E.bottom = 168; R2_GLOBALS._uiElements._active = true; } @@ -11071,71 +10941,73 @@ void Scene1750::process(Event &event) { void Scene1750::dispatch() { if (_rotation) { - if (!_field417 && (_speed != _field413)) { - if (_field413 >= _speed) - --_field413; + if (!_speedDelta && (_speed != _speedCurrent)) { + if (_speedCurrent >= _speed) + --_speedCurrent; else - ++_field413; + ++_speedCurrent; - _field417 = 21 - ABS(_field413); + _speedDelta = 21 - ABS(_speedCurrent); } - if (_field417 == 1) { - if (_field413 == 0) { - _actor3.show(); + if (_speedDelta == 1) { + if (_speedCurrent == 0) { + _radarSweep.show(); _rotation->_idxChange = 0; } else { if (_rotation->_idxChange == 0) - _actor3.hide(); + _radarSweep.hide(); - if (_field413 < -12) { - _rotation->setDelay(15 - ABS(_field413)); + if (_speedCurrent < -12) { + _rotation->setDelay(15 - ABS(_speedCurrent)); _rotation->_idxChange = -2; - } else if (_field413 < 0) { - _rotation->setDelay(10 - ABS(_field413)); + } else if (_speedCurrent < 0) { + _rotation->setDelay(10 - ABS(_speedCurrent)); _rotation->_idxChange = -1; - } else if (_field413 < 11) { - _rotation->setDelay(10 - _field413); + } else if (_speedCurrent < 11) { + _rotation->setDelay(10 - _speedCurrent); _rotation->_idxChange = 1; } else { - _rotation->setDelay(15 - _field413); + _rotation->setDelay(15 - _speedCurrent); _rotation->_idxChange = 2; } - } + } } - if (_field417) - --_field417; + if (_speedDelta) + --_speedDelta; - _field41B = _field419; - _field419 = ((_rotation->_currIndex - 218) / 4) / 4; + _rotationSegCurrent = _rotationSegment; + _rotationSegment = ((_rotation->_currIndex - 218) / 4) % 4; - if ((_field41B + 1) == _field419 || (_field41B - 3) == _field419) { + if ((_rotationSegCurrent + 1) == _rotationSegment || (_rotationSegCurrent - 3) == _rotationSegment) { if (R2_GLOBALS._rimLocation < 2400) { ++R2_GLOBALS._rimLocation; } } - if ((_field41B - 1) == _field419 || (_field41B + 3) == _field419) { + if ((_rotationSegCurrent - 1) == _rotationSegment || (_rotationSegCurrent + 3) == _rotationSegment) { if (R2_GLOBALS._rimLocation > -2400) { --R2_GLOBALS._rimLocation; } } - if (_rotation->_currIndex != _field41D) { - _field41D = _rotation->_currIndex; - _actor1.setPosition(Common::Point(35, ((_rotation->_currIndex - 218) % 4) + + if (_rotation->_currIndex != _newRotation) { + // Handle setting the position of the lift icon in the scanner display + _newRotation = _rotation->_currIndex; + _scannerIcon.setPosition(Common::Point(35, ((_rotation->_currIndex - 218) % 4) + ((R2_GLOBALS._rimLocation % 800) * 4) - 1440)); } } - int v = ABS(_actor1._position.y - 158) / 100; + int v = ABS(_scannerIcon._position.y - 158) / 100; if (v < 8) { - _actor2.show(); - _actor2.setPosition(Common::Point((_actor1._position.y <= 158) ? 137 : 148, + // Show how close the user is to the lift on the second column of lights + _redLights.show(); + _redLights.setPosition(Common::Point((_scannerIcon._position.y <= 158) ? 137 : 148, v * 7 + 122)); } else { - _actor2.hide(); + _redLights.hide(); } } @@ -11231,8 +11103,11 @@ bool Scene1800::Doors::startAction(CursorType action, Event &event) { R2_GLOBALS.setFlag(14); } } else { + // Seeker failing to force open doors scene->_sceneMode = 1813; - scene->setAction(&scene->_sequenceManager, scene, 1813, &R2_GLOBALS._player, NULL); + // Original was using 1813 in setAction too, but it somewhat broken. + // Seeker goes 2 pixels to high, hiding behind the door + scene->setAction(&scene->_sequenceManager, scene, 1808, &R2_GLOBALS._player, &scene->_doors, NULL); } } else if (R2_GLOBALS.getFlag(14)) { return SceneActor::startAction(action, event); @@ -11278,30 +11153,28 @@ bool Scene1800::PassengerDoor::startAction(CursorType action, Event &event) { } } } + } else if (scene->_leftStaircase._frame == 1) { + return SceneActor::startAction(action, event); } else { - if (scene->_leftStaircase._frame == 1) { - return SceneActor::startAction(action, event); + R2_GLOBALS.clearFlag(29); + R2_GLOBALS._player.disableControl(); + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + if (R2_GLOBALS.getFlag(14)) { + scene->_sceneMode = 2; + scene->setAction(&scene->_sequenceManager, scene, 1809, &scene->_companion, &scene->_doors, NULL); + R2_GLOBALS.clearFlag(14); + } else { + scene->_sceneMode = 1806; + scene->setAction(&scene->_sequenceManager, scene, 1806, &R2_GLOBALS._player, &scene->_companion, &scene->_rightDoor, NULL); + } } else { - R2_GLOBALS.clearFlag(29); - R2_GLOBALS._player.disableControl(); - if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - if (R2_GLOBALS.getFlag(14)) { - scene->_sceneMode = 2; - scene->setAction(&scene->_sequenceManager, scene, 1809, &scene->_companion, &scene->_doors, NULL); - R2_GLOBALS.clearFlag(14); - } else { - scene->_sceneMode = 1806; - scene->setAction(&scene->_sequenceManager, scene, 1806, &R2_GLOBALS._player, &scene->_companion, &scene->_rightDoor, NULL); - } + if (R2_GLOBALS.getFlag(14)) { + scene->_sceneMode = 2; + scene->setAction(&scene->_sequenceManager, scene, 1809, &R2_GLOBALS._player, &scene->_doors, NULL); + R2_GLOBALS.clearFlag(14); } else { - if (R2_GLOBALS.getFlag(14)) { - scene->_sceneMode = 2; - scene->setAction(&scene->_sequenceManager, scene, 1809, &R2_GLOBALS._player, &scene->_doors, NULL); - R2_GLOBALS.clearFlag(14); - } else { - scene->_sceneMode = 1807; - scene->setAction(&scene->_sequenceManager, scene, 1807, &R2_GLOBALS._player, &scene->_companion, &scene->_rightDoor, NULL); - } + scene->_sceneMode = 1807; + scene->setAction(&scene->_sequenceManager, scene, 1807, &R2_GLOBALS._player, &scene->_companion, &scene->_rightDoor, NULL); } } } @@ -11309,7 +11182,7 @@ bool Scene1800::PassengerDoor::startAction(CursorType action, Event &event) { return true; } -void Scene1800::Exit1::changeScene() { +void Scene1800::SouthExit::changeScene() { Scene1800 *scene = (Scene1800 *)R2_GLOBALS._sceneManager._scene; _enabled = false; @@ -11327,7 +11200,7 @@ void Scene1800::Exit1::changeScene() { if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 1802, &R2_GLOBALS._player, &scene->_companion, NULL); else - scene->setAction(&scene->_sequenceManager, scene, 1802, &R2_GLOBALS._player, &scene->_companion, NULL); + scene->setAction(&scene->_sequenceManager, scene, 1803, &R2_GLOBALS._player, &scene->_companion, NULL); } } @@ -11348,7 +11221,7 @@ void Scene1800::postInit(SceneObjectList *OwnerList) { _locationMode = 0; scalePalette(65, 65, 65); - _exit1.setDetails(Rect(0, 160, 319, 168), EXITCURSOR_S, 1800); + _southExit.setDetails(Rect(0, 160, 319, 168), EXITCURSOR_S, 1800); _background.setDetails(Rect(0, 0, 320, 200), -1, -1, -1, -1, 1, NULL); _lever.postInit(); @@ -11458,50 +11331,48 @@ void Scene1800::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._walkRegions.disableRegion(10); R2_GLOBALS._walkRegions.disableRegion(11); } + } else if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + R2_GLOBALS._player.setPosition(Common::Point(140, 160)); + _companion.setPosition(Common::Point(180, 160)); } else { - if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - R2_GLOBALS._player.setPosition(Common::Point(140, 160)); - _companion.setPosition(Common::Point(180, 160)); - } else { - R2_GLOBALS._player.setPosition(Common::Point(180, 160)); - _companion.setPosition(Common::Point(140, 160)); - } + R2_GLOBALS._player.setPosition(Common::Point(180, 160)); + _companion.setPosition(Common::Point(140, 160)); } - _actor1.postInit(); - _actor1.fixPriority(10); + _playerShadow.postInit(); + _playerShadow.fixPriority(10); if (R2_GLOBALS._player._characterIndex == R2_QUINN) - _actor1.setVisage(1111); + _playerShadow.setVisage(1111); else - _actor1.setVisage(1110); + _playerShadow.setVisage(1110); - _actor1._effect = 5; - _actor1._field9C = _field312; + _playerShadow._effect = EFFECT_SHADOW_MAP; + _playerShadow._shadowMap = _shadowPaletteMap; - R2_GLOBALS._player._linkedActor = &_actor1; + R2_GLOBALS._player._linkedActor = &_playerShadow; - _actor3.postInit(); - _actor3.fixPriority(10); + _companionShadow.postInit(); + _companionShadow.fixPriority(10); if (R2_GLOBALS._player._characterIndex == R2_QUINN) - _actor3.setVisage(1110); + _companionShadow.setVisage(1110); else - _actor3.setVisage(1111); + _companionShadow.setVisage(1111); - _actor3._effect = 5; - _actor3._field9C = _field312; + _companionShadow._effect = EFFECT_SHADOW_MAP; + _companionShadow._shadowMap = _shadowPaletteMap; - _companion._linkedActor = &_actor3; + _companion._linkedActor = &_companionShadow; R2_GLOBALS._player._characterScene[R2_QUINN] = 1800; R2_GLOBALS._player._characterScene[R2_SEEKER] = 1800; - _item2.setDetails(Rect(128, 95, 190, 135), 1800, 10, -1, -1, 1, NULL); - _item1.setDetails(Rect(95, 3, 223, 135), 1800, 0, -1, -1, 1, NULL); + _elevatorContents.setDetails(Rect(128, 95, 190, 135), 1800, 10, -1, -1, 1, NULL); + _elevator.setDetails(Rect(95, 3, 223, 135), 1800, 0, -1, -1, 1, NULL); // Original was calling _item3.setDetails(Rect(1800, 11, 24, 23), 25, -1, -1, -1, 1, NULL); // This is *wrong*. The following statement is a wild guess based on good common sense - _item3.setDetails(11, 1800, 23, 24, 25); - _item4.setDetails(Rect(0, 0, 320, 200), 1800, 17, -1, 19, 1, NULL); + _surface.setDetails(11, 1800, 23, 24, 25); + _secBackground.setDetails(Rect(0, 0, 320, 200), 1800, 17, -1, 19, 1, NULL); R2_GLOBALS._player.disableControl(); if (R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] == 1800) { @@ -11520,23 +11391,19 @@ void Scene1800::postInit(SceneObjectList *OwnerList) { _sceneMode = 1815; setAction(&_sequenceManager, this, 1815, &R2_GLOBALS._player, &_companion, &_leftDoor, NULL); } + } else if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + _sceneMode = 1816; + setAction(&_sequenceManager, this, 1816, &R2_GLOBALS._player, &_companion, &_rightDoor, NULL); } else { - if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - _sceneMode = 1816; - setAction(&_sequenceManager, this, 1816, &R2_GLOBALS._player, &_companion, &_rightDoor, NULL); - } else { - _sceneMode = 1817; - setAction(&_sequenceManager, this, 1817, &R2_GLOBALS._player, &_companion, &_rightDoor, NULL); - } + _sceneMode = 1817; + setAction(&_sequenceManager, this, 1817, &R2_GLOBALS._player, &_companion, &_rightDoor, NULL); } + } else if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + _sceneMode = 1800; + setAction(&_sequenceManager, this, 1800, &R2_GLOBALS._player, &_companion, NULL); } else { - if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - _sceneMode = 1800; - setAction(&_sequenceManager, this, 1800, &R2_GLOBALS._player, &_companion, NULL); - } else { - _sceneMode = 1801; - setAction(&_sequenceManager, this, 1801, &R2_GLOBALS._player, &_companion, NULL); - } + _sceneMode = 1801; + setAction(&_sequenceManager, this, 1801, &R2_GLOBALS._player, &_companion, NULL); } R2_GLOBALS._player._oldCharacterScene[R2_QUINN] = 1800; @@ -11583,7 +11450,7 @@ void Scene1800::signal() { _sceneMode = 14; R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); R2_GLOBALS._player.setup(1801, 7, 1); - R2_GLOBALS._player.animate(ANIM_MODE_8, NULL); + R2_GLOBALS._player.animate(ANIM_MODE_8, 0, NULL); _stripManager.start(550, this); break; case 14: @@ -11597,6 +11464,29 @@ void Scene1800::signal() { R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); R2_GLOBALS._player.enableControl(CURSOR_USE); break; + // Cases 23 and 24 have been added to fix missing hardcoded logic in the original, + // when Seeker tries to open the door + case 23: + _sceneMode = 24; + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + R2_GLOBALS._player.setup(1801, 5, 1); + R2_GLOBALS._player.animate(ANIM_MODE_8, 0, NULL); + _stripManager.start(550, this); + break; + case 24: + R2_GLOBALS._player.disableControl(); + R2_GLOBALS._player.setup(1507, 4, 1); + R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); + R2_GLOBALS._player.enableControl(CURSOR_USE); + + _doors.setup(1801, 3, 1); + _doors.setPosition(Common::Point(160, 139)); + _doors.setDetails(1800, 6, -1, -1, 1, (SceneItem *) NULL); + _doors.show(); + + R2_GLOBALS._player._position.y += 2; + R2_GLOBALS._player.show(); + break; case 1800: R2_GLOBALS._walkRegions.disableRegion(8); if (R2_GLOBALS.getFlag(63)) @@ -11611,16 +11501,7 @@ void Scene1800::signal() { R2_GLOBALS._walkRegions.disableRegion(10); R2_GLOBALS._walkRegions.disableRegion(11); R2_GLOBALS.setFlag(63); - - // The following check is completely dumb. - // Either an original bug, or dead code. - if (R2_GLOBALS.getFlag(63)) { - R2_GLOBALS._player.enableControl(CURSOR_WALK); - } else { - _sceneMode = 10; - R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); - _stripManager.start(545, this); - } + R2_GLOBALS._player.enableControl(CURSOR_WALK); break; case 1802: R2_GLOBALS.clearFlag(14); @@ -11645,6 +11526,11 @@ void Scene1800::signal() { _sceneMode = 13; R2_GLOBALS._player.animate(ANIM_MODE_5, this); break; + // Case 1813 has been added to fix Seeker missing animation in the original game + case 1813: + _sceneMode = 23; + R2_GLOBALS._player.animate(ANIM_MODE_5, this); + break; case 1814: // No break on purpose case 1815: @@ -11690,7 +11576,7 @@ bool Scene1850::Button::startAction(CursorType action, Event &event) { else scene->setAction(&scene->_sequenceManager1, scene, 1852, &R2_GLOBALS._player, NULL); } else if (R2_GLOBALS.getFlag(30)) { - scene->_field41E = 1; + scene->_seqNumber = 1; scene->_sceneMode = 1860; if (R2_GLOBALS.getFlag(32)) @@ -11732,9 +11618,9 @@ bool Scene1850::Robot::startAction(CursorType action, Event &event) { break; case CURSOR_LOOK: if (R2_GLOBALS.getFlag(34)) - SceneItem::display(1850, 2, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1850, 2, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); else - SceneItem::display(1850, 1, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1850, 1, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); return true; break; @@ -11754,12 +11640,14 @@ bool Scene1850::Robot::startAction(CursorType action, Event &event) { } else if (R2_GLOBALS.getFlag(30)) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 1875; - scene->_actor2.postInit(); + scene->_airbag.postInit(); if (R2_GLOBALS.getFlag(32)) - scene->setAction(&scene->_sequenceManager1, scene, 1876, &R2_GLOBALS._player, &scene->_actor2, NULL); + scene->setAction(&scene->_sequenceManager1, scene, 1876, + &R2_GLOBALS._player, &scene->_airbag, NULL); else - scene->setAction(&scene->_sequenceManager1, scene, 1875, &R2_GLOBALS._player, &scene->_actor2, NULL); + scene->setAction(&scene->_sequenceManager1, scene, 1875, + &R2_GLOBALS._player, &scene->_airbag, NULL); return true; } else if (R2_GLOBALS.getFlag(70)) { @@ -11781,7 +11669,8 @@ bool Scene1850::Robot::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 1878; - scene->setAction(&scene->_sequenceManager1, scene, 1878, &R2_GLOBALS._player, &scene->_robot, &scene->_actor2, NULL); + scene->setAction(&scene->_sequenceManager1, scene, 1878, &R2_GLOBALS._player, + &scene->_robot, &scene->_airbag, NULL); } return true; @@ -11792,20 +11681,20 @@ bool Scene1850::Robot::startAction(CursorType action, Event &event) { } } -bool Scene1850::Actor6::startAction(CursorType action, Event &event) { +bool Scene1850::Door::startAction(CursorType action, Event &event) { if (action != CURSOR_USE) return SceneHotspot::startAction(action, event); - Scene1850 *scene = (Scene1850 *)R2_GLOBALS._sceneManager._scene; - if (R2_GLOBALS.getFlag(32)) { - SceneItem::display(3240, 4, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(3240, 4, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); return true; } + Scene1850 *scene = (Scene1850 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); - if (scene->_field412 == 1851) - R2_GLOBALS._player._effect = 1; + if (scene->_sceneMode == 1851) + R2_GLOBALS._player._effect = EFFECT_SHADED; if (_position.x >= 160) R2_GLOBALS.setFlag(29); @@ -11814,9 +11703,9 @@ bool Scene1850::Actor6::startAction(CursorType action, Event &event) { if ((R2_GLOBALS._player._characterIndex == R2_SEEKER) && (R2_GLOBALS.getFlag(30))) { if (_position.x >= 160) - scene->_field41E = 3; + scene->_seqNumber = 3; else - scene->_field41E = 2; + scene->_seqNumber = 2; scene->_sceneMode = 1860; @@ -11858,23 +11747,23 @@ bool Scene1850::DisplayScreen::startAction(CursorType action, Event &event) { /*------------------------------------------------------------------------*/ Scene1850::Scene1850() { - _field412 = 0; - _field414 = 0; - _field416 = 0; - _field418 = 0; - _field41E = 0; + _sceneMode = 0; + _shadeCountdown = 0; + _shadeDirection = 0; + _shadeChanging = false; + _seqNumber = 0; } void Scene1850::synchronize(Serializer &s) { SceneExt::synchronize(s); - s.syncAsSint16LE(_field412); - s.syncAsSint16LE(_field414); - s.syncAsSint16LE(_field416); - s.syncAsSint16LE(_field418); - s.syncAsSint16LE(_field41E); - s.syncAsSint16LE(_field41A.x); - s.syncAsSint16LE(_field41A.y); + s.syncAsSint16LE(_sceneMode); + s.syncAsSint16LE(_shadeCountdown); + s.syncAsSint16LE(_shadeDirection); + s.syncAsSint16LE(_shadeChanging); + s.syncAsSint16LE(_seqNumber); + s.syncAsSint16LE(_playerDest.x); + s.syncAsSint16LE(_playerDest.y); } void Scene1850::postInit(SceneObjectList *OwnerList) { @@ -11886,10 +11775,10 @@ void Scene1850::postInit(SceneObjectList *OwnerList) { _palette1.loadPalette(0); if (R2_GLOBALS.getFlag(31)) { - _field412 = 1850; + _sceneMode = 1850; g_globals->_scenePalette.loadPalette(1850); } else { - _field412 = 1851; + _sceneMode = 1851; g_globals->_scenePalette.loadPalette(1851); } @@ -11901,9 +11790,9 @@ void Scene1850::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_quinnSpeaker); _stripManager.addSpeaker(&_seekerSpeaker); - _field418 = 0; - _field41E = 0; - _field41A = Common::Point(0, 0); + _shadeChanging = false; + _seqNumber = 0; + _playerDest = Common::Point(0, 0); R2_GLOBALS._player._characterScene[R2_QUINN] = 1850; R2_GLOBALS._player._characterScene[R2_SEEKER] = 1850; @@ -11953,8 +11842,8 @@ void Scene1850::postInit(SceneObjectList *OwnerList) { } if (R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] == 1850) { - R2_GLOBALS._player._effect = 6; - _companion._effect = 6; + R2_GLOBALS._player._effect = EFFECT_SHADED2; + _companion._effect = EFFECT_SHADED2; if (R2_GLOBALS.getFlag(31)) { R2_GLOBALS._player._shade = 0; _companion._shade = 0; @@ -11964,21 +11853,21 @@ void Scene1850::postInit(SceneObjectList *OwnerList) { } if (R2_INVENTORY.getObjectScene(R2_AIRBAG) == 1850) { - _actor2.postInit(); + _airbag.postInit(); if (R2_GLOBALS.getFlag(34)) { - _actor2.setup(1851, 4, 2); - _actor2.fixPriority(114); + _airbag.setup(1851, 4, 2); + _airbag.fixPriority(114); } else { - _actor2.setup(1851, 4, 1); + _airbag.setup(1851, 4, 1); } - _actor2.setPosition(Common::Point(179, 113)); + _airbag.setPosition(Common::Point(179, 113)); if ((_robot._strip == 1) && (_robot._frame == 3)){ - _actor2.hide(); + _airbag.hide(); } - _actor2.setDetails(1850, 6, -1, -1, 1, (SceneItem *) NULL); + _airbag.setDetails(1850, 6, -1, -1, 1, (SceneItem *) NULL); } if (R2_GLOBALS._player._characterIndex == R2_QUINN) { @@ -11986,89 +11875,61 @@ void Scene1850::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.setVisage(1511); _companion.setVisage(1508); - _actor3.postInit(); - _actor3.setup(1853, 3, 1); - _actor3.setPosition(Common::Point(122, 113)); - _actor3.fixPriority(114); - _actor3._effect = 6; - - // Totally useless test - if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - _actor3.setDetails(1850, 28, -1, -1, 2, (SceneItem *) NULL); - } else { - // And the associated dead code - _actor3.setDetails(1850, 30, -1, -1, 2, (SceneItem *) NULL); - } + _screen.postInit(); + _screen.setup(1853, 3, 1); + _screen.setPosition(Common::Point(122, 113)); + _screen.fixPriority(114); + _screen._effect = EFFECT_SHADED2; + _screen.setDetails(1850, 28, -1, -1, 2, (SceneItem *) NULL); - _actor4.postInit(); - _actor4.setup(1853, 3, 2); - _actor4.setPosition(Common::Point(139, 111)); - _actor4.fixPriority(114); - _actor4._effect = 6; - - // Still totally useless test - if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - _actor4.setDetails(1850, 29, -1, -1, 2, (SceneItem *) NULL); - } else { - // Another piece of dead code - _actor4.setDetails(1850, 28, -1, -1, 2, (SceneItem *) NULL); - } + _helmet.postInit(); + _helmet.setup(1853, 3, 2); + _helmet.setPosition(Common::Point(139, 111)); + _helmet.fixPriority(114); + _helmet._effect = EFFECT_SHADED2; + _helmet.setDetails(1850, 29, -1, -1, 2, (SceneItem *) NULL); if (R2_GLOBALS.getFlag(31)) { - _actor3._shade = 0; - _actor4._shade = 0; + _screen._shade = 0; + _helmet._shade = 0; } else { - _actor3._shade = 6; - _actor4._shade = 6; + _screen._shade = 6; + _helmet._shade = 6; } } else { R2_GLOBALS._player.setVisage(1500); _companion.setVisage(1505); } - } else { // Not Quinn - if (R2_GLOBALS.getFlag(32)) { - R2_GLOBALS._player.setVisage(1508); - _companion.setVisage(1511); - - _actor3.postInit(); - _actor3.setup(1853, 3, 1); - _actor3.setPosition(Common::Point(122, 113)); - _actor3.fixPriority(114); - _actor3._effect = 6; - - // Totally useless test - if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - // Dead code - _actor3.setDetails(1850, 28, -1, -1, 2, (SceneItem *) NULL); - } else { - _actor3.setDetails(1850, 30, -1, -1, 2, (SceneItem *) NULL); - } - - _actor4.postInit(); - _actor4.setup(1853, 3, 2); - _actor4.setPosition(Common::Point(139, 111)); - _actor4.fixPriority(114); - _actor4._effect = 6; - - // Again, useless test - if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - // and dead code - _actor4.setDetails(1850, 29, -1, -1, 1, (SceneItem *) NULL); - } else { - _actor4.setDetails(1850, 28, -1, -1, 1, (SceneItem *) NULL); - } - - if (R2_GLOBALS.getFlag(31)) { - _actor3._shade = 0; - _actor4._shade = 0; - } else { - _actor3._shade = 6; - _actor4._shade = 6; - } + } else if (R2_GLOBALS.getFlag(32)) { + // Not Quinn, flag 32 + R2_GLOBALS._player.setVisage(1508); + _companion.setVisage(1511); + + _screen.postInit(); + _screen.setup(1853, 3, 1); + _screen.setPosition(Common::Point(122, 113)); + _screen.fixPriority(114); + _screen._effect = EFFECT_SHADED2; + _screen.setDetails(1850, 30, -1, -1, 2, (SceneItem *) NULL); + + _helmet.postInit(); + _helmet.setup(1853, 3, 2); + _helmet.setPosition(Common::Point(139, 111)); + _helmet.fixPriority(114); + _helmet._effect = EFFECT_SHADED2; + _helmet.setDetails(1850, 28, -1, -1, 1, (SceneItem *) NULL); + + if (R2_GLOBALS.getFlag(31)) { + _screen._shade = 0; + _helmet._shade = 0; } else { - R2_GLOBALS._player.setVisage(1505); - _companion.setVisage(1500); + _screen._shade = 6; + _helmet._shade = 6; } + } else { + // Not Quinn, nor flag 32 + R2_GLOBALS._player.setVisage(1505); + _companion.setVisage(1500); } R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); @@ -12106,8 +11967,8 @@ void Scene1850::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.enableControl(); } else { // R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] != 1850 - R2_GLOBALS._player._effect = 1; - _companion._effect = 1; + R2_GLOBALS._player._effect = EFFECT_SHADED; + _companion._effect = EFFECT_SHADED; R2_GLOBALS._player.disableControl(); _sceneMode = 10; if (R2_GLOBALS._player._characterIndex == R2_QUINN) { @@ -12173,10 +12034,10 @@ void Scene1850::remove() { void Scene1850::signal() { switch (_sceneMode) { case 10: - R2_GLOBALS._player._effect = 6; + R2_GLOBALS._player._effect = EFFECT_SHADED2; R2_GLOBALS._player._shade = 6; - _companion._effect = 6; + _companion._effect = EFFECT_SHADED2; _companion._shade = 6; R2_GLOBALS._walkRegions.disableRegion(5); @@ -12199,7 +12060,8 @@ void Scene1850::signal() { break; case 16: _sceneMode = 1870; - setAction(&_sequenceManager1, this, 1870, &R2_GLOBALS._player, &_companion, &_actor3, &_actor4, NULL); + setAction(&_sequenceManager1, this, 1870, &R2_GLOBALS._player, &_companion, + &_screen, &_helmet, NULL); break; case 20: R2_GLOBALS._player.enableControl(CURSOR_TALK); @@ -12207,7 +12069,8 @@ void Scene1850::signal() { case 21: R2_GLOBALS._player.disableControl(); _sceneMode = 1877; - setAction(&_sequenceManager1, this, 1877, &R2_GLOBALS._player, &_companion, &_robot, NULL); + setAction(&_sequenceManager1, this, 1877, &R2_GLOBALS._player, &_companion, + &_robot, NULL); break; case 30: R2_GLOBALS._player.disableControl(); @@ -12217,17 +12080,17 @@ void Scene1850::signal() { case 1852: // No break on purpose: case 1853: - if (_field412 == 1851) { + if (_sceneMode == 1851) { // At this point, SceneMode can't be equal to 1851 => dead code R2_GLOBALS.setFlag(31); _palette1.loadPalette(1850); - _field412 = 1850; + _sceneMode = 1850; } else { R2_GLOBALS.clearFlag(31); _palette1.loadPalette(1851); - _field412 = 1851; + _sceneMode = 1851; } - _field418 = 1; + _shadeChanging = true; if (R2_GLOBALS.getFlag(30)) { _displayScreen.setAction(&_sequenceManager2, NULL, 1867, &_displayScreen, NULL); } else if (R2_GLOBALS.getFlag(34)) { @@ -12243,12 +12106,13 @@ void Scene1850::signal() { R2_GLOBALS.setFlag(34); R2_GLOBALS._walkRegions.disableRegion(2); - _actor2.postInit(); - _actor2.setDetails(1850, 6, -1, -1, 5, &_robot); + _airbag.postInit(); + _airbag.setDetails(1850, 6, -1, -1, 5, &_robot); _sceneMode = 1879; - _displayScreen.setAction(&_sequenceManager2, this, 1879, &_robot, &_displayScreen, &_actor2, NULL); + _displayScreen.setAction(&_sequenceManager2, this, 1879, &_robot, + &_displayScreen, &_airbag, NULL); } else { _displayScreen.setAction(&_sequenceManager2, NULL, 1867, &_displayScreen, NULL); } @@ -12258,12 +12122,12 @@ void Scene1850::signal() { else R2_GLOBALS._scenePalette.addFader(_palette1._palette, 256, 5, this); - if (_field412 == 1851) - _field416 = -20; + if (_sceneMode == 1851) + _shadeDirection = -20; else - _field416 = 20; + _shadeDirection = 20; - _field414 = 20; + _shadeCountdown = 20; if (R2_GLOBALS._player._characterIndex == R2_QUINN) { if (_sceneMode == 1879) @@ -12309,16 +12173,16 @@ void Scene1850::signal() { _stripManager.start(575, this); break; case 1860: - if (_field41A.x != 0) { + if (_playerDest.x != 0) { R2_GLOBALS._player.enableControl(); PlayerMover *mover = new PlayerMover(); - R2_GLOBALS._player.addMover(mover, &_field41A, this); + R2_GLOBALS._player.addMover(mover, &_playerDest, this); - _field41A = Common::Point(0, 0); + _playerDest = Common::Point(0, 0); } - switch (_field41E) { + switch (_seqNumber) { case 1: _sceneMode = 1853; if (R2_GLOBALS.getFlag(32)) { @@ -12339,7 +12203,7 @@ void Scene1850::signal() { break; } - _field41E = 0; + _seqNumber = 0; break; case 1870: R2_GLOBALS._walkRegions.disableRegion(5); @@ -12354,36 +12218,36 @@ void Scene1850::signal() { _stripManager.start(561, this); break; case 1877: - _actor3.postInit(); - _actor3._effect = 6; + _screen.postInit(); + _screen._effect = EFFECT_SHADED2; if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - _actor3.setDetails(1850, 28, -1, -1, 2, (SceneItem *)NULL); + _screen.setDetails(1850, 28, -1, -1, 2, (SceneItem *)NULL); } else { - _actor3.setDetails(1850, 30, -1, -1, 2, (SceneItem *)NULL); + _screen.setDetails(1850, 30, -1, -1, 2, (SceneItem *)NULL); } - _actor4.postInit(); - _actor4._effect = 6; + _helmet.postInit(); + _helmet._effect = EFFECT_SHADED2; if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - _actor4.setDetails(1850, 29, -1, -1, 2, (SceneItem *)NULL); + _helmet.setDetails(1850, 29, -1, -1, 2, (SceneItem *)NULL); } else { - _actor4.setDetails(1850, 28, -1, -1, 2, (SceneItem *)NULL); + _helmet.setDetails(1850, 28, -1, -1, 2, (SceneItem *)NULL); } if (R2_GLOBALS.getFlag(31)) { - _actor3._shade = 0; - _actor4._shade = 0; + _screen._shade = 0; + _helmet._shade = 0; } else { - _actor3._shade = 6; - _actor4._shade = 6; + _screen._shade = 6; + _helmet._shade = 6; } R2_GLOBALS.clearFlag(30); _sceneMode = 15; - setAction(&_sequenceManager1, this, 1869, &R2_GLOBALS._player, &_actor3, NULL); - _companion.setAction(&_sequenceManager2, this, 1868, &_companion, &_actor4, NULL); + setAction(&_sequenceManager1, this, 1869, &R2_GLOBALS._player, &_screen, NULL); + _companion.setAction(&_sequenceManager2, this, 1868, &_companion, &_helmet, NULL); break; case 1878: R2_INVENTORY.setObjectScene(R2_REBREATHER_TANK, 1850); @@ -12409,8 +12273,8 @@ void Scene1850::signal() { void Scene1850::process(Event &event) { if ( (event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_WALK) - && (R2_GLOBALS._player._characterIndex == R2_SEEKER) && (R2_GLOBALS.getFlag(30))) { - _field41A = event.mousePos; + && (R2_GLOBALS._player._characterIndex == R2_SEEKER) && (R2_GLOBALS.getFlag(30))) { + _playerDest = event.mousePos; R2_GLOBALS._player.disableControl(); _sceneMode = 1860; if (R2_GLOBALS.getFlag(32)) { @@ -12418,7 +12282,7 @@ void Scene1850::process(Event &event) { } else { setAction(&_sequenceManager1, this, 1859, &R2_GLOBALS._player, &_robot, NULL); } - R2_GLOBALS.clearFlag(32); + R2_GLOBALS.clearFlag(30); event.handled = true; } @@ -12426,35 +12290,35 @@ void Scene1850::process(Event &event) { } void Scene1850::dispatch() { - if (_field418 != 0) { - _field414--; - if (_field414 == 0) - _field418 = 0; + if (_shadeChanging) { + _shadeCountdown--; + if (_shadeCountdown == 0) + _shadeChanging = false; - if (_field416 >= 0) { - R2_GLOBALS._player._shade = (_field414 * 6) / _field416; + if (_shadeDirection >= 0) { + R2_GLOBALS._player._shade = (_shadeCountdown * 6) / _shadeDirection; } else { - R2_GLOBALS._player._shade = ((_field414 * 6) / _field416) + 6; + R2_GLOBALS._player._shade = ((_shadeCountdown * 6) / _shadeDirection) + 6; } R2_GLOBALS._player._flags |= OBJFLAG_PANES; _companion._shade = R2_GLOBALS._player._shade; _companion._flags |= OBJFLAG_PANES; - _actor3._shade = R2_GLOBALS._player._shade; - _actor3._flags |= OBJFLAG_PANES; + _screen._shade = R2_GLOBALS._player._shade; + _screen._flags |= OBJFLAG_PANES; - _actor4._shade = R2_GLOBALS._player._shade; - _actor4._flags |= OBJFLAG_PANES; + _helmet._shade = R2_GLOBALS._player._shade; + _helmet._flags |= OBJFLAG_PANES; } if (R2_GLOBALS.getFlag(32)) { - _actor3.setPosition(Common::Point(_displayScreen._position.x - 37, _displayScreen._position.y - 71)); - _actor4.setPosition(Common::Point(_displayScreen._position.x - 20, _displayScreen._position.y - 73)); + _screen.setPosition(Common::Point(_displayScreen._position.x - 37, _displayScreen._position.y - 71)); + _helmet.setPosition(Common::Point(_displayScreen._position.x - 20, _displayScreen._position.y - 73)); } if (R2_INVENTORY.getObjectScene(R2_AIRBAG) == 1850) { - _actor2.setPosition(Common::Point(_displayScreen._position.x + 20, _displayScreen._position.y - 71)); + _airbag.setPosition(Common::Point(_displayScreen._position.x + 20, _displayScreen._position.y - 71)); } Scene::dispatch(); @@ -12485,7 +12349,7 @@ void Scene1875::Button::doButtonPress() { int newFrameNumber; switch (_buttonId) { case 3: - if ((scene->_actor1._frame == 1) && (scene->_button1._strip == 2)) { + if ((scene->_map._frame == 1) && (scene->_button1._strip == 2)) { R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); scene->_sceneMode = 10; @@ -12493,21 +12357,21 @@ void Scene1875::Button::doButtonPress() { } else { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 1890; - scene->_actor2.postInit(); - scene->setAction(&scene->_sequenceManager, scene, 1890, &scene->_actor2, NULL); + scene->_rimPosition.postInit(); + scene->setAction(&scene->_sequenceManager, scene, 1890, &scene->_rimPosition, NULL); } break; case 4: - newFrameNumber = scene->_actor1._frame + 1; + newFrameNumber = scene->_map._frame + 1; if (newFrameNumber > 6) newFrameNumber = 1; - scene->_actor1.setFrame(newFrameNumber); + scene->_map.setFrame(newFrameNumber); break; case 5: - newFrameNumber = scene->_actor1._frame - 1; + newFrameNumber = scene->_map._frame - 1; if (newFrameNumber < 1) newFrameNumber = 6; - scene->_actor1.setFrame(newFrameNumber); + scene->_map.setFrame(newFrameNumber); break; default: break; @@ -12555,7 +12419,7 @@ void Scene1875::Button::process(Event &event) { Scene1875 *scene = (Scene1875 *)R2_GLOBALS._sceneManager._scene; - if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_USE) + if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_USE) && (_bounds.contains(event.mousePos)) && !_buttonDown) { setStrip(2); switch (_buttonId) { @@ -12600,9 +12464,9 @@ void Scene1875::postInit(SceneObjectList *OwnerList) { _button4.initButton(4); _button5.initButton(5); - _actor1.postInit(); - _actor1.setup(1855, 4, 1); - _actor1.setPosition(Common::Point(160, 116)); + _map.postInit(); + _map.setup(1855, 4, 1); + _map.setPosition(Common::Point(160, 116)); R2_GLOBALS._player.postInit(); R2_GLOBALS._player.hide(); @@ -12611,19 +12475,19 @@ void Scene1875::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._sound1.play(122); R2_GLOBALS._player.disableControl(); _sceneMode = 11; - _actor2.postInit(); - setAction(&_sequenceManager, this, 1892, &_actor2, NULL); + _rimPosition.postInit(); + setAction(&_sequenceManager, this, 1892, &_rimPosition, NULL); } else { if (R2_GLOBALS._sceneManager._previousScene == 3150) { R2_GLOBALS._sound1.play(116); - } + } R2_GLOBALS._player.enableControl(); R2_GLOBALS._player._canWalk = false; } - _item2.setDetails(Rect(43, 14, 275, 122), 1875, 9, 1, -1, 1, NULL); - _item1.setDetails(Rect(0, 0, 320, 200), 1875, 3, -1, -1, 1, NULL); + _screen.setDetails(Rect(43, 14, 275, 122), 1875, 9, 1, -1, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 1875, 3, -1, -1, 1, NULL); R2_GLOBALS._player._characterScene[R2_QUINN] = 1875; R2_GLOBALS._player._characterScene[R2_SEEKER] = 1875; @@ -12636,8 +12500,8 @@ void Scene1875::signal() { case 10: R2_GLOBALS._player.disableControl(); _sceneMode = 1891; - _actor2.postInit(); - setAction(&_sequenceManager, this, 1891, &_actor2, NULL); + _rimPosition.postInit(); + setAction(&_sequenceManager, this, 1891, &_rimPosition, NULL); break; case 11: R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); @@ -12645,7 +12509,7 @@ void Scene1875::signal() { _stripManager.start(577, this); break; case 1890: - _actor2.remove(); + _rimPosition.remove(); R2_GLOBALS._player.enableControl(); R2_GLOBALS._player._canWalk = false; break; @@ -12680,8 +12544,6 @@ void Scene1875::process(Event &event) { *--------------------------------------------------------------------------*/ bool Scene1900::LiftDoor::startAction(CursorType action, Event &event) { - Scene1900 *scene = (Scene1900 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); @@ -12692,6 +12554,8 @@ bool Scene1900::LiftDoor::startAction(CursorType action, Event &event) { return true; } + Scene1900 *scene = (Scene1900 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.enableControl(CURSOR_USE); if (_position.x >= 160) { @@ -12788,23 +12652,23 @@ void Scene1900::postInit(SceneObjectList *OwnerList) { _rightDoor.setDetails(1900, 0, 1, -1, 1, (SceneItem *) NULL); if (R2_GLOBALS._sceneManager._previousScene != 1875) { - _object1.postInit(); - _object1.setup(1945, 6, 1); - _object1.setPosition(Common::Point(96, 109)); - _object1.fixPriority(80); + _leftDoorFrame.postInit(); + _leftDoorFrame.setup(1945, 6, 1); + _leftDoorFrame.setPosition(Common::Point(96, 109)); + _leftDoorFrame.fixPriority(80); - _object2.postInit(); - _object2.setup(1945, 6, 2); - _object2.setPosition(Common::Point(223, 109)); - _object2.fixPriority(80); + _rightDoorFrame.postInit(); + _rightDoorFrame.setup(1945, 6, 2); + _rightDoorFrame.setPosition(Common::Point(223, 109)); + _rightDoorFrame.fixPriority(80); } if (R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] == 1875) { R2_GLOBALS._player._characterIndex = R2_QUINN; - _actor1.postInit(); + _companion.postInit(); _sceneMode = 20; R2_GLOBALS._player.setAction(&_sequenceManager1, NULL, 1901, &R2_GLOBALS._player, &_leftDoor, NULL); - _actor1.setAction(&_sequenceManager2, this, 1900, &_actor1, &_rightDoor, NULL); + _companion.setAction(&_sequenceManager2, this, 1900, &_companion, &_rightDoor, NULL); } else if (R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] == 1925) { if (R2_GLOBALS.getFlag(29)) { R2_GLOBALS.clearFlag(29); @@ -12823,24 +12687,24 @@ void Scene1900::postInit(SceneObjectList *OwnerList) { } if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { - _actor1.postInit(); - _actor1.setPosition(Common::Point(30, 110)); + _companion.postInit(); + _companion.setPosition(Common::Point(30, 110)); R2_GLOBALS._walkRegions.disableRegion(1); - _actor1.setup(2008, 3, 1); - _actor1.setDetails(9001, 0, -1, -1, 1, (SceneItem *) NULL); + _companion.setup(2008, 3, 1); + _companion.setDetails(9001, 0, -1, -1, 1, (SceneItem *) NULL); } R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] = 1900; } else { if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { - _actor1.postInit(); - _actor1.setPosition(Common::Point(30, 110)); + _companion.postInit(); + _companion.setPosition(Common::Point(30, 110)); R2_GLOBALS._walkRegions.disableRegion(1); if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - _actor1.setup(20, 3, 1); - _actor1.setDetails(9002, 1, -1, -1, 1, (SceneItem *) NULL); + _companion.setup(20, 3, 1); + _companion.setDetails(9002, 1, -1, -1, 1, (SceneItem *) NULL); } else { - _actor1.setup(2008, 3, 1); - _actor1.setDetails(9001, 0, -1, -1, 1, (SceneItem *) NULL); + _companion.setup(2008, 3, 1); + _companion.setDetails(9001, 0, -1, -1, 1, (SceneItem *) NULL); } } @@ -12903,7 +12767,7 @@ void Scene1900::signal() { break; case 22: _sceneMode = 1910; - _actor1.setAction(&_sequenceManager2, this, 1910, &_actor1, NULL); + _companion.setAction(&_sequenceManager2, this, 1910, &_companion, NULL); break; case 1904: R2_GLOBALS._scene1925CurrLevel = -3; @@ -12934,7 +12798,7 @@ void Scene1900::signal() { *--------------------------------------------------------------------------*/ Scene1925::Scene1925() { - _field9B8 = 0; + _newSceneMode = 0; for (int i = 0; i < 5; i++) _levelResNum[i] = 0; } @@ -12942,20 +12806,20 @@ Scene1925::Scene1925() { void Scene1925::synchronize(Serializer &s) { SceneExt::synchronize(s); - s.syncAsSint16LE(_field9B8); + s.syncAsSint16LE(_newSceneMode); for (int i = 0; i < 5; i++) s.syncAsSint16LE(_levelResNum[i]); } bool Scene1925::Button::startAction(CursorType action, Event &event) { - Scene1925 *scene = (Scene1925 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneHotspot::startAction(action, event); if ((R2_GLOBALS._player._position.x == 110) && (R2_GLOBALS._player._position.y == 100)) return SceneHotspot::startAction(action, event); + Scene1925 *scene = (Scene1925 *)R2_GLOBALS._sceneManager._scene; + if ((R2_GLOBALS._player._position.x == 154) && (R2_GLOBALS._player._position.y == 20)) scene->_sceneMode = 1928; else if ((R2_GLOBALS._player._position.x == 154) && (R2_GLOBALS._player._position.y == 200)) @@ -12964,7 +12828,8 @@ bool Scene1925::Button::startAction(CursorType action, Event &event) { scene->_sceneMode = 1930; R2_GLOBALS._player.disableControl(CURSOR_WALK); - scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_actor1, NULL); + scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, + &scene->_door, NULL); return true; } @@ -12978,9 +12843,10 @@ bool Scene1925::Ladder::startAction(CursorType action, Event &event) { scene->_sceneMode = 0; if ((R2_GLOBALS._player._position.x == 110) && (R2_GLOBALS._player._position.y == 100)) { - scene->_exit3._enabled = false; + scene->_westExit._enabled = false; scene->_sceneMode = 1925; - scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_actor1, NULL); + scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, + &R2_GLOBALS._player, &scene->_door, NULL); return true; } @@ -13015,10 +12881,11 @@ void Scene1925::ExitUp::changeScene() { scene->_sceneMode = 0; if ((R2_GLOBALS._player._position.x == 110) && (R2_GLOBALS._player._position.y == 100)) { - scene->_exit3._enabled = false; - scene->_field9B8 = 1927; + scene->_westExit._enabled = false; + scene->_newSceneMode = 1927; scene->_sceneMode = 1925; - scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_actor1, NULL); + scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, + &R2_GLOBALS._player, &scene->_door, NULL); return; } @@ -13037,7 +12904,7 @@ void Scene1925::ExitUp::changeScene() { } } -void Scene1925::Exit2::changeScene() { +void Scene1925::ExitDown::changeScene() { Scene1925 *scene = (Scene1925 *)R2_GLOBALS._sceneManager._scene; _moving = false; @@ -13045,10 +12912,11 @@ void Scene1925::Exit2::changeScene() { scene->_sceneMode = 0; if ((R2_GLOBALS._player._position.x == 110) && (R2_GLOBALS._player._position.y == 100)) { - scene->_exit3._enabled = false; - scene->_field9B8 = 1926; + scene->_westExit._enabled = false; + scene->_newSceneMode = 1926; scene->_sceneMode = 1925; - scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_actor1, NULL); + scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, + &R2_GLOBALS._player, &scene->_door, NULL); return; } @@ -13066,7 +12934,7 @@ void Scene1925::Exit2::changeScene() { scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, NULL); } -void Scene1925::Exit3::changeScene() { +void Scene1925::WestExit::changeScene() { Scene1925 *scene = (Scene1925 *)R2_GLOBALS._sceneManager._scene; _moving = false; @@ -13075,7 +12943,7 @@ void Scene1925::Exit3::changeScene() { scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, NULL); } -void Scene1925::Exit4::changeScene() { +void Scene1925::EastExit::changeScene() { Scene1925 *scene = (Scene1925 *)R2_GLOBALS._sceneManager._scene; _moving = false; @@ -13106,8 +12974,8 @@ void Scene1925::changeLevel(bool upFlag) { case 3: loadScene(_levelResNum[4]); _button.setDetails(Rect(133, 68, 140, 77), 1925, 3, -1, 5, 2, NULL); - _actor1.setDetails(1925, 0, 1, 2, 2, (SceneItem *) NULL); - _actor1.show(); + _door.setDetails(1925, 0, 1, 2, 2, (SceneItem *) NULL); + _door.show(); break; case 512: R2_GLOBALS._scene1925CurrLevel = 508; @@ -13115,8 +12983,8 @@ void Scene1925::changeLevel(bool upFlag) { default: loadScene(_levelResNum[(R2_GLOBALS._scene1925CurrLevel % 4)]); R2_GLOBALS._sceneItems.remove(&_button); - R2_GLOBALS._sceneItems.remove(&_actor1); - _actor1.hide(); + R2_GLOBALS._sceneItems.remove(&_door); + _door.hide(); break; } @@ -13146,32 +13014,33 @@ void Scene1925::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.disableControl(); R2_GLOBALS._player._characterScene[R2_SEEKER] = 1925; R2_GLOBALS._player._characterIndex = R2_SEEKER; + switch (R2_GLOBALS._scene1925CurrLevel) { case -2: - _exit4.setDetails(Rect(203, 44, 247, 111), EXITCURSOR_E, 1925); + _eastExit.setDetails(Rect(203, 44, 247, 111), EXITCURSOR_E, 1925); _ladder.setDetails(Rect(31, 3, 45, 167), 1925, 6, -1, 8, 1, NULL); break; case 3: - _actor1.setDetails(1925, 0, 1, 2, 1, (SceneItem *) NULL); + _door.setDetails(1925, 0, 1, 2, 1, (SceneItem *) NULL); _button.setDetails(Rect(133, 68, 140, 77), 1925, 3, -1, 5, 1, NULL); // No break on purpose case -3: - _exit3.setDetails(Rect(83, 38, 128, 101), EXITCURSOR_W, 1925); + _westExit.setDetails(Rect(83, 38, 128, 101), EXITCURSOR_W, 1925); // No break on purpose default: _exitUp.setDetails(Rect(128, 0, 186, 10), EXITCURSOR_N, 1925); - _exit2.setDetails(Rect(128, 160, 190, 167), EXITCURSOR_S, 1925); + _exitDown.setDetails(Rect(128, 160, 190, 167), EXITCURSOR_S, 1925); _ladder.setDetails(Rect(141, 11, 167, 159), 1925, 6, -1, -1, 1, NULL); break; } - _actor1.postInit(); - _actor1.setup(1925, 5, 1); - _actor1.setPosition(Common::Point(128, 35)); - _actor1.hide(); + _door.postInit(); + _door.setup(1925, 5, 1); + _door.setPosition(Common::Point(128, 35)); + _door.hide(); if (R2_GLOBALS._scene1925CurrLevel == 3) - _actor1.show(); + _door.show(); R2_GLOBALS._player.enableControl(CURSOR_USE); switch (R2_GLOBALS._scene1925CurrLevel) { @@ -13181,7 +13050,7 @@ void Scene1925::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.setPosition(Common::Point(224, 109)); break; case -3: - _actor1.hide(); + _door.hide(); R2_GLOBALS._player.setup(20, 5, 1); R2_GLOBALS._player.setPosition(Common::Point(110, 100)); break; @@ -13196,9 +13065,9 @@ void Scene1925::postInit(SceneObjectList *OwnerList) { } R2_GLOBALS._player._canWalk = false; - _field9B8 = 0; + _newSceneMode = 0; R2_GLOBALS._sceneManager._previousScene = 1925; - _item1.setDetails(Rect(27, 0, 292, 200), 1925, 9, -1, -1, 1, NULL); + _background.setDetails(Rect(27, 0, 292, 200), 1925, 9, -1, -1, 1, NULL); } void Scene1925::remove() { @@ -13234,10 +13103,10 @@ void Scene1925::signal() { changeLevel(true); break; case 1925: - _exit3._enabled = false; - if (_field9B8 != 0) { - _sceneMode = _field9B8; - _field9B8 = 0; + _westExit._enabled = false; + if (_newSceneMode != 0) { + _sceneMode = _newSceneMode; + _newSceneMode = 0; setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, NULL); } // No break on purpose @@ -13309,11 +13178,11 @@ bool Scene1945::Ice::startAction(CursorType action, Event &event) { } bool Scene1945::Ladder::startAction(CursorType action, Event &event) { - Scene1945 *scene = (Scene1945 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneHotspot::startAction(action, event); + Scene1945 *scene = (Scene1945 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(CURSOR_USE); scene->_sceneMode = 0; @@ -13323,7 +13192,8 @@ bool Scene1945::Ladder::startAction(CursorType action, Event &event) { } else if ( ((R2_GLOBALS._player._position.x == 197) && (R2_GLOBALS._player._position.y == 158)) || ((R2_GLOBALS._player._position.x == 191) && (R2_GLOBALS._player._position.y == 142)) ) { scene->_sceneMode = 1947; - } else if ((R2_GLOBALS._player._position.x == 221) && (R2_GLOBALS._player._position.y == 142) && (event.mousePos.y >= 30)) { + } else if ((R2_GLOBALS._player._position.x == 154) && (R2_GLOBALS._player._position.y == 50) + && (event.mousePos.y >= 30)) { scene->_sceneMode = 1940; } else { R2_GLOBALS._player.enableControl(CURSOR_USE); @@ -13432,14 +13302,14 @@ void Scene1945::postInit(SceneObjectList *OwnerList) { else _gunpowder.hide(); - _actor1.postInit(); - _actor1.setup(1945, 8, 1); - _actor1.setPosition(Common::Point(253, 169)); - _actor1.fixPriority(130); + _coveringIce.postInit(); + _coveringIce.setup(1945, 8, 1); + _coveringIce.setPosition(Common::Point(253, 169)); + _coveringIce.fixPriority(130); - _actor2.postInit(); - _actor2.setup(1945, 3, 1); - _actor2.hide(); + _alcoholLamp.postInit(); + _alcoholLamp.setup(1945, 3, 1); + _alcoholLamp.hide(); } else { _corridorExit._enabled = true; } @@ -13468,8 +13338,8 @@ void Scene1945::postInit(SceneObjectList *OwnerList) { _nextSceneMode2 = 0; _ice.setDetails(11, 1945, 3, -1, 5); - _item1.setDetails(Rect(238, 144, 274, 167), 1945, 0, -1, 2, 1, NULL); - _item2.setDetails(Rect(27, 3, 292, 167), 1945, 3, -1, -1, 1, NULL); + _hole.setDetails(Rect(238, 144, 274, 167), 1945, 0, -1, 2, 1, NULL); + _ice2.setDetails(Rect(27, 3, 292, 167), 1945, 3, -1, -1, 1, NULL); } void Scene1945::remove() { @@ -13482,7 +13352,7 @@ void Scene1945::signal() { case 1940: if (_nextSceneMode1 == 1943) { _sceneMode = _nextSceneMode1; - setAction(&_sequenceManager1, this, _sceneMode, &R2_GLOBALS._player, &_actor2, NULL); + setAction(&_sequenceManager1, this, _sceneMode, &R2_GLOBALS._player, &_alcoholLamp, NULL); } else { _sceneMode = 1946; setAction(&_sequenceManager1, this, _sceneMode, &R2_GLOBALS._player, NULL); @@ -13509,7 +13379,7 @@ void Scene1945::signal() { R2_GLOBALS._sound1.fadeOut2(NULL); R2_INVENTORY.setObjectScene(_lampUsed, 0); _sceneMode = 1948; - setAction(&_sequenceManager1, this, _sceneMode, &_gunpowder, &_actor2, &_actor1, NULL); + setAction(&_sequenceManager1, this, _sceneMode, &_gunpowder, &_alcoholLamp, &_coveringIce, NULL); R2_GLOBALS._player.setAction(&_sequenceManager2, NULL, 1941, &R2_GLOBALS._player, NULL); return; case 1944: @@ -13524,12 +13394,13 @@ void Scene1945::signal() { setAction(&_sequenceManager1, this, _sceneMode, &R2_GLOBALS._player, &_gunpowder, NULL); return; } + _sceneMode = 0; break; case 1947: if (_nextSceneMode1 == 1943) { _sceneMode = _nextSceneMode1; _nextSceneMode1 = 1948; - setAction(&_sequenceManager1, this, _sceneMode, &R2_GLOBALS._player, &_actor2, NULL); + setAction(&_sequenceManager1, this, _sceneMode, &R2_GLOBALS._player, &_alcoholLamp, NULL); } else { _sceneMode = 1941; setAction(&_sequenceManager1, this, _sceneMode, &R2_GLOBALS._player, NULL); @@ -13548,7 +13419,7 @@ void Scene1945::signal() { if (_nextSceneMode2 == 1943) { _nextSceneMode1 = _nextSceneMode2; _nextSceneMode2 = 0; - setAction(&_sequenceManager1, this, _sceneMode, &R2_GLOBALS._player, &_actor2, NULL); + setAction(&_sequenceManager1, this, _sceneMode, &R2_GLOBALS._player, &_alcoholLamp, NULL); } else { _nextSceneMode1 = 0; setAction(&_sequenceManager1, this, _sceneMode, &R2_GLOBALS._player, NULL); @@ -13568,14 +13439,12 @@ void Scene1945::signal() { *--------------------------------------------------------------------------*/ Scene1950::KeypadWindow::KeypadWindow() { - _field20 = 0; _buttonIndex = 0; } void Scene1950::KeypadWindow::synchronize(Serializer &s) { SceneArea::synchronize(s); - s.syncAsByte(_field20); s.syncAsSint16LE(_buttonIndex); } @@ -13608,7 +13477,7 @@ void Scene1950::KeypadWindow::KeypadButton::init(int indx) { } void Scene1950::KeypadWindow::KeypadButton::process(Event &event) { - if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_USE) + if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_USE) && (_bounds.contains(event.mousePos)) && !_pressed) { R2_GLOBALS._sound2.play(227); if (!_toggled) { @@ -13662,24 +13531,24 @@ void Scene1950::KeypadWindow::remove() { } } -void Scene1950::KeypadWindow::proc12(int visage, int stripFrameNum, int frameNum, int posX, int posY) { +void Scene1950::KeypadWindow::setup2(int visage, int stripFrameNum, int frameNum, int posX, int posY) { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; if (R2_GLOBALS._player._mover) R2_GLOBALS._player.addMover(NULL); R2_GLOBALS._player._canWalk = false; - ModalWindow::proc12(visage, stripFrameNum, frameNum, posX, posY); + ModalWindow::setup2(visage, stripFrameNum, frameNum, posX, posY); _object1.fixPriority(248); scene->_eastExit._enabled = false; - proc13(1950, 27, 28, 27); + setup3(1950, 27, 28, 27); for (_buttonIndex = 0; _buttonIndex < 16; _buttonIndex++) _buttons[_buttonIndex].init(_buttonIndex); } -void Scene1950::KeypadWindow::proc13(int resNum, int lookLineNum, int talkLineNum, int useLineNum) { +void Scene1950::KeypadWindow::setup3(int resNum, int lookLineNum, int talkLineNum, int useLineNum) { // Copy of Scene1200::LaserPanel::proc13() _areaActor.setDetails(resNum, lookLineNum, talkLineNum, useLineNum, 2, (SceneItem *) NULL); } @@ -13745,11 +13614,10 @@ bool Scene1950::Gem::startAction(CursorType action, Event &event) { /*--------------------------------------------------------------------------*/ Scene1950::Vampire::Vampire() { - _fieldA8 = 0; - _fieldAA = 0; + _deadPosition = Common::Point(0, 0); + _deltaX = 0; + _deltaY = 0; _vampireMode = 0; - _fieldAE = 0; - _fieldAF = 0; } void Scene1950::Vampire::synchronize(Serializer &s) { @@ -13757,11 +13625,9 @@ void Scene1950::Vampire::synchronize(Serializer &s) { s.syncAsSint16LE(_deadPosition.x); s.syncAsSint16LE(_deadPosition.y); - s.syncAsSint16LE(_fieldA8); - s.syncAsSint16LE(_fieldAA); + s.syncAsSint16LE(_deltaX); + s.syncAsSint16LE(_deltaY); s.syncAsSint16LE(_vampireMode); - s.syncAsByte(_fieldAE); - s.syncAsByte(_fieldAF); } void Scene1950::Vampire::signal() { @@ -13777,7 +13643,7 @@ void Scene1950::Vampire::signal() { setStrip(1); NpcMover *mover = new NpcMover(); - addMover(mover, &scene->_field418, scene); + addMover(mover, &scene->_vampireDestPos, scene); } break; case 20: { @@ -13812,7 +13678,7 @@ void Scene1950::Vampire::signal() { R2_GLOBALS._player.enableControl(); } break; - case 21: + case 21: { // Fatal shot R2_GLOBALS._player.setVisage(22); if (R2_GLOBALS._flubMazeEntryDirection == 3) @@ -13836,23 +13702,24 @@ void Scene1950::Vampire::signal() { R2_GLOBALS._vampireData[scene->_vampireIndex - 1]._isAlive = false; R2_GLOBALS._vampireData[scene->_vampireIndex - 1]._shotsRequired--; R2_GLOBALS._vampireData[scene->_vampireIndex - 1]._position = _position; - _fieldA8 = (_position.x - R2_GLOBALS._player._position.x) / 2; - _fieldAA = (_position.y - R2_GLOBALS._player._position.y) / 2; + _deltaX = (_position.x - R2_GLOBALS._player._position.x) / 2; + _deltaY = (_position.y - R2_GLOBALS._player._position.y) / 2; - _fieldAE = 0; - for (_fieldAF = 0; _fieldAF < 18; ++_fieldAF) - if (!R2_GLOBALS._vampireData[_fieldAF]._isAlive) - ++_fieldAE; + byte vampireCount = 0; + for (byte i = 0; i < 18; ++i) { + if (!R2_GLOBALS._vampireData[i]._isAlive) + ++vampireCount; + } - if (_fieldAE == 18) { + if (vampireCount == 18) { R2_GLOBALS.setFlag(36); _vampireMode = 23; - Common::Point pt(R2_GLOBALS._player._position.x + _fieldA8, R2_GLOBALS._player._position.y + _fieldAA); + Common::Point pt(R2_GLOBALS._player._position.x + _deltaX, R2_GLOBALS._player._position.y + _deltaY); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); - } else if (_fieldAE == 1) { + } else if (vampireCount == 1) { _vampireMode = 22; - Common::Point pt(R2_GLOBALS._player._position.x + _fieldA8, R2_GLOBALS._player._position.y + _fieldAA); + Common::Point pt(R2_GLOBALS._player._position.x + _deltaX, R2_GLOBALS._player._position.y + _deltaY); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); } else { @@ -13864,14 +13731,15 @@ void Scene1950::Vampire::signal() { else scene->_westExit._enabled = true; - scene->_field416 = 0; + scene->_vampireActive = false; + } break; case 22: - SceneItem::display(1950, 18, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1950, 18, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); R2_GLOBALS._player.enableControl(CURSOR_WALK); break; case 23: - SceneItem::display(1950, 25, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1950, 25, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); scene->_sceneMode = R2_GLOBALS._flubMazeEntryDirection; scene->setAction(&scene->_sequenceManager, scene, 1960, &R2_GLOBALS._player, NULL); break; @@ -13883,7 +13751,7 @@ void Scene1950::Vampire::signal() { bool Scene1950::Vampire::startAction(CursorType action, Event &event) { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; - if (!R2_GLOBALS._vampireData[scene->_vampireIndex - 1]._isAlive || + if (!R2_GLOBALS._vampireData[scene->_vampireIndex - 1]._isAlive || (action != R2_PHOTON_STUNNER)) return SceneActor::startAction(action, event); @@ -13928,7 +13796,7 @@ void Scene1950::UpExit::changeScene() { R2_GLOBALS._flubMazeEntryDirection = 2; scene->_sceneMode = 12; - if (scene->_field412 == 0) { + if (!scene->_upExitStyle) { if (R2_GLOBALS.getFlag(36)) scene->setAction(&scene->_sequenceManager, scene, 1953, &R2_GLOBALS._player, NULL); else @@ -13949,7 +13817,7 @@ void Scene1950::EastExit::changeScene() { R2_GLOBALS._flubMazeEntryDirection = 3; scene->_sceneMode = 13; - if (scene->_field416 != 0) + if (scene->_vampireActive) R2_GLOBALS._player.animate(ANIM_MODE_9); Common::Point pt(340, 160); @@ -14000,16 +13868,16 @@ void Scene1950::WestExit::changeScene() { R2_GLOBALS._player.addMover(mover, &pt, scene); } else { if (!R2_GLOBALS.getFlag(36)) - SceneItem::display(1950, 33, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1950, 33, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); if ((R2_INVENTORY.getObjectScene(R2_SAPPHIRE_BLUE) == 1950) || (R2_INVENTORY.getObjectScene(R2_ANCIENT_SCROLLS) == 1950)) - SceneItem::display(1950, 34, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1950, 34, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); scene->_sceneMode = 0; Common::Point pt(30, 160); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, scene); } } else { - if (scene->_field416 != 0) + if (scene->_vampireActive) R2_GLOBALS._player.animate(ANIM_MODE_9); scene->_sceneMode = 16; @@ -14039,7 +13907,7 @@ void Scene1950::DoorExit::changeScene() { scene->_sceneMode = 1975; scene->setAction(&scene->_sequenceManager, scene, 1975, &R2_GLOBALS._player, NULL); } else { - SceneItem::display(1950, 22, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1950, 22, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); R2_GLOBALS._flubMazeEntryDirection = 0; scene->_sceneMode = 0; Common::Point pt(250, 150); @@ -14052,21 +13920,21 @@ void Scene1950::DoorExit::changeScene() { /*--------------------------------------------------------------------------*/ Scene1950::Scene1950() { - _field412 = 0; - _field414 = 0; - _field416 = 0; - _field418 = Common::Point(0, 0); + _upExitStyle = false; + _removeFlag = false; + _vampireActive = false; + _vampireDestPos = Common::Point(0, 0); _vampireIndex = 0; } void Scene1950::synchronize(Serializer &s) { SceneExt::synchronize(s); - s.syncAsSint16LE(_field412); - s.syncAsSint16LE(_field414); - s.syncAsSint16LE(_field416); - s.syncAsSint16LE(_field418.x); - s.syncAsSint16LE(_field418.y); + s.syncAsSint16LE(_upExitStyle); + s.syncAsSint16LE(_removeFlag); + s.syncAsSint16LE(_vampireActive); + s.syncAsSint16LE(_vampireDestPos.x); + s.syncAsSint16LE(_vampireDestPos.y); s.syncAsSint16LE(_vampireIndex); } @@ -14095,7 +13963,7 @@ void Scene1950::initArea() { _westExit._moving = false; _shaftExit._moving = false; _doorExit._moving = false; - _field412 = 0; + _upExitStyle = false; switch (R2_GLOBALS._flubMazeArea - 1) { case 0: @@ -14322,7 +14190,7 @@ void Scene1950::initArea() { // No break on purpose case 67: loadScene(1985); - _field412 = 1; + _upExitStyle = true; break; default: break; @@ -14769,7 +14637,7 @@ void Scene1950::enterArea() { _door.remove(); _scrolls.remove(); - _field416 = 0; + _vampireActive = false; _vampireIndex = 0; // Certain areas have a vampire in them @@ -14778,7 +14646,7 @@ void Scene1950::enterArea() { _vampireIndex = 1; break; case 13: - _vampireIndex = 2; + _vampireIndex = 2; break; case 16: _vampireIndex = 3; @@ -14837,7 +14705,7 @@ void Scene1950::enterArea() { _vampire._numFrames = 6; _vampire._moveRate = 6; _vampire._moveDiff = Common::Point(3, 2); - _vampire._effect = 1; + _vampire._effect = EFFECT_SHADED; if (!R2_GLOBALS._vampireData[_vampireIndex - 1]._isAlive) { // Show vampire ashes @@ -14855,7 +14723,7 @@ void Scene1950::enterArea() { _vampire.setPosition(Common::Point(160, 130)); _vampire.animate(ANIM_MODE_2, NULL); _vampire.setDetails(1950, 12, -1, 14, 2, (SceneItem *) NULL); - _field416 = 1; + _vampireActive = true; } } if ((R2_GLOBALS._flubMazeArea == 1) && (R2_INVENTORY.getObjectScene(R2_SCRITH_KEY) != 0)) { @@ -14885,13 +14753,13 @@ void Scene1950::enterArea() { _cube.setPosition(Common::Point(193, 158)); _cube.setDetails(1950, 3, 4, 5, 2, (SceneItem *) NULL); - _actor7.postInit(); - _actor7.setVisage(1970); - _actor7.setStrip(3); - _actor7.animate(ANIM_MODE_2, NULL); - _actor7._numFrames = 6; - _actor7.setPosition(Common::Point(194, 158)); - _actor7.fixPriority(159); + _pulsingLights.postInit(); + _pulsingLights.setVisage(1970); + _pulsingLights.setStrip(3); + _pulsingLights.animate(ANIM_MODE_2, NULL); + _pulsingLights._numFrames = 6; + _pulsingLights.setPosition(Common::Point(194, 158)); + _pulsingLights.fixPriority(159); _keypad.setDetails(Rect(188, 124, 199, 133), 1950, 27, 28, -1, 2, NULL); @@ -14931,27 +14799,29 @@ void Scene1950::enterArea() { else _scrolls.setFrame(1); - _field414 = 1; - } else if (_field414 != 0) { + _removeFlag = true; + } else if (_removeFlag) { _cube.remove(); _containmentField.remove(); _gem.remove(); - _actor7.remove(); + _pulsingLights.remove(); _scrolls.remove(); R2_GLOBALS._sceneItems.remove(&_background); _background.setDetails(Rect(0, 0, 320, 200), 1950, 0, 1, 2, 2, NULL); + + _removeFlag = false; } switch (R2_GLOBALS._flubMazeEntryDirection) { case 0: _sceneMode = 1950; - if (R2_INVENTORY.getObjectScene(R2_SCRITH_KEY) == 0) { - R2_GLOBALS._v56AAB = 0; + if (R2_INVENTORY.getObjectScene(R2_SCRITH_KEY) == 0) + // The original uses CURSOR_ARROW. CURSOR_WALK is much more coherent R2_GLOBALS._player.enableControl(CURSOR_WALK); - } else { + else setAction(&_sequenceManager, this, 1950, &R2_GLOBALS._player, NULL); - } + break; case 1: { _sceneMode = R2_GLOBALS._flubMazeEntryDirection; @@ -14970,7 +14840,7 @@ void Scene1950::enterArea() { break; case 3: // Entering from the left - if (_field416 == 0) { + if (!_vampireActive) { _sceneMode = R2_GLOBALS._flubMazeEntryDirection; R2_GLOBALS._player.setPosition(Common::Point(-20, 160)); Common::Point pt(30, 160); @@ -14979,14 +14849,13 @@ void Scene1950::enterArea() { } else { _sceneMode = 18; _eastExit._enabled = false; - _field418 = Common::Point(60, 152); - R2_GLOBALS._v56AAB = 0; + _vampireDestPos = Common::Point(60, 152); R2_GLOBALS._player.enableControl(CURSOR_USE); R2_GLOBALS._player._canWalk = false; _vampire.setStrip(2); NpcMover *mover = new NpcMover(); - _vampire.addMover(mover, &_field418, this); + _vampire.addMover(mover, &_vampireDestPos, this); R2_GLOBALS._player.setPosition(Common::Point(-20, 160)); Common::Point pt2(30, 160); @@ -14996,7 +14865,7 @@ void Scene1950::enterArea() { break; case 4: _sceneMode = R2_GLOBALS._flubMazeEntryDirection; - if (_field412 == 0) { + if (!_upExitStyle) { if (R2_GLOBALS.getFlag(36)) setAction(&_sequenceManager, this, 1955, &R2_GLOBALS._player, NULL); else @@ -15018,7 +14887,7 @@ void Scene1950::enterArea() { break; case 6: // Entering from the right - if (_field416 == 0) { + if (!_vampireActive) { _sceneMode = R2_GLOBALS._flubMazeEntryDirection; if (R2_GLOBALS._flubMazeArea == 1) { setAction(&_sequenceManager, this, 1961, &R2_GLOBALS._player, NULL); @@ -15031,15 +14900,14 @@ void Scene1950::enterArea() { } else { _sceneMode = 17; _westExit._enabled = false; - _field418 = Common::Point(259, 152); + _vampireDestPos = Common::Point(259, 152); - R2_GLOBALS._v56AAB = 0; R2_GLOBALS._player.enableControl(CURSOR_USE); R2_GLOBALS._player._canWalk = false; _vampire.setStrip(1); NpcMover *mover = new NpcMover(); - _vampire.addMover(mover, &_field418, this); + _vampire.addMover(mover, &_vampireDestPos, this); R2_GLOBALS._player.setPosition(Common::Point(340, 160)); Common::Point pt2(289, 160); @@ -15134,9 +15002,9 @@ void Scene1950::doButtonPress(int indx) { } void Scene1950::postInit(SceneObjectList *OwnerList) { - _field412 = 0; - _field414 = 0; - _field416 = 0; + _upExitStyle = false; + _removeFlag = false; + _vampireActive = false; _vampireIndex = 0; if (R2_GLOBALS._sceneManager._previousScene == 300) R2_GLOBALS._flubMazeArea = 103; @@ -15202,7 +15070,7 @@ void Scene1950::signal() { enterArea(); break; case 1975: - SceneItem::display(1950, 21, SET_WIDTH, 280, SET_X, 160, SET_POS_MODE, 1, + SceneItem::display(1950, 21, SET_WIDTH, 280, SET_X, 160, SET_POS_MODE, 1, SET_Y, 20, SET_EXT_BGCOLOR, 7, LIST_END); // No break on purpose case 13: @@ -15233,11 +15101,11 @@ void Scene1950::signal() { case 17: { _sceneMode = 13; R2_GLOBALS._flubMazeEntryDirection = 3; - _field416 = 0; + _vampireActive = false; R2_GLOBALS._player.disableControl(CURSOR_WALK); R2_GLOBALS._player._canWalk = true; R2_GLOBALS._player.setVisage(22); - R2_GLOBALS._player.animate(ANIM_MODE_9, NULL); + R2_GLOBALS._player.animate(ANIM_MODE_9); Common::Point pt(340, 160); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); @@ -15249,11 +15117,11 @@ void Scene1950::signal() { case 18: { _sceneMode = 16; R2_GLOBALS._flubMazeEntryDirection = 6; - _field416 = 0; + _vampireActive = false; R2_GLOBALS._player.disableControl(CURSOR_WALK); R2_GLOBALS._player._canWalk = true; R2_GLOBALS._player.setVisage(22); - R2_GLOBALS._player.animate(ANIM_MODE_9, NULL); + R2_GLOBALS._player.animate(ANIM_MODE_9); Common::Point pt(-20, 160); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); @@ -15273,14 +15141,12 @@ void Scene1950::signal() { R2_GLOBALS._sceneManager.changeScene(1945); break; case 1958: - SceneItem::display(1950, 24, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); - R2_GLOBALS._v56AAB = 0; + SceneItem::display(1950, 24, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); R2_GLOBALS._player.enableControl(CURSOR_WALK); _doorExit._enabled = true; break; case 1959: R2_INVENTORY.setObjectScene(R2_SOAKED_FACEMASK, 0); - R2_GLOBALS._v56AAB = 0; R2_GLOBALS._player.enableControl(CURSOR_WALK); _doorExit._enabled = true; break; @@ -15288,14 +15154,14 @@ void Scene1950::signal() { // No break on purpose case 1963: R2_GLOBALS._player.enableControl(); - _KeypadWindow.proc12(1971, 1, 1, 160, 135); + _KeypadWindow.setup2(1971, 1, 1, 160, 135); break; case 1964: // No break on purpose case 1965: - if (!R2_GLOBALS.getFlag(37)) { - SceneItem::display(1950, 26, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); - } + if (!R2_GLOBALS.getFlag(37)) + SceneItem::display(1950, 26, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); + R2_GLOBALS._player.enableControl(); break; case 1966: @@ -15319,7 +15185,8 @@ void Scene1950::signal() { R2_GLOBALS._player.setVisage(22); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - Common::Point pt(218, 165); + // This is a hack to work around a pathfinding issue. original destination is (218, 165) + Common::Point pt(128, 165); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); } @@ -15335,7 +15202,6 @@ void Scene1950::signal() { R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); break; default: - R2_GLOBALS._v56AAB = 0; R2_GLOBALS._player.enableControl(CURSOR_WALK); break; } diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.h b/engines/tsage/ringworld2/ringworld2_scenes1.h index c0088236b4..91c4b88391 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.h +++ b/engines/tsage/ringworld2/ringworld2_scenes1.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -111,13 +111,13 @@ public: SceneActor _shotImpact4; SceneActor _shotImpact5; SceneActor _laserShot; - SceneActor _animation; // Used for cliff collapse and ship theft + SceneActor _animation; // Used for cliff collapse and ship theft SceneActor _leftImpacts; SceneActor _runningGuy1; SceneActor _runningGuy2; SceneActor _runningGuy3; BackgroundSceneObject _rightLandslide; - BackgroundSceneObject _object2; + BackgroundSceneObject _purplePlant; Seeker _seeker; Trooper _trooper; Chief _chief; @@ -183,38 +183,52 @@ public: }; class Scene1337 : public SceneExt { - class unkObj1337sub1: public SceneHotspot { + class OptionsDialog: public GfxDialog { + private: + GfxButton _autoplay; + GfxButton _restartGame; + GfxButton _quitGame; + GfxButton _continueGame; + + OptionsDialog(); + virtual ~OptionsDialog() {} + virtual GfxButton *execute(GfxButton *defaultButton); + public: + static void show(); + }; + + class Card: public SceneHotspot { public: - SceneObject _object1; + SceneObject _card; - int _field34; - Common::Point _field36; + int _cardId; + Common::Point _stationPos; - unkObj1337sub1(); + Card(); void synchronize(Serializer &s); + bool isIn(Common::Point pt); }; - class unkObj1337_1: public SceneHotspot { + class GameBoardSide: public SceneHotspot { public: - unkObj1337sub1 _arr1[4]; - unkObj1337sub1 _arr2[8]; - unkObj1337sub1 _arr3[1]; - unkObj1337sub1 _arr4[1]; + Card _handCard[4]; + Card _outpostStation[8]; + Card _delayCard; + Card _emptyStationPos; - Common::Point _fieldB94; - Common::Point _fieldB98; - Common::Point _fieldB9C; - Common::Point _fieldBA0; - int _fieldBA4; + Common::Point _card1Pos; + Common::Point _card2Pos; + Common::Point _card3Pos; + Common::Point _card4Pos; + int _frameNum; - unkObj1337_1(); + GameBoardSide(); void synchronize(Serializer &s); }; class Action1337: public Action { public: - void subD18B5(int resNum, int stripNum, int frameNum); - void skipFrames(int32 skipCount); + void waitFrames(int32 frameCount); }; class Action1: public Action1337 { @@ -270,16 +284,6 @@ class Scene1337 : public SceneExt { void signal(); }; public: - typedef void (Scene1337::*FunctionPtrType)(); - FunctionPtrType _unkFctPtr412; - - ASound _aSound1; - ASound _aSound2; - BackgroundSceneObject _background1; - bool _autoplay; - unkObj1337_1 _arrunkObj1337[4]; - SceneItem _item1; - SceneObject _object1; Action1 _action1; Action2 _action2; Action3 _action3; @@ -293,90 +297,101 @@ public: Action11 _action11; Action12 _action12; Action13 _action13; - unkObj1337sub1 _item2; - unkObj1337sub1 _item3; - unkObj1337sub1 _item4; - BackgroundSceneObject _background2; - int _field3E24; - int _field3E26; - int _field3E28[100]; - unkObj1337sub1 *_field3EF0; - unkObj1337sub1 *_field3EF4; - unkObj1337sub1 *_field3EF8; - unkObj1337sub1 _item5; - unkObj1337sub1 _item6; - unkObj1337sub1 _item7; - unkObj1337sub1 _item8; - int _field423C; - int _field423E; - int _field4240; - int _field4242; - int _field4244; - int _field4246; - int _field4248; - int _field424A; - int _field424C; - int _field424E; - - SceneObject _arrObject1[8]; - SceneObject _arrObject2[8]; + + typedef void (Scene1337::*FunctionPtrType)(); + FunctionPtrType _delayedFunction; + + bool _autoplay; + bool _shuffleEndedFl; + bool _showPlayerTurn; + bool _displayHelpFl; + bool _instructionsDisplayedFl; + + // Discarded cards are put in the available cards pile, with an higher index so there no conflict + int _currentDiscardIndex; + int _availableCardsPile[100]; + int _cardsAvailableNumb; + int _currentPlayerNumb; + int _actionIdx1; + int _actionIdx2; + int _winnerId; + int _instructionsWaitCount; + int _cursorCurRes; + int _cursorCurStrip; + int _cursorCurFrame; + + ASound _aSound1; + ASound _aSound2; + GameBoardSide _gameBoardSide[4]; + SceneActor _helpIcon; + SceneActor _stockPile; + SceneItem _actionItem; + SceneObject _currentPlayerArrow; + + Card *_actionCard1; + Card *_actionCard2; + Card *_actionCard3; + Card _animatedCard; + Card _shuffleAnimation; + Card _discardedPlatformCard; + Card _selectedCard; + Card _discardPile; + Card _stockCard; + + SceneObject _upperDisplayCard[8]; + SceneObject _lowerDisplayCard[8]; Scene1337(); virtual void synchronize(Serializer &s); - void actionDisplay(int resNum, int lineNum, int x, int y, int arg5, int width, int textMode, int fontNum, int colFG, int colBGExt, int colFGExt); - void setAnimationInfo(unkObj1337sub1 *subObj); - void subC20E5(); - void subC20F9(); - void subC2586(); - bool subC264B(int arg1); - bool subC2687(int arg1); - int subC26CB(int arg1, int arg2); - int subC2719(int arg1); - int subC274D(int arg1); - int subC2781(int arg1); - int subC27B5(int arg1); - int subC27F9(int arg1); - void subC2835(int arg1); - bool subC2BF8(unkObj1337sub1 *subObj1, Common::Point pt); - void subC2C2F(); - void subC318B(int arg1, unkObj1337sub1 *subObj2, int arg3); - int subC3257(int arg1); - bool subC32B1(int arg1, int arg2); - int subC331B(int arg1); - bool subC3386(int arg1, int arg2); - void subC33C0(unkObj1337sub1 *subObj1, unkObj1337sub1 *subObj2); - void subC3456(unkObj1337sub1 *subObj1, unkObj1337sub1 *subObj2); - void subC340B(unkObj1337sub1 *subObj1, unkObj1337sub1 *subObj2); - void subC34A1(unkObj1337sub1 *subObj1, unkObj1337sub1 *subObj2); - unkObj1337sub1 *subC34EC(int arg1); - void subC358E(unkObj1337sub1 *subObj1, int arg2); - int subC3E92(int arg1); - void subC4A39(unkObj1337sub1 *subObj); + void actionDisplay(int resNum, int lineNum, int x, int y, int keepOnScreen, int width, int textMode, int fontNum, int colFG, int colBGExt, int colFGExt); + void setAnimationInfo(Card *card); + void handleNextTurn(); + void handlePlayerTurn(); + bool isStationCard(int cardId); + bool isStopConstructionCard(int cardId); + int getStationId(int playerId, int handCardId); + int findPlatformCardInHand(int playerId); + int findCard13InHand(int playerId); + int checkThieftCard(int playerId); + int isDelayCard(int cardId); + int getStationCardId(int cardId); + void handlePlayer01Discard(int playerId); + void playThieftCard(int playerId, Card *card, int victimId); + int getPreventionCardId(int cardId); + bool isAttackPossible(int victimId, int cardId); + int getPlayerWithOutpost(int playerId); + bool checkAntiDelayCard(int delayCardId, int cardId); + void playStationCard(Card *station, Card *platform); + void playDelayCard(Card *card, Card *dest); + void playPlatformCard(Card *card, Card *dest); + void playAntiDelayCard(Card *card, Card *dest); + Card *getStationCard(int arg1); + void playCounterTrickCard(Card *card, int playerId); + int getFreeHandCard(int playerId); + void discardCard(Card *card); void subC4CD2(); void subC4CEC(); - void subC51A0(unkObj1337sub1 *subObj1, unkObj1337sub1 *subObj2); + void subC51A0(Card *subObj1, Card *subObj2); void displayDialog(int dialogNumb); void subPostInit(); - void subCB59B(); + void displayInstructions(); void suggestInstructions(); void shuffleCards(); - void subCCF26(); - void subCD193(); - void subCDB90(int arg1, Common::Point pt); - void subCF31D(); - void subCF979(); - void subD026D(); - void subD0281(); - void subD02CA(); - void subD183F(int arg1, int arg2); - void subD18B5(int resNum, int rlbNum, int arg3); - int subD18F5(); - int subD1917(); - int subD1940(bool flag); - void subD195F(int arg1, int arg2); + void dealCards(); + void showOptionsDialog(); + void handleClick(int arg1, Common::Point pt); + void handlePlayer0(); + void handlePlayer1(); + void handlePlayer2(); + void handlePlayer3(); + void handleAutoplayPlayer2(); + void updateCursorId(int arg1, bool arg2); + void setCursorData(int resNum, int rlbNum, int frameNum); + void subD18F5(); + void subD1917(); + void subD1940(bool flag); void subD1975(int arg1, int arg2); - void subD1A48(int arg1); virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void remove(); @@ -386,10 +401,10 @@ public: class Scene1500 : public SceneExt { public: - SceneActor _actor1; - SceneActor _actor2; - SceneActor _actor3; - SceneActor _actor4; + SceneActor _starship; + SceneActor _starshipShadow; + SceneActor _smallShip; + SceneActor _smallShipShadow; SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -410,9 +425,9 @@ class Scene1530 : public SceneExt { public: SpeakerQuinn _quinnSpeaker; SpeakerSeeker _seekerSpeaker; - SceneActor _actor1; - SceneActor _actor2; - SceneActor _actor3; + SceneActor _seeker; + SceneActor _leftReactor; + SceneActor _rightReactor; SequenceManager _sequenceManager; @@ -422,14 +437,13 @@ public: }; class Scene1550 : public SceneExt { - class SceneActor1550 : public SceneActor { + class Wall : public SceneActor { public: - void subA4D14(int frameNumber, int strip); + void setupWall(int frameNumber, int strip); }; class Junk : public SceneActor { public: - int _fieldA4; int _junkNumber; Junk(); @@ -449,27 +463,24 @@ class Scene1550 : public SceneExt { void setupShipComponent(int componentId); }; - class UnkObj15503 : public SceneActor { - public: - int _fieldA4; - - UnkObj15503(); - void synchronize(Serializer &s); + class DishControlsWindow : public ModalWindow { + class DishControl : public SceneActor { + public: + int _controlId; - virtual bool startAction(CursorType action, Event &event); - }; + DishControl(); + void synchronize(Serializer &s); - class UnkArea1550 : public SceneArea { + virtual bool startAction(CursorType action, Event &event); + }; public: byte _field20; SceneActor _areaActor; - UnkObj15503 _unkObj155031; - UnkObj15503 _unkObj155032; + DishControl _button; + DishControl _lever; virtual void remove(); - virtual void process(Event &event); - virtual void proc12(int visage, int stripFrameNum, int frameNum, int posX, int posY); - virtual void proc13(int resNum, int lookLineNum, int talkLineNum, int useLineNum); + virtual void setup2(int visage, int stripFrameNum, int frameNum, int posX, int posY); }; class WorkingShip : public NamedHotspot { @@ -477,11 +488,6 @@ class Scene1550 : public SceneExt { virtual bool startAction(CursorType action, Event &event); }; - class Hotspot3 : public NamedHotspot { - public: - virtual bool startAction(CursorType action, Event &event); - }; - class Wreckage : public SceneActor { public: virtual bool startAction(CursorType action, Event &event); @@ -492,77 +498,71 @@ class Scene1550 : public SceneExt { virtual bool startAction(CursorType action, Event &event); }; - class Actor8 : public SceneActor { + class AirBag : public SceneActor { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor9 : public SceneActor { + class Joystick : public SceneActor { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor10 : public SceneActor { + class Gyroscope : public SceneActor { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor11 : public SceneActor { + class DiagnosticsDisplay : public SceneActor { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor12 : public SceneActor { + class DishTower : public SceneActor { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor13 : public SceneActor { + class Dish : public SceneActor { public: virtual bool startAction(CursorType action, Event &event); }; - class Wall : public SceneActor1550 { - // Nothing specific found in the original - // TODO: check if it's an useless class - }; - public: SpeakerQuinn _quinnSpeaker; SpeakerSeeker _seekerSpeaker; - WorkingShip _shipHull; - WorkingShip _item2; - Hotspot3 _item3; - SceneActor _landingStrut; - SceneActor _actor2; - SceneActor _actor3; - SceneActor _actor4; - SceneActor _actor5; + WorkingShip _intactHull1, _intactHull2; + SceneHotspot _background; + SceneActor _wreckage2; // also used for Lance of Truth landing strut + SceneActor _wreckage3; + SceneActor _wreckage4; + SceneActor _walkway; + SceneActor _dishTowerShadow; Wreckage _wreckage; Companion _companion; - Actor8 _actor8; - Actor9 _actor9; - Actor10 _actor10; - Actor11 _actor11; - Actor12 _actor12; - Actor13 _actor13; + AirBag _airbag; + Joystick _joystick; + Gyroscope _gyroscope; + DiagnosticsDisplay _diagnosticsDisplay; + DishTower _dishTower; + Dish _dish; Junk _junk[8]; - Wall _actor14; + Wall _wallCorner1; Wall _northWall; // Is also reused for landing strip - Wall _actor16; + Wall _wallCorner2; Wall _westWall; // Is also reused for left hand space Wall _eastWall; Wall _southWall; ShipComponent _shipComponents[8]; - UnkArea1550 _unkArea1; + DishControlsWindow _dishControlsWindow; SequenceManager _sequenceManager1; SequenceManager _sequenceManager2; - int _field412; - byte _field414; - int _field415; - int _field417; - int _field419; + bool _dontExit; + int _wallType; + int _dishMode; + int _sceneResourceId; + int _walkRegionsId; Scene1550(); void synchronize(Serializer &s); @@ -576,14 +576,14 @@ public: }; class Scene1575 : public SceneExt { - class Hotspot1 : public NamedHotspot { + class Button : public NamedHotspot { public: - int _field34; - int _field36; + int _buttonId; + bool _pressed; - Hotspot1(); + Button(); void synchronize(Serializer &s); - void subA910D(int indx); + void initButton(int buttonId); virtual void process(Event &event); virtual bool startAction(CursorType action, Event &event); @@ -594,12 +594,12 @@ public: int _field416; int _field418; int _field41A; - Hotspot1 _item1; - Hotspot1 _item2; - Hotspot1 _item3; - Hotspot1 _item4; - Hotspot1 _item5; - Hotspot1 _item6; + Button _button1; + Button _button2; + Button _button3; + Button _button4; + Button _button5; + Button _button6; SceneActor _actor1; SceneActor _actor2; SceneActor _actor3; @@ -629,54 +629,53 @@ public: }; class Scene1580 : public SceneExt { - class Hotspot1 : public NamedHotspot { + class JoystickPlug : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; - class Hotspot2 : public NamedHotspot { + class ScreenSlot : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor2 : public SceneActor { + class Joystick : public SceneActor { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor3 : public SceneActor { + class Screen : public SceneActor { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor4 : public SceneActor { + class StorageCompartment : public SceneActor { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor5 : public SceneActor { + class HatchButton : public SceneActor { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor6 : public SceneActor { + class ThrusterValve : public SceneActor { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor7 : public SceneActor { + class Ignitor : public SceneActor { public: virtual bool startAction(CursorType action, Event &event); }; public: - int _field412; SpeakerQuinn _quinnSpeaker; SpeakerSeeker _seekerSpeaker; - Hotspot1 _item1; - Hotspot2 _item2; - NamedHotspot _item3; - SceneActor _actor1; + JoystickPlug _joystickPlug; + ScreenSlot _screenSlot; + NamedHotspot _background; + SceneActor _screenDisplay; SceneActor _arrActor[8]; - Actor2 _actor2; - Actor3 _actor3; - Actor4 _actor4; - Actor5 _actor5; - Actor6 _actor6; - Actor7 _actor7; + Joystick _joystick; + Screen _screen; + StorageCompartment _storageCompartment; + HatchButton _hatchButton; + ThrusterValve _thrusterValve; + Ignitor _ignitor; SequenceManager _sequenceManager; Scene1580(); @@ -692,17 +691,16 @@ class Scene1625 : public SceneExt { virtual bool startAction(CursorType action, Event &event); }; public: - int _field412; SpeakerMiranda1625 _mirandaSpeaker; SpeakerTeal1625 _tealSpeaker; SpeakerSoldier1625 _soldierSpeaker; - NamedHotspot _item1; - SceneActor _actor1; + NamedHotspot _background; + SceneActor _teal; SceneActor _tealHead; - SceneActor _actor3; + SceneActor _mirandaMouth; SceneActor _glass; - SceneActor _actor5; - SceneActor _actor6; + SceneActor _wristRestraints; + SceneActor _tealRightArm; Wire _wire; SequenceManager _sequenceManager; @@ -716,16 +714,11 @@ public: }; class Scene1700 : public SceneExt { - class Item2 : public NamedHotspot { - public: - virtual bool startAction(CursorType action, Event &event); - }; - class RimTransport : public SceneActor { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor12 : public SceneActor { + class Companion : public SceneActor { public: virtual bool startAction(CursorType action, Event &event); }; @@ -745,10 +738,10 @@ class Scene1700 : public SceneExt { public: SpeakerQuinn _quinnSpeaker; SpeakerSeeker _seekerSpeaker; - NamedHotspot _item1; - Item2 _item2; - SceneActor _actor1; - SceneActor _actor2; + NamedHotspot _surface; + NamedHotspot _background; + SceneActor _playerShadow; + SceneActor _companionShadow; SceneActor _slabWest; SceneActor _slabEast; SceneActor _slabShadowWest; @@ -756,16 +749,15 @@ public: SceneActor _westPlatform; SceneActor _rimTransportDoor; SceneActor _ledgeHopper; - SceneActor _actor10; + SceneActor _hatch; RimTransport _rimTransport; - Actor12 _actor12; + Companion _companion; NorthExit _northExit; SouthExit _southExit; WestExit _westExit; SequenceManager _sequenceManager; - int _field77A; - int _field77C; + bool _walkFlag; Scene1700(); void synchronize(Serializer &s); @@ -791,7 +783,6 @@ class Scene1750 : public SceneExt { void setupSlider(int incrAmount, int xp, int ys, int height, int thumbHeight); void calculateSlider(); - virtual void remove(); virtual void process(Event &event); virtual bool startAction(CursorType action, Event &event); }; @@ -808,13 +799,13 @@ class Scene1750 : public SceneExt { public: NamedHotspot _background; - NamedHotspot _redLights; + NamedHotspot _redLightsDescr; NamedHotspot _greenLights; NamedHotspot _frontView; NamedHotspot _rearView; - SceneActor _actor1; - SceneActor _actor2; - SceneActor _actor3; + SceneActor _scannerIcon; + SceneActor _redLights; + SceneActor _radarSweep; SpeedSlider _speedSlider; Button _forwardButton; Button _backwardButton; @@ -823,12 +814,12 @@ public: PaletteRotation *_rotation; int _direction; - int _field413; + int _speedCurrent; int _speed; - int _field417; - int _field419; - int _field41B; - int _field41D; + int _speedDelta; + int _rotationSegment; + int _rotationSegCurrent; + int _newRotation; Scene1750(); virtual void synchronize(Serializer &s); @@ -859,7 +850,7 @@ class Scene1800 : public SceneExt { virtual bool startAction(CursorType action, Event &event); }; - class Exit1 : public SceneExit { + class SouthExit : public SceneExit { public: virtual void changeScene(); }; @@ -867,21 +858,21 @@ public: int _locationMode; SpeakerQuinn _quinnSpeaker; SpeakerSeeker _seekerSpeaker; - NamedHotspot _item1; - NamedHotspot _item2; - NamedHotspot _item3; - NamedHotspot _item4; + NamedHotspot _elevator; + NamedHotspot _elevatorContents; + NamedHotspot _surface; + NamedHotspot _secBackground; Background _background; - SceneActor _actor1; + SceneActor _playerShadow; SceneActor _companion; - SceneActor _actor3; + SceneActor _companionShadow; SceneActor _leftStaircase; SceneActor _rightStaircase; Lever _lever; Doors _doors; PassengerDoor _leftDoor; PassengerDoor _rightDoor; - Exit1 _exit1; + SouthExit _southExit; SequenceManager _sequenceManager; Scene1800(); @@ -902,7 +893,7 @@ class Scene1850 : public SceneExt { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor6 : public SceneActor { + class Door : public SceneActor { public: virtual bool startAction(CursorType action, Event &event); }; @@ -912,24 +903,24 @@ class Scene1850 : public SceneExt { }; public: - int _field412; - int _field414; - int _field416; - int _field418; - Common::Point _field41A; - int _field41E; + int _sceneMode; + int _shadeCountdown; + int _shadeDirection; + bool _shadeChanging; + Common::Point _playerDest; + int _seqNumber; ScenePalette _palette1; SpeakerQuinn _quinnSpeaker; SpeakerSeeker _seekerSpeaker; NamedHotspot _background; Button _button; SceneActor _companion; - SceneActor _actor2; - SceneActor _actor3; - SceneActor _actor4; + SceneActor _airbag; + SceneActor _screen; + SceneActor _helmet; Robot _robot; - Actor6 _leftDoor; - Actor6 _rightDoor; + Door _leftDoor; + Door _rightDoor; DisplayScreen _displayScreen; SequenceManager _sequenceManager1; SequenceManager _sequenceManager2; @@ -961,11 +952,10 @@ class Scene1875 : public SceneExt { public: SpeakerQuinn _quinnSpeaker; SpeakerSeeker _seekerSpeaker; - NamedHotspot _item1; - NamedHotspot _item2; - SceneActor _actor1; - SceneActor _actor2; - SceneActor _actor3; + NamedHotspot _background; + NamedHotspot _screen; + SceneActor _map; + SceneActor _rimPosition; Button _button1; Button _button2; Button _button3; @@ -996,9 +986,9 @@ public: SpeakerSeeker1900 _seekerSpeaker; NamedHotspot _background; NamedHotspot _elevator; - SceneActor _actor1; - BackgroundSceneObject _object1; - BackgroundSceneObject _object2; + SceneActor _companion; + BackgroundSceneObject _leftDoorFrame; + BackgroundSceneObject _rightDoorFrame; LiftDoor _leftDoor, _rightDoor; WestExit _westExit; EastExit _eastExit; @@ -1024,30 +1014,30 @@ class Scene1925 : public SceneExt { public: virtual void changeScene(); }; - class Exit2 : public SceneExit { + class ExitDown : public SceneExit { public: virtual void changeScene(); }; - class Exit3 : public SceneExit { + class WestExit : public SceneExit { public: virtual void changeScene(); }; - class Exit4 : public SceneExit { + class EastExit : public SceneExit { public: virtual void changeScene(); }; public: - NamedHotspot _item1; + NamedHotspot _background; Button _button; Ladder _ladder; - SceneActor _actor1; + SceneActor _door; ExitUp _exitUp; - Exit2 _exit2; - Exit3 _exit3; - Exit4 _exit4; + ExitDown _exitDown; + WestExit _westExit; + EastExit _eastExit; SequenceManager _sequenceManager; - int _field9B8; + int _newSceneMode; int _levelResNum[5]; Scene1925(); @@ -1083,12 +1073,12 @@ class Scene1945 : public SceneExt { virtual void changeScene(); }; public: - NamedHotspot _item1; - NamedHotspot _item2; + NamedHotspot _hole; + NamedHotspot _ice2; Ice _ice; Ladder _ladder; - SceneActor _actor1; - SceneActor _actor2; + SceneActor _coveringIce; + SceneActor _alcoholLamp; Gunpowder _gunpowder; ExitUp _exitUp; CorridorExit _corridorExit; @@ -1128,14 +1118,13 @@ class Scene1950 : public SceneExt { SceneActor _areaActor; KeypadButton _buttons[16]; - byte _field20; int _buttonIndex; KeypadWindow(); virtual void synchronize(Serializer &s); virtual void remove(); - virtual void proc12(int visage, int stripFrameNum, int frameNum, int posX, int posY); - virtual void proc13(int resNum, int lookLineNum, int talkLineNum, int useLineNum); + virtual void setup2(int visage, int stripFrameNum, int frameNum, int posX, int posY); + virtual void setup3(int resNum, int lookLineNum, int talkLineNum, int useLineNum); }; class Keypad : public NamedHotspot { @@ -1152,10 +1141,6 @@ class Scene1950 : public SceneExt { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor4 : public SceneActor { - public: - virtual bool startAction(CursorType action, Event &event); - }; class Gem : public SceneActor { public: virtual bool startAction(CursorType action, Event &event); @@ -1163,11 +1148,9 @@ class Scene1950 : public SceneExt { class Vampire : public SceneActor { public: Common::Point _deadPosition; - int _fieldA8; - int _fieldAA; + int _deltaX; + int _deltaY; int _vampireMode; - byte _fieldAE; - byte _fieldAF; Vampire(); void synchronize(Serializer &s); @@ -1223,7 +1206,7 @@ public: SceneActor _containmentField; Gem _gem; SceneActor _cube; - SceneActor _actor7; + SceneActor _pulsingLights; Vampire _vampire; KeypadWindow _KeypadWindow; NorthExit _northExit; @@ -1236,10 +1219,10 @@ public: DoorExit _doorExit; SequenceManager _sequenceManager; - int _field412; - int _field414; - int _field416; - Common::Point _field418; + bool _upExitStyle; + bool _removeFlag; + bool _vampireActive; + Common::Point _vampireDestPos; int _vampireIndex; Scene1950(); @@ -1250,6 +1233,7 @@ public: virtual void signal(); virtual void process(Event &event); }; + } // End of namespace Ringworld2 } // End of namespace TsAGE diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.cpp b/engines/tsage/ringworld2/ringworld2_scenes2.cpp index 510855b162..bd8a0cdd0d 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes2.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -132,25 +132,28 @@ void Scene2000::initPlayer() { } for (int i = 0; i < 11; i++) { if (R2_GLOBALS._spillLocation[R2_GLOBALS._player._characterIndex] == R2_GLOBALS._spillLocation[3 + i]) - _objList1[i].show(); + _persons[i].show(); } - if ((R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) && (R2_GLOBALS._spillLocation[R2_QUINN] == R2_GLOBALS._spillLocation[R2_SEEKER])) { - _object1.postInit(); + if ((R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) + && (R2_GLOBALS._spillLocation[R2_QUINN] == R2_GLOBALS._spillLocation[R2_SEEKER])) { + _companion.postInit(); if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - _object1.setup(20, 5, 1); - _object1.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); + // Seeker is in room with Quinn + _companion.setup(20, 5, 1); + _companion.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); } else { - _object1.setup(2008, 5, 1); - _object1.setDetails(9001, 0, 5, 3, 1, (SceneItem *)NULL); + // Quinn is in room with Seeker + _companion.setup(2008, 5, 1); + _companion.setDetails(9001, 0, 5, 3, 1, (SceneItem *)NULL); } if (_westExit._enabled) { if (_eastExit._enabled) - _object1.setPosition(Common::Point(180, 128)); + _companion.setPosition(Common::Point(180, 128)); else - _object1.setPosition(Common::Point(75, 128)); + _companion.setPosition(Common::Point(75, 128)); } else - _object1.setPosition(Common::Point(300, 128)); + _companion.setPosition(Common::Point(300, 128)); } } @@ -174,9 +177,9 @@ void Scene2000::initExits() { _doorExit._moving = false; for (int i = 0; i < 11; i++) - _objList1[i].hide(); + _persons[i].hide(); - _object1.remove(); + _companion.remove(); switch (R2_GLOBALS._spillLocation[R2_GLOBALS._player._characterIndex]) { case 3: @@ -393,11 +396,11 @@ void Scene2000::Action1::signal() { _actionIndex = 1; Common::Point pt(-20, 127); NpcMover *mover = new NpcMover(); - scene->_objList1[_state].addMover(mover, &pt, scene); + scene->_persons[_state].addMover(mover, &pt, scene); break; } case 1: - scene->_objList1[_state].setPosition(Common::Point(340, 127)); + scene->_persons[_state].setPosition(Common::Point(340, 127)); --R2_GLOBALS._spillLocation[4 + _state]; _actionIndex = 0; switch (_state - 1) { @@ -426,9 +429,9 @@ void Scene2000::Action1::signal() { } if (R2_GLOBALS._spillLocation[3 + _state] == R2_GLOBALS._spillLocation[R2_GLOBALS._player._characterIndex]) - scene->_objList1[_state].show(); + scene->_persons[_state].show(); else - scene->_objList1[_state].hide(); + scene->_persons[_state].hide(); signal(); break; @@ -436,11 +439,11 @@ void Scene2000::Action1::signal() { _actionIndex = 6; Common::Point pt(340, 127); NpcMover *mover = new NpcMover(); - scene->_objList1[_state].addMover(mover, &pt, this); + scene->_persons[_state].addMover(mover, &pt, this); break; } case 6: - scene->_objList1[_state].setPosition(Common::Point(-20, 127)); + scene->_persons[_state].setPosition(Common::Point(-20, 127)); ++R2_GLOBALS._spillLocation[3 + _state]; _actionIndex = 5; switch (_state - 1) { @@ -469,33 +472,33 @@ void Scene2000::Action1::signal() { } if (R2_GLOBALS._spillLocation[3 + _state] == R2_GLOBALS._spillLocation[R2_GLOBALS._player._characterIndex]) - scene->_objList1[_state].show(); + scene->_persons[_state].show(); else - scene->_objList1[_state].hide(); + scene->_persons[_state].hide(); signal(); break; case 10: { Common::Point pt(290, 127); NpcMover *mover = new NpcMover(); - scene->_objList1[_state].addMover(mover, &pt, this); + scene->_persons[_state].addMover(mover, &pt, this); _actionIndex = 11; break; } case 11: if (_state == 1) - scene->_objList1[0].setStrip(1); + scene->_persons[0].setStrip(1); else if (_state == 5) - scene->_objList1[4].setStrip(1); + scene->_persons[4].setStrip(1); setDelay(600); _actionIndex = 12; break; case 12: if (_state == 1) - scene->_objList1[0].setStrip(2); + scene->_persons[0].setStrip(2); else if (_state == 5) - scene->_objList1[4].setStrip(2); - scene->_objList1[_state].setStrip(1); + scene->_persons[4].setStrip(2); + scene->_persons[_state].setStrip(1); _actionIndex = 5; signal(); break; @@ -503,29 +506,29 @@ void Scene2000::Action1::signal() { if ((R2_GLOBALS._spillLocation[3 + _state] == 13) || (R2_GLOBALS._spillLocation[3 + _state] == 22) || (R2_GLOBALS._spillLocation[3 + _state] == 27)) { Common::Point pt(30, 127); NpcMover *mover = new NpcMover(); - scene->_objList1[_state].addMover(mover, &pt, this); + scene->_persons[_state].addMover(mover, &pt, this); _actionIndex = 16; } else { Common::Point pt(120, 127); NpcMover *mover = new NpcMover(); - scene->_objList1[_state].addMover(mover, &pt, this); + scene->_persons[_state].addMover(mover, &pt, this); _actionIndex = 16; } break; case 16: if (_state == 1) - scene->_objList1[2].setStrip(2); + scene->_persons[2].setStrip(2); else if (_state == 8) - scene->_objList1[9].setStrip(2); + scene->_persons[9].setStrip(2); setDelay(600); _actionIndex = 17; break; case 17: if (_state == 1) - scene->_objList1[2].setStrip(1); + scene->_persons[2].setStrip(1); else if (_state == 8) - scene->_objList1[9].setStrip(1); - scene->_objList1[_state].setStrip(2); + scene->_persons[9].setStrip(1); + scene->_persons[_state].setStrip(2); _actionIndex = 0; break; case 99: @@ -806,57 +809,57 @@ void Scene2000::postInit(SceneObjectList *OwnerList) { _action5._state = 3; for (int i = 0; i < 11; i++) - _objList1[i].postInit(); + _persons[i].postInit(); - _objList1[0].setVisage(2000); - _objList1[0].setStrip(2); - _objList1[0].setDetails(2001, 0, -1, -1, 1, (SceneItem *)NULL); + _persons[0].setVisage(2000); + _persons[0].setStrip(2); + _persons[0].setDetails(2001, 0, -1, -1, 1, (SceneItem *)NULL); - _objList1[1].setVisage(2001); - _objList1[1].setStrip(2); - _objList1[1].setDetails(2001, 0, -1, -1, 1, (SceneItem *)NULL); + _persons[1].setVisage(2001); + _persons[1].setStrip(2); + _persons[1].setDetails(2001, 0, -1, -1, 1, (SceneItem *)NULL); - _objList1[2].setVisage(2003); - _objList1[2].setStrip(1); - _objList1[2].setDetails(2001, 0, -1, -1, 1, (SceneItem *)NULL); + _persons[2].setVisage(2003); + _persons[2].setStrip(1); + _persons[2].setDetails(2001, 0, -1, -1, 1, (SceneItem *)NULL); - _objList1[3].setVisage(2007); - _objList1[3].setStrip(2); - _objList1[3].setDetails(2001, 12, -1, -1, 1, (SceneItem *)NULL); + _persons[3].setVisage(2007); + _persons[3].setStrip(2); + _persons[3].setDetails(2001, 12, -1, -1, 1, (SceneItem *)NULL); - _objList1[4].setVisage(2004); - _objList1[4].setStrip(2); - _objList1[4].setDetails(2001, 19, -1, -1, 1, (SceneItem *)NULL); + _persons[4].setVisage(2004); + _persons[4].setStrip(2); + _persons[4].setDetails(2001, 19, -1, -1, 1, (SceneItem *)NULL); - _objList1[5].setVisage(2003); - _objList1[5].setStrip(2); - _objList1[5].setDetails(2001, 0, -1, -1, 1, (SceneItem *)NULL); + _persons[5].setVisage(2003); + _persons[5].setStrip(2); + _persons[5].setDetails(2001, 0, -1, -1, 1, (SceneItem *)NULL); - _objList1[6].setVisage(2000); - _objList1[6].setStrip(1); - _objList1[6].setDetails(2001, 0, -1, -1, 1, (SceneItem *)NULL); + _persons[6].setVisage(2000); + _persons[6].setStrip(1); + _persons[6].setDetails(2001, 0, -1, -1, 1, (SceneItem *)NULL); - _objList1[7].setVisage(2000); - _objList1[7].setStrip(2); - _objList1[7].setDetails(2001, 0, -1, -1, 1, (SceneItem *)NULL); + _persons[7].setVisage(2000); + _persons[7].setStrip(2); + _persons[7].setDetails(2001, 0, -1, -1, 1, (SceneItem *)NULL); - _objList1[8].setVisage(2000); - _objList1[8].setStrip(2); - _objList1[8].setDetails(2001, 0, -1, -1, 1, (SceneItem *)NULL); + _persons[8].setVisage(2000); + _persons[8].setStrip(2); + _persons[8].setDetails(2001, 0, -1, -1, 1, (SceneItem *)NULL); - _objList1[9].setVisage(2006); - _objList1[9].setStrip(1); - _objList1[9].setDetails(2001, 6, -1, -1, 1, (SceneItem *)NULL); + _persons[9].setVisage(2006); + _persons[9].setStrip(1); + _persons[9].setDetails(2001, 6, -1, -1, 1, (SceneItem *)NULL); - _objList1[10].setVisage(2007); - _objList1[10].setStrip(1); - _objList1[10].setDetails(2001, 12, -1, -1, 1, (SceneItem *)NULL); + _persons[10].setVisage(2007); + _persons[10].setStrip(1); + _persons[10].setDetails(2001, 12, -1, -1, 1, (SceneItem *)NULL); for (int i = 0; i < 11; i++) { - _objList1[i].animate(ANIM_MODE_1, NULL); - _objList1[i]._moveDiff.x = 3; - _objList1[i]._moveRate = 8; - _objList1[i].hide(); + _persons[i].animate(ANIM_MODE_1, NULL); + _persons[i]._moveDiff.x = 3; + _persons[i]._moveRate = 8; + _persons[i].hide(); switch (i - 1) { case 0: if (R2_GLOBALS._spillLocation[3 + i] == 1) @@ -899,28 +902,28 @@ void Scene2000::postInit(SceneObjectList *OwnerList) { case 22: case 27: case 30: - _objList1[i].setPosition(Common::Point(265, 127)); + _persons[i].setPosition(Common::Point(265, 127)); break; case 5: case 12: case 17: case 21: case 26: - _objList1[i].setPosition(Common::Point(55, 127)); + _persons[i].setPosition(Common::Point(55, 127)); break; default: - _objList1[i].setPosition(Common::Point(160, 127)); + _persons[i].setPosition(Common::Point(160, 127)); break; } } - _objList1[1].setAction(&_action2); - _objList1[3].setAction(&_action5); - _objList1[5].setAction(&_action4); - _objList1[8].setAction(&_action1); + _persons[1].setAction(&_action2); + _persons[3].setAction(&_action5); + _persons[5].setAction(&_action4); + _persons[8].setAction(&_action1); initPlayer(); - _item1.setDetails(Rect(0, 0, 320, 200), 2000, 0, -1, 23, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 2000, 0, -1, 23, 1, NULL); SceneExt::postInit(); } @@ -997,8 +1000,6 @@ void Scene2000::signal() { g_globals->_sceneManager.changeScene(2535); break; default: - if (R2_GLOBALS._v56AAB != 0) - R2_GLOBALS._v56AAB = 0; R2_GLOBALS._player.enableControl(CURSOR_WALK); break; } @@ -1008,7 +1009,6 @@ void Scene2000::signal() { g_globals->_sceneManager.changeScene(2350); break; default: - R2_GLOBALS._v56AAB = 0; R2_GLOBALS._player.enableControl(); break; } @@ -1039,20 +1039,20 @@ void Scene2000::synchronize(Serializer &s) { * *--------------------------------------------------------------------------*/ -bool Scene2350::Actor2::startAction(CursorType action, Event &event) { +bool Scene2350::Companion::startAction(CursorType action, Event &event) { if (action != R2_SENSOR_PROBE) return(SceneActor::startAction(action, event)); return true; } -bool Scene2350::Actor3::startAction(CursorType action, Event &event) { - Scene2350 *scene = (Scene2350 *)R2_GLOBALS._sceneManager._scene; - +bool Scene2350::Balloon::startAction(CursorType action, Event &event) { if ((action == R2_REBREATHER_TANK) && (R2_GLOBALS.getFlag(74))) { + Scene2350 *scene = (Scene2350 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); - scene->_actor1.postInit(); + scene->_person.postInit(); scene->_sceneMode = 2355; - scene->setAction(&scene->_sequenceManager, scene, 2355, &R2_GLOBALS._player, &scene->_actor1, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2355, &R2_GLOBALS._player, &scene->_person, NULL); return true; } @@ -1061,8 +1061,9 @@ bool Scene2350::Actor3::startAction(CursorType action, Event &event) { void Scene2350::ExitUp::changeScene() { Scene2350 *scene = (Scene2350 *)R2_GLOBALS._sceneManager._scene; + _enabled = false; - R2_GLOBALS._player.disableControl(CURSOR_CROSSHAIRS); + R2_GLOBALS._player.disableControl(CURSOR_WALK); scene->_sceneMode = 12; if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2350, &R2_GLOBALS._player, NULL); @@ -1109,37 +1110,37 @@ void Scene2350::postInit(SceneObjectList *OwnerList) { } if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { - _actor2.postInit(); + _companion.postInit(); if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - _actor2.setup(20, 5, 1); - _actor2.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); + _companion.setup(20, 5, 1); + _companion.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); } else { - _actor2.setup(2008, 5, 1); - _actor2.setDetails(9001, 0, 5, 3, 1, (SceneItem *)NULL); + _companion.setup(2008, 5, 1); + _companion.setDetails(9001, 0, 5, 3, 1, (SceneItem *)NULL); } - _actor2.setPosition(Common::Point(135, 128)); + _companion.setPosition(Common::Point(135, 128)); } - _actor3.postInit(); - _actor4.postInit(); + _balloon.postInit(); + _harness.postInit(); if (R2_INVENTORY.getObjectScene(R2_REBREATHER_TANK) == 2350) { - _actor3.hide(); - _actor4.hide(); + _balloon.hide(); + _harness.hide(); } else { - _actor3.setup(2350, 0, 1); - _actor3.setPosition(Common::Point(197, 101)); - _actor3.setDetails(2000, 12, -1, -1, 1, (SceneItem *)NULL); - _actor3.fixPriority(10); - _actor4.setup(2350, 1, 2); - _actor4.setPosition(Common::Point(199, 129)); - _actor4.setDetails(2000, 12, -1, -1, 1, (SceneItem *)NULL); - _actor4.fixPriority(10); - } - _item1.setDetails(Rect(0, 0, 320, 200), 2000, 9, -1, -1, 1, NULL); + _balloon.setup(2350, 0, 1); + _balloon.setPosition(Common::Point(197, 101)); + _balloon.setDetails(2000, 12, -1, -1, 1, (SceneItem *)NULL); + _balloon.fixPriority(10); + _harness.setup(2350, 1, 2); + _harness.setPosition(Common::Point(199, 129)); + _harness.setDetails(2000, 12, -1, -1, 1, (SceneItem *)NULL); + _harness.fixPriority(10); + } + _background.setDetails(Rect(0, 0, 320, 200), 2000, 9, -1, -1, 1, NULL); R2_GLOBALS._player.disableControl(); if (R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] == 2000) { - if (R2_GLOBALS._spillLocation[R2_GLOBALS._player._characterIndex] == 34) { + if (R2_GLOBALS._spillLocation[R2_GLOBALS._player._characterIndex] != 34) { if (R2_GLOBALS._player._characterIndex == R2_QUINN) _sceneMode = 2351; else @@ -1201,23 +1202,12 @@ void Scene2350::signal() { } } -void Scene2350::process(Event &event) { - if ((R2_GLOBALS._player._canWalk) && (event.eventType != EVENT_BUTTON_DOWN) && - (R2_GLOBALS._events.getCursor() == CURSOR_CROSSHAIRS)){ - Common::Point pt(event.mousePos.x, 129); - PlayerMover *mover = new PlayerMover(); - R2_GLOBALS._player.addMover(mover, &pt); - event.handled = true; - } - Scene::process(event); -} - /*-------------------------------------------------------------------------- * Scene 2400 - Spill Mountains: Large empty room * *--------------------------------------------------------------------------*/ -void Scene2400::Exit1::changeScene() { +void Scene2400::WestExit::changeScene() { Scene2400 *scene = (Scene2400 *)R2_GLOBALS._sceneManager._scene; R2_GLOBALS._player.disableControl(); @@ -1229,7 +1219,7 @@ void Scene2400::Exit1::changeScene() { } -void Scene2400::Exit2::changeScene() { +void Scene2400::EastExit::changeScene() { Scene2400 *scene = (Scene2400 *)R2_GLOBALS._sceneManager._scene; R2_GLOBALS._player.disableControl(); @@ -1243,10 +1233,10 @@ void Scene2400::Exit2::changeScene() { void Scene2400::postInit(SceneObjectList *OwnerList) { loadScene(2400); SceneExt::postInit(); - _exit1.setDetails(Rect(0, 125, 14, 165), EXITCURSOR_W, 2000); - _exit1.setDest(Common::Point(14, 150)); - _exit2.setDetails(Rect(305, 125, 320, 165), EXITCURSOR_E, 2000); - _exit2.setDest(Common::Point(315, 150)); + _westExit.setDetails(Rect(0, 125, 14, 165), EXITCURSOR_W, 2000); + _westExit.setDest(Common::Point(14, 150)); + _eastExit.setDetails(Rect(305, 125, 320, 165), EXITCURSOR_E, 2000); + _eastExit.setDest(Common::Point(315, 150)); R2_GLOBALS._player.postInit(); R2_GLOBALS._player.disableControl(); @@ -1281,9 +1271,9 @@ void Scene2400::signal() { *--------------------------------------------------------------------------*/ bool Scene2425::RopeDest1::startAction(CursorType action, Event &event) { - Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; - if ((action == R2_CURSOR_ROPE) && (!R2_GLOBALS.getFlag(84))) { + Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2426; scene->setAction(&scene->_sequenceManager, scene, 2426, &R2_GLOBALS._player, &scene->_rope, NULL); @@ -1298,9 +1288,9 @@ bool Scene2425::RopeDest1::startAction(CursorType action, Event &event) { } bool Scene2425::RopeDest2::startAction(CursorType action, Event &event) { - Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; - if ((action == R2_CURSOR_ROPE) && (R2_GLOBALS.getFlag(84))) { + Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2427; scene->setAction(&scene->_sequenceManager, scene, 2427, &R2_GLOBALS._player, &scene->_rope, NULL); @@ -1315,11 +1305,11 @@ bool Scene2425::RopeDest2::startAction(CursorType action, Event &event) { } bool Scene2425::Crevasse::startAction(CursorType action, Event &event) { - Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; - if (action != R2_CURSOR_ROPE) return NamedHotspot::startAction(action, event); else { + Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); if (R2_GLOBALS.getFlag(84)) { scene->_sceneMode = 20; @@ -1333,7 +1323,7 @@ bool Scene2425::Crevasse::startAction(CursorType action, Event &event) { } } -bool Scene2425::Item4::startAction(CursorType action, Event &event) { +bool Scene2425::Background::startAction(CursorType action, Event &event) { if (action != R2_CURSOR_ROPE) return NamedHotspot::startAction(action, event); else { @@ -1367,7 +1357,7 @@ bool Scene2425::Pictographs::startAction(CursorType action, Event &event) { } } -void Scene2425::Exit1::changeScene() { +void Scene2425::SouthEastExit::changeScene() { Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; _enabled = false; @@ -1390,7 +1380,7 @@ void Scene2425::postInit(SceneObjectList *OwnerList) { } R2_GLOBALS._sound1.play(200); - _exit1.setDetails(Rect(270, 136, 319, 168), EXITCURSOR_SE, 2000); + _southEastExit.setDetails(Rect(270, 136, 319, 168), EXITCURSOR_SE, 2000); R2_GLOBALS._player.postInit(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); @@ -1426,8 +1416,6 @@ void Scene2425::postInit(SceneObjectList *OwnerList) { _ropeDest1.setDetails(Rect(225, 52, 248, 65), 2425, -1, -1, -1, 1, NULL); _ropeDest2.setDetails(Rect(292, 81, 316, 94), 2425, -1, -1, -1, 1, NULL); -// CHECKME: SceneActor using a SceneItem function?? -// _pictographs2.setDetails(11, 2425, 3, -1, 6); _pictographs2._sceneRegionId = 11; _pictographs2._resNum = 2425; _pictographs2._lookLineNum = 3; @@ -1436,7 +1424,7 @@ void Scene2425::postInit(SceneObjectList *OwnerList) { g_globals->_sceneItems.push_back(&_pictographs2); _crevasse.setDetails(12, 2425, 7, -1, 9); - _item4.setDetails(Rect(0, 0, 320, 200), 2425, 0, -1, -1, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 2425, 0, -1, -1, 1, NULL); R2_GLOBALS._player.disableControl(); switch (R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex]) { @@ -1495,16 +1483,16 @@ void Scene2425::signal() { * *--------------------------------------------------------------------------*/ -bool Scene2430::Actor1::startAction(CursorType action, Event &event) { +bool Scene2430::Companion::startAction(CursorType action, Event &event) { return SceneActor::startAction(action, event); } bool Scene2430::GunPowder::startAction(CursorType action, Event &event) { - Scene2430 *scene = (Scene2430 *)R2_GLOBALS._sceneManager._scene; - if ((action != CURSOR_USE) || (R2_GLOBALS._player._characterIndex != 2)) return SceneActor::startAction(action, event); + Scene2430 *scene = (Scene2430 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2430; scene->setAction(&scene->_sequenceManager, scene, 2430, &R2_GLOBALS._player, &scene->_gunPowder, NULL); @@ -1512,18 +1500,18 @@ bool Scene2430::GunPowder::startAction(CursorType action, Event &event) { } bool Scene2430::OilLamp::startAction(CursorType action, Event &event) { - Scene2430 *scene = (Scene2430 *)R2_GLOBALS._sceneManager._scene; - if ((action != CURSOR_USE) || (R2_GLOBALS._player._characterIndex != 2)) return SceneActor::startAction(action, event); + Scene2430 *scene = (Scene2430 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2435; scene->setAction(&scene->_sequenceManager, scene, 2435, &R2_GLOBALS._player, &scene->_oilLamp, NULL); return true; } -void Scene2430::Exit1::changeScene() { +void Scene2430::SouthExit::changeScene() { Scene2430 *scene = (Scene2430 *)R2_GLOBALS._sceneManager._scene; scene->_sceneMode = 0; @@ -1538,8 +1526,8 @@ void Scene2430::Exit1::changeScene() { void Scene2430::postInit(SceneObjectList *OwnerList) { loadScene(2430); SceneExt::postInit(); - _exit1.setDetails(Rect(68, 155, 147, 168), EXITCURSOR_S, 2000); - _exit1.setDest(Common::Point(108, 160)); + _southExit.setDetails(Rect(68, 155, 147, 168), EXITCURSOR_S, 2000); + _southExit.setDest(Common::Point(108, 160)); if (R2_INVENTORY.getObjectScene(R2_GUNPOWDER) == 2430) { _gunPowder.postInit(); @@ -1568,33 +1556,31 @@ void Scene2430::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.setPosition(Common::Point(100, 200)); if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { - _actor1.postInit(); + _companion.postInit(); if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - _actor1.setup(20, 5, 1); - _actor1.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); + _companion.setup(20, 5, 1); + _companion.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); } else { - _actor1.setup(2008, 5, 1); - _actor1.setDetails(9001, 0, 5, 3, 1, (SceneItem *)NULL); + _companion.setup(2008, 5, 1); + _companion.setDetails(9001, 0, 5, 3, 1, (SceneItem *)NULL); } - _actor1.setPosition(Common::Point(189, 137)); + _companion.setPosition(Common::Point(189, 137)); R2_GLOBALS._walkRegions.disableRegion(4); } - _item2.setDetails(Rect(11, 30, 37, 45), 2430, 3, -1, 5, 1, NULL); - _item3.setDetails(Rect(9, 58, 63, 92), 2430, 6, -1, -1, 1, NULL); - _item4.setDetails(Rect(20, 89, 127, 107), 2430, 9, -1, 11, 1, NULL); - _item5.setDetails(Rect(49, 7, 60, 27), 2430, 12, 13, 14, 1, NULL); - _item6.setDetails(Rect(69, 10, 95, 72), 2430, 15, -1, 14, 1, NULL); - _item10.setDetails(Rect(198, 4, 222, 146), 2430, 30, 31, 32, 1, NULL); - _item7.setDetails(Rect(155, 40, 304, 120), 2430, 21, -1, 23, 1, NULL); - _item8.setDetails(Rect(249, 3, 261, 39), 2430, 24, 25, -1, 1, NULL); - _item9.setDetails(Rect(279, 13, 305, 34), 2430, 33, -1, 18, 1, NULL); - // CHECKME: initialized for the 2nd time?? - _item2.setDetails(Rect(11, 30, 37, 45), 2430, 33, -1, 18, 1, NULL); - _item11.setDetails(Rect(116, 104, 148, 111), 2430, 39, -1, -1, 1, NULL); - _item12.setDetails(Rect(66, 77, 84, 83), 2430, 39, -1, -1, 1, NULL); - _item13.setDetails(Rect(117, 118, 201, 141), 2430, 9, -1, 11, 1, NULL); - _item1.setDetails(Rect(0, 0, 320, 200), 2430, 0, -1, -1, 1, NULL); + _furnishings.setDetails(Rect(9, 58, 63, 92), 2430, 6, -1, -1, 1, NULL); + _rug1.setDetails(Rect(20, 89, 127, 107), 2430, 9, -1, 11, 1, NULL); + _mirror.setDetails(Rect(49, 7, 60, 27), 2430, 12, 13, 14, 1, NULL); + _garments.setDetails(Rect(69, 10, 95, 72), 2430, 15, -1, 14, 1, NULL); + _post.setDetails(Rect(198, 4, 222, 146), 2430, 30, 31, 32, 1, NULL); + _bed.setDetails(Rect(155, 40, 304, 120), 2430, 21, -1, 23, 1, NULL); + _towel.setDetails(Rect(249, 3, 261, 39), 2430, 24, 25, -1, 1, NULL); + _bottles1.setDetails(Rect(279, 13, 305, 34), 2430, 33, -1, 18, 1, NULL); + _bottles2.setDetails(Rect(11, 30, 37, 45), 2430, 33, -1, 18, 1, NULL); + _clothesPile1.setDetails(Rect(116, 104, 148, 111), 2430, 39, -1, -1, 1, NULL); + _clothesPile2.setDetails(Rect(66, 77, 84, 83), 2430, 39, -1, -1, 1, NULL); + _rug2.setDetails(Rect(117, 118, 201, 141), 2430, 9, -1, 11, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 2430, 0, -1, -1, 1, NULL); if (R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] == 2000) { R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] = 2430; @@ -1675,7 +1661,7 @@ bool Scene2435::Astor::startAction(CursorType action, Event &event) { } } -void Scene2435::Exit1::changeScene() { +void Scene2435::SouthExit::changeScene() { Scene2435 *scene = (Scene2435 *)R2_GLOBALS._sceneManager._scene; _enabled = false; @@ -1695,8 +1681,8 @@ void Scene2435::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_quinnSpeaker); _stripManager.addSpeaker(&_seekerSpeaker); _stripManager.addSpeaker(&_pharishaSpeaker); - _exit1.setDetails(Rect(142, 155, 207, 167), EXITCURSOR_S, 2000); - _exit1.setDest(Common::Point(175, 160)); + _southExit.setDetails(Rect(142, 155, 207, 167), EXITCURSOR_S, 2000); + _southExit.setDest(Common::Point(175, 160)); _astor.postInit(); _astor.setup(2005, 3, 1); _astor.setPosition(Common::Point(219, 106)); @@ -1784,6 +1770,7 @@ void Scene2435::signal() { _sceneMode = 20; R2_GLOBALS._events.setCursor(CURSOR_ARROW); _stripManager.start(709, this); + break; default: R2_GLOBALS._player.enableControl(); break; @@ -1795,14 +1782,14 @@ void Scene2435::signal() { * *--------------------------------------------------------------------------*/ -bool Scene2440::Actor1::startAction(CursorType action, Event &event) { +bool Scene2440::Companion::startAction(CursorType action, Event &event) { return SceneActor::startAction(action, event); } bool Scene2440::OilLamp::startAction(CursorType action, Event &event) { - Scene2440 *scene = (Scene2440 *)R2_GLOBALS._sceneManager._scene; - if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == R2_SEEKER)) { + Scene2440 *scene = (Scene2440 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2440; scene->setAction(&scene->_sequenceManager, scene, 2440, &R2_GLOBALS._player, &scene->_oilLamp, NULL); @@ -1812,7 +1799,7 @@ bool Scene2440::OilLamp::startAction(CursorType action, Event &event) { return SceneActor::startAction(action, event); } -void Scene2440::Exit1::changeScene() { +void Scene2440::SouthEastExit::changeScene() { Scene2440 *scene = (Scene2440 *)R2_GLOBALS._sceneManager._scene; _enabled = false; @@ -1828,8 +1815,8 @@ void Scene2440::postInit(SceneObjectList *OwnerList) { SceneExt::postInit(); R2_GLOBALS._sound1.play(200); // Fix exit cursor, the original was using NW - _exit1.setDetails(Rect(172, 155, 250, 167), EXITCURSOR_SE, 2000); - _exit1.setDest(Common::Point(210, 160)); + _southEastExit.setDetails(Rect(172, 155, 250, 167), EXITCURSOR_SE, 2000); + _southEastExit.setDest(Common::Point(210, 160)); if (R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_2) == 2440) { _oilLamp.postInit(); _oilLamp.setup(2435, 1, 1); @@ -1850,24 +1837,24 @@ void Scene2440::postInit(SceneObjectList *OwnerList) { } R2_GLOBALS._player.setPosition(Common::Point(210, 200)); if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { - _actor1.postInit(); + _companion.postInit(); if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - _actor1.setup(20, 5, 1); - _actor1.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); + _companion.setup(20, 5, 1); + _companion.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); } else { - _actor1.setup(2008, 5, 1); - _actor1.setDetails(9002, 0, 5, 3, 1, (SceneItem *)NULL); + _companion.setup(2008, 5, 1); + _companion.setDetails(9002, 0, 5, 3, 1, (SceneItem *)NULL); } - _actor1.setPosition(Common::Point(38, 119)); + _companion.setPosition(Common::Point(38, 119)); } - _item2.setDetails(Rect(125, 25, 142, 73), 2430, 15, -1, 14, 1, NULL); - _item3.setDetails(Rect(124, 78, 237, 120), 2430, 36, -1, 38, 1, NULL); - _item4.setDetails(Rect(250, 3, 265, 133), 2430, 30, 31, 32, 1, NULL); - _item5.setDetails(Rect(91, 117, 203, 140), 2430, 9, -1, 11, 1, NULL); - _item6.setDetails(Rect(48, 78, 103, 112), 2430, 6, -1, -1, 1, NULL); - _item7.setDetails(Rect(48, 31, 73, 52), 2430, 33, -1, 18, 1, NULL); - _item1.setDetails(Rect(0, 0, 320, 200), 2430, 0, -1, -1, 1, NULL); + _garments.setDetails(Rect(125, 25, 142, 73), 2430, 15, -1, 14, 1, NULL); + _bedspread.setDetails(Rect(124, 78, 237, 120), 2430, 36, -1, 38, 1, NULL); + _post.setDetails(Rect(250, 3, 265, 133), 2430, 30, 31, 32, 1, NULL); + _rug.setDetails(Rect(91, 117, 203, 140), 2430, 9, -1, 11, 1, NULL); + _furnishings.setDetails(Rect(48, 78, 103, 112), 2430, 6, -1, -1, 1, NULL); + _bottles.setDetails(Rect(48, 31, 73, 52), 2430, 33, -1, 18, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 2430, 0, -1, -1, 1, NULL); R2_GLOBALS._player.disableControl(); @@ -1928,9 +1915,9 @@ void Scene2445::signal() { *--------------------------------------------------------------------------*/ bool Scene2450::Parker::startAction(CursorType action, Event &event) { - Scene2450 *scene = (Scene2450 *)R2_GLOBALS._sceneManager._scene; - if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == R2_QUINN)) { + Scene2450 *scene = (Scene2450 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2452; scene->setAction(&scene->_sequenceManager, scene, 2452, &R2_GLOBALS._player, &scene->_parker, NULL); @@ -1940,18 +1927,18 @@ bool Scene2450::Parker::startAction(CursorType action, Event &event) { } bool Scene2450::CareTaker::startAction(CursorType action, Event &event) { - Scene2450 *scene = (Scene2450 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_TALK) { R2_GLOBALS._player.disableControl(); - if (R2_GLOBALS._v565AE < 3) { - ++R2_GLOBALS._v565AE; + if (R2_GLOBALS._stripModifier < 3) { + Scene2450 *scene = (Scene2450 *)R2_GLOBALS._sceneManager._scene; + + ++R2_GLOBALS._stripModifier; scene->_sceneMode = 20; R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); if (R2_GLOBALS._player._characterIndex == R2_QUINN) - scene->_stripManager.start(699 + (R2_GLOBALS._v565AE * 2), scene); + scene->_stripManager.start(699 + (R2_GLOBALS._stripModifier * 2), scene); else - scene->_stripManager.start(700 + (R2_GLOBALS._v565AE * 2), scene); + scene->_stripManager.start(700 + (R2_GLOBALS._stripModifier * 2), scene); } return true; } else { @@ -1959,10 +1946,10 @@ bool Scene2450::CareTaker::startAction(CursorType action, Event &event) { } } -void Scene2450::Exit1::changeScene() { - Scene2450 *scene = (Scene2450 *)R2_GLOBALS._sceneManager._scene; - +void Scene2450::SouthWestExit::changeScene() { if ((R2_GLOBALS._player._characterIndex == R2_SEEKER) || (R2_GLOBALS.getFlag(61))) { + Scene2450 *scene = (Scene2450 *)R2_GLOBALS._sceneManager._scene; + _enabled = false; R2_GLOBALS._events.setCursor(CURSOR_ARROW); R2_GLOBALS._player.disableControl(); @@ -1972,7 +1959,7 @@ void Scene2450::Exit1::changeScene() { R2_GLOBALS._player.addMover(mover, &pt, scene); } else { _moving = false; - SceneItem::display(2450, 3, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(2450, 3, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); Common::Point pt(60, 140); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, NULL); @@ -1993,8 +1980,8 @@ void Scene2450::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_caretakerSpeaker); if (R2_GLOBALS.getFlag(72)) { - _exit1.setDetails(Rect(0, 143, 47, 168), EXITCURSOR_SW, 2000); - _exit1.setDest(Common::Point(10, 160)); + _southWestExit.setDetails(Rect(0, 143, 47, 168), EXITCURSOR_SW, 2000); + _southWestExit.setDest(Common::Point(10, 160)); } if (!R2_GLOBALS.getFlag(61)) { @@ -2009,7 +1996,7 @@ void Scene2450::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.disableControl(); switch (R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex]) { case 1900: - R2_GLOBALS._v565AE = 0; + R2_GLOBALS._stripModifier = 0; R2_GLOBALS._player._characterScene[R2_QUINN] = 2450; R2_GLOBALS._player._characterScene[R2_SEEKER] = 2450; R2_GLOBALS._player._oldCharacterScene[R2_QUINN] = 2450; @@ -2071,7 +2058,7 @@ void Scene2450::postInit(SceneObjectList *OwnerList) { _careTaker.setPosition(Common::Point(34, 153)); _careTaker.setDetails(2001, 40, -1, -1, 1, (SceneItem *)NULL); - _exit1._enabled = false; + _southWestExit._enabled = false; } } else { R2_GLOBALS._player.postInit(); @@ -2104,7 +2091,7 @@ void Scene2450::postInit(SceneObjectList *OwnerList) { _careTaker.setPosition(Common::Point(34, 153)); _careTaker.setDetails(2001, 40, -1, -1, 1, (SceneItem *)NULL); - _exit1._enabled = false; + _southWestExit._enabled = false; } } R2_GLOBALS._player.enableControl(); @@ -2145,14 +2132,14 @@ void Scene2450::signal() { g_globals->_sceneManager.changeScene(2000); break; case 20: - if (R2_GLOBALS._v565AE == 3) { + if (R2_GLOBALS._stripModifier == 3) { R2_GLOBALS._player.disableControl(); - R2_GLOBALS._v565AE = 4; + R2_GLOBALS._stripModifier = 4; _sceneMode = 2454; setAction(&_sequenceManager, this, 2454, &_careTaker, NULL); } else { R2_GLOBALS._player.enableControl(CURSOR_TALK); - if (R2_GLOBALS._v565AE < 4) + if (R2_GLOBALS._stripModifier < 4) R2_GLOBALS._player._canWalk = false; } break; @@ -2183,7 +2170,7 @@ void Scene2450::signal() { _stripManager.start(700, this); break; case 2454: - _exit1._enabled = true; + _southWestExit._enabled = true; R2_GLOBALS.setFlag(72); _careTaker.remove(); if (R2_GLOBALS.getFlag(61)) { @@ -2221,10 +2208,10 @@ void Scene2450::signal() { *--------------------------------------------------------------------------*/ bool Scene2455::Lamp::startAction(CursorType action, Event &event) { - Scene2455 *scene = (Scene2455 *)R2_GLOBALS._sceneManager._scene; - if (action == R2_GLASS_DOME) { if ((R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_2) == 2455) || (R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_3) == 2455)) { + Scene2455 *scene = (Scene2455 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2458; scene->_pool._lookLineNum = 9; @@ -2275,9 +2262,9 @@ bool Scene2455::Pool::startAction(CursorType action, Event &event) { } bool Scene2455::ScrithKey::startAction(CursorType action, Event &event) { - Scene2455 *scene = (Scene2455 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_USE) { + Scene2455 *scene = (Scene2455 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2459; scene->setAction(&scene->_sequenceManager, scene, 2459, &R2_GLOBALS._player, &scene->_scrithKey, NULL); @@ -2287,7 +2274,7 @@ bool Scene2455::ScrithKey::startAction(CursorType action, Event &event) { return SceneActor::startAction(action, event); } -void Scene2455::Exit1::changeScene() { +void Scene2455::NorthExit::changeScene() { Scene2455 *scene = (Scene2455 *)R2_GLOBALS._sceneManager._scene; _enabled = false; @@ -2307,14 +2294,14 @@ void Scene2455::postInit(SceneObjectList *OwnerList) { } R2_GLOBALS._sound1.play(200); - _exit1.setDetails(Rect(0, 0, 320, 15), EXITCURSOR_N, 2425); + _northExit.setDetails(Rect(0, 0, 320, 15), EXITCURSOR_N, 2425); if (R2_INVENTORY.getObjectScene(R2_GLASS_DOME) == 2455) { _scrithKey.postInit(); _scrithKey.setup(2456, 3, 1); _scrithKey.setPosition(Common::Point(176, 165)); _scrithKey.setDetails(2455, 16, 1, -1, 1, (SceneItem *)NULL); - } else if ((R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_3) == 2455) || + } else if ((R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_3) == 2455) || (R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_2) == 2455)) { _lamp.postInit(); _lamp.setup(2456, 3, 3); @@ -2395,11 +2382,11 @@ void Scene2455::signal() { } /*-------------------------------------------------------------------------- - * Scene 2500 - Spill Mountains: Large Cave + * Scene 2500 - Spill Mountains: Large Ledge * *--------------------------------------------------------------------------*/ -void Scene2500::Exit1::changeScene() { +void Scene2500::WestExit::changeScene() { Scene2500 *scene = (Scene2500 *)R2_GLOBALS._sceneManager._scene; _enabled = false; @@ -2427,8 +2414,8 @@ void Scene2500::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._sceneManager._previousScene == -1) R2_GLOBALS._sceneManager._previousScene = 2000; - _exit1.setDetails(Rect(30, 50, 85, 105), EXITCURSOR_W, 2000); - _exit1.setDest(Common::Point(84, 104)); + _westExit.setDetails(Rect(30, 50, 85, 105), EXITCURSOR_W, 2000); + _westExit.setDest(Common::Point(84, 104)); R2_GLOBALS._player.postInit(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); @@ -2441,19 +2428,19 @@ void Scene2500::postInit(SceneObjectList *OwnerList) { } if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { - _actor1.postInit(); + _companion.postInit(); if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - _actor1.setup(21, 3, 1); - _actor1.setDetails(9002, 1, -1, -1, 1, (SceneItem *)NULL); + _companion.setup(21, 3, 1); + _companion.setDetails(9002, 1, -1, -1, 1, (SceneItem *)NULL); } else { - _actor1.setup(2008, 3, 1); - _actor1.changeZoom(50); - _actor1.setDetails(9001, 0, -1, -1, 1, (SceneItem *)NULL); + _companion.setup(2008, 3, 1); + _companion.changeZoom(50); + _companion.setDetails(9001, 0, -1, -1, 1, (SceneItem *)NULL); } - _actor1.setPosition(Common::Point(141, 94)); + _companion.setPosition(Common::Point(141, 94)); } - _item1.setDetails(Rect(0, 0, 320, 200), 2430, 0, -1, -1, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 2430, 0, -1, -1, 1, NULL); R2_GLOBALS._player.disableControl(); if (R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] == 2000) { @@ -2464,9 +2451,9 @@ void Scene2500::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.addMover(mover, &pt, this); } else if (R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] == 3100) { _sceneMode = 2500; - _actor2.postInit(); - _actor3.postInit(); - setAction(&_sequenceManager, this, 2500, &R2_GLOBALS._player, &_actor2, &_actor3, NULL); + _quinn.postInit(); + _ship.postInit(); + setAction(&_sequenceManager, this, 2500, &R2_GLOBALS._player, &_quinn, &_ship, NULL); } else { R2_GLOBALS._player.setPosition(Common::Point(160, 150)); R2_GLOBALS._player.setStrip(3); @@ -2483,7 +2470,7 @@ void Scene2500::signal() { case 20: R2_GLOBALS._player.disableControl(); _sceneMode = 2501; - setAction(&_sequenceManager, this, 2501, &R2_GLOBALS._player, &_actor2, &_actor3, NULL); + setAction(&_sequenceManager, this, 2501, &R2_GLOBALS._player, &_quinn, &_ship, NULL); break; case 2500: _sceneMode = 20; @@ -2504,10 +2491,10 @@ void Scene2500::signal() { * *--------------------------------------------------------------------------*/ -bool Scene2525::Item5::startAction(CursorType action, Event &event) { - Scene2525 *scene = (Scene2525 *)R2_GLOBALS._sceneManager._scene; - +bool Scene2525::StopCock::startAction(CursorType action, Event &event) { if ((action == R2_REBREATHER_TANK) && (!R2_GLOBALS.getFlag(74))) { + Scene2525 *scene = (Scene2525 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2526; scene->setAction(&scene->_sequenceManager, scene, 2526, &R2_GLOBALS._player, NULL); @@ -2518,22 +2505,22 @@ bool Scene2525::Item5::startAction(CursorType action, Event &event) { } bool Scene2525::GlassDome::startAction(CursorType action, Event &event) { - Scene2525 *scene = (Scene2525 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { + Scene2525 *scene = (Scene2525 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2525; scene->setAction(&scene->_sequenceManager, scene, 2525, &R2_GLOBALS._player, &scene->_glassDome, NULL); } else { - SceneItem::display(2530, 33, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(2530, 33, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); } return true; } -void Scene2525::Exit1::changeScene() { +void Scene2525::SouthExit::changeScene() { Scene2525 *scene = (Scene2525 *)R2_GLOBALS._sceneManager._scene; _enabled = false; @@ -2552,7 +2539,7 @@ void Scene2525::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._sound1.play(200); R2_GLOBALS._sound2.play(207); - _exit1.setDetails(Rect(86, 155, 228, 168), EXITCURSOR_S, 2000); + _southExit.setDetails(Rect(86, 155, 228, 168), EXITCURSOR_S, 2000); if (R2_INVENTORY.getObjectScene(R2_GLASS_DOME) == 2525) { _glassDome.postInit(); @@ -2562,12 +2549,12 @@ void Scene2525::postInit(SceneObjectList *OwnerList) { _glassDome.setDetails(2525, 27, -1, -1, 1, (SceneItem *)NULL); } - _actor2.postInit(); - _actor2.setup(2525, 1, 1); - _actor2.setPosition(Common::Point(183, 114)); - _actor2.setDetails(2525, 15, -1, -1, 1, (SceneItem *)NULL); - _actor2.animate(ANIM_MODE_2, NULL); - _actor2._numFrames = 3; + _compressor.postInit(); + _compressor.setup(2525, 1, 1); + _compressor.setPosition(Common::Point(183, 114)); + _compressor.setDetails(2525, 15, -1, -1, 1, (SceneItem *)NULL); + _compressor.animate(ANIM_MODE_2, NULL); + _compressor._numFrames = 3; R2_GLOBALS._player.postInit(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); @@ -2580,24 +2567,24 @@ void Scene2525::postInit(SceneObjectList *OwnerList) { } if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { - _actor1.postInit(); + _companion.postInit(); if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - _actor1.setup(20, 5, 1); - _actor1.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); + _companion.setup(20, 5, 1); + _companion.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); } else { - _actor1.setup(2008, 5, 1); - _actor1.setDetails(9001, 0, 5, 3, 1, (SceneItem *)NULL); + _companion.setup(2008, 5, 1); + _companion.setDetails(9001, 0, 5, 3, 1, (SceneItem *)NULL); } - _actor1.setPosition(Common::Point(209, 162)); + _companion.setPosition(Common::Point(209, 162)); R2_GLOBALS._walkRegions.disableRegion(4); } - _item5.setDetails(Rect(125, 73, 140, 86), 2525, 6, -1, -1, 1, NULL); - _item3.setDetails(Rect(137, 11, 163, 72), 2525, 12, -1, -1, 1, NULL); - _item4.setDetails(Rect(204, 20, 234, 78), 2525, 12, -1, -1, 1, NULL); - _item2.setDetails(Rect(102, 62, 230, 134), 2525, 0, -1, -1, 1, NULL); - _item1.setDetails(Rect(0, 0, 320, 200), 2525, 24, -1, -1, 1, NULL); + _stopcock.setDetails(Rect(125, 73, 140, 86), 2525, 6, -1, -1, 1, NULL); + _pipes1.setDetails(Rect(137, 11, 163, 72), 2525, 12, -1, -1, 1, NULL); + _pipes2.setDetails(Rect(204, 20, 234, 78), 2525, 12, -1, -1, 1, NULL); + _machine.setDetails(Rect(102, 62, 230, 134), 2525, 0, -1, -1, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 2525, 24, -1, -1, 1, NULL); R2_GLOBALS._player.disableControl(); @@ -2646,31 +2633,31 @@ void Scene2525::signal() { *--------------------------------------------------------------------------*/ bool Scene2530::Flask::startAction(CursorType action, Event &event) { - Scene2530 *scene = (Scene2530 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { + Scene2530 *scene = (Scene2530 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2530; scene->setAction(&scene->_sequenceManager, scene, 2530, &R2_GLOBALS._player, &scene->_flask, NULL); } else { - SceneItem::display(2530, 33, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(2530, 33, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); } return true; } bool Scene2530::Crank::startAction(CursorType action, Event &event) { - Scene2530 *scene = (Scene2530 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); + Scene2530 *scene = (Scene2530 *)R2_GLOBALS._sceneManager._scene; + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { if (R2_GLOBALS.getFlag(73)) - SceneItem::display(2530, 35, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(2530, 35, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); else { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2532; @@ -2691,7 +2678,7 @@ bool Scene2530::Crank::startAction(CursorType action, Event &event) { return true; } -void Scene2530::Exit1::changeScene() { +void Scene2530::SouthExit::changeScene() { Scene2530 *scene = (Scene2530 *)R2_GLOBALS._sceneManager._scene; _enabled = false; @@ -2708,8 +2695,8 @@ void Scene2530::postInit(SceneObjectList *OwnerList) { loadScene(2530); SceneExt::postInit(); - _exit1.setDetails(Rect(68, 155, 147, 168), EXITCURSOR_S, 2000); - _exit1.setDest(Common::Point(108, 160)); + _southExit.setDetails(Rect(68, 155, 147, 168), EXITCURSOR_S, 2000); + _southExit.setDest(Common::Point(108, 160)); if (R2_INVENTORY.getObjectScene(R2_PURE_GRAIN_ALCOHOL) == 2530) { _flask.postInit(); @@ -2742,20 +2729,20 @@ void Scene2530::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.setPosition(Common::Point(100, 200)); if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { - _actor1.postInit(); + _companion.postInit(); if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - _actor1.setup(20, 5, 1); - _actor1.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); + _companion.setup(20, 5, 1); + _companion.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); } else { - _actor1.setup(2008, 5, 1); - _actor1.setDetails(9001, 0, 5, 3, 1, (SceneItem *)NULL); + _companion.setup(2008, 5, 1); + _companion.setDetails(9001, 0, 5, 3, 1, (SceneItem *)NULL); } - _actor1.setPosition(Common::Point(20, 130)); + _companion.setPosition(Common::Point(20, 130)); R2_GLOBALS._walkRegions.disableRegion(1); } - _item2.setDetails(Rect(108, 90, 135, 205), 2530, 22, -1, -1, 1, NULL); - _item5.setDetails(Rect(115, 112, 206, 130), 2530, 25, -1, 27, 1, NULL); + _crank2.setDetails(Rect(108, 90, 135, 205), 2530, 22, -1, -1, 1, NULL); + _rope.setDetails(Rect(115, 112, 206, 130), 2530, 25, -1, 27, 1, NULL); _shelf.setDetails(Rect(256, 64, 311, 85), 2530, 31, -1, 33, 1, NULL); _background.setDetails(Rect(0, 0, 320, 200), 2530, 0, 1, -1, 1, NULL); @@ -2805,42 +2792,42 @@ void Scene2530::signal() { *--------------------------------------------------------------------------*/ bool Scene2535::RebreatherTank::startAction(CursorType action, Event &event) { - Scene2535 *scene = (Scene2535 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + Scene2535 *scene = (Scene2535 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); - + scene->_sceneMode = (R2_INVENTORY.getObjectScene(R2_REBREATHER_TANK) == 2535) ? 2536 : 2537; - scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, + scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_rebreatherTank, NULL); } else { - SceneItem::display(2530, 33, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(2530, 33, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); } return true; } bool Scene2535::TannerMask::startAction(CursorType action, Event &event) { - Scene2535 *scene = (Scene2535 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { + Scene2535 *scene = (Scene2535 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2535; scene->setAction(&scene->_sequenceManager, scene, 2535, &R2_GLOBALS._player, &scene->_tannerMask, NULL); } else { - SceneItem::display(2530, 33, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(2530, 33, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); } return true; } -void Scene2535::Exit1::changeScene() { +void Scene2535::SouthExit::changeScene() { Scene2535 *scene = (Scene2535 *)R2_GLOBALS._sceneManager._scene; _enabled = false; @@ -2859,8 +2846,8 @@ void Scene2535::postInit(SceneObjectList *OwnerList) { R2_GLOBALS.setFlag(73); R2_INVENTORY.setObjectScene(R2_REBREATHER_TANK, 2535); } - _exit1.setDetails(Rect(172, 155, 250, 167), EXITCURSOR_S, 2000); - _exit1.setDest(Common::Point(210, 160)); + _southExit.setDetails(Rect(172, 155, 250, 167), EXITCURSOR_S, 2000); + _southExit.setDest(Common::Point(210, 160)); if (R2_INVENTORY.getObjectScene(R2_TANNER_MASK) == 2535) { _tannerMask.postInit(); @@ -2998,6 +2985,8 @@ void Scene2600::postInit(SceneObjectList *OwnerList) { loadScene(2600); R2_GLOBALS._uiElements._active = false; SceneExt::postInit(); + R2_GLOBALS._interfaceY = SCREEN_HEIGHT; + R2_GLOBALS._sound1.fadeSound(214); R2_GLOBALS._sound2.play(215); _rotation = R2_GLOBALS._scenePalette.addRotation(176, 191, 1); @@ -3012,6 +3001,7 @@ void Scene2600::postInit(SceneObjectList *OwnerList) { void Scene2600::remove() { R2_GLOBALS._sound1.fadeOut2(NULL); R2_GLOBALS._sound2.fadeOut2(NULL); + R2_GLOBALS._uiElements._visible = true; // _rotation->remove(); SceneExt::remove(); } @@ -3027,7 +3017,7 @@ void Scene2600::signal() { *--------------------------------------------------------------------------*/ Scene2700::Scene2700(): SceneExt() { - _field412 = _field414 = _field416 = 0; + _areaMode = _moveMode = _stripNumber = 0; _walkRect1.set(70, 122, 90, 132); _walkRect2.set(150, 122, 160, 132); @@ -3040,9 +3030,9 @@ Scene2700::Scene2700(): SceneExt() { void Scene2700::synchronize(Serializer &s) { SceneExt::synchronize(s); - s.syncAsSint16LE(_field412); - s.syncAsSint16LE(_field414); - s.syncAsSint16LE(_field416); + s.syncAsSint16LE(_areaMode); + s.syncAsSint16LE(_moveMode); + s.syncAsSint16LE(_stripNumber); } void Scene2700::Action1::signal() { @@ -3073,14 +3063,14 @@ void Scene2700::Action4::signal() { scene->_ghoulHome9.animate(ANIM_MODE_8, 1, NULL); } -void Scene2700::Area1::process(Event &event) { +void Scene2700::SouthExit::process(Event &event) { SceneArea::process(event); if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._player._canWalk) && (_bounds.contains(event.mousePos))) { Scene2700 *scene = (Scene2700 *)R2_GLOBALS._sceneManager._scene; R2_GLOBALS._player.disableControl(); scene->_sceneMode = 10; - scene->_field414 = 2703; - switch (scene->_field412) { + scene->_moveMode = 2703; + switch (scene->_areaMode) { case 0: // No break on purpose case 6: @@ -3123,14 +3113,14 @@ void Scene2700::Area1::process(Event &event) { } } -void Scene2700::Area2::process(Event &event) { +void Scene2700::EastExit::process(Event &event) { SceneArea::process(event); if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._player._canWalk) && (_bounds.contains(event.mousePos))) { Scene2700 *scene = (Scene2700 *)R2_GLOBALS._sceneManager._scene; R2_GLOBALS._player.disableControl(); scene->_sceneMode = 10; - scene->_field414 = 2704; - switch (scene->_field412) { + scene->_moveMode = 2704; + switch (scene->_areaMode) { case 0: { Common::Point pt(140, 162); NpcMover *mover = new NpcMover(); @@ -3183,8 +3173,8 @@ void Scene2700::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._sound1.stop(); R2_GLOBALS._sound2.stop(); - _area1.setDetails(Rect(135, 160, 185, 168), SHADECURSOR_DOWN); - _area2.setDetails(Rect(300, 90, 320, 135), EXITCURSOR_E); + _southExit.setDetails(Rect(135, 160, 185, 168), SHADECURSOR_DOWN); + _eastExit.setDetails(Rect(300, 90, 320, 135), EXITCURSOR_E); _ghoulHome6.postInit(); _ghoulHome6.setup(2700, 1, 1); @@ -3229,10 +3219,10 @@ void Scene2700::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._sceneManager._previousScene == 2750) { _sceneMode = 2702; - _field412 = 5; + _areaMode = 5; setAction(&_sequenceManager, this, 2702, &R2_GLOBALS._player, NULL); } else { - _field412 = 0; + _areaMode = 0; if (R2_GLOBALS._sceneManager._previousScene == 3900) { _sceneMode = 2701; setAction(&_sequenceManager, this, 2701, &R2_GLOBALS._player, NULL); @@ -3247,26 +3237,26 @@ void Scene2700::postInit(SceneObjectList *OwnerList) { void Scene2700::signal() { switch (_sceneMode) { case 10: - switch (_field414) { + switch (_moveMode) { case 1: - switch (_field412) { + switch (_areaMode) { case 0: case 2: case 4: case 6: - _field412 = 3; + _areaMode = 3; R2_GLOBALS._player.setAction(&_sequenceManager, this, 2705, &R2_GLOBALS._player, NULL); break; case 3: { - _sceneMode = _field414; - _field412 = 1; + _sceneMode = _moveMode; + _areaMode = 1; Common::Point pt(80, 127); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); break; } case 5: - _field412 = 4; + _areaMode = 4; R2_GLOBALS._player.setAction(&_sequenceManager, this, 2708, &R2_GLOBALS._player, NULL); break; default: // includes case 1 @@ -3274,24 +3264,24 @@ void Scene2700::signal() { } break; case 2: - switch (_field412) { + switch (_areaMode) { case 0: case 1: case 6: - _field412 = 3; + _areaMode = 3; R2_GLOBALS._player.setAction(&_sequenceManager, this, 2706, &R2_GLOBALS._player, NULL); break; case 3: case 4: { - _sceneMode = _field414; - _field412 = 2; + _sceneMode = _moveMode; + _areaMode = 2; Common::Point pt(155, 127); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); break; } case 5: - _field412 = 4; + _areaMode = 4; R2_GLOBALS._player.setAction(&_sequenceManager, this, 2708, &R2_GLOBALS._player, NULL); break; default: // includes case 2 @@ -3299,21 +3289,21 @@ void Scene2700::signal() { } break; case 3: - switch (_field412) { + switch (_areaMode) { case 0: case 1: case 2: case 4: case 6: { - _sceneMode = _field414; - _field412 = 3; + _sceneMode = _moveMode; + _areaMode = 3; Common::Point pt(115, 152); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); break; } case 5: - _field412 = 4; + _areaMode = 4; R2_GLOBALS._player.setAction(&_sequenceManager, this, 2708, &R2_GLOBALS._player, NULL); break; default: // includes case 3 @@ -3321,21 +3311,21 @@ void Scene2700::signal() { } break; case 4: - switch (_field412) { + switch (_areaMode) { case 0: case 1: case 6: - _field412 = 3; + _areaMode = 3; R2_GLOBALS._player.setAction(&_sequenceManager, this, 2706, &R2_GLOBALS._player, NULL); break; case 2: case 3: - _field412 = 4; + _areaMode = 4; R2_GLOBALS._player.setAction(&_sequenceManager, this, 2709, &R2_GLOBALS._player, NULL); break; case 4: case 5: - _sceneMode = _field414; + _sceneMode = _moveMode; R2_GLOBALS._player.setAction(&_sequenceManager, this, 2704, &R2_GLOBALS._player, NULL); break; default: @@ -3343,21 +3333,21 @@ void Scene2700::signal() { } break; case 5: - switch (_field412) { + switch (_areaMode) { case 0: case 1: case 6: - _field412 = 3; + _areaMode = 3; R2_GLOBALS._player.setAction(&_sequenceManager, this, 2706, &R2_GLOBALS._player, NULL); break; case 2: case 3: - _field412 = 4; + _areaMode = 4; R2_GLOBALS._player.setAction(&_sequenceManager, this, 2709, &R2_GLOBALS._player, NULL); break; case 4: { - _sceneMode = _field414; - _field412 = 5; + _sceneMode = _moveMode; + _areaMode = 5; Common::Point pt(285, 132); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); @@ -3368,11 +3358,11 @@ void Scene2700::signal() { } break; case 6: - switch (_field412) { + switch (_areaMode) { case 0: case 3: { - _sceneMode = _field414; - _field412 = 6; + _sceneMode = _moveMode; + _areaMode = 6; Common::Point pt(250, 162); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); @@ -3381,11 +3371,11 @@ void Scene2700::signal() { case 1: case 2: case 4: - _field412 = 3; + _areaMode = 3; R2_GLOBALS._player.setAction(&_sequenceManager, this, 2707, &R2_GLOBALS._player, NULL); break; case 5: - _field412 = 4; + _areaMode = 4; R2_GLOBALS._player.setAction(&_sequenceManager, this, 2708, &R2_GLOBALS._player, NULL); break; default: @@ -3393,21 +3383,21 @@ void Scene2700::signal() { } break; case 2703: - switch (_field412) { + switch (_areaMode) { case 0: case 3: case 6: - _sceneMode = _field414; + _sceneMode = _moveMode; setAction(&_sequenceManager, this, 2703, &R2_GLOBALS._player, NULL); break; case 1: case 2: case 4: - _field412 = 3; + _areaMode = 3; R2_GLOBALS._player.setAction(&_sequenceManager, this, 2707, &R2_GLOBALS._player, NULL); break; case 5: - _field412 = 4; + _areaMode = 4; R2_GLOBALS._player.setAction(&_sequenceManager, this, 2708, &R2_GLOBALS._player, NULL); break; default: @@ -3415,21 +3405,21 @@ void Scene2700::signal() { } break; case 2704: - switch (_field412) { + switch (_areaMode) { case 0: case 1: case 6: - _field412 = 3; + _areaMode = 3; R2_GLOBALS._player.setAction(&_sequenceManager, this, 2706, &R2_GLOBALS._player, NULL); break; case 2: case 3: - _field412 = 4; + _areaMode = 4; R2_GLOBALS._player.setAction(&_sequenceManager, this, 2709, &R2_GLOBALS._player, NULL); break; case 4: case 5: - _sceneMode = _field414; + _sceneMode = _moveMode; R2_GLOBALS._player.setAction(&_sequenceManager, this, 2704, &R2_GLOBALS._player, NULL); break; default: @@ -3437,23 +3427,23 @@ void Scene2700::signal() { } break; case 2710: - switch (_field412) { + switch (_areaMode) { case 0: case 1: case 3: - _field412 = 3; + _areaMode = 3; R2_GLOBALS._player.setAction(&_sequenceManager, this, 2707, &R2_GLOBALS._player, NULL); break; case 2: case 5: { - _sceneMode = _field414; + _sceneMode = _moveMode; Common::Point pt(164, 160); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); break; } case 4: - _field412 = 4; + _areaMode = 4; R2_GLOBALS._player.setAction(&_sequenceManager, this, 2708, &R2_GLOBALS._player, NULL); break; default: @@ -3467,7 +3457,7 @@ void Scene2700::signal() { case 11: R2_INVENTORY.setObjectScene(R2_FLUTE, 0); R2_GLOBALS._player.disableControl(); - _field412 = 0; + _areaMode = 0; _sceneMode = 2700; setAction(&_sequenceManager, this, 2700, &_nej, NULL); break; @@ -3475,22 +3465,22 @@ void Scene2700::signal() { R2_GLOBALS._sound1.play(234); R2_GLOBALS._events.setCursor(CURSOR_WALK); _sceneMode = 2711; - _stripManager.start(_field416, this); + _stripManager.start(_stripNumber, this); break; case 13: R2_GLOBALS._events.setCursor(CURSOR_WALK); _sceneMode = 2712; - _stripManager.start(_field416, this); + _stripManager.start(_stripNumber, this); break; case 14: R2_GLOBALS._events.setCursor(CURSOR_WALK); _sceneMode = 2713; - _stripManager.start(_field416, this); + _stripManager.start(_stripNumber, this); break; case 15: R2_GLOBALS._events.setCursor(CURSOR_WALK); _sceneMode = 11; - _stripManager.start(_field416, this); + _stripManager.start(_stripNumber, this); break; case 2700: _nej.remove(); @@ -3504,26 +3494,26 @@ void Scene2700::signal() { break; case 2710: // Start of Nej assault - _field416 = 1200; + _stripNumber = 1200; _sceneMode = 12; _nej.postInit(); setAction(&_sequenceManager, this, 2710, &R2_GLOBALS._player, &_nej, NULL); break; case 2711: R2_GLOBALS._player.disableControl(); - _field416 = 1201; + _stripNumber = 1201; _sceneMode = 13; setAction(&_sequenceManager, this, 2711, &R2_GLOBALS._player, &_nej, NULL); break; case 2712: R2_GLOBALS._player.disableControl(); - _field416 = 1202; + _stripNumber = 1202; _sceneMode = 14; setAction(&_sequenceManager, this, 2712, &R2_GLOBALS._player, &_nej, NULL); break; case 2713: R2_GLOBALS._player.disableControl(); - _field416 = 1203; + _stripNumber = 1203; _sceneMode = 15; setAction(&_sequenceManager, this, 2713, &R2_GLOBALS._player, &_nej, NULL); break; @@ -3537,11 +3527,11 @@ void Scene2700::process(Event &event) { if (R2_GLOBALS._events.getCursor() == R2_FLUTE) { if (R2_GLOBALS._player._bounds.contains(event.mousePos)) { _sceneMode = 10; - _field414 = 2710; + _moveMode = 2710; R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_WALK); - switch (_field412) { + switch (_areaMode) { case 0: { _sceneMode = 2710; Common::Point pt(164, 160); @@ -3589,7 +3579,7 @@ void Scene2700::process(Event &event) { break; } } else { - SceneItem::display(2700, 3, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(2700, 3, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); } event.handled = true; @@ -3598,37 +3588,37 @@ void Scene2700::process(Event &event) { if (!_walkRect1.contains(R2_GLOBALS._player._position)) { event.handled = true; _sceneMode = 10; - _field414 = 1; + _moveMode = 1; } } else if (_walkRect2.contains(event.mousePos)) { if (!_walkRect2.contains(R2_GLOBALS._player._position)) { event.handled = true; _sceneMode = 10; - _field414 = 2; + _moveMode = 2; } } else if (_walkRect3.contains(event.mousePos)) { if (!_walkRect3.contains(R2_GLOBALS._player._position)) { event.handled = true; _sceneMode = 10; - _field414 = 3; + _moveMode = 3; } } else if (_walkRect4.contains(event.mousePos)) { if (!_walkRect4.contains(R2_GLOBALS._player._position)) { event.handled = true; _sceneMode = 10; - _field414 = 4; + _moveMode = 4; } } else if (_walkRect5.contains(event.mousePos)) { if (!_walkRect5.contains(R2_GLOBALS._player._position)) { event.handled = true; _sceneMode = 10; - _field414 = 5; + _moveMode = 5; } } else if (_walkRect6.contains(event.mousePos)) { if (!_walkRect6.contains(R2_GLOBALS._player._position)) { event.handled = true; _sceneMode = 10; - _field414 = 6; + _moveMode = 6; } } else { event.handled = true; @@ -3636,9 +3626,9 @@ void Scene2700::process(Event &event) { } if (_sceneMode == 10) { R2_GLOBALS._player.disableControl(); - switch (_field412) { + switch (_areaMode) { case 0: - if (_field414 >= 6) { + if (_moveMode >= 6) { Common::Point pt(205, 162); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); @@ -3661,11 +3651,11 @@ void Scene2700::process(Event &event) { break; } case 3: - if (_field414 == 1) { + if (_moveMode == 1) { Common::Point pt(80, 137); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); - } else if (_field414 == 6) { + } else if (_moveMode == 6) { Common::Point pt(140, 162); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); @@ -3676,7 +3666,7 @@ void Scene2700::process(Event &event) { } break; case 4: - if (_field414 == 5) { + if (_moveMode == 5) { Common::Point pt(235, 132); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); @@ -3713,15 +3703,15 @@ void Scene2700::process(Event &event) { *--------------------------------------------------------------------------*/ Scene2750::Scene2750(): SceneExt() { - _field412 = _field414 = _field416 = 0; + _areaMode = _moveMode = _stripNumber = 0; } void Scene2750::synchronize(Serializer &s) { SceneExt::synchronize(s); - s.syncAsSint16LE(_field412); - s.syncAsSint16LE(_field414); - s.syncAsSint16LE(_field416); + s.syncAsSint16LE(_areaMode); + s.syncAsSint16LE(_moveMode); + s.syncAsSint16LE(_stripNumber); } void Scene2750::Action1::signal() { @@ -3731,20 +3721,20 @@ void Scene2750::Action1::signal() { case 1: setDelay(60 + R2_GLOBALS._randomSource.getRandomNumber(240)); _actionIndex = 2; - scene->_actor5.show(); - scene->_actor5.animate(ANIM_MODE_8, 1, NULL); + scene->_bird2.show(); + scene->_bird2.animate(ANIM_MODE_8, 1, NULL); break; case 2: setDelay(600 + R2_GLOBALS._randomSource.getRandomNumber(600)); _actionIndex = 0; - scene->_actor5.show(); - scene->_actor3.animate(ANIM_MODE_2, NULL); + scene->_bird2.show(); + scene->_bird1.animate(ANIM_MODE_2, NULL); break; default: setDelay(30); _actionIndex = 1; - scene->_actor3.animate(ANIM_MODE_6, NULL); - scene->_actor4.animate(ANIM_MODE_8, 1, NULL); + scene->_bird1.animate(ANIM_MODE_6, NULL); + scene->_folliage1.animate(ANIM_MODE_8, 1, NULL); break; } } @@ -3753,20 +3743,20 @@ void Scene2750::Action2::signal() { Scene2750 *scene = (Scene2750 *)R2_GLOBALS._sceneManager._scene; setDelay(600 + R2_GLOBALS._randomSource.getRandomNumber(300)); - scene->_actor6.animate(ANIM_MODE_8, 1, NULL); + scene->_folliage2.animate(ANIM_MODE_8, 1, NULL); } void Scene2750::Action3::signal() { Scene2750 *scene = (Scene2750 *)R2_GLOBALS._sceneManager._scene; - if (scene->_actor7._position.x <= 320) { + if (scene->_folliage3._position.x <= 320) { setDelay(1800 + R2_GLOBALS._randomSource.getRandomNumber(600)); } else { setDelay(60); - scene->_actor7.setPosition(Common::Point(-10, 25)); + scene->_folliage3.setPosition(Common::Point(-10, 25)); Common::Point pt(330, 45); NpcMover *mover = new NpcMover(); - scene->_actor7.addMover(mover, &pt, NULL); + scene->_folliage3.addMover(mover, &pt, NULL); } } @@ -3774,38 +3764,38 @@ void Scene2750::Action4::signal() { Scene2750 *scene = (Scene2750 *)R2_GLOBALS._sceneManager._scene; setDelay(600 + R2_GLOBALS._randomSource.getRandomNumber(300)); - scene->_actor8.animate(ANIM_MODE_8, 1, NULL); + scene->_folliage4.animate(ANIM_MODE_8, 1, NULL); } void Scene2750::Action5::signal() { Scene2750 *scene = (Scene2750 *)R2_GLOBALS._sceneManager._scene; setDelay(600 + R2_GLOBALS._randomSource.getRandomNumber(300)); - scene->_actor9.animate(ANIM_MODE_8, 1, NULL); + scene->_folliage5.animate(ANIM_MODE_8, 1, NULL); } void Scene2750::Action6::signal() { Scene2750 *scene = (Scene2750 *)R2_GLOBALS._sceneManager._scene; setDelay(600 + R2_GLOBALS._randomSource.getRandomNumber(300)); - scene->_actor10.animate(ANIM_MODE_8, 1, NULL); + scene->_folliage6.animate(ANIM_MODE_8, 1, NULL); } void Scene2750::Action7::signal() { Scene2750 *scene = (Scene2750 *)R2_GLOBALS._sceneManager._scene; setDelay(600 + R2_GLOBALS._randomSource.getRandomNumber(300)); - scene->_actor11.animate(ANIM_MODE_8, 1, NULL); + scene->_folliage7.animate(ANIM_MODE_8, 1, NULL); } -void Scene2750::Area1::process(Event &event) { +void Scene2750::WestExit::process(Event &event) { SceneArea::process(event); if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._player._canWalk) && (_bounds.contains(event.mousePos))) { Scene2750 *scene = (Scene2750 *)R2_GLOBALS._sceneManager._scene; R2_GLOBALS._player.disableControl(); scene->_sceneMode = 10; - scene->_field414 = 2752; - switch (scene->_field412) { + scene->_moveMode = 2752; + switch (scene->_areaMode) { case 1: { scene->_sceneMode = 2752; scene->setAction(&scene->_sequenceManager, scene, 2752, &R2_GLOBALS._player, NULL); @@ -3829,14 +3819,14 @@ void Scene2750::Area1::process(Event &event) { } } -void Scene2750::Area2::process(Event &event) { +void Scene2750::EastExit::process(Event &event) { SceneArea::process(event); if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._player._canWalk) && (_bounds.contains(event.mousePos))) { Scene2750 *scene = (Scene2750 *)R2_GLOBALS._sceneManager._scene; R2_GLOBALS._player.disableControl(); scene->_sceneMode = 10; - scene->_field414 = 2753; - switch (scene->_field412) { + scene->_moveMode = 2753; + switch (scene->_areaMode) { case 1: { Common::Point pt(140, 142); NpcMover *mover = new NpcMover(); @@ -3864,76 +3854,76 @@ void Scene2750::postInit(SceneObjectList *OwnerList) { loadScene(2750); R2_GLOBALS._sound2.stop(); SceneExt::postInit(); - _area1.setDetails(Rect(0, 90, 20, 135), EXITCURSOR_W); - _area2.setDetails(Rect(300, 90, 320, 135), EXITCURSOR_E); + _westExit.setDetails(Rect(0, 90, 20, 135), EXITCURSOR_W); + _eastExit.setDetails(Rect(300, 90, 320, 135), EXITCURSOR_E); - _rect1.set(30, 127, 155, 147); - _rect2.set(130, 142, 210, 167); - _rect3.set(-1, 137, 290, 147); + _walkRect1.set(30, 127, 155, 147); + _walkRect2.set(130, 142, 210, 167); + _walkRect3.set(-1, 137, 290, 147); if (R2_INVENTORY.getObjectScene(R2_FLUTE) == 0) { R2_GLOBALS._sound1.changeSound(235); - _actor2.postInit(); - _actor2.setup(2751, 1, 1); - _actor2.setPosition(Common::Point(104, 158)); - _actor2.animate(ANIM_MODE_2, NULL); - } - - _actor3.postInit(); - _actor3.setup(2750, 1, 1); - _actor3.setPosition(Common::Point(188, 34)); - _actor3.animate(ANIM_MODE_2, NULL); - _actor3._numFrames = 16; - - _actor4.postInit(); - _actor4.setup(2700, 4, 1); - _actor4.setPosition(Common::Point(188, 37)); - _actor4.fixPriority(26); - - _actor5.postInit(); - _actor5.setup(2750, 2, 1); - _actor5.setPosition(Common::Point(188, 34)); - _actor5.hide(); - - _actor3.setAction(&_action1); - - _actor6.postInit(); - _actor6.setup(2750, 3, 1); - _actor6.setPosition(Common::Point(9, 167)); - _actor6.fixPriority(252); - _actor6.setAction(&_action2); - - _actor7.postInit(); - _actor7.setup(2750, 4, 1); - _actor7.setPosition(Common::Point(-10, 25)); - _actor7.animate(ANIM_MODE_1, NULL); - _actor7.setStrip2(4); - _actor7._moveRate = 20; - _actor7.setAction(&_action3); - - _actor8.postInit(); - _actor8.fixPriority(26); - _actor8.setup(2750, 5, 1); - _actor8.setPosition(Common::Point(258, 33)); - _actor8.setAction(&_action4); - - _actor9.postInit(); - _actor9.fixPriority(26); - _actor9.setup(2750, 6, 1); - _actor9.setPosition(Common::Point(61, 38)); - _actor9.setAction(&_action5); - - _actor10.postInit(); - _actor10.fixPriority(26); - _actor10.setup(2750, 7, 1); - _actor10.setPosition(Common::Point(69, 37)); - _actor10.setAction(&_action6); - - _actor11.postInit(); - _actor11.fixPriority(26); - _actor11.setup(2750, 8, 1); - _actor11.setPosition(Common::Point(80, 35)); - _actor11.setAction(&_action7); + _fire.postInit(); + _fire.setup(2751, 1, 1); + _fire.setPosition(Common::Point(104, 158)); + _fire.animate(ANIM_MODE_2, NULL); + } + + _bird1.postInit(); + _bird1.setup(2750, 1, 1); + _bird1.setPosition(Common::Point(188, 34)); + _bird1.animate(ANIM_MODE_2, NULL); + _bird1._numFrames = 16; + + _folliage1.postInit(); + _folliage1.setup(2700, 4, 1); + _folliage1.setPosition(Common::Point(188, 37)); + _folliage1.fixPriority(26); + + _bird2.postInit(); + _bird2.setup(2750, 2, 1); + _bird2.setPosition(Common::Point(188, 34)); + _bird2.hide(); + + _bird1.setAction(&_action1); + + _folliage2.postInit(); + _folliage2.setup(2750, 3, 1); + _folliage2.setPosition(Common::Point(9, 167)); + _folliage2.fixPriority(252); + _folliage2.setAction(&_action2); + + _folliage3.postInit(); + _folliage3.setup(2750, 4, 1); + _folliage3.setPosition(Common::Point(-10, 25)); + _folliage3.animate(ANIM_MODE_1, NULL); + _folliage3.setStrip2(4); + _folliage3._moveRate = 20; + _folliage3.setAction(&_action3); + + _folliage4.postInit(); + _folliage4.fixPriority(26); + _folliage4.setup(2750, 5, 1); + _folliage4.setPosition(Common::Point(258, 33)); + _folliage4.setAction(&_action4); + + _folliage5.postInit(); + _folliage5.fixPriority(26); + _folliage5.setup(2750, 6, 1); + _folliage5.setPosition(Common::Point(61, 38)); + _folliage5.setAction(&_action5); + + _folliage6.postInit(); + _folliage6.fixPriority(26); + _folliage6.setup(2750, 7, 1); + _folliage6.setPosition(Common::Point(69, 37)); + _folliage6.setAction(&_action6); + + _folliage7.postInit(); + _folliage7.fixPriority(26); + _folliage7.setup(2750, 8, 1); + _folliage7.setPosition(Common::Point(80, 35)); + _folliage7.setAction(&_action7); _ghoulHome1.setDetails(Rect(29, 50, 35, 56), 2750, 3, -1, 5, 1, NULL); _ghoulHome2.setDetails(Rect(47, 36, 54, 42), 2750, 3, -1, 5, 1, NULL); @@ -3965,42 +3955,44 @@ void Scene2750::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.setStrip(6); R2_GLOBALS._player.animate(ANIM_MODE_NONE, NULL); R2_GLOBALS._player.setPosition(Common::Point(81, 165)); - R2_GLOBALS._events.setCursor(CURSOR_WALK); - _field416 = 1204; + + R2_GLOBALS._events.setCursor(CURSOR_ARROW); + _stripNumber = 1204; _sceneMode = 11; - _stripManager.start(_field416, this); + _stripManager.start(_stripNumber, this); } else { _sceneMode = 2750; - _field412 = 1; + _areaMode = 1; R2_GLOBALS._player.setAction(&_sequenceManager, this, 2750, &R2_GLOBALS._player, NULL); } } else if (R2_GLOBALS._sceneManager._previousScene == 2800) { _sceneMode = 2751; - _field412 = 3; + _areaMode = 3; R2_GLOBALS._player.setAction(&_sequenceManager, this, 2751, &R2_GLOBALS._player, NULL); } else { - _field412 = 1; + _areaMode = 1; R2_GLOBALS._player.setPosition(Common::Point(90, 137)); R2_GLOBALS._player.setStrip(3); R2_GLOBALS._player.enableControl(); } } + void Scene2750::signal() { switch (_sceneMode) { case 10: - switch (_field414) { + switch (_moveMode) { case 1: - switch (_field412) { + switch (_areaMode) { case 2: { - _sceneMode = _field414; - _field412 = 1; + _sceneMode = _moveMode; + _areaMode = 1; Common::Point pt(90, 137); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); } break; case 3: { - _field412 = 2; + _areaMode = 2; Common::Point pt(140, 142); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); @@ -4011,25 +4003,25 @@ void Scene2750::signal() { } break; case 2: { - _sceneMode = _field414; - _field412 = 2; + _sceneMode = _moveMode; + _areaMode = 2; Common::Point pt(170, 162); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); } break; case 3: - switch (_field412) { + switch (_areaMode) { case 1: { - _field412 = 2; + _areaMode = 2; Common::Point pt(210, 142); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); } break; case 2: { - _sceneMode = _field414; - _field412 = 3; + _sceneMode = _moveMode; + _areaMode = 3; Common::Point pt(270, 142); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); @@ -4040,20 +4032,20 @@ void Scene2750::signal() { } break; case 2752: - switch (_field412) { + switch (_areaMode) { case 1: - _sceneMode = _field414; + _sceneMode = _moveMode; setAction(&_sequenceManager, this, 2752, &R2_GLOBALS._player, NULL); break; case 2: { - _field412 = 1; + _areaMode = 1; Common::Point pt(20, 132); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); } break; case 3: { - _field412 = 2; + _areaMode = 2; Common::Point pt(140, 142); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); @@ -4064,23 +4056,23 @@ void Scene2750::signal() { } break; case 2753: - switch (_field412) { + switch (_areaMode) { case 1: { - _field412 = 2; + _areaMode = 2; Common::Point pt(210, 142); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); } break; case 2: { - _field412 = 3; + _areaMode = 3; Common::Point pt(300, 132); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); } break; case 3: - _sceneMode = _field414; + _sceneMode = _moveMode; setAction(&_sequenceManager, this, 2753, &R2_GLOBALS._player, NULL); break; default: @@ -4106,24 +4098,25 @@ void Scene2750::signal() { } void Scene2750::process(Event &event) { - if ((R2_GLOBALS._player._canWalk) && (event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == R2_NEGATOR_GUN)) { - if (_rect1.contains(event.mousePos)) { - if (!_rect1.contains(R2_GLOBALS._player._position)) { + if ((R2_GLOBALS._player._canWalk) && (event.eventType == EVENT_BUTTON_DOWN) + && (R2_GLOBALS._events.getCursor() == R2_NEGATOR_GUN)) { + if (_walkRect1.contains(event.mousePos)) { + if (!_walkRect1.contains(R2_GLOBALS._player._position)) { event.handled = true; _sceneMode = 10; - _field414 = 1; + _moveMode = 1; } - } else if (_rect2.contains(event.mousePos)) { - if (!_rect2.contains(R2_GLOBALS._player._position)) { + } else if (_walkRect2.contains(event.mousePos)) { + if (!_walkRect2.contains(R2_GLOBALS._player._position)) { event.handled = true; _sceneMode = 10; - _field414 = 2; + _moveMode = 2; } - } else if (_rect3.contains(event.mousePos)) { - if (!_rect3.contains(R2_GLOBALS._player._position)) { + } else if (_walkRect3.contains(event.mousePos)) { + if (!_walkRect3.contains(R2_GLOBALS._player._position)) { event.handled = true; _sceneMode = 10; - _field414 = 3; + _moveMode = 3; } } else { event.handled = true; @@ -4132,7 +4125,7 @@ void Scene2750::process(Event &event) { if (_sceneMode == 10) { R2_GLOBALS._player.disableControl(); - switch (_field412) { + switch (_areaMode) { case 1: { Common::Point pt(140, 142); NpcMover *mover = new NpcMover(); @@ -4140,7 +4133,7 @@ void Scene2750::process(Event &event) { } break; case 2: - if (_field414 == 1) { + if (_moveMode == 1) { Common::Point pt(140, 142); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); @@ -4170,19 +4163,19 @@ void Scene2750::process(Event &event) { *--------------------------------------------------------------------------*/ Scene2800::Scene2800(): SceneExt() { - _field412 = 0; + _stripNumber = 0; } void Scene2800::synchronize(Serializer &s) { SceneExt::synchronize(s); - s.syncAsSint16LE(_field412); + s.syncAsSint16LE(_stripNumber); } bool Scene2800::Outpost::startAction(CursorType action, Event &event) { - Scene2800 *scene = (Scene2800 *)R2_GLOBALS._sceneManager._scene; - if ((action == CURSOR_USE) && (R2_GLOBALS.getFlag(47))) { + Scene2800 *scene = (Scene2800 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2805; scene->setAction(&scene->_sequenceManager, scene, 2805, &R2_GLOBALS._player, NULL); @@ -4198,16 +4191,16 @@ bool Scene2800::Guard::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_WALK); R2_GLOBALS.setFlag(47); - scene->_field412 = 1205; + scene->_stripNumber = 1205; scene->_sceneMode = 2803; - scene->_stripManager.start(scene->_field412, scene); + scene->_stripManager.start(scene->_stripNumber, scene); return true; } else if (action == R2_SONIC_STUNNER) { R2_GLOBALS._events.setCursor(CURSOR_ARROW); R2_GLOBALS._player.disableControl(); R2_GLOBALS.setFlag(47); scene->_sceneMode = 10; - scene->setAction(&scene->_sequenceManager, scene, 2802, &R2_GLOBALS._player, &scene->_actor2, &scene->_guard, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2802, &R2_GLOBALS._player, &scene->_nej, &scene->_guard, NULL); return true; } else return SceneActor::startAction(action, event); @@ -4220,10 +4213,10 @@ void Scene2800::Action1::signal() { setDelay(120); Common::Point pt(330, 25); NpcMover *mover = new NpcMover(); - scene->_object1.addMover(mover, &pt, NULL); + scene->_bird.addMover(mover, &pt, NULL); } else { setDelay(1800 + R2_GLOBALS._randomSource.getRandomNumber(600)); - scene->_object1.setPosition(Common::Point(-10, 45)); + scene->_bird.setPosition(Common::Point(-10, 45)); } } @@ -4334,7 +4327,7 @@ void Scene2800::Action2::signal() { R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); R2_GLOBALS._player.setObjectWrapper(new SceneObjectWrapper()); - Common::Point pt(100, 64); + Common::Point pt(64, 100); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); break; @@ -4364,8 +4357,8 @@ void Scene2800::Action2::signal() { } case 13: R2_GLOBALS._events.setCursor(CURSOR_WALK); - scene->_field412 = 1207; - scene->_stripManager.start(scene->_field412, this); + scene->_stripNumber = 1207; + scene->_stripManager.start(scene->_stripNumber, this); break; case 14: { R2_GLOBALS._player.disableControl(); @@ -4431,20 +4424,20 @@ void Scene2800::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._sound2.stop(); SceneExt::postInit(); - _object1.postInit(); - _object1.setup(2750, 4, 1); - _object1.setPosition(Common::Point(-10, 25)); - _object1.animate(ANIM_MODE_1, NULL); - _object1.setStrip2(4); - _object1._moveRate = 20; - _object1.setAction(&_action1); - - _actor3.postInit(); - _actor3.setup(2802, 1, 1); - _actor3.setPosition(Common::Point(116, 80)); - _actor3.fixPriority(111); - _actor3.animate(ANIM_MODE_2, NULL); - _actor3._numFrames = 6; + _bird.postInit(); + _bird.setup(2750, 4, 1); + _bird.setPosition(Common::Point(-10, 25)); + _bird.animate(ANIM_MODE_1, NULL); + _bird.setStrip2(4); + _bird._moveRate = 20; + _bird.setAction(&_action1); + + _lightBar.postInit(); + _lightBar.setup(2802, 1, 1); + _lightBar.setPosition(Common::Point(116, 80)); + _lightBar.fixPriority(111); + _lightBar.animate(ANIM_MODE_2, NULL); + _lightBar._numFrames = 6; if (!R2_GLOBALS.getFlag(47)) { _guard.postInit(); @@ -4458,7 +4451,7 @@ void Scene2800::postInit(SceneObjectList *OwnerList) { _guard.setDetails(2800, -1, -1, -1, 1, (SceneItem *)NULL); } - _item1.setDetails(Rect(0, 0, 320, 200), 2800, -1, -1, -1, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 2800, -1, -1, -1, 1, NULL); _stripManager.setColors(60, 255); _stripManager.setFontNumber(3); @@ -4471,12 +4464,12 @@ void Scene2800::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS.getFlag(47)) { _outpost.setDetails(Rect(76, 45, 155, 90), 2800, 3, -1, -1, 2, NULL); } else { - _actor2.postInit(); - _actor2.setup(2752, 5, 1); - _actor2.animate(ANIM_MODE_NONE, NULL); - _actor2.changeZoom(100); - _actor2._moveDiff = Common::Point(2, 1); - _actor2.setPosition(Common::Point(101, 148)); + _nej.postInit(); + _nej.setup(2752, 5, 1); + _nej.animate(ANIM_MODE_NONE, NULL); + _nej.changeZoom(100); + _nej._moveDiff = Common::Point(2, 1); + _nej.setPosition(Common::Point(101, 148)); } } @@ -4498,7 +4491,8 @@ void Scene2800::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.enableControl(); } else { _sceneMode = 2801; - R2_GLOBALS._player.setAction(&_sequenceManager, this, 2801, &R2_GLOBALS._player, &_actor2, &_guard, NULL); + R2_GLOBALS._player.setAction(&_sequenceManager, this, 2801, &R2_GLOBALS._player, + &_nej, &_guard, NULL); } } @@ -4507,13 +4501,13 @@ void Scene2800::signal() { case 10: R2_GLOBALS._sound1.play(238); R2_GLOBALS._events.setCursor(CURSOR_WALK); - _field412 = 1206; + _stripNumber = 1206; _sceneMode = 2804; - _stripManager.start(_field412, this); + _stripManager.start(_stripNumber, this); break; case 11: - _actor2.remove(); - _object1.setAction(NULL); + _nej.remove(); + _bird.setAction(NULL); R2_GLOBALS._player.enableControl(CURSOR_WALK); R2_GLOBALS._player._moveDiff = Common::Point(3, 2); _outpost.setDetails(Rect(76, 45, 155, 90), 2800, 3, -1, -1, 2, NULL); @@ -4533,15 +4527,15 @@ void Scene2800::signal() { case 2803: R2_GLOBALS._player.disableControl(); _sceneMode = 10; - setAction(&_sequenceManager, this, 2803, &R2_GLOBALS._player, &_actor2, &_guard, NULL); + setAction(&_sequenceManager, this, 2803, &R2_GLOBALS._player, &_nej, &_guard, NULL); break; case 2804: R2_GLOBALS._player.disableControl(); _sceneMode = 11; - setAction(&_sequenceManager, this, 2804, &R2_GLOBALS._player, &_actor2, NULL); + setAction(&_sequenceManager, this, 2804, &R2_GLOBALS._player, &_nej, NULL); break; case 2805: - _object1.remove(); + _bird.remove(); setAction(&_action2); break; default: @@ -4616,8 +4610,8 @@ bool Scene2900::KnobLeft::startAction(CursorType action, Event &event) { switch (action) { case CURSOR_USE: - if (scene->_field416 || scene->_altitudeChanging || - scene->_field425 != scene->_field426) { + if (scene->_majorMinorFlag || scene->_altitudeChanging || + scene->_xAmount != scene->_xComparison) { // Let your altitude stablize first SceneItem::display2(2900, 17); } else if (R2_GLOBALS._balloonAltitude / 48 == 0) { @@ -4628,7 +4622,7 @@ bool Scene2900::KnobLeft::startAction(CursorType action, Event &event) { R2_GLOBALS._sound2.fadeSound(282); scene->_altitudeChanging = true; scene->_altitudeMajorChange = -1; - scene->_field426 = 100 - ((R2_GLOBALS._balloonAltitude / 48) - 1) * 25; + scene->_xComparison = 100 - ((R2_GLOBALS._balloonAltitude / 48) - 1) * 25; } break; @@ -4649,12 +4643,12 @@ bool Scene2900::KnobLeft::startAction(CursorType action, Event &event) { } bool Scene2900::KnobRight::startAction(CursorType action, Event &event) { - Scene2900 *scene = (Scene2900 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_USE: - if (scene->_field416 || scene->_altitudeChanging || - scene->_field425 != scene->_field426) { + case CURSOR_USE: { + Scene2900 *scene = (Scene2900 *)R2_GLOBALS._sceneManager._scene; + + if (scene->_majorMinorFlag || scene->_altitudeChanging || + scene->_xAmount != scene->_xComparison) { // Let your altitude stablize first SceneItem::display2(2900, 17); } else if (R2_GLOBALS._balloonAltitude / 48 >= 3) { @@ -4665,9 +4659,10 @@ bool Scene2900::KnobRight::startAction(CursorType action, Event &event) { R2_GLOBALS._sound2.fadeSound(212); scene->_altitudeChanging = true; scene->_altitudeMajorChange = 1; - scene->_field426 = 100 - ((R2_GLOBALS._balloonAltitude / 48) + 1) * 25; + scene->_xComparison = 100 - ((R2_GLOBALS._balloonAltitude / 48) + 1) * 25; } break; + } case CURSOR_LOOK: SceneItem::display2(2900, 12); @@ -4686,9 +4681,9 @@ bool Scene2900::KnobRight::startAction(CursorType action, Event &event) { } bool Scene2900::Skip::startAction(CursorType action, Event &event) { - Scene2900 *scene = (Scene2900 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_USE) { + Scene2900 *scene = (Scene2900 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 12; scene->signal(); @@ -4703,22 +4698,22 @@ void Scene2900::Action1::signal() { Scene2900 *scene = (Scene2900 *)R2_GLOBALS._sceneManager._scene; setDelay(3); - if (!scene->_field416 && !scene->_altitudeChanging) { - scene->_field427 = 2; - scene->_field412 = 0; - } else if (scene->_field416) { + if (!scene->_majorMinorFlag && !scene->_altitudeChanging) { + scene->_fadeCounter = 2; + scene->_controlsActiveChanging = false; + } else if (scene->_majorMinorFlag) { R2_GLOBALS._sound2.fadeOut2(NULL); - } else if (scene->_field427 == 0) { + } else if (scene->_fadeCounter == 0) { R2_GLOBALS._sound2.fadeOut2(NULL); - } else if (scene->_field412 == 0) { + } else if (!scene->_controlsActiveChanging) { scene->_knobLeftContent.hide(); scene->_knobRightContent.hide(); - scene->_field412 = 1; + scene->_controlsActiveChanging = true; } else { - --scene->_field427; + --scene->_fadeCounter; scene->_knobLeftContent.show(); scene->_knobRightContent.show(); - scene->_field412 = 0; + scene->_controlsActiveChanging = false; } } @@ -4726,10 +4721,6 @@ void Scene2900::Action1::signal() { Scene2900::Map::Map() { _mapWidth = _mapHeight = 0; - _field4 = 0; - _field6 = 0; - _field8 = 0; - _fieldA = 0; _resNum = 0; _xV = _yV = 0; _bounds = Rect(40, 0, 280, 150); @@ -4851,7 +4842,7 @@ int Scene2900::Map::adjustRect(Common::Rect &r1, const Common::Rect &r2) { return -1; } -void Scene2900::Map::drawBlock(const byte *data, int xp, int yp, +void Scene2900::Map::drawBlock(const byte *data, int xp, int yp, const Rect &bounds, const Rect &updateRect) { Rect blockRect(xp, yp, xp + 160, yp + 100); const byte *src = data; @@ -4881,10 +4872,10 @@ void Scene2900::Map::drawBlock(const byte *data, int xp, int yp, void Scene2900::Map::moveArea(Rect &r, int xAmt, int yAmt) { Rect tempRect = r; tempRect.translate(xAmt, yAmt); - int xpSrc, xpDest, width; - int ypSrc, ypDest, height; if (tempRect.intersects(r)) { + int xpSrc, xpDest, width; + int ypSrc, ypDest, height; if (xAmt >= 0) { xpSrc = tempRect.left; width = tempRect.width() - xAmt; @@ -4935,48 +4926,48 @@ void Scene2900::Map::moveLine(int xpSrc, int ypSrc, int xpDest, int ypDest, int /*------------------------------------------------------------------------*/ Scene2900::Scene2900(): SceneExt() { - _field412 = 0; + _controlsActiveChanging = false; _altitudeChanging = false; - _field416 = false; + _majorMinorFlag = false; _balloonLocation = Common::Point(550, 550); - _field41C = 0; + _altitudeMinorChange = 0; _altitudeMajorChange = 0; _balloonScreenPos = Common::Point(160, 100); _newAltitude = 0; - _field425 = 100; - _field426 = 100; - _field427 = 0; - _field8F8 = false; + _xAmount = 100; + _xComparison = 100; + _fadeCounter = 0; + _paletteReloadNeeded = false; } void Scene2900::synchronize(Serializer &s) { SceneExt::synchronize(s); - s.syncAsSint16LE(_field412); + s.syncAsSint16LE(_controlsActiveChanging); s.syncAsSint16LE(_altitudeChanging); - s.syncAsSint16LE(_field416); - s.syncAsSint16LE(_field41C); + s.syncAsSint16LE(_majorMinorFlag); + s.syncAsSint16LE(_altitudeMinorChange); s.syncAsSint16LE(_altitudeMajorChange); s.syncAsSint16LE(_balloonLocation.x); s.syncAsSint16LE(_balloonLocation.y); s.syncAsSint16LE(_balloonScreenPos.x); s.syncAsSint16LE(_balloonScreenPos.y); s.syncAsSint16LE(_newAltitude); - s.syncAsSint16LE(_field425); - s.syncAsSint16LE(_field426); - s.syncAsSint16LE(_field427); - s.syncAsSint16LE(_field8F8); + s.syncAsSint16LE(_xAmount); + s.syncAsSint16LE(_xComparison); + s.syncAsSint16LE(_fadeCounter); + s.syncAsSint16LE(_paletteReloadNeeded); _map.synchronize(s); } void Scene2900::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._uiElements._active = false; - // TODO: Determine correct colours + // TODO: Determine correct colors R2_GLOBALS._gfxColors.foreground = 228; R2_GLOBALS._fontColors.background = 12; R2_GLOBALS._fontColors.foreground = 22; - + _map.load(2950); loadScene(2900); @@ -4986,7 +4977,7 @@ void Scene2900::postInit(SceneObjectList *OwnerList) { _leftEdge.setup(2900, 6, 1, 22, 0, 25); _rightEdge.setup(2900, 6, 1, 280, 0, 25); _knob.setup(2900, 1, 3, 228, 199, 25); - + _altimeterContent.postInit(); _altimeterContent.setVisage(2900); _altimeterContent.setStrip(2); @@ -4999,7 +4990,7 @@ void Scene2900::postInit(SceneObjectList *OwnerList) { _knobLeftContent.setFrame(1); _knobLeftContent.setPosition(Common::Point(209, 199)); _knobLeftContent.fixPriority(200); - + _knobRightContent.postInit(); _knobRightContent.setVisage(2900); _knobRightContent.setStrip(1); @@ -5032,7 +5023,7 @@ void Scene2900::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._moveDiff = Common::Point(2, 2); R2_GLOBALS._player.disableControl(); - if (R2_GLOBALS._sceneManager._previousScene == 2350 && + if (R2_GLOBALS._sceneManager._previousScene == 2350 && R2_GLOBALS._balloonPosition.x == 0 && R2_GLOBALS._balloonPosition.y == 0) { R2_GLOBALS._balloonAltitude = 5; _map.setPosition(Common::Point(_balloonLocation.x - 120, _balloonLocation.y - 100)); @@ -5051,7 +5042,7 @@ void Scene2900::postInit(SceneObjectList *OwnerList) { _balloonLocation.x -= 70; else if ((R2_GLOBALS._balloonAltitude % 8) == 7) _balloonLocation.x += 70; - + if (_balloonLocation.x <= 120) _balloonScreenPos.x = _balloonLocation.x + 40; else if (_balloonLocation.x >= 680) @@ -5062,23 +5053,23 @@ void Scene2900::postInit(SceneObjectList *OwnerList) { if (_balloonLocation.y <= 100) _balloonScreenPos.y = _balloonLocation.y; - _field425 = _field426 = 100 - (R2_GLOBALS._balloonAltitude / 48) * 25; + _xAmount = _xComparison = 100 - (R2_GLOBALS._balloonAltitude / 48) * 25; _map.setPosition(Common::Point(_balloonLocation.x - 120, _balloonLocation.y - 100)); _sceneMode = 11; - R2_GLOBALS._player.changeZoom(_field425); + R2_GLOBALS._player.changeZoom(_xAmount); R2_GLOBALS._player.setPosition(_balloonScreenPos); R2_GLOBALS._player.enableControl(); R2_GLOBALS._player._canWalk = false; - _altimeterContent.setPosition(Common::Point(109 - _field425, 189)); + _altimeterContent.setPosition(Common::Point(109 - _xAmount, 189)); } R2_GLOBALS._sound1.play(211); } void Scene2900::remove() { - // TODO: Figure out correct colours + // TODO: Figure out correct colors R2_GLOBALS._gfxColors.foreground = 59; R2_GLOBALS._fontColors.background = 4; R2_GLOBALS._fontColors.foreground = 15; @@ -5088,7 +5079,7 @@ void Scene2900::remove() { R2_GLOBALS._sound1.fadeOut2(NULL); R2_GLOBALS._sound2.stop(); - + R2_GLOBALS._interfaceY = UI_INTERFACE_Y; SceneExt::remove(); } @@ -5112,51 +5103,51 @@ void Scene2900::dispatch() { if (_sceneMode == 11) { _balloonLocation.x += balloonData[R2_GLOBALS._balloonAltitude].x; _balloonLocation.y += balloonData[R2_GLOBALS._balloonAltitude].y; - _field41C = balloonData[R2_GLOBALS._balloonAltitude].v3; + _altitudeMinorChange = balloonData[R2_GLOBALS._balloonAltitude].v3; - if (_field41C == 0) { - _field416 = false; + if (_altitudeMinorChange == 0) { + _majorMinorFlag = false; } else { - _field416 = true; + _majorMinorFlag = true; _altitudeChanging = false; - _field426 = 100 - ((R2_GLOBALS._balloonAltitude / 48) + _field41C) * 25; + _xComparison = 100 - ((R2_GLOBALS._balloonAltitude / 48) + _altitudeMinorChange) * 25; } // Zooming/altitude balloon change - if (_field425 == _field426) { - _field416 = false; + if (_xAmount == _xComparison) { + _majorMinorFlag = false; } else { - if (!_field416) { - _field425 = _field425 - _altitudeMajorChange; + if (!_majorMinorFlag) { + _xAmount = _xAmount - _altitudeMajorChange; } else { - _field425 = _field425 - _field41C; + _xAmount = _xAmount - _altitudeMinorChange; } - if (_field41C == -1 || _altitudeMajorChange == -1) { + if (_altitudeMinorChange == -1 || _altitudeMajorChange == -1) { if (_altimeterContent._frame == 1) { _altimeterContent.setFrame2(10); } else { _altimeterContent.setFrame2(_altimeterContent._frame - 1); } - } else if (_field41C == -1 || _altitudeMajorChange == 1) { + } else if (_altitudeMinorChange == -1 || _altitudeMajorChange == 1) { if (_altimeterContent._frame == 10) _altimeterContent.setFrame2(1); else _altimeterContent.setFrame2(_altimeterContent._frame + 1); } - _altimeterContent.setPosition(Common::Point(109 - _field425, 189)); - R2_GLOBALS._player.changeZoom(_field425); + _altimeterContent.setPosition(Common::Point(109 - _xAmount, 189)); + R2_GLOBALS._player.changeZoom(_xAmount); } - if (!_field8F8) { + if (!_paletteReloadNeeded) { R2_GLOBALS._scenePalette.loadPalette(2950); R2_GLOBALS._scenePalette.refresh(); } R2_GLOBALS._balloonPosition = _map.setPosition( - Common::Point(_balloonLocation.x - 120, _balloonLocation.y - 100), !_field8F8); - _field8F8 = true; + Common::Point(_balloonLocation.x - 120, _balloonLocation.y - 100), !_paletteReloadNeeded); + _paletteReloadNeeded = true; if (_balloonLocation.x <= 120) _balloonScreenPos.x = _balloonLocation.x + 40; @@ -5168,7 +5159,7 @@ void Scene2900::dispatch() { R2_GLOBALS._player.setPosition(_balloonScreenPos); - if ((_balloonLocation.x % 100) == 50 && (_balloonLocation.y % 100) == 50 && !_field416) { + if ((_balloonLocation.x % 100) == 50 && (_balloonLocation.y % 100) == 50 && !_majorMinorFlag) { // At an altitude change point, so calculate new altitude _newAltitude = R2_GLOBALS._balloonAltitude; if (_altitudeChanging) { diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.h b/engines/tsage/ringworld2/ringworld2_scenes2.h index f90126b5a1..1339504712 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.h +++ b/engines/tsage/ringworld2/ringworld2_scenes2.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -69,9 +69,9 @@ public: bool _exitingFlag; int _mazePlayerMode; - NamedHotspot _item1; - SceneActor _object1; - SceneActor _objList1[11]; + NamedHotspot _background; + SceneActor _companion; + SceneActor _persons[11]; WestExit _westExit; EastExit _eastExit; SouthExit _southExit; @@ -92,10 +92,10 @@ public: }; class Scene2350 : public SceneExt { - class Actor2 : public SceneActor { + class Companion : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor3 : public SceneActor { + class Balloon : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; @@ -106,14 +106,13 @@ class Scene2350 : public SceneExt { virtual void changeScene(); }; public: - SpeakerQuinn _quinnSpeaker; SpeakerPharisha _pharishaSpeaker; - NamedHotspot _item1; - SceneActor _actor1; - Actor2 _actor2; - Actor3 _actor3; - Actor3 _actor4; + NamedHotspot _background; + SceneActor _person; + Companion _companion; + Balloon _balloon; + Balloon _harness; ExitUp _exitUp; ExitWest _exitWest; SequenceManager _sequenceManager; @@ -121,19 +120,18 @@ public: virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void remove(); virtual void signal(); - virtual void process(Event &event); }; class Scene2400 : public SceneExt { - class Exit1 : public SceneExit { + class WestExit : public SceneExit { virtual void changeScene(); }; - class Exit2 : public SceneExit { + class EastExit : public SceneExit { virtual void changeScene(); }; public: - Exit1 _exit1; - Exit2 _exit2; + WestExit _westExit; + EastExit _eastExit; SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -153,7 +151,7 @@ class Scene2425 : public SceneExt { public: virtual bool startAction(CursorType action, Event &event); }; - class Item4 : public NamedHotspot { + class Background : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; @@ -167,7 +165,7 @@ class Scene2425 : public SceneExt { bool startAction(CursorType action, Event &event); }; - class Exit1 : public SceneExit { + class SouthEastExit : public SceneExit { public: virtual void changeScene(); }; @@ -175,11 +173,11 @@ public: RopeDest1 _ropeDest1; RopeDest2 _ropeDest2; Crevasse _crevasse; - Item4 _item4; + Background _background; Rope _rope; Pictographs _pictographs1; Pictographs _pictographs2; - Exit1 _exit1; + SouthEastExit _southEastExit; SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -188,7 +186,7 @@ public: }; class Scene2430 : public SceneExt { - class Actor1 : public SceneActor { + class Companion : public SceneActor { public: bool startAction(CursorType action, Event &event); }; @@ -201,28 +199,28 @@ class Scene2430 : public SceneExt { bool startAction(CursorType action, Event &event); }; - class Exit1 : public SceneExit { + class SouthExit : public SceneExit { public: virtual void changeScene(); }; public: - NamedHotspot _item1; - NamedHotspot _item2; - NamedHotspot _item3; - NamedHotspot _item4; - NamedHotspot _item5; - NamedHotspot _item6; - NamedHotspot _item7; - NamedHotspot _item8; - NamedHotspot _item9; - NamedHotspot _item10; - NamedHotspot _item11; - NamedHotspot _item12; - NamedHotspot _item13; - Actor1 _actor1; + NamedHotspot _background; + NamedHotspot _bottles2; + NamedHotspot _furnishings; + NamedHotspot _rug1; + NamedHotspot _mirror; + NamedHotspot _garments; + NamedHotspot _bed; + NamedHotspot _towel; + NamedHotspot _bottles1; + NamedHotspot _post; + NamedHotspot _clothesPile1; + NamedHotspot _clothesPile2; + NamedHotspot _rug2; + Companion _companion; GunPowder _gunPowder; OilLamp _oilLamp; - Exit1 _exit1; + SouthExit _southExit; SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -239,7 +237,7 @@ class Scene2435 : public SceneExt { bool startAction(CursorType action, Event &event); }; - class Exit1 : public SceneExit { + class SouthExit : public SceneExit { public: virtual void changeScene(); }; @@ -252,7 +250,7 @@ public: NamedHotspot _rightWindow; Companion _companion; Astor _astor; - Exit1 _exit1; + SouthExit _southExit; SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -261,7 +259,7 @@ public: }; class Scene2440 : public SceneExt { - class Actor1 : public SceneActor { + class Companion : public SceneActor { public: bool startAction(CursorType action, Event &event); }; @@ -270,21 +268,21 @@ class Scene2440 : public SceneExt { bool startAction(CursorType action, Event &event); }; - class Exit1 : public SceneExit { + class SouthEastExit : public SceneExit { public: virtual void changeScene(); }; public: - NamedHotspot _item1; - NamedHotspot _item2; - NamedHotspot _item3; - NamedHotspot _item4; - NamedHotspot _item5; - NamedHotspot _item6; - NamedHotspot _item7; - Actor1 _actor1; + NamedHotspot _background; + NamedHotspot _garments; + NamedHotspot _bedspread; + NamedHotspot _post; + NamedHotspot _rug; + NamedHotspot _furnishings; + NamedHotspot _bottles; + Companion _companion; OilLamp _oilLamp; - Exit1 _exit1; + SouthEastExit _southEastExit; SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -310,7 +308,7 @@ class Scene2450 : public SceneExt { bool startAction(CursorType action, Event &event); }; - class Exit1 : public SceneExit { + class SouthWestExit : public SceneExit { public: virtual void changeScene(); }; @@ -324,7 +322,7 @@ public: SceneActor _companion; Parker _parker; CareTaker _careTaker; - Exit1 _exit1; + SouthWestExit _southWestExit; SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -346,7 +344,7 @@ class Scene2455 : public SceneExt { bool startAction(CursorType action, Event &event); }; - class Exit1 : public SceneExit { + class NorthExit : public SceneExit { public: virtual void changeScene(); }; @@ -355,7 +353,7 @@ public: Lamp _lamp; Pool _pool; ScrithKey _scrithKey; - Exit1 _exit1; + NorthExit _northExit; SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -364,7 +362,7 @@ public: }; class Scene2500 : public SceneExt { - class Exit1 : public SceneExit { + class WestExit : public SceneExit { public: virtual void changeScene(); }; @@ -373,11 +371,11 @@ public: SpeakerSeeker _seekerSpeaker; SpeakerMiranda _mirandaSpeaker; SpeakerWebbster2500 _webbsterSpeaker; - NamedHotspot _item1; - SceneActor _actor1; - SceneActor _actor2; - SceneActor _actor3; - Exit1 _exit1; + NamedHotspot _background; + SceneActor _companion; + SceneActor _quinn; + SceneActor _ship; + WestExit _westExit; SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -385,7 +383,7 @@ public: }; class Scene2525 : public SceneExt { - class Item5 : public NamedHotspot { + class StopCock : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; @@ -395,20 +393,20 @@ class Scene2525 : public SceneExt { bool startAction(CursorType action, Event &event); }; - class Exit1 : public SceneExit { + class SouthExit : public SceneExit { public: virtual void changeScene(); }; public: - NamedHotspot _item1; - NamedHotspot _item2; - NamedHotspot _item3; - NamedHotspot _item4; - Item5 _item5; - SceneActor _actor1; - SceneActor _actor2; + NamedHotspot _background; + NamedHotspot _machine; + NamedHotspot _pipes1; + NamedHotspot _pipes2; + StopCock _stopcock; + SceneActor _companion; + SceneActor _compressor; GlassDome _glassDome; - Exit1 _exit1; + SouthExit _southExit; SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -426,20 +424,20 @@ class Scene2530 : public SceneExt { bool startAction(CursorType action, Event &event); }; - class Exit1 : public SceneExit { + class SouthExit : public SceneExit { public: virtual void changeScene(); }; public: NamedHotspot _background; - NamedHotspot _item2; + NamedHotspot _crank2; NamedHotspot _shelf; NamedHotspot _item4; - NamedHotspot _item5; - SceneActor _actor1; + NamedHotspot _rope; + SceneActor _companion; Flask _flask; Crank _crank; - Exit1 _exit1; + SouthExit _southExit; SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -456,7 +454,7 @@ class Scene2535 : public SceneExt { bool startAction(CursorType action, Event &event); }; - class Exit1 : public SceneExit { + class SouthExit : public SceneExit { public: virtual void changeScene(); }; @@ -472,7 +470,7 @@ public: SceneActor _rope; RebreatherTank _rebreatherTank; TannerMask _tannerMask; - Exit1 _exit1; + SouthExit _southExit; SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -509,11 +507,11 @@ class Scene2700 : public SceneExt { void signal(); }; - class Area1: public SceneArea { + class SouthExit: public SceneArea { public: void process(Event &event); }; - class Area2: public SceneArea { + class EastExit: public SceneArea { public: void process(Event &event); }; @@ -535,12 +533,12 @@ public: Action2 _action2; Action3 _action3; Action4 _action4; - Area1 _area1; - Area2 _area2; + SouthExit _southExit; + EastExit _eastExit; Rect _walkRect1, _walkRect2, _walkRect3; Rect _walkRect4, _walkRect5, _walkRect6; SequenceManager _sequenceManager; - int _field412, _field414, _field416; + int _areaMode, _moveMode, _stripNumber; Scene2700(); virtual void synchronize(Serializer &s); @@ -579,11 +577,11 @@ class Scene2750 : public SceneExt { void signal(); }; - class Area1: public SceneArea { + class WestExit: public SceneArea { public: void process(Event &event); }; - class Area2: public SceneArea { + class EastExit: public SceneArea { public: void process(Event &event); }; @@ -596,16 +594,16 @@ public: NamedHotspot _ghoulHome3; NamedHotspot _ghoulHome4; SceneActor _nej; - SceneActor _actor2; - SceneActor _actor3; - SceneActor _actor4; - SceneActor _actor5; - SceneActor _actor6; - SceneActor _actor7; - SceneActor _actor8; - SceneActor _actor9; - SceneActor _actor10; - SceneActor _actor11; + SceneActor _fire; + SceneActor _bird1; + SceneActor _folliage1; + SceneActor _bird2; + SceneActor _folliage2; + SceneActor _folliage3; + SceneActor _folliage4; + SceneActor _folliage5; + SceneActor _folliage6; + SceneActor _folliage7; Action1 _action1; Action2 _action2; Action3 _action3; @@ -613,11 +611,11 @@ public: Action5 _action5; Action6 _action6; Action7 _action7; - Area1 _area1; - Area2 _area2; - Rect _rect1, _rect2, _rect3; + WestExit _westExit; + EastExit _eastExit; + Rect _walkRect1, _walkRect2, _walkRect3; SequenceManager _sequenceManager; - int _field412, _field414, _field416; + int _areaMode, _moveMode, _stripNumber; Scene2750(); virtual void synchronize(Serializer &s); @@ -651,16 +649,16 @@ public: SpeakerQuinn2800 _quinnSpeaker; SpeakerNej2800 _nejSpeaker; SpeakerGuard2800 _guardSpeaker; - NamedHotspot _item1; + NamedHotspot _background; Outpost _outpost; Guard _guard; - SceneActor _actor2; - SceneActor _actor3; - SceneObject _object1; + SceneActor _nej; + SceneActor _lightBar; + SceneObject _bird; Action1 _action1; Action2 _action2; SequenceManager _sequenceManager; - int _field412; + int _stripNumber; Scene2800(); virtual void synchronize(Serializer &s); @@ -710,10 +708,6 @@ class Scene2900 : public SceneExt { void drawBlock(const byte *data, int xp, int yp, const Rect &r1, const Rect &r2); public: int _mapWidth, _mapHeight; - int _field4; - int _field6; - int _field8; - int _fieldA; int _resNum; int _xV, _yV; Rect _bounds; @@ -741,18 +735,18 @@ public: Map _map; SceneText _skipText; - int _field412; + bool _controlsActiveChanging; bool _altitudeChanging; - bool _field416; - int _field41C; + bool _majorMinorFlag; + int _altitudeMinorChange; int _altitudeMajorChange; Common::Point _balloonLocation; Common::Point _balloonScreenPos; int _newAltitude; - int _field425; - int _field426; - int _field427; - bool _field8F8; + int _xAmount; + int _xComparison; + int _fadeCounter; + bool _paletteReloadNeeded; Scene2900(); virtual void synchronize(Serializer &s); diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index 5cca1ee483..3f32503fdf 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -35,13 +35,13 @@ namespace Ringworld2 { *--------------------------------------------------------------------------*/ Scene3100::Scene3100() { - _field412 = 0; + _fadeSound = false; } void Scene3100::synchronize(Serializer &s) { SceneExt::synchronize(s); - s.syncAsSint16LE(_field412); + s.syncAsSint16LE(_fadeSound); } bool Scene3100::Guard::startAction(CursorType action, Event &event) { @@ -84,20 +84,21 @@ void Scene3100::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._characterIndex = R2_QUINN; R2_GLOBALS._player.disableControl(); - _actor1.postInit(); - _item2.setDetails(Rect(212, 97, 320, 114), 3100, 3, -1, -1, 1, NULL); - _item1.setDetails(Rect(0, 0, 480, 200), 3100, 0, -1, -1, 1, NULL); - _field412 = 0; + _hammerHead.postInit(); + _hammerHead2.setDetails(Rect(212, 97, 320, 114), 3100, 3, -1, -1, 1, NULL); + _background.setDetails(Rect(0, 0, 480, 200), 3100, 0, -1, -1, 1, NULL); + _fadeSound = false; if (R2_GLOBALS._sceneManager._previousScene == 1000) { if (R2_GLOBALS._player._oldCharacterScene[R2_QUINN] == 3100) { _sceneMode = 3102; - _actor3.postInit(); - _actor4.postInit(); - _actor5.postInit(); + _ghoul.postInit(); + _technicians.postInit(); + _deadBodies.postInit(); R2_GLOBALS._sound1.play(274); _sound1.fadeSound(130); - setAction(&_sequenceManager, this, 3102, &_actor1, &R2_GLOBALS._player, &_actor3, &_actor4, &_actor5, NULL); + setAction(&_sequenceManager, this, 3102, &_hammerHead, &R2_GLOBALS._player, + &_ghoul, &_technicians, &_deadBodies, NULL); } else { _guard.postInit(); _guard.setup(3110, 5, 1); @@ -105,27 +106,28 @@ void Scene3100::postInit(SceneObjectList *OwnerList) { _guard.setPosition(Common::Point(10, 149)); _guard.setDetails(3100, 6, -1, -1, 2, (SceneItem *)NULL); - _actor4.postInit(); - _actor4.setup(3103, 1, 1); - _actor4.setPosition(Common::Point(278, 113)); - _actor4.setDetails(3100, 9, -1, -1, 2, (SceneItem *)NULL); - _actor4.animate(ANIM_MODE_2, NULL); + _technicians.postInit(); + _technicians.setup(3103, 1, 1); + _technicians.setPosition(Common::Point(278, 113)); + _technicians.setDetails(3100, 9, -1, -1, 2, (SceneItem *)NULL); + _technicians.animate(ANIM_MODE_2, NULL); - _field412 = 1; - _actor1.setDetails(3100, 3, -1, -1, 2, (SceneItem *)NULL); + _fadeSound = true; + _hammerHead.setDetails(3100, 3, -1, -1, 2, (SceneItem *)NULL); R2_GLOBALS._sound1.play(243); R2_GLOBALS._sound2.play(130); _sceneMode = 3100; - setAction(&_sequenceManager, this, 3100, &R2_GLOBALS._player, &_actor1, NULL); + setAction(&_sequenceManager, this, 3100, &R2_GLOBALS._player, &_hammerHead, NULL); } } else if (R2_GLOBALS._sceneManager._previousScene == 3255) { _sceneMode = 3101; - _actor2.postInit(); - _actor3.postInit(); - _field412 = 1; + _miranda.postInit(); + _ghoul.postInit(); + _fadeSound = true; - setAction(&_sequenceManager, this, 3101, &R2_GLOBALS._player, &_actor1, &_actor2, &_actor3, NULL); + setAction(&_sequenceManager, this, 3101, &R2_GLOBALS._player, &_hammerHead, + &_miranda, &_ghoul, NULL); } else { _guard.postInit(); _guard.setup(3110, 5, 1); @@ -133,16 +135,16 @@ void Scene3100::postInit(SceneObjectList *OwnerList) { _guard.setPosition(Common::Point(10, 149)); _guard.setDetails(3100, 6, -1, -1, 2, (SceneItem *)NULL); - _actor4.postInit(); - _actor4.setup(3103, 1, 1); - _actor4.setPosition(Common::Point(278, 113)); - _actor4.setDetails(3100, 9, -1, -1, 2, (SceneItem *)NULL); - _actor4.animate(ANIM_MODE_2, NULL); + _technicians.postInit(); + _technicians.setup(3103, 1, 1); + _technicians.setPosition(Common::Point(278, 113)); + _technicians.setDetails(3100, 9, -1, -1, 2, (SceneItem *)NULL); + _technicians.animate(ANIM_MODE_2, NULL); - _actor1.postInit(); - _actor1.setup(3104, 4, 1); - _actor1.setPosition(Common::Point(143, 104)); - _actor1.setDetails(3100, 3, -1, -1, 2, (SceneItem *)NULL); + _hammerHead.postInit(); + _hammerHead.setup(3104, 4, 1); + _hammerHead.setPosition(Common::Point(143, 104)); + _hammerHead.setDetails(3100, 3, -1, -1, 2, (SceneItem *)NULL); R2_GLOBALS._player.setup(3110, 3, 1); R2_GLOBALS._player.changeZoom(50); @@ -189,13 +191,13 @@ void Scene3100::signal() { } void Scene3100::dispatch() { - if ((_sceneMode == 3100) && (_field412 != 0) && (R2_GLOBALS._player._position.y == 104)) { - _field412 = 0; + if ((_sceneMode == 3100) && _fadeSound && (R2_GLOBALS._player._position.y == 104)) { + _fadeSound = false; R2_GLOBALS._sound2.fadeOut2(NULL); } - if ((_sceneMode == 3101) && (_field412 != 0) && (R2_GLOBALS._player._position.y < 104)) { - _field412 = 0; + if ((_sceneMode == 3101) && _fadeSound && (R2_GLOBALS._player._position.y < 104)) { + _fadeSound = false; _sound1.fadeSound(130); } @@ -208,33 +210,33 @@ void Scene3100::dispatch() { *--------------------------------------------------------------------------*/ Scene3125::Scene3125() { - _field412 = 0; + _soundPlayed = false; } void Scene3125::synchronize(Serializer &s) { SceneExt::synchronize(s); - s.syncAsSint16LE(_field412); + s.syncAsSint16LE(_soundPlayed); } bool Scene3125::Background::startAction(CursorType action, Event &event) { - Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene; - switch (action) { case CURSOR_USE: if (_useLineNum != -1) - SceneItem::display(_resNum, _useLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); + SceneItem::display(_resNum, _useLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, LIST_END); break; case CURSOR_LOOK: if (_lookLineNum != -1) - SceneItem::display(_resNum, _lookLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); + SceneItem::display(_resNum, _lookLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, LIST_END); break; case CURSOR_TALK: if (_talkLineNum != -1) - SceneItem::display(_resNum, _talkLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); + SceneItem::display(_resNum, _talkLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, LIST_END); break; - default: + default: { + Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene; return scene->display(action, event); + } break; } @@ -242,19 +244,20 @@ bool Scene3125::Background::startAction(CursorType action, Event &event) { } bool Scene3125::Table::startAction(CursorType action, Event &event) { - Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_USE: + case CURSOR_USE: { + Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3125; - scene->setAction(&scene->_sequenceManager1, scene, 3125, &R2_GLOBALS._player, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3125, &R2_GLOBALS._player, NULL); + } break; case CURSOR_LOOK: - SceneItem::display(3125, 15, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); + SceneItem::display(3125, 15, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, LIST_END); break; case CURSOR_TALK: - SceneItem::display(3125, 13, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); + SceneItem::display(3125, 13, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, LIST_END); break; default: return SceneHotspot::startAction(action, event); @@ -265,22 +268,23 @@ bool Scene3125::Table::startAction(CursorType action, Event &event) { } bool Scene3125::Computer::startAction(CursorType action, Event &event) { - Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_USE: + case CURSOR_USE: { + Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_ghoul4.postInit(); scene->_sceneMode = 3126; - scene->setAction(&scene->_sequenceManager1, scene, 3126, &R2_GLOBALS._player, - &scene->_ghoul1, &scene->_ghoul2, &scene->_ghoul3, &scene->_door, + scene->setAction(&scene->_sequenceManager, scene, 3126, &R2_GLOBALS._player, + &scene->_ghoul1, &scene->_ghoul2, &scene->_ghoul3, &scene->_door, &scene->_ghoul4, NULL); + } break; case CURSOR_LOOK: - SceneItem::display(3125, 9, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); + SceneItem::display(3125, 9, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, LIST_END); break; case CURSOR_TALK: - SceneItem::display(3125, 13, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); + SceneItem::display(3125, 13, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, LIST_END); break; default: return SceneHotspot::startAction(action, event); @@ -291,21 +295,21 @@ bool Scene3125::Computer::startAction(CursorType action, Event &event) { } bool Scene3125::Door::startAction(CursorType action, Event &event) { - Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); + Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3176; - scene->setAction(&scene->_sequenceManager1, scene, 3176, &R2_GLOBALS._player, &scene->_door, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3176, &R2_GLOBALS._player, &scene->_door, NULL); return true; } void Scene3125::postInit(SceneObjectList *OwnerList) { loadScene(3125); SceneExt::postInit(); - _field412 = 0; + _soundPlayed = false; _door.postInit(); _door.setup(3175, 1, 1); @@ -336,7 +340,7 @@ void Scene3125::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] == 3250) { _sceneMode = 3175; - setAction(&_sequenceManager1, this, 3175, &R2_GLOBALS._player, &_door, NULL); + setAction(&_sequenceManager, this, 3175, &R2_GLOBALS._player, &_door, NULL); } else { R2_GLOBALS._player.setup(30, 5, 1); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); @@ -349,9 +353,9 @@ void Scene3125::postInit(SceneObjectList *OwnerList) { void Scene3125::signal() { switch (_sceneMode) { case 3125: - SceneItem::display(3125, 3, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); + SceneItem::display(3125, 3, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, LIST_END); _sceneMode = 3127; - setAction(&_sequenceManager1, this, 3127, &R2_GLOBALS._player, NULL); + setAction(&_sequenceManager, this, 3127, &R2_GLOBALS._player, NULL); break; case 3126: R2_GLOBALS.setFlag(79); @@ -366,9 +370,9 @@ void Scene3125::signal() { } void Scene3125::dispatch() { - if ((_sceneMode == 3126) && (_ghoul1._frame == 2) && (_field412 == 0)) { - _field412 = 1; + if ((_sceneMode == 3126) && (_ghoul1._frame == 2) && !_soundPlayed) { R2_GLOBALS._sound1.play(265); + _soundPlayed = true; } Scene::dispatch(); } @@ -394,12 +398,12 @@ bool Scene3150::LightFixture::startAction(CursorType action, Event &event) { if ((R2_INVENTORY.getObjectScene(R2_LIGHT_BULB) != 3150) && (R2_GLOBALS.getFlag(75))) { R2_GLOBALS._player.disableControl(); scene->_bulbOrWire.postInit(); - scene->_bulbOrWire._effect = 3; + scene->_bulbOrWire._effect = EFFECT_SHADED2; scene->_bulbOrWire._shade = 5; scene->_sceneMode = 3155; scene->setAction(&scene->_sequenceManager, scene, 3155, &R2_GLOBALS._player, &scene->_bulbOrWire, NULL); } else { - SceneItem::display(3150, 42, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(3150, 42, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); } return true; default: @@ -415,18 +419,18 @@ bool Scene3150::Toilet::startAction(CursorType action, Event &event) { case R2_PILLOW: R2_GLOBALS._player.disableControl(); scene->_water.postInit(); - scene->_water._effect = 6; + scene->_water._effect = EFFECT_SHADED2; scene->_water._shade = 3; R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3158; scene->setAction(&scene->_sequenceManager, scene, 3158, &R2_GLOBALS._player, &scene->_water, NULL); return true; case R2_FOOD_TRAY: - if ((R2_INVENTORY.getObjectScene(R2_LIGHT_BULB) != 3150) && - (R2_INVENTORY.getObjectScene(R2_SUPERCONDUCTOR_WIRE) == 3150) + if ((R2_INVENTORY.getObjectScene(R2_LIGHT_BULB) != 3150) && + (R2_INVENTORY.getObjectScene(R2_SUPERCONDUCTOR_WIRE) == 3150) && (R2_GLOBALS.getFlag(75))) { scene->_foodTray.postInit(); - scene->_foodTray._effect = 6; + scene->_foodTray._effect = EFFECT_SHADED2; scene->_foodTray._shade = 3; scene->_foodTray.setDetails(3150, 30, -1, -1, 2, (SceneItem *)NULL); @@ -434,7 +438,7 @@ bool Scene3150::Toilet::startAction(CursorType action, Event &event) { scene->_sceneMode = 3159; scene->setAction(&scene->_sequenceManager, scene, 3159, &R2_GLOBALS._player, &scene->_foodTray, NULL); } else { - SceneItem::display(3150, 42, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(3150, 42, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); } return true; default: @@ -444,17 +448,18 @@ bool Scene3150::Toilet::startAction(CursorType action, Event &event) { } bool Scene3150::Water::startAction(CursorType action, Event &event) { - Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_USE: + case CURSOR_USE: { if (R2_GLOBALS.getFlag(75)) return SceneActor::startAction(action, event); + Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3151; scene->setAction(&scene->_sequenceManager, scene, 3151, &R2_GLOBALS._player, &scene->_water, NULL); return true; + } case R2_FOOD_TRAY: return false; default: @@ -464,21 +469,21 @@ bool Scene3150::Water::startAction(CursorType action, Event &event) { } bool Scene3150::FoodTray::startAction(CursorType action, Event &event) { - Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; - if ((action != CURSOR_USE) || (R2_GLOBALS.getFlag(77))) return SceneActor::startAction(action, event); + Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3157; scene->setAction(&scene->_sequenceManager, scene, 3157, &R2_GLOBALS._player, &scene->_foodTray, NULL); return true; } -bool Scene3150::Actor6::startAction(CursorType action, Event &event) { - Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; - +bool Scene3150::ToiletFlush::startAction(CursorType action, Event &event) { if (action == CURSOR_USE) { + Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; + if (R2_GLOBALS.getFlag(75)) { if (R2_GLOBALS.getFlag(77)) { R2_GLOBALS._player.disableControl(); @@ -487,10 +492,10 @@ bool Scene3150::Actor6::startAction(CursorType action, Event &event) { scene->setAction(&scene->_sequenceManager, scene, 3152, &R2_GLOBALS._player, NULL); } else { scene->_sceneMode = 3153; - scene->setAction(&scene->_sequenceManager, scene, 3152, &R2_GLOBALS._player, &scene->_water, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3153, &R2_GLOBALS._player, &scene->_water, NULL); } } else { - SceneItem::display(3150, 42, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(3150, 42, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); } } else { R2_GLOBALS._player.disableControl(); @@ -504,9 +509,9 @@ bool Scene3150::Actor6::startAction(CursorType action, Event &event) { } bool Scene3150::AirVent::startAction(CursorType action, Event &event) { - Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; - if ((action == R2_LASER_HACKSAW) && (!R2_GLOBALS.getFlag(80))) { + Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3160; scene->setAction(&scene->_sequenceManager, scene, 3160, &R2_GLOBALS._player, &scene->_airVent, NULL); @@ -577,7 +582,7 @@ void Scene3150::postInit(SceneObjectList *OwnerList) { _guard.postInit(); _guard.setup(3154, 1, 16); _guard.setPosition(Common::Point(104, 129)); - _guard._effect = 6; + _guard._effect = EFFECT_SHADED2; _guard._shade = 3; _guard.setDetails(3150, 24, -1, -1, -1, (SceneItem *)NULL); } @@ -607,7 +612,7 @@ void Scene3150::postInit(SceneObjectList *OwnerList) { } _water.fixPriority(110); _water.setPosition(Common::Point(83, 88)); - _water._effect = 6; + _water._effect = EFFECT_SHADED2; _water._shade = 3; } else { _water.setup(3152, 7, 3); @@ -624,10 +629,10 @@ void Scene3150::postInit(SceneObjectList *OwnerList) { if (R2_INVENTORY.getObjectScene(R2_SUPERCONDUCTOR_WIRE) == 3150) { _bulbOrWire.postInit(); - _bulbOrWire.setup(3152, 7, 3); + _bulbOrWire.setup(3152, 7, 2); _bulbOrWire.setPosition(Common::Point(70, 55)); _bulbOrWire.fixPriority(111); - _bulbOrWire._effect = 6; + _bulbOrWire._effect = EFFECT_SHADED2; _bulbOrWire._shade = 5; } @@ -637,7 +642,7 @@ void Scene3150::postInit(SceneObjectList *OwnerList) { _foodTray.setup(3152, 7, 8); _foodTray.setPosition(Common::Point(82, 92)); _foodTray.fixPriority(111); - _foodTray._effect = 6; + _foodTray._effect = EFFECT_SHADED2; _foodTray._shade = 3; } else { _foodTray.setup(3152, 7, 7); @@ -662,7 +667,7 @@ void Scene3150::postInit(SceneObjectList *OwnerList) { case 0: _sceneMode = 3150; _guard.postInit(); - _guard._effect = 6; + _guard._effect = EFFECT_SHADED2; _guard._shade = 5; setAction(&_sequenceManager, this, 3150, &R2_GLOBALS._player, &_guard, &_doorBars, NULL); break; @@ -683,22 +688,24 @@ void Scene3150::postInit(SceneObjectList *OwnerList) { break; } default: - if ((R2_GLOBALS._v56AA0 == 1) && (R2_INVENTORY.getObjectScene(R2_ANCIENT_SCROLLS) == 2000) && (R2_GLOBALS._player._oldCharacterScene[R2_QUINN] == 3100)) { - ++R2_GLOBALS._v56AA0; + if ((R2_GLOBALS._mirandaJailState == 1) && (R2_INVENTORY.getObjectScene(R2_ANCIENT_SCROLLS) == 2000) + && (R2_GLOBALS._player._oldCharacterScene[R2_QUINN] == 3100)) { + // Moving story on to Miranda getting food delivered + ++R2_GLOBALS._mirandaJailState; _sceneMode = 3156; _guard.postInit(); - _guard._effect = 6; + _guard._effect = EFFECT_SHADED2; _guard._shade = 3; _doorBars.postInit(); _foodTray.postInit(); - _foodTray._effect = 6; + _foodTray._effect = EFFECT_SHADED2; _foodTray._shade = 3; setAction(&_sequenceManager, this, 3156, &R2_GLOBALS._player, &_guard, &_doorBars, &_foodTray, NULL); } else { - if (R2_GLOBALS._v56AA0 != 2) - ++R2_GLOBALS._v56AA0; + if ((R2_GLOBALS._mirandaJailState != 1) && (R2_GLOBALS._mirandaJailState != 2)) + ++R2_GLOBALS._mirandaJailState; R2_GLOBALS._player.setup(30, 3, 1); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); @@ -787,12 +794,12 @@ void Scene3150::signal() { void Scene3150::dispatch() { if (_foodTray._position.x == 155) { - _foodTray._effect = 0; + _foodTray._effect = EFFECT_NONE; _foodTray._shade = 0; } if (_guard._visage == 3154) { - _guard._effect = 0; + _guard._effect = EFFECT_NONE; _guard._shade = 0; } @@ -804,25 +811,23 @@ void Scene3150::dispatch() { * *--------------------------------------------------------------------------*/ -bool Scene3175::Item1::startAction(CursorType action, Event &event) { - Scene3175 *scene = (Scene3175 *)R2_GLOBALS._sceneManager._scene; - +bool Scene3175::RoomItem::startAction(CursorType action, Event &event) { switch (action) { case CURSOR_USE: if (_useLineNum != -1) { - SceneItem::display(_resNum, _useLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); + SceneItem::display(_resNum, _useLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, LIST_END); return true; } break; case CURSOR_LOOK: if (_lookLineNum != -1) { - SceneItem::display(_resNum, _lookLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); + SceneItem::display(_resNum, _lookLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, LIST_END); return true; } break; case CURSOR_TALK: if (_talkLineNum != -1) { - SceneItem::display(_resNum, _talkLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); + SceneItem::display(_resNum, _talkLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, LIST_END); return true; } break; @@ -830,28 +835,27 @@ bool Scene3175::Item1::startAction(CursorType action, Event &event) { break; } + Scene3175 *scene = (Scene3175 *)R2_GLOBALS._sceneManager._scene; return scene->display(action, event); } bool Scene3175::Corpse::startAction(CursorType action, Event &event) { - Scene3175 *scene = (Scene3175 *)R2_GLOBALS._sceneManager._scene; - switch (action) { case CURSOR_USE: if (_useLineNum != -1) { - SceneItem::display(_resNum, _useLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); + SceneItem::display(_resNum, _useLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, LIST_END); return true; } break; case CURSOR_LOOK: if (_lookLineNum != -1) { - SceneItem::display(_resNum, _lookLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); + SceneItem::display(_resNum, _lookLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, LIST_END); return true; } break; case CURSOR_TALK: if (_talkLineNum != -1) { - SceneItem::display(_resNum, _talkLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); + SceneItem::display(_resNum, _talkLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, LIST_END); return true; } break; @@ -859,25 +863,27 @@ bool Scene3175::Corpse::startAction(CursorType action, Event &event) { break; } + Scene3175 *scene = (Scene3175 *)R2_GLOBALS._sceneManager._scene; return scene->display(action, event); } bool Scene3175::Door::startAction(CursorType action, Event &event) { - Scene3175 *scene = (Scene3175 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_USE: + case CURSOR_USE: { + Scene3175 *scene = (Scene3175 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3176; scene->setAction(&scene->_sequenceManager, scene, 3176, &R2_GLOBALS._player, &scene->_door, NULL); return true; + } break; case CURSOR_LOOK: - SceneItem::display(3175, 9, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); + SceneItem::display(3175, 9, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, LIST_END); return true; break; case CURSOR_TALK: - SceneItem::display(3175, 10, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); + SceneItem::display(3175, 10, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, LIST_END); return true; break; default: @@ -895,17 +901,17 @@ void Scene3175::postInit(SceneObjectList *OwnerList) { _door.setPosition(Common::Point(35, 72)); _door.setDetails(3175, 9, 10, -1, 1, (SceneItem *)NULL); - _actor2.postInit(); - _actor2.setup(3175, 2, 1); - _actor2.setPosition(Common::Point(87, 148)); + _computer.postInit(); + _computer.setup(3175, 2, 1); + _computer.setPosition(Common::Point(87, 148)); _corpse.postInit(); _corpse.setup(3175, 3, 1); _corpse.setPosition(Common::Point(199, 117)); _corpse.setDetails(3175, 15, 16, 17, 1, (SceneItem *)NULL); - _item2.setDetails(12, 3175, 3, 1, 5); - _item3.setDetails(11, 3175, 6, 7, 8); + _table.setDetails(12, 3175, 3, 1, 5); + _autopsies.setDetails(11, 3175, 6, 7, 8); _background.setDetails(Rect(0, 0, 320, 200), 3175, 0, 1, 2, 1, NULL); R2_GLOBALS._player.postInit(); @@ -948,11 +954,12 @@ void Scene3200::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.hide(); R2_GLOBALS._player.disableControl(); - _actor1.postInit(); - _actor3.postInit(); - _actor2.postInit(); + _rocko.postInit(); + _jocko.postInit(); + _socko.postInit(); - setAction(&_sequenceManager, this, 3200 + R2_GLOBALS._randomSource.getRandomNumber(1), &_actor1, &_actor2, &_actor3, NULL); + setAction(&_sequenceManager, this, 3200 + R2_GLOBALS._randomSource.getRandomNumber(1), + &_rocko, &_jocko, &_socko, NULL); } void Scene3200::signal() { @@ -976,10 +983,11 @@ void Scene3210::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.hide(); R2_GLOBALS._player.disableControl(); - _actor1.postInit(); - _actor2.postInit(); + _captain.postInit(); + _private.postInit(); - setAction(&_sequenceManager, this, 3210 + R2_GLOBALS._randomSource.getRandomNumber(1), &_actor1, &_actor2, NULL); + setAction(&_sequenceManager, this, 3210 + R2_GLOBALS._randomSource.getRandomNumber(1), + &_captain, &_private, NULL); } void Scene3210::signal() { @@ -1003,10 +1011,11 @@ void Scene3220::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.hide(); R2_GLOBALS._player.disableControl(); - _actor1.postInit(); - _actor2.postInit(); + _rocko.postInit(); + _jocko.postInit(); - setAction(&_sequenceManager, this, 3220 + R2_GLOBALS._randomSource.getRandomNumber(1), &_actor1, &_actor2, NULL); + setAction(&_sequenceManager, this, 3220 + R2_GLOBALS._randomSource.getRandomNumber(1), + &_rocko, &_jocko, NULL); } void Scene3220::signal() { @@ -1030,11 +1039,12 @@ void Scene3230::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.hide(); R2_GLOBALS._player.disableControl(); - _actor1.postInit(); - _actor2.postInit(); - _actor3.postInit(); + _rocko.postInit(); + _jocko.postInit(); + _ghoul.postInit(); - setAction(&_sequenceManager, this, 3230 + R2_GLOBALS._randomSource.getRandomNumber(1), &_actor1, &_actor2, &_actor3, NULL); + setAction(&_sequenceManager, this, 3230 + R2_GLOBALS._randomSource.getRandomNumber(1), + &_rocko, &_jocko, &_ghoul, NULL); } void Scene3230::signal() { @@ -1059,10 +1069,11 @@ void Scene3240::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.hide(); R2_GLOBALS._player.disableControl(); - _actor1.postInit(); - _actor2.postInit(); + _teal.postInit(); + _webbster.postInit(); - setAction(&_sequenceManager, this, 3240 + R2_GLOBALS._randomSource.getRandomNumber(1), &_actor1, &_actor2, NULL); + setAction(&_sequenceManager, this, 3240 + R2_GLOBALS._randomSource.getRandomNumber(1), + &_teal, &_webbster, NULL); } void Scene3240::signal() { @@ -1086,17 +1097,18 @@ void Scene3245::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.hide(); R2_GLOBALS._player.disableControl(); - _actor1.postInit(); - _actor2.postInit(); + _ralf.postInit(); + _tomko.postInit(); if (R2_GLOBALS._scientistConvIndex < 4) ++R2_GLOBALS._scientistConvIndex; if (R2_GLOBALS._scientistConvIndex >= 4) { - SceneItem::display(1200, 7, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1200, 7, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); signal(); } else { - setAction(&_sequenceManager, this, 3244 + R2_GLOBALS._scientistConvIndex, &_actor1, &_actor2, NULL); + setAction(&_sequenceManager, this, 3244 + R2_GLOBALS._scientistConvIndex, + &_ralf, &_tomko, NULL); } } @@ -1110,24 +1122,22 @@ void Scene3245::signal() { *--------------------------------------------------------------------------*/ bool Scene3250::Item::startAction(CursorType action, Event &event) { - Scene3250 *scene = (Scene3250 *)R2_GLOBALS._sceneManager._scene; - switch (action) { case CURSOR_USE: if (_useLineNum != -1) { - SceneItem::display(_resNum, _useLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); + SceneItem::display(_resNum, _useLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, LIST_END); return true; } break; case CURSOR_LOOK: if (_lookLineNum != -1) { - SceneItem::display(_resNum, _lookLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); + SceneItem::display(_resNum, _lookLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, LIST_END); return true; } break; case CURSOR_TALK: if (_talkLineNum != -1) { - SceneItem::display(_resNum, _talkLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); + SceneItem::display(_resNum, _talkLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, LIST_END); return true; } break; @@ -1135,15 +1145,15 @@ bool Scene3250::Item::startAction(CursorType action, Event &event) { break; } + Scene3250 *scene = (Scene3250 *)R2_GLOBALS._sceneManager._scene; return scene->display(action, event); } bool Scene3250::Door::startAction(CursorType action, Event &event) { - Scene3250 *scene = (Scene3250 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); + Scene3250 *scene = (Scene3250 *)R2_GLOBALS._sceneManager._scene; R2_GLOBALS._player.disableControl(); switch(_position.x) { @@ -1202,20 +1212,20 @@ void Scene3250::postInit(SceneObjectList *OwnerList) { switch (R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA]) { case 1200: _sceneMode = 3250; - _actor4.postInit(); - R2_GLOBALS._player._effect = 0; - setAction(&_sequenceManager, this, 3250, &R2_GLOBALS._player, &_actor4, NULL); + _grate.postInit(); + R2_GLOBALS._player._effect = EFFECT_NONE; + setAction(&_sequenceManager, this, 3250, &R2_GLOBALS._player, &_grate, NULL); break; case 3125: if (R2_GLOBALS.getFlag(79)) { _sceneMode = 3254; _ghoul1.postInit(); - _ghoul1._effect = 1; + _ghoul1._effect = EFFECT_SHADED; _ghoul2.postInit(); - _ghoul2._effect = 1; + _ghoul2._effect = EFFECT_SHADED; _ghoul3.postInit(); - _ghoul3._effect = 1; - setAction(&_sequenceManager, this, 3254, &R2_GLOBALS._player, &_rightDoor, + _ghoul3._effect = EFFECT_SHADED; + setAction(&_sequenceManager, this, 3254, &R2_GLOBALS._player, &_rightDoor, &_ghoul1, &_ghoul2, &_ghoul3, &_leftDoor, NULL); } else { _sceneMode = 3252; @@ -1244,7 +1254,7 @@ void Scene3250::postInit(SceneObjectList *OwnerList) { void Scene3250::signal() { switch(_sceneMode) { case 3250: - R2_GLOBALS._player._effect = 1; + R2_GLOBALS._player._effect = EFFECT_SHADED; R2_GLOBALS._player.enableControl(); break; case 3254: @@ -1265,8 +1275,8 @@ void Scene3250::signal() { } void Scene3250::dispatch() { - if ((R2_GLOBALS._player._visage == 3250) && (R2_GLOBALS._player._strip == 3) && (R2_GLOBALS._player._effect == 0)) { - R2_GLOBALS._player._effect = 6; + if ((R2_GLOBALS._player._visage == 3250) && (R2_GLOBALS._player._strip == 3) && (R2_GLOBALS._player._effect == EFFECT_NONE)) { + R2_GLOBALS._player._effect = EFFECT_SHADED2; R2_GLOBALS._player._shade = 6; } @@ -1295,10 +1305,10 @@ void Scene3255::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._sound1.play(267); R2_GLOBALS._sound2.play(268); _sceneMode = 3257; - _actor3.postInit(); + _door.postInit(); _quinn.postInit(); - _quinn._effect = 1; - setAction(&_sequenceManager, this, 3257, &R2_GLOBALS._player, &_quinn, &_actor3, NULL); + _quinn._effect = EFFECT_SHADED; + setAction(&_sequenceManager, this, 3257, &R2_GLOBALS._player, &_quinn, &_door, NULL); } else { _teal.postInit(); _teal.setup(303, 1, 1); @@ -1319,8 +1329,8 @@ void Scene3255::signal() { _ghoul1.postInit(); _ghoul2.postInit(); _ghoul3.postInit(); - setAction(&_sequenceManager, this, 3258, &R2_GLOBALS._player, &_quinn, - &_actor3, &_ghoul1, &_ghoul2, &_ghoul3, NULL); + setAction(&_sequenceManager, this, 3258, &R2_GLOBALS._player, &_quinn, + &_door, &_ghoul1, &_ghoul2, &_ghoul3, NULL); break; case 3256: R2_GLOBALS._sceneManager.changeScene(3250); @@ -1334,7 +1344,7 @@ void Scene3255::signal() { R2_GLOBALS._sceneManager.changeScene(3100); break; default: - SceneItem::display(3255, 0, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(3255, 0, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); _sceneMode = 3256; setAction(&_sequenceManager, this, 3256, &R2_GLOBALS._player, NULL); } @@ -1346,9 +1356,9 @@ void Scene3255::dispatch() { if (_ghoul1._position.y <= 110) _ghoul1._shade = 6 - (_ghoul1._position.y - 95) / 3; else - _ghoul1._effect = 1; + _ghoul1._effect = EFFECT_SHADED; } else { - _ghoul1._effect = 6; + _ghoul1._effect = EFFECT_SHADED2; _ghoul1._shade = 6; } @@ -1356,9 +1366,9 @@ void Scene3255::dispatch() { if (_ghoul2._position.y <= 110) _ghoul2._shade = 6 - (_ghoul2._position.y - 95) / 3; else - _ghoul2._effect = 1; + _ghoul2._effect = EFFECT_SHADED; } else { - _ghoul2._effect = 6; + _ghoul2._effect = EFFECT_SHADED2; _ghoul2._shade = 6; } @@ -1366,16 +1376,16 @@ void Scene3255::dispatch() { if (_ghoul3._position.y <= 110) _ghoul3._shade = 6 - (_ghoul3._position.y - 95) / 3; else - _ghoul3._effect = 1; + _ghoul3._effect = EFFECT_SHADED; } else { - _ghoul3._effect = 6; + _ghoul3._effect = EFFECT_SHADED2; _ghoul3._shade = 6; } } if ((R2_GLOBALS._player._position.x > 250) && (R2_GLOBALS._player._shade == 1)) { - R2_GLOBALS._player._effect = 6; - _quinn._effect = 6; + R2_GLOBALS._player._effect = EFFECT_SHADED2; + _quinn._effect = EFFECT_SHADED2; } Scene::dispatch(); } @@ -1386,11 +1396,11 @@ void Scene3255::dispatch() { *--------------------------------------------------------------------------*/ bool Scene3260::Door::startAction(CursorType action, Event &event) { - Scene3260 *scene = (Scene3260 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); + Scene3260 *scene = (Scene3260 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3271; scene->setAction(&scene->_sequenceManager, scene, 3271, &R2_GLOBALS._player, &scene->_door, NULL); @@ -1398,11 +1408,11 @@ bool Scene3260::Door::startAction(CursorType action, Event &event) { } bool Scene3260::Toolbox::startAction(CursorType action, Event &event) { - Scene3260 *scene = (Scene3260 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); + Scene3260 *scene = (Scene3260 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3272; scene->setAction(&scene->_sequenceManager, scene, 3272, &R2_GLOBALS._player, &scene->_toolbox, NULL); @@ -1470,23 +1480,23 @@ void Scene3260::postInit(SceneObjectList *OwnerList) { _screen6.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); _screen6.setAction(&_action6, &_screen6); - _actor7.postInit(); - _actor7.setup(3260, 2, 1); - _actor7.setPosition(Common::Point(190, 22)); - _actor7.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); - _actor7.setAction(&_action7, &_actor7); + _screen7.postInit(); + _screen7.setup(3260, 2, 1); + _screen7.setPosition(Common::Point(190, 22)); + _screen7.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); + _screen7.setAction(&_action7, &_screen7); - _actor8.postInit(); - _actor8.setup(3260, 2, 1); - _actor8.setPosition(Common::Point(142, 14)); - _actor8.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); - _actor8.setAction(&_action8, &_actor8); + _screen8.postInit(); + _screen8.setup(3260, 2, 1); + _screen8.setPosition(Common::Point(142, 14)); + _screen8.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); + _screen8.setAction(&_action8, &_screen8); - _actor9.postInit(); - _actor9.setup(3260, 2, 1); - _actor9.setPosition(Common::Point(166, 6)); - _actor9.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); - _actor9.setAction(&_action9, &_actor9); + _screen9.postInit(); + _screen9.setup(3260, 2, 1); + _screen9.setPosition(Common::Point(166, 6)); + _screen9.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); + _screen9.setAction(&_action9, &_screen9); _securityConsole.postInit(); _securityConsole.setup(3260, 3, 1); @@ -1513,7 +1523,7 @@ void Scene3260::postInit(SceneObjectList *OwnerList) { _lightingConsole.setDetails(3260, 9, 1, 11, 1, (SceneItem *)NULL); _lightingConsole.animate(ANIM_MODE_2, NULL); - _item1.setDetails(Rect(0, 0, 320, 200), 3260, 0, 1, 2, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 3260, 0, 1, 2, 1, NULL); R2_GLOBALS._player.postInit(); if (R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] == 3275) { @@ -1542,7 +1552,7 @@ void Scene3260::signal() { case 3272: _sceneMode = 3273; R2_GLOBALS._events.setCursor(CURSOR_WALK); - SceneItem::display(3260, 15, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); + SceneItem::display(3260, 15, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, LIST_END); R2_GLOBALS._player.disableControl(); R2_INVENTORY.setObjectScene(R2_TOOLBOX, 3); R2_INVENTORY.setObjectScene(R2_LASER_HACKSAW, 3); @@ -1564,11 +1574,11 @@ void Scene3260::signal() { *--------------------------------------------------------------------------*/ bool Scene3275::Door::startAction(CursorType action, Event &event) { - Scene3275 *scene = (Scene3275 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); + Scene3275 *scene = (Scene3275 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3275; scene->setAction(&scene->_sequenceManager, scene, 3275, &R2_GLOBALS._player, &scene->_door, NULL); @@ -1600,9 +1610,9 @@ void Scene3275::postInit(SceneObjectList *OwnerList) { _cellExit.setDetails(Rect(398, 60, 439, 118), SHADECURSOR_UP, 3150); _cellExit.setDest(Common::Point(418, 128)); - _actor1.postInit(); - _actor1.setup(3275, 1, 7); - _actor1.setPosition(Common::Point(419, 119)); + _doorFrame.postInit(); + _doorFrame.setup(3275, 1, 7); + _doorFrame.setPosition(Common::Point(419, 119)); _door.postInit(); _door.setup(3275, 2, 1); @@ -1661,8 +1671,8 @@ void Scene3275::signal() { void Scene3350::postInit(SceneObjectList *OwnerList) { loadScene(3350); - SceneExt::postInit(); R2_GLOBALS._uiElements._active = false; + SceneExt::postInit(); R2_GLOBALS._interfaceY = SCREEN_HEIGHT; R2_GLOBALS._sound2.play(310); @@ -1673,27 +1683,27 @@ void Scene3350::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.hide(); R2_GLOBALS._player.disableControl(); - _actor1.postInit(); - _actor1.hide(); - _actor2.postInit(); - _actor2.hide(); - _actor3.postInit(); - _actor3.hide(); - _actor4.postInit(); - _actor4.hide(); - _actor9.postInit(); - _actor9.hide(); - _actor8.postInit(); - _actor8.hide(); - _actor5.postInit(); - _actor5.hide(); - _actor6.postInit(); - _actor6.hide(); - _actor7.postInit(); - _actor7.hide(); + _miranda.postInit(); + _miranda.hide(); + _seeker.postInit(); + _seeker.hide(); + _webbster.postInit(); + _webbster.hide(); + _seatedPeople.postInit(); + _seatedPeople.hide(); + _shipFront.postInit(); + _shipFront.hide(); + _canopy.postInit(); + _canopy.hide(); + _ship.postInit(); + _ship.hide(); + _landedShip.postInit(); + _landedShip.hide(); + _shipShadow.postInit(); + _shipShadow.hide(); _sceneMode = 3350; - setAction(&_sequenceManager, this, _sceneMode, &_actor5, &_actor6, &_actor7, NULL); + setAction(&_sequenceManager, this, _sceneMode, &_ship, &_landedShip, &_shipShadow, NULL); } void Scene3350::remove() { @@ -1705,11 +1715,13 @@ void Scene3350::signal() { switch (_sceneMode) { case 3350: _sceneMode = 3351; - setAction(&_sequenceManager, this, 3351, &_actor4, &_actor9, &_actor8, NULL); + setAction(&_sequenceManager, this, 3351, &_seatedPeople, &_shipFront, &_canopy, NULL); break; case 3351: _sceneMode = 3352; - setAction(&_sequenceManager, this, 3352, &_actor4, &R2_GLOBALS._player, &_actor1, &_actor2, &_actor3, NULL); + setAction(&_sequenceManager, this, 3352, &_seatedPeople, &R2_GLOBALS._player, + &_miranda, &_seeker, &_webbster, NULL); + break; case 3352: R2_GLOBALS._sceneManager.changeScene(3395); break; @@ -1727,8 +1739,7 @@ void Scene3350::signal() { void Scene3375::synchronize(Serializer &s) { SceneExt::synchronize(s); - s.syncAsSint16LE(_field1488); - s.syncAsSint16LE(_field1492); + s.syncAsSint16LE(_newSceneMode); for (int i = 0; i < 4; ++i) s.syncAsSint16LE(_sceneAreas[i]); } @@ -1753,11 +1764,11 @@ void Scene3375::enterArea(int sceneMode) { R2_GLOBALS._player.setPosition(Common::Point(148, 230)); _companion1.setPosition(Common::Point(191, 274)); - _companion1._effect = 1; + _companion1._effect = EFFECT_SHADED; _companion2.setPosition(Common::Point(124, 255)); - _companion2._effect = 1; + _companion2._effect = EFFECT_SHADED; _webbster.setPosition(Common::Point(155, 245)); - _webbster._effect = 1; + _webbster._effect = EFFECT_SHADED; break; case 3381: --R2_GLOBALS._walkwaySceneNumber; @@ -1771,11 +1782,11 @@ void Scene3375::enterArea(int sceneMode) { R2_GLOBALS._player.setPosition(Common::Point(201, 131)); _companion1.setPosition(Common::Point(231, 127)); - _companion1._effect = 1; + _companion1._effect = EFFECT_SHADED; _companion2.setPosition(Common::Point(231, 127)); - _companion2._effect = 1; + _companion2._effect = EFFECT_SHADED; _webbster.setPosition(Common::Point(231, 127)); - _webbster._effect = 1; + _webbster._effect = EFFECT_SHADED; break; default: R2_GLOBALS._player.setPosition(Common::Point(192, 155)); @@ -1811,11 +1822,11 @@ void Scene3375::enterArea(int sceneMode) { } bool Scene3375::Companion2::startAction(CursorType action, Event &event) { - Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_TALK) return SceneActor::startAction(action, event); + Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; + scene->_sceneMode = 9999; if (R2_GLOBALS._player._characterIndex == R2_SEEKER) scene->_stripManager.start(3302, scene); @@ -1826,11 +1837,11 @@ bool Scene3375::Companion2::startAction(CursorType action, Event &event) { } bool Scene3375::Companion1::startAction(CursorType action, Event &event) { - Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_TALK) return SceneActor::startAction(action, event); + Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; + scene->_sceneMode = 9999; if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) scene->_stripManager.start(3302, scene); @@ -1841,11 +1852,11 @@ bool Scene3375::Companion1::startAction(CursorType action, Event &event) { } bool Scene3375::Webbster::startAction(CursorType action, Event &event) { - Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_TALK) return SceneActor::startAction(action, event); + Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; + scene->_sceneMode = 9999; scene->_stripManager.start(3303, scene); @@ -1853,8 +1864,6 @@ bool Scene3375::Webbster::startAction(CursorType action, Event &event) { } bool Scene3375::Door::startAction(CursorType action, Event &event) { - Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); @@ -1872,8 +1881,10 @@ bool Scene3375::Door::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(CURSOR_ARROW); + Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; + scene->_sceneMode = 3375; - scene->setAction(&scene->_sequenceManager, scene, 3375, &R2_GLOBALS._player, + scene->setAction(&scene->_sequenceManager, scene, 3375, &R2_GLOBALS._player, &scene->_companion1, &scene->_companion2, &scene->_webbster, &scene->_door, NULL); return true; @@ -1916,12 +1927,12 @@ void Scene3375::DownExit::changeScene() { Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; _moving = false; - R2_GLOBALS._player._effect = 6; + R2_GLOBALS._player._effect = EFFECT_SHADED2; R2_GLOBALS._player._shade = 4; R2_GLOBALS._player.disableControl(CURSOR_ARROW); scene->_sceneMode = 3377; - scene->_field1488 = 3381; + scene->_newSceneMode = 3381; if (R2_GLOBALS._walkwaySceneNumber != 0) { R2_GLOBALS._walkRegions.enableRegion(2); @@ -1938,12 +1949,12 @@ void Scene3375::RightExit::changeScene() { Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; _moving = false; - R2_GLOBALS._player._effect = 6; + R2_GLOBALS._player._effect = EFFECT_SHADED2; R2_GLOBALS._player._shade = 4; R2_GLOBALS._player.disableControl(CURSOR_ARROW); scene->_sceneMode = 3378; - scene->_field1488 = 3380; + scene->_newSceneMode = 3380; if (R2_GLOBALS._walkwaySceneNumber != 0) { R2_GLOBALS._walkRegions.enableRegion(2); @@ -1957,7 +1968,7 @@ void Scene3375::RightExit::changeScene() { } Scene3375::Scene3375() { - _field1488 = _field1492 = 0; + _newSceneMode = 0; _sceneAreas[0] = 3376; _sceneAreas[1] = 3377; @@ -1985,11 +1996,11 @@ void Scene3375::postInit(SceneObjectList *OwnerList) { setZoomPercents(126, 55, 200, 167); R2_GLOBALS._player.postInit(); - if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) R2_GLOBALS._player._moveDiff = Common::Point(5, 3); - } else { + else R2_GLOBALS._player._moveDiff = Common::Point(3, 2); - } + R2_GLOBALS._player.changeZoom(-1); switch (R2_GLOBALS._player._characterIndex) { @@ -2025,7 +2036,7 @@ void Scene3375::postInit(SceneObjectList *OwnerList) { _companion1._moveDiff = Common::Point(5, 3); } _companion1.changeZoom(-1); - _companion1._effect = 1; + _companion1._effect = EFFECT_SHADED; int tmpStrip, tmpVisage; if (R2_GLOBALS._sceneManager._previousScene == 3385) @@ -2044,7 +2055,7 @@ void Scene3375::postInit(SceneObjectList *OwnerList) { _companion2.postInit(); _companion2._moveDiff = Common::Point(3, 2); _companion2.changeZoom(-1); - _companion2._effect = 1; + _companion2._effect = EFFECT_SHADED; if (R2_GLOBALS._sceneManager._previousScene == 3385) tmpStrip = 1; else @@ -2062,7 +2073,7 @@ void Scene3375::postInit(SceneObjectList *OwnerList) { _webbster._moveRate = 7; _webbster._moveDiff = Common::Point(5, 3); _webbster.changeZoom(-1); - _webbster._effect = 1; + _webbster._effect = EFFECT_SHADED; if (R2_GLOBALS._sceneManager._previousScene == 3385) tmpStrip = 1; else @@ -2117,10 +2128,10 @@ void Scene3375::signalCase3379() { _sceneMode = 1; ADD_MOVER(R2_GLOBALS._player, 70, R2_GLOBALS._player._position.y); R2_GLOBALS._sceneManager._previousScene = 3375; - R2_GLOBALS._player._effect = 1; - _companion1._effect = 1; - _companion2._effect = 1; - _webbster._effect = 1; + R2_GLOBALS._player._effect = EFFECT_SHADED; + _companion1._effect = EFFECT_SHADED; + _companion2._effect = EFFECT_SHADED; + _webbster._effect = EFFECT_SHADED; return; //R2_GLOBALS._walkRegions.disableRegion(1); @@ -2150,10 +2161,10 @@ void Scene3375::signalCase3379() { break; } R2_GLOBALS._sceneManager._previousScene = 3375; - R2_GLOBALS._player._effect = 1; - _companion1._effect = 1; - _companion2._effect = 1; - _webbster._effect = 1; + R2_GLOBALS._player._effect = EFFECT_SHADED; + _companion1._effect = EFFECT_SHADED; + _companion2._effect = EFFECT_SHADED; + _webbster._effect = EFFECT_SHADED; R2_GLOBALS._player.enableControl(CURSOR_WALK); } @@ -2171,14 +2182,23 @@ void Scene3375::signal() { case 3377: // No break on purpose case 3378: - _sceneMode = _field1488; - _field1488 = 0; - _companion1._effect = 6; + _sceneMode = _newSceneMode; + _newSceneMode = 0; + + _companion1._effect = EFFECT_SHADED2; _companion1._shade = 4; - _companion2._effect = 6; + _companion2._effect = EFFECT_SHADED2; _companion2._shade = 4; - _webbster._effect = 6; + _webbster._effect = EFFECT_SHADED2; _webbster._shade = 4; + + // HACK: Reset zooms in order to avoid giant characters on the upper right of the screen + R2_GLOBALS._player.setZoom(-1); + _companion1.setZoom(-1); + _companion2.setZoom(-1); + _webbster.setZoom(-1); + // + enterArea(_sceneMode); break; case 3379: @@ -2190,6 +2210,7 @@ void Scene3375::signal() { else R2_GLOBALS._player.setStrip(3); R2_GLOBALS._player.enableControl(CURSOR_TALK); + break; default: _companion1.setPriority(130); _companion2.setPriority(132); @@ -2200,25 +2221,25 @@ void Scene3375::signal() { } void Scene3375::dispatch() { - if ((R2_GLOBALS._player._position.y >= 168) && (R2_GLOBALS._player._effect == 1)) - R2_GLOBALS._player._effect = 6; - else if ((R2_GLOBALS._player._position.y < 168) && (R2_GLOBALS._player._effect == 6)) - R2_GLOBALS._player._effect = 1; - - if ((_companion1._position.y >= 168) && (_companion1._effect == 1)) - _companion1._effect = 6; - else if ((_companion1._position.y < 168) && (_companion1._effect == 6)) - _companion1._effect = 1; - - if ((_companion2._position.y >= 168) && (_companion2._effect == 1)) - _companion2._effect = 6; - else if ((_companion2._position.y < 168) && (_companion2._effect == 6)) - _companion2._effect = 1; - - if ((_webbster._position.y >= 168) && (_webbster._effect == 1)) - _webbster._effect = 6; - else if ((_webbster._position.y < 168) && (_webbster._effect == 6)) - _webbster._effect = 1; + if ((R2_GLOBALS._player._position.y >= 168) && (R2_GLOBALS._player._effect == EFFECT_SHADED)) + R2_GLOBALS._player._effect = EFFECT_SHADED2; + else if ((R2_GLOBALS._player._position.y < 168) && (R2_GLOBALS._player._effect == EFFECT_SHADED2)) + R2_GLOBALS._player._effect = EFFECT_SHADED; + + if ((_companion1._position.y >= 168) && (_companion1._effect == EFFECT_SHADED)) + _companion1._effect = EFFECT_SHADED2; + else if ((_companion1._position.y < 168) && (_companion1._effect == EFFECT_SHADED2)) + _companion1._effect = EFFECT_SHADED; + + if ((_companion2._position.y >= 168) && (_companion2._effect == EFFECT_SHADED)) + _companion2._effect = EFFECT_SHADED2; + else if ((_companion2._position.y < 168) && (_companion2._effect == EFFECT_SHADED2)) + _companion2._effect = EFFECT_SHADED; + + if ((_webbster._position.y >= 168) && (_webbster._effect == EFFECT_SHADED)) + _webbster._effect = EFFECT_SHADED2; + else if ((_webbster._position.y < 168) && (_webbster._effect == EFFECT_SHADED2)) + _webbster._effect = EFFECT_SHADED; Scene::dispatch(); } @@ -2229,21 +2250,21 @@ void Scene3375::dispatch() { *--------------------------------------------------------------------------*/ Scene3385::Scene3385() { - _field11B2 = 0; + _playerStrip = 0; } void Scene3385::synchronize(Serializer &s) { SceneExt::synchronize(s); - s.syncAsSint16LE(_field11B2); + s.syncAsSint16LE(_playerStrip); } bool Scene3385::Companion1::startAction(CursorType action, Event &event) { - Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_TALK) return SceneActor::startAction(action, event); + Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; + scene->_sceneMode = 9999; if (R2_GLOBALS._player._characterIndex == R2_SEEKER) scene->_stripManager.start(3302, scene); @@ -2254,11 +2275,11 @@ bool Scene3385::Companion1::startAction(CursorType action, Event &event) { } bool Scene3385::Companion2::startAction(CursorType action, Event &event) { - Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_TALK) return SceneActor::startAction(action, event); + Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; + scene->_sceneMode = 9999; if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) scene->_stripManager.start(3302, scene); @@ -2269,11 +2290,11 @@ bool Scene3385::Companion2::startAction(CursorType action, Event &event) { } bool Scene3385::Webbster::startAction(CursorType action, Event &event) { - Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_TALK) return SceneActor::startAction(action, event); + Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; + scene->_sceneMode = 9999; scene->_stripManager.start(3303, scene); @@ -2281,8 +2302,6 @@ bool Scene3385::Webbster::startAction(CursorType action, Event &event) { } bool Scene3385::Door::startAction(CursorType action, Event &event) { - Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); @@ -2290,23 +2309,25 @@ bool Scene3385::Door::startAction(CursorType action, Event &event) { if (R2_GLOBALS._sceneManager._previousScene == 3375) R2_GLOBALS._sound2.play(314); + Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; + scene->_sceneMode = 3386; - scene->setAction(&scene->_sequenceManager, scene, 3386, &R2_GLOBALS._player, - &scene->_companion1, &scene->_companion2, &scene->_webbster, &scene->_door, + scene->setAction(&scene->_sequenceManager, scene, 3386, &R2_GLOBALS._player, + &scene->_companion1, &scene->_companion2, &scene->_webbster, &scene->_door, NULL); return true; } -void Scene3385::Exit1::changeScene() { +void Scene3385::SouthExit::changeScene() { Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; R2_GLOBALS._player.disableControl(CURSOR_ARROW); scene->_sceneMode = 3387; if (R2_GLOBALS._sceneManager._previousScene == 3375) - scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, - &R2_GLOBALS._player, &scene->_companion1, &scene->_companion2, + scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, + &R2_GLOBALS._player, &scene->_companion1, &scene->_companion2, &scene->_webbster, NULL); else scene->signal(); @@ -2340,9 +2361,9 @@ void Scene3385::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._characterScene[R2_MIRANDA] = 3385; if (R2_GLOBALS._sceneManager._previousScene == 3375) - _field11B2 = 3; + _playerStrip = 3; else - _field11B2 = 4; + _playerStrip = 4; setZoomPercents(102, 40, 200, 160); R2_GLOBALS._player.postInit(); @@ -2355,11 +2376,11 @@ void Scene3385::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.changeZoom(-1); if (R2_GLOBALS._player._characterIndex == R2_SEEKER) - R2_GLOBALS._player.setup(20, _field11B2, 1); + R2_GLOBALS._player.setup(20, _playerStrip, 1); else if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) - R2_GLOBALS._player.setup(30, _field11B2, 1); + R2_GLOBALS._player.setup(30, _playerStrip, 1); else - R2_GLOBALS._player.setup(10, _field11B2, 1); + R2_GLOBALS._player.setup(10, _playerStrip, 1); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); R2_GLOBALS._player.disableControl(); @@ -2373,35 +2394,35 @@ void Scene3385::postInit(SceneObjectList *OwnerList) { _companion1._moveDiff = Common::Point(5, 3); } _companion1.changeZoom(-1); - _companion1._effect = 1; + _companion1._effect = EFFECT_SHADED; if (R2_GLOBALS._player._characterIndex == R2_SEEKER) - _companion1.setup(10, _field11B2, 1); + _companion1.setup(10, _playerStrip, 1); else - _companion1.setup(20, _field11B2, 1); + _companion1.setup(20, _playerStrip, 1); _companion1.animate(ANIM_MODE_1, NULL); _companion1.setDetails(3385, -1, -1, -1, 1, (SceneItem *) NULL); _companion2.postInit(); _companion2._moveDiff = Common::Point(3, 2); _companion2.changeZoom(-1); - _companion2._effect = 1; + _companion2._effect = EFFECT_SHADED; if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) - _companion2.setup(10, _field11B2, 1); + _companion2.setup(10, _playerStrip, 1); else - _companion2.setup(30, _field11B2, 1); + _companion2.setup(30, _playerStrip, 1); _companion2.animate(ANIM_MODE_1, NULL); _companion2.setDetails(3385, -1, -1, -1, 1, (SceneItem *) NULL); _webbster.postInit(); _webbster._moveDiff = Common::Point(3, 2); _webbster.changeZoom(-1); - _webbster._effect = 1; - _webbster.setup(40, _field11B2, 1); + _webbster._effect = EFFECT_SHADED; + _webbster.setup(40, _playerStrip, 1); _webbster.animate(ANIM_MODE_1, NULL); _webbster.setDetails(3385, 15, -1, -1, 1, (SceneItem *) NULL); - _exit1.setDetails(Rect(103, 152, 217, 170), SHADECURSOR_DOWN, 3395); - _exit1.setDest(Common::Point(158, 151)); + _southExit.setDetails(Rect(103, 152, 217, 170), SHADECURSOR_DOWN, 3395); + _southExit.setDest(Common::Point(158, 151)); _door.postInit(); _door.setPosition(Common::Point(160, 100)); @@ -2466,21 +2487,21 @@ void Scene3385::signal() { *--------------------------------------------------------------------------*/ Scene3395::Scene3395() { - _field142E = 0; + _playerStrip = 0; } void Scene3395::synchronize(Serializer &s) { SceneExt::synchronize(s); - s.syncAsSint16LE(_field142E); + s.syncAsSint16LE(_playerStrip); } bool Scene3395::Companion1::startAction(CursorType action, Event &event) { - Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_TALK) return SceneActor::startAction(action, event); + Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; + scene->_sceneMode = 9999; if (R2_GLOBALS._player._characterIndex == R2_SEEKER) scene->_stripManager.start(3302, scene); @@ -2491,11 +2512,11 @@ bool Scene3395::Companion1::startAction(CursorType action, Event &event) { } bool Scene3395::Companion2::startAction(CursorType action, Event &event) { - Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_TALK) return SceneActor::startAction(action, event); + Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; + scene->_sceneMode = 9999; if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) scene->_stripManager.start(3302, scene); @@ -2506,11 +2527,11 @@ bool Scene3395::Companion2::startAction(CursorType action, Event &event) { } bool Scene3395::Webbster::startAction(CursorType action, Event &event) { - Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_TALK) return SceneActor::startAction(action, event); + Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; + scene->_sceneMode = 9999; scene->_stripManager.start(3303, scene); @@ -2518,8 +2539,6 @@ bool Scene3395::Webbster::startAction(CursorType action, Event &event) { } bool Scene3395::Door::startAction(CursorType action, Event &event) { - Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); @@ -2527,9 +2546,11 @@ bool Scene3395::Door::startAction(CursorType action, Event &event) { if (R2_GLOBALS._sceneManager._previousScene == 3385) R2_GLOBALS._sound2.play(314); + Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; + scene->_sceneMode = 3396; - scene->setAction(&scene->_sequenceManager, scene, 3396, &R2_GLOBALS._player, - &scene->_companion1, &scene->_companion2, &scene->_webbster, &scene->_door, + scene->setAction(&scene->_sequenceManager, scene, 3396, &R2_GLOBALS._player, + &scene->_companion1, &scene->_companion2, &scene->_webbster, &scene->_door, NULL); return true; @@ -2563,9 +2584,9 @@ void Scene3395::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._characterScene[R2_MIRANDA] = 3395; if (R2_GLOBALS._sceneManager._previousScene == 3385) - _field142E = 3; + _playerStrip = 3; else - _field142E = 4; + _playerStrip = 4; setZoomPercents(51, 40, 200, 137); R2_GLOBALS._player.postInit(); @@ -2578,11 +2599,11 @@ void Scene3395::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.changeZoom(-1); if (R2_GLOBALS._player._characterIndex == R2_SEEKER) - R2_GLOBALS._player.setup(20, _field142E, 1); + R2_GLOBALS._player.setup(20, _playerStrip, 1); else if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) - R2_GLOBALS._player.setup(30, _field142E, 1); + R2_GLOBALS._player.setup(30, _playerStrip, 1); else - R2_GLOBALS._player.setup(10, _field142E, 1); + R2_GLOBALS._player.setup(10, _playerStrip, 1); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); R2_GLOBALS._player.disableControl(); @@ -2596,30 +2617,30 @@ void Scene3395::postInit(SceneObjectList *OwnerList) { _companion1._moveDiff = Common::Point(5, 3); } _companion1.changeZoom(-1); - _companion1._effect = 1; + _companion1._effect = EFFECT_SHADED; if (R2_GLOBALS._player._characterIndex == R2_SEEKER) - _companion1.setup(10, _field142E, 1); + _companion1.setup(10, _playerStrip, 1); else - _companion1.setup(20, _field142E, 1); + _companion1.setup(20, _playerStrip, 1); _companion1.animate(ANIM_MODE_1, NULL); _companion1.setDetails(3395, -1, -1, -1, 1, (SceneItem *) NULL); _companion2.postInit(); _companion2._moveDiff = Common::Point(3, 2); _companion2.changeZoom(-1); - _companion2._effect = 1; + _companion2._effect = EFFECT_SHADED; if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) - _companion2.setup(10, _field142E, 1); + _companion2.setup(10, _playerStrip, 1); else - _companion2.setup(30, _field142E, 1); + _companion2.setup(30, _playerStrip, 1); _companion2.animate(ANIM_MODE_1, NULL); _companion2.setDetails(3395, -1, -1, -1, 1, (SceneItem *) NULL); _webbster.postInit(); _webbster._moveDiff = Common::Point(3, 2); _webbster.changeZoom(-1); - _webbster._effect = 1; - _webbster.setup(40, _field142E, 1); + _webbster._effect = EFFECT_SHADED; + _webbster.setup(40, _playerStrip, 1); _webbster.animate(ANIM_MODE_1, NULL); _webbster.setDetails(3395, 18, -1, -1, 1, (SceneItem *) NULL); @@ -2689,13 +2710,13 @@ void Scene3395::signal() { *--------------------------------------------------------------------------*/ Scene3400::Scene3400() { - _field157C = 0; + _soundFaded = false; } void Scene3400::synchronize(Serializer &s) { SceneExt::synchronize(s); - s.syncAsSint16LE(_field157C); + s.syncAsSint16LE(_soundFaded); } void Scene3400::postInit(SceneObjectList *OwnerList) { @@ -2703,8 +2724,7 @@ void Scene3400::postInit(SceneObjectList *OwnerList) { _sceneBounds = Rect(160, 0, 480, 200); loadScene(3400); - _field157C = 0; - R2_GLOBALS._v558B6.set(60, 0, 260, 200); + _soundFaded = false; SceneExt::postInit(); R2_GLOBALS._sound1.play(317); @@ -2721,10 +2741,10 @@ void Scene3400::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._characterScene[R2_SEEKER] = 3400; R2_GLOBALS._player._characterScene[R2_MIRANDA] = 3400; - _actor7.postInit(); - _actor7.setup(3403, 1, 1); - _actor7.setPosition(Common::Point(190, 103)); - _actor7.fixPriority(89); + _manholeCover.postInit(); + _manholeCover.setup(3403, 1, 1); + _manholeCover.setPosition(Common::Point(190, 103)); + _manholeCover.fixPriority(89); R2_GLOBALS._player.postInit(); if (R2_GLOBALS._player._characterIndex == R2_SEEKER) @@ -2753,7 +2773,7 @@ void Scene3400::postInit(SceneObjectList *OwnerList) { _companion1._moveDiff = Common::Point(5, 3); } _companion1.changeZoom(-1); - _companion1._effect = 1; + _companion1._effect = EFFECT_SHADED; _companion1.setPosition(Common::Point(247, 63)); if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _companion1.setup(10, 5, 1); @@ -2764,7 +2784,7 @@ void Scene3400::postInit(SceneObjectList *OwnerList) { _companion2.postInit(); _companion2._moveDiff = Common::Point(3, 2); _companion2.changeZoom(-1); - _companion2._effect = 1; + _companion2._effect = EFFECT_SHADED; _companion2.setPosition(Common::Point(225, 63)); if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) _companion2.setup(10, 5, 1); @@ -2776,16 +2796,16 @@ void Scene3400::postInit(SceneObjectList *OwnerList) { _webbster._numFrames = 7; _webbster._moveDiff = Common::Point(5, 3); _webbster.changeZoom(-1); - _webbster._effect = 1; + _webbster._effect = EFFECT_SHADED; _webbster.setPosition(Common::Point(235, 61)); _webbster.setup(40, 3, 1); _webbster.animate(ANIM_MODE_1, NULL); - _actor6.postInit(); - _actor6.setup(3400, 1, 6); - _actor6.setPosition(Common::Point(236, 51)); - _actor6.fixPriority(51); - _actor6.animate(ANIM_MODE_6, NULL); + _door.postInit(); + _door.setup(3400, 1, 6); + _door.setPosition(Common::Point(236, 51)); + _door.fixPriority(51); + _door.animate(ANIM_MODE_6, NULL); R2_GLOBALS.clearFlag(71); _sceneMode = 3400; @@ -2801,7 +2821,7 @@ void Scene3400::remove() { void Scene3400::signal() { switch (_sceneMode) { case 3305: { - warning("STUB: sub_1D227()"); + // First part of discussion _tealSpeaker._object1.hide(); _teal.show(); _teal.setStrip(1); @@ -2813,6 +2833,7 @@ void Scene3400::signal() { } break; case 3306: + // Teal picks up the sapphire R2_GLOBALS._sound2.play(318); _companion1.setStrip(2); R2_GLOBALS._player.setStrip(6); @@ -2823,25 +2844,26 @@ void Scene3400::signal() { _stripManager.start(3307, this); if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { _sceneMode = 3400; - R2_GLOBALS._player.setAction(&_sequenceManager, this, 3400, &R2_GLOBALS._player, &_teal, &_actor8, NULL); + R2_GLOBALS._player.setAction(&_sequenceManager, this, 3400, &R2_GLOBALS._player, &_teal, &_sapphire, NULL); } else { _sceneMode = 3408; - _companion1.setAction(&_sequenceManager, this, 3408, &_companion1, &_teal, &_actor8, NULL); + _companion1.setAction(&_sequenceManager, this, 3408, &_companion1, &_teal, &_sapphire, NULL); } break; case 3307: case 3404: case 3408: - if (_field157C == 0) { + // A tasp! + if (!_soundFaded) { R2_GLOBALS._sound2.fadeOut2(NULL); - _field157C = 1; + _soundFaded = true; } else { _sceneMode = 3308; _stripManager.start(3308, this); } break; case 3308: - warning("STUB: sub_1D227()"); + // Characters teleport one after the other _companion1.setStrip(2); R2_GLOBALS._player.setStrip(6); _companion2.setStrip(6); @@ -2849,46 +2871,47 @@ void Scene3400::signal() { _teal.setStrip(1); _sceneMode = 3403; if (R2_GLOBALS._player._characterIndex == R2_SEEKER) - setAction(&_sequenceManager, this, 3403, &R2_GLOBALS._player, &_webbster, &_actor7, NULL); + setAction(&_sequenceManager, this, 3403, &R2_GLOBALS._player, &_webbster, &_manholeCover, NULL); else - setAction(&_sequenceManager, this, 3403, &_companion1, &_webbster, &_actor7, NULL); + setAction(&_sequenceManager, this, 3403, &_companion1, &_webbster, &_manholeCover, NULL); break; case 3309: - warning("STUB: sub_1D227()"); + // Miranda teleports away _teal.setStrip(1); _sceneMode = 3405; if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) - setAction(&_sequenceManager, this, 3405, &R2_GLOBALS._player, &_actor7, NULL); + setAction(&_sequenceManager, this, 3405, &R2_GLOBALS._player, &_manholeCover, NULL); else - setAction(&_sequenceManager, this, 3405, &_companion2, &_actor7, NULL); + setAction(&_sequenceManager, this, 3405, &_companion2, &_manholeCover, NULL); break; case 3310: - warning("STUB: sub_1D227()"); + // Quinn teleports away _teal.setStrip(1); _sceneMode = 3406; if (R2_GLOBALS._player._characterIndex == R2_QUINN) - setAction(&_sequenceManager, this, 3406, &R2_GLOBALS._player, &_actor7, NULL); + setAction(&_sequenceManager, this, 3406, &R2_GLOBALS._player, &_manholeCover, NULL); else if (R2_GLOBALS._player._characterIndex == R2_SEEKER) - setAction(&_sequenceManager, this, 3406, &_companion1, &_actor7, NULL); + setAction(&_sequenceManager, this, 3406, &_companion1, &_manholeCover, NULL); else if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) - setAction(&_sequenceManager, this, 3406, &_companion2, &_actor7, NULL); + setAction(&_sequenceManager, this, 3406, &_companion2, &_manholeCover, NULL); break; case 3311: - warning("STUB: sub_1D227()"); + // Teal teleports away _tealSpeaker._object1.hide(); _teal.show(); _teal.setStrip(1); _sceneMode = 3407; - setAction(&_sequenceManager, this, 3407, &_teal, &_actor7, NULL); + setAction(&_sequenceManager, this, 3407, &_teal, &_manholeCover, NULL); break; case 3400: { - _actor8.postInit(); - _actor8.hide(); + // Teal enters the room + _sapphire.postInit(); + _sapphire.hide(); _teal.postInit(); _teal._numFrames = 7; _teal._moveDiff = Common::Point(3, 2); _teal.changeZoom(-1); - _teal._effect = 1; + _teal._effect = EFFECT_SHADED; _teal.setPosition(Common::Point(-15, 90)); _teal.setup(3402, 1, 1); _teal.animate(ANIM_MODE_1, NULL); @@ -2903,123 +2926,133 @@ void Scene3400::signal() { } break; case 3401: + // Teal first speech _sceneMode = 3305; _stripManager.start(3305, this); break; case 3402: + // Betrayal of Webbster _sceneMode = 3306; _stripManager.start(3306, this); break; case 3403: + // Teal: "Miranda..." R2_GLOBALS._scrollFollower = &R2_GLOBALS._player; _sceneMode = 3309; _stripManager.start(3309, this); break; case 3405: + // Teal: "And Quinn..." _sceneMode = 3310; _stripManager.start(3310, this); break; case 3406: + // Teal final sentence before teleporting _sceneMode = 3311; _stripManager.start(3311, this); break; case 3407: + // End of scene R2_GLOBALS._sceneManager.changeScene(3600); break; default: + // Unexpected scene mode R2_GLOBALS._player.enableControl(); break; } } /*-------------------------------------------------------------------------- - * Scene 3500 - Cavern Maze + * Scene 3500 - Flub tube maze * *--------------------------------------------------------------------------*/ Scene3500::Action1::Action1() { - _field1E = 0; - _field20 = 0; - _field22 = 0; - _field24 = 0; + _direction = 0; + _headingRightFl = false; + _turningFl = false; } void Scene3500::Action1::synchronize(Serializer &s) { Action::synchronize(s); - s.syncAsSint16LE(_field1E); - s.syncAsSint16LE(_field20); - s.syncAsSint16LE(_field22); - s.syncAsSint16LE(_field24); + s.syncAsSint16LE(_direction); + s.syncAsSint16LE(_headingRightFl); + if (s.getVersion() < 13) { + int useless = 0; + s.syncAsSint32LE(useless); + } + s.syncAsSint16LE(_turningFl); } -void Scene3500::Action1::sub108670(int arg1) { +void Scene3500::Action1::handleHorzButton(int direction) { Scene3500 *scene = (Scene3500 *)R2_GLOBALS._sceneManager._scene; - _field1E = arg1; - _field20 = 1; - _field24 = 1; + // Direction: -1 == Left, 1 == Right + _direction = direction; + _headingRightFl = true; + _turningFl = true; - scene->_actor9.setStrip(2); - scene->_actor9.show(); + scene->_tunnelHorzCircle.setStrip(2); + scene->_tunnelHorzCircle.show(); - if (_field1E == 1) - scene->_actor6.show(); + if (_direction == 1) + scene->_symbolRight.show(); else - scene->_actor5.show(); + scene->_symbolLeft.show(); - if (scene->_actor1._frame % 2 == 0) { - scene->_actor1._frameChange = _field1E; - scene->_actor1.setFrame(scene->_actor1.changeFrame()); + if (scene->_shuttle._frame % 2 == 0) { + scene->_shuttle._frameChange = _direction; + scene->_shuttle.setFrame(scene->_shuttle.changeFrame()); } setActionIndex(0); } -void Scene3500::Action1::sub108732(int arg1) { +void Scene3500::Action1::turnShuttle(bool arg1) { Scene3500 *scene = (Scene3500 *)R2_GLOBALS._sceneManager._scene; - _field20 = arg1; - _field1E = -_field1E; + _headingRightFl = arg1; + _direction = -_direction; - if (_field1E == 1) { - scene->_actor6.show(); - scene->_actor5.hide(); + if (_direction == 1) { + scene->_symbolRight.show(); + scene->_symbolLeft.hide(); } else { - scene->_actor5.show(); - scene->_actor6.hide(); + scene->_symbolLeft.show(); + scene->_symbolRight.hide(); } switch (_actionIndex) { case 4: - scene->_actor1._frameChange = _field1E; - scene->_actor1.setFrame(scene->_actor1.changeFrame()); + scene->_shuttle._frameChange = _direction; + scene->_shuttle.setFrame(scene->_shuttle.changeFrame()); // No break on purpose case 3: _actionIndex = 10; setDelay(0); break; case 5: { - scene->_fieldAF8 = 160; + scene->_moverVertX = 160; Common::Point pt(160, 73); NpcMover *mover = new NpcMover(); - scene->_actor8.addMover(mover, &pt, NULL); + scene->_tunnelVertCircle.addMover(mover, &pt, NULL); - scene->_fieldB9E = 160 - (_field1E * 2 * 160); - Common::Point pt2(scene->_fieldB9E, 73); + scene->_moverHorzX = 160 - (_direction * 2 * 160); + Common::Point pt2(scene->_moverHorzX, 73); NpcMover *mover2 = new NpcMover(); - scene->_actor9.addMover(mover2, &pt2, this); + scene->_tunnelHorzCircle.addMover(mover2, &pt2, this); _actionIndex = 11; } break; case 6: - scene->_actor1._frameChange = _field1E; - scene->_actor1.setFrame(scene->_actor1.changeFrame()); + scene->_shuttle._frameChange = _direction; + scene->_shuttle.setFrame(scene->_shuttle.changeFrame()); setDelay(1); // No break on purpose case 8: - scene->_actor9.setStrip(2); + scene->_tunnelHorzCircle.setStrip(2); _actionIndex = 1; break; default: @@ -3033,156 +3066,155 @@ void Scene3500::Action1::signal() { switch(_actionIndex++) { case 0: R2_GLOBALS._player.disableControl(); - scene->_field1286 = 0; - if (scene->_field1270 != 0) { - scene->_field1270 = 0; + scene->_directionChangesEnabled = false; + if (scene->_speed != 0) { + scene->_speed = 0; scene->_mazeChangeAmount = 0; - scene->_field1272 = 0; + scene->_updateIdxChangeFl = false; scene->_rotation->_idxChange = 0; } break; case 1: - if ((scene->_actor1._frame % 2) == 1) { + if ((scene->_shuttle._frame % 2) == 1) { setDelay(1); return; } // No break on purpose case 3: - scene->_actor1._frameChange = _field1E; - scene->_actor1.setFrame(scene->_actor1.changeFrame()); + scene->_shuttle._frameChange = _direction; + scene->_shuttle.setFrame(scene->_shuttle.changeFrame()); setDelay(1); break; case 4: { - int si = scene->_mazeUI.getCellFromMapXY(Common::Point(scene->_mazePosition.x + 70, scene->_mazePosition.y + 46)); + int cellId = scene->_mazeUI.getCellFromMapXY(Common::Point(scene->_mazePosition.x + 70, scene->_mazePosition.y + 46)); int var2 = scene->_mazeUI.cellFromX(scene->_mazePosition.x + 70) - 70; int var4 = scene->_mazeUI.cellFromY(scene->_mazePosition.y + 46) - 46; int di = abs(var2 - scene->_mazePosition.x); int var6 = abs(var4 - scene->_mazePosition.y); - if ((scene->_actor1._frame % 2) != 0) { - scene->_actor1._frameChange = _field1E; - scene->_actor1.setFrame(scene->_actor1.changeFrame()); + if ((scene->_shuttle._frame % 2) != 0) { + scene->_shuttle._frameChange = _direction; + scene->_shuttle.setFrame(scene->_shuttle.changeFrame()); } // Get the new direction starting on - int var8 = (scene->_action1._field1E * 2 + scene->_mazeDirection); - if (var8 > MAZEDIR_NORTHWEST) - var8 = MAZEDIR_NORTH; - else if (var8 < MAZEDIR_NORTH) - var8 = MAZEDIR_WEST; + int direction = (scene->_action1._direction * 2 + scene->_mazeDirection); + if (direction > MAZEDIR_NORTHWEST) + direction = MAZEDIR_NORTH; + else if (direction < MAZEDIR_NORTH) + direction = MAZEDIR_WEST; // Check whether movement is allowed in that direction. If so, then // movement is started again - switch (var8) { + switch (direction) { case MAZEDIR_NORTH: - if ( ((si != 2) && (si != 3) && (si != 6) && (si != 1) && (si != 23) && (si != 24) && (si != 4) && (si != 11)) + if ( ((cellId != 2) && (cellId != 3) && (cellId != 6) && (cellId != 1) && (cellId != 23) && (cellId != 24) && (cellId != 4) && (cellId != 11)) || (var6 != 0)) { - if ((si != 25) && (si != 26) && (si != 5) && (si != 14) && (si != 15)) - _field20 = 0; + if ((cellId != 25) && (cellId != 26) && (cellId != 5) && (cellId != 14) && (cellId != 15)) + _headingRightFl = false; else if ((var6 != 0) || (di <= 3)) // useless, skipped: "|| (di == 0)" - _field20 = 0; + _headingRightFl = false; else - _field20 = 1; + _headingRightFl = true; } else - _field20 = 1; + _headingRightFl = true; break; case MAZEDIR_EAST: - if ( ((si != 12) && (si != 13) && (si != 11) && (si != 16) && (si != 26) && (si != 24) && (si != 15) && (si != 6) && (si != 31)) + if ( ((cellId != 12) && (cellId != 13) && (cellId != 11) && (cellId != 16) && (cellId != 26) && (cellId != 24) && (cellId != 15) && (cellId != 6) && (cellId != 31)) || (di != 0)) { - if ((si != 25) && (si != 23) && (si != 14) && (si != 5) && (si != 4)) - _field20 = 0; + if ((cellId != 25) && (cellId != 23) && (cellId != 14) && (cellId != 5) && (cellId != 4)) + _headingRightFl = false; else if ((di != 0) || (var6 <= 3)) // useless, skipped: "|| (var6 == 0)" - _field20 = 0; + _headingRightFl = false; else - _field20 = 1; + _headingRightFl = true; } else - _field20 = 1; + _headingRightFl = true; break; case MAZEDIR_SOUTH: - if ( ((si != 2) && (si != 3) && (si != 6) && (si != 1) && (si != 25) && (si != 26) && (si != 5) && (si != 16) && (si != 31)) + if ( ((cellId != 2) && (cellId != 3) && (cellId != 6) && (cellId != 1) && (cellId != 25) && (cellId != 26) && (cellId != 5) && (cellId != 16) && (cellId != 31)) || (var6 != 0)) { - if ((si != 23) && (si != 24) && (si != 4) && (si != 14) && (si != 15)) - _field20 = 0; + if ((cellId != 23) && (cellId != 24) && (cellId != 4) && (cellId != 14) && (cellId != 15)) + _headingRightFl = false; else if ((var6 != 0) || (di <= 3)) // useless, skipped: "|| (di == 0)" - _field20 = 0; + _headingRightFl = false; else - _field20 = 1; + _headingRightFl = true; } else - _field20 = 1; + _headingRightFl = true; break; case MAZEDIR_WEST: - if ( ((si != 12) && (si != 13) && (si != 11) && (si != 16) && (si != 25) && (si != 23) && (si != 14) && (si != 1) && (si != 31)) + if ( ((cellId != 12) && (cellId != 13) && (cellId != 11) && (cellId != 16) && (cellId != 25) && (cellId != 23) && (cellId != 14) && (cellId != 1) && (cellId != 31)) || (var6 != 0)) { - if ((si != 26) && (si != 24) && (si != 15) && (si != 5) && (si != 4)) - _field20 = 0; + if ((cellId != 26) && (cellId != 24) && (cellId != 15) && (cellId != 5) && (cellId != 4)) + _headingRightFl = false; else if ((var6 <= 0) || (di != 0)) // useless, skipped: "|| (var6 == 0)" - _field20 = 0; + _headingRightFl = false; else - _field20 = 1; + _headingRightFl = true; } else - _field20 = 1; + _headingRightFl = true; default: break; } } // No break on purpose case 2: { - scene->_actor8.setPosition(Common::Point(160, 73)); - scene->_actor8._moveDiff.x = 160 - scene->_mazeChangeAmount; - scene->_fieldAF8 = 160 - ((_field1E * 2) * 160); - Common::Point pt(scene->_fieldAF8, 73); + scene->_tunnelVertCircle.setPosition(Common::Point(160, 73)); + scene->_tunnelVertCircle._moveDiff.x = 160 - scene->_mazeChangeAmount; + scene->_moverVertX = 160 - ((_direction * 2) * 160); + Common::Point pt(scene->_moverVertX, 73); NpcMover *mover = new NpcMover(); - scene->_actor8.addMover(mover, &pt, this); + scene->_tunnelVertCircle.addMover(mover, &pt, this); - scene->_actor9.setPosition(Common::Point(160 + ((_field1E * 2) * 160), 73)); - scene->_actor9._moveDiff.x = 160 - scene->_mazeChangeAmount; - scene->_fieldB9E = 160; - Common::Point pt2(scene->_fieldB9E, 73); + scene->_tunnelHorzCircle.setPosition(Common::Point(160 + ((_direction * 2) * 160), 73)); + scene->_tunnelHorzCircle._moveDiff.x = 160 - scene->_mazeChangeAmount; + scene->_moverHorzX = 160; + Common::Point pt2(scene->_moverHorzX, 73); NpcMover *mover2 = new NpcMover(); - scene->_actor9.addMover(mover2, &pt2, NULL); + scene->_tunnelHorzCircle.addMover(mover2, &pt2, NULL); } break; case 5: - scene->_actor1._frameChange = _field1E; - scene->_mazeDirection = scene->_actor1.changeFrame(); - scene->_actor1.setFrame(scene->_mazeDirection); + scene->_shuttle._frameChange = _direction; + scene->_mazeDirection = scene->_shuttle.changeFrame(); + scene->_shuttle.setFrame(scene->_mazeDirection); setDelay(1); break; case 6: - scene->_actor8.setPosition(Common::Point(160, 73)); - if (_field20 == 0) - scene->_actor8.setStrip(1); + scene->_tunnelVertCircle.setPosition(Common::Point(160, 73)); + if (!_headingRightFl) + scene->_tunnelVertCircle.setStrip(1); else - scene->_actor8.setStrip(2); - scene->_actor8.fixPriority(1); + scene->_tunnelVertCircle.setStrip(2); + scene->_tunnelVertCircle.fixPriority(1); - scene->_actor9.setPosition(Common::Point(-160, 73)); - scene->_actor9.setStrip(9); - scene->_actor9.fixPriority(11); - scene->_actor9.hide(); + scene->_tunnelHorzCircle.setPosition(Common::Point(-160, 73)); + scene->_tunnelHorzCircle.setStrip(9); + scene->_tunnelHorzCircle.fixPriority(11); + scene->_tunnelHorzCircle.hide(); setDelay(1); break; case 7: - if ((scene->_actor1._frame % 2) == 0) { - scene->_actor1._frameChange = _field1E; - scene->_mazeDirection = scene->_actor1.changeFrame(); - scene->_actor1.setFrame(scene->_mazeDirection); + if ((scene->_shuttle._frame % 2) == 0) { + scene->_shuttle._frameChange = _direction; + scene->_mazeDirection = scene->_shuttle.changeFrame(); + scene->_shuttle.setFrame(scene->_mazeDirection); } setDelay(1); break; case 8: { R2_GLOBALS._player.enableControl(); R2_GLOBALS._player._canWalk = false; - scene->_field1286 = 1; - if ((scene->_actor1._frame % 2) == 0) { - scene->_actor1._frameChange = _field1E; - scene->_actor1.setFrame(scene->_actor1.changeFrame()); + scene->_directionChangesEnabled = true; + if ((scene->_shuttle._frame % 2) == 0) { + scene->_shuttle._frameChange = _direction; + scene->_shuttle.setFrame(scene->_shuttle.changeFrame()); } - // All the var_8 initialization was missing in the original + // CHECKME: All the var_8 initialization was missing in the original // but it's clearly a cut and paste error from case 4. // The following code allows the switch to work properly. - warning("Checkme: fix for dead code"); - int var_8 = (_field1E * 2 + scene->_mazeDirection); + int var_8 = (_direction * 2 + scene->_mazeDirection); if (var_8 > 7) var_8 = 1; else if (var_8 < 1) @@ -3203,47 +3235,47 @@ void Scene3500::Action1::signal() { default: break; } - scene->_actor5.hide(); - scene->_actor6.hide(); - _field24 = 0; - if (_field20 == 0) { - scene->_actor7.sub1094ED(); - if (scene->_mazeChangeAmount == scene->_field1270) + scene->_symbolLeft.hide(); + scene->_symbolRight.hide(); + _turningFl = false; + if (!_headingRightFl) { + scene->_throttle.updateSpeed(); + if (scene->_mazeChangeAmount == scene->_speed) scene->_aSound1.play(276); } break; } case 10: { - scene->_fieldAF8 = 160; + scene->_moverVertX = 160; Common::Point pt(160, 73); NpcMover *mover = new NpcMover(); - scene->_actor8.addMover(mover, &pt, NULL); + scene->_tunnelVertCircle.addMover(mover, &pt, NULL); - scene->_fieldB9E = 160 - (_field1E * 2 * 160); - Common::Point pt2(scene->_fieldB9E, 73); + scene->_moverHorzX = 160 - (_direction * 2 * 160); + Common::Point pt2(scene->_moverHorzX, 73); NpcMover *mover2 = new NpcMover(); - scene->_actor9.addMover(mover2, &pt2, this); + scene->_tunnelHorzCircle.addMover(mover2, &pt2, this); _actionIndex = 6; } break; case 11: { - scene->_actor8.setStrip(2); - scene->_actor8.setPosition(Common::Point(160, 73)); - scene->_fieldAF8 = 160 - (_field1E * 2 * 160); - Common::Point pt(scene->_fieldAF8, 73); + scene->_tunnelVertCircle.setStrip(2); + scene->_tunnelVertCircle.setPosition(Common::Point(160, 73)); + scene->_moverVertX = 160 - (_direction * 2 * 160); + Common::Point pt(scene->_moverVertX, 73); NpcMover *mover = new NpcMover(); - scene->_actor8.addMover(mover, &pt, NULL); - scene->_actor8.fixPriority(11); - if (_field20 == 0) - scene->_actor9.setStrip(1); + scene->_tunnelVertCircle.addMover(mover, &pt, NULL); + scene->_tunnelVertCircle.fixPriority(11); + if (!_headingRightFl) + scene->_tunnelHorzCircle.setStrip(1); else - scene->_actor9.setStrip(2); - scene->_actor9.setPosition(Common::Point(160 - (_field1E * 2 * 160), 73)); - scene->_fieldB9E = 160; - Common::Point pt2(scene->_fieldB9E, 73); + scene->_tunnelHorzCircle.setStrip(2); + scene->_tunnelHorzCircle.setPosition(Common::Point(160 - (_direction * 2 * 160), 73)); + scene->_moverHorzX = 160; + Common::Point pt2(scene->_moverHorzX, 73); NpcMover *mover2 = new NpcMover(); - scene->_actor9.addMover(mover2, &pt2, this); - scene->_actor9.fixPriority(1); + scene->_tunnelHorzCircle.addMover(mover2, &pt2, this); + scene->_tunnelHorzCircle.fixPriority(1); _actionIndex = 5; } break; @@ -3265,231 +3297,24 @@ void Scene3500::Action1::dispatch() { /*--------------------------------------------------------------------------*/ Scene3500::Action2::Action2() { - _field1E = 0; + _direction = 0; } void Scene3500::Action2::synchronize(Serializer &s) { Action::synchronize(s); - s.syncAsSint16LE(_field1E); -} - -/*--------------------------------------------------------------------------*/ - -Scene3500::Item4::Item4() { - _field34 = 0; -} - -void Scene3500::Item4::synchronize(Serializer &s) { - NamedHotspot::synchronize(s); - - s.syncAsSint16LE(_field34); -} - -/*--------------------------------------------------------------------------*/ - -Scene3500::Actor7::Actor7() { - _fieldA4 = 0; - _fieldA6 = 0; - _fieldA8 = 0; - _fieldAA = 0; - _fieldAC = 0; - _fieldAE = 0; -} - -void Scene3500::Actor7::synchronize(Serializer &s) { - SceneActor::synchronize(s); - - s.syncAsSint16LE(_fieldA4); - s.syncAsSint16LE(_fieldA6); - s.syncAsSint16LE(_fieldA8); - s.syncAsSint16LE(_fieldAA); - s.syncAsSint16LE(_fieldAC); - s.syncAsSint16LE(_fieldAE); -} - -void Scene3500::Actor7::sub109466(int arg1, int arg2, int arg3, int arg4, int arg5) { - _fieldAE = 0; - _fieldA4 = arg1; - _fieldA6 = arg2; - _fieldA8 = arg3; - _fieldAA = arg4; - _fieldAC = _fieldAA / _fieldA8; - - postInit(); - setup(1050, 3, 1); - fixPriority(255); - sub109663(arg5); + s.syncAsSint16LE(_direction); } -void Scene3500::Actor7::sub1094ED() { +void Scene3500::Action2::handleVertButton(int direction) { Scene3500 *scene = (Scene3500 *)R2_GLOBALS._sceneManager._scene; - scene->_field1270 = _position.x - _fieldA4; -} - -void Scene3500::Actor7::sub109663(int arg1){ - sub109693(Common::Point(_fieldA4 + arg1, _fieldA6 - (_fieldAC * arg1))); -} - -void Scene3500::Actor7::sub109693(Common::Point Pt) { - setPosition(Pt); -} - -/*--------------------------------------------------------------------------*/ - -int Scene3500::MazeUI3500::cellFromX(int x) { - return (_cellSize.x / 2) + x - (x % _cellSize.x); -} - -int Scene3500::MazeUI3500::cellFromY(int y) { - return (_cellSize.y / 2) + y - (y % _cellSize.y) - 1; -} - -int Scene3500::MazeUI3500::getCellFromMapXY(Common::Point pt) { - int cellX = pt.x / _cellSize.x; - int cellY = pt.y / _cellSize.y; - - if ((cellX >= 0) && (cellY >= 0) && (cellX < _mapCells.x) && (cellY < _mapCells.y)) { - return (int16)READ_LE_UINT16(_mapData + (_mapCells.x * cellY + cellX) * 2); - } else - return -1; -} - -bool Scene3500::MazeUI3500::setMazePosition2(Common::Point &p) { - bool retVal = setMazePosition(p); - p = _mapOffset; - - return retVal; -} - -Scene3500::Scene3500() { - _fieldAF8 = 0; - _fieldB9E = 0; - _rotation = NULL; - _mazeChangeAmount = 0; - _field1270 = 0; - _field1272 = 0; - _field1274 = 0; - _mazeDirection = MAZEDIR_NONE; - _field1278 = 0; - _mazePosition.x = 0; - _mazePosition.y = 0; - _field127E = 0; - _field1280 = 0; - _field1282 = 0; - _field1284 = 0; - _field1286 = 0; -} - -void Scene3500::synchronize(Serializer &s) { - SceneExt::synchronize(s); - SYNC_POINTER(_rotation); - - s.syncAsSint16LE(_fieldAF8); - s.syncAsSint16LE(_fieldB9E); - s.syncAsSint16LE(_mazeChangeAmount); - s.syncAsSint16LE(_field1270); - s.syncAsSint16LE(_field1272); - s.syncAsSint16LE(_field1274); - s.syncAsSint16LE(_mazeDirection); - s.syncAsSint16LE(_field1278); - s.syncAsSint16LE(_mazePosition.x); - s.syncAsSint16LE(_mazePosition.y); - s.syncAsSint16LE(_field127E); - s.syncAsSint16LE(_field1280); - s.syncAsSint16LE(_field1282); - s.syncAsSint16LE(_field1284); - s.syncAsSint16LE(_field1286); -} - -void Scene3500::sub107F71(int arg1) { - switch (arg1) { - case -1: - _actor7.sub1094ED(); - if (_field1270 != 0) { - _field1270--; - _actor7.sub109663(_field1270); - } - if (_action1._field24 != 0) - _field1270 = 0; - break; - case 1: - _actor7.sub1094ED(); - if (_field1270 < 16) { - ++_field1270; - _actor7.sub109663(_field1270); - } - if (_action1._field24 != 0) - _field1270 = 0; - break; - case 88: - if ((_action == 0) || (_action1._field24 == 0)) { - // The original makes a second useless check on action, skipped - _action2.sub10831F(2); - if ((_action) && ((_action2.getActionIndex() != 0) || (_action2._field1E != 2))) { - _action2.signal(); - } else { - _actor9.setAction(&_action2, &_actor9, NULL); - } - } - break; - case 96: - if ((_action) && (_action1._field24 != 0) && (_action2._field1E != 1)) { - _field1278 = 0; - _action1.sub108732(0); - } else if ((_action) && (_field1278 == 0) && (_action1._field24 != 0)) { - _field1278 = arg1; - } else if ((_action) && (_action1._field24 == 0)) { - _action1.sub108670(1); - _action1.signal(); - } else if (_action == 0) { - _action1.sub108670(1); - setAction(&_action1, &_actor1, NULL); - } - break; - case 104: - if ((_action == 0) || (_action1._field24 == 0)) { - _action2.sub10831F(-1); - if ((_action) && ((_action2.getActionIndex() != 0) || (_action2._field1E != -1))) { - _action2.signal(); - } else { - _actor9.setAction(&_action2, &_actor9, NULL); - } - } - break; - case 112: - if ((_action) && (_action1._field24 != 0) && (_action2._field1E != -1)) { - _field1278 = 0; - _action1.sub108732(0); - } else if ((_action) && (_field1278 == 0) && (_action1._field24 != 0)) { - _field1278 = arg1; - } else if ((_action) && (_action1._field24 == 0)) { - _action1.sub108670(-1); - _action1.signal(); - } else if (_action == 0) { - _action1.sub108670(-1); - setAction(&_action1, &_actor1, NULL); - } - break; - default: - _field1270 = arg1; - _actor7.sub109663(arg1); - if (_action1._field24 != 0) { - _field1270 = 0; - } - break; - } -} - -void Scene3500::Action2::sub10831F(int arg1) { - Scene3500 *scene = (Scene3500 *)R2_GLOBALS._sceneManager._scene; - - _field1E = arg1; - if (_field1E == -1) - scene->_actor3.setFrame2(3); + // Directions : 2 == up, -1 == down + _direction = direction; + if (_direction == -1) + scene->_horizontalSpeedDisplay.setFrame2(3); else - scene->_actor3.setFrame2(1); + scene->_horizontalSpeedDisplay.setFrame2(1); setActionIndex(0); } @@ -3497,57 +3322,57 @@ void Scene3500::Action2::sub10831F(int arg1) { void Scene3500::Action2::signal() { Scene3500 *scene = (Scene3500 *)R2_GLOBALS._sceneManager._scene; - int si; - int di; + int vertX; + int horzX; switch (_actionIndex++) { case 0: { - if (scene->_actor8._mover) { - si = scene->_fieldAF8; - di = scene->_fieldB9E; + if (scene->_tunnelVertCircle._mover) { + vertX = scene->_moverVertX; + horzX = scene->_moverHorzX; } else { - scene->_fieldAF8 = scene->_actor8._position.x; - si = scene->_fieldAF8; - scene->_fieldB9E = scene->_actor9._position.y; - di = scene->_fieldB9E; + scene->_moverVertX = scene->_tunnelVertCircle._position.x; + vertX = scene->_moverVertX; + scene->_moverHorzX = scene->_tunnelHorzCircle._position.y; + horzX = scene->_moverHorzX; } - scene->_actor8._moveDiff.y = 9 - (scene->_mazeChangeAmount / 2); - Common::Point pt(si, 73 - (_field1E * 12)); + scene->_tunnelVertCircle._moveDiff.y = 9 - (scene->_mazeChangeAmount / 2); + Common::Point pt(vertX, 73 - (_direction * 12)); NpcMover *mover = new NpcMover(); - scene->_actor8.addMover(mover, &pt, NULL); + scene->_tunnelVertCircle.addMover(mover, &pt, NULL); - scene->_actor9._moveDiff.y = 9 - (scene->_mazeChangeAmount / 2); - Common::Point pt2(di, 73 - (_field1E * 12)); + scene->_tunnelHorzCircle._moveDiff.y = 9 - (scene->_mazeChangeAmount / 2); + Common::Point pt2(horzX, 73 - (_direction * 12)); NpcMover *mover2 = new NpcMover(); - scene->_actor9.addMover(mover2, &pt2, NULL); + scene->_tunnelHorzCircle.addMover(mover2, &pt2, NULL); scene->_mazeChangeAmount = (scene->_mazeChangeAmount / 2) + (scene->_mazeChangeAmount % 2); setDelay(17 - scene->_mazeChangeAmount); } break; case 1: { R2_GLOBALS._sound2.play(339); - if (scene->_actor8._mover) { - si = scene->_fieldAF8; - di = scene->_fieldB9E; + if (scene->_tunnelVertCircle._mover) { + vertX = scene->_moverVertX; + horzX = scene->_moverHorzX; } else { - si = scene->_actor8._position.x; - di = scene->_actor9._position.x; + vertX = scene->_tunnelVertCircle._position.x; + horzX = scene->_tunnelHorzCircle._position.x; } - scene->_actor7.sub1094ED(); + scene->_throttle.updateSpeed(); - scene->_actor8._moveDiff.y = 9 - (scene->_mazeChangeAmount / 2); - Common::Point pt(si, 73); + scene->_tunnelVertCircle._moveDiff.y = 9 - (scene->_mazeChangeAmount / 2); + Common::Point pt(vertX, 73); NpcMover *mover = new NpcMover(); - scene->_actor8.addMover(mover, &pt, NULL); + scene->_tunnelVertCircle.addMover(mover, &pt, NULL); - scene->_actor9._moveDiff.y = 9 - (scene->_mazeChangeAmount / 2); - Common::Point pt2(di, 73); + scene->_tunnelHorzCircle._moveDiff.y = 9 - (scene->_mazeChangeAmount / 2); + Common::Point pt2(horzX, 73); NpcMover *mover2 = new NpcMover(); - scene->_actor9.addMover(mover2, &pt2, NULL); + scene->_tunnelHorzCircle.addMover(mover2, &pt2, NULL); - scene->_actor3.setFrame2(2); + scene->_horizontalSpeedDisplay.setFrame2(2); } break; default: @@ -3555,66 +3380,187 @@ void Scene3500::Action2::signal() { } } -bool Scene3500::Item4::startAction(CursorType action, Event &event) { +/*--------------------------------------------------------------------------*/ + +Scene3500::DirectionButton::DirectionButton() { + _movementId = 0; +} + +void Scene3500::DirectionButton::synchronize(Serializer &s) { + NamedHotspot::synchronize(s); + + s.syncAsSint16LE(_movementId); +} + +bool Scene3500::DirectionButton::startAction(CursorType action, Event &event) { Scene3500 *scene = (Scene3500 *)R2_GLOBALS._sceneManager._scene; - if (scene->_field1286 == 0) + if (!scene->_directionChangesEnabled) { return true; - - if (scene->_field1286 != 4) + } else if (action == CURSOR_USE) { + R2_GLOBALS._sound2.play(14, nullptr, 63); + scene->doMovement(_movementId); + return true; + } else { return SceneHotspot::startAction(action, event); + } +} - R2_GLOBALS._sound2.play(14); - scene->sub107F71(_field34); +/*--------------------------------------------------------------------------*/ - return true; +Scene3500::Throttle::Throttle() { + _deltaX = 1; + _deltaY = 0; + _slideDeltaY = 0; + _deltaMouseY = 0; } -void Scene3500::Actor7::process(Event &event) { +void Scene3500::Throttle::synchronize(Serializer &s) { + SceneActor::synchronize(s); + + s.syncAsSint16LE(_pos.x); + s.syncAsSint16LE(_pos.y); + s.syncAsSint16LE(_deltaX); + s.syncAsSint16LE(_deltaY); + s.syncAsSint16LE(_slideDeltaY); + s.syncAsSint16LE(_deltaMouseY); +} + +void Scene3500::Throttle::init(int xp, int yp, int dx, int dy, int speed) { + _deltaMouseY = 0; + _pos = Common::Point(xp, yp); + _deltaX = dx; + _deltaY = dy; + _slideDeltaY = _deltaY / _deltaX; + + postInit(); + setup(1050, 3, 1); + fixPriority(255); + setSpeed(speed); +} + +void Scene3500::Throttle::updateSpeed() { Scene3500 *scene = (Scene3500 *)R2_GLOBALS._sceneManager._scene; - if (scene->_field1286 == 0) + scene->_speed = _position.x - _pos.x; +} + +void Scene3500::Throttle::setSpeed(int arg1){ + changePosition(Common::Point(_pos.x + arg1, _pos.y - (_slideDeltaY * arg1))); +} + +void Scene3500::Throttle::changePosition(const Common::Point &pt) { + setPosition(pt); +} + +void Scene3500::Throttle::process(Event &event) { + Scene3500 *scene = (Scene3500 *)R2_GLOBALS._sceneManager._scene; + + if (!scene->_directionChangesEnabled) return; if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_USE) && (_bounds.contains(event.mousePos))) { - _fieldAE = 1 + event.mousePos.y - _position.y; + _deltaMouseY = 1 + event.mousePos.y - _position.y; event.eventType = EVENT_NONE; } - if ((event.eventType == EVENT_BUTTON_UP) && (_fieldAE != 0)) { - _fieldAE = 0; + if ((event.eventType == EVENT_BUTTON_UP) && (_deltaMouseY != 0)) { + _deltaMouseY = 0; event.handled = true; - if (scene->_action1._field24 == 0) - sub1094ED(); + if (!scene->_action1._turningFl) + updateSpeed(); } - if (_fieldAE == 0) + if (_deltaMouseY == 0) return; R2_GLOBALS._sound2.play(338); event.handled = true; - int cx = event.mousePos.y - _fieldAE + 1; - if (_fieldA6 >= cx) { - if (_fieldA6 - _fieldAA <= cx) - sub109693(Common::Point(((_fieldA6 - cx) / 2) + _fieldA4 + ((_fieldA6 - cx) % 2), cx)); + int cx = event.mousePos.y - _deltaMouseY + 1; + if (_pos.y >= cx) { + if (_pos.y - _deltaY <= cx) + changePosition(Common::Point(((_pos.y - cx) / 2) + _pos.x + ((_pos.y - cx) % 2), cx)); else - sub109693(Common::Point(_fieldA4 + _fieldA8, _fieldA6 - _fieldAA)); + changePosition(Common::Point(_pos.x + _deltaX, _pos.y - _deltaY)); } else { - sub109693(Common::Point(_fieldA4, _fieldA6)); + changePosition(Common::Point(_pos.x, _pos.y)); } } -bool Scene3500::Actor7::startAction(CursorType action, Event &event) { +bool Scene3500::Throttle::startAction(CursorType action, Event &event) { Scene3500 *scene = (Scene3500 *)R2_GLOBALS._sceneManager._scene; - if (scene->_field1286 == 0) + if (!scene->_directionChangesEnabled) { return true; - - if (scene->_field1286 == 4) + } else if (action == CURSOR_USE) { return false; + } else { + return SceneActor::startAction(action, event); + } +} - return SceneActor::startAction(action, event); +/*--------------------------------------------------------------------------*/ + +int16 Scene3500::MazeUI3500::cellFromX(int x) { + return (_cellSize.x / 2) + x - (x % _cellSize.x); +} + +int16 Scene3500::MazeUI3500::cellFromY(int y) { + return (_cellSize.y / 2) + y - (y % _cellSize.y) - 1; +} + +int Scene3500::MazeUI3500::getCellFromMapXY(Common::Point pt) { + int cellX = pt.x / _cellSize.x; + int cellY = pt.y / _cellSize.y; + + if ((cellX >= 0) && (cellY >= 0) && (cellX < _mapCells.x) && (cellY < _mapCells.y)) { + return (int16)READ_LE_UINT16(_mapData + (_mapCells.x * cellY + cellX) * 2); + } else + return -1; +} + +bool Scene3500::MazeUI3500::setMazePosition2(Common::Point &p) { + bool retVal = setMazePosition(p); + p = _mapOffset; + + return retVal; +} + +/*--------------------------------------------------------------------------*/ + +Scene3500::Scene3500() { + _moverVertX = 0; + _moverHorzX = 0; + _rotation = NULL; + _mazeChangeAmount = 0; + _speed = 0; + _updateIdxChangeFl = false; + _mazeDirection = MAZEDIR_NONE; + _nextMove = 0; + _mazePosition.x = 0; + _mazePosition.y = 0; + _postFixupFl = true; // Set to true in fixup() + _exitCounter = 0; + _directionChangesEnabled = false; +} + +void Scene3500::synchronize(Serializer &s) { + SceneExt::synchronize(s); + SYNC_POINTER(_rotation); + + s.syncAsSint16LE(_moverVertX); + s.syncAsSint16LE(_moverHorzX); + s.syncAsSint16LE(_mazeChangeAmount); + s.syncAsSint16LE(_speed); + s.syncAsSint16LE(_updateIdxChangeFl); + s.syncAsSint16LE(_mazeDirection); + s.syncAsSint16LE(_nextMove); + s.syncAsSint16LE(_mazePosition.x); + s.syncAsSint16LE(_mazePosition.y); + s.syncAsSint16LE(_postFixupFl); + s.syncAsSint16LE(_exitCounter); + s.syncAsSint16LE(_directionChangesEnabled); } void Scene3500::postInit(SceneObjectList *OwnerList) { @@ -3622,19 +3568,18 @@ void Scene3500::postInit(SceneObjectList *OwnerList) { loadScene(1050); R2_GLOBALS._uiElements._active = false; - R2_GLOBALS._interfaceY = 200; + R2_GLOBALS._interfaceY = SCREEN_HEIGHT; - R2_GLOBALS._v5589E.set(0, 0, 320, 200); R2_GLOBALS._sound1.play(305); R2_GLOBALS._player._characterIndex = R2_QUINN; R2_GLOBALS._player._characterScene[R2_QUINN] = 3500; R2_GLOBALS._player._characterScene[R2_SEEKER] = 3500; R2_GLOBALS._player._characterScene[R2_MIRANDA] = 3500; - _field1284 = 0; - _field1282 = 0; - _field1278 = 0; - _field1272 = 1; - _field1270 = 4; + _exitCounter = 0; + _postFixupFl = false; + _nextMove = 0; + _updateIdxChangeFl = true; + _speed = 4; _mazeChangeAmount = 4; _mazePosition = Common::Point(860, 891); _rotation = R2_GLOBALS._scenePalette.addRotation(240, 254, -1); @@ -3658,78 +3603,78 @@ void Scene3500::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._scenePalette._palette[(3 * i) + 2] = tmpPal[(3 * i) + 2]; } - _actor7.sub109466(38, 165, 16, 32, _field1270); - _actor7.setDetails(3500, 6, 7, -1, 1, (SceneItem *)NULL); + _throttle.init(38, 165, 16, 32, _speed); + _throttle.setDetails(3500, 6, 7, -1, 1, (SceneItem *)NULL); R2_GLOBALS._sound1.play(276); - _item4._field34 = 88; - _item4.setDetails(88, 3500, 18, 10, -1); + _pitchDown._movementId = 88; + _pitchDown.setDetails(88, 3500, 18, 10, -1); - _item5._field34 = 112; - _item5.setDetails(112, 3500, 9, 10, -1); + _turnLeft._movementId = 112; + _turnLeft.setDetails(112, 3500, 9, 10, -1); - _item6._field34 = 104; - _item6.setDetails(104, 3500, 15, 10, -1); + _pitchUp._movementId = 104; + _pitchUp.setDetails(104, 3500, 15, 10, -1); - _item7._field34 = 96; - _item7.setDetails(96, 3500, 12, 10, -1); + _turnRight._movementId = 96; + _turnRight.setDetails(96, 3500, 12, 10, -1); - _actor8.postInit(); - _actor8.setup(1050, 1, 1); - _actor8.setPosition(Common::Point(160, 73)); - _actor8.fixPriority(1); + _tunnelVertCircle.postInit(); + _tunnelVertCircle.setup(1050, 1, 1); + _tunnelVertCircle.setPosition(Common::Point(160, 73)); + _tunnelVertCircle.fixPriority(1); - _actor9.postInit(); - _actor9.setup(1050, 2, 1); - _actor9.setPosition(Common::Point(-160, 73)); - _actor9.fixPriority(11); - _actor9.hide(); + _tunnelHorzCircle.postInit(); + _tunnelHorzCircle.setup(1050, 2, 1); + _tunnelHorzCircle.setPosition(Common::Point(-160, 73)); + _tunnelHorzCircle.fixPriority(11); + _tunnelHorzCircle.hide(); - _item2.setDetails(27, 3500, 21, -1, -1); - _item3.setDetails(Rect(160, 89, 299, 182), 3500, 3, -1, -1, 1, NULL); - _item1.setDetails(Rect(0, 0, 320, 200), 3500, 0, -1, 2, 1, NULL); + _outsideView.setDetails(27, 3500, 21, -1, -1); + _mapScreen.setDetails(Rect(160, 89, 299, 182), 3500, 3, -1, -1, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 3500, 0, -1, 2, 1, NULL); - _actor1.postInit(); + _shuttle.postInit(); _mazeDirection = MAZEDIR_NORTH; - _actor1.setup(1004, 1, _mazeDirection); - _actor1.setPosition(Common::Point(230, 135)); - _actor1.fixPriority(200); - _actor1._frameChange = 1; - - _actor5.postInit(); - _actor5.setup(1004, 3, 1); - _actor5.setPosition(Common::Point(117, 163)); - _actor5.fixPriority(200); - _actor5.hide(); - - _actor4.postInit(); - _actor4.setup(1004, 3, 2); - _actor4.setPosition(Common::Point(126, 163)); - _actor4.fixPriority(200); - - _actor6.postInit(); - _actor6.setup(1004, 3, 3); - _actor6.setPosition(Common::Point(135, 163)); - _actor6.fixPriority(200); - _actor6.hide(); - - _actor2.postInit(); - _actor2.setup(1004, 4, _mazeChangeAmount + 1); - _actor2.setPosition(Common::Point(126, 137)); - _actor2.fixPriority(200); - - _actor3.postInit(); - _actor3.setup(1004, 5, 2); - _actor3.setPosition(Common::Point(126, 108)); - _actor3.fixPriority(200); + _shuttle.setup(1004, 1, _mazeDirection); + _shuttle.setPosition(Common::Point(230, 135)); + _shuttle.fixPriority(200); + _shuttle._frameChange = 1; + + _symbolLeft.postInit(); + _symbolLeft.setup(1004, 3, 1); + _symbolLeft.setPosition(Common::Point(117, 163)); + _symbolLeft.fixPriority(200); + _symbolLeft.hide(); + + _symbolVertical.postInit(); + _symbolVertical.setup(1004, 3, 2); + _symbolVertical.setPosition(Common::Point(126, 163)); + _symbolVertical.fixPriority(200); + + _symbolRight.postInit(); + _symbolRight.setup(1004, 3, 3); + _symbolRight.setPosition(Common::Point(135, 163)); + _symbolRight.fixPriority(200); + _symbolRight.hide(); + + _verticalSpeedDisplay.postInit(); + _verticalSpeedDisplay.setup(1004, 4, _mazeChangeAmount + 1); + _verticalSpeedDisplay.setPosition(Common::Point(126, 137)); + _verticalSpeedDisplay.fixPriority(200); + + _horizontalSpeedDisplay.postInit(); + _horizontalSpeedDisplay.setup(1004, 5, 2); + _horizontalSpeedDisplay.setPosition(Common::Point(126, 108)); + _horizontalSpeedDisplay.fixPriority(200); _mazeUI.setDisplayBounds(Rect(160, 89, 299, 182)); _mazeUI.load(2); _mazeUI.setMazePosition(_mazePosition); - _action1._field24 = 0; + _action1._turningFl = false; _mazeUI.draw(); - _field1286 = 1; + _directionChangesEnabled = true; R2_GLOBALS._player.postInit(); R2_GLOBALS._player.hide(); @@ -3738,6 +3683,99 @@ void Scene3500::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._canWalk = false; } +void Scene3500::doMovement(int id) { + switch (id) { + case -1: + _throttle.updateSpeed(); + if (_speed != 0) { + _speed--; + _throttle.setSpeed(_speed); + } + if (_action1._turningFl) + _speed = 0; + break; + case 1: + _throttle.updateSpeed(); + if (_speed < 16) { + ++_speed; + _throttle.setSpeed(_speed); + } + if (_action1._turningFl) + _speed = 0; + break; + case 88: + // Up button has been pressed + // The original was doing a double check on action, only one is here. + if (!_action || (!_action1._turningFl)) { + _action2.handleVertButton(2); + if (_action && ((_action2.getActionIndex() != 0) || (_action2._direction != 2))) { + _action2.signal(); + } else { + _tunnelHorzCircle.setAction(&_action2, &_tunnelHorzCircle, NULL); + } + } + break; + case 96: + // Right button has been pressed + if (!_action || !_action1._turningFl || (_action1._direction == 1)) { + if (_action && (_nextMove == 0) && (_action1._turningFl)) { + _nextMove = id; + } else if (_action && (!_action1._turningFl)) { + _action1.handleHorzButton(1); + _action1.signal(); + } else if (!_action) { + _action1.handleHorzButton(1); + setAction(&_action1, &_shuttle, NULL); + } + + } else { + if (_nextMove != 0) + _nextMove = 0; + + _action1.turnShuttle(false); + } + break; + case 104: + // Down button has been pressed + if (!_action || (!_action1._turningFl)) { + _action2.handleVertButton(-1); + if ((_action) && ((_action2.getActionIndex() != 0) || (_action2._direction != -1))) { + _action2.signal(); + } else { + _tunnelHorzCircle.setAction(&_action2, &_tunnelHorzCircle, NULL); + } + } + break; + case 112: + // Left button has been pressed + if (!_action || !_action1._turningFl || (_action1._direction == 1)) { + if (_action && (_nextMove == 0) && (_action1._turningFl)) { + _nextMove = id; + } else if (_action && (!_action1._turningFl)) { + _action1.handleHorzButton(-1); + _action1.signal(); + } else if (!_action) { + _action1.handleHorzButton(-1); + setAction(&_action1, &_shuttle, NULL); + } + + } else { + if (_nextMove != 0) + _nextMove = 0; + + _action1.turnShuttle(false); + } + break; + default: + _speed = id; + _throttle.setSpeed(id); + if (_action1._turningFl) { + _speed = 0; + } + break; + } +} + void Scene3500::remove() { R2_GLOBALS._sound2.fadeOut2(NULL); SceneExt::remove(); @@ -3746,69 +3784,69 @@ void Scene3500::remove() { void Scene3500::signal() { R2_GLOBALS._player.enableControl(CURSOR_USE); R2_GLOBALS._player._canWalk = false; - _field1286 = 1; + _directionChangesEnabled = true; } void Scene3500::process(Event &event) { - if (_field1286 == 0) + if (!_directionChangesEnabled) return; if (event.eventType == EVENT_KEYPRESS) { switch (event.kbd.keycode) { case Common::KEYCODE_KP7: R2_GLOBALS._sound2.play(338); - sub107F71(16); + doMovement(16); event.handled = true; break; case Common::KEYCODE_UP: case Common::KEYCODE_KP8: R2_GLOBALS._sound2.play(14, NULL, 63); - sub107F71(88); + doMovement(88); event.handled = true; break; case Common::KEYCODE_KP9: - if (_field1270 < 16) + if (_speed < 16) R2_GLOBALS._sound2.play(338); - sub107F71(1); + doMovement(1); event.handled = true; break; case Common::KEYCODE_KP4: case Common::KEYCODE_LEFT: R2_GLOBALS._sound2.play(14, NULL, 63); - sub107F71(112); + doMovement(112); event.handled = true; break; case Common::KEYCODE_KP6: case Common::KEYCODE_RIGHT: R2_GLOBALS._sound2.play(14, NULL, 63); - sub107F71(96); + doMovement(96); event.handled = true; break; case Common::KEYCODE_KP1: R2_GLOBALS._sound2.play(338); - sub107F71(0); + doMovement(0); event.handled = true; break; case Common::KEYCODE_KP2: case Common::KEYCODE_DOWN: R2_GLOBALS._sound2.play(14, NULL, 63); - sub107F71(104); + doMovement(104); event.handled = true; break; case Common::KEYCODE_KP3: - if (_field1270 != 0) + if (_speed != 0) R2_GLOBALS._sound2.play(338); - sub107F71(-1); + doMovement(-1); event.handled = true; break; case Common::KEYCODE_KP0: R2_GLOBALS._sound2.play(338); - sub107F71(8); + doMovement(8); event.handled = true; break; case Common::KEYCODE_KP_PERIOD: R2_GLOBALS._sound2.play(338); - sub107F71(4); + doMovement(4); event.handled = true; break; default: @@ -3817,19 +3855,19 @@ void Scene3500::process(Event &event) { } if (!event.handled) - _actor7.process(event); + _throttle.process(event); if (!event.handled) - _item4.process(event); + _pitchDown.process(event); if (!event.handled) - _item5.process(event); + _turnLeft.process(event); if (!event.handled) - _item6.process(event); + _pitchUp.process(event); if (!event.handled) - _item7.process(event); + _turnRight.process(event); Scene::process(event); } @@ -3838,104 +3876,103 @@ void Scene3500::dispatch() { Rect tmpRect; Scene::dispatch(); - if (((_actor1._frame % 2) == 0) && (_action1._field24 == 0)) { - _actor1.setFrame(_actor1.changeFrame()); - _mazeDirection = _actor1._frame; + if (((_shuttle._frame % 2) == 0) && (!_action1._turningFl)) { + _shuttle.setFrame(_shuttle.changeFrame()); + _mazeDirection = _shuttle._frame; } - int oldField1278; - if ((_field1278 != 0) && (_action1._field24 == 0)) { - oldField1278 = _field1278; - _field1278 = 0; - sub107F71(oldField1278); + + if ((_nextMove != 0) && (!_action1._turningFl)) { + int move = _nextMove; + _nextMove = 0; + doMovement(move); } if (!_rotation) return; - int newMazeX = 0; - int newMazeY = 0; - int var_4 = 0; - int var_6 = 0; - int var_8 = 0; - int var_a = 0; - int dx = 0; + int16 newMazeX = 0; + int16 newMazeY = 0; + int16 mazePosX = 0; + int16 mazePosY = 0; + int deltaX = 0; + int deltaY = 0; int cellId = 0; - if ((_mazeChangeAmount == 0) && (_field1282 == 0)) { - if (_field1284 == 2) + if ((_mazeChangeAmount == 0) && !_postFixupFl) { + if (_exitCounter == 2) R2_GLOBALS._sceneManager.changeScene(1000); } else { - _field1282 = 0; + _postFixupFl = false; tmpRect.set(160, 89, 299, 182); newMazeX = _mazePosition.x; newMazeY = _mazePosition.y; - var_4 = _mazeUI.cellFromX(newMazeX + 70) - 70; - var_6 = _mazeUI.cellFromY(_mazePosition.y + 46) - 46; - var_8 = abs(var_4 - newMazeX); - var_a = abs(var_6 - newMazeY); - dx = 0; + mazePosX = _mazeUI.cellFromX(newMazeX + 70) - 70; + mazePosY = _mazeUI.cellFromY(_mazePosition.y + 46) - 46; + deltaX = abs(mazePosX - newMazeX); + deltaY = abs(mazePosY - newMazeY); + int tmpCellId = 0; switch (_mazeDirection) { case MAZEDIR_NORTH: cellId = _mazeUI.getCellFromMapXY(Common::Point(newMazeX + 70, newMazeY + 46)); if (((cellId == 2) || (cellId == 3) || (cellId == 6) || (cellId == 1)) || - ((cellId == 25 || cellId == 26 || cellId == 5 || cellId == 14 || cellId == 15) && var_8 > 3)) { + ((cellId == 25 || cellId == 26 || cellId == 5 || cellId == 14 || cellId == 15) && deltaX > 3)) { R2_GLOBALS._sound2.play(339); _rotation->_idxChange = 0; - _field1270 = 0; + _speed = 0; _mazeChangeAmount = 0; - _field1272 = 0; - if (_action1._field24 == 0) - _actor8.hide(); + _updateIdxChangeFl = false; + if (!_action1._turningFl) + _tunnelVertCircle.hide(); } else { - var_6 = _mazeUI.cellFromY(newMazeY + 46) - 46; + mazePosY = _mazeUI.cellFromY(newMazeY + 46) - 46; newMazeY = _mazePosition.y - _mazeChangeAmount; - dx = _mazeUI.getCellFromMapXY(Common::Point(newMazeX + 70, newMazeY + 46)); - if (((cellId == 23) || (cellId == 24) || (cellId == 4)) && (cellId != dx)) { - newMazeY = var_6; + tmpCellId = _mazeUI.getCellFromMapXY(Common::Point(newMazeX + 70, newMazeY + 46)); + if (((cellId == 23) || (cellId == 24) || (cellId == 4)) && (cellId != tmpCellId)) { + newMazeY = mazePosY; R2_GLOBALS._sound2.play(339); _rotation->_idxChange = 0; - _field1270 = 0; + _speed = 0; _mazeChangeAmount = 0; - _field1272 = 0; - if (_action1._field24 == 0) - _actor8.hide(); - } else if ((cellId == 11) && (cellId != dx)) { - newMazeY = var_6 + 3; + _updateIdxChangeFl = false; + if (!_action1._turningFl) + _tunnelVertCircle.hide(); + } else if ((cellId == 11) && (cellId != tmpCellId)) { + newMazeY = mazePosY + 3; R2_GLOBALS._sound2.play(339); _rotation->_idxChange = 0; - _field1270 = 0; + _speed = 0; _mazeChangeAmount = 0; - _field1272 = 0; - if (_action1._field24 == 0) - _actor8.hide(); + _updateIdxChangeFl = false; + if (!_action1._turningFl) + _tunnelVertCircle.hide(); } else { - var_6 = _mazeUI.cellFromY(newMazeY + 46) - 46; - var_a = abs(var_6 - newMazeY); + mazePosY = _mazeUI.cellFromY(newMazeY + 46) - 46; + deltaY = abs(mazePosY - newMazeY); cellId = _mazeUI.getCellFromMapXY(Common::Point(newMazeX + 70, newMazeY + 46)); - if ( (((cellId == 23) || (cellId == 24) || (cellId == 4)) && (newMazeY <= var_6) && (_mazePosition.y>= var_6)) - || (((cellId == 25) || (cellId == 26) || (cellId == 5) || (cellId == 14) || (cellId == 15)) && (_mazeChangeAmount >= var_a) && (_mazeChangeAmount > 3) && (_action1._field24 != 0)) ) { - newMazeY = var_6; - if ((cellId != 25) && (cellId != 26) && (cellId != 5) && (cellId != 14) && (cellId == 15)) + if ( (((cellId == 23) || (cellId == 24) || (cellId == 4)) && (newMazeY <= mazePosY) && (_mazePosition.y>= mazePosY)) + || (((cellId == 25) || (cellId == 26) || (cellId == 5) || (cellId == 14) || (cellId == 15)) && (_mazeChangeAmount >= deltaY) && (_mazeChangeAmount > 3) && (_action1._turningFl != 0)) ) { + newMazeY = mazePosY; + if ((cellId != 25) && (cellId != 26) && (cellId != 5) && (cellId != 14) && (cellId != 15)) R2_GLOBALS._sound2.play(339); _rotation->_idxChange = 0; - _field1270 = 0; + _speed = 0; _mazeChangeAmount = 0; - _field1272 = 0; - if (_action1._field24 == 0) - _actor8.hide(); - } else if ((cellId == 11) && (var_6 + 3 >= newMazeY) && (_mazePosition.y >= var_6 + 3)) { + _updateIdxChangeFl = false; + if (!_action1._turningFl) + _tunnelVertCircle.hide(); + } else if ((cellId == 11) && (mazePosY + 3 >= newMazeY) && (_mazePosition.y >= mazePosY + 3)) { R2_GLOBALS._sound2.play(339); _rotation->_idxChange = 0; - _field1270 = 0; + _speed = 0; _mazeChangeAmount = 0; - _field1272 = 0; - if (_action1._field24 == 0) - _actor8.hide(); - } else if (((cellId == 25) || (cellId == 26) || (cellId == 5) || (cellId == 14) || (cellId == 15)) && (var_8 != 0) && (var_8 <= 3)) { - newMazeX = var_4; + _updateIdxChangeFl = false; + if (!_action1._turningFl) + _tunnelVertCircle.hide(); + } else if (((cellId == 25) || (cellId == 26) || (cellId == 5) || (cellId == 14) || (cellId == 15)) && (deltaX != 0) && (deltaX <= 3)) { + newMazeX = mazePosX; R2_GLOBALS._sound2.play(339); } else { // Nothing @@ -3946,62 +3983,62 @@ void Scene3500::dispatch() { case MAZEDIR_EAST: cellId = _mazeUI.getCellFromMapXY(Common::Point(newMazeX + 70, newMazeY + 46)); if ( ((cellId == 12) || (cellId == 13) || (cellId == 11) || (cellId == 16) || (cellId == 31)) - || (((cellId == 25) || (cellId == 23) || (cellId == 14) || (cellId == 5) || (cellId == 4)) && (var_a > 3)) ) { + || (((cellId == 25) || (cellId == 23) || (cellId == 14) || (cellId == 5) || (cellId == 4)) && (deltaY > 3)) ) { R2_GLOBALS._sound2.play(339); _rotation->_idxChange = 0; - _field1270 = 0; + _speed = 0; _mazeChangeAmount = 0; - _field1272 = 0; - if (_action1._field24 == 0) - _actor8.hide(); + _updateIdxChangeFl = false; + if (!_action1._turningFl) + _tunnelVertCircle.hide(); } else { - var_4 = _mazeUI.cellFromX(newMazeX + 70) - 70; + mazePosX = _mazeUI.cellFromX(newMazeX + 70) - 70; newMazeX = _mazePosition.x + _mazeChangeAmount; - dx = _mazeUI.getCellFromMapXY(Common::Point(newMazeX + 70, newMazeY + 46)); - if (((cellId == 26) || (cellId == 24) || (cellId == 15)) && (cellId != dx)) { - newMazeX = var_4; + tmpCellId = _mazeUI.getCellFromMapXY(Common::Point(newMazeX + 70, newMazeY + 46)); + if (((cellId == 26) || (cellId == 24) || (cellId == 15)) && (cellId != tmpCellId)) { + newMazeX = mazePosX; R2_GLOBALS._sound2.play(339); _rotation->_idxChange = 0; - _field1270 = 0; + _speed = 0; _mazeChangeAmount = 0; - _field1272 = 0; - if (_action1._field24 == 0) - _actor8.hide(); - } else if ((cellId == 6) && (cellId != dx)) { - newMazeX = var_4 - 5; + _updateIdxChangeFl = false; + if (!_action1._turningFl) + _tunnelVertCircle.hide(); + } else if ((cellId == 6) && (cellId != tmpCellId)) { + newMazeX = mazePosX - 5; R2_GLOBALS._sound2.play(339); _rotation->_idxChange = 0; - _field1270 = 0; + _speed = 0; _mazeChangeAmount = 0; - _field1272 = 0; - if (_action1._field24 == 0) - _actor8.hide(); + _updateIdxChangeFl = false; + if (!_action1._turningFl) + _tunnelVertCircle.hide(); } else { - var_4 = _mazeUI.cellFromX(newMazeX + 70) - 70; - var_8 = abs(newMazeX - var_4); + mazePosX = _mazeUI.cellFromX(newMazeX + 70) - 70; + deltaX = abs(newMazeX - mazePosX); cellId = _mazeUI.getCellFromMapXY(Common::Point(newMazeX + 70, newMazeY + 46)); - if ( (((cellId == 26) || (cellId == 24) || (cellId == 15)) && (newMazeX >= var_4) && (_mazePosition.x <= var_4)) - || (((cellId == 25) || (cellId == 23) || (cellId == 14) || (cellId == 5) || (cellId == 4)) && (_mazeChangeAmount >= var_8) && (_mazeChangeAmount <= 3) && (_action1._field24 != 0)) ) { - newMazeX = var_4; + if ( (((cellId == 26) || (cellId == 24) || (cellId == 15)) && (newMazeX >= mazePosX) && (_mazePosition.x <= mazePosX)) + || (((cellId == 25) || (cellId == 23) || (cellId == 14) || (cellId == 5) || (cellId == 4)) && (_mazeChangeAmount >= deltaX) && (_mazeChangeAmount <= 3) && (_action1._turningFl != 0)) ) { + newMazeX = mazePosX; if ((cellId == 25) || (cellId == 23) || (cellId == 14) || (cellId == 5) || (cellId == 4)) R2_GLOBALS._sound2.play(339); _rotation->_idxChange = 0; - _field1270 = 0; + _speed = 0; _mazeChangeAmount = 0; - _field1272 = 0; - if (_action1._field24 == 0) - _actor8.hide(); - } else if ((cellId == 6) && (var_4 - 5 <= newMazeX) && (_mazePosition.x <= var_4 - 5)) { - newMazeX = var_4 - 5; + _updateIdxChangeFl = false; + if (!_action1._turningFl) + _tunnelVertCircle.hide(); + } else if ((cellId == 6) && (mazePosX - 5 <= newMazeX) && (_mazePosition.x <= mazePosX - 5)) { + newMazeX = mazePosX - 5; R2_GLOBALS._sound2.play(339); _rotation->_idxChange = 0; - _field1270 = 0; + _speed = 0; _mazeChangeAmount = 0; - _field1272 = 0; - if (_action1._field24 == 0) - _actor8.hide(); - } else if (((cellId == 25) || (cellId == 23) || (cellId == 14) || (cellId == 5) || (cellId == 4)) && (var_a != 0) && (var_a <= 3)) { - newMazeY = var_6; + _updateIdxChangeFl = false; + if (!_action1._turningFl) + _tunnelVertCircle.hide(); + } else if (((cellId == 25) || (cellId == 23) || (cellId == 14) || (cellId == 5) || (cellId == 4)) && (deltaY != 0) && (deltaY <= 3)) { + newMazeY = mazePosY; R2_GLOBALS._sound2.play(339); } else { // Nothing @@ -4012,84 +4049,84 @@ void Scene3500::dispatch() { case MAZEDIR_SOUTH: cellId = _mazeUI.getCellFromMapXY(Common::Point(newMazeX + 70, newMazeY + 46)); if ( ((cellId == 2) || (cellId == 3) || (cellId == 6) || (cellId == 1)) - || (((cellId == 23) || (cellId == 24) || (cellId == 4) || (cellId == 14) || (cellId == 15)) && (var_8 > 3)) ) { + || (((cellId == 23) || (cellId == 24) || (cellId == 4) || (cellId == 14) || (cellId == 15)) && (deltaX > 3)) ) { R2_GLOBALS._sound2.play(339); _rotation->_idxChange = 0; - _field1270 = 0; + _speed = 0; _mazeChangeAmount = 0; - _field1272 = 0; - if (_action1._field24 == 0) - _actor8.hide(); + _updateIdxChangeFl = false; + if (!_action1._turningFl) + _tunnelVertCircle.hide(); } else { - var_6 = _mazeUI.cellFromY(newMazeY + 46) - 46; + mazePosY = _mazeUI.cellFromY(newMazeY + 46) - 46; newMazeY = _mazePosition.y + _mazeChangeAmount; - dx = _mazeUI.getCellFromMapXY(Common::Point(newMazeX + 70, newMazeY + 46)); + tmpCellId = _mazeUI.getCellFromMapXY(Common::Point(newMazeX + 70, newMazeY + 46)); - if (((cellId == 25) || (cellId == 26) || (cellId == 5)) && (cellId != dx)) { + if (((cellId == 25) || (cellId == 26) || (cellId == 5)) && (cellId != tmpCellId)) { R2_GLOBALS._sound2.play(339); _rotation->_idxChange = 0; - _field1270 = 0; + _speed = 0; _mazeChangeAmount = 0; - _field1272 = 0; - if (_action1._field24 == 0) - _actor8.hide(); - } else if ((cellId == 16) && (cellId != dx)) { - newMazeY = var_6 - 3; + _updateIdxChangeFl = false; + if (!_action1._turningFl) + _tunnelVertCircle.hide(); + } else if ((cellId == 16) && (cellId != tmpCellId)) { + newMazeY = mazePosY - 3; R2_GLOBALS._sound2.play(339); _rotation->_idxChange = 0; - _field1270 = 0; + _speed = 0; _mazeChangeAmount = 0; - _field1272 = 0; - if (_action1._field24 == 0) - _actor8.hide(); - } else if ((cellId == 31) && (cellId != dx)) { - newMazeY = var_6 + 4; + _updateIdxChangeFl = false; + if (!_action1._turningFl) + _tunnelVertCircle.hide(); + } else if ((cellId == 31) && (cellId != tmpCellId)) { + newMazeY = mazePosY + 4; R2_GLOBALS._sound2.play(339); _rotation->_idxChange = 0; - _field1270 = 0; + _speed = 0; _mazeChangeAmount = 0; - _field1272 = 0; - if (_action1._field24 == 0) - _actor8.hide(); + _updateIdxChangeFl = false; + if (!_action1._turningFl) + _tunnelVertCircle.hide(); } else { - var_6 = _mazeUI.cellFromY(newMazeY + 46) - 46; - var_a = abs(newMazeY - var_6); + mazePosY = _mazeUI.cellFromY(newMazeY + 46) - 46; + deltaY = abs(newMazeY - mazePosY); cellId = _mazeUI.getCellFromMapXY(Common::Point(newMazeX + 70, newMazeY + 46)); - if ( (((cellId == 25) || (cellId == 26) || (cellId == 5)) && (newMazeY >= var_6) && (_mazePosition.y <= var_6)) - || (((cellId == 23) || (cellId == 24) || (cellId == 4) || (cellId == 14) || (cellId == 15)) && (_mazeChangeAmount >= var_a) && (_mazeChangeAmount <= 3) && (_action1._field24 != 0)) ){ - newMazeY = var_6; + if ( (((cellId == 25) || (cellId == 26) || (cellId == 5)) && (newMazeY >= mazePosY) && (_mazePosition.y <= mazePosY)) + || (((cellId == 23) || (cellId == 24) || (cellId == 4) || (cellId == 14) || (cellId == 15)) && (_mazeChangeAmount >= deltaY) && (_mazeChangeAmount <= 3) && (_action1._turningFl != 0)) ){ + newMazeY = mazePosY; if ((cellId != 23) && (cellId != 24) && (cellId != 4) && (cellId != 14) && (cellId != 15)) R2_GLOBALS._sound2.play(339); _rotation->_idxChange = 0; - _field1270 = 0; + _speed = 0; _mazeChangeAmount = 0; - _field1272 = 0; - if (_action1._field24 == 0) - _actor8.hide(); - } else if ((cellId == 16) && (var_6 - 3 <= newMazeY) && (_mazePosition.y <= var_6 - 3)) { - newMazeY = var_6 - 3; + _updateIdxChangeFl = false; + if (!_action1._turningFl) + _tunnelVertCircle.hide(); + } else if ((cellId == 16) && (mazePosY - 3 <= newMazeY) && (_mazePosition.y <= mazePosY - 3)) { + newMazeY = mazePosY - 3; R2_GLOBALS._sound2.play(339); _rotation->_idxChange = 0; - _field1270 = 0; + _speed = 0; _mazeChangeAmount = 0; - _field1272 = 0; - if (_action1._field24 == 0) - _actor8.hide(); - } else if ((cellId == 31) && (var_6 + 4 <= newMazeY) && (_mazePosition.y <= var_6 + 4)) { - newMazeY = var_6 + 4; + _updateIdxChangeFl = false; + if (!_action1._turningFl) + _tunnelVertCircle.hide(); + } else if ((cellId == 31) && (mazePosY + 4 <= newMazeY) && (_mazePosition.y <= mazePosY + 4)) { + newMazeY = mazePosY + 4; _rotation->_idxChange = 0; - _field1270 = 0; + _speed = 0; _mazeChangeAmount = 0; - _field1272 = 0; - if (_action1._field24 == 0) - _actor8.hide(); + _updateIdxChangeFl = false; + if (!_action1._turningFl) + _tunnelVertCircle.hide(); if ((newMazeX == 660) && (_mazeChangeAmount + 306 <= newMazeY) && (newMazeY <= 307)) - ++_field1284; + ++_exitCounter; else R2_GLOBALS._sound2.play(339); - } else if (((cellId == 23) || (cellId == 24) || (cellId == 4) || (cellId == 14) || (cellId == 15)) && (var_8 != 0) && (var_8 <= 3)) { - newMazeX = var_4; + } else if (((cellId == 23) || (cellId == 24) || (cellId == 4) || (cellId == 14) || (cellId == 15)) && (deltaX != 0) && (deltaX <= 3)) { + newMazeX = mazePosX; R2_GLOBALS._sound2.play(339); } else { // Nothing @@ -4100,62 +4137,62 @@ void Scene3500::dispatch() { case MAZEDIR_WEST: cellId = _mazeUI.getCellFromMapXY(Common::Point(newMazeX + 70, newMazeY + 46)); if ( ((cellId == 12) || (cellId == 13) || (cellId == 11) || (cellId == 16) || (cellId == 31)) - || (((cellId == 26) || (cellId == 24) || (cellId == 15) || (cellId == 5) || (cellId == 4)) && (var_a > 3)) ) { + || (((cellId == 26) || (cellId == 24) || (cellId == 15) || (cellId == 5) || (cellId == 4)) && (deltaY > 3)) ) { R2_GLOBALS._sound2.play(339); _rotation->_idxChange = 0; - _field1270 = 0; + _speed = 0; _mazeChangeAmount = 0; - _field1272 = 0; - if (_action1._field24 == 0) - _actor8.hide(); + _updateIdxChangeFl = false; + if (!_action1._turningFl) + _tunnelVertCircle.hide(); } else { - var_4 = _mazeUI.cellFromX(newMazeX + 70) - 70; + mazePosX = _mazeUI.cellFromX(newMazeX + 70) - 70; newMazeX = _mazePosition.x - _mazeChangeAmount; - dx = _mazeUI.getCellFromMapXY(Common::Point(newMazeX + 70, newMazeY + 46)); - if (((cellId == 25) || (cellId == 23) || (cellId == 14)) && (cellId != dx)) { - newMazeX = var_4; + tmpCellId = _mazeUI.getCellFromMapXY(Common::Point(newMazeX + 70, newMazeY + 46)); + if (((cellId == 25) || (cellId == 23) || (cellId == 14)) && (cellId != tmpCellId)) { + newMazeX = mazePosX; R2_GLOBALS._sound2.play(339); _rotation->_idxChange = 0; - _field1270 = 0; + _speed = 0; _mazeChangeAmount = 0; - _field1272 = 0; - if (_action1._field24 == 0) - _actor8.hide(); - } else if ((cellId == 1) && (cellId != dx)) { - newMazeX = var_4 + 5; + _updateIdxChangeFl = false; + if (!_action1._turningFl) + _tunnelVertCircle.hide(); + } else if ((cellId == 1) && (cellId != tmpCellId)) { + newMazeX = mazePosX + 5; R2_GLOBALS._sound2.play(339); _rotation->_idxChange = 0; - _field1270 = 0; + _speed = 0; _mazeChangeAmount = 0; - _field1272 = 0; - if (_action1._field24 == 0) - _actor8.hide(); + _updateIdxChangeFl = false; + if (!_action1._turningFl) + _tunnelVertCircle.hide(); } else { - var_4 = _mazeUI.cellFromX(newMazeX + 70) - 70; - var_8 = abs(var_4 - newMazeX); + mazePosX = _mazeUI.cellFromX(newMazeX + 70) - 70; + deltaX = abs(mazePosX - newMazeX); cellId = _mazeUI.getCellFromMapXY(Common::Point(newMazeX + 70, newMazeY + 46)); - if ( (((cellId == 25) || (cellId == 23) || (cellId == 14)) && (newMazeX <= var_4) && (_mazePosition.x >= var_4)) - || (((cellId == 26) || (cellId == 24) || (cellId == 15) || (cellId == 5) || (cellId == 4)) && (_mazeChangeAmount >= var_8) && (_mazeChangeAmount <= 3) && (_action1._field24 != 0)) ) { - newMazeX = var_4; + if ( (((cellId == 25) || (cellId == 23) || (cellId == 14)) && (newMazeX <= mazePosX) && (_mazePosition.x >= mazePosX)) + || (((cellId == 26) || (cellId == 24) || (cellId == 15) || (cellId == 5) || (cellId == 4)) && (_mazeChangeAmount >= deltaX) && (_mazeChangeAmount <= 3) && (_action1._turningFl)) ) { + newMazeX = mazePosX; if ((cellId == 26) || (cellId == 24) || (cellId == 15) || (cellId == 5) || (cellId == 4)) R2_GLOBALS._sound2.play(339); _rotation->_idxChange = 0; - _field1270 = 0; + _speed = 0; _mazeChangeAmount = 0; - _field1272 = 0; - if (_action1._field24 == 0) - _actor8.hide(); - } else if ((cellId == 1) && (newMazeX >= var_4 + 5) && (_mazePosition.x >= var_4 + 5)) { - newMazeX = var_4 + 5; + _updateIdxChangeFl = false; + if (!_action1._turningFl) + _tunnelVertCircle.hide(); + } else if ((cellId == 1) && (newMazeX >= mazePosX + 5) && (_mazePosition.x >= mazePosX + 5)) { + newMazeX = mazePosX + 5; R2_GLOBALS._sound2.play(339); _rotation->_idxChange = 0; - _field1270 = 0; + _speed = 0; _mazeChangeAmount = 0; - _field1272 = 0; - if (_action1._field24 == 0) - _actor8.hide(); - } else if (((cellId == 26) || (cellId == 24) || (cellId == 15) || (cellId == 5) || (cellId == 4)) && (var_a != 0) && (var_a <= 3)) { - newMazeY = var_6; + _updateIdxChangeFl = false; + if (!_action1._turningFl) + _tunnelVertCircle.hide(); + } else if (((cellId == 26) || (cellId == 24) || (cellId == 15) || (cellId == 5) || (cellId == 4)) && (deltaY != 0) && (deltaY <= 3)) { + newMazeY = mazePosY; R2_GLOBALS._sound2.play(339); } else { // Nothing @@ -4167,32 +4204,32 @@ void Scene3500::dispatch() { break; } - if (_field1284 < 2) { + if (_exitCounter < 2) { _mazePosition.x = newMazeX; _mazePosition.y = newMazeY; if (_mazeUI.setMazePosition2(_mazePosition) != 0) { - _field1272 = 0; + _updateIdxChangeFl = false; _mazeChangeAmount = 0; - _field1270 = 0; + _speed = 0; _rotation->setDelay(0); _rotation->_idxChange = 0; } _mazeUI.draw(); - if (_field1284 != 0) - ++_field1284; + if (_exitCounter != 0) + ++_exitCounter; } } - if (_field1272 == 0) { - if (_mazeChangeAmount != _field1270) { - if (_mazeChangeAmount >= _field1270) { + if (!_updateIdxChangeFl) { + if (_mazeChangeAmount != _speed) { + if (_mazeChangeAmount >= _speed) { if (_mazeChangeAmount == 1) { - if (_action1._field24 != 0) { - if ( ((_mazeDirection == 1) && (var_8 == 0) && (var_a != 0) && (var_a <= 3) && ((cellId == 25) || (cellId == 26) || (cellId == 5) || (cellId == 14) || (cellId == 15))) - || ((_mazeDirection == 3) && (var_a == 0) && (var_8 != 0) && (var_8 <= 3) && ((cellId == 25) || (cellId == 23) || (cellId == 14) || (cellId == 5) || (cellId == 4))) - || ((_mazeDirection == 5) && (var_8 == 0) && (var_a != 0) && (var_a <= 3) && ((cellId == 23) || (cellId == 24) || (cellId == 4) || (cellId == 14) || (cellId == 15))) - || ((_mazeDirection == 7) && (var_a == 0) && (var_8 != 0) && (var_8 <= 3) && ((cellId == 26) || (cellId == 24) || (cellId == 15) || (cellId == 5) || (cellId == 4))) ){ + if (_action1._turningFl) { + if ( ((_mazeDirection == 1) && (deltaX == 0) && (deltaY != 0) && (deltaY <= 3) && ((cellId == 25) || (cellId == 26) || (cellId == 5) || (cellId == 14) || (cellId == 15))) + || ((_mazeDirection == 3) && (deltaY == 0) && (deltaX != 0) && (deltaX <= 3) && ((cellId == 25) || (cellId == 23) || (cellId == 14) || (cellId == 5) || (cellId == 4))) + || ((_mazeDirection == 5) && (deltaX == 0) && (deltaY != 0) && (deltaY <= 3) && ((cellId == 23) || (cellId == 24) || (cellId == 4) || (cellId == 14) || (cellId == 15))) + || ((_mazeDirection == 7) && (deltaY == 0) && (deltaX != 0) && (deltaX <= 3) && ((cellId == 26) || (cellId == 24) || (cellId == 15) || (cellId == 5) || (cellId == 4))) ){ _mazeChangeAmount = 1; } else _mazeChangeAmount--; @@ -4202,34 +4239,30 @@ void Scene3500::dispatch() { _mazeChangeAmount--; } else ++_mazeChangeAmount; - _field1272 = 1; + _updateIdxChangeFl = true; } - _actor2.setFrame2(_mazeChangeAmount + 1); + _verticalSpeedDisplay.setFrame2(_mazeChangeAmount + 1); } - if (_field1272 == 1) { + if (_updateIdxChangeFl) { if (_mazeChangeAmount == 0) _rotation->_idxChange = 0; else if (_mazeChangeAmount > 8) _rotation->_idxChange = 2; else _rotation->_idxChange = 1; - } - if (_field1272 != 0) - _field1272--; + _updateIdxChangeFl = false; + } if (_mazeChangeAmount != 0) { - R2_GLOBALS._player._uiEnabled = false; - if (_mazeChangeAmount != _field1270) + R2_GLOBALS._player._uiEnabled = false; + if (_mazeChangeAmount != _speed) _aSound1.play(276); } else { R2_GLOBALS._player._uiEnabled = true; _aSound1.fadeOut2(NULL); } - - if (_rotation->_currIndex != _field1274) - _field1274 = _rotation->_currIndex; } /*-------------------------------------------------------------------------- @@ -4238,32 +4271,28 @@ void Scene3500::dispatch() { *--------------------------------------------------------------------------*/ Scene3600::Scene3600() { - _field2548 = 0; - _field254A = 0; - _field254C = 0; - _field254E = 0; + _tealDead = false; + _lightEntered = false; _ghoulTeleported = false; } void Scene3600::synchronize(Serializer &s) { SceneExt::synchronize(s); - s.syncAsSint16LE(_field2548); - s.syncAsSint16LE(_field254A); - s.syncAsSint16LE(_field254C); - s.syncAsSint16LE(_field254E); + s.syncAsSint16LE(_tealDead); + s.syncAsSint16LE(_lightEntered); s.syncAsSint16LE(_ghoulTeleported); } Scene3600::Action3600::Action3600() { - _field1E = 0; - _field20 = 0; + _part2Fl = false; + _fadePct = 0; } void Scene3600::Action3600::synchronize(Serializer &s) { Action::synchronize(s); - s.syncAsSint16LE(_field1E); - s.syncAsSint16LE(_field20); + s.syncAsSint16LE(_part2Fl); + s.syncAsSint16LE(_fadePct); } void Scene3600::Action3600::signal() { @@ -4275,17 +4304,17 @@ void Scene3600::Action3600::signal() { setDelay(60); break; case 1: - if (_field1E == 0) { - _field1E = 1; - scene->_actor2.setAction(NULL); + if (!_part2Fl) { + _part2Fl = true; + scene->_steppingDisk.setAction(NULL); R2_GLOBALS._sound2.play(330, NULL, 0); R2_GLOBALS._sound2.fade(127, 5, 10, false, NULL); } setDelay(1); - R2_GLOBALS._scenePalette.fade((const byte *)&scene->_palette1._palette, true, _field20); - if (_field20 > 0) - _field20 -= 2; + R2_GLOBALS._scenePalette.fade((const byte *)&scene->_palette1._palette, true, _fadePct); + if (_fadePct > 0) + _fadePct -= 2; break; case 2: R2_GLOBALS._sound2.stop(); @@ -4317,7 +4346,7 @@ void Scene3600::Action2::signal() { scene->_protector.setup(3127, 2, 1); scene->_protector.animate(ANIM_MODE_1, NULL); NpcMover *mover = new NpcMover(); - scene->_protector.addMover(mover, &scene->_protector._field8A, scene); + scene->_protector.addMover(mover, &scene->_protector._actorDestPos, scene); } break; default: @@ -4327,10 +4356,10 @@ void Scene3600::Action2::signal() { } } -bool Scene3600::Item5::startAction(CursorType action, Event &event) { +bool Scene3600::LightShaft::startAction(CursorType action, Event &event) { Scene3600 *scene = (Scene3600 *)R2_GLOBALS._sceneManager._scene; - if ((action != CURSOR_USE) || (scene->_action1._field1E == 0)) + if ((action != CURSOR_USE) || !scene->_action1._part2Fl) return SceneItem::startAction(action, event); R2_GLOBALS._walkRegions.enableRegion(2); @@ -4338,10 +4367,10 @@ bool Scene3600::Item5::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3624; - scene->_actor10.setStrip2(-1); - scene->_actor11.setStrip2(-1); - scene->_actor12.setStrip2(-1); - scene->_actor4.setStrip2(-1); + scene->_quinn.setStrip2(-1); + scene->_seeker.setStrip2(-1); + scene->_miranda.setStrip2(-1); + scene->_webbster.setStrip2(-1); if (R2_GLOBALS._player._characterIndex == R2_SEEKER) R2_GLOBALS._player.setAction(&scene->_sequenceManager3, scene, 3611, &R2_GLOBALS._player, NULL); @@ -4364,14 +4393,14 @@ bool Scene3600::Protector::startAction(CursorType action, Event &event) { scene->_protectorSpeaker._displayMode = 1; if (!R2_GLOBALS._player._mover) R2_GLOBALS._player.addMover(NULL); - if (!scene->_actor10._mover) - scene->_actor10.addMover(NULL); - if (!scene->_actor11._mover) - scene->_actor11.addMover(NULL); - if (!scene->_actor12._mover) - scene->_actor12.addMover(NULL); - if (!scene->_actor4._mover) - scene->_actor4.addMover(NULL); + if (!scene->_quinn._mover) + scene->_quinn.addMover(NULL); + if (!scene->_seeker._mover) + scene->_seeker.addMover(NULL); + if (!scene->_miranda._mover) + scene->_miranda.addMover(NULL); + if (!scene->_webbster._mover) + scene->_webbster.addMover(NULL); setup(3127, 2, 1); scene->_sceneMode = 3327; @@ -4409,16 +4438,13 @@ bool Scene3600::Protector::startAction(CursorType action, Event &event) { void Scene3600::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._sceneManager._previousScene == 3600) { R2_GLOBALS._scrollFollower = &R2_GLOBALS._player; - R2_GLOBALS._v558B6.set(60, 0, 260, 200); } else { - R2_GLOBALS._scrollFollower = &_actor2; + R2_GLOBALS._scrollFollower = &_steppingDisk; _sceneBounds = Rect(160, 0, 480, 200); - R2_GLOBALS._v558B6.set(25, 0, 260, 200); } loadScene(3600); SceneExt::postInit(); - _field254C = 0; _stripManager.setColors(60, 255); _stripManager.setFontNumber(3); @@ -4433,62 +4459,61 @@ void Scene3600::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._characterScene[R2_SEEKER] = 3600; R2_GLOBALS._player._characterScene[R2_MIRANDA] = 3600; - _item2.setDetails(33, 3600, 6, -1, -1); - _item3.setDetails(Rect(3, 3, 22, 45), 3600, 9, -1, -1, 1, NULL); - _item4.setDetails(Rect(449, 3, 475, 45), 3600, 9, -1, -1, 1, NULL); + _console.setDetails(33, 3600, 6, -1, -1); + _tapestry1.setDetails(Rect(3, 3, 22, 45), 3600, 9, -1, -1, 1, NULL); + _tapestry2.setDetails(Rect(449, 3, 475, 45), 3600, 9, -1, -1, 1, NULL); - _actor10.postInit(); - _actor10._moveDiff = Common::Point(3, 2); - _actor10.changeZoom(-1); - _actor10._effect = 1; + _quinn.postInit(); + _quinn._moveDiff = Common::Point(3, 2); + _quinn.changeZoom(-1); + _quinn._effect = EFFECT_SHADED; - if (R2_GLOBALS._player._characterIndex != 1) - _actor10.setDetails(9001, 0, -1, -1, 1, (SceneItem *) NULL); + if (R2_GLOBALS._player._characterIndex != R2_QUINN) + _quinn.setDetails(9001, 0, -1, -1, 1, (SceneItem *) NULL); - _actor11.postInit(); - _actor11._numFrames = 7; - _actor11._moveDiff = Common::Point(5, 3); - _actor11.changeZoom(-1); - _actor11._effect = 1; + _seeker.postInit(); + _seeker._numFrames = 7; + _seeker._moveDiff = Common::Point(5, 3); + _seeker.changeZoom(-1); + _seeker._effect = EFFECT_SHADED; - if (R2_GLOBALS._player._characterIndex != 2) - _actor11.setDetails(9002, 1, -1, -1, 1, (SceneItem *) NULL); + if (R2_GLOBALS._player._characterIndex != R2_SEEKER) + _seeker.setDetails(9002, 1, -1, -1, 1, (SceneItem *) NULL); - _actor12.postInit(); - _actor12._moveDiff = Common::Point(3, 2); - _actor12.changeZoom(-1); - _actor12._effect = 1; + _miranda.postInit(); + _miranda._moveDiff = Common::Point(3, 2); + _miranda.changeZoom(-1); + _miranda._effect = EFFECT_SHADED; - if (R2_GLOBALS._player._characterIndex != 3) - _actor12.setDetails(9003, 1, -1, -1, 1, (SceneItem *) NULL); + if (R2_GLOBALS._player._characterIndex != R2_MIRANDA) + _miranda.setDetails(9003, 1, -1, -1, 1, (SceneItem *) NULL); R2_GLOBALS._player.postInit(); R2_GLOBALS._player.changeZoom(-1); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); R2_GLOBALS._player.disableControl(); - _actor4.postInit(); - _actor4._numFrames = 7; - _actor4._moveDiff = Common::Point(5, 3); - _actor4.changeZoom(-1); - _actor4._effect = 1; - _actor4.setDetails(3600, 27, -1, -1, 1, (SceneItem *) NULL); + _webbster.postInit(); + _webbster._numFrames = 7; + _webbster._moveDiff = Common::Point(5, 3); + _webbster.changeZoom(-1); + _webbster._effect = EFFECT_SHADED; + _webbster.setDetails(3600, 27, -1, -1, 1, (SceneItem *) NULL); - _actor5.postInit(); - _actor5._numFrames = 7; - _actor5._moveDiff = Common::Point(3, 2); - _actor5.changeZoom(-1); - _actor5._effect = 1; - _actor5.setDetails(3600, 12, -1, -1, 1, (SceneItem *) NULL); + _teal.postInit(); + _teal._numFrames = 7; + _teal._moveDiff = Common::Point(3, 2); + _teal.changeZoom(-1); + _teal._effect = EFFECT_SHADED; + _teal.setDetails(3600, 12, -1, -1, 1, (SceneItem *) NULL); _palette1.loadPalette(0); _palette1.loadPalette(3601); if (R2_GLOBALS._sceneManager._previousScene == 3600) { - _item5._sceneRegionId = 200; - _item5.setDetails(3600, 30, -1, -1, 5, &_actor4); - _field254A = 1; - _field2548 = 1; + _lightShaft._sceneRegionId = 200; + _lightShaft.setDetails(3600, 30, -1, -1, 5, &_webbster); + _tealDead = true; R2_GLOBALS._walkRegions.disableRegion(2); R2_GLOBALS._walkRegions.disableRegion(7); @@ -4496,51 +4521,51 @@ void Scene3600::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._walkRegions.disableRegion(15); R2_GLOBALS._walkRegions.disableRegion(16); - _actor10.setup(10, 5, 11); - _actor10.animate(ANIM_MODE_1, NULL); + _quinn.setup(10, 5, 11); + _quinn.animate(ANIM_MODE_1, NULL); - _actor11.setup(20, 5, 11); - _actor11.animate(ANIM_MODE_1, NULL); + _seeker.setup(20, 5, 11); + _seeker.animate(ANIM_MODE_1, NULL); - _actor12.setup(30, 5, 11); - _actor12.animate(ANIM_MODE_1, NULL); + _miranda.setup(30, 5, 11); + _miranda.animate(ANIM_MODE_1, NULL); if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { - _actor10.setPosition(Common::Point(76, 148)); - _actor11.setPosition(Common::Point(134, 148)); - _actor12.setPosition(Common::Point(100, 148)); + _quinn.setPosition(Common::Point(76, 148)); + _seeker.setPosition(Common::Point(134, 148)); + _miranda.setPosition(Common::Point(100, 148)); R2_GLOBALS._player._moveDiff = Common::Point(5, 3); - R2_GLOBALS._player.setup(20, _actor11._strip, 1); - R2_GLOBALS._player.setPosition(_actor11._position); - _actor11.hide(); + R2_GLOBALS._player.setup(20, _seeker._strip, 1); + R2_GLOBALS._player.setPosition(_seeker._position); + _seeker.hide(); } else if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) { - _actor10.setPosition(Common::Point(110, 148)); - _actor11.setPosition(Common::Point(76, 148)); - _actor12.setPosition(Common::Point(134, 148)); + _quinn.setPosition(Common::Point(110, 148)); + _seeker.setPosition(Common::Point(76, 148)); + _miranda.setPosition(Common::Point(134, 148)); R2_GLOBALS._player._moveDiff = Common::Point(3, 2); - R2_GLOBALS._player.setup(30, _actor12._strip, 1); - R2_GLOBALS._player.setPosition(_actor12._position); - _actor12.hide(); + R2_GLOBALS._player.setup(30, _miranda._strip, 1); + R2_GLOBALS._player.setPosition(_miranda._position); + _miranda.hide(); } else { - _actor10.setPosition(Common::Point(134, 148)); - _actor11.setPosition(Common::Point(76, 148)); - _actor12.setPosition(Common::Point(110, 148)); + _quinn.setPosition(Common::Point(134, 148)); + _seeker.setPosition(Common::Point(76, 148)); + _miranda.setPosition(Common::Point(110, 148)); R2_GLOBALS._player._moveDiff = Common::Point(3, 2); - R2_GLOBALS._player.setup(10, _actor10._strip, 1); - R2_GLOBALS._player.setPosition(_actor10._position); - _actor10.hide(); + R2_GLOBALS._player.setup(10, _quinn._strip, 1); + R2_GLOBALS._player.setPosition(_quinn._position); + _quinn.hide(); } - _actor4.setPosition(Common::Point(47, 149)); - _actor4.setup(40, 1, 11); - _actor4.animate(ANIM_MODE_1, NULL); + _webbster.setPosition(Common::Point(47, 149)); + _webbster.setup(40, 1, 11); + _webbster.animate(ANIM_MODE_1, NULL); - _actor5.setPosition(Common::Point(367, 148)); - _actor5.setup(3601, 7, 5); + _teal.setPosition(Common::Point(367, 148)); + _teal.setup(3601, 7, 5); if (!R2_GLOBALS.getFlag(71)) { _protector.postInit(); _protector._state = 0; - _protector._field8A = Common::Point(226, 152); + _protector._actorDestPos = Common::Point(226, 152); _protector._moveDiff = Common::Point(3, 2); _protector.setPosition(Common::Point(284, 152)); _protector.setup(3127, 2, 1); @@ -4549,65 +4574,64 @@ void Scene3600::postInit(SceneObjectList *OwnerList) { } R2_GLOBALS._sound2.play(330); - _actor3.postInit(); - _actor3.setPosition(Common::Point(84, 156)); - _actor3.fixPriority(158); - _actor3.setup(3601, 5, 1); - _actor3.animate(ANIM_MODE_2, NULL); - - _action1._field1E = 1; - _action1._field20 = 0; + _consoleLights.postInit(); + _consoleLights.setPosition(Common::Point(84, 156)); + _consoleLights.fixPriority(158); + _consoleLights.setup(3601, 5, 1); + _consoleLights.animate(ANIM_MODE_2, NULL); + + _action1._part2Fl = true; + _action1._fadePct = 0; _action1.setActionIndex(1); - _actor3.setAction(&_action1); + _consoleLights.setAction(&_action1); _sceneMode = 3623; g_globals->_events.setCursor(CURSOR_ARROW); R2_GLOBALS._player.enableControl(CURSOR_WALK); } else { - _field254A = 0; - _field2548 = 0; + _tealDead = false; R2_GLOBALS._walkRegions.disableRegion(17); R2_GLOBALS._walkRegions.disableRegion(18); - _actor10.setPosition(Common::Point(393, 148)); - _actor11.setPosition(Common::Point(364, 153)); - _actor12.setPosition(Common::Point(413, 164)); + _quinn.setPosition(Common::Point(393, 148)); + _seeker.setPosition(Common::Point(364, 153)); + _miranda.setPosition(Common::Point(413, 164)); R2_GLOBALS._player.hide(); - _actor4.setPosition(Common::Point(373, 164)); + _webbster.setPosition(Common::Point(373, 164)); - _actor5.setup(3403, 8, 11); - _actor5.setPosition(Common::Point(403, 155)); + _teal.setup(3403, 8, 11); + _teal.setPosition(Common::Point(403, 155)); _protector.setup(3403, 7, 1); _protector.setPosition(Common::Point(405, 155)); - _actor2.postInit(); - _actor2.setup(3600, 2, 1); - _actor2.setPosition(Common::Point(403, 161)); - _actor2.fixPriority(149); - _actor2.changeZoom(-1); + _steppingDisk.postInit(); + _steppingDisk.setup(3600, 2, 1); + _steppingDisk.setPosition(Common::Point(403, 161)); + _steppingDisk.fixPriority(149); + _steppingDisk.changeZoom(-1); - _action1._field1E = 0; - _action1._field20 = 90; + _action1._part2Fl = false; + _action1._fadePct = 90; _sceneMode = 3600; - setAction(&_sequenceManager1, this, 3600, &_actor11, &_actor10, &_actor12, &_actor4, &_actor5, &_actor2, NULL); - _field254E = 0; + setAction(&_sequenceManager1, this, 3600, &_seeker, &_quinn, &_miranda, + &_webbster, &_teal, &_steppingDisk, NULL); } - _field254E = 0; + _lightEntered = false; _ghoulTeleported = R2_GLOBALS.getFlag(71); R2_GLOBALS._sound1.play(326); - _item1.setDetails(Rect(0, 0, 480, 200), 3600, 0, -1, -1, 1, NULL); + _background.setDetails(Rect(0, 0, 480, 200), 3600, 0, -1, -1, 1, NULL); } void Scene3600::remove() { - _actor3.animate(ANIM_MODE_NONE, NULL); - _actor3.setAction(NULL); + _consoleLights.animate(ANIM_MODE_NONE, NULL); + _consoleLights.setAction(NULL); R2_GLOBALS._sound2.fadeOut2(NULL); R2_GLOBALS._sound1.fadeOut2(NULL); R2_GLOBALS._scrollFollower = &R2_GLOBALS._player; @@ -4617,54 +4641,56 @@ void Scene3600::remove() { void Scene3600::signal() { switch (_sceneMode) { case 3320: - // TODO: warning("STUB: sub_1D227()"); + // Move to the console R2_GLOBALS._walkRegions.disableRegion(14); - R2_GLOBALS._scrollFollower = &_actor11; + R2_GLOBALS._scrollFollower = &_seeker; _tealSpeaker._object1.hide(); - _actor5.show(); - _actor5.setStrip(2); + _teal.show(); + _teal.setStrip(2); if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _sceneMode = 3602; else if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) _sceneMode = 3603; else _sceneMode = 3601; - setAction(&_sequenceManager1, this, _sceneMode, &_actor11, &_actor10, &_actor12, &_actor4, &_actor5, NULL); + setAction(&_sequenceManager1, this, _sceneMode, &_seeker, &_quinn, + &_miranda, &_webbster, &_teal, NULL); break; case 3321: - warning("STUB: sub_1D227()"); + // Teal activates console R2_GLOBALS._scrollFollower = &R2_GLOBALS._player; - _tealSpeaker.proc16(); - _actor5.show(); - _actor5.setStrip(1); - _actor3.postInit(); + _tealSpeaker.stopSpeaking(); + _teal.show(); + _teal.setStrip(1); + _consoleLights.postInit(); _sceneMode = 3604; - setAction(&_sequenceManager1, this, _sceneMode, &_actor5, &_actor3, &_actor10, &_actor11, &_actor12, &_actor4, NULL); + setAction(&_sequenceManager1, this, _sceneMode, &_teal, &_consoleLights, + &_quinn, &_seeker, &_miranda, &_webbster, NULL); break; case 3322: - warning("STUB: sub_1D227()"); - _quinnSpeaker.proc16(); + // Teal walks toward the teleport pod, the goule protector appears + _quinnSpeaker.stopSpeaking(); _quinnSpeaker._displayMode = 1; - _tealSpeaker.proc16(); + _tealSpeaker.stopSpeaking(); _tealSpeaker._displayMode = 7; - R2_GLOBALS._scrollFollower = &_actor5; + R2_GLOBALS._scrollFollower = &_teal; _sceneMode = 3605; - setAction(&_sequenceManager1, this, _sceneMode, &_actor5, &_protector, &_actor2, NULL); + setAction(&_sequenceManager1, this, _sceneMode, &_teal, &_protector, &_steppingDisk, NULL); break; case 3323: - if (_field254A == 0) - _field254A = 1; + // Goule protector eats Teal guts then moves + + if (!_tealDead) + _tealDead = true; else { - warning("STUB: sub_1D227()"); - _protectorSpeaker.proc16(); + _protectorSpeaker.stopSpeaking(); _protector.show(); _protector.setup(3258, 6, 1); _sceneMode = 3607; _protector.setAction(&_sequenceManager1, this, _sceneMode, &_protector, NULL); - R2_GLOBALS._v558C2 = 1; - _protectorSpeaker.proc16(); + _protectorSpeaker.stopSpeaking(); _protectorSpeaker._displayMode = 1; _quinnSpeaker._displayMode = 1; _protector.show(); @@ -4678,7 +4704,7 @@ void Scene3600::signal() { R2_GLOBALS._walkRegions.disableRegion(15); R2_GLOBALS._walkRegions.disableRegion(16); - _actor3.setAction(&_action1); + _consoleLights.setAction(&_action1); } break; case 3324: @@ -4688,7 +4714,6 @@ void Scene3600::signal() { R2_GLOBALS._player.enableControl(CURSOR_WALK); _protector.fixPriority(-1); _sceneMode = 3623; - _field2548 = 1; break; case 3327: g_globals->_events.setCursor(CURSOR_ARROW); @@ -4696,29 +4721,30 @@ void Scene3600::signal() { _sceneMode = 3623; break; case 3450: + // Speech of Teal and Quinn R2_GLOBALS._sound1.stop(); - _actor1.hide(); - _actor6.hide(); + _protector3400.hide(); + _door3400.hide(); _sceneBounds = Rect(40, 0, SCREEN_WIDTH + 40, SCREEN_HEIGHT); setZoomPercents(142, 80, 167, 105); loadScene(3600); R2_GLOBALS._uiElements.show(); - _item5._sceneRegionId = 200; - _item5.setDetails(3600, 30, -1, -1, 5, &_actor4); - - _actor3.show(); - _actor10.show(); - _actor11.show(); - _actor12.show(); - _actor4.show(); - _actor5.show(); + _lightShaft._sceneRegionId = 200; + _lightShaft.setDetails(3600, 30, -1, -1, 5, &_webbster); + + _consoleLights.show(); + _quinn.show(); + _seeker.show(); + _miranda.show(); + _webbster.show(); + _teal.show(); - _actor5.setPosition(Common::Point(298, 151)); + _teal.setPosition(Common::Point(298, 151)); _protector.postInit(); _protector._state = 0; - _protector._field8A = Common::Point(226, 152); + _protector._actorDestPos = Common::Point(226, 152); _protector._moveDiff = Common::Point(5, 3); _protector.setup(3403, 7, 1); _protector.setPosition(Common::Point(405, 155)); @@ -4726,32 +4752,32 @@ void Scene3600::signal() { _protector.addMover(NULL); _protector.animate(ANIM_MODE_NONE); _protector.hide(); - _protector.setDetails(3600, 15, -1, 17, 5, &_item5); + _protector.setDetails(3600, 15, -1, 17, 5, &_lightShaft); - _actor2.setup(3600, 2, 1); - _actor2.setPosition(Common::Point(403, 161)); - _actor2.fixPriority(149); - _actor2.changeZoom(-1); - _actor2.show(); + _steppingDisk.setup(3600, 2, 1); + _steppingDisk.setPosition(Common::Point(403, 161)); + _steppingDisk.fixPriority(149); + _steppingDisk.changeZoom(-1); + _steppingDisk.show(); _quinnSpeaker._displayMode = 2; _tealSpeaker._displayMode = 2; if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { R2_GLOBALS._player._moveDiff = Common::Point(5, 3); - R2_GLOBALS._player.setup(20, _actor11._strip, 1); - R2_GLOBALS._player.setPosition(_actor11._position); - _actor11.hide(); + R2_GLOBALS._player.setup(20, _seeker._strip, 1); + R2_GLOBALS._player.setPosition(_seeker._position); + _seeker.hide(); } else if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) { R2_GLOBALS._player._moveDiff = Common::Point(3, 2); - R2_GLOBALS._player.setup(30, _actor12._strip, 1); - R2_GLOBALS._player.setPosition(_actor12._position); - _actor12.hide(); + R2_GLOBALS._player.setup(30, _miranda._strip, 1); + R2_GLOBALS._player.setPosition(_miranda._position); + _miranda.hide(); } else { R2_GLOBALS._player._moveDiff = Common::Point(3, 2); - R2_GLOBALS._player.setup(10, _actor10._strip, 1); - R2_GLOBALS._player.setPosition(_actor10._position); - _actor10.hide(); + R2_GLOBALS._player.setup(10, _quinn._strip, 1); + R2_GLOBALS._player.setPosition(_quinn._position); + _quinn.hide(); } R2_GLOBALS._player.show(); R2_GLOBALS._sound1.play(326); @@ -4760,6 +4786,7 @@ void Scene3600::signal() { R2_GLOBALS._sound2.play(329); break; case 3600: + // First speech by Teal _sceneMode = 3320; _stripManager.start(3320, this); break; @@ -4768,53 +4795,56 @@ void Scene3600::signal() { case 3602: // No break on purpose case 3603: + // Teal speech near the console R2_GLOBALS._walkRegions.disableRegion(2); R2_GLOBALS._walkRegions.disableRegion(7); - R2_GLOBALS._v558B6.set(60, 0, 260, 200); _tealSpeaker._displayMode = 1; _sceneMode = 3321; _stripManager.start(3321, this); break; case 3604: + // Goule Protector forces the door R2_GLOBALS._sound2.fadeOut2(NULL); R2_GLOBALS._sound1.stop(); R2_GLOBALS._walkRegions.enableRegion(2); R2_GLOBALS._walkRegions.enableRegion(7); - _actor2.hide(); - _actor3.hide(); + _steppingDisk.hide(); + _consoleLights.hide(); R2_GLOBALS._player.hide(); - _actor10.hide(); - _actor11.hide(); - _actor12.hide(); - _actor4.hide(); - _actor5.hide(); + _quinn.hide(); + _seeker.hide(); + _miranda.hide(); + _webbster.hide(); + _teal.hide(); _sceneBounds = Rect(60, 0, SCREEN_WIDTH + 60, SCREEN_HEIGHT); setZoomPercents(51, 46, 180, 200); loadScene(3400); R2_GLOBALS._uiElements.show(); - _actor1.postInit(); + _protector3400.postInit(); - _actor2.setup(3403, 1, 1); - _actor2.setPosition(Common::Point(190, 103)); - _actor2.fixPriority(89); - _actor2.show(); + _steppingDisk.setup(3403, 1, 1); + _steppingDisk.setPosition(Common::Point(190, 103)); + _steppingDisk.fixPriority(89); + _steppingDisk.show(); - _actor6.postInit(); - _actor6.setup(3400, 1, 6); - _actor6.setPosition(Common::Point(236, 51)); - _actor6.fixPriority(51); - R2_GLOBALS._scrollFollower = &_actor6; + _door3400.postInit(); + _door3400.setup(3400, 1, 6); + _door3400.setPosition(Common::Point(236, 51)); + _door3400.fixPriority(51); + R2_GLOBALS._scrollFollower = &_door3400; R2_GLOBALS._sound1.play(323); _sceneMode = 3450; - setAction(&_sequenceManager1, this, 3450, &_actor1, &_actor6, NULL); + setAction(&_sequenceManager1, this, 3450, &_protector3400, &_door3400, NULL); break; case 3605: + // Goule protector jumps on Teal _protector.setup(3258, 4, 1); - _protector.setAction(&_sequenceManager1, this, 3606, &_actor5, &_protector, &_actor2, NULL); + _protector.setAction(&_sequenceManager1, this, 3606, &_teal, &_protector, + &_steppingDisk, NULL); _sceneMode = 3323; _stripManager.start(3323, this); @@ -4822,8 +4852,8 @@ void Scene3600::signal() { case 3620: // No break on purpose case 3623: - if ((_protector._position.x == 226) && (_protector._position.y == 152) - && (_action1._field1E != 0) && (_protector._visage == 3127) && (!R2_GLOBALS.getFlag(71))) { + if ((_protector._position.x == 226) && (_protector._position.y == 152) + && _action1._part2Fl && (_protector._visage == 3127) && (!R2_GLOBALS.getFlag(71))) { R2_GLOBALS._sound2.stop(); R2_GLOBALS._sound2.play(331); R2_GLOBALS.setFlag(71); @@ -4833,11 +4863,11 @@ void Scene3600::signal() { break; case 3624: R2_GLOBALS._player.disableControl(); - if ((_field254E != 0) && (_actor10._position.x == 229) && (_actor10._position.y == 154) && (_actor11._position.x == 181) && (_actor11._position.y == 154) && (_actor12._position.x == 207) && (_actor12._position.y == 154) && (_actor4._position.x == 155) && (_actor4._position.y == 154)) { + if (_lightEntered && (_quinn._position.x == 229) && (_quinn._position.y == 154) && (_seeker._position.x == 181) && (_seeker._position.y == 154) && (_miranda._position.x == 207) && (_miranda._position.y == 154) && (_webbster._position.x == 155) && (_webbster._position.y == 154)) { R2_GLOBALS._sound2.stop(); R2_GLOBALS._sound2.play(331); _sceneMode = 3625; - setAction(&_sequenceManager1, this, 3625, &_actor10, &_actor11, &_actor12, &_actor4, NULL); + setAction(&_sequenceManager1, this, 3625, &_quinn, &_seeker, &_miranda, &_webbster, NULL); } break; case 3625: @@ -4862,16 +4892,16 @@ void Scene3600::signal() { } void Scene3600::process(Event &event) { - if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_ARROW) && (event.mousePos.x > 237) && (!R2_GLOBALS.getFlag(71))) { - SceneItem::display(3600, 17, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7 -999); + if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_ARROW) + && (event.mousePos.x > 237) && (!R2_GLOBALS.getFlag(71))) { + SceneItem::display(3600, 17, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); event.handled = true; } Scene::process(event); } void Scene3600::dispatch() { - if ((R2_GLOBALS._player.getRegionIndex() == 200) && (_action1._field1E != 0) - && (_field254E == 0)) { + if ((R2_GLOBALS._player.getRegionIndex() == 200) && _action1._part2Fl && !_lightEntered) { R2_GLOBALS._sound2.fadeOut2(NULL); if (_protector._mover) _protector.addMover(NULL); @@ -4881,8 +4911,7 @@ void Scene3600::dispatch() { if (R2_GLOBALS._player._mover) R2_GLOBALS._player.addMover(NULL); - _field254C = 0; - _field254E = 1; + _lightEntered = true; R2_GLOBALS._walkRegions.enableRegion(2); R2_GLOBALS._walkRegions.enableRegion(7); @@ -4890,30 +4919,30 @@ void Scene3600::dispatch() { _sceneMode = 3624; - _actor10.setStrip(-1); - _actor11.setStrip(-1); - _actor12.setStrip(-1); - _actor4.setStrip(-1); + _quinn.setStrip(-1); + _seeker.setStrip(-1); + _miranda.setStrip(-1); + _webbster.setStrip(-1); R2_GLOBALS._player.hide(); if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { - _actor11.setPosition(R2_GLOBALS._player._position); - _actor11.show(); + _seeker.setPosition(R2_GLOBALS._player._position); + _seeker.show(); } else if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) { - _actor12.setPosition(R2_GLOBALS._player._position); - _actor12.show(); + _miranda.setPosition(R2_GLOBALS._player._position); + _miranda.show(); } else { - _actor10.setPosition(R2_GLOBALS._player._position); - _actor10.show(); + _quinn.setPosition(R2_GLOBALS._player._position); + _quinn.show(); } - _actor10.setAction(&_sequenceManager2, this, 3610, &_actor10, NULL); - _actor11.setAction(&_sequenceManager3, this, 3611, &_actor11, NULL); - _actor12.setAction(&_sequenceManager4, this, 3612, &_actor12, NULL); - _actor4.setAction(&_sequenceManager1, this, 3613, &_actor4, NULL); + _quinn.setAction(&_sequenceManager2, this, 3610, &_quinn, NULL); + _seeker.setAction(&_sequenceManager3, this, 3611, &_seeker, NULL); + _miranda.setAction(&_sequenceManager4, this, 3612, &_miranda, NULL); + _webbster.setAction(&_sequenceManager1, this, 3613, &_webbster, NULL); } - if ((_protector.getRegionIndex() == 200) && (_action1._field1E != 0) && !_ghoulTeleported) { + if ((_protector.getRegionIndex() == 200) && _action1._part2Fl && !_ghoulTeleported) { R2_GLOBALS._sound2.fadeOut2(NULL); _sceneMode = 3620; _ghoulTeleported = true; @@ -4921,14 +4950,14 @@ void Scene3600::dispatch() { if (R2_GLOBALS._player._mover) R2_GLOBALS._player.addMover(NULL); - if (_actor10._mover) - _actor10.addMover(NULL); - if (_actor11._mover) - _actor11.addMover(NULL); - if (_actor12._mover) - _actor12.addMover(NULL); - if (_actor4._mover) - _actor4.addMover(NULL); + if (_quinn._mover) + _quinn.addMover(NULL); + if (_seeker._mover) + _seeker.addMover(NULL); + if (_miranda._mover) + _miranda.addMover(NULL); + if (_webbster._mover) + _webbster.addMover(NULL); } Scene::dispatch(); @@ -4941,8 +4970,9 @@ void Scene3600::dispatch() { void Scene3700::postInit(SceneObjectList *OwnerList) { loadScene(3700); - SceneExt::postInit(); R2_GLOBALS._uiElements._active = false; + R2_GLOBALS._uiElements._visible = false; + SceneExt::postInit(); R2_GLOBALS._interfaceY = SCREEN_HEIGHT; _stripManager.setColors(60, 255); @@ -4968,14 +4998,14 @@ void Scene3700::postInit(SceneObjectList *OwnerList) { _webbster._moveDiff = Common::Point(5, 3); _webbster.hide(); - _actor5.postInit(); + _teleportPad.postInit(); R2_GLOBALS._player.disableControl(); R2_GLOBALS._sound1.play(332); _sceneMode = 3700; - setAction(&_sequenceManager, this, 3700, &_quinn, &_seeker, &_miranda, - &_webbster, &_actor5, NULL); + setAction(&_sequenceManager, this, 3700, &_quinn, &_seeker, &_miranda, + &_webbster, &_teleportPad, NULL); } void Scene3700::remove() { @@ -4988,7 +5018,6 @@ void Scene3700::signal() { case 3328: // No break on purpose case 3329: - warning("STUB: sub_1D227()"); _sceneMode = 3701; setAction(&_sequenceManager, this, 3701, &_seeker, &_miranda, &_webbster, NULL); break; @@ -5019,6 +5048,7 @@ void Scene3700::signal() { Scene3800::Scene3800() { _desertDirection = 0; + _skylineRect.set(0, 0, 320, 87); } void Scene3800::synchronize(Serializer &s) { @@ -5185,13 +5215,14 @@ void Scene3800::initExits() { _southExit._moving = false; _westExit._moving = false; - loadScene(R2_GLOBALS._v566A6); + loadScene(R2_GLOBALS._maze3800SceneNumb); R2_GLOBALS._uiElements.draw(); } void Scene3800::enterArea() { - R2_GLOBALS._player.disableControl(); + R2_GLOBALS._player.disableControl(CURSOR_WALK); + switch (_desertDirection) { case 0: R2_GLOBALS._player.postInit(); @@ -5201,20 +5232,23 @@ void Scene3800::enterArea() { R2_GLOBALS._player.setStrip(3); R2_GLOBALS._player.changeZoom(-1); R2_GLOBALS._player._moveDiff = Common::Point(3, 2); - _actor1.postInit(); - _actor1.fixPriority(10); - _actor1.changeZoom(-1); - _actor1.setVisage(1110); - _actor1._effect = 5; - _actor1._field9C = this->_field312; - R2_GLOBALS._player._linkedActor = &_actor1; + + _quinnShadow.postInit(); + _quinnShadow.fixPriority(10); + _quinnShadow.changeZoom(-1); + _quinnShadow.setVisage(1110); + _quinnShadow._effect = EFFECT_SHADOW_MAP; + _quinnShadow._shadowMap = this->_shadowPaletteMap; + R2_GLOBALS._player._linkedActor = &_quinnShadow; + switch (R2_GLOBALS._sceneManager._previousScene) { case 2600: - _object1.postInit(); - _object2.postInit(); - _actor1.hide(); + _balloon.postInit(); + _harness.postInit(); + _quinnShadow.hide(); _sceneMode = 3800; - setAction(&_sequenceManager1, this, 3800, &R2_GLOBALS._player, &_object1, &_object2, NULL); + setAction(&_sequenceManager1, this, 3800, &R2_GLOBALS._player, + &_balloon, &_harness, NULL); break; case 3900: _sceneMode = 15; @@ -5250,6 +5284,7 @@ void Scene3800::enterArea() { default: break; } + break; default: R2_GLOBALS._player.enableControl(CURSOR_WALK); break; @@ -5313,7 +5348,6 @@ void Scene3800::postInit(SceneObjectList *OwnerList) { _westExit.setDetails(Rect(0, 87, 14, 168), EXITCURSOR_W, 3800); _westExit.setDest(Common::Point(7, 145)); - _rect1.set(0, 0, 320, 87); _background.setDetails(Rect(0, 0, 320, 200), 3800, 0, 1, 2, 1, (SceneItem *) NULL); enterArea(); @@ -5322,45 +5356,43 @@ void Scene3800::postInit(SceneObjectList *OwnerList) { void Scene3800::signal() { switch (_sceneMode) { case 11: - R2_GLOBALS._v566A6 += 15; - if (R2_GLOBALS._v566A6 > 3815) - R2_GLOBALS._v566A6 -= 20; + R2_GLOBALS._maze3800SceneNumb += 15; + if (R2_GLOBALS._maze3800SceneNumb > 3815) + R2_GLOBALS._maze3800SceneNumb -= 20; initExits(); enterArea(); break; case 12: - R2_GLOBALS._v566A6 += 5; - if (R2_GLOBALS._v566A6 > 3815) - R2_GLOBALS._v566A6 = 3800; + R2_GLOBALS._maze3800SceneNumb += 5; + if (R2_GLOBALS._maze3800SceneNumb > 3815) + R2_GLOBALS._maze3800SceneNumb = 3800; initExits(); enterArea(); break; case 13: - R2_GLOBALS._v566A6 -= 15; - if (R2_GLOBALS._v566A6 < 3800) - R2_GLOBALS._v566A6 += 20; + R2_GLOBALS._maze3800SceneNumb -= 15; + if (R2_GLOBALS._maze3800SceneNumb < 3800) + R2_GLOBALS._maze3800SceneNumb += 20; initExits(); enterArea(); break; case 14: - R2_GLOBALS._v566A6 -= 5; - if (R2_GLOBALS._v566A6 < 3800) - R2_GLOBALS._v566A6 = 3815; + R2_GLOBALS._maze3800SceneNumb -= 5; + if (R2_GLOBALS._maze3800SceneNumb < 3800) + R2_GLOBALS._maze3800SceneNumb = 3815; initExits(); enterArea(); break; case 15: - R2_GLOBALS._v56AAB = 0; R2_GLOBALS._player.enableControl(); break; case 16: g_globals->_sceneManager.changeScene(3900); break; case 3800: - _actor1.show(); - _object1.remove(); - _object2.remove(); - R2_GLOBALS._v56AAB = 0; + _quinnShadow.show(); + _balloon.remove(); + _harness.remove(); R2_GLOBALS._player.enableControl(); break; case 3805: @@ -5384,18 +5416,19 @@ void Scene3800::signal() { } void Scene3800::process(Event &event) { - if ((R2_GLOBALS._player._uiEnabled) && (event.eventType == EVENT_BUTTON_DOWN) && (_rect1.contains(event.mousePos))) { + if ((R2_GLOBALS._player._uiEnabled) && (event.eventType == EVENT_BUTTON_DOWN) + && (_skylineRect.contains(event.mousePos))) { event.handled = true; switch (R2_GLOBALS._events.getCursor()) { - case R2_NEGATOR_GUN: + case CURSOR_WALK: R2_GLOBALS._player.addMover(NULL); R2_GLOBALS._player.updateAngle(event.mousePos); break; - case R2_STEPPING_DISKS: - SceneItem::display(3800, 5, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + case CURSOR_LOOK: + SceneItem::display(3800, 3, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); break; - case R2_ATTRACTOR_UNIT: - SceneItem::display(3800, 3, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + case CURSOR_USE: + SceneItem::display(3800, 5, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); break; default: event.handled = false; @@ -5492,7 +5525,7 @@ void Scene3900::Exit5::changeScene() { } void Scene3900::postInit(SceneObjectList *OwnerList) { - if ((R2_GLOBALS._desertPreviousDirection == 2) + if ((R2_GLOBALS._desertPreviousDirection == 2) && (R2_GLOBALS._sceneManager._previousScene != 2700)) loadScene(3825); else @@ -5510,13 +5543,13 @@ void Scene3900::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.changeZoom(-1); R2_GLOBALS._player._moveDiff = Common::Point(3, 2); - _actor1.postInit(); - _actor1.fixPriority(10); - _actor1.changeZoom(-1); - _actor1.setVisage(1110); - _actor1._effect = 5; - _actor1._field9C = _field312; - R2_GLOBALS._player._linkedActor = &_actor1; + _quinnShadow.postInit(); + _quinnShadow.fixPriority(10); + _quinnShadow.changeZoom(-1); + _quinnShadow.setVisage(1110); + _quinnShadow._effect = EFFECT_SHADOW_MAP; + _quinnShadow._shadowMap = _shadowPaletteMap; + R2_GLOBALS._player._linkedActor = &_quinnShadow; if ((R2_GLOBALS._desertPreviousDirection == 2) && (R2_GLOBALS._sceneManager._previousScene != 2700)) { // loadScene(3825); @@ -5532,8 +5565,8 @@ void Scene3900::postInit(SceneObjectList *OwnerList) { _westExit._enabled = false; - _exit5.setDetails(Rect(0, 87, 29, 168), EXITCURSOR_W, 3900); - _exit5.setDest(Common::Point(24, 135)); + _westEnterForest.setDetails(Rect(0, 87, 29, 168), EXITCURSOR_W, 3900); + _westEnterForest.setDest(Common::Point(24, 135)); } else { // loadScene(3820); R2_GLOBALS._desertCorrectDirection = 2; @@ -5548,12 +5581,12 @@ void Scene3900::postInit(SceneObjectList *OwnerList) { _westExit._insideArea = false; _westExit._moving = false; - _exit5.setDetails(Rect(290, 87, 320, 168), EXITCURSOR_E, 3900); - _exit5.setDest(Common::Point(295, 135)); + _westEnterForest.setDetails(Rect(290, 87, 320, 168), EXITCURSOR_E, 3900); + _westEnterForest.setDest(Common::Point(295, 135)); } - _exit5._enabled = true; - _exit5._insideArea = false; - _exit5._moving = false; + _westEnterForest._enabled = true; + _westEnterForest._insideArea = false; + _westEnterForest._moving = false; scalePalette(65, 65, 65); @@ -5569,8 +5602,8 @@ void Scene3900::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._uiElements.draw(); - _rect1.set(0, 0, 320, 87); - _item1.setDetails(Rect(0, 0, 320, 200), 3800, 0, 1, 2, 1, (SceneItem *)NULL); + _skylineRect.set(0, 0, 320, 87); + _background.setDetails(Rect(0, 0, 320, 200), 3800, 0, 1, 2, 1, (SceneItem *)NULL); if (R2_GLOBALS._sceneManager._previousScene == 3800) { _sceneMode = 11; switch (R2_GLOBALS._desertPreviousDirection) { @@ -5626,7 +5659,6 @@ void Scene3900::signal() { case 11: // No break on purpose case 12: - R2_GLOBALS._v56AAB = 0; R2_GLOBALS._player.enableControl(CURSOR_WALK); break; case 13: @@ -5656,18 +5688,19 @@ void Scene3900::signal() { } void Scene3900::process(Event &event) { - if ((R2_GLOBALS._player._uiEnabled) && (event.eventType == EVENT_BUTTON_DOWN) && (_rect1.contains(event.mousePos))) { + if ((R2_GLOBALS._player._uiEnabled) && (event.eventType == EVENT_BUTTON_DOWN) + && (_skylineRect.contains(event.mousePos))) { event.handled = true; switch (R2_GLOBALS._events.getCursor()) { - case R2_NEGATOR_GUN: + case CURSOR_WALK: R2_GLOBALS._player.addMover(NULL); R2_GLOBALS._player.updateAngle(event.mousePos); break; - case R2_STEPPING_DISKS: - SceneItem::display(3800, 5, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + case CURSOR_USE: + SceneItem::display(3800, 5, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); break; - case R2_ATTRACTOR_UNIT: - SceneItem::display(3800, 3, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + case CURSOR_LOOK: + SceneItem::display(3800, 3, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); break; default: event.handled = false; diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.h b/engines/tsage/ringworld2/ringworld2_scenes3.h index 6c7a594b12..c73f8548e4 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.h +++ b/engines/tsage/ringworld2/ringworld2_scenes3.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -45,15 +45,15 @@ class Scene3100 : public SceneExt { virtual bool startAction(CursorType action, Event &event); }; public: - int _field412; + bool _fadeSound; SpeakerGuard _guardSpeaker; - NamedHotspot _item1; - NamedHotspot _item2; - SceneActor _actor1; - SceneActor _actor2; - SceneActor _actor3; - SceneActor _actor4; - SceneActor _actor5; + NamedHotspot _background; + NamedHotspot _hammerHead2; + SceneActor _hammerHead; + SceneActor _miranda; + SceneActor _ghoul; + SceneActor _technicians; + SceneActor _deadBodies; Guard _guard; ASoundExt _sound1; SequenceManager _sequenceManager; @@ -84,7 +84,7 @@ class Scene3125 : public SceneExt { virtual bool startAction(CursorType action, Event &event); }; public: - int _field412; + bool _soundPlayed; Background _background; Door _door; Table _table; @@ -93,9 +93,7 @@ public: SceneActor _ghoul2; SceneActor _ghoul3; SceneActor _ghoul4; - SequenceManager _sequenceManager1; - // Second sequence manager... Unused? - SequenceManager _sequenceManager2; + SequenceManager _sequenceManager; Scene3125(); virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -119,7 +117,7 @@ class Scene3150 : public SceneExt { class FoodTray : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor6 : public SceneActor { + class ToiletFlush : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; class AirVent : public SceneActor { @@ -146,7 +144,7 @@ public: SceneActor _bulbOrWire; Water _water; FoodTray _foodTray; - Actor6 _toiletFlush; + ToiletFlush _toiletFlush; AirVent _airVent; DoorExit _doorExit; VentExit _ventExit; @@ -158,7 +156,7 @@ public: }; class Scene3175 : public SceneExt { - class Item1 : public NamedHotspot { + class RoomItem : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; @@ -170,11 +168,11 @@ class Scene3175 : public SceneExt { virtual bool startAction(CursorType action, Event &event); }; public: - Item1 _background; - Item1 _item2; - Item1 _item3; + RoomItem _background; + RoomItem _table; + RoomItem _autopsies; Door _door; - SceneActor _actor2; + SceneActor _computer; Corpse _corpse; SequenceManager _sequenceManager; @@ -187,9 +185,9 @@ public: SpeakerRocko3200 _rockoSpeaker; SpeakerJocko3200 _jockoSpeaker; SpeakerSocko3200 _sockoSpeaker; - SceneActor _actor1; - SceneActor _actor2; - SceneActor _actor3; + SceneActor _rocko; + SceneActor _jocko; + SceneActor _socko; SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -200,8 +198,8 @@ class Scene3210 : public SceneExt { public: SpeakerCaptain3210 _captainSpeaker; SpeakerPrivate3210 _privateSpeaker; - SceneActor _actor1; - SceneActor _actor2; + SceneActor _captain; + SceneActor _private; SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -212,8 +210,8 @@ class Scene3220 : public SceneExt { public: SpeakerRocko3220 _rockoSpeaker; SpeakerJocko3220 _jockoSpeaker; - SceneActor _actor1; - SceneActor _actor2; + SceneActor _rocko; + SceneActor _jocko; SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -224,9 +222,9 @@ class Scene3230 : public SceneExt { public: SpeakerRocko3230 _rockoSpeaker; SpeakerJocko3230 _jockoSpeaker; - SceneActor _actor1; - SceneActor _actor2; - SceneActor _actor3; + SceneActor _rocko; + SceneActor _jocko; + SceneActor _ghoul; SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -238,8 +236,8 @@ public: SpeakerTeal3240 _tealSpeaker; SpeakerWebbster3240 _webbsterSpeaker; SpeakerMiranda _mirandaSpeaker; - SceneActor _actor1; - SceneActor _actor2; + SceneActor _teal; + SceneActor _webbster; SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -250,8 +248,8 @@ class Scene3245 : public SceneExt { public: SpeakerRalf3245 _ralfSpeaker; SpeakerTomko3245 _tomkoSpeaker; - SceneActor _actor1; - SceneActor _actor2; + SceneActor _ralf; + SceneActor _tomko; SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -275,7 +273,7 @@ public: Door _leftDoor; Door _topDoor; Door _rightDoor; - Door _actor4; + Door _grate; SceneActor _ghoul1; SceneActor _ghoul2; SceneActor _ghoul3; @@ -290,7 +288,7 @@ class Scene3255 : public SceneExt { public: SceneActor _teal; SceneActor _guard; - SceneActor _actor3; + SceneActor _door; SceneActor _quinn; SceneActor _ghoul1; SceneActor _ghoul2; @@ -317,16 +315,16 @@ class Scene3260 : public SceneExt { void signal(); }; public: - NamedHotspot _item1; + NamedHotspot _background; SceneActor _sceeen1; SceneActor _screen2; SceneActor _screen3; SceneActor _screen4; SceneActor _screen5; SceneActor _screen6; - SceneActor _actor7; - SceneActor _actor8; - SceneActor _actor9; + SceneActor _screen7; + SceneActor _screen8; + SceneActor _screen9; SceneActor _securityConsole; SceneActor _computerConsole; SceneActor _lightingConsole; @@ -366,7 +364,7 @@ public: NamedHotspot _emptyCell2; NamedHotspot _securityBeams1; NamedHotspot _securityBeams2; - SceneActor _actor1; + SceneActor _doorFrame; Door _door; CellExit _cellExit; SequenceManager _sequenceManager; @@ -377,15 +375,15 @@ public: class Scene3350 : public SceneExt { public: - SceneActor _actor1; - SceneActor _actor2; - SceneActor _actor3; - SceneActor _actor4; - SceneActor _actor5; - SceneActor _actor6; - SceneActor _actor7; - SceneActor _actor8; - SceneActor _actor9; + SceneActor _miranda; + SceneActor _seeker; + SceneActor _webbster; + SceneActor _seatedPeople; + SceneActor _ship; + SceneActor _landedShip; + SceneActor _shipShadow; + SceneActor _canopy; + SceneActor _shipFront; SequenceManager _sequenceManager; PaletteRotation *_rotation; @@ -439,9 +437,8 @@ public: DownExit _downExit; RightExit _rightExit; SequenceManager _sequenceManager; - int _field1488; + int _newSceneMode; int _sceneAreas[4]; - int _field1492; Scene3375(); virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -465,7 +462,7 @@ class Scene3385 : public SceneExt { virtual bool startAction(CursorType action, Event &event); }; - class Exit1 : public SceneExit { + class SouthExit : public SceneExit { public: virtual void changeScene(); }; @@ -485,11 +482,11 @@ public: Companion2 _companion2; Webbster _webbster; Door _door; - Exit1 _exit1; + SouthExit _southExit; Action1 _action1; SequenceManager _sequenceManager; - int _field11B2; + int _playerStrip; Scene3385(); virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -531,7 +528,7 @@ public: Action1 _action1; SequenceManager _sequenceManager; - int _field142E; + int _playerStrip; Scene3395(); virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -551,12 +548,11 @@ public: SceneActor _companion2; SceneActor _webbster; SceneActor _teal; - SceneActor _actor5; - SceneActor _actor6; - SceneActor _actor7; - SceneActor _actor8; + SceneActor _door; + SceneActor _manholeCover; + SceneActor _sapphire; SequenceManager _sequenceManager; - int16 _field157C; + bool _soundFaded; Scene3400(); virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -568,114 +564,104 @@ public: class Scene3500 : public SceneExt { class Action1: public Action { public: - int _field1E; - int _field20; - int _field22; - int _field24; + int _direction; + bool _headingRightFl; + bool _turningFl; Action1(); virtual void synchronize(Serializer &s); - void sub108670(int arg1); - void sub108732(int arg1); + void handleHorzButton(int direction); + void turnShuttle(bool arg1); virtual void signal(); virtual void dispatch(); }; class Action2: public Action { public: - int _field1E; + int _direction; Action2(); virtual void synchronize(Serializer &s); - void sub10831F(int arg1); + void handleVertButton(int direction); virtual void signal(); }; - class Item4 : public NamedHotspot { + class DirectionButton : public NamedHotspot { public: - int _field34; + int _movementId; - Item4(); + DirectionButton(); virtual void synchronize(Serializer &s); virtual bool startAction(CursorType action, Event &event); }; - class Actor7 : public SceneActor { + class Throttle : public SceneActor { public: - int _fieldA4; - int _fieldA6; - int _fieldA8; - int _fieldAA; - int _fieldAC; - int _fieldAE; + Common::Point _pos; + int _deltaX; + int _deltaY; + int _slideDeltaY; + int _deltaMouseY; - Actor7(); + Throttle(); virtual void synchronize(Serializer &s); - void sub109466(int arg1, int arg2, int arg3, int arg4, int arg5); - void sub1094ED(); - void sub109663(int arg1); - void sub109693(Common::Point Pt); + void init(int xp, int yp, int dx, int dy, int speed); + void updateSpeed(); + void setSpeed(int arg1); + void changePosition(const Common::Point &pt); virtual void process(Event &event); virtual bool startAction(CursorType action, Event &event); }; - class Actor8 : public SceneActor { - public: - // TODO: double check if nothing specific is present, then remove this class - }; - class MazeUI3500 : public MazeUI { public: - int cellFromX(int arg1); - int cellFromY(int arg1); + int16 cellFromX(int arg1); + int16 cellFromY(int arg1); int getCellFromMapXY(Common::Point pt); bool setMazePosition2(Common::Point &p); }; public: Action1 _action1; Action2 _action2; - NamedHotspot _item1; - NamedHotspot _item2; - NamedHotspot _item3; - Item4 _item4; - Item4 _item5; - Item4 _item6; - Item4 _item7; + NamedHotspot _background; + NamedHotspot _outsideView; + NamedHotspot _mapScreen; + DirectionButton _pitchDown; + DirectionButton _turnLeft; + DirectionButton _pitchUp; + DirectionButton _turnRight; // Glyph of vessel on top of the maze ui - SceneActor _actor1; - SceneActor _actor2; - SceneActor _actor3; - SceneActor _actor4; - SceneActor _actor5; - SceneActor _actor6; - Actor7 _actor7; - Actor8 _actor8; - Actor8 _actor9; + SceneActor _shuttle; + SceneActor _verticalSpeedDisplay; + SceneActor _horizontalSpeedDisplay; + SceneActor _symbolVertical; + SceneActor _symbolLeft; + SceneActor _symbolRight; + Throttle _throttle; + SceneActor _tunnelVertCircle; + SceneActor _tunnelHorzCircle; ASoundExt _aSound1; MazeUI3500 _mazeUI; SequenceManager _sequenceManager; - int _fieldAF8; - int _fieldB9E; + int _moverVertX; + int _moverHorzX; PaletteRotation *_rotation; int _mazeChangeAmount; - int _field1270; - int _field1272; - int _field1274; + int _speed; + bool _updateIdxChangeFl; int _mazeDirection; - int _field1278; + int _nextMove; Common::Point _mazePosition; - int _field127E; - int _field1280; - int _field1282; - int _field1284; - int _field1286; + bool _postFixupFl; + int _exitCounter; + bool _directionChangesEnabled; Scene3500(); - void sub107F71(int arg1); + void doMovement(int id); virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void remove(); @@ -688,7 +674,8 @@ public: class Scene3600 : public SceneExt { class Action3600: public ActionExt { public: - int _field1E, _field20; + bool _part2Fl; + int _fadePct; Action3600(); virtual void synchronize(Serializer &s); @@ -699,7 +686,7 @@ class Scene3600 : public SceneExt { virtual void signal(); }; - class Item5 : public NamedHotspot { + class LightShaft : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; @@ -715,23 +702,20 @@ public: SpeakerMiranda3600 _mirandaSpeaker; SpeakerTeal3600 _tealSpeaker; SpeakerProtector3600 _protectorSpeaker; - NamedHotspot _item1; - NamedHotspot _item2; - NamedHotspot _item3; - NamedHotspot _item4; - Item5 _item5; - SceneActor _actor1; - SceneActor _actor2; - SceneActor _actor3; - SceneActor _actor4; - SceneActor _actor5; - SceneActor _actor6; - SceneActor _actor7; - SceneActor _actor8; - SceneActor _actor9; - SceneActor _actor10; - SceneActor _actor11; - SceneActor _actor12; + NamedHotspot _background; + NamedHotspot _console; + NamedHotspot _tapestry1; + NamedHotspot _tapestry2; + LightShaft _lightShaft; + SceneActor _protector3400; + SceneActor _steppingDisk; + SceneActor _consoleLights; + SceneActor _webbster; + SceneActor _teal; + SceneActor _door3400; + SceneActor _quinn; + SceneActor _seeker; + SceneActor _miranda; Protector _protector; SequenceManager _sequenceManager1; SequenceManager _sequenceManager2; @@ -739,10 +723,8 @@ public: SequenceManager _sequenceManager4; ScenePalette _palette1; - int _field2548; - int _field254A; - int _field254C; - int _field254E; + bool _tealDead; + bool _lightEntered; bool _ghoulTeleported; Scene3600(); @@ -763,7 +745,7 @@ public: SceneActor _seeker; SceneActor _miranda; SceneActor _webbster; - SceneActor _actor5; + SceneActor _teleportPad; SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -793,15 +775,15 @@ class Scene3800 : public SceneExt { }; public: - SceneObject _object1; - SceneObject _object2; - SceneActor _actor1; + SceneObject _balloon; + SceneObject _harness; + SceneActor _quinnShadow; NamedHotspot _background; NorthExit _northExit; EastExit _eastExit; SouthExit _southExit; WestExit _westExit; - Rect _rect1; + Rect _skylineRect; SequenceManager _sequenceManager1; int _desertDirection; @@ -842,14 +824,14 @@ class Scene3900 : public SceneExt { virtual void changeScene(); }; public: - SceneActor _actor1; - NamedHotspot _item1; + SceneActor _quinnShadow; + NamedHotspot _background; NorthExit _northExit; EastExit _eastExit; SouthExit _southExit; WestExit _westExit; - Exit5 _exit5; - Rect _rect1; + Exit5 _westEnterForest; + Rect _skylineRect; virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void signal(); diff --git a/engines/tsage/ringworld2/ringworld2_speakers.cpp b/engines/tsage/ringworld2/ringworld2_speakers.cpp index a43938230e..016242edd1 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.cpp +++ b/engines/tsage/ringworld2/ringworld2_speakers.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -36,11 +36,19 @@ namespace Ringworld2 { VisualSpeaker::VisualSpeaker(): Speaker() { _delayAmount = 0; + _voiceDelayAmount = 0; _frameNumber = R2_GLOBALS._events.getFrameNumber(); _color1 = 8; _color2 = 0; _displayMode = 0; _speakerMode = 0; + + _object2 = nullptr; + _fieldF8 = 0; + _soundId = 0; + _removeObject = false; + _numFrames = 0; + _voiceFrameNumber = 0; } void VisualSpeaker::remove() { @@ -63,9 +71,10 @@ void VisualSpeaker::remove() { } void VisualSpeaker::signal() { - // TODO: _action->_field18 = 1; + // TODO: Handle _field18 if used in Action. It looks only used in the original in remove() + // _action->_field18 = 1; if (_speakerMode == 0xff) - proc16(); + stopSpeaking(); _speakerMode = 0; if (_numFrames) { @@ -75,12 +84,11 @@ void VisualSpeaker::signal() { _fieldF8 = 1; } - if ((R2_GLOBALS._speechSubtitles & SPEECH_TEXT) || _soundId) + if ((R2_GLOBALS._speechSubtitles & SPEECH_TEXT) || !_soundId) _sceneText.show(); if ((R2_GLOBALS._speechSubtitles & SPEECH_VOICE) && _soundId) { - // TODO: Check global that is passed - setFrame2(/* word_55F90 */ 1); + setVoiceFrame(1); } } else if (_action && _object2) { _action->setDelay(1); @@ -92,6 +100,7 @@ void VisualSpeaker::signal() { void VisualSpeaker::dispatch() { uint32 frameNumber = R2_GLOBALS._events.getFrameNumber(); + assert(_action); // Delay check for character animation if (_delayAmount) { @@ -108,14 +117,14 @@ void VisualSpeaker::dispatch() { } // Delay check for voice - if (_delayAmount2) { - if (frameNumber >= _frameNumber2) { - _delayAmount2 = _delayAmount2 - (_frameNumber2 - frameNumber); - _frameNumber2 = frameNumber; - - if (_delayAmount2 <= 0) { - _delayAmount2 = 0; - if (R2_GLOBALS._playStream.play(0, NULL)) { + if (_voiceDelayAmount) { + if (frameNumber >= _voiceFrameNumber) { + _voiceDelayAmount = _voiceDelayAmount - (frameNumber - _voiceFrameNumber); + _voiceFrameNumber = frameNumber; + + if (_voiceDelayAmount <= 0) { + _voiceDelayAmount = 0; + if (R2_GLOBALS._playStream.play(_soundId, NULL)) { _numFrames = 2; _soundId = 0; } else { @@ -132,6 +141,7 @@ void VisualSpeaker::dispatch() { _object1.setFrame(1); if (!(R2_GLOBALS._speechSubtitles & SPEECH_TEXT)) { + // Don't bother waiting for a mouse click to start the next speech segment _action->setDelay(1); } } @@ -149,8 +159,8 @@ void VisualSpeaker::synchronize(Serializer &s) { s.syncAsSint16LE(_numFrames); s.syncAsSint16LE(_delayAmount); s.syncAsUint32LE(_frameNumber); - s.syncAsSint16LE(_delayAmount2); - s.syncAsUint32LE(_frameNumber2); + s.syncAsSint16LE(_voiceDelayAmount); + s.syncAsUint32LE(_voiceFrameNumber); } void VisualSpeaker::setText(const Common::String &msg) { @@ -212,7 +222,7 @@ void VisualSpeaker::setText(const Common::String &msg) { _sceneText.fixPriority(256); // If subtitles are turned off, don't show the text - if ((R2_GLOBALS._speechSubtitles & SPEECH_VOICE) && + if ((R2_GLOBALS._speechSubtitles & SPEECH_VOICE) && !(R2_GLOBALS._speechSubtitles & SPEECH_TEXT)) { _sceneText.hide(); } @@ -244,13 +254,18 @@ void VisualSpeaker::setText(const Common::String &msg) { _sceneText.hide(); } else { if ((R2_GLOBALS._speechSubtitles & SPEECH_VOICE) && _soundId) { - if (!R2_GLOBALS._playStream.play(_soundId, NULL)) + if (!R2_GLOBALS._playStream.play(_soundId, NULL)) { + // Couldn't play voice, so fall back on showing text _sceneText.show(); + } else { + _numFrames = 2; + _soundId = 0; + } } } } -void VisualSpeaker::proc16() { +void VisualSpeaker::stopSpeaking() { R2_GLOBALS._playStream.stop(); _speakerMode = 0; _object1.remove(); @@ -266,9 +281,9 @@ void VisualSpeaker::setFrame(int numFrames) { _frameNumber = R2_GLOBALS._events.getFrameNumber(); } -void VisualSpeaker::setFrame2(int numFrames) { - _delayAmount2 = numFrames; - _frameNumber2 = R2_GLOBALS._events.getFrameNumber(); +void VisualSpeaker::setVoiceFrame(int numFrames) { + _voiceDelayAmount = numFrames; + _voiceFrameNumber = R2_GLOBALS._events.getFrameNumber(); } void VisualSpeaker::setDelay(int delay) { @@ -303,12 +318,12 @@ SpeakerCaptain3210::SpeakerCaptain3210() { _numFrames = 0; } -void SpeakerCaptain3210::proc15() { +void SpeakerCaptain3210::animateSpeaker() { int v = _speakerMode; Scene3210 *scene = (Scene3210 *)R2_GLOBALS._sceneManager._scene; if (!_object2) { - _object2 = &scene->_actor1; + _object2 = &scene->_captain; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -320,7 +335,8 @@ void SpeakerCaptain3210::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4060, (_object2->_strip * 2) - 1, 1); _object1.animate(ANIM_MODE_5, this); } @@ -358,7 +374,7 @@ SpeakerChief1100::SpeakerChief1100() { _numFrames = 0; } -void SpeakerChief1100::proc15() { +void SpeakerChief1100::animateSpeaker() { int v = _speakerMode; Scene1100 *scene = (Scene1100 *)R2_GLOBALS._sceneManager._scene; @@ -378,18 +394,21 @@ void SpeakerChief1100::proc15() { _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4080, 1, 1); _object1.animate(ANIM_MODE_5, this); break; case 2: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4080, 3, 1); _object1.animate(ANIM_MODE_5, this); break; case 100: _numFrames = 0; - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setStrip(_object1._strip - 1); _object1.setFrame(_object1.getFrameCount()); _object1.animate(ANIM_MODE_6, this); @@ -416,7 +435,7 @@ SpeakerGuard::SpeakerGuard() { _numFrames = 0; } -void SpeakerGuard2800::proc15() { +void SpeakerGuard2800::animateSpeaker() { int v = _speakerMode; Scene2800 *scene = (Scene2800 *)R2_GLOBALS._sceneManager._scene; @@ -433,7 +452,8 @@ void SpeakerGuard2800::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setZoom(75); _object1.setup(4060, 3, 1); _object1.animate(ANIM_MODE_5, this); @@ -456,12 +476,12 @@ SpeakerJocko::SpeakerJocko() { _numFrames = 0; } -void SpeakerJocko3200::proc15() { +void SpeakerJocko3200::animateSpeaker() { int v = _speakerMode; Scene3200 *scene = (Scene3200 *)R2_GLOBALS._sceneManager._scene; if (!_object2) { - _object2 = &scene->_actor2; + _object2 = &scene->_jocko; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -473,18 +493,19 @@ void SpeakerJocko3200::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4060, (_object2->_strip * 2) - 1, 1); _object1.animate(ANIM_MODE_5, this); } } -void SpeakerJocko3220::proc15() { +void SpeakerJocko3220::animateSpeaker() { int v = _speakerMode; Scene3220 *scene = (Scene3220 *)R2_GLOBALS._sceneManager._scene; if (!_object2) { - _object2 = &scene->_actor2; + _object2 = &scene->_jocko; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -496,18 +517,19 @@ void SpeakerJocko3220::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4060, (_object2->_strip * 2) - 1, 1); _object1.animate(ANIM_MODE_5, this); } } -void SpeakerJocko3230::proc15() { +void SpeakerJocko3230::animateSpeaker() { int v = _speakerMode; Scene3230 *scene = (Scene3230 *)R2_GLOBALS._sceneManager._scene; if (!_object2) { - _object2 = &scene->_actor2; + _object2 = &scene->_jocko; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -519,7 +541,8 @@ void SpeakerJocko3230::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4060, (_object2->_strip * 2) - 1, 1); _object1.animate(ANIM_MODE_5, this); } @@ -541,7 +564,7 @@ SpeakerMiranda::SpeakerMiranda(): VisualSpeaker() { _numFrames = 0; } -void SpeakerMiranda300::proc15() { +void SpeakerMiranda300::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -564,13 +587,13 @@ void SpeakerMiranda300::proc15() { _object1.animate(ANIM_MODE_2, NULL); } else if (v == 100) { _numFrames = 0; - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; _object1.setStrip(_object1._strip - 1); _object1.setFrame(_object1.getFrameCount()); _object1.animate(ANIM_MODE_6, this); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; if (v == 4) { _object1.setup(304, 5, 1); @@ -581,12 +604,12 @@ void SpeakerMiranda300::proc15() { } } -void SpeakerMiranda1625::proc15() { +void SpeakerMiranda1625::animateSpeaker() { int v = _speakerMode; if (!_object2) { Scene1625 *scene = (Scene1625 *)R2_GLOBALS._sceneManager._scene; - _object2 = &scene->_actor3; + _object2 = &scene->_mirandaMouth; _object2->hide(); _object1.postInit(); _object1.setPosition(Common::Point(196, 65)); @@ -598,13 +621,14 @@ void SpeakerMiranda1625::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(1627, 3, 1); _object1.animate(ANIM_MODE_5, this); } } -void SpeakerMiranda3255::proc15() { +void SpeakerMiranda3255::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -619,13 +643,14 @@ void SpeakerMiranda3255::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(3257, 5, 1); _object1.animate(ANIM_MODE_5, this); } } -void SpeakerMiranda3375::proc15() { +void SpeakerMiranda3375::animateSpeaker() { Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -640,7 +665,7 @@ void SpeakerMiranda3375::proc15() { _object1.postInit(); _object1.setPosition(_object2->_position); _object1._numFrames = 7; - _object1._effect = 1; + _object1._effect = EFFECT_SHADED; _object1.changeZoom(-1); if (scene->_companion1._position.y != 163) @@ -665,7 +690,8 @@ void SpeakerMiranda3375::proc15() { _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4051, 5, 1); _object1.animate(ANIM_MODE_5, this); break; @@ -675,7 +701,7 @@ void SpeakerMiranda3375::proc15() { } } -void SpeakerMiranda3385::proc15() { +void SpeakerMiranda3385::animateSpeaker() { Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -690,7 +716,7 @@ void SpeakerMiranda3385::proc15() { _object1.postInit(); _object1.setPosition(_object2->_position); _object1._numFrames = 7; - _object1._effect = 1; + _object1._effect = EFFECT_SHADED; _object1.changeZoom(-1); if (R2_GLOBALS._sceneManager._previousScene == 3375) @@ -714,7 +740,8 @@ void SpeakerMiranda3385::proc15() { _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4051, 5, 1); _object1.animate(ANIM_MODE_5, this); break; @@ -724,7 +751,7 @@ void SpeakerMiranda3385::proc15() { } } -void SpeakerMiranda3395::proc15() { +void SpeakerMiranda3395::animateSpeaker() { Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -739,7 +766,7 @@ void SpeakerMiranda3395::proc15() { _object1.postInit(); _object1.setPosition(_object2->_position); _object1._numFrames = 7; - _object1._effect = 1; + _object1._effect = EFFECT_SHADED; _object1.changeZoom(-1); if (R2_GLOBALS._sceneManager._previousScene == 3385) @@ -764,7 +791,8 @@ void SpeakerMiranda3395::proc15() { _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4051, 5, 1); _object1.animate(ANIM_MODE_5, this); break; @@ -774,7 +802,7 @@ void SpeakerMiranda3395::proc15() { } } -void SpeakerMiranda3400::proc15() { +void SpeakerMiranda3400::animateSpeaker() { Scene3400 *scene = (Scene3400 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -789,7 +817,7 @@ void SpeakerMiranda3400::proc15() { _object1.postInit(); _object1.setPosition(_object2->_position); _object1._numFrames = 7; - _object1._effect = 1; + _object1._effect = EFFECT_SHADED; _object1.changeZoom(-1); R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); @@ -803,12 +831,14 @@ void SpeakerMiranda3400::proc15() { _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4051, 5, 1); _object1.animate(ANIM_MODE_5, this); break; case 2: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4050, 3, 1); _object1.animate(ANIM_MODE_5, this); break; @@ -818,7 +848,7 @@ void SpeakerMiranda3400::proc15() { } } -void SpeakerMiranda3600::proc15() { +void SpeakerMiranda3600::animateSpeaker() { Scene3600 *scene = (Scene3600 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -827,13 +857,13 @@ void SpeakerMiranda3600::proc15() { if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) _object2 = &R2_GLOBALS._player; else - _object2 = &scene->_actor12; + _object2 = &scene->_miranda; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); _object1._numFrames = 7; - _object1._effect = 1; + _object1._effect = EFFECT_SHADED; _object1.changeZoom(-1); R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); @@ -849,12 +879,14 @@ void SpeakerMiranda3600::proc15() { _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4051, 1, 1); _object1.animate(ANIM_MODE_5, this); break; case 2: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4050, 1, 1); _object1.animate(ANIM_MODE_5, this); break; @@ -864,7 +896,7 @@ void SpeakerMiranda3600::proc15() { } } -void SpeakerMiranda3700::proc15() { +void SpeakerMiranda3700::animateSpeaker() { Scene3700 *scene = (Scene3700 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -889,7 +921,8 @@ void SpeakerMiranda3700::proc15() { _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + scene->_quinn.setup(10, 6, 1); scene->_seeker.setup(20, 5, 1); _object2->setup(30, 1, 1); @@ -898,13 +931,15 @@ void SpeakerMiranda3700::proc15() { _object1.animate(ANIM_MODE_5, this); break; case 2: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + scene->_miranda.setup(30, 8, 1); _object1.setup(4052, 3, 1); _object1.animate(ANIM_MODE_5, this); break; case 3: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + scene->_seeker.setup(20, 1, 1); scene->_miranda.setup(30, 1, 1); _object1.setup(4051, 7, 1); @@ -932,7 +967,7 @@ SpeakerNej::SpeakerNej() { _numFrames = 0; } -void SpeakerNej2700::proc15() { +void SpeakerNej2700::animateSpeaker() { int v = _speakerMode; Scene2700 *scene = (Scene2700 *)R2_GLOBALS._sceneManager._scene; @@ -949,7 +984,8 @@ void SpeakerNej2700::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + switch (_object2->_visage) { case 2701: _object1.setup(4022, 3, 1); @@ -967,7 +1003,7 @@ void SpeakerNej2700::proc15() { } } -void SpeakerNej2750::proc15() { +void SpeakerNej2750::animateSpeaker() { int v = _speakerMode; Scene2750 *scene = (Scene2750 *)R2_GLOBALS._sceneManager._scene; @@ -984,7 +1020,8 @@ void SpeakerNej2750::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + switch (_object2->_visage) { case 2705: _object1.setup(4022, 7, 1); @@ -999,12 +1036,12 @@ void SpeakerNej2750::proc15() { } } -void SpeakerNej2800::proc15() { +void SpeakerNej2800::animateSpeaker() { int v = _speakerMode; - Scene2750 *scene = (Scene2750 *)R2_GLOBALS._sceneManager._scene; + Scene2800 *scene = (Scene2800 *)R2_GLOBALS._sceneManager._scene; if (!_object2) { - _object2 = &scene->_actor2; + _object2 = &scene->_nej; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -1016,10 +1053,11 @@ void SpeakerNej2800::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4023, 3, 1); if (_object2->_visage == 2801) - _object1.setPosition(Common::Point(R2_GLOBALS._player._position.x - 12, R2_GLOBALS._player._position.y)); + _object1.setPosition(Common::Point(_object2->_position.x - 12, _object2->_position.y)); _object1.animate(ANIM_MODE_5, this); } } @@ -1040,7 +1078,7 @@ SpeakerPharisha::SpeakerPharisha(): VisualSpeaker() { _numFrames = 0; } -void SpeakerPharisha2435::proc15() { +void SpeakerPharisha2435::animateSpeaker() { int v = _speakerMode; Scene2435 *scene = (Scene2435 *)R2_GLOBALS._sceneManager._scene; @@ -1054,7 +1092,8 @@ void SpeakerPharisha2435::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4098, 5, 1); _object1.animate(ANIM_MODE_5, this); } @@ -1076,12 +1115,12 @@ SpeakerPrivate3210::SpeakerPrivate3210() { _numFrames = 0; } -void SpeakerPrivate3210::proc15() { +void SpeakerPrivate3210::animateSpeaker() { int v = _speakerMode; Scene3210 *scene = (Scene3210 *)R2_GLOBALS._sceneManager._scene; if (!_object2) { - _object2 = &scene->_actor2; + _object2 = &scene->_private; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -1093,7 +1132,8 @@ void SpeakerPrivate3210::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4060, (_object2->_strip * 2) - 1, 1); _object1.animate(ANIM_MODE_5, this); } @@ -1115,7 +1155,7 @@ SpeakerProtector3600::SpeakerProtector3600() { _numFrames = 0; } -void SpeakerProtector3600::proc15() { +void SpeakerProtector3600::animateSpeaker() { int v = _speakerMode; Scene3600 *scene = (Scene3600 *)R2_GLOBALS._sceneManager._scene; @@ -1125,7 +1165,7 @@ void SpeakerProtector3600::proc15() { _object1.postInit(); _object1.setPosition(_object2->_position); _object1._numFrames = 7; - _object1._effect = 1; + _object1._effect = EFFECT_SHADED; _object1.changeZoom(-1); R2_GLOBALS._player.disableControl(); @@ -1142,7 +1182,8 @@ void SpeakerProtector3600::proc15() { _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + if (scene->_sceneMode != 3324) { _object1.setup(4125, 3, 1); _object1.animate(ANIM_MODE_5, this); @@ -1176,7 +1217,7 @@ SpeakerQuinn::SpeakerQuinn(): VisualSpeaker() { _numFrames = 0; } -void SpeakerQuinn300::proc15() { +void SpeakerQuinn300::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -1197,16 +1238,16 @@ void SpeakerQuinn300::proc15() { _object1.animate(ANIM_MODE_2, NULL); } else if (v == 100) { _numFrames = 0; - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; _object1.setStrip(_object1._strip - 1); _object1.setFrame(_object1.getFrameCount()); _object1.animate(ANIM_MODE_6, this); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; switch (_object2->_visage) { - case 10: + case 10: _object1.setup((v - 1) / 4 + 4010, ((v - ((v - 1) / 4 * 4) - 1) % 8) * 2 + 1, 1); break; case 302: @@ -1223,7 +1264,7 @@ void SpeakerQuinn300::proc15() { } } -void SpeakerQuinn500::proc15() { +void SpeakerQuinn500::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -1249,7 +1290,7 @@ void SpeakerQuinn500::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; switch (_object2->_visage) { case 10: @@ -1268,7 +1309,7 @@ void SpeakerQuinn500::proc15() { } } -void SpeakerQuinn1100::proc15() { +void SpeakerQuinn1100::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -1297,17 +1338,20 @@ void SpeakerQuinn1100::proc15() { _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(1108, 7, 1); _object1.animate(ANIM_MODE_5, this); break; case 2: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(1109, 1, 1); _object1.animate(ANIM_MODE_5, this); break; case 3: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(1109, 5, 1); _object1.animate(ANIM_MODE_5, this); break; @@ -1317,7 +1361,7 @@ void SpeakerQuinn1100::proc15() { } } -void SpeakerQuinn2435::proc15() { +void SpeakerQuinn2435::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -1337,14 +1381,15 @@ void SpeakerQuinn2435::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object2->setStrip(7); _object1.setup(2020, 5, 1); _object1.animate(ANIM_MODE_5, this); } } -void SpeakerQuinn2450::proc15() { +void SpeakerQuinn2450::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -1364,7 +1409,8 @@ void SpeakerQuinn2450::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + if (R2_GLOBALS.getFlag(61)) _object1.setup(2020, 3, 1); else @@ -1373,7 +1419,7 @@ void SpeakerQuinn2450::proc15() { } } -void SpeakerQuinn2700::proc15() { +void SpeakerQuinn2700::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -1389,7 +1435,8 @@ void SpeakerQuinn2700::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + switch (_object2->_visage) { case 19: _object1.setup(4022, 5, 1); @@ -1404,7 +1451,7 @@ void SpeakerQuinn2700::proc15() { } } -void SpeakerQuinn2750::proc15() { +void SpeakerQuinn2750::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -1420,13 +1467,14 @@ void SpeakerQuinn2750::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + switch (_object2->_visage) { case 19: _object1.setup(4022, 5, 1); break; case 2752: - _object1.setup(2752, 1, 1); + _object1.setup(2752, 3, 1); break; default: break; @@ -1435,7 +1483,7 @@ void SpeakerQuinn2750::proc15() { } } -void SpeakerQuinn2800::proc15() { +void SpeakerQuinn2800::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -1451,7 +1499,8 @@ void SpeakerQuinn2800::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + switch (_object2->_visage) { case 16: _object1.setZoom(75); @@ -1474,7 +1523,7 @@ void SpeakerQuinn2800::proc15() { } } -void SpeakerQuinn3255::proc15() { +void SpeakerQuinn3255::animateSpeaker() { Scene3255 *scene = (Scene3255 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -1491,13 +1540,14 @@ void SpeakerQuinn3255::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(3257, 3, 1); _object1.animate(ANIM_MODE_5, this); } } -void SpeakerQuinn3375::proc15() { +void SpeakerQuinn3375::animateSpeaker() { Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -1514,7 +1564,7 @@ void SpeakerQuinn3375::proc15() { _object1.postInit(); _object1.setPosition(_object2->_position); _object1._numFrames = 7; - _object1._effect = 1; + _object1._effect = EFFECT_SHADED; _object1.changeZoom(-1); if (scene->_companion1._position.y != 163) @@ -1532,13 +1582,13 @@ void SpeakerQuinn3375::proc15() { _object2->addMover(NULL); } - switch (v) { case 0: _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4010, 5, 1); _object1.animate(ANIM_MODE_5, this); break; @@ -1548,7 +1598,7 @@ void SpeakerQuinn3375::proc15() { } } -void SpeakerQuinn3385::proc15() { +void SpeakerQuinn3385::animateSpeaker() { Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -1565,7 +1615,7 @@ void SpeakerQuinn3385::proc15() { _object1.postInit(); _object1.setPosition(_object2->_position); _object1._numFrames = 7; - _object1._effect = 1; + _object1._effect = EFFECT_SHADED; _object1.changeZoom(-1); if (R2_GLOBALS._sceneManager._previousScene == 3375) @@ -1583,13 +1633,13 @@ void SpeakerQuinn3385::proc15() { _object2->addMover(NULL); } - switch (v) { case 0: _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _object1.setup(4010, 3, 1); else @@ -1603,7 +1653,7 @@ void SpeakerQuinn3385::proc15() { } } -void SpeakerQuinn3395::proc15() { +void SpeakerQuinn3395::animateSpeaker() { Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -1620,7 +1670,7 @@ void SpeakerQuinn3395::proc15() { _object1.postInit(); _object1.setPosition(_object2->_position); _object1._numFrames = 7; - _object1._effect = 1; + _object1._effect = EFFECT_SHADED; _object1.changeZoom(-1); if (R2_GLOBALS._sceneManager._previousScene == 3385) @@ -1638,13 +1688,13 @@ void SpeakerQuinn3395::proc15() { _object2->addMover(NULL); } - switch (v) { case 0: _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _object1.setup(4010, 3, 1); else @@ -1658,7 +1708,7 @@ void SpeakerQuinn3395::proc15() { } } -void SpeakerQuinn3400::proc15() { +void SpeakerQuinn3400::animateSpeaker() { Scene3400 *scene = (Scene3400 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -1675,7 +1725,7 @@ void SpeakerQuinn3400::proc15() { _object1.postInit(); _object1.setPosition(_object2->_position); _object1._numFrames = 7; - _object1._effect = 1; + _object1._effect = EFFECT_SHADED; _object1.changeZoom(-1); R2_GLOBALS._player.disableControl(); if (_object2->_mover) @@ -1687,17 +1737,20 @@ void SpeakerQuinn3400::proc15() { _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4010, 5, 1); _object1.animate(ANIM_MODE_5, NULL); break; case 2: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4010, 3, 1); _object1.animate(ANIM_MODE_5, this); break; case 3: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4012, 3, 1); _object1.animate(ANIM_MODE_5, this); break; @@ -1707,7 +1760,7 @@ void SpeakerQuinn3400::proc15() { } } -void SpeakerQuinn3600::proc15() { +void SpeakerQuinn3600::animateSpeaker() { Scene3600 *scene = (Scene3600 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -1716,12 +1769,12 @@ void SpeakerQuinn3600::proc15() { if (R2_GLOBALS._player._characterIndex == R2_QUINN) _object2 = &R2_GLOBALS._player; else - _object2 = &scene->_actor10; + _object2 = &scene->_quinn; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); _object1._numFrames = 7; - _object1._effect = 1; + _object1._effect = EFFECT_SHADED; _object1.changeZoom(-1); R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); @@ -1735,17 +1788,20 @@ void SpeakerQuinn3600::proc15() { _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4021, 7, 1); _object1.animate(ANIM_MODE_5, this); break; case 2: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4010, 1, 1); _object1.animate(ANIM_MODE_5, this); break; case 3: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4012, 1, 1); _object1.animate(ANIM_MODE_5, this); break; @@ -1773,7 +1829,7 @@ void SpeakerQuinn3700::setText(const Common::String &msg) { VisualSpeaker::setText(msg); } -void SpeakerQuinn3700::proc15() { +void SpeakerQuinn3700::animateSpeaker() { Scene3700 *scene = (Scene3700 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -1798,7 +1854,8 @@ void SpeakerQuinn3700::proc15() { _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + R2_GLOBALS._sound2.stop(); scene->_quinn.setup(10, 4, 1); scene->_miranda.setup(30, 7, 1); @@ -1806,14 +1863,16 @@ void SpeakerQuinn3700::proc15() { _object1.animate(ANIM_MODE_5, this); break; case 2: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + scene->_seeker.setup(20, 1, 1); scene->_miranda.setup(30, 1, 1); _object1.setup(3702, 1, 1); _object1.animate(ANIM_MODE_5, this); break; case 3: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + scene->_quinn.setup(10, 2, 1); scene->_miranda.setup(30, 1, 1); _object1.setup(4011, 1, 1); @@ -1829,17 +1888,8 @@ void SpeakerQuinn3700::proc15() { // Classes related to QUINNL //---------------------------------------------------------------------------- -SpeakerQuinnL::SpeakerQuinnL(): VisualSpeaker() { +SpeakerQuinnL::SpeakerQuinnL(): SpeakerQuinn() { _speakerName = "QUINNL"; - _color1 = 35; - _color2 = 0; - _speakerMode = 0; - _textWidth = 300; - _hideObjects = false; - _object2 = NULL; - _displayMode = 1; - _numFrames = 0; - _fontNumber = 10; } //---------------------------------------------------------------------------- @@ -1858,12 +1908,12 @@ SpeakerRalf3245::SpeakerRalf3245() { _numFrames = 0; } -void SpeakerRalf3245::proc15() { +void SpeakerRalf3245::animateSpeaker() { int v = _speakerMode; Scene3245 *scene = (Scene3245 *)R2_GLOBALS._sceneManager._scene; if (!_object2) { - _object2 = &scene->_actor1; + _object2 = &scene->_ralf; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -1875,7 +1925,8 @@ void SpeakerRalf3245::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + switch (_object2->_visage) { case 3100: _object1.setup(4105, (_object2->_strip * 2) - 1, 1); @@ -1910,12 +1961,12 @@ SpeakerRocko::SpeakerRocko() { _numFrames = 0; } -void SpeakerRocko3200::proc15() { +void SpeakerRocko3200::animateSpeaker() { int v = _speakerMode; Scene3200 *scene = (Scene3200 *)R2_GLOBALS._sceneManager._scene; if (!_object2) { - _object2 = &scene->_actor1; + _object2 = &scene->_rocko; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -1927,18 +1978,19 @@ void SpeakerRocko3200::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4060, (_object2->_strip * 2) - 1, 1); _object1.animate(ANIM_MODE_5, this); } } -void SpeakerRocko3220::proc15() { +void SpeakerRocko3220::animateSpeaker() { int v = _speakerMode; Scene3220 *scene = (Scene3220 *)R2_GLOBALS._sceneManager._scene; if (!_object2) { - _object2 = &scene->_actor1; + _object2 = &scene->_rocko; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -1950,18 +2002,19 @@ void SpeakerRocko3220::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4060, (_object2->_strip * 2) - 1, 1); _object1.animate(ANIM_MODE_5, this); } } -void SpeakerRocko3230::proc15() { +void SpeakerRocko3230::animateSpeaker() { int v = _speakerMode; Scene3230 *scene = (Scene3230 *)R2_GLOBALS._sceneManager._scene; if (!_object2) { - _object2 = &scene->_actor1; + _object2 = &scene->_rocko; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -1973,7 +2026,8 @@ void SpeakerRocko3230::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4111, (_object2->_strip * 2) - 1, 1); _object1.animate(ANIM_MODE_5, this); } @@ -1995,7 +2049,7 @@ SpeakerSeeker::SpeakerSeeker(): VisualSpeaker() { _numFrames = 0; } -void SpeakerSeeker300::proc15() { +void SpeakerSeeker300::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -2019,19 +2073,20 @@ void SpeakerSeeker300::proc15() { _object1.animate(ANIM_MODE_2, NULL); } else if (v == 100) { _numFrames = 0; - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; _object1.setStrip(_object1._strip - 1); _object1.setFrame(_object1.getFrameCount()); _object1.animate(ANIM_MODE_6, this); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(306, v * 2 - 1, 1); _object1.animate(ANIM_MODE_5, this); } } -void SpeakerSeeker500::proc15() { +void SpeakerSeeker500::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -2057,7 +2112,7 @@ void SpeakerSeeker500::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; if (v == 1) _object1.setup(4041, 3, 1); @@ -2068,7 +2123,7 @@ void SpeakerSeeker500::proc15() { } } -void SpeakerSeeker1100::proc15() { +void SpeakerSeeker1100::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -2097,28 +2152,33 @@ void SpeakerSeeker1100::proc15() { _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(1108, 1, 1); _object1.animate(ANIM_MODE_5, this); break; case 2: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(1108, 3, 1); _object1.animate(ANIM_MODE_5, this); break; case 3: _object1.setPosition(Common::Point(197, 134)); - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(1108, 5, 1); _object1.animate(ANIM_MODE_5, this); break; case 4: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(1109, 7, 1); _object1.animate(ANIM_MODE_5, this); break; case 5: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(1109, 3, 1); _object1.animate(ANIM_MODE_5, this); break; @@ -2128,7 +2188,7 @@ void SpeakerSeeker1100::proc15() { } } -void SpeakerSeeker1900::proc15() { +void SpeakerSeeker1900::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -2137,7 +2197,7 @@ void SpeakerSeeker1900::proc15() { } else { assert(R2_GLOBALS._sceneManager._sceneNumber == 1900); Scene1900 *scene = (Scene1900 *)R2_GLOBALS._sceneManager._scene; - _object2 = &scene->_actor1; + _object2 = &scene->_companion; } _object2->hide(); @@ -2159,7 +2219,7 @@ void SpeakerSeeker1900::proc15() { } } -void SpeakerSeeker2435::proc15() { +void SpeakerSeeker2435::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -2179,14 +2239,15 @@ void SpeakerSeeker2435::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object2->setStrip(7); _object1.setup(4099, 1, 1); _object1.animate(ANIM_MODE_5, this); } } -void SpeakerSeeker2450::proc15() { +void SpeakerSeeker2450::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -2206,13 +2267,14 @@ void SpeakerSeeker2450::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4099, 3, 1); _object1.animate(ANIM_MODE_5, this); } } -void SpeakerSeeker3375::proc15() { +void SpeakerSeeker3375::animateSpeaker() { Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -2227,7 +2289,7 @@ void SpeakerSeeker3375::proc15() { _object1.postInit(); _object1.setPosition(_object2->_position); _object1._numFrames = 7; - _object1._effect = 1; + _object1._effect = EFFECT_SHADED; _object1.changeZoom(-1); if (scene->_companion1._position.y != 163) @@ -2245,13 +2307,13 @@ void SpeakerSeeker3375::proc15() { _object2->addMover(NULL); } - switch (v) { case 0: _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4031, 1, 1); _object1.animate(ANIM_MODE_5, this); break; @@ -2261,7 +2323,7 @@ void SpeakerSeeker3375::proc15() { } } -void SpeakerSeeker3385::proc15() { +void SpeakerSeeker3385::animateSpeaker() { Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -2276,7 +2338,7 @@ void SpeakerSeeker3385::proc15() { _object1.postInit(); _object1.setPosition(_object2->_position); _object1._numFrames = 7; - _object1._effect = 1; + _object1._effect = EFFECT_SHADED; _object1.changeZoom(-1); if (R2_GLOBALS._sceneManager._previousScene == 3375) @@ -2300,7 +2362,8 @@ void SpeakerSeeker3385::proc15() { _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4031, 3, 1); _object1.animate(ANIM_MODE_5, this); break; @@ -2310,7 +2373,7 @@ void SpeakerSeeker3385::proc15() { } } -void SpeakerSeeker3395::proc15() { +void SpeakerSeeker3395::animateSpeaker() { Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -2325,7 +2388,7 @@ void SpeakerSeeker3395::proc15() { _object1.postInit(); _object1.setPosition(_object2->_position); _object1._numFrames = 7; - _object1._effect = 1; + _object1._effect = EFFECT_SHADED; _object1.changeZoom(-1); if (R2_GLOBALS._sceneManager._previousScene == 3385) @@ -2343,13 +2406,13 @@ void SpeakerSeeker3395::proc15() { _object2->addMover(NULL); } - switch (v) { case 0: _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4031, 3, 1); _object1.animate(ANIM_MODE_5, this); break; @@ -2359,7 +2422,7 @@ void SpeakerSeeker3395::proc15() { } } -void SpeakerSeeker3400::proc15() { +void SpeakerSeeker3400::animateSpeaker() { Scene3400 *scene = (Scene3400 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -2374,7 +2437,7 @@ void SpeakerSeeker3400::proc15() { _object1.postInit(); _object1.setPosition(_object2->_position); _object1._numFrames = 7; - _object1._effect = 1; + _object1._effect = EFFECT_SHADED; _object1.changeZoom(-1); R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); @@ -2388,27 +2451,32 @@ void SpeakerSeeker3400::proc15() { _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4031, 1, 1); _object1.animate(ANIM_MODE_5, this); break; case 2: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4031, 3, 1); _object1.animate(ANIM_MODE_5, this); break; case 3: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4030, 3, 1); _object1.animate(ANIM_MODE_5, this); break; case 4: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4031, 7, 1); _object1.animate(ANIM_MODE_5, this); break; case 5: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4033, 1, 1); _object1.animate(ANIM_MODE_5, this); break; @@ -2418,7 +2486,7 @@ void SpeakerSeeker3400::proc15() { } } -void SpeakerSeeker3600::proc15() { +void SpeakerSeeker3600::animateSpeaker() { Scene3600 *scene = (Scene3600 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -2427,13 +2495,13 @@ void SpeakerSeeker3600::proc15() { if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _object2 = &R2_GLOBALS._player; else - _object2 = &scene->_actor11; + _object2 = &scene->_seeker; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); _object1._numFrames = 7; - _object1._effect = 1; + _object1._effect = EFFECT_SHADED; _object1.changeZoom(-1); R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); @@ -2450,12 +2518,14 @@ void SpeakerSeeker3600::proc15() { _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4031, 5, 1); _object1.animate(ANIM_MODE_5, this); break; case 2: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4030, 1, 1); _object1.animate(ANIM_MODE_5, this); break; @@ -2478,7 +2548,7 @@ void SpeakerSeeker3700::setText(const Common::String &msg) { VisualSpeaker::setText(msg); } -void SpeakerSeeker3700::proc15() { +void SpeakerSeeker3700::animateSpeaker() { Scene3700 *scene = (Scene3700 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -2503,7 +2573,8 @@ void SpeakerSeeker3700::proc15() { _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + R2_GLOBALS._sound2.stop(); scene->_quinn.setup(10, 8, 1); scene->_seeker.setup(20, 7, 1); @@ -2512,7 +2583,8 @@ void SpeakerSeeker3700::proc15() { _object1.animate(ANIM_MODE_5, this); break; case 2: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + scene->_quinn.setup(10, 2, 1); scene->_seeker.setup(20, 1, 1); scene->_miranda.setup(30, 1, 1); @@ -2529,17 +2601,8 @@ void SpeakerSeeker3700::proc15() { // Classes related to SEEKERL //---------------------------------------------------------------------------- -SpeakerSeekerL::SpeakerSeekerL(): VisualSpeaker() { +SpeakerSeekerL::SpeakerSeekerL(): SpeakerSeeker() { _speakerName = "SEEKERL"; - _color1 = 35; - _color2 = 0; - _speakerMode = 0; - _textWidth = 300; - _hideObjects = false; - _object2 = NULL; - _displayMode = 1; - _numFrames = 0; - _fontNumber = 10; } //---------------------------------------------------------------------------- @@ -2558,12 +2621,12 @@ SpeakerSocko3200::SpeakerSocko3200() { _numFrames = 0; } -void SpeakerSocko3200::proc15() { +void SpeakerSocko3200::animateSpeaker() { int v = _speakerMode; Scene3200 *scene = (Scene3200 *)R2_GLOBALS._sceneManager._scene; if (!_object2) { - _object2 = &scene->_actor3; + _object2 = &scene->_socko; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -2575,7 +2638,8 @@ void SpeakerSocko3200::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4060, (_object2->_strip * 2) - 1, 1); _object1.animate(ANIM_MODE_5, this); } @@ -2597,7 +2661,7 @@ SpeakerSoldier::SpeakerSoldier(int color) { _numFrames = 0; } -void SpeakerSoldier300::proc15() { +void SpeakerSoldier300::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -2615,7 +2679,8 @@ void SpeakerSoldier300::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(303, 3, 1); _object1.animate(ANIM_MODE_5, this); } @@ -2641,7 +2706,7 @@ SpeakerTealMode7::SpeakerTealMode7(): SpeakerTeal() { _displayMode = 7; } -void SpeakerTeal180::proc15() { +void SpeakerTeal180::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -2661,12 +2726,14 @@ void SpeakerTeal180::proc15() { _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(75, 5, 1); _object1.animate(ANIM_MODE_5, this); break; case 2: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(77, 1, 1); _object1.animate(ANIM_MODE_5, this); break; @@ -2676,7 +2743,7 @@ void SpeakerTeal180::proc15() { } } -void SpeakerTeal300::proc15() { +void SpeakerTeal300::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -2694,13 +2761,14 @@ void SpeakerTeal300::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(303, 1, 1); _object1.animate(ANIM_MODE_5, this); } } -void SpeakerTeal1625::proc15() { +void SpeakerTeal1625::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -2718,18 +2786,19 @@ void SpeakerTeal1625::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(1627, 1, 1); _object1.animate(ANIM_MODE_5, this); } } -void SpeakerTeal3240::proc15() { +void SpeakerTeal3240::animateSpeaker() { int v = _speakerMode; Scene3240 *scene = (Scene3240 *)R2_GLOBALS._sceneManager._scene; if (!_object2) { - _object2 = &scene->_actor1; + _object2 = &scene->_teal; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -2741,13 +2810,14 @@ void SpeakerTeal3240::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4070, (_object2->_strip * 2) - 1, 1); _object1.animate(ANIM_MODE_5, this); } } -void SpeakerTeal3400::proc15() { +void SpeakerTeal3400::animateSpeaker() { Scene3400 *scene = (Scene3400 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -2757,7 +2827,7 @@ void SpeakerTeal3400::proc15() { _object2->hide(); _object1.postInit(); _object1._numFrames = 7; - _object1._effect = 1; + _object1._effect = EFFECT_SHADED; _object1.changeZoom(-1); R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); @@ -2779,22 +2849,26 @@ void SpeakerTeal3400::proc15() { _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4107, 5, 1); _object1.animate(ANIM_MODE_5, this); break; case 2: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4107, 1, 1); _object1.animate(ANIM_MODE_5, this); break; case 3: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4107, 7, 1); _object1.animate(ANIM_MODE_5, this); break; case 4: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4107, 3, 1); _object1.animate(ANIM_MODE_5, this); break; @@ -2804,18 +2878,18 @@ void SpeakerTeal3400::proc15() { } } -void SpeakerTeal3600::proc15() { +void SpeakerTeal3600::animateSpeaker() { Scene3600 *scene = (Scene3600 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; if (!_object2) { - _object2 = &scene->_actor5; + _object2 = &scene->_teal; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); _object1._numFrames = 7; - _object1._effect = 1; + _object1._effect = EFFECT_SHADED; _object1.changeZoom(-1); R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); @@ -2835,22 +2909,26 @@ void SpeakerTeal3600::proc15() { _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4107, 5, 1); _object1.animate(ANIM_MODE_5, this); break; case 2: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4107, 1, 1); _object1.animate(ANIM_MODE_5, this); break; case 3: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4107, 7, 1); _object1.animate(ANIM_MODE_5, this); break; case 4: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4107, 3, 1); _object1.animate(ANIM_MODE_5, this); break; @@ -2876,12 +2954,12 @@ SpeakerTomko3245::SpeakerTomko3245() { _numFrames = 0; } -void SpeakerTomko3245::proc15() { +void SpeakerTomko3245::animateSpeaker() { int v = _speakerMode; Scene3245 *scene = (Scene3245 *)R2_GLOBALS._sceneManager._scene; if (!_object2) { - _object2 = &scene->_actor2; + _object2 = &scene->_tomko; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -2893,7 +2971,8 @@ void SpeakerTomko3245::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + switch (_object2->_visage) { case 3100: _object1.setup(4105, (_object2->_strip * 2) - 1, 1); @@ -2928,8 +3007,8 @@ SpeakerWebbster::SpeakerWebbster(int color) { _numFrames = 0; } -void SpeakerWebbster180::proc15() { - Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; +void SpeakerWebbster180::animateSpeaker() { + Scene180 *scene = (Scene180 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -2949,18 +3028,21 @@ void SpeakerWebbster180::proc15() { _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(75, 7, 1); _object1.animate(ANIM_MODE_5, this); break; case 2: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(76, 4, 1); _object1.animate(ANIM_MODE_5, this); break; case 3: - ((SceneItem *)_action)->_sceneRegionId = 0; - _object1.setup(75, 6, 1); + ((StripManager *)_action)->_useless = 0; + + _object1.setup(76, 6, 1); _object1.animate(ANIM_MODE_5, this); break; default: @@ -2969,12 +3051,12 @@ void SpeakerWebbster180::proc15() { } } -void SpeakerWebbster3240::proc15() { +void SpeakerWebbster3240::animateSpeaker() { int v = _speakerMode; Scene3240 *scene = (Scene3240 *)R2_GLOBALS._sceneManager._scene; if (!_object2) { - _object2 = &scene->_actor2; + _object2 = &scene->_webbster; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -2986,13 +3068,14 @@ void SpeakerWebbster3240::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); } else { - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4110, 5, 1); _object1.animate(ANIM_MODE_5, this); } } -void SpeakerWebbster3375::proc15() { +void SpeakerWebbster3375::animateSpeaker() { Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -3003,7 +3086,7 @@ void SpeakerWebbster3375::proc15() { _object1.postInit(); _object1.setPosition(_object2->_position); _object1._numFrames = 7; - _object1._effect = 1; + _object1._effect = EFFECT_SHADED; _object1.changeZoom(-1); if (scene->_companion1._position.y != 163) @@ -3026,7 +3109,8 @@ void SpeakerWebbster3375::proc15() { _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4110, 5, 1); _object1.animate(ANIM_MODE_5, this); break; @@ -3036,7 +3120,7 @@ void SpeakerWebbster3375::proc15() { } } -void SpeakerWebbster3385::proc15() { +void SpeakerWebbster3385::animateSpeaker() { Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -3047,7 +3131,7 @@ void SpeakerWebbster3385::proc15() { _object1.postInit(); _object1.setPosition(_object2->_position); _object1._numFrames = 7; - _object1._effect = 1; + _object1._effect = EFFECT_SHADED; _object1.changeZoom(-1); if (R2_GLOBALS._sceneManager._previousScene == 3375) @@ -3070,7 +3154,8 @@ void SpeakerWebbster3385::proc15() { _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4110, 5, 1); _object1.animate(ANIM_MODE_5, this); break; @@ -3080,7 +3165,7 @@ void SpeakerWebbster3385::proc15() { } } -void SpeakerWebbster3395::proc15() { +void SpeakerWebbster3395::animateSpeaker() { Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -3091,7 +3176,7 @@ void SpeakerWebbster3395::proc15() { _object1.postInit(); _object1.setPosition(_object2->_position); _object1._numFrames = 7; - _object1._effect = 1; + _object1._effect = EFFECT_SHADED; _object1.changeZoom(-1); if (R2_GLOBALS._sceneManager._previousScene == 3385) @@ -3114,7 +3199,8 @@ void SpeakerWebbster3395::proc15() { _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4110, 5, 1); _object1.animate(ANIM_MODE_5, this); break; @@ -3124,7 +3210,7 @@ void SpeakerWebbster3395::proc15() { } } -void SpeakerWebbster3400::proc15() { +void SpeakerWebbster3400::animateSpeaker() { Scene3400 *scene = (Scene3400 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -3135,7 +3221,7 @@ void SpeakerWebbster3400::proc15() { _object1.postInit(); _object1.setPosition(_object2->_position); _object1._numFrames = 7; - _object1._effect = 1; + _object1._effect = EFFECT_SHADED; _object1.changeZoom(-1); R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); @@ -3149,17 +3235,20 @@ void SpeakerWebbster3400::proc15() { _object1.animate(ANIM_MODE_2, NULL); break; case 1: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4110, 5, 1); _object1.animate(ANIM_MODE_5, this); break; case 2: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4110, 7, 1); _object1.animate(ANIM_MODE_5, this); break; case 3: - ((SceneItem *)_action)->_sceneRegionId = 0; + ((StripManager *)_action)->_useless = 0; + _object1.setup(4110, 3, 1); _object1.animate(ANIM_MODE_5, this); break; @@ -3183,7 +3272,7 @@ SpeakerDutyOfficer180::SpeakerDutyOfficer180(): VisualSpeaker() { _numFrames = 0; } -void SpeakerDutyOfficer180::proc15() { +void SpeakerDutyOfficer180::animateSpeaker() { Scene180 *scene = (Scene180 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -3203,7 +3292,7 @@ void SpeakerDutyOfficer180::proc15() { _object1.animate(ANIM_MODE_2, NULL); break; case 1: - _action = NULL; + _action->_action = NULL; _object1.setup(76, 2, 1); _object1.animate(ANIM_MODE_5, this); break; @@ -3213,6 +3302,5 @@ void SpeakerDutyOfficer180::proc15() { } } - } // End of namespace Ringworld2 } // End of namespace TsAGE diff --git a/engines/tsage/ringworld2/ringworld2_speakers.h b/engines/tsage/ringworld2/ringworld2_speakers.h index 1b87606381..4a794f65c8 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.h +++ b/engines/tsage/ringworld2/ringworld2_speakers.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -49,11 +49,11 @@ public: bool _removeObject; uint32 _frameNumber; int _numFrames; - int _delayAmount2; - uint32 _frameNumber2; + int _voiceDelayAmount; + uint32 _voiceFrameNumber; private: void setFrame(int numFrames); - void setFrame2(int numFrames); + void setVoiceFrame(int numFrames); public: VisualSpeaker(); @@ -63,8 +63,8 @@ public: virtual void signal(); virtual void dispatch(); virtual void setText(const Common::String &msg); - virtual void proc15() {} - virtual void proc16(); + virtual void animateSpeaker() {} + virtual void stopSpeaking(); void setDelay(int delay); }; @@ -83,7 +83,7 @@ public: SpeakerCaptain3210(); virtual Common::String getClassName() { return "SpeakerCaptain3210"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Caretaker @@ -102,7 +102,7 @@ public: SpeakerChief1100(); virtual Common::String getClassName() { return "SpeakerChief1100"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Guard @@ -116,7 +116,7 @@ public: class SpeakerGuard2800 : public SpeakerGuard { public: virtual Common::String getClassName() { return "SpeakerGuard2800"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Jocko @@ -130,19 +130,19 @@ public: class SpeakerJocko3200 : public SpeakerJocko { public: virtual Common::String getClassName() { return "SpeakerJocko3200"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerJocko3220 : public SpeakerJocko { public: virtual Common::String getClassName() { return "SpeakerJocko3220"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerJocko3230 : public SpeakerJocko { public: virtual Common::String getClassName() { return "SpeakerJocko3230"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Miranda @@ -156,55 +156,55 @@ public: class SpeakerMiranda300 : public SpeakerMiranda { public: virtual Common::String getClassName() { return "SpeakerMiranda300"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerMiranda1625 : public SpeakerMiranda { public: virtual Common::String getClassName() { return "SpeakerMiranda1625"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerMiranda3255 : public SpeakerMiranda { public: virtual Common::String getClassName() { return "SpeakerMiranda3255"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerMiranda3375 : public SpeakerMiranda { public: virtual Common::String getClassName() { return "SpeakerMiranda3375"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerMiranda3385 : public SpeakerMiranda { public: virtual Common::String getClassName() { return "SpeakerMiranda3385"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerMiranda3395 : public SpeakerMiranda { public: virtual Common::String getClassName() { return "SpeakerMiranda3395"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerMiranda3400 : public SpeakerMiranda { public: virtual Common::String getClassName() { return "SpeakerMiranda3400"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerMiranda3600 : public SpeakerMiranda { public: virtual Common::String getClassName() { return "SpeakerMiranda3600"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerMiranda3700 : public SpeakerMiranda { public: virtual Common::String getClassName() { return "SpeakerMiranda3700"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Nej @@ -218,19 +218,19 @@ public: class SpeakerNej2700 : public SpeakerNej { public: virtual Common::String getClassName() { return "SpeakerNej2700"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerNej2750 : public SpeakerNej { public: virtual Common::String getClassName() { return "SpeakerNej2750"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerNej2800 : public SpeakerNej { public: virtual Common::String getClassName() { return "SpeakerNej2800"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Pharisha @@ -245,7 +245,7 @@ public: class SpeakerPharisha2435 : public SpeakerPharisha { public: virtual Common::String getClassName() { return "SpeakerPharisha2435"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Private @@ -255,7 +255,7 @@ public: SpeakerPrivate3210(); virtual Common::String getClassName() { return "SpeakerPrivate3210"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Protector @@ -265,7 +265,7 @@ public: SpeakerProtector3600(); virtual Common::String getClassName() { return "SpeakerProtector3600"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Quinn @@ -279,97 +279,97 @@ public: class SpeakerQuinn300 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn300"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn500 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn500"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn1100 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn1100"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn2435 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn2435"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn2450 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn2450"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn2700 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn2700"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn2750 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn2750"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn2800 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn2800"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn3255 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn3255"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn3375 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn3375"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn3385 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn3385"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn3395 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn3395"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn3400 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn3400"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn3600 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn3600"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn3700 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn3700"; } virtual void setText(const Common::String &msg); - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to QuinnL -class SpeakerQuinnL : public VisualSpeaker { +class SpeakerQuinnL : public SpeakerQuinn { public: SpeakerQuinnL(); @@ -383,7 +383,7 @@ public: SpeakerRalf3245(); virtual Common::String getClassName() { return "SpeakerRalf3245"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Rocko @@ -397,19 +397,19 @@ public: class SpeakerRocko3200 : public SpeakerRocko { public: virtual Common::String getClassName() { return "SpeakerRocko3200"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerRocko3220 : public SpeakerRocko { public: virtual Common::String getClassName() { return "SpeakerRocko3220"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerRocko3230 : public SpeakerRocko { public: virtual Common::String getClassName() { return "SpeakerRocko3230"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Seeker @@ -423,79 +423,79 @@ public: class SpeakerSeeker300 : public SpeakerSeeker { public: virtual Common::String getClassName() { return "SpeakerSeeker300"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerSeeker500 : public SpeakerSeeker { public: virtual Common::String getClassName() { return "SpeakerSeeker500"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerSeeker1100 : public SpeakerSeeker { public: virtual Common::String getClassName() { return "SpeakerSeeker1100"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerSeeker1900 : public SpeakerSeeker { public: virtual Common::String getClassName() { return "SpeakerSeeker1900"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerSeeker2435 : public SpeakerSeeker { public: virtual Common::String getClassName() { return "SpeakerSeeker2435"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerSeeker2450 : public SpeakerSeeker { public: virtual Common::String getClassName() { return "SpeakerSeeker2450"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerSeeker3375 : public SpeakerSeeker { public: virtual Common::String getClassName() { return "SpeakerSeeker3375"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerSeeker3385 : public SpeakerSeeker { public: virtual Common::String getClassName() { return "SpeakerSeeker3385"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerSeeker3395 : public SpeakerSeeker { public: virtual Common::String getClassName() { return "SpeakerSeeker3395"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerSeeker3400 : public SpeakerSeeker { public: virtual Common::String getClassName() { return "SpeakerSeeker3400"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerSeeker3600 : public SpeakerSeeker { public: virtual Common::String getClassName() { return "SpeakerSeeker3600"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerSeeker3700 : public SpeakerSeeker { public: virtual Common::String getClassName() { return "SpeakerSeeker3700"; } virtual void setText(const Common::String &msg); - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to SeekerL -class SpeakerSeekerL : public VisualSpeaker { +class SpeakerSeekerL : public SpeakerSeeker { public: SpeakerSeekerL(); @@ -509,7 +509,7 @@ public: SpeakerSocko3200(); virtual Common::String getClassName() { return "SpeakerSocko3200"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Soldier @@ -524,7 +524,7 @@ class SpeakerSoldier300 : public SpeakerSoldier { public: SpeakerSoldier300() : SpeakerSoldier(60) {} virtual Common::String getClassName() { return "SpeakerSoldier300"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerSoldier1625 : public SpeakerSoldier { @@ -550,37 +550,37 @@ public: class SpeakerTeal180 : public SpeakerTeal { public: virtual Common::String getClassName() { return "SpeakerTeal180"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerTeal300 : public SpeakerTeal { public: virtual Common::String getClassName() { return "SpeakerTeal300"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerTeal1625 : public SpeakerTeal { public: virtual Common::String getClassName() { return "SpeakerTeal1625"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerTeal3240 : public SpeakerTeal { public: virtual Common::String getClassName() { return "SpeakerTeal3240"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerTeal3400 : public SpeakerTeal { public: virtual Common::String getClassName() { return "SpeakerTeal3400"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerTeal3600 : public SpeakerTealMode7 { public: virtual Common::String getClassName() { return "SpeakerTeal3600"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Tomko @@ -590,7 +590,7 @@ public: SpeakerTomko3245(); virtual Common::String getClassName() { return "SpeakerTomko3245"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Webbster @@ -605,7 +605,7 @@ class SpeakerWebbster180 : public SpeakerWebbster { public: SpeakerWebbster180() : SpeakerWebbster(27) {} virtual Common::String getClassName() { return "SpeakerWebbster180"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerWebbster2500 : public SpeakerWebbster { @@ -619,7 +619,7 @@ public: SpeakerWebbster3240() : SpeakerWebbster(10) {} virtual Common::String getClassName() { return "SpeakerWebbster3240"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerWebbster3375 : public SpeakerWebbster { @@ -627,7 +627,7 @@ public: SpeakerWebbster3375() : SpeakerWebbster(60) {} virtual Common::String getClassName() { return "SpeakerWebbster3375"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerWebbster3385 : public SpeakerWebbster { @@ -635,7 +635,7 @@ public: SpeakerWebbster3385() : SpeakerWebbster(60) {} virtual Common::String getClassName() { return "SpeakerWebbster3385"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerWebbster3395 : public SpeakerWebbster { @@ -643,7 +643,7 @@ public: SpeakerWebbster3395() : SpeakerWebbster(60) {} virtual Common::String getClassName() { return "SpeakerWebbster3395"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerWebbster3400 : public SpeakerWebbster { @@ -651,7 +651,7 @@ public: SpeakerWebbster3400() : SpeakerWebbster(27) {} virtual Common::String getClassName() { return "SpeakerWebbster3400"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerDutyOfficer180: public VisualSpeaker { @@ -659,7 +659,7 @@ public: SpeakerDutyOfficer180(); virtual Common::String getClassName() { return "SpeakerDutyOfficer"; } - virtual void proc15(); + virtual void animateSpeaker(); }; } // End of namespace Ringworld2 diff --git a/engines/tsage/saveload.cpp b/engines/tsage/saveload.cpp index dbc122e6e4..9954b929b2 100644 --- a/engines/tsage/saveload.cpp +++ b/engines/tsage/saveload.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -47,6 +47,8 @@ SavedObject::~SavedObject() { Saver::Saver() { _macroSaveFlag = false; _macroRestoreFlag = false; + + _factoryPtr = nullptr; } Saver::~Saver() { @@ -127,7 +129,6 @@ Common::Error Saver::save(int slot, const Common::String &saveName) { // Set fields _macroSaveFlag = true; - _saveSlot = slot; // Try and create the save file Common::OutSaveFile *saveFile = g_system->getSavefileManager()->openForSaving(g_vm->generateSaveName(slot)); @@ -140,8 +141,8 @@ Common::Error Saver::save(int slot, const Common::String &saveName) { // Write out the savegame header tSageSavegameHeader header; - header.saveName = saveName; - header.version = TSAGE_SAVEGAME_VERSION; + header._saveName = saveName; + header._version = TSAGE_SAVEGAME_VERSION; writeSavegameHeader(saveFile, header); // Save out objects that need to come at the start of the savegame @@ -177,7 +178,6 @@ Common::Error Saver::restore(int slot) { // Set fields _macroRestoreFlag = true; - _saveSlot = slot; _unresolvedPtrs.clear(); // Set up the serializer @@ -190,11 +190,11 @@ Common::Error Saver::restore(int slot) { // Read in the savegame header tSageSavegameHeader header; readSavegameHeader(saveFile, header); - if (header.thumbnail) - header.thumbnail->free(); - delete header.thumbnail; + if (header._thumbnail) + header._thumbnail->free(); + delete header._thumbnail; - serializer.setSaveVersion(header.version); + serializer.setSaveVersion(header._version); // Load in data for objects that need to come at the start of the savegame for (Common::List<SaveListener *>::iterator i = _listeners.begin(); i != _listeners.end(); ++i) { @@ -242,34 +242,34 @@ const char *SAVEGAME_STR = "SCUMMVM_TSAGE"; bool Saver::readSavegameHeader(Common::InSaveFile *in, tSageSavegameHeader &header) { char saveIdentBuffer[SAVEGAME_STR_SIZE + 1]; - header.thumbnail = NULL; + header._thumbnail = NULL; // Validate the header Id in->read(saveIdentBuffer, SAVEGAME_STR_SIZE + 1); if (strncmp(saveIdentBuffer, SAVEGAME_STR, SAVEGAME_STR_SIZE)) return false; - header.version = in->readByte(); - if (header.version > TSAGE_SAVEGAME_VERSION) + header._version = in->readByte(); + if (header._version > TSAGE_SAVEGAME_VERSION) return false; // Read in the string - header.saveName.clear(); + header._saveName.clear(); char ch; - while ((ch = (char)in->readByte()) != '\0') header.saveName += ch; + while ((ch = (char)in->readByte()) != '\0') header._saveName += ch; // Get the thumbnail - header.thumbnail = Graphics::loadThumbnail(*in); - if (!header.thumbnail) + header._thumbnail = Graphics::loadThumbnail(*in); + if (!header._thumbnail) return false; // Read in save date/time - header.saveYear = in->readSint16LE(); - header.saveMonth = in->readSint16LE(); - header.saveDay = in->readSint16LE(); - header.saveHour = in->readSint16LE(); - header.saveMinutes = in->readSint16LE(); - header.totalFrames = in->readUint32LE(); + header._saveYear = in->readSint16LE(); + header._saveMonth = in->readSint16LE(); + header._saveDay = in->readSint16LE(); + header._saveHour = in->readSint16LE(); + header._saveMinutes = in->readSint16LE(); + header._totalFrames = in->readUint32LE(); return true; } @@ -281,7 +281,7 @@ void Saver::writeSavegameHeader(Common::OutSaveFile *out, tSageSavegameHeader &h out->writeByte(TSAGE_SAVEGAME_VERSION); // Write savegame name - out->write(header.saveName.c_str(), header.saveName.size() + 1); + out->write(header._saveName.c_str(), header._saveName.size() + 1); // Get the active palette uint8 thumbPalette[256 * 3]; diff --git a/engines/tsage/saveload.h b/engines/tsage/saveload.h index d43ef792bc..be5ff51ffb 100644 --- a/engines/tsage/saveload.h +++ b/engines/tsage/saveload.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -33,22 +33,22 @@ namespace TsAGE { typedef void (*SaveNotifierFn)(bool postFlag); -#define TSAGE_SAVEGAME_VERSION 10 +#define TSAGE_SAVEGAME_VERSION 15 class SavedObject; struct tSageSavegameHeader { - uint8 version; - Common::String saveName; - Graphics::Surface *thumbnail; - int saveYear, saveMonth, saveDay; - int saveHour, saveMinutes; - int totalFrames; + uint8 _version; + Common::String _saveName; + Graphics::Surface *_thumbnail; + int _saveYear, _saveMonth, _saveDay; + int _saveHour, _saveMinutes; + int _totalFrames; }; /*--------------------------------------------------------------------------*/ -// FIXME: workaround to supress spurious strict-alias warnings on older GCC +// FIXME: workaround to suppress spurious strict-alias warnings on older GCC // versions. this should be resolved with the savegame rewrite #define SYNC_POINTER(x) do { \ SavedObject **y = (SavedObject **)((void *)&x); \ @@ -59,7 +59,7 @@ struct tSageSavegameHeader { if (s.isLoading()) FIELD = (TYPE)v_##FIELD; /** - * Derived serializer class with extra synchronisation types + * Derived serializer class with extra synchronization types */ class Serializer : public Common::Serializer { public: @@ -212,7 +212,6 @@ private: bool _macroSaveFlag; bool _macroRestoreFlag; - int _saveSlot; void resolveLoadPointers(); public: diff --git a/engines/tsage/scenes.cpp b/engines/tsage/scenes.cpp index 58bb8c4a44..80ce1e3ecc 100644 --- a/engines/tsage/scenes.cpp +++ b/engines/tsage/scenes.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -43,6 +43,7 @@ SceneManager::SceneManager() { g_saver->addListener(this); _objectCount = 0; _loadMode = 0; + _sceneLoadCount = 0; } SceneManager::~SceneManager() { @@ -149,6 +150,7 @@ void SceneManager::fadeInIfNecessary() { void SceneManager::changeScene(int newSceneNumber) { debug(1, "changeScene(%d)", newSceneNumber); + // Fade out the scene ScenePalette scenePalette; uint32 adjustData = 0; @@ -273,6 +275,8 @@ Scene::Scene() : _sceneBounds(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT), _activeScreenNumber = 0; _oldSceneBounds = Rect(4000, 4000, 4100, 4100); Common::fill(&_zoomPercents[0], &_zoomPercents[256], 0); + + _screenNumber = 0; } Scene::~Scene() { @@ -282,15 +286,23 @@ void Scene::synchronize(Serializer &s) { if (s.getVersion() >= 2) StripCallback::synchronize(s); - s.syncAsSint32LE(_field12); + if (s.getVersion() < 14) { + int useless = 0; + s.syncAsSint32LE(useless); + } + s.syncAsSint32LE(_screenNumber); s.syncAsSint32LE(_activeScreenNumber); s.syncAsSint32LE(_sceneMode); _backgroundBounds.synchronize(s); _sceneBounds.synchronize(s); _oldSceneBounds.synchronize(s); - s.syncAsSint16LE(_fieldA); - s.syncAsSint16LE(_fieldE); + + if (s.getVersion() < 14) { + int useless = 0; + s.syncAsSint16LE(useless); + s.syncAsSint16LE(useless); + } for (int i = 0; i < 256; ++i) s.syncAsUint16LE(_enabledSections[i]); @@ -303,7 +315,6 @@ void Scene::synchronize(Serializer &s) { void Scene::postInit(SceneObjectList *OwnerList) { _action = NULL; - _field12 = 0; _sceneMode = 0; } diff --git a/engines/tsage/scenes.h b/engines/tsage/scenes.h index d5ac88c692..9e3857af5e 100644 --- a/engines/tsage/scenes.h +++ b/engines/tsage/scenes.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -35,7 +35,6 @@ class Scene : public StripCallback { private: void drawBackgroundObjects(); public: - int _field12; int _screenNumber; int _activeScreenNumber; int _sceneMode; @@ -49,9 +48,6 @@ public: int _zoomPercents[256]; ScenePriorities _priorities; SceneObjectList _bgSceneObjects; - - int _fieldA; - int _fieldE; public: Scene(); virtual ~Scene(); diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 02abc58178..c5c38505a7 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -120,17 +120,31 @@ void SoundManager::syncSounds() { bool mute = false; if (ConfMan.hasKey("mute")) mute = ConfMan.getBool("mute"); + bool subtitles = ConfMan.hasKey("subtitles") ? ConfMan.getBool("subtitles") : true; bool music_mute = mute; + bool voice_mute = mute; if (!mute) { music_mute = ConfMan.getBool("music_mute"); + voice_mute = ConfMan.getBool("speech_mute"); } // Get the new music volume int musicVolume = music_mute ? 0 : MIN(255, ConfMan.getInt("music_volume")); this->setMasterVol(musicVolume / 2); + + // Return to Ringworld voice settings + if (g_vm->getGameID() == GType_Ringworld2) { + // If we don't have voice, then ensure that text is turned on + if (voice_mute) + subtitles = true; + + R2_GLOBALS._speechSubtitles = + (voice_mute ? 0 : SPEECH_VOICE) | + (!subtitles ? 0 : SPEECH_TEXT); + } } void SoundManager::update() { @@ -454,8 +468,9 @@ void SoundManager::sfProcessFading() { if (vtStruct->_voiceType == VOICETYPE_1) { for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) { - if (vtStruct->_entries[idx]._type1._field6 >= -1) - ++vtStruct->_entries[idx]._type1._field6; + VoiceStructEntryType1 &vte = vtStruct->_entries[idx]._type1; + if (vte._field6 >= -1) + ++vte._field6; } } } @@ -485,22 +500,22 @@ void SoundManager::sfUpdateVoiceStructs() { if (vs->_voiceType == VOICETYPE_0) { for (uint idx = 0; idx < vs->_entries.size(); ++idx) { - VoiceStructEntry &vse = vs->_entries[idx]; + VoiceStructEntryType0 &vte = vs->_entries[idx]._type0; - vse._type0._sound = vse._type0._sound2; - vse._type0._channelNum = vse._type0._channelNum2; - vse._type0._priority = vse._type0._priority2; - vse._type0._fieldA = vse._type0._field12; + vte._sound = vte._sound2; + vte._channelNum = vte._channelNum2; + vte._priority = vte._priority2; + vte._fieldA = vte._field12; } } else { vs->_field3 = vs->_numVoices; for (uint idx = 0; idx < vs->_entries.size(); ++idx) { - VoiceStructEntry &vse = vs->_entries[idx]; + VoiceStructEntryType1 &vte = vs->_entries[idx]._type1; - vse._type1._sound = vse._type1._sound2; - vse._type1._channelNum = vse._type1._channelNum2; - vse._type1._priority = vse._type1._priority2; + vte._sound = vte._sound2; + vte._channelNum = vte._channelNum2; + vte._priority = vte._priority2; } } } @@ -515,16 +530,16 @@ void SoundManager::sfUpdateVoiceStructs2() { for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) { if (vtStruct->_voiceType == VOICETYPE_0) { - VoiceStructEntryType0 &vse = vtStruct->_entries[idx]._type0; - vse._sound2 = vse._sound; - vse._channelNum2 = vse._channelNum; - vse._priority2 = vse._priority; - vse._field12 = vse._fieldA; + VoiceStructEntryType0 &vte = vtStruct->_entries[idx]._type0; + vte._sound2 = vte._sound; + vte._channelNum2 = vte._channelNum; + vte._priority2 = vte._priority; + vte._field12 = vte._fieldA; } else { - VoiceStructEntryType1 &vse = vtStruct->_entries[idx]._type1; - vse._sound2 = vse._sound; - vse._channelNum2 = vse._channelNum; - vse._priority2 = vse._priority; + VoiceStructEntryType1 &vte = vtStruct->_entries[idx]._type1; + vte._sound2 = vte._sound; + vte._channelNum2 = vte._channelNum; + vte._priority2 = vte._priority; } } } @@ -710,7 +725,7 @@ void SoundManager::sfRethinkSoundDrivers() { ve._type0._sound = NULL; ve._type0._channelNum = 0; ve._type0._priority = 0; - ve._type0._fieldA = 0; + ve._type0._fieldA = false; vs->_entries.push_back(ve); } @@ -759,32 +774,31 @@ void SoundManager::sfRethinkVoiceTypes() { if (vs->_voiceType == VOICETYPE_0) { for (uint idx = 0; idx < vs->_entries.size(); ++idx) { - VoiceStructEntry &vse = vs->_entries[idx]; - vse._type0._sound3 = vse._type0._sound; - vse._type0._channelNum3 = vse._type0._channelNum; - vse._type0._priority3 = vse._type0._priority; - vse._type0._field1A = vse._type0._fieldA; - vse._type0._sound = NULL; - vse._type0._channelNum = 0; - vse._type0._priority = 0; - vse._type0._fieldA = 0; - vse._type0._sound2 = NULL; - vse._type0._channelNum2 = 0; - vse._type0._priority2 = 0; - vse._type0._field12 = 0; + VoiceStructEntryType0 &vte = vs->_entries[idx]._type0; + vte._sound3 = vte._sound; + vte._channelNum3 = vte._channelNum; + vte._priority3 = vte._priority; + vte._sound = NULL; + vte._channelNum = 0; + vte._priority = 0; + vte._fieldA = false; + vte._sound2 = NULL; + vte._channelNum2 = 0; + vte._priority2 = 0; + vte._field12 = false; } } else { for (uint idx = 0; idx < vs->_entries.size(); ++idx) { - VoiceStructEntry &vse = vs->_entries[idx]; - vse._type1._sound3 = vse._type1._sound; - vse._type1._channelNum3 = vse._type1._channelNum; - vse._type1._priority3 = vse._type1._priority; - vse._type1._sound = NULL; - vse._type1._channelNum = 0; - vse._type1._priority = 0; - vse._type1._sound2 = NULL; - vse._type1._channelNum2 = 0; - vse._type1._priority2 = 0; + VoiceStructEntryType1 &vte = vs->_entries[idx]._type1; + vte._sound3 = vte._sound; + vte._channelNum3 = vte._channelNum; + vte._priority3 = vte._priority; + vte._sound = NULL; + vte._channelNum = 0; + vte._priority = 0; + vte._sound2 = NULL; + vte._channelNum2 = 0; + vte._priority2 = 0; } // Reset the number of voices available @@ -844,10 +858,11 @@ void SoundManager::sfRethinkVoiceTypes() { if (numVoices >= chNumVoices) { int channelCount = chNumVoices, idx = 0; while (channelCount > 0) { - if (!vtStruct->_entries[idx]._type1._sound2) { - vtStruct->_entries[idx]._type1._sound2 = sound; - vtStruct->_entries[idx]._type1._channelNum2 = foundIndex; - vtStruct->_entries[idx]._type1._priority2 = foundPriority; + VoiceStructEntryType1 &vte = vtStruct->_entries[idx]._type1; + if (!vte._sound2) { + vte._sound2 = sound; + vte._channelNum2 = foundIndex; + vte._priority2 = foundPriority; --channelCount; } ++idx; @@ -867,10 +882,11 @@ void SoundManager::sfRethinkVoiceTypes() { } for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) { - if (vtStruct->_entries[idx]._type1._priority2 == maxPriority) { - vtStruct->_entries[idx]._type1._sound2 = NULL; - vtStruct->_entries[idx]._type1._channelNum2 = 0; - vtStruct->_entries[idx]._type1._priority2 = 0; + VoiceStructEntryType1 &vte = vtStruct->_entries[idx]._type1; + if (vte._priority2 == maxPriority) { + vte._sound2 = NULL; + vte._channelNum2 = 0; + vte._priority2 = 0; ++numVoices; } } @@ -878,10 +894,11 @@ void SoundManager::sfRethinkVoiceTypes() { int voicesCtr = chNumVoices; for (uint idx = 0; (idx < vtStruct->_entries.size()) && (voicesCtr > 0); ++idx) { - if (!vtStruct->_entries[idx]._type1._sound2) { - vtStruct->_entries[idx]._type1._sound2 = sound; - vtStruct->_entries[idx]._type1._channelNum2 = foundIndex; - vtStruct->_entries[idx]._type1._priority2 = foundPriority; + VoiceStructEntryType1 &vte = vtStruct->_entries[idx]._type1; + if (!vte._sound2) { + vte._sound2 = sound; + vte._channelNum2 = foundIndex; + vte._priority2 = foundPriority; --voicesCtr; } } @@ -918,10 +935,11 @@ void SoundManager::sfRethinkVoiceTypes() { } if (entryIndex != -1) { - vtStruct->_entries[entryIndex]._type0._sound2 = sound; - vtStruct->_entries[entryIndex]._type0._channelNum2 = foundIndex; - vtStruct->_entries[entryIndex]._type0._priority2 = foundPriority; - vtStruct->_entries[entryIndex]._type0._field12 = 0; + VoiceStructEntryType0 &vte = vtStruct->_entries[entryIndex]._type0; + vte._sound2 = sound; + vte._channelNum2 = foundIndex; + vte._priority2 = foundPriority; + vte._field12 = false; continue; } @@ -939,10 +957,11 @@ void SoundManager::sfRethinkVoiceTypes() { } if (entryIndex != -1) { - vtStruct->_entries[entryIndex]._type0._sound2 = sound; - vtStruct->_entries[entryIndex]._type0._channelNum2 = foundIndex; - vtStruct->_entries[entryIndex]._type0._priority2 = foundPriority; - vtStruct->_entries[entryIndex]._type0._field12 = 0; + VoiceStructEntryType0 &vte = vtStruct->_entries[entryIndex]._type0; + vte._sound2 = sound; + vte._channelNum2 = foundIndex; + vte._priority2 = foundPriority; + vte._field12 = false; continue; } @@ -955,7 +974,7 @@ void SoundManager::sfRethinkVoiceTypes() { int entryIndex = -1; for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) { if (vtStruct->_entries[idx]._voiceNum == foundIndex) { - foundIndex = true; + foundMatch = true; if (!vtStruct->_entries[idx]._type0._sound2) { entryIndex = idx; break; @@ -964,10 +983,11 @@ void SoundManager::sfRethinkVoiceTypes() { } if (entryIndex != -1) { - vtStruct->_entries[entryIndex]._type0._sound2 = sound; - vtStruct->_entries[entryIndex]._type0._channelNum2 = foundIndex; - vtStruct->_entries[entryIndex]._type0._priority2 = foundPriority; - vtStruct->_entries[entryIndex]._type0._field12 = 0; + VoiceStructEntryType0 &vte = vtStruct->_entries[entryIndex]._type0; + vte._sound2 = sound; + vte._channelNum2 = foundIndex; + vte._priority2 = foundPriority; + vte._field12 = false; continue; } @@ -994,7 +1014,7 @@ void SoundManager::sfRethinkVoiceTypes() { if (vtStruct->_entries[idx]._type0._priority2 > maxPriority) { maxPriority = vtStruct->_entries[idx]._type0._priority2; - entryIndex = -1; + entryIndex = idx; } } @@ -1003,10 +1023,11 @@ void SoundManager::sfRethinkVoiceTypes() { continue; if (entryIndex != -1) { - vtStruct->_entries[entryIndex]._type0._sound2 = sound; - vtStruct->_entries[entryIndex]._type0._channelNum2 = foundIndex; - vtStruct->_entries[entryIndex]._type0._priority2 = foundPriority; - vtStruct->_entries[entryIndex]._type0._field12 = 1; + VoiceStructEntryType0 &vte = vtStruct->_entries[entryIndex]._type0; + vte._sound2 = sound; + vte._channelNum2 = foundIndex; + vte._priority2 = foundPriority; + vte._field12 = true; continue; } @@ -1021,14 +1042,15 @@ void SoundManager::sfRethinkVoiceTypes() { for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) { if (vtStruct->_entries[idx]._field1) { - if (!vtStruct->_entries[idx]._type0._sound2) { + VoiceStructEntryType0 &vte = vtStruct->_entries[idx]._type0; + if (!vte._sound2) { if (vtStruct->_entries[idx]._voiceNum > maxVoiceNum) { maxVoiceNum = vtStruct->_entries[idx]._voiceNum; voiceIndex = idx; } } else { - if (vtStruct->_entries[idx]._type0._priority2 > maxPriority) { - maxPriority = vtStruct->_entries[idx]._type0._priority2; + if (vte._priority2 > maxPriority) { + maxPriority = vte._priority2; priorityIndex = idx; } } @@ -1046,7 +1068,7 @@ void SoundManager::sfRethinkVoiceTypes() { vteSrc._sound2 = sound; vteSrc._channelNum2 = foundIndex; vteSrc._priority2 = foundPriority; - vteSrc._field12 = 1; + vteSrc._field12 = true; continue; } @@ -1070,7 +1092,7 @@ void SoundManager::sfRethinkVoiceTypes() { vteSrc._sound2 = sound; vteSrc._channelNum2 = foundIndex; vteSrc._priority2 = foundPriority; - vteSrc._field12 = 1; + vteSrc._field12 = true; continue; } } @@ -1101,10 +1123,10 @@ void SoundManager::sfRethinkVoiceTypes() { ++total; vse._priority = vse._priority2; - vse._fieldA = 1; + vse._fieldA = true; vse._sound2 = NULL; - if (total) { + if ((total) && vse._sound) { driver->proc24(vse._channelNum, idx, vse._sound, 123, 0); driver->proc24(vse._channelNum, idx, vse._sound, 1, vse._sound->_chModulation[vse._channelNum]); driver->proc24(vse._channelNum, idx, vse._sound, 7, @@ -1121,7 +1143,7 @@ void SoundManager::sfRethinkVoiceTypes() { vse._sound = NULL; vse._channelNum = 0; vse._priority = 0; - vse._fieldA = 0; + vse._fieldA = false; } } @@ -1134,13 +1156,13 @@ void SoundManager::sfRethinkVoiceTypes() { continue; for (uint entryIndex = 0; entryIndex < vs->_entries.size(); ++entryIndex) { - if ((vs->_entries[entryIndex]._type0._sound3 != sound) || - (vs->_entries[entryIndex]._type0._channelNum3 != channelNum)) { + VoiceStructEntryType0 &vteCur = vs->_entries[entryIndex]._type0; + if ((vteCur._sound3 != sound) || (vteCur._channelNum3 != channelNum)) { // Found match - vs->_entries[entryIndex]._type0._sound = sound; - vs->_entries[entryIndex]._type0._channelNum = channelNum; - vs->_entries[entryIndex]._type0._priority = vse._priority2; - vs->_entries[entryIndex]._type0._fieldA = 0; + vteCur._sound = sound; + vteCur._channelNum = channelNum; + vteCur._priority = vse._priority2; + vteCur._fieldA = false; vse._sound2 = NULL; break; } @@ -1171,7 +1193,7 @@ void SoundManager::sfRethinkVoiceTypes() { vseFound._sound = vse._sound2; vseFound._channelNum = vse._channelNum2; vseFound._priority = vse._priority2; - vseFound._fieldA = 0; + vseFound._fieldA = false; SoundDriver *driver = vs->_entries[foundIndex]._driver; assert(driver); @@ -1201,10 +1223,10 @@ void SoundManager::sfRethinkVoiceTypes() { } else { // Type 1 for (uint idx = 0; idx < vs->_entries.size(); ++idx) { - VoiceStructEntry &vse = vs->_entries[idx]; - vse._type1._sound = NULL; - vse._type1._channelNum = 0; - vse._type1._priority = 0; + VoiceStructEntryType1 &vte = vs->_entries[idx]._type1; + vte._sound = NULL; + vte._channelNum = 0; + vte._priority = 0; } for (uint idx = 0; idx < vs->_entries.size(); ++idx) { @@ -1722,7 +1744,7 @@ uint32 Sound::getTimeIndex() const { } int Sound::getCueValue() const { - return _cueValue; + return _cueValue == 0xff ? -1 : _cueValue; } void Sound::setCueValue(int cueValue) { @@ -2174,9 +2196,10 @@ void Sound::soPlaySound(VoiceTypeStruct *vtStruct, const byte *channelData, int SoundDriver *driver = vtStruct->_entries[entryIndex]._driver; assert(driver); - vtStruct->_entries[entryIndex]._type1._field6 = 0; - vtStruct->_entries[entryIndex]._type1._field4 = v0; - vtStruct->_entries[entryIndex]._type1._field5 = 0; + VoiceStructEntryType1 &vte = vtStruct->_entries[entryIndex]._type1; + vte._field6 = 0; + vte._field4 = v0; + vte._field5 = 0; driver->playSound(channelData, 0, _chProgram[channelNum], vtStruct->_entries[entryIndex]._voiceNum, v0, v1); } @@ -2193,9 +2216,10 @@ void Sound::soPlaySound2(VoiceTypeStruct *vtStruct, const byte *channelData, int assert(driver); byte *trackData = _channelData[trackCtr]; - vtStruct->_entries[entryIndex]._type1._field6 = 0; - vtStruct->_entries[entryIndex]._type1._field4 = v0; - vtStruct->_entries[entryIndex]._type1._field5 = 0; + VoiceStructEntryType1 &vte = vtStruct->_entries[entryIndex]._type1; + vte._field6 = 0; + vte._field4 = v0; + vte._field5 = 0; int v1, v2; driver->playSound(trackData, 14, -1, vtStruct->_entries[entryIndex]._voiceNum, v0, 0x7F); @@ -2322,9 +2346,10 @@ void Sound::soServiceTrackType1(int trackIndex, const byte *channelData) { SoundDriver *driver = vtStruct->_entries[entryIndex]._driver; assert(driver); - vtStruct->_entries[entryIndex]._type1._field6 = 0; - vtStruct->_entries[entryIndex]._type1._field4 = *(channelData + 1); - vtStruct->_entries[entryIndex]._type1._field5 = 0; + VoiceStructEntryType1 &vte = vtStruct->_entries[entryIndex]._type1; + vte._field6 = 0; + vte._field4 = *(channelData + 1); + vte._field5 = 0; int v1, v2; driver->playSound(channelData, 14, -1, vtStruct->_entries[entryIndex]._voiceNum, *(channelData + 1), 0x7f); @@ -2397,7 +2422,7 @@ int Sound::soFindSound(VoiceTypeStruct *vtStruct, int channelNum) { /*--------------------------------------------------------------------------*/ ASound::ASound(): EventHandler() { - _action = NULL; + _endAction = NULL; _cueValue = -1; if (g_globals) g_globals->_sounds.push_back(this); @@ -2424,23 +2449,23 @@ void ASound::dispatch() { _cueValue = cueValue; _sound.setCueValue(-1); - if (_action) - _action->signal(); + if (_endAction) + _endAction->signal(); } if (_cueValue != -1) { if (!_sound.isPrimed()) { _cueValue = -1; - if (_action) { - _action->signal(); - _action = NULL; + if (_endAction) { + _endAction->signal(); + _endAction = NULL; } } } } -void ASound::play(int soundNum, EventHandler *action, int volume) { - _action = action; +void ASound::play(int soundNum, EventHandler *endAction, int volume) { + _endAction = endAction; _cueValue = 0; setVol(volume); @@ -2463,9 +2488,9 @@ void ASound::unPrime() { _action = NULL; } -void ASound::fade(int fadeDest, int fadeSteps, int fadeTicks, bool stopAfterFadeFlag, EventHandler *action) { - if (action) - _action = action; +void ASound::fade(int fadeDest, int fadeSteps, int fadeTicks, bool stopAfterFadeFlag, EventHandler *endAction) { + if (endAction) + _endAction = endAction; _sound.fade(fadeDest, fadeSteps, fadeTicks, stopAfterFadeFlag); } @@ -2492,8 +2517,8 @@ void ASoundExt::signal() { } } -void ASoundExt::fadeOut2(EventHandler *action) { - fade(0, 10, 10, true, action); +void ASoundExt::fadeOut2(EventHandler *endAction) { + fade(0, 10, 10, true, endAction); } void ASoundExt::changeSound(int soundNum) { @@ -2525,6 +2550,12 @@ void PlayStream::ResFileData::load(Common::SeekableReadStream &stream) { PlayStream::PlayStream(): EventHandler() { _index = NULL; _endAction = NULL; + _audioStream = NULL; + + _resData._fileChunkSize = 0; + _resData._indexSize = 0; + _resData._chunkSize = 0; + _voiceNum = 0; } PlayStream::~PlayStream() { @@ -2540,7 +2571,7 @@ bool PlayStream::setFile(const Common::String &filename) { // Load header _resData.load(_file); - + // Load the index _index = new uint16[_resData._indexSize / 2]; for (uint i = 0; i < (_resData._indexSize / 2); ++i) @@ -2552,9 +2583,8 @@ bool PlayStream::setFile(const Common::String &filename) { bool PlayStream::play(int voiceNum, EventHandler *endAction) { uint32 offset = getFileOffset(_index, _resData._fileChunkSize, voiceNum); if (offset) { + stop(); _voiceNum = 0; - if (_sound.isPlaying()) - _sound.stop(); // Move to the offset for the start of the voice _file.seek(offset); @@ -2564,7 +2594,7 @@ bool PlayStream::play(int voiceNum, EventHandler *endAction) { _file.read(&header[0], 4); if (strncmp(header, "FEED", 4)) error("Invalid stream data"); - + // Get basic details of first sound chunk uint chunkSize = _file.readUint16LE() - 16; _file.skip(4); @@ -2572,19 +2602,23 @@ bool PlayStream::play(int voiceNum, EventHandler *endAction) { _file.skip(4); // Create the stream - Audio::QueuingAudioStream *audioStream = Audio::makeQueuingAudioStream(rate, false); + _audioStream = Audio::makeQueuingAudioStream(rate, false); // Load in the first chunk byte *data = (byte *)malloc(chunkSize); _file.read(data, chunkSize); - audioStream->queueBuffer(data, chunkSize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); - + _audioStream->queueBuffer(data, chunkSize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); + // If necessary, load further chunks of the voice in while (chunkSize == (_resData._chunkSize - 16)) { // Ensure the next chunk has the 'MORE' header _file.read(&header[0], 4); + if (!strncmp(header, "FEED", 4)) + // Reached start of next voice sample, so stop + break; if (strncmp(header, "MORE", 4)) - error("Invalid stream data"); + // Not more remaining, so break + break; // Get the size of the chunk chunkSize = _file.readUint16LE() - 16; @@ -2593,28 +2627,32 @@ bool PlayStream::play(int voiceNum, EventHandler *endAction) { // Read in the data for this next chunk and queue it data = (byte *)malloc(chunkSize); _file.read(data, chunkSize); - audioStream->queueBuffer(data, chunkSize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); + _audioStream->queueBuffer(data, chunkSize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); } - g_vm->_mixer->playStream(Audio::Mixer::kSpeechSoundType, &_soundHandle, - audioStream, DisposeAfterUse::YES); - - return true; + g_vm->_mixer->playStream(Audio::Mixer::kSpeechSoundType, &_soundHandle, + _audioStream, DisposeAfterUse::YES); + _voiceNum = voiceNum; + _endAction = endAction; + return true; } - + // If it reaches this point, no valid voice data found return false; } void PlayStream::stop() { - g_vm->_mixer->stopHandle(_soundHandle); + if (_audioStream) { + g_vm->_mixer->stopHandle(_soundHandle); + } + _audioStream = NULL; _voiceNum = 0; _endAction = NULL; } bool PlayStream::isPlaying() const { - return _voiceNum != 0 && g_vm->_mixer->isSoundHandleActive(_soundHandle); + return _audioStream != NULL && !_audioStream->endOfData(); } void PlayStream::remove() { @@ -2643,12 +2681,14 @@ void PlayStream::dispatch() { } uint32 PlayStream::getFileOffset(const uint16 *data, int count, int voiceNum) { - assert(data); + if (!data) + return 0; // no valid voice data found + int bitsIndex = voiceNum & 7; int byteIndex = voiceNum >> 3; int shiftAmount = bitsIndex * 2; int bitMask = 3 << shiftAmount; - int v = (data[byteIndex] & bitMask) >> shiftAmount; + int v = (data[byteIndex] & bitMask) >> shiftAmount; uint32 offset = 0; if (!v) @@ -2680,13 +2720,8 @@ SoundDriver::SoundDriver() { const byte adlib_group_data[] = { 1, 1, 9, 1, 0xff }; -const byte v440B0[9] = { 0, 1, 2, 6, 7, 8, 12, 13, 14 }; - -const byte v440B9[9] = { 3, 4, 5, 9, 10, 11, 15, 16, 17 }; - -const byte v440C2[18] = { - 0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21 -}; +const byte adlib_operator1_offset[] = { 0, 1, 2, 8, 9, 10, 16, 17, 18 }; +const byte adlib_operator2_offset[] = { 3, 4, 5, 11, 12, 13, 19, 20, 21 }; const byte v44134[64] = { 0, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -2710,8 +2745,6 @@ AdlibSoundDriver::AdlibSoundDriver(): SoundDriver() { _masterVolume = 0; _groupData._groupMask = 9; - _groupData._v1 = 0x46; - _groupData._v2 = 0; _groupData._pData = &adlib_group_data[0]; _mixer = g_vm->_mixer; @@ -2817,10 +2850,10 @@ void AdlibSoundDriver::playSound(const byte *channelData, int dataOffset, int pr _v4409E[channel] = dataP + offset - _patchData; // Set sustain/release - int portNum = v440C2[v440B0[channel]] + 0x80; + int portNum = adlib_operator1_offset[channel] + 0x80; write(portNum, (_portContents[portNum] & 0xF0) | 0xF); - portNum = v440C2[v440B9[channel]] + 0x80; + portNum = adlib_operator2_offset[channel] + 0x80; write(portNum, (_portContents[portNum] & 0xF0) | 0xF); if (_channelVoiced[channel]) @@ -2877,10 +2910,10 @@ void AdlibSoundDriver::updateChannelVolume(int channelNum) { int level1 = !_v44082[channelNum] ? 63 - _v44070[channelNum] : 63 - v44134[volume * _v44070[channelNum] / 63]; - int portNum = v440C2[v440B0[channelNum]] + 0x40; + int portNum = adlib_operator1_offset[channelNum] + 0x40; write(portNum, (_portContents[portNum] & 0x80) | level1); - portNum = v440C2[v440B9[channelNum]] + 0x40; + portNum = adlib_operator2_offset[channelNum] + 0x40; write(portNum, (_portContents[portNum] & 0x80) | level2); } @@ -2897,7 +2930,7 @@ void AdlibSoundDriver::clearVoice(int channel) { void AdlibSoundDriver::updateChannel(int channel) { const byte *dataP = _patchData + _v4409E[channel]; - int portOffset = v440C2[v440B0[channel]]; + int portOffset = adlib_operator1_offset[channel]; int portNum = portOffset + 0x20; int portValue = 0; @@ -2920,7 +2953,7 @@ void AdlibSoundDriver::updateChannel(int channel) { write(0x80 + portOffset, *(dataP + 14) | (*(dataP + 13) << 4)); write(0xE0 + portOffset, (_portContents[0xE0 + portOffset] & 0xFC) | *(dataP + 15)); - portOffset = v440C2[v440B9[channel]]; + portOffset = adlib_operator2_offset[channel]; portNum = portOffset + 0x20; portValue = 0; if (*(dataP + 17)) @@ -3029,8 +3062,6 @@ SoundBlasterDriver::SoundBlasterDriver(): SoundDriver() { _masterVolume = 0; _groupData._groupMask = 1; - _groupData._v1 = 0x3E; - _groupData._v2 = 0; static byte const group_data[] = { 3, 1, 1, 0, 0xff }; _groupData._pData = group_data; @@ -3078,10 +3109,12 @@ void SoundBlasterDriver::playSound(const byte *channelData, int dataOffset, int updateVoice(channel); // Set the new channel data - _channelData = channelData + dataOffset; + _channelData = channelData + dataOffset + 18; // Make a copy of the buffer int dataSize = g_vm->_memoryManager.getSize(channelData); + dataSize -= 18; + byte *soundData = (byte *)malloc(dataSize - dataOffset); Common::copy(_channelData, _channelData + (dataSize - dataOffset), soundData); diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 83cd4753d5..49558b4bca 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -63,8 +63,6 @@ public: struct GroupData { uint32 _groupMask; - byte _v1; - byte _v2; const byte *_pData; }; @@ -98,7 +96,7 @@ public: virtual const GroupData *getGroupData() { return NULL; } // Method #3 virtual void installPatch(const byte *data, int size) {} // Method #4 virtual void poll() {} // Method #5 - virtual void proc12() {} // Method #6 + virtual void method6() {} // Method #6 virtual int setMasterVolume(int volume) { return 0; } // Method #7 virtual void proc16() {} // Method #8 virtual void proc18(int al, VoiceType voiceType) {} // Method #9 @@ -120,15 +118,14 @@ struct VoiceStructEntryType0 { Sound *_sound; int _channelNum; int _priority; - int _fieldA; + bool _fieldA; Sound *_sound2; int _channelNum2; int _priority2; - int _field12; + bool _field12; Sound *_sound3; int _channelNum3; int _priority3; - int _field1A; }; struct VoiceStructEntryType1 { @@ -366,7 +363,7 @@ public: class ASound: public EventHandler { public: Sound _sound; - EventHandler *_action; + EventHandler *_endAction; int _cueValue; ASound(); @@ -374,7 +371,7 @@ public: virtual void synchronize(Serializer &s); virtual void dispatch(); - void play(int soundNum, EventHandler *action = NULL, int volume = 127); + void play(int soundNum, EventHandler *endAction = NULL, int volume = 127); void stop(); void prime(int soundNum, Action *action = NULL); void unPrime(); @@ -386,7 +383,7 @@ public: bool isMuted() const { return _sound.isMuted(); } void pause(bool flag) { _sound.pause(flag); } void mute(bool flag) { _sound.mute(flag); } - void fade(int fadeDest, int fadeSteps, int fadeTicks, bool stopAfterFadeFlag, EventHandler *action); + void fade(int fadeDest, int fadeSteps, int fadeTicks, bool stopAfterFadeFlag, EventHandler *endAction); void fadeIn() { fade(127, 5, 10, false, NULL); } void fadeOut(Action *action) { fade(0, 5, 10, true, action); } void setTimeIndex(uint32 timeIndex) { _sound.setTimeIndex(timeIndex); } @@ -407,7 +404,7 @@ public: int _soundNum; ASoundExt(); - void fadeOut2(EventHandler *action); + void fadeOut2(EventHandler *endAction); void changeSound(int soundNum); virtual Common::String getClassName() { return "ASoundExt"; } @@ -427,8 +424,8 @@ class PlayStream: public EventHandler { private: Common::File _file; ResFileData _resData; + Audio::QueuingAudioStream *_audioStream; Audio::SoundHandle _soundHandle; - Sound _sound; uint16 *_index; EventHandler *_endAction; int _voiceNum; @@ -438,7 +435,7 @@ public: PlayStream(); virtual ~PlayStream(); - bool setFile(const Common::String &filename); + bool setFile(const Common::String &filename); bool play(int voiceNum, EventHandler *endAction); void stop(); bool isPlaying() const; diff --git a/engines/tsage/staticres.cpp b/engines/tsage/staticres.cpp index 662efa19b4..311f7965c7 100644 --- a/engines/tsage/staticres.cpp +++ b/engines/tsage/staticres.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -213,6 +213,14 @@ char const *const ACCESS_CODE_REQUIRED = "access code required"; char const *const INVALID_ACCESS_CODE = "invalid access code"; char const *const FOREIGN_OBJECT_EXTRACTED = "foreign object extracted"; +// Scene 1330/7 Options dialog messages +char const *const AUTO_PLAY_ON = "Auto-Play is On"; +char const *const AUTO_PLAY_OFF = "Auto-Play is Off"; +char const *const START_NEW_CARD_GAME = "Start a new game"; +char const *const QUIT_CARD_GAME = "Quit Outpost Alpha"; +char const *const CONTINUE_CARD_GAME = "Continue Outpost Alpha"; + +// char const *const HELP_MSG = "\x1\rRETURN TO\r RINGWORLD\x14"; char const *const CHAR_TITLE = "\x01Select Character:"; char const *const CHAR_QUINN_MSG = " Quinn "; @@ -245,6 +253,8 @@ char const *const USE_INTERCEPTOR = "Do you want to use your interceptor card?"; char const *const USE_DOUBLE_AGENT = "Do you want to use your double agent?"; char const *const NEED_INSTRUCTIONS = "Do you want instructions?"; char const *const WRONG_ANSWER_MSG = "Wrong respond value sent."; +char const *const BUY_FULL_GAME_MSG = "To order the complete game, RETURN TO RINGWORLD, call 1-800-482-3766!"; + const byte scene1550JunkLocationsDefault[] = { 20, 7, 41, 6, 3, 6, 42, 11, @@ -398,8 +408,8 @@ const byte scene1550AreaMap[] = { 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14 }; -const byte k5A72E[] = {0, 98, 135, 183, 229, 81, 133, 185, 235, 75, 131, 187, 241, 70, 129, 190, 247}; -const byte k5A73F[] = {0, 42, 42, 42, 42, 67, 67, 67, 67, 92, 92, 92, 92, 116, 116, 116, 116}; +const byte scene1550JunkX[] = {0, 98, 135, 183, 229, 81, 133, 185, 235, 75, 131, 187, 241, 70, 129, 190, 247}; +const byte scene1550JunkY[] = {0, 42, 42, 42, 42, 67, 67, 67, 67, 92, 92, 92, 92, 116, 116, 116, 116}; const byte k5A750[] = { 9, 10, 7, 13, 7, 8, 9, 7, 9, 10, 2, 3, 3, 2, 2, 2, 4, 3, 3, 4, @@ -411,7 +421,7 @@ const byte k5A76D[] = { 3, 3, 3, 3, 3, 3, 3, 3, 3 }; const byte scene1550JunkRegions[] = {0, 8, 15, 16, 12, 7, 18, 17, 13, 6, 19, 20, 14, 5, 11, 10, 9}; -const byte k5A79B[] = { +const byte scene1550SpecialAreas[] = { 23, 3, 1, 23, 4, 1, 26, 3, 1, diff --git a/engines/tsage/staticres.h b/engines/tsage/staticres.h index 7d97f2824d..f6fef378ae 100644 --- a/engines/tsage/staticres.h +++ b/engines/tsage/staticres.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -165,6 +165,13 @@ extern char const *const ACCESS_CODE_REQUIRED; extern char const *const INVALID_ACCESS_CODE; extern char const *const FOREIGN_OBJECT_EXTRACTED; +// Scene 1330/7 Options dialog messages +extern char const *const AUTO_PLAY_ON; +extern char const *const AUTO_PLAY_OFF; +extern char const *const START_NEW_CARD_GAME; +extern char const *const QUIT_CARD_GAME; +extern char const *const CONTINUE_CARD_GAME; + // Dialog messages extern char const *const HELP_MSG; extern char const *const CHAR_TITLE; @@ -199,15 +206,16 @@ extern char const *const USE_DOUBLE_AGENT; extern char const *const NEED_INSTRUCTIONS; extern char const *const WRONG_ANSWER_MSG; +extern char const *const BUY_FULL_GAME_MSG; // Scene 1550 arrays of constants extern const byte scene1550JunkLocationsDefault[]; extern const byte scene1550AreaMap[]; -extern const byte k5A72E[]; -extern const byte k5A73F[]; +extern const byte scene1550JunkX[]; +extern const byte scene1550JunkY[]; extern const byte k5A750[]; extern const byte k5A76D[]; extern const byte scene1550JunkRegions[]; -extern const byte k5A79B[]; +extern const byte scene1550SpecialAreas[]; extern const byte k5A7F6[]; // Scene 2900 balloon data diff --git a/engines/tsage/tsage.cpp b/engines/tsage/tsage.cpp index 87697f950b..0b882d5cbf 100644 --- a/engines/tsage/tsage.cpp +++ b/engines/tsage/tsage.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -38,10 +38,13 @@ TSageEngine::TSageEngine(OSystem *system, const tSageGameDescription *gameDesc) _gameDescription(gameDesc) { g_vm = this; DebugMan.addDebugChannel(kRingDebugScripts, "scripts", "Scripts debugging"); - if (g_vm->getFeatures() & GF_DEMO) - _debugger = new DemoDebugger(); - else if (g_vm->getGameID() == GType_Ringworld) - _debugger = new RingworldDebugger(); + _debugger = nullptr; + if (g_vm->getGameID() == GType_Ringworld) { + if (g_vm->getFeatures() & GF_DEMO) + _debugger = new DemoDebugger(); + else + _debugger = new RingworldDebugger(); + } else if (g_vm->getGameID() == GType_BlueForce) _debugger = new BlueForceDebugger(); else if (g_vm->getGameID() == GType_Ringworld2) @@ -75,16 +78,16 @@ void TSageEngine::initialize() { // Set up the resource manager g_resourceManager = new ResourceManager(); - if (g_vm->getFeatures() & GF_DEMO) { - // Add the single library file associated with the demo - 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(); - + if (g_vm->getGameID() == GType_Ringworld) { + if (g_vm->getFeatures() & GF_DEMO) { + // Add the single library file associated with the demo + g_resourceManager->addLib(getPrimaryFilename()); + g_globals = new Globals(); + } else { + 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) { @@ -103,7 +106,7 @@ void TSageEngine::initialize() { g_globals = new Ringworld2::Ringworld2Globals(); // Setup the user interface - T2_GLOBALS._uiElements.setup(Common::Point(0, UI_INTERFACE_Y - 2)); + T2_GLOBALS._uiElements.setup(Common::Point(0, UI_INTERFACE_Y)); // Reset all global variables R2_GLOBALS.reset(); @@ -124,7 +127,7 @@ void TSageEngine::deinitialize() { } Common::Error TSageEngine::run() { - // Basic initialisation + // Basic initialization initialize(); g_globals->_sceneHandler->registerHandler(); @@ -176,8 +179,4 @@ void TSageEngine::syncSoundSettings() { g_globals->_soundManager.syncSounds(); } -bool TSageEngine::shouldQuit() { - return getEventManager()->shouldQuit() || getEventManager()->shouldRTL(); -} - } // End of namespace TsAGE diff --git a/engines/tsage/tsage.h b/engines/tsage/tsage.h index 41179c4915..ea4f5da6ea 100644 --- a/engines/tsage/tsage.h +++ b/engines/tsage/tsage.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -27,6 +27,7 @@ #include "common/rect.h" #include "audio/mixer.h" #include "common/file.h" +#include "gui/debugger.h" #include "tsage/core.h" #include "tsage/resources.h" @@ -76,12 +77,12 @@ public: MemoryManager _memoryManager; Debugger *_debugger; + GUI::Debugger *getDebugger() { return _debugger; } const char *getGameId() const; uint32 getGameID() const; uint32 getFeatures() const; Common::String getPrimaryFilename() const; - bool shouldQuit(); virtual Common::Error init(); virtual Common::Error run(); diff --git a/engines/tsage/user_interface.cpp b/engines/tsage/user_interface.cpp index 09cc2fd56d..3ee585d5ef 100644 --- a/engines/tsage/user_interface.cpp +++ b/engines/tsage/user_interface.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -38,13 +38,15 @@ void StripProxy::process(Event &event) { void UIElement::synchronize(Serializer &s) { BackgroundSceneObject::synchronize(s); - s.syncAsSint16LE(_field88); + if (s.getVersion() < 15) { + int useless = 0; + s.syncAsSint16LE(useless); + } s.syncAsSint16LE(_enabled); s.syncAsSint16LE(_frameNum); } void UIElement::setup(int visage, int stripNum, int frameNum, int posX, int posY, int priority) { - _field88 = 0; _frameNum = frameNum; _enabled = true; @@ -87,7 +89,7 @@ void UIQuestion::showDescription(CursorType cursor) { Ringworld2::SceneExt *scene = static_cast<Ringworld2::SceneExt *> (R2_GLOBALS._sceneManager._scene); if (!scene->_sceneAreas.contains(R2_GLOBALS._scannerDialog)) - R2_GLOBALS._scannerDialog->proc12(4, 1, 1, 160, 125); + R2_GLOBALS._scannerDialog->setup2(4, 1, 1, 160, 125); } else { // Show object description SceneItem::display2(3, (int)cursor); @@ -276,11 +278,30 @@ void UICollection::draw() { Rect(0, UI_INTERFACE_Y, SCREEN_WIDTH, SCREEN_HEIGHT), Rect(0, UI_INTERFACE_Y, SCREEN_WIDTH, SCREEN_HEIGHT)); + if (g_vm->getGameID() == GType_Ringworld2) + r2rDrawFrame(); + _clearScreen = 1; g_globals->_sceneManager._scene->_sceneBounds = savedBounds; } } +void UICollection::r2rDrawFrame() { + Visage visage; + visage.setVisage(2, 1); + GfxSurface vertLineLeft = visage.getFrame(1); + GfxSurface vertLineRight = visage.getFrame(3); + GfxSurface horizLine = visage.getFrame(2); + + GLOBALS._screenSurface.copyFrom(horizLine, 0, 0); + GLOBALS._screenSurface.copyFrom(vertLineLeft, 0, 3); + GLOBALS._screenSurface.copyFrom(vertLineRight, SCREEN_WIDTH - 4, 3); + + // Restrict drawing area to exclude the borders at the edge of the screen + R2_GLOBALS._screenSurface._clipRect = Rect(4, 3, SCREEN_WIDTH - 4, + SCREEN_HEIGHT - 3); +} + /*--------------------------------------------------------------------------*/ UIElements::UIElements(): UICollection() { @@ -289,6 +310,10 @@ UIElements::UIElements(): UICollection() { else _cursorVisage.setVisage(1, 5); g_saver->addLoadNotifier(&UIElements::loadNotifierProc); + + _slotStart = 0; + _scoreValue = 0; + _active = false; } void UIElements::synchronize(Serializer &s) { diff --git a/engines/tsage/user_interface.h b/engines/tsage/user_interface.h index d06dccd9a4..7cde2900f8 100644 --- a/engines/tsage/user_interface.h +++ b/engines/tsage/user_interface.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -37,7 +37,6 @@ public: class UIElement: public BackgroundSceneObject { public: - int _field88; bool _enabled; int _frameNum; @@ -95,6 +94,8 @@ public: }; class UICollection: public EventHandler { +private: + void r2rDrawFrame(); protected: void erase(); public: |