diff options
author | Paul Gilbert | 2011-12-22 21:55:46 +1100 |
---|---|---|
committer | Paul Gilbert | 2011-12-22 21:55:46 +1100 |
commit | a4934fe05a50ccdbffd5171d08b7e600572da5a7 (patch) | |
tree | 8c7137bb5d6b1f0e4626af4d5cb641b31bb3e9f8 /engines/tsage/ringworld2 | |
parent | b5e53281846e455ebd3f4a7bf40d1fffc6afeafe (diff) | |
download | scummvm-rg350-a4934fe05a50ccdbffd5171d08b7e600572da5a7.tar.gz scummvm-rg350-a4934fe05a50ccdbffd5171d08b7e600572da5a7.tar.bz2 scummvm-rg350-a4934fe05a50ccdbffd5171d08b7e600572da5a7.zip |
TSAGE: Moved look/use/talk descriptions to SceneItem class, and implemented R2R SceneExt::display
Diffstat (limited to 'engines/tsage/ringworld2')
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_logic.cpp | 99 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_logic.h | 7 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes3.cpp | 9 |
3 files changed, 39 insertions, 76 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 0844a48ed8..470cdab10c 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -303,7 +303,7 @@ void SceneExt::loadScene(int sceneNum) { } } -bool SceneExt::display(CursorType action) { +bool SceneExt::display(CursorType action, Event &event) { switch (action) { case CURSOR_CROSSHAIRS: return false; @@ -316,10 +316,41 @@ bool SceneExt::display(CursorType action) { case CURSOR_TALK: SceneItem::display2(1, R2_GLOBALS._randomSource.getRandomNumber(4) + 10); break; + case R2_NEGATOR_GUN: + if (R2_GLOBALS.getFlag(1)) + SceneItem::display2(2, action); + else + SceneItem::display2(5, 0); + break; + case R2_7: + if ((R2_GLOBALS._v565F1[1] == 2) || ((R2_GLOBALS._v565F1[1] == 1) && + (R2_GLOBALS._v565F1[2] == 2) && (R2_GLOBALS._sceneManager._previousScene == 300))) { + R2_GLOBALS._sound4.stop(); + R2_GLOBALS._sound3.play(46); + SceneItem::display2(5, 15); + } else { + R2_GLOBALS._sound3.play(43, 0); + SceneItem::display2(2, 0); + } + + R2_GLOBALS._sound4.play(45); + break; + case R2_9: + case R2_39: + R2_GLOBALS._sound3.play(44); + SceneItem::display2(2, action); + R2_GLOBALS._sound3.stop(); + break; + case R2_44: + R2_GLOBALS._sound3.play(99); + SceneItem::display2(2, action); + break; default: - return false; + SceneItem::display2(2, action); + break; } + event.handled = true; return true; } @@ -840,68 +871,6 @@ bool NamedHotspot::startAction(CursorType action, Event &event) { } } -void NamedHotspot::setDetails(int ys, int xs, int ye, int xe, const int resnum, const int lookLineNum, const int useLineNum) { - setBounds(ys, xe, ye, xs); - _resNum = resnum; - _lookLineNum = lookLineNum; - _useLineNum = useLineNum; - _talkLineNum = -1; - g_globals->_sceneItems.addItems(this, NULL); -} - -void NamedHotspot::setDetails(const Rect &bounds, int resNum, int lookLineNum, int talkLineNum, int useLineNum, int mode, SceneItem *item) { - setBounds(bounds); - _resNum = resNum; - _lookLineNum = lookLineNum; - _talkLineNum = talkLineNum; - _useLineNum = useLineNum; - - switch (mode) { - case 2: - g_globals->_sceneItems.push_front(this); - break; - case 4: - g_globals->_sceneItems.addBefore(item, this); - break; - case 5: - g_globals->_sceneItems.addAfter(item, this); - break; - default: - g_globals->_sceneItems.push_back(this); - break; - } -} - -void NamedHotspot::setDetails(int sceneRegionId, int resNum, int lookLineNum, int talkLineNum, int useLineNum, int mode) { - _sceneRegionId = sceneRegionId; - _resNum = resNum; - _lookLineNum = lookLineNum; - _talkLineNum = talkLineNum; - _useLineNum = useLineNum; - - // Handle adding hotspot to scene items list as necessary - switch (mode) { - case 2: - GLOBALS._sceneItems.push_front(this); - break; - case 3: - break; - default: - GLOBALS._sceneItems.push_back(this); - break; - } -} - -void NamedHotspot::synchronize(Serializer &s) { - SceneHotspot::synchronize(s); - s.syncAsSint16LE(_resNum); - s.syncAsSint16LE(_lookLineNum); - s.syncAsSint16LE(_useLineNum); - - if (g_vm->getGameID() == GType_BlueForce) - s.syncAsSint16LE(_talkLineNum); -} - void SceneActor::postInit(SceneObjectList *OwnerList) { _lookLineNum = _talkLineNum = _useLineNum = -1; SceneObject::postInit(); @@ -943,7 +912,7 @@ bool SceneActor::startAction(CursorType action, Event &event) { } if (!handled) - handled = ((SceneExt *)R2_GLOBALS._sceneManager._scene)->display(action); + handled = ((SceneExt *)R2_GLOBALS._sceneManager._scene)->display(action, event); return handled; } diff --git a/engines/tsage/ringworld2/ringworld2_logic.h b/engines/tsage/ringworld2/ringworld2_logic.h index 9eaa1b0cd1..67346bcc80 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.h +++ b/engines/tsage/ringworld2/ringworld2_logic.h @@ -102,7 +102,7 @@ public: virtual void refreshBackground(int xAmount, int yAmount); virtual void saveCharacter(int characterIndex); - bool display(CursorType action); + bool display(CursorType action, Event &event); void fadeOut(); void clearScreen(); }; @@ -233,15 +233,10 @@ public: class NamedHotspot : public SceneHotspot { public: - int _resNum, _lookLineNum, _useLineNum, _talkLineNum; NamedHotspot(); virtual bool startAction(CursorType action, Event &event); virtual Common::String getClassName() { return "NamedHotspot"; } - virtual void synchronize(Serializer &s); - virtual void setDetails(int ys, int xs, int ye, int xe, const int resnum, const int lookLineNum, const int useLineNum); - virtual void setDetails(const Rect &bounds, int resNum, int lookLineNum, int talkLineNum, int useLineNum, int mode, SceneItem *item); - virtual void setDetails(int sceneRegionId, int resNum, int lookLineNum, int talkLineNum, int useLineNum, int mode = 0); }; class NamedHotspotExt : public NamedHotspot { diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index 8ea83a2527..5b1e05ebc8 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -233,8 +233,7 @@ bool Scene3125::Item1::startAction(CursorType action, Event &event) { SceneItem::display(_resNum, _talkLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); break; default: - warning("scene->display() called with two parameters"); - return scene->display(action); + return scene->display(action, event); break; } @@ -822,8 +821,8 @@ bool Scene3175::Item1::startAction(CursorType action, Event &event) { default: break; } - warning("scene->display() called with two parameters"); - return scene->display(action); + + return scene->display(action, event); } bool Scene3175::Actor3::startAction(CursorType action, Event &event) { @@ -852,7 +851,7 @@ bool Scene3175::Actor3::startAction(CursorType action, Event &event) { break; } warning("scene->display() called with two parameters"); - return scene->display(action); + return scene->display(action, event); } bool Scene3175::Actor1::startAction(CursorType action, Event &event) { |