diff options
author | Paul Gilbert | 2011-04-09 19:12:54 +1000 |
---|---|---|
committer | Paul Gilbert | 2011-04-09 19:12:54 +1000 |
commit | f5d22217d66e568b92230b8c8d799ab3dedc05e8 (patch) | |
tree | e9691219288a821138ef6772594e1f3348e9d0d9 | |
parent | ee32440cdee393ca313061ea0c24faec3e473b7e (diff) | |
parent | 48542fb364e3fd27d1557b8eb1a86ff330f6a0cb (diff) | |
download | scummvm-rg350-f5d22217d66e568b92230b8c8d799ab3dedc05e8.tar.gz scummvm-rg350-f5d22217d66e568b92230b8c8d799ab3dedc05e8.tar.bz2 scummvm-rg350-f5d22217d66e568b92230b8c8d799ab3dedc05e8.zip |
Merge remote branch 'remotes/Strangerke/master' into tsage
-rw-r--r-- | engines/tsage/core.cpp | 20 | ||||
-rw-r--r-- | engines/tsage/core.h | 44 | ||||
-rw-r--r-- | engines/tsage/ringworld_scenes10.cpp | 300 | ||||
-rw-r--r-- | engines/tsage/ringworld_scenes10.h | 254 | ||||
-rw-r--r-- | engines/tsage/ringworld_scenes5.cpp | 41 | ||||
-rw-r--r-- | engines/tsage/ringworld_scenes5.h | 18 | ||||
-rw-r--r-- | engines/tsage/ringworld_scenes8.cpp | 133 | ||||
-rw-r--r-- | engines/tsage/ringworld_scenes8.h | 26 |
8 files changed, 398 insertions, 438 deletions
diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index d3ca30e012..4ce7513e12 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -1568,22 +1568,22 @@ void SceneHotspot::doAction(int action) { /*--------------------------------------------------------------------------*/ -void SceneHotspot_3::doAction(int action) { +void NamedHotspot::doAction(int action) { switch (action) { case CURSOR_WALK: // Nothing break; case CURSOR_LOOK: - if (_field28 == -1) + if (_lookLineNum == -1) SceneHotspot::doAction(action); else - SceneItem::display(_field26, _field28, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + SceneItem::display(_resnum, _lookLineNum, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); break; case CURSOR_USE: - if (_field2A == -1) + if (_useLineNum == -1) SceneHotspot::doAction(action); else - SceneItem::display(_field26, _field2A, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + SceneItem::display(_resnum, _useLineNum, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); break; default: SceneHotspot::doAction(action); @@ -1591,11 +1591,11 @@ void SceneHotspot_3::doAction(int action) { } } -void SceneHotspot_3::quickInit(const int ys, const int xe, const int ye, const int xs, const int val26, const int val28, const int val2A) { +void NamedHotspot::setup(const int ys, const int xe, const int ye, const int xs, const int resnum, const int lookLineNum, const int useLineNum) { setBounds(ys, xe, ye, xs); - _field26 = val26; - _field28 = val28; - _field2A = val2A; + _resnum = resnum; + _lookLineNum = lookLineNum; + _useLineNum = useLineNum; _globals->_sceneItems.addItems(this, NULL); } @@ -2241,7 +2241,7 @@ void SceneObject::updateScreen() { } } -void SceneObject::quickInit(int visage, int stripFrameNum, int frameNum, int posX, int posY, int priority) { +void SceneObject::setup(int visage, int stripFrameNum, int frameNum, int posX, int posY, int priority) { postInit(); setVisage(visage); setStrip(stripFrameNum); diff --git a/engines/tsage/core.h b/engines/tsage/core.h index e05ba6c066..be3dde15fc 100644 --- a/engines/tsage/core.h +++ b/engines/tsage/core.h @@ -439,22 +439,14 @@ public: virtual void doAction(int action); }; -class SceneHotspot_2: public SceneHotspot { +class NamedHotspot: public SceneHotspot { public: - int _field26, _field28; - SceneHotspot_2(): SceneHotspot() {} + int _resnum, _lookLineNum, _useLineNum; + NamedHotspot(): SceneHotspot() {} - virtual Common::String getClassName() { return "SceneHotspot_2"; } -}; - -class SceneHotspot_3: public SceneHotspot_2 { -public: - int _field2A; - SceneHotspot_3(): SceneHotspot_2() {} - - void quickInit(const int ys, const int xe, const int ye, const int xs, const int val26, const int val28, const int val2A); + void setup(const int ys, const int xe, const int ye, const int xs, const int resnum, const int lookLineNum, const int useLineNum); virtual void doAction(int action); - virtual Common::String getClassName() { return "SceneHotspot_3"; } + virtual Common::String getClassName() { return "NamedHotspot"; } }; enum AnimateMode {ANIM_MODE_NONE = 0, ANIM_MODE_1 = 1, ANIM_MODE_2 = 2, ANIM_MODE_3 = 3, @@ -577,7 +569,7 @@ public: virtual void draw(); virtual void proc19() {} virtual void updateScreen(); - void quickInit(int visage, int stripFrameNum, int frameNum, int posX, int posY, int priority); + void setup(int visage, int stripFrameNum, int frameNum, int posX, int posY, int priority); }; class SceneObjectExt: public SceneObject { @@ -591,30 +583,6 @@ public: virtual Common::String getClassName() { return "SceneObjectExt"; } }; -class SceneObject3: public SceneObjectExt { -public: - int _field88, _field8A; - - virtual void synchronise(Serialiser &s) { - SceneObject::synchronise(s); - s.syncAsSint16LE(_field88); - s.syncAsSint16LE(_field8A); - } - virtual Common::String getClassName() { return "SceneObject3"; } -}; - -class SceneObject4: public SceneObject { -public: - int _field88, _field8A; - - virtual void synchronise(Serialiser &s) { - SceneObject::synchronise(s); - s.syncAsSint16LE(_field88); - s.syncAsSint16LE(_field8A); - } - virtual Common::String getClassName() { return "SceneObject4"; } -}; - class SceneText: public SceneObject { public: int _fontNumber; diff --git a/engines/tsage/ringworld_scenes10.cpp b/engines/tsage/ringworld_scenes10.cpp index 9bfa2e017c..ed9ddedf31 100644 --- a/engines/tsage/ringworld_scenes10.cpp +++ b/engines/tsage/ringworld_scenes10.cpp @@ -36,6 +36,8 @@ Scene2::Scene2() { _sceneState = 0; } +/*--------------------------------------------------------------------------*/ + void Object9350::postInit(SceneObjectList *OwnerList) { _globals->_sceneManager.postInit(&_globals->_sceneManager._altSceneObjects); } @@ -67,7 +69,7 @@ void Scene9100::SceneHotspot1::doAction(int action) { } scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &_globals->_player, &scene->_object5, &scene->_object6, 0); } else { - SceneHotspot_3::doAction(action); + NamedHotspot::doAction(action); } } @@ -146,13 +148,13 @@ void Scene9100::postInit(SceneObjectList *OwnerList) { _object6.setStrip(6); _object6.setFrame(1); _object6.setPosition(Common::Point(138, 166), 0); - _sceneHotspot3.quickInit(145, 125, 166, 156, 9100, 40, 43); + _sceneHotspot3.setup(145, 125, 166, 156, 9100, 40, 43); } - _sceneHotspot1.quickInit(140, 176, 185, 215, 9100, 36, 37); - _sceneHotspot2.quickInit(161, 138, 182, 175, 9100, 38, 39); - _sceneHotspot4.quickInit(37, 196, 47, 320, 9100, 44, -1); - _sceneHotspot5.quickInit(69, 36, 121, 272, 9100, 45, 46); - _sceneHotspot6.quickInit(127, 0, 200, 52, 9100, 47, 48); + _sceneHotspot1.setup(140, 176, 185, 215, 9100, 36, 37); + _sceneHotspot2.setup(161, 138, 182, 175, 9100, 38, 39); + _sceneHotspot4.setup(37, 196, 47, 320, 9100, 44, -1); + _sceneHotspot5.setup(69, 36, 121, 272, 9100, 45, 46); + _sceneHotspot6.setup(127, 0, 200, 52, 9100, 47, 48); _globals->_soundHandler.startSound(251, 0, 127); if (_globals->_sceneManager._previousScene == 9150) { @@ -181,20 +183,20 @@ void Scene9100::postInit(SceneObjectList *OwnerList) { * *--------------------------------------------------------------------------*/ void Scene9150::Object3::signal() { - switch (_field8A++) { + switch (_signalFlag++) { case 0: - _field88 = 10 + _globals->_randomSource.getRandomNumber(90); + _timer = 10 + _globals->_randomSource.getRandomNumber(90); break; default: animate(ANIM_MODE_5, this); - _field88 = 0; + _signalFlag = 0; break; } } void Scene9150::Object3::dispatch() { SceneObject::dispatch(); - if ((_field88 != 0) && (--_field88 == 0)) + if ((_timer != 0) && (--_timer == 0)) signal(); } @@ -221,7 +223,7 @@ void Scene9150::signal() { void Scene9150::dispatch() { if ((_sceneState != 0) && (_sceneBounds.left == 0)) { - _object3._field88 = 0; + _object3._timer = 0; _sceneState = 0; _sceneHotspot3.setAction(&_sequenceManager2, 0, 9154, &_object3, 0); _sceneHotspot10.remove(); @@ -262,16 +264,16 @@ void Scene9150::postInit(SceneObjectList *OwnerList) { _object3.setPosition(Common::Point(312, 95), 0); _object3.signal(); - _sceneHotspot1.quickInit(0, 0, 200, 94, 9150, 46, -1); - _sceneHotspot2.quickInit(51, 90, 118, 230, 9150, 47, -1); - _sceneHotspot3.quickInit(182, 104, 200, 320, 9150, 48, 49); - _sceneHotspot4.quickInit(103, 292, 152, 314, 9150, 50, 51); - _sceneHotspot5.quickInit(115, 350, 160, 374, 9150, 52, 53); - _sceneHotspot6.quickInit(0, 471, 200, 531, 9150, 54, 55); - _sceneHotspot7.quickInit(170, 320, 185, 640, 9150, 56, -1); - _sceneHotspot9.quickInit(157, 107, 186, 320, 9150, 56, -1); - _sceneHotspot8.quickInit(133, 584, 142, 640, 9150, 57, -1); - _sceneHotspot10.quickInit(83, 304, 103, 323, 9150, 58, 59); + _sceneHotspot1.setup(0, 0, 200, 94, 9150, 46, -1); + _sceneHotspot2.setup(51, 90, 118, 230, 9150, 47, -1); + _sceneHotspot3.setup(182, 104, 200, 320, 9150, 48, 49); + _sceneHotspot4.setup(103, 292, 152, 314, 9150, 50, 51); + _sceneHotspot5.setup(115, 350, 160, 374, 9150, 52, 53); + _sceneHotspot6.setup(0, 471, 200, 531, 9150, 54, 55); + _sceneHotspot7.setup(170, 320, 185, 640, 9150, 56, -1); + _sceneHotspot9.setup(157, 107, 186, 320, 9150, 56, -1); + _sceneHotspot8.setup(133, 584, 142, 640, 9150, 57, -1); + _sceneHotspot10.setup(83, 304, 103, 323, 9150, 58, 59); _globals->_soundHandler.startSound(285, 0, 127); _globals->_player.disableControl(); @@ -318,7 +320,7 @@ void Scene9200::SceneHotspot1::doAction(int action) { scene->_sceneState = 9214; setAction(&scene->_sequenceManager, scene, 9214, &_globals->_player, &scene->_object2, 0); } else { - SceneHotspot_3::doAction(action); + NamedHotspot::doAction(action); } } @@ -412,15 +414,15 @@ void Scene9200::postInit(SceneObjectList *OwnerList) { if (!_globals->getFlag(86)) { _object2.postInit(); - _hotspot1.quickInit(96, 194, 160, 234, 9200, 29, 31); + _hotspot1.setup(96, 194, 160, 234, 9200, 29, 31); } - _hotspot2.quickInit(164, 0, 200, 282, 9200, 0, 1); - _hotspot3.quickInit(140, 39, 165, 153, 9200, 2, 3); - _hotspot4.quickInit(92, 122, 139, 152, 9200, 4, 5); - _hotspot5.quickInit(33, 20, 142, 115, 9200, 6, 7); - _hotspot6.quickInit(104, 235, 153, 265, 9200, 8, 9); - _hotspot7.quickInit(107, 262, 153, 286, 9200, 10, 11); - _hotspot8.quickInit(69, 276, 164, 320, 9200, 12, 13); + _hotspot2.setup(164, 0, 200, 282, 9200, 0, 1); + _hotspot3.setup(140, 39, 165, 153, 9200, 2, 3); + _hotspot4.setup(92, 122, 139, 152, 9200, 4, 5); + _hotspot5.setup(33, 20, 142, 115, 9200, 6, 7); + _hotspot6.setup(104, 235, 153, 265, 9200, 8, 9); + _hotspot7.setup(107, 262, 153, 286, 9200, 10, 11); + _hotspot8.setup(69, 276, 164, 320, 9200, 12, 13); _globals->_events.setCursor(CURSOR_WALK); _globals->_player.disableControl(); @@ -510,19 +512,19 @@ void Scene9300::postInit(SceneObjectList *OwnerList) { _object2.postInit(); _globals->_soundHandler.startSound(289, 0, 127); - _hotspot1.quickInit(35, 142, 76, 212, 9300, 0, 1); - _hotspot2.quickInit(28, 90, 81, 143, 9300, 2, 3); - _hotspot3.quickInit(78, 142, 146, 216, 9300, 4, 5); - _hotspot4.quickInit(3, 43, 91, 74, 9300, 6, 7); - _hotspot5.quickInit(82, 19, 157, 65, 9300, 8, 9); - _hotspot6.quickInit(5, 218, 84, 274, 9300, 10, 11); - _hotspot7.quickInit(86, 233, 168, 293, 9300, 12, 13); - _hotspot8.quickInit(157, 0, 200, 230, 9300, 14, 15); - _hotspot9.quickInit(169, 227, 200, 320, 9300, 16, 17); - _hotspot10.quickInit(145, 97, 166, 225, 9300, 18, 19); - _hotspot11.quickInit(81, 75, 145, 145, 9300, 20, 21); - _hotspot12.quickInit(0, 0, 94, 35, 9300, 22, 23); - _hotspot13.quickInit(12, 268, 149, 320, 9300, 24, 25); + _hotspot1.setup(35, 142, 76, 212, 9300, 0, 1); + _hotspot2.setup(28, 90, 81, 143, 9300, 2, 3); + _hotspot3.setup(78, 142, 146, 216, 9300, 4, 5); + _hotspot4.setup(3, 43, 91, 74, 9300, 6, 7); + _hotspot5.setup(82, 19, 157, 65, 9300, 8, 9); + _hotspot6.setup(5, 218, 84, 274, 9300, 10, 11); + _hotspot7.setup(86, 233, 168, 293, 9300, 12, 13); + _hotspot8.setup(157, 0, 200, 230, 9300, 14, 15); + _hotspot9.setup(169, 227, 200, 320, 9300, 16, 17); + _hotspot10.setup(145, 97, 166, 225, 9300, 18, 19); + _hotspot11.setup(81, 75, 145, 145, 9300, 20, 21); + _hotspot12.setup(0, 0, 94, 35, 9300, 22, 23); + _hotspot13.setup(12, 268, 149, 320, 9300, 24, 25); if (_globals->_sceneManager._previousScene == 9350) { _globals->_player.disableControl(); @@ -588,12 +590,12 @@ void Scene9350::postInit(SceneObjectList *OwnerList) { setZoomPercents(95, 80, 200, 100); _globals->_player.postInit(); - _object1.quickInit(9350, 1, 3, 139, 97, 0); - _sceneHotspot1.quickInit(42, 0, 97, 60, 9350, 0, -1); - _sceneHotspot2.quickInit(37, 205, 82, 256, 9350, 0, -1); - _sceneHotspot3.quickInit(29, 93, 92, 174, 9350, 1, -1); - _sceneHotspot4.quickInit(0, 308, 109, 320, 9350, 2, -1); - _sceneHotspot5.quickInit(0, 0, 200, 320, 9350, 3, -1); + _object1.setup(9350, 1, 3, 139, 97, 0); + _sceneHotspot1.setup(42, 0, 97, 60, 9350, 0, -1); + _sceneHotspot2.setup(37, 205, 82, 256, 9350, 0, -1); + _sceneHotspot3.setup(29, 93, 92, 174, 9350, 1, -1); + _sceneHotspot4.setup(0, 308, 109, 320, 9350, 2, -1); + _sceneHotspot5.setup(0, 0, 200, 320, 9350, 3, -1); _globals->_events.setCursor(CURSOR_WALK); _globals->_player.disableControl(); @@ -673,14 +675,14 @@ void Scene9360::postInit(SceneObjectList *OwnerList) { setZoomPercents(95, 80, 200, 100); _globals->_player.postInit(); - _hotspot1.quickInit(37, 92, 93, 173, 9360, 0, 1); - _hotspot2.quickInit(42, 0, 100, 63, 9360, 2, -1); - _hotspot3.quickInit(36, 205, 82, 260, 9360, 3, -1); - _hotspot4.quickInit(103, 2, 200, 320, 9360, 4, -1); - _hotspot5.quickInit(0, 0, 37, 320, 9360, 4, -1); - _hotspot6.quickInit(35, 61, 103, 92, 9360, 4, -1); - _hotspot7.quickInit(33, 174, 93, 207, 9360, 4, -1); - _hotspot8.quickInit(28, 257, 149, 320, 9360, 4, -1); + _hotspot1.setup(37, 92, 93, 173, 9360, 0, 1); + _hotspot2.setup(42, 0, 100, 63, 9360, 2, -1); + _hotspot3.setup(36, 205, 82, 260, 9360, 3, -1); + _hotspot4.setup(103, 2, 200, 320, 9360, 4, -1); + _hotspot5.setup(0, 0, 37, 320, 9360, 4, -1); + _hotspot6.setup(35, 61, 103, 92, 9360, 4, -1); + _hotspot7.setup(33, 174, 93, 207, 9360, 4, -1); + _hotspot8.setup(28, 257, 149, 320, 9360, 4, -1); _globals->_events.setCursor(CURSOR_WALK); _globals->_player.disableControl(); if (_globals->_sceneManager._previousScene == 9350) { @@ -696,7 +698,7 @@ void Scene9360::postInit(SceneObjectList *OwnerList) { _sceneState = 9362; setAction(&_sequenceManager, this, 9362, &_globals->_player, 0); } - _object1.quickInit(9351, 1, 1, 131, 90, 0); + _object1.setup(9351, 1, 1, 131, 90, 0); } /*-------------------------------------------------------------------------- @@ -714,7 +716,7 @@ void Scene9400::SceneHotspot7::doAction(int action) { scene->_sceneState = 1; scene->setAction(&scene->_sequenceManager, scene, 9408, &_globals->_player, 0); } else { - SceneHotspot_3::doAction(action); + NamedHotspot::doAction(action); } } @@ -726,7 +728,7 @@ void Scene9400::SceneHotspot8::doAction(int action) { scene->_sceneState = 2; scene->signal(); } else { - SceneHotspot_3::doAction(action); + NamedHotspot::doAction(action); } } @@ -791,14 +793,14 @@ void Scene9400::postInit(SceneObjectList *OwnerList) { _object3.postInit(0); _speakerQText._textPos.x = 20; - _hotspot7.quickInit(157, 66, 180, 110, 9400, 21, 23); - _hotspot5.quickInit(130, 133, 152, 198, 9400, 22, -1); - _hotspot1.quickInit(33, 280, 69, 297, 9400, 1, 2); - _hotspot2.quickInit(73, 96, 87, 159, 9400, 3, 4); - _hotspot3.quickInit(89, 253, 111, 305, 9400, 5, 6); - _hotspot4.quickInit(46, 0, 116, 35, 9400, 7, 8); - _hotspot8.quickInit(58, 169, 122, 200, 9400, 9, 10); - _hotspot6.quickInit(0, 0, 199, 319, 9400, 16, 0); + _hotspot7.setup(157, 66, 180, 110, 9400, 21, 23); + _hotspot5.setup(130, 133, 152, 198, 9400, 22, -1); + _hotspot1.setup(33, 280, 69, 297, 9400, 1, 2); + _hotspot2.setup(73, 96, 87, 159, 9400, 3, 4); + _hotspot3.setup(89, 253, 111, 305, 9400, 5, 6); + _hotspot4.setup(46, 0, 116, 35, 9400, 7, 8); + _hotspot8.setup(58, 169, 122, 200, 9400, 9, 10); + _hotspot6.setup(0, 0, 199, 319, 9400, 16, 0); _stripManager.addSpeaker(&_speakerQText); _stripManager.addSpeaker(&_speakerOR); @@ -842,7 +844,7 @@ void Scene9450::Hotspot1::doAction(int action) { _globals->_player.disableControl(); setAction(&scene->_sequenceManager1, scene, 9459, &scene->_object2, &scene->_object1, &scene->_object3, &_globals->_player, 0); } else { - SceneHotspot_3::doAction(action); + NamedHotspot::doAction(action); } } @@ -977,23 +979,23 @@ void Scene9450::postInit(SceneObjectList *OwnerList) { } if (_globals->_inventory._tunic._sceneNumber != 1) - _hotspot1.quickInit(123, 139, 138, 170, 9450, 37, -1); - - _hotspot2.quickInit(153, 102, 176, 141, 9450, 39, 40); - _hotspot3.quickInit(97, 198, 130, 229, 9450, 41, 42); - _hotspot15.quickInit(131, 190, 145, 212, 9450, 43, 44); - _hotspot4.quickInit(33, 144, 105, 192, 9450, 0, 1); - _hotspot5.quickInit(20, 236, 106, 287, 9450, 2, 3); - _hotspot6.quickInit(137, 119, 195, 320, 9450, 4, 5); - _hotspot7.quickInit(20, 59, 99, 111, 9450, 6, -1); - _hotspot8.quickInit(110, 0, 199, 117, 9450, 7, 8); - _hotspot9.quickInit(101, 104, 130, 174, 9450, 9, 10); - _hotspot10.quickInit(110, 246, 149, 319, 9450, 11, 12); - _hotspot11.quickInit(16, 34, 74, 62, 6450, 13, 14); - _hotspot12.quickInit(19, 108, 72, 134, 9450, 15, 16); - _hotspot13.quickInit(18, 215, 71, 237, 9450, 17, 18); - _hotspot14.quickInit(15, 288, 76, 314, 9450, 19, 20); - _hotspot16.quickInit(0, 0, 200, 320, 9450, 46, -1); + _hotspot1.setup(123, 139, 138, 170, 9450, 37, -1); + + _hotspot2.setup(153, 102, 176, 141, 9450, 39, 40); + _hotspot3.setup(97, 198, 130, 229, 9450, 41, 42); + _hotspot15.setup(131, 190, 145, 212, 9450, 43, 44); + _hotspot4.setup(33, 144, 105, 192, 9450, 0, 1); + _hotspot5.setup(20, 236, 106, 287, 9450, 2, 3); + _hotspot6.setup(137, 119, 195, 320, 9450, 4, 5); + _hotspot7.setup(20, 59, 99, 111, 9450, 6, -1); + _hotspot8.setup(110, 0, 199, 117, 9450, 7, 8); + _hotspot9.setup(101, 104, 130, 174, 9450, 9, 10); + _hotspot10.setup(110, 246, 149, 319, 9450, 11, 12); + _hotspot11.setup(16, 34, 74, 62, 6450, 13, 14); + _hotspot12.setup(19, 108, 72, 134, 9450, 15, 16); + _hotspot13.setup(18, 215, 71, 237, 9450, 17, 18); + _hotspot14.setup(15, 288, 76, 314, 9450, 19, 20); + _hotspot16.setup(0, 0, 200, 320, 9450, 46, -1); } /*-------------------------------------------------------------------------- @@ -1009,10 +1011,10 @@ void Scene9500::Hotspot1::doAction(int action) { _globals->_inventory._sword._sceneNumber = 9500; _globals->_player.disableControl(); _globals->_sceneItems.remove(this); - scene->_hotspot2.quickInit(87, 294, 104, 314, 9400, 17, -1); + scene->_hotspot2.setup(87, 294, 104, 314, 9400, 17, -1); scene->setAction(&scene->_sequenceManager, scene, 9510, &_globals->_player, &scene->_object2, 0); } else { - SceneHotspot_3::doAction(action); + NamedHotspot::doAction(action); } } @@ -1025,7 +1027,7 @@ void Scene9500::Hotspot2::doAction(int action) { _globals->_sceneItems.remove(this); scene->setAction(&scene->_sequenceManager, scene, 9511, &_globals->_player, &scene->_object2, 0); } else { - SceneHotspot_3::doAction(action); + NamedHotspot::doAction(action); } } @@ -1038,7 +1040,7 @@ void Scene9500::Hotspot3::doAction(int action) { _globals->_sceneItems.remove(this); scene->setAction(&scene->_sequenceManager, scene, 9505, &_globals->_player, &scene->_candle, 0); } else { - SceneHotspot_3::doAction(action); + NamedHotspot::doAction(action); } } @@ -1063,7 +1065,7 @@ void Scene9500::Hotspot4::doAction(int action) { _globals->_inventory._straw._sceneNumber = 9500; scene->setAction(&scene->_sequenceManager, scene, 9512, &_globals->_player, &scene->_object3, 0); } else { - SceneHotspot_3::doAction(action); + NamedHotspot::doAction(action); } } @@ -1165,37 +1167,37 @@ void Scene9500::postInit(SceneObjectList *OwnerList) { _object2.setPosition(Common::Point(303, 130)); _object2.setPriority2(132); if (_globals->_inventory._helmet._sceneNumber == 1) { - _hotspot2.quickInit(87, 294, 104, 314, 9400, 17, -1); + _hotspot2.setup(87, 294, 104, 314, 9400, 17, -1); } else { _object2.setStrip(2); _object2.setFrame(1); } } else { - _hotspot1.quickInit(105, 295, 134, 313, 9500, 9, 10); + _hotspot1.setup(105, 295, 134, 313, 9500, 9, 10); } - _hotspot17.quickInit(101, 293, 135, 315, 9500, 9, 10); - _hotspot3.quickInit(84, 12, 107, 47, 9500, 15, 15); - _hotspot6.quickInit(93, 11, 167, 46, 9500, 0, 1); - _hotspot7.quickInit(100, 70, 125, 139, 9500, 2, 3); + _hotspot17.setup(101, 293, 135, 315, 9500, 9, 10); + _hotspot3.setup(84, 12, 107, 47, 9500, 15, 15); + _hotspot6.setup(93, 11, 167, 46, 9500, 0, 1); + _hotspot7.setup(100, 70, 125, 139, 9500, 2, 3); if (!_globals->getFlag(85)) { - _hotspot5.quickInit(111, 68, 155, 244, 9500, 17, -1); - _hotspot4.quickInit(57, 71, 120, 126, 9500, 16, -1); + _hotspot5.setup(111, 68, 155, 244, 9500, 17, -1); + _hotspot4.setup(57, 71, 120, 126, 9500, 16, -1); } - _hotspot8.quickInit(60, 24, 90, 53, 9500, 4, 5); - _hotspot9.quickInit(72, 143, 93, 163, 9500, 4, 5); - _hotspot10.quickInit(70, 205, 92, 228, 9500, 4, 5); - _hotspot11.quickInit(66, 291, 90, 317, 9500, 4, 5); - _hotspot12.quickInit(22, 58, 101, 145, 9500, 6, 7); - _hotspot13.quickInit(121, 57, 163, 249, 9500, 6, 7); - _hotspot14.quickInit(115, 133, 135, 252, 9500, 6, 7); - _hotspot15.quickInit(55, 240, 125, 254, 9500, 6, 7); - _hotspot16.quickInit(53, 251, 132, 288, 9500, 8, -1); - _hotspot19.quickInit(101, 207, 120, 225, 9500, 9, 10); - _hotspot18.quickInit(98, 144, 117, 162, 9500, 9, 10); - _hotspot20.quickInit(102, 27, 132, 50, 9500, 9, 10); + _hotspot8.setup(60, 24, 90, 53, 9500, 4, 5); + _hotspot9.setup(72, 143, 93, 163, 9500, 4, 5); + _hotspot10.setup(70, 205, 92, 228, 9500, 4, 5); + _hotspot11.setup(66, 291, 90, 317, 9500, 4, 5); + _hotspot12.setup(22, 58, 101, 145, 9500, 6, 7); + _hotspot13.setup(121, 57, 163, 249, 9500, 6, 7); + _hotspot14.setup(115, 133, 135, 252, 9500, 6, 7); + _hotspot15.setup(55, 240, 125, 254, 9500, 6, 7); + _hotspot16.setup(53, 251, 132, 288, 9500, 8, -1); + _hotspot19.setup(101, 207, 120, 225, 9500, 9, 10); + _hotspot18.setup(98, 144, 117, 162, 9500, 9, 10); + _hotspot20.setup(102, 27, 132, 50, 9500, 9, 10); _globals->_events.setCursor(CURSOR_WALK); _globals->_player.disableControl(); @@ -1206,7 +1208,7 @@ void Scene9500::postInit(SceneObjectList *OwnerList) { setAction(&_sequenceManager, this, 9501, &_globals->_player, &_candle, 0); } else { _globals->_inventory._helmet._sceneNumber = 9500; - _hotspot2.quickInit(87, 294, 104, 314, 9400, 17, -1); + _hotspot2.setup(87, 294, 104, 314, 9400, 17, -1); setAction(&_sequenceManager, this, 9513, &_globals->_player, &_object2, 0); } } else { @@ -1264,12 +1266,12 @@ void Scene9700::postInit(SceneObjectList *OwnerList) { Scene::postInit(); setZoomPercents(0, 100, 200, 100); - _sceneHotspot1.quickInit(84, 218, 151, 278, 9700, 14, -1); - _sceneHotspot2.quickInit(89, 11, 151, 121, 9700, 14, -1); - _sceneHotspot3.quickInit(69, 119, 138, 218, 9700, 15, 16); - _sceneHotspot4.quickInit(34, 13, 88, 116, 9700, 17, -1); - _sceneHotspot5.quickInit(52, 119, 68, 204, 9700, 17, -1); - _sceneHotspot6.quickInit(0, 22, 56, 275, 9700, 18, -1); + _sceneHotspot1.setup(84, 218, 151, 278, 9700, 14, -1); + _sceneHotspot2.setup(89, 11, 151, 121, 9700, 14, -1); + _sceneHotspot3.setup(69, 119, 138, 218, 9700, 15, 16); + _sceneHotspot4.setup(34, 13, 88, 116, 9700, 17, -1); + _sceneHotspot5.setup(52, 119, 68, 204, 9700, 17, -1); + _sceneHotspot6.setup(0, 22, 56, 275, 9700, 18, -1); _object1.postInit(); _object1.hide(); @@ -1368,7 +1370,7 @@ void Scene9850::Hotspot12::doAction(int action) { setAction(&scene->_sequenceManager, scene, 9861, &_globals->_player, &scene->_objTunic2, 0); } } else if ((action != CURSOR_LOOK) || (_globals->_inventory._tunic2._sceneNumber != 1)) { - SceneHotspot_3::doAction(action); + NamedHotspot::doAction(action); } else { SceneItem::display(9850, 30, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); } @@ -1390,7 +1392,7 @@ void Scene9850::Hotspot14::doAction(int action) { setAction(&scene->_sequenceManager, scene, 9860, &_globals->_player, &scene->_objJacket, 0); } } else if ((action != CURSOR_LOOK) || (_globals->_inventory._jacket._sceneNumber != 1)) { - SceneHotspot_3::doAction(action); + NamedHotspot::doAction(action); } else { SceneItem::display(9850, 30, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); } @@ -1412,7 +1414,7 @@ void Scene9850::Hotspot16::doAction(int action) { setAction(&scene->_sequenceManager, scene, 9859, &_globals->_player, &scene->_objCloak, 0); } } else if ((action != CURSOR_LOOK) || (_globals->_inventory._cloak._sceneNumber != 1)) { - SceneHotspot_3::doAction(action); + NamedHotspot::doAction(action); } else { SceneItem::display(9850, 30, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); } @@ -1426,7 +1428,7 @@ void Scene9850::Hotspot17::doAction(int action) { } else { if (action == CURSOR_USE) scene->_soundHandler.startSound(306, 0, 127); - SceneHotspot_3::doAction(action); + NamedHotspot::doAction(action); } } @@ -1438,7 +1440,7 @@ void Scene9850::Hotspot18::doAction(int action) { } else { if (action == CURSOR_USE) scene->_soundHandler.startSound(306, 0, 127); - SceneHotspot_3::doAction(action); + NamedHotspot::doAction(action); } } @@ -1450,7 +1452,7 @@ void Scene9850::Hotspot19::doAction(int action) { } else { if (action == CURSOR_USE) scene->_soundHandler.startSound(313, 0, 127); - SceneHotspot_3::doAction(action); + NamedHotspot::doAction(action); } } @@ -1473,7 +1475,7 @@ void Scene9850::Hotspot20::doAction(int action) { } scene->_objSword._state ^= 1; } else { - SceneHotspot_3::doAction(action); + NamedHotspot::doAction(action); } } @@ -1488,15 +1490,15 @@ void Scene9850::signal() { _objSword.hide(); _globals->_sceneItems.remove(&_objScimitar); _globals->_sceneItems.remove(&_objSword); - _globals->_sceneItems.addItems(&_hotspot19); + _globals->_sceneItems.addItems(&_hotspot19, NULL); _globals->_player.enableControl(); break; case 11: // Hidden closet opened if (_globals->_inventory._scimitar._sceneNumber == 9850) - _globals->_sceneItems.addItems(&_objScimitar); + _globals->_sceneItems.addItems(&_objScimitar, NULL); if (_globals->_inventory._sword._sceneNumber == 9850) - _globals->_sceneItems.addItems(&_objSword); + _globals->_sceneItems.addItems(&_objSword, NULL); _globals->_sceneItems.remove(&_hotspot19); _globals->_player.enableControl(); break; @@ -1600,26 +1602,26 @@ void Scene9850::postInit(SceneObjectList *OwnerList) { _objSword.hide(); } - _spotLever.quickInit(30, 251, 45, 270, 9850, 26, -1); - _hotspot1.quickInit(123, 0, 200, 320, 9850, 0, 1); - _hotspot2.quickInit(107, 87, 133, 308, 9850, 0, 1); - _hotspot3.quickInit(2, 28, 53, 80, 9850, 2, 3); - _hotspot4.quickInit(13, 0, 55, 27, 9850, 2, 3); - _hotspot5.quickInit(8, 74, 27, 91, 9850, 4, 5); - _hotspot17.quickInit(61, 0, 125, 28, 9850, 6, 7); - _hotspot18.quickInit(51, 95, 105, 145, 9850, 6, 7); - _hotspot19.quickInit(56, 28, 115, 97, 9850, 6, 8); - _hotspot6.quickInit(0, 223, 115, 257, 9850, 9, 10); - _hotspot7.quickInit(15, 254, 33, 268, 9850, 9, -1); - _hotspot8.quickInit(17, 218, 37, 233, 9850, 9, 10); - _hotspot9.quickInit(8, 113, 26, 221, 9850, 11, 12); - _hotspot10.quickInit(14, 94, 53, 112, 9850, 13, 14); - _hotspot11.quickInit(5, 269, 29, 303, 9850, 15, 16); - _hotspot12.quickInit(43, 278, 91, 317, 9850, 17, 18); - _hotspot13.quickInit(47, 263, 112, 282, 9850, 19, 20); - _hotspot14.quickInit(43, 188, 86, 224, 9850, 21, 22); - _hotspot15.quickInit(43, 162, 92, 191, 9850, 23, 24); - _hotspot16.quickInit(40, 146, 90, 169, 9850, 25, -1); + _spotLever.setup(30, 251, 45, 270, 9850, 26, -1); + _hotspot1.setup(123, 0, 200, 320, 9850, 0, 1); + _hotspot2.setup(107, 87, 133, 308, 9850, 0, 1); + _hotspot3.setup(2, 28, 53, 80, 9850, 2, 3); + _hotspot4.setup(13, 0, 55, 27, 9850, 2, 3); + _hotspot5.setup(8, 74, 27, 91, 9850, 4, 5); + _hotspot17.setup(61, 0, 125, 28, 9850, 6, 7); + _hotspot18.setup(51, 95, 105, 145, 9850, 6, 7); + _hotspot19.setup(56, 28, 115, 97, 9850, 6, 8); + _hotspot6.setup(0, 223, 115, 257, 9850, 9, 10); + _hotspot7.setup(15, 254, 33, 268, 9850, 9, -1); + _hotspot8.setup(17, 218, 37, 233, 9850, 9, 10); + _hotspot9.setup(8, 113, 26, 221, 9850, 11, 12); + _hotspot10.setup(14, 94, 53, 112, 9850, 13, 14); + _hotspot11.setup(5, 269, 29, 303, 9850, 15, 16); + _hotspot12.setup(43, 278, 91, 317, 9850, 17, 18); + _hotspot13.setup(47, 263, 112, 282, 9850, 19, 20); + _hotspot14.setup(43, 188, 86, 224, 9850, 21, 22); + _hotspot15.setup(43, 162, 92, 191, 9850, 23, 24); + _hotspot16.setup(40, 146, 90, 169, 9850, 25, -1); _globals->_player.postInit(); _globals->_player.disableControl(); diff --git a/engines/tsage/ringworld_scenes10.h b/engines/tsage/ringworld_scenes10.h index 6a09773179..6f43bcf9b6 100644 --- a/engines/tsage/ringworld_scenes10.h +++ b/engines/tsage/ringworld_scenes10.h @@ -35,6 +35,18 @@ namespace tSage { +class SceneObject9150: public SceneObject { +public: + int _timer, _signalFlag; + + virtual void synchronise(Serialiser &s) { + SceneObject::synchronise(s); + s.syncAsSint16LE(_timer); + s.syncAsSint16LE(_signalFlag); + } + virtual Common::String getClassName() { return "SceneObject9150"; } +}; + class Scene2: public Scene { public : int _sceneState; @@ -54,7 +66,7 @@ public: class Scene9100: public Scene { /* Items */ - class SceneHotspot1: public SceneHotspot_3 { + class SceneHotspot1: public NamedHotspot { public: virtual void doAction(int action); }; @@ -67,11 +79,11 @@ public: SceneObject _object5; SceneObject _object6; SceneHotspot1 _sceneHotspot1; - SceneHotspot_3 _sceneHotspot2; - SceneHotspot_3 _sceneHotspot3; - SceneHotspot_3 _sceneHotspot4; - SceneHotspot_3 _sceneHotspot5; - SceneHotspot_3 _sceneHotspot6; + NamedHotspot _sceneHotspot2; + NamedHotspot _sceneHotspot3; + NamedHotspot _sceneHotspot4; + NamedHotspot _sceneHotspot5; + NamedHotspot _sceneHotspot6; virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void signal(); @@ -79,7 +91,7 @@ public: }; class Scene9150: public Scene2 { - class Object3: public SceneObject4 { + class Object3: public SceneObject9150 { public: virtual void signal(); virtual void dispatch(); @@ -90,16 +102,16 @@ public: SceneObject _object1; SceneObject _object2; Object3 _object3; - SceneHotspot_3 _sceneHotspot1; - SceneHotspot_3 _sceneHotspot2; - SceneHotspot_3 _sceneHotspot3; - SceneHotspot_3 _sceneHotspot4; - SceneHotspot_3 _sceneHotspot5; - SceneHotspot_3 _sceneHotspot6; - SceneHotspot_3 _sceneHotspot7; - SceneHotspot_3 _sceneHotspot8; - SceneHotspot_3 _sceneHotspot9; - SceneHotspot_3 _sceneHotspot10; + NamedHotspot _sceneHotspot1; + NamedHotspot _sceneHotspot2; + NamedHotspot _sceneHotspot3; + NamedHotspot _sceneHotspot4; + NamedHotspot _sceneHotspot5; + NamedHotspot _sceneHotspot6; + NamedHotspot _sceneHotspot7; + NamedHotspot _sceneHotspot8; + NamedHotspot _sceneHotspot9; + NamedHotspot _sceneHotspot10; virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void signal(); @@ -107,7 +119,7 @@ public: }; class Scene9200: public Scene2 { - class SceneHotspot1: public SceneHotspot_3{ + class SceneHotspot1: public NamedHotspot{ public: virtual void doAction(int action); }; @@ -122,13 +134,13 @@ public: SpeakerQText _speakerQText; SoundHandler _soundHandler; SceneHotspot1 _hotspot1; - SceneHotspot_3 _hotspot2; - SceneHotspot_3 _hotspot3; - SceneHotspot_3 _hotspot4; - SceneHotspot_3 _hotspot5; - SceneHotspot_3 _hotspot6; - SceneHotspot_3 _hotspot7; - SceneHotspot_3 _hotspot8; + NamedHotspot _hotspot2; + NamedHotspot _hotspot3; + NamedHotspot _hotspot4; + NamedHotspot _hotspot5; + NamedHotspot _hotspot6; + NamedHotspot _hotspot7; + NamedHotspot _hotspot8; virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void signal(); @@ -141,19 +153,19 @@ public: SequenceManager _sequenceManager; SceneObject _object1; SceneObject _object2; - SceneHotspot_3 _hotspot1; - SceneHotspot_3 _hotspot2; - SceneHotspot_3 _hotspot3; - SceneHotspot_3 _hotspot4; - SceneHotspot_3 _hotspot5; - SceneHotspot_3 _hotspot6; - SceneHotspot_3 _hotspot7; - SceneHotspot_3 _hotspot8; - SceneHotspot_3 _hotspot9; - SceneHotspot_3 _hotspot10; - SceneHotspot_3 _hotspot11; - SceneHotspot_3 _hotspot12; - SceneHotspot_3 _hotspot13; + NamedHotspot _hotspot1; + NamedHotspot _hotspot2; + NamedHotspot _hotspot3; + NamedHotspot _hotspot4; + NamedHotspot _hotspot5; + NamedHotspot _hotspot6; + NamedHotspot _hotspot7; + NamedHotspot _hotspot8; + NamedHotspot _hotspot9; + NamedHotspot _hotspot10; + NamedHotspot _hotspot11; + NamedHotspot _hotspot12; + NamedHotspot _hotspot13; virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void signal(); @@ -165,11 +177,11 @@ public: SequenceManager _sequenceManager; Object9350 _object1; SceneObject _object2; - SceneHotspot_3 _sceneHotspot1; - SceneHotspot_3 _sceneHotspot2; - SceneHotspot_3 _sceneHotspot3; - SceneHotspot_3 _sceneHotspot4; - SceneHotspot_3 _sceneHotspot5; + NamedHotspot _sceneHotspot1; + NamedHotspot _sceneHotspot2; + NamedHotspot _sceneHotspot3; + NamedHotspot _sceneHotspot4; + NamedHotspot _sceneHotspot5; virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void signal(); @@ -181,14 +193,14 @@ public: SequenceManager _sequenceManager; Action _action1; Object9350 _object1; - SceneHotspot_3 _hotspot1; - SceneHotspot_3 _hotspot2; - SceneHotspot_3 _hotspot3; - SceneHotspot_3 _hotspot4; - SceneHotspot_3 _hotspot5; - SceneHotspot_3 _hotspot6; - SceneHotspot_3 _hotspot7; - SceneHotspot_3 _hotspot8; + NamedHotspot _hotspot1; + NamedHotspot _hotspot2; + NamedHotspot _hotspot3; + NamedHotspot _hotspot4; + NamedHotspot _hotspot5; + NamedHotspot _hotspot6; + NamedHotspot _hotspot7; + NamedHotspot _hotspot8; virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void signal(); @@ -196,12 +208,12 @@ public: }; class Scene9400: public Scene2 { - class SceneHotspot7: public SceneHotspot_3{ + class SceneHotspot7: public NamedHotspot{ public: virtual void doAction(int action); }; - class SceneHotspot8: public SceneHotspot_3{ + class SceneHotspot8: public NamedHotspot{ public: virtual void doAction(int action); }; @@ -215,12 +227,12 @@ public: SpeakerOText _speakerOText; SpeakerOR _speakerOR; SpeakerQText _speakerQText; - SceneHotspot_3 _hotspot1; - SceneHotspot_3 _hotspot2; - SceneHotspot_3 _hotspot3; - SceneHotspot_3 _hotspot4; - SceneHotspot_3 _hotspot5; - SceneHotspot_3 _hotspot6; + NamedHotspot _hotspot1; + NamedHotspot _hotspot2; + NamedHotspot _hotspot3; + NamedHotspot _hotspot4; + NamedHotspot _hotspot5; + NamedHotspot _hotspot6; SoundHandler _soundHandler; int _field1032; SceneHotspot7 _hotspot7; @@ -237,17 +249,17 @@ class Scene9450: public Scene2 { virtual void signal(); }; - class Object3: public SceneObject4 { + class Object3: public SceneObject9150 { public: virtual void dispatch(); }; - class Hotspot1: public SceneHotspot_3{ + class Hotspot1: public NamedHotspot{ public: virtual void doAction(int action); }; - class Hotspot3: public SceneHotspot_3{ + class Hotspot3: public NamedHotspot{ public: virtual void doAction(int action); }; @@ -259,21 +271,21 @@ public: SequenceManager _sequenceManager3; Object3 _object3; Hotspot1 _hotspot1; - SceneHotspot_3 _hotspot2; + NamedHotspot _hotspot2; Hotspot3 _hotspot3; - SceneHotspot_3 _hotspot4; - SceneHotspot_3 _hotspot5; - SceneHotspot_3 _hotspot6; - SceneHotspot_3 _hotspot7; - SceneHotspot_3 _hotspot8; - SceneHotspot_3 _hotspot9; - SceneHotspot_3 _hotspot10; - SceneHotspot_3 _hotspot11; - SceneHotspot_3 _hotspot12; - SceneHotspot_3 _hotspot13; - SceneHotspot_3 _hotspot14; - SceneHotspot_3 _hotspot15; - SceneHotspot_3 _hotspot16; + NamedHotspot _hotspot4; + NamedHotspot _hotspot5; + NamedHotspot _hotspot6; + NamedHotspot _hotspot7; + NamedHotspot _hotspot8; + NamedHotspot _hotspot9; + NamedHotspot _hotspot10; + NamedHotspot _hotspot11; + NamedHotspot _hotspot12; + NamedHotspot _hotspot13; + NamedHotspot _hotspot14; + NamedHotspot _hotspot15; + NamedHotspot _hotspot16; virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void signal(); @@ -281,22 +293,22 @@ public: }; class Scene9500: public Scene2 { - class Hotspot1: public SceneHotspot_3{ + class Hotspot1: public NamedHotspot{ public: virtual void doAction(int action); }; - class Hotspot2: public SceneHotspot_3{ + class Hotspot2: public NamedHotspot{ public: virtual void doAction(int action); }; - class Hotspot3: public SceneHotspot_3{ + class Hotspot3: public NamedHotspot{ public: virtual void doAction(int action); }; - class Hotspot4: public SceneHotspot_3{ + class Hotspot4: public NamedHotspot{ public: virtual void doAction(int action); }; @@ -311,21 +323,21 @@ public: Hotspot3 _hotspot3; Hotspot4 _hotspot4; Hotspot4 _hotspot5; - SceneHotspot_3 _hotspot6; - SceneHotspot_3 _hotspot7; - SceneHotspot_3 _hotspot8; - SceneHotspot_3 _hotspot9; - SceneHotspot_3 _hotspot10; - SceneHotspot_3 _hotspot11; - SceneHotspot_3 _hotspot12; - SceneHotspot_3 _hotspot13; - SceneHotspot_3 _hotspot14; - SceneHotspot_3 _hotspot15; - SceneHotspot_3 _hotspot16; - SceneHotspot_3 _hotspot17; - SceneHotspot_3 _hotspot18; - SceneHotspot_3 _hotspot19; - SceneHotspot_3 _hotspot20; + NamedHotspot _hotspot6; + NamedHotspot _hotspot7; + NamedHotspot _hotspot8; + NamedHotspot _hotspot9; + NamedHotspot _hotspot10; + NamedHotspot _hotspot11; + NamedHotspot _hotspot12; + NamedHotspot _hotspot13; + NamedHotspot _hotspot14; + NamedHotspot _hotspot15; + NamedHotspot _hotspot16; + NamedHotspot _hotspot17; + NamedHotspot _hotspot18; + NamedHotspot _hotspot19; + NamedHotspot _hotspot20; virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void signal(); @@ -336,12 +348,12 @@ public: class Scene9700: public Scene2 { SequenceManager _sequenceManager; SceneObject _object1; - SceneHotspot_3 _sceneHotspot1; - SceneHotspot_3 _sceneHotspot2; - SceneHotspot_3 _sceneHotspot3; - SceneHotspot_3 _sceneHotspot4; - SceneHotspot_3 _sceneHotspot5; - SceneHotspot_3 _sceneHotspot6; + NamedHotspot _sceneHotspot1; + NamedHotspot _sceneHotspot2; + NamedHotspot _sceneHotspot3; + NamedHotspot _sceneHotspot4; + NamedHotspot _sceneHotspot5; + NamedHotspot _sceneHotspot6; GfxButton _gfxButton1; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -371,37 +383,37 @@ class Scene9850: public Scene { virtual void doAction(int action); }; - class Hotspot12: public SceneHotspot_3{ + class Hotspot12: public NamedHotspot{ public: virtual void doAction(int action); }; - class Hotspot14: public SceneHotspot_3{ + class Hotspot14: public NamedHotspot{ public: virtual void doAction(int action); }; - class Hotspot16: public SceneHotspot_3{ + class Hotspot16: public NamedHotspot{ public: virtual void doAction(int action); }; - class Hotspot17: public SceneHotspot_3{ + class Hotspot17: public NamedHotspot{ public: virtual void doAction(int action); }; - class Hotspot18: public SceneHotspot_3{ + class Hotspot18: public NamedHotspot{ public: virtual void doAction(int action); }; - class Hotspot19: public SceneHotspot_3{ + class Hotspot19: public NamedHotspot{ public: virtual void doAction(int action); }; - class Hotspot20: public SceneHotspot_3{ + class Hotspot20: public NamedHotspot{ public: virtual void doAction(int action); }; @@ -415,21 +427,21 @@ public: Object6 _objScimitar; Object7 _objSword; SoundHandler _soundHandler; - SceneHotspot_3 _hotspot1; - SceneHotspot_3 _hotspot2; - SceneHotspot_3 _hotspot3; - SceneHotspot_3 _hotspot4; - SceneHotspot_3 _hotspot5; - SceneHotspot_3 _hotspot6; - SceneHotspot_3 _hotspot7; - SceneHotspot_3 _hotspot8; - SceneHotspot_3 _hotspot9; - SceneHotspot_3 _hotspot10; - SceneHotspot_3 _hotspot11; + NamedHotspot _hotspot1; + NamedHotspot _hotspot2; + NamedHotspot _hotspot3; + NamedHotspot _hotspot4; + NamedHotspot _hotspot5; + NamedHotspot _hotspot6; + NamedHotspot _hotspot7; + NamedHotspot _hotspot8; + NamedHotspot _hotspot9; + NamedHotspot _hotspot10; + NamedHotspot _hotspot11; Hotspot12 _hotspot12; - SceneHotspot_3 _hotspot13; + NamedHotspot _hotspot13; Hotspot14 _hotspot14; - SceneHotspot_3 _hotspot15; + NamedHotspot _hotspot15; Hotspot16 _hotspot16; Hotspot17 _hotspot17; Hotspot18 _hotspot18; diff --git a/engines/tsage/ringworld_scenes5.cpp b/engines/tsage/ringworld_scenes5.cpp index fad83cdcf8..a8a1055338 100644 --- a/engines/tsage/ringworld_scenes5.cpp +++ b/engines/tsage/ringworld_scenes5.cpp @@ -3743,37 +3743,6 @@ void Scene4300::Action2::signal() { /*--------------------------------------------------------------------------*/ -void HotspotBase4300::doAction(int action) { - switch (action) { - case CURSOR_WALK: - break; - case CURSOR_LOOK: - if (_lookLine != -1) - SceneItem::display2(_resNum, _lookLine); - else - SceneHotspot::doAction(action); - break; - case CURSOR_USE: - if (_useLine != -1) - SceneItem::display2(_resNum, _useLine); - else - SceneHotspot::doAction(action); - break; - default: - SceneHotspot::doAction(action); - break; - } -} - -void HotspotBase4300::setup(const Rect &bounds, int resNum, int lookLine, int useLine) { - SceneHotspot::setBounds(bounds); - _resNum = resNum; - _lookLine = lookLine; - _useLine = useLine; - - _globals->_sceneItems.push_back(this); -} - void Scene4300::Hotspot8::doAction(int action) { switch (action) { case CURSOR_LOOK: @@ -3829,7 +3798,7 @@ void Scene4300::Hotspot9::doAction(int action) { SceneItem::display2(4300, 23); break; default: - HotspotBase4300::doAction(action); + NamedHotspot::doAction(action); break; } } @@ -3981,7 +3950,7 @@ void Scene4300::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_speakerMText); _stripManager.addSpeaker(&_speakerFLText); - _hotspot11.setup(Rect(76, 97, 102, 127), 4300, 5, 6); + _hotspot11.setup(76, 97, 102, 127, 4300, 5, 6); _hotspot7.postInit(); _hotspot7.setPosition(Common::Point(90, 128)); @@ -3989,7 +3958,7 @@ void Scene4300::postInit(SceneObjectList *OwnerList) { _hotspot7.setPriority2(250); _globals->_sceneItems.push_back(&_hotspot7); - _hotspot9.setup(Rect(120, 49, 174, 91), 4300, -1, -1); + _hotspot9.setup(120, 49, 174, 91, 4300, -1, -1); _hotspot15.postInit(); _hotspot15.setVisage(4300); @@ -4324,7 +4293,7 @@ void Scene4301::Hotspot4::doAction(int action) { _globals->_player.disableControl(); scene->setAction(&scene->_action1); } else { - HotspotBase4300::doAction(action); + NamedHotspot::doAction(action); } } @@ -4358,7 +4327,7 @@ void Scene4301::postInit(SceneObjectList *OwnerList) { _field68E = false; _globals->_inventory._stasisBox2._sceneNumber = 1; - _hotspot4.setup(Rect(76, 97, 102, 127), 4300, 5, 6); + _hotspot4.setup(76, 97, 102, 127, 4300, 5, 6); _hotspot1.postInit(); _hotspot1.setPosition(Common::Point(90, 128)); diff --git a/engines/tsage/ringworld_scenes5.h b/engines/tsage/ringworld_scenes5.h index fd7751af27..e9ad5b62cb 100644 --- a/engines/tsage/ringworld_scenes5.h +++ b/engines/tsage/ringworld_scenes5.h @@ -574,16 +574,6 @@ public: virtual void dispatch(); }; -class HotspotBase4300: public SceneObject { -public: - int _resNum; - int _lookLine, _useLine; - - virtual void doAction(int action); - - void setup(const Rect &bounds, int resNum, int lookLine, int useLine); -}; - class Scene4300: public Scene { /* Actions */ class Action1: public Action { @@ -600,7 +590,7 @@ class Scene4300: public Scene { public: virtual void doAction(int action); }; - class Hotspot9: public HotspotBase4300 { + class Hotspot9: public NamedHotspot { public: virtual void doAction(int action); }; @@ -638,7 +628,7 @@ public: Hotspot8 _hotspot8; Hotspot9 _hotspot9; Hotspot10 _hotspot10; - HotspotBase4300 _hotspot11; + NamedHotspot _hotspot11; SceneObject _hotspot12, _hotspot13, _hotspot14; Hotspot15 _hotspot15; Hotspot16 _hotspot16; @@ -672,11 +662,11 @@ class Scene4301: public Scene { }; /* Hotspots */ - class Hotspot4: public HotspotBase4300 { + class Hotspot4: public NamedHotspot { public: virtual void doAction(int action); }; - class Hotspot5: public HotspotBase4300 { + class Hotspot5: public NamedHotspot { public: virtual void doAction(int action); }; diff --git a/engines/tsage/ringworld_scenes8.cpp b/engines/tsage/ringworld_scenes8.cpp index 0e4ba84346..e9277fbe00 100644 --- a/engines/tsage/ringworld_scenes8.cpp +++ b/engines/tsage/ringworld_scenes8.cpp @@ -1917,7 +1917,7 @@ void Scene7700::Object1::doAction(int action) { Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; if (action == CURSOR_LOOK) { - SceneItem::display(7700, _field88, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + SceneItem::display(7700, _lookLineNum, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); } else if (action == CURSOR_USE) { if (_globals->getFlag(78)) { _globals->_player.disableControl(); @@ -1934,10 +1934,10 @@ void Scene7700::Object1::doAction(int action) { void Scene7700::SceneHotspot11::doAction(int action) { switch (action) { case CURSOR_LOOK: - SceneItem::display(7700, _field28, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + SceneItem::display(7700, _lookLineNum, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); break; case CURSOR_USE: - SceneItem::display(7701, _field26, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + SceneItem::display(7701, _useLineNum, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); break; default: SceneHotspot::doAction(action); @@ -1948,7 +1948,7 @@ void Scene7700::SceneHotspot11::doAction(int action) { void Scene7700::Object1::signal() { if (_state == 0) { _state = 1; - SceneItem::display(7701, _field8A, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + SceneItem::display(7701, _defltLineNum, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); } else { _state = 0; } @@ -2333,15 +2333,15 @@ void Scene7700::postInit(SceneObjectList *OwnerList) { _object1.postInit(); _object1.setVisage(7700); _object1.setPosition(Common::Point(184, 61), 0); - _object1._field88 = 18; - _object1._field8A = 16; + _object1._lookLineNum = 18; + _object1._defltLineNum = 16; _object2.postInit(); _object2.setVisage(7700); _object2.setPosition(Common::Point(184, 70), 0); _object2.setPriority2(60); - _object2._field88 = 19; - _object2._field8A = 17; + _object2._lookLineNum = 19; + _object2._defltLineNum = 17; _object3.postInit(); _object3.setVisage(7703); @@ -2352,24 +2352,24 @@ void Scene7700::postInit(SceneObjectList *OwnerList) { _object4.setVisage(7700); _object4.setPosition(Common::Point(268, 59), 0); _object4.setStrip(2); - _object4._field88 = 37; - _object4._field8A = 35; + _object4._lookLineNum = 37; + _object4._defltLineNum = 35; _object5.postInit(); _object5.setVisage(7700); _object5.setPosition(Common::Point(268, 67), 0); _object5.setPriority2(58); _object5.setStrip2(3); - _object5._field88 = 38; - _object5._field8A = 36; + _object5._lookLineNum = 38; + _object5._defltLineNum = 36; _object6.postInit(); _object6.setVisage(7700); _object6.setPosition(Common::Point(268, 75), 0); _object6.setPriority2(57); _object6.setStrip2(4); - _object6._field88 = 40; - _object6._field8A = 43; + _object6._lookLineNum = 40; + _object6._defltLineNum = 43; _object8.postInit(); _object8.setVisage(7703); @@ -2405,83 +2405,83 @@ void Scene7700::postInit(SceneObjectList *OwnerList) { _sceneItem10.setBounds(0, 320, 200, 0); _sceneHotspot11._sceneRegionId = 57; - _sceneHotspot11._field26 = 0; - _sceneHotspot11._field28 = 0; + _sceneHotspot11._useLineNum = 0; + _sceneHotspot11._lookLineNum = 0; _sceneHotspot12._sceneRegionId = 2; - _sceneHotspot12._field26 = 2; - _sceneHotspot12._field28 = 2; + _sceneHotspot12._useLineNum = 2; + _sceneHotspot12._lookLineNum = 2; _sceneHotspot13._sceneRegionId = 12; - _sceneHotspot13._field26 = 3; - _sceneHotspot13._field28 = 3; + _sceneHotspot13._useLineNum = 3; + _sceneHotspot13._lookLineNum = 3; _sceneHotspot14._sceneRegionId = 18; - _sceneHotspot14._field26 = 4; - _sceneHotspot14._field28 = 5; + _sceneHotspot14._useLineNum = 4; + _sceneHotspot14._lookLineNum = 5; _sceneHotspot15.setBounds(0, 55, 50, 8); - _sceneHotspot15._field26 = 6; - _sceneHotspot15._field28 = 7; + _sceneHotspot15._useLineNum = 6; + _sceneHotspot15._lookLineNum = 7; _sceneHotspot16.setBounds(0, 130, 34, 103); - _sceneHotspot16._field26 = 8; - _sceneHotspot16._field28 = 9; + _sceneHotspot16._useLineNum = 8; + _sceneHotspot16._lookLineNum = 9; _sceneHotspot17.setBounds(41, 180, 46, 170); - _sceneHotspot17._field26 = 11; - _sceneHotspot17._field28 = 13; + _sceneHotspot17._useLineNum = 11; + _sceneHotspot17._lookLineNum = 13; _sceneHotspot18.setBounds(38, 187, 46, 180); - _sceneHotspot18._field26 = 12; - _sceneHotspot18._field28 = 14; + _sceneHotspot18._useLineNum = 12; + _sceneHotspot18._lookLineNum = 14; _sceneHotspot19._sceneRegionId = 3; - _sceneHotspot19._field26 = 14; - _sceneHotspot19._field28 = 16; + _sceneHotspot19._useLineNum = 14; + _sceneHotspot19._lookLineNum = 16; _sceneHotspot20._sceneRegionId = 14; - _sceneHotspot20._field26 = 15; - _sceneHotspot20._field28 = 17; + _sceneHotspot20._useLineNum = 15; + _sceneHotspot20._lookLineNum = 17; _sceneHotspot21.setBounds(9, 215, 26, 210); - _sceneHotspot21._field26 = 18; - _sceneHotspot21._field28 = 20; + _sceneHotspot21._useLineNum = 18; + _sceneHotspot21._lookLineNum = 20; _sceneHotspot22.setBounds(10, 221, 26, 215); - _sceneHotspot22._field26 = 19; - _sceneHotspot22._field28 = 21; + _sceneHotspot22._useLineNum = 19; + _sceneHotspot22._lookLineNum = 21; _sceneHotspot23.setBounds(6, 230, 26, 225); - _sceneHotspot23._field26 = 20; - _sceneHotspot23._field28 = 22; + _sceneHotspot23._useLineNum = 20; + _sceneHotspot23._lookLineNum = 22; _sceneHotspot24._sceneRegionId = 13; - _sceneHotspot24._field26 = 21; - _sceneHotspot24._field28 = 23; + _sceneHotspot24._useLineNum = 21; + _sceneHotspot24._lookLineNum = 23; _sceneHotspot25._sceneRegionId = 21; - _sceneHotspot25._field26 = 22; - _sceneHotspot25._field28 = 24; + _sceneHotspot25._useLineNum = 22; + _sceneHotspot25._lookLineNum = 24; _sceneHotspot26._sceneRegionId = 19; - _sceneHotspot26._field26 = 23; - _sceneHotspot26._field28 = 25; + _sceneHotspot26._useLineNum = 23; + _sceneHotspot26._lookLineNum = 25; _sceneHotspot27._sceneRegionId = 27; - _sceneHotspot27._field26 = 24; - _sceneHotspot27._field28 = 26; + _sceneHotspot27._useLineNum = 24; + _sceneHotspot27._lookLineNum = 26; _sceneHotspot28._sceneRegionId = 15; - _sceneHotspot28._field26 = 25; - _sceneHotspot28._field28 = 27; + _sceneHotspot28._useLineNum = 25; + _sceneHotspot28._lookLineNum = 27; _sceneHotspot29._sceneRegionId = 26; - _sceneHotspot29._field26 = 27; - _sceneHotspot29._field28 = 29; + _sceneHotspot29._useLineNum = 27; + _sceneHotspot29._lookLineNum = 29; _sceneHotspot30.setBounds(0, 317, 34, 310); - _sceneHotspot30._field26 = 28; - _sceneHotspot30._field28 = 30; + _sceneHotspot30._useLineNum = 28; + _sceneHotspot30._lookLineNum = 30; _sceneHotspot31._sceneRegionId = 17; - _sceneHotspot31._field26 = 29; - _sceneHotspot31._field28 = 31; + _sceneHotspot31._useLineNum = 29; + _sceneHotspot31._lookLineNum = 31; _sceneHotspot32._sceneRegionId = 25; - _sceneHotspot32._field26 = 30; - _sceneHotspot32._field28 = 32; + _sceneHotspot32._useLineNum = 30; + _sceneHotspot32._lookLineNum = 32; _sceneHotspot33._sceneRegionId = 5; - _sceneHotspot33._field26 = 31; - _sceneHotspot33._field28 = 33; + _sceneHotspot33._useLineNum = 31; + _sceneHotspot33._lookLineNum = 33; _sceneHotspot34.setBounds(42, 292, 48, 281); - _sceneHotspot34._field26 = 32; - _sceneHotspot34._field28 = 35; + _sceneHotspot34._useLineNum = 32; + _sceneHotspot34._lookLineNum = 35; _sceneHotspot35._sceneRegionId = 24; - _sceneHotspot35._field26 = 38; - _sceneHotspot35._field28 = 41; + _sceneHotspot35._useLineNum = 38; + _sceneHotspot35._lookLineNum = 41; _sceneHotspot36._sceneRegionId = 1; - _sceneHotspot36._field26 = 39; - _sceneHotspot36._field28 = 42; + _sceneHotspot36._useLineNum = 39; + _sceneHotspot36._lookLineNum = 42; _globals->_sceneItems.addItems(&_prof, &_sceneHotspot35, &_object8, &_sceneHotspot34, &_sceneHotspot33, &_sceneHotspot32, NULL); _globals->_sceneItems.addItems(&_sceneHotspot31, &_sceneHotspot30, &_sceneHotspot29, &_sceneHotspot5, &_sceneHotspot28, &_sceneHotspot27, NULL); @@ -2499,7 +2499,6 @@ void Scene7700::postInit(SceneObjectList *OwnerList) { Scene7700::Scene7700() { _object1._state = 0; _object2._state = 0; - _object3._state = 0; _object4._state = 0; _object5._state = 0; _object6._state = 0; diff --git a/engines/tsage/ringworld_scenes8.h b/engines/tsage/ringworld_scenes8.h index 406ba0894f..929426696e 100644 --- a/engines/tsage/ringworld_scenes8.h +++ b/engines/tsage/ringworld_scenes8.h @@ -35,6 +35,26 @@ namespace tSage { +class NamedHotspotMult: public SceneHotspot { +public: + int _useLineNum, _lookLineNum; + NamedHotspotMult(): SceneHotspot() {} + + virtual Common::String getClassName() { return "NamedHotspotMult"; } +}; + +class SceneObject7700: public SceneObjectExt { +public: + int _lookLineNum, _defltLineNum; + + virtual void synchronise(Serialiser &s) { + SceneObject::synchronise(s); + s.syncAsSint16LE(_lookLineNum); + s.syncAsSint16LE(_defltLineNum); + } + virtual Common::String getClassName() { return "SceneObject7700"; } +}; + class Scene7000: public Scene { /* Actions */ class Action1: public Action { @@ -315,12 +335,12 @@ class Scene7700: public Scene { virtual void signal(); }; - class Object1: public SceneObject3 { + class Object1: public SceneObject7700 { public: virtual void signal(); virtual void doAction(int action); }; - class Object3: public SceneObject3 { + class Object3: public SceneObject { public: virtual void doAction(int action); }; @@ -390,7 +410,7 @@ class Scene7700: public Scene { public: virtual void doAction(int action); }; - class SceneHotspot11: public SceneHotspot_2 { + class SceneHotspot11: public NamedHotspotMult { public: virtual void doAction(int action); }; |