aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2013-07-16 09:19:19 -0400
committerPaul Gilbert2013-07-16 09:19:19 -0400
commite17095df2e636a3d36c1b606e7e650b494eec696 (patch)
tree08e74f942bb660a10c27efdc2f9d71ecf91947c5
parent8e9aefbf6edafa9eed41bd90e5579e5bcde34b03 (diff)
downloadscummvm-rg350-e17095df2e636a3d36c1b606e7e650b494eec696.tar.gz
scummvm-rg350-e17095df2e636a3d36c1b606e7e650b494eec696.tar.bz2
scummvm-rg350-e17095df2e636a3d36c1b606e7e650b494eec696.zip
TSAGE: Bugfixes for R2R drive room, and work on scanner modal dialog
-rw-r--r--engines/tsage/globals.cpp13
-rw-r--r--engines/tsage/globals.h6
-rw-r--r--engines/tsage/ringworld2/ringworld2_logic.cpp339
-rw-r--r--engines/tsage/ringworld2/ringworld2_logic.h66
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes0.cpp20
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes1.cpp49
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes1.h9
-rw-r--r--engines/tsage/saveload.h10
-rw-r--r--engines/tsage/user_interface.cpp9
9 files changed, 451 insertions, 70 deletions
diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp
index 86ac8985d5..8970d08e4d 100644
--- a/engines/tsage/globals.cpp
+++ b/engines/tsage/globals.cpp
@@ -366,9 +366,20 @@ bool BlueForceGlobals::removeFlag(int flagNum) {
namespace Ringworld2 {
+Ringworld2Globals::Ringworld2Globals() {
+ _scannerDialog = new ScannerDialog();
+}
+
+Ringworld2Globals::~Ringworld2Globals() {
+ delete _scannerDialog;
+}
+
void Ringworld2Globals::reset() {
Globals::reset();
+ if (!_scannerDialog)
+ _scannerDialog = new ScannerDialog();
+
// Reset the inventory
R2_INVENTORY.reset();
T2_GLOBALS._uiElements.updateInventory();
@@ -393,6 +404,7 @@ void Ringworld2Globals::reset() {
_v565EB = 26;
_v565F5 = 0;
_v565F6 = 0;
+ _v565F8 = 0;
_v565FA = 0;
_v565AE = 0;
_v56605[0] = 0;
@@ -507,6 +519,7 @@ void Ringworld2Globals::synchronize(Serializer &s) {
s.syncAsSint16LE(_v565EB);
s.syncAsSint16LE(_v565F5);
s.syncAsSint16LE(_v565F6);
+ s.syncAsSint16LE(_v565F8);
s.syncAsSint16LE(_v565FA);
s.syncAsSint16LE(_v566A3);
s.syncAsSint16LE(_v566A6);
diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h
index 6eca937fda..88fc0821df 100644
--- a/engines/tsage/globals.h
+++ b/engines/tsage/globals.h
@@ -247,6 +247,8 @@ namespace Ringworld2 {
#define k5A790 18
#define k5A791 17
+class ScannerDialog;
+
class Ringworld2Globals: public TsAGE2Globals {
public:
ASoundExt _sound1, _sound2, _sound3, _sound4;
@@ -269,6 +271,7 @@ public:
int _v565EB;
int _v565F5;
int _v565F6;
+ int _v565F8;
int _v565FA;
int _v5657C;
byte _v565AE;
@@ -304,7 +307,10 @@ public:
byte _v565EC[5];
byte _v565F1[4];
byte _stripManager_lookupList[12];
+ ScannerDialog *_scannerDialog;
+ Ringworld2Globals();
+ virtual ~Ringworld2Globals();
virtual void reset();
virtual void synchronize(Serializer &s);
};
diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp
index 87e1cbee52..1ddaa5e6c2 100644
--- a/engines/tsage/ringworld2/ringworld2_logic.cpp
+++ b/engines/tsage/ringworld2/ringworld2_logic.cpp
@@ -583,7 +583,7 @@ void SceneHandlerExt::process(Event &event) {
SceneExt *scene = static_cast<SceneExt *>(R2_GLOBALS._sceneManager._scene);
if (scene && R2_GLOBALS._player._uiEnabled) {
// Handle any scene areas that have been registered
- SynchronizedList<SceneArea *>::iterator saIter;
+ SynchronizedList<EventHandler *>::iterator saIter;
for (saIter = scene->_sceneAreas.begin(); saIter != scene->_sceneAreas.end() && !event.handled; ++saIter) {
(*saIter)->process(event);
}
@@ -2061,6 +2061,343 @@ void AnimationPlayerExt::synchronize(Serializer &s) {
s.syncAsSint16LE(_v);
}
+/*--------------------------------------------------------------------------*/
+
+ModalDialog::ModalDialog() {
+ _field20 = 0;
+}
+
+void ModalDialog::remove() {
+ R2_GLOBALS._sceneItems.remove(&_object1);
+ _object1.remove();
+
+ SceneArea::remove();
+
+ --R2_GLOBALS._insetUp;
+}
+
+void ModalDialog::synchronize(Serializer &s) {
+ SceneArea::synchronize(s);
+
+ s.syncAsByte(_field20);
+}
+
+void ModalDialog::process(Event &event) {
+ if (_field20 != R2_GLOBALS._insetUp)
+ return;
+
+ CursorType cursor = R2_GLOBALS._events.getCursor();
+
+ if (_object1._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 ModalDialog::proc12(int visage, int stripFrameNum, int frameNum, int posX, int posY) {
+ Scene1200 *scene = (Scene1200 *)R2_GLOBALS._sceneManager._scene;
+
+ _object1.postInit();
+ _object1.setup(visage, stripFrameNum, frameNum);
+ _object1.setPosition(Common::Point(posX, posY));
+ _object1.fixPriority(250);
+ _cursorNum = CURSOR_INVALID;
+ scene->_sceneAreas.push_front(this);
+ ++R2_GLOBALS._insetUp;
+ _field20 = R2_GLOBALS._insetUp;
+}
+
+void ModalDialog::proc13(int resNum, int lookLineNum, int talkLineNum, int useLineNum) {
+ _object1.setDetails(resNum, lookLineNum, talkLineNum, useLineNum, 2, (SceneItem *) NULL);
+}
+
+/*--------------------------------------------------------------------------*/
+
+ScannerDialog::ScannerActor::ScannerActor() {
+ _v1 = _v2 = 0;
+}
+
+void ScannerDialog::ScannerActor::setup(int v) {
+ _v1 = v;
+ _v2 = 0;
+ SceneActor::postInit();
+
+ SceneObject::setup(4, 2, 2);
+ fixPriority(255);
+
+ if (_v1 == 1)
+ setPosition(Common::Point(141, 99));
+ else if (_v1 == 2)
+ setPosition(Common::Point(141, 108));
+
+ static_cast<SceneExt *>(R2_GLOBALS._sceneManager._scene)->_sceneAreas.push_front(this);
+}
+
+void ScannerDialog::ScannerActor::synchronize(Serializer &s) {
+ SceneActor::synchronize(s);
+ s.syncAsSint16LE(_v1);
+ s.syncAsSint16LE(_v2);
+}
+
+void ScannerDialog::ScannerActor::process(Event &event) {
+ if (event.eventType == EVENT_BUTTON_DOWN && R2_GLOBALS._events.getCursor() == CURSOR_USE
+ && _bounds.contains(event.mousePos) && !_v2) {
+ setFrame(3);
+ _v2 = 1;
+ event.handled = true;
+ }
+
+ if (event.eventType == EVENT_BUTTON_UP && _v2) {
+ setFrame(2);
+ _v2 = 0;
+ event.handled = true;
+
+ reset();
+ }
+}
+
+bool ScannerDialog::ScannerActor::startAction(CursorType action, Event &event) {
+ if (action == CURSOR_USE)
+ return false;
+
+ return startAction(action, event);
+}
+
+void ScannerDialog::ScannerActor::reset() {
+ Scene *scene = R2_GLOBALS._sceneManager._scene;
+ ScannerDialog &scanner = *R2_GLOBALS._scannerDialog;
+
+ switch (_v1) {
+ case 1:
+ switch (R2_GLOBALS._sceneManager._sceneNumber) {
+ case 1550:
+ scene->_sceneMode = 80;
+ scene->signal();
+ break;
+ case 1700:
+ scene->_sceneMode = 30;
+ scene->signal();
+ remove();
+ break;
+ default:
+ break;
+ }
+ break;
+ case 2:
+ switch (R2_GLOBALS._sceneManager._sceneNumber) {
+ case 1550:
+ scanner._obj4.setup(4, 3, 1);
+
+ scanner._obj5.postInit();
+ scanner._obj5.setup(4, 4, 1);
+ scanner._obj5.setPosition(Common::Point(R2_GLOBALS._v565EC[1] + 145,
+ R2_GLOBALS._v565EC[3] + 59));
+ scanner._obj5.fixPriority(257);
+
+ scanner._obj6.postInit();
+ scanner._obj6.setup(4, 4, 2);
+ scanner._obj6.setPosition(Common::Point(R2_GLOBALS._v565EC[2] + 145,
+ R2_GLOBALS._v565EC[4] + 59));
+ scanner._obj6.fixPriority(257);
+ break;
+ case 1700:
+ case 1800:
+ if (R2_GLOBALS._v565F8 < 0 || (R2_GLOBALS._v565F8 == 0 && R2_GLOBALS._v565F6 < 1201))
+ scanner._obj4.setup(4, 3, 3);
+ else if (R2_GLOBALS._v565F8 > 0 || (R2_GLOBALS._v565F8 == 0 && R2_GLOBALS._v565F6 < 1201))
+ scanner._obj4.setup(4, 3, 4);
+ else
+ scanner._obj4.setup(4, 3, 5);
+ break;
+ case 3800:
+ case 3900:
+ if ((R2_GLOBALS._v56A93 + 1) == 0 && R2_GLOBALS._v566A9 == 0) {
+ do {
+ R2_GLOBALS._v566A9 = R2_GLOBALS._randomSource.getRandomNumber(3);
+ } while (R2_GLOBALS._v566A9 == R2_GLOBALS._v566AA);
+ }
+
+ scanner._obj4.setup(4, 7, R2_GLOBALS._v566A9);
+ if (!R2_GLOBALS.getFlag(46))
+ R2_GLOBALS.setFlag(46);
+ break;
+ default:
+ scanner._obj4.setup(4, 3, 2);
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+ScannerDialog::ScannerActor2::ScannerActor2() {
+ _v1 = _v2 = _yp = 0;
+ _v4 = _v5 = _v6 = 0;
+}
+
+void ScannerDialog::ScannerActor2::synchronize(Serializer &s) {
+ SceneActor::synchronize(s);
+
+ s.syncAsSint16LE(_v1);
+ s.syncAsSint16LE(_v2);
+ s.syncAsSint16LE(_yp);
+ s.syncAsSint16LE(_v4);
+ s.syncAsSint16LE(_v5);
+ s.syncAsSint16LE(_v6);
+}
+
+void ScannerDialog::ScannerActor2::remove() {
+ static_cast<SceneExt *>(R2_GLOBALS._sceneManager._scene)->_sceneAreas.remove(this);
+ SceneActor::remove();
+}
+
+void ScannerDialog::ScannerActor2::process(Event &event) {
+ if (event.eventType == EVENT_BUTTON_DOWN && R2_GLOBALS._events.getCursor() == CURSOR_USE
+ && _bounds.contains(event.mousePos) && !_v2) {
+ _v6 = 1;
+ }
+
+ if (event.eventType == EVENT_BUTTON_UP && _v6) {
+ _v6 = 0;
+ event.handled = 1;
+ update();
+ }
+
+ if (_v6) {
+ event.handled = true;
+ if (event.mousePos.x < _v2) {
+ setPosition(Common::Point(_v2, _yp));
+ } else if (event.mousePos.x >= (_v2 + _v4)) {
+ setPosition(Common::Point(_v2 + _v4, _yp));
+ } else {
+ setPosition(Common::Point(event.mousePos.x, _yp));
+ }
+ }
+}
+
+bool ScannerDialog::ScannerActor2::startAction(CursorType action, Event &event) {
+ if (action == CURSOR_USE)
+ return false;
+
+ return startAction(action, event);
+}
+
+void ScannerDialog::ScannerActor2::update() {
+ int v = (_v4 / (_v5 - 1)) / 2;
+ int v2 = ((_position.x - _v2 + v) * _v5) / (_v4 + v * 2);
+ setPosition(Common::Point(_v2 + ((_v4 * v2) / (_v5 - 1)), _yp));
+
+ R2_GLOBALS._v565F1[R2_GLOBALS._player._characterIndex] = v2;
+
+ switch (v2 - 1) {
+ case 0:
+ R2_GLOBALS._sound4.stop();
+ break;
+ case 1:
+ R2_GLOBALS._sound4.play(45);
+ break;
+ case 2:
+ R2_GLOBALS._sound4.play(4);
+ break;
+ case 3:
+ R2_GLOBALS._sound4.play(5);
+ break;
+ case 4:
+ R2_GLOBALS._sound4.play(6);
+ break;
+ default:
+ break;
+ }
+}
+
+void ScannerDialog::ScannerActor2::setup(int v1, int v2, int yp, int v4, int v5) {
+ _v1 = v1;
+ _v2 = v2;
+ _yp = yp;
+ _v4 = v4;
+ _v5 = v5;
+ _v6 = 0;
+ SceneActor::postInit();
+ fixPriority(255);
+ setPosition(Common::Point(_v4 * (_v1 - 1) / (_v5 - 1) + _v2, yp));
+
+ static_cast<SceneExt *>(R2_GLOBALS._sceneManager._scene)->_sceneAreas.push_front(this);
+}
+
+/*--------------------------------------------------------------------------*/
+
+ScannerDialog::ScannerDialog() {
+}
+
+void ScannerDialog::remove() {
+ switch (R2_GLOBALS._sceneManager._sceneNumber) {
+ case 1550:
+ case 1700:
+ R2_GLOBALS._events.setCursor(R2_GLOBALS._player._canWalk ? CURSOR_ARROW : CURSOR_USE);
+ break;
+ case 3800:
+ case 3900: {
+ Scene *scene = R2_GLOBALS._sceneManager._scene;
+ scene->_sceneMode = 3806;
+ scene->signal();
+ break;
+ }
+ default:
+ break;
+ }
+
+ SceneExt *scene = static_cast<SceneExt *>(R2_GLOBALS._sceneManager._scene);
+ scene->_sceneAreas.remove(&_obj1);
+ scene->_sceneAreas.remove(&_obj2);
+ _obj1.remove();
+ _obj2.remove();
+ _obj3.remove();
+ _obj4.remove();
+ _obj5.remove();
+ _obj6.remove();
+ _obj7.remove();
+
+ ModalDialog::remove();
+}
+
+void ScannerDialog::proc12(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(EXITCURSOR_LEFT_HAND);
+ ModalDialog::proc12(visage, stripFrameNum, frameNum, posX, posY);
+
+ proc13(100, -1, -1, -1);
+ _obj1.setup(1);
+ _obj2.setup(2);
+ _obj3.setup(R2_GLOBALS._v565F1[R2_GLOBALS._player._characterIndex], 142, 124, 35, 5);
+ _obj4.postInit();
+ _obj4.setup(4, 3, 2);
+ _obj4.setPosition(Common::Point(160, 83));
+ _obj4.fixPriority(256);
+
+ if (R2_GLOBALS._sceneManager._sceneNumber == 3800 || R2_GLOBALS._sceneManager._sceneNumber == 3900) {
+ Scene *scene = R2_GLOBALS._sceneManager._scene;
+ scene->_sceneMode = 3805;
+ scene->signal();
+ }
+}
+
} // End of namespace Ringworld2
} // End of namespace TsAGE
diff --git a/engines/tsage/ringworld2/ringworld2_logic.h b/engines/tsage/ringworld2/ringworld2_logic.h
index 57f8258a18..20ba999b00 100644
--- a/engines/tsage/ringworld2/ringworld2_logic.h
+++ b/engines/tsage/ringworld2/ringworld2_logic.h
@@ -88,7 +88,7 @@ public:
SceneObject *_focusObject;
Visage _cursorVisage;
- SynchronizedList<SceneArea *> _sceneAreas;
+ SynchronizedList<EventHandler *> _sceneAreas;
Rect _v51C34;
public:
@@ -444,6 +444,70 @@ public:
virtual void synchronize(Serializer &s);
};
+class ModalDialog: public SceneArea {
+public:
+ SceneActor _object1;
+ byte _field20;
+public:
+ ModalDialog();
+
+ virtual void remove();
+ virtual void synchronize(Serializer &s);
+ 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);
+};
+
+class ScannerDialog: public ModalDialog {
+
+ class ScannerActor: public SceneActor {
+ private:
+ void reset();
+ public:
+ int _v1;
+ int _v2;
+ public:
+ ScannerActor();
+ void setup(int v);
+
+ virtual void synchronize(Serializer &s);
+ virtual void process(Event &event);
+ virtual bool startAction(CursorType action, Event &event);
+ };
+ class ScannerActor2: public SceneActor {
+ private:
+ void update();
+ public:
+ int _v1;
+ int _v2;
+ int _yp;
+ int _v4;
+ int _v5;
+ int _v6;
+ public:
+ ScannerActor2();
+ void setup(int v1, int v2, int v3, int v4, int v5);
+
+ virtual void synchronize(Serializer &s);
+ virtual void remove();
+ virtual void process(Event &event);
+ virtual bool startAction(CursorType action, Event &event);
+ };
+public:
+ ScannerActor _obj1;
+ ScannerActor _obj2;
+ ScannerActor2 _obj3;
+ SceneActor _obj4;
+ SceneActor _obj5;
+ SceneActor _obj6;
+ SceneActor _obj7;
+public:
+ ScannerDialog();
+
+ virtual void remove();
+ void proc12(int visage, int stripFrameNum, int frameNum, int posX, int posY);
+};
+
} // End of namespace Ringworld2
} // End of namespace TsAGE
diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.cpp b/engines/tsage/ringworld2/ringworld2_scenes0.cpp
index 692a708c74..d1deac7c3e 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes0.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes0.cpp
@@ -5397,13 +5397,14 @@ bool Scene600::Item4::startAction(CursorType action, Event &event) {
}
void Scene600::Actor4::signal() {
- Common::Point pt(36, 177 + R2_GLOBALS._randomSource.getRandomNumber(5));
+ Common::Point pt(177 + R2_GLOBALS._randomSource.getRandomNumber(5),
+ 108 + R2_GLOBALS._randomSource.getRandomNumber(3));
NpcMover *mover = new NpcMover();
addMover(mover, &pt, this);
}
bool Scene600::Actor4::startAction(CursorType action, Event &event) {
- if ((action >= CURSOR_WALK) && (action < R2CURSORS_START))
+ if (action >= CURSOR_WALK)
// Only action cursors
return SceneActor::startAction(action, event);
@@ -5456,7 +5457,7 @@ bool Scene600::Actor5::startAction(CursorType action, Event &event) {
bool Scene600::Actor6::startAction(CursorType action, Event &event) {
Scene600 *scene = (Scene600 *)R2_GLOBALS._sceneManager._scene;
- if ((action < CURSOR_WALK) && (action >= R2CURSORS_START)) {
+ if (action < CURSOR_WALK) {
switch (action) {
case R2_COM_SCANNER:
if (R2_GLOBALS.getFlag(6)) {
@@ -5512,7 +5513,7 @@ bool Scene600::Actor6::startAction(CursorType action, Event &event) {
return false;
break;
}
- } else if (action != CURSOR_USE) {
+ } else if (action == CURSOR_USE) {
if (R2_GLOBALS.getFlag(5)) {
return SceneActor::startAction(action, event);
} else {
@@ -5706,7 +5707,7 @@ void Scene600::signal() {
R2_GLOBALS._walkRegions.enableRegion(9);
R2_GLOBALS._walkRegions.enableRegion(10);
- R2_INVENTORY.setObjectScene(12, 600);
+ R2_INVENTORY.setObjectScene(R2_AEROSOL, 600);
R2_GLOBALS.setFlag(5);
_actor4._effect = 3;
@@ -5756,7 +5757,8 @@ void Scene600::signal() {
}
void Scene600::process(Event &event) {
- if ((!R2_GLOBALS._player._canWalk) && (!R2_GLOBALS.getFlag(6)) && (event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == R2_NEGATOR_GUN)) {
+ if (R2_GLOBALS._player._canWalk && (!R2_GLOBALS.getFlag(6)) && (event.eventType == EVENT_BUTTON_DOWN)
+ && (R2_GLOBALS._events.getCursor() == CURSOR_WALK)) {
if (!_actor5.contains(event.mousePos) || (_actor5._frame <= 1)) {
if (R2_GLOBALS.getFlag(5)) {
_field412 += 10;
@@ -5913,7 +5915,7 @@ bool Scene700::Actor5::startAction(CursorType action, Event &event) {
case 0:
if ((_strip == 2) && (_frame == 1)) {
R2_GLOBALS._player.disableControl();
- if (R2_GLOBALS._player._position.x <= 100) {
+ if (R2_GLOBALS._player._position.y <= 100) {
scene->_sceneMode = 710;
scene->setAction(&scene->_sequenceManager, scene, 710, &R2_GLOBALS._player, this, NULL);
} else {
@@ -6417,8 +6419,8 @@ bool Scene800::Cabinet::startAction(CursorType action, Event &event) {
/*--------------------------------------------------------------------------*/
void Scene800::postInit(SceneObjectList *OwnerList) {
- SceneExt::postInit();
loadScene(800);
+ SceneExt::postInit();
_door.postInit();
_door.setVisage(800);
@@ -7007,8 +7009,8 @@ bool Scene850::Panel::startAction(CursorType action, Event &event) {
/*--------------------------------------------------------------------------*/
void Scene850::postInit(SceneObjectList *OwnerList) {
- SceneExt::postInit();
loadScene(850);
+ SceneExt::postInit();
_liftDoor.postInit();
_liftDoor.setup(850, 2, 1);
diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
index dd29488bea..00605b3ef6 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
@@ -883,13 +883,6 @@ void Scene1200::synchronize(Serializer &s) {
}
Scene1200::LaserPanel::LaserPanel() {
- _field20 = 0;
-}
-
-void Scene1200::LaserPanel::synchronize(Serializer &s) {
- SceneArea::synchronize(s);
-
- s.syncAsByte(_field20);
}
void Scene1200::LaserPanel::Jumper::init(int state) {
@@ -1051,53 +1044,13 @@ void Scene1200::LaserPanel::remove() {
// sub201EA
R2_GLOBALS._sceneItems.remove((SceneItem *)this);
- _actor2.remove();
+ _object1.remove();
SceneArea::remove();
R2_GLOBALS._insetUp--;
R2_GLOBALS._player._canWalk = true;
}
-void Scene1200::LaserPanel::process(Event &event) {
- if (_field20 != R2_GLOBALS._insetUp)
- return;
-
- CursorType cursor = R2_GLOBALS._events.getCursor();
-
- if (_actor2._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 Scene1200::LaserPanel::proc12(int visage, int stripFrameNum, int frameNum, int posX, int posY) {
- Scene1200 *scene = (Scene1200 *)R2_GLOBALS._sceneManager._scene;
-
- _actor2.postInit();
- _actor2.setup(visage, stripFrameNum, frameNum);
- _actor2.setPosition(Common::Point(posX, posY));
- _actor2.fixPriority(250);
- _cursorNum = CURSOR_INVALID;
- scene->_sceneAreas.push_front(this);
- ++R2_GLOBALS._insetUp;
- _field20 = R2_GLOBALS._insetUp;
-}
-
-void Scene1200::LaserPanel::proc13(int resNum, int lookLineNum, int talkLineNum, int useLineNum) {
- _actor2.setDetails(resNum, lookLineNum, talkLineNum, useLineNum, 2, (SceneItem *) NULL);
-}
-
void Scene1200::postInit(SceneObjectList *OwnerList) {
loadScene(1200);
SceneExt::postInit();
diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.h b/engines/tsage/ringworld2/ringworld2_scenes1.h
index 1b6ca768ef..a2865a4b94 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.h
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.h
@@ -120,7 +120,7 @@ public:
class Scene1200 : public SceneExt {
enum CrawlDirection { CRAWL_EAST = 1, CRAWL_WEST = 2, CRAWL_SOUTH = 3, CRAWL_NORTH = 4 };
- class LaserPanel: public SceneArea {
+ class LaserPanel: public ModalDialog {
public:
class Jumper : public SceneActorExt {
public:
@@ -128,21 +128,14 @@ class Scene1200 : public SceneExt {
virtual bool startAction(CursorType action, Event &event);
};
- SceneActor _actor2;
Jumper _jumper1;
Jumper _jumper2;
Jumper _jumper3;
- byte _field20;
-
LaserPanel();
- void synchronize(Serializer &s);
virtual void postInit(SceneObjectList *OwnerList = NULL);
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);
};
public:
diff --git a/engines/tsage/saveload.h b/engines/tsage/saveload.h
index 4126e31822..d43ef792bc 100644
--- a/engines/tsage/saveload.h
+++ b/engines/tsage/saveload.h
@@ -150,6 +150,16 @@ public:
if (i != this->end()) ++i;
this->insert(i, newItem);
}
+
+ bool contains(T item) {
+ typename SynchronizedList<T>::iterator i = this->begin();
+ for (; i != this->end(); ++i) {
+ if (*i == item)
+ return true;
+ }
+
+ return false;
+ }
};
/**
diff --git a/engines/tsage/user_interface.cpp b/engines/tsage/user_interface.cpp
index 4bd9e49875..c0ebb804d2 100644
--- a/engines/tsage/user_interface.cpp
+++ b/engines/tsage/user_interface.cpp
@@ -84,7 +84,10 @@ void UIQuestion::showDescription(CursorType cursor) {
case GType_Ringworld2:
if ((cursor == R2_COM_SCANNER) || (cursor == R2_COM_SCANNER_2)) {
// Show communicator
- warning("TODO: Communicator");
+ 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);
} else {
// Show object description
SceneItem::display2(3, (int)cursor);
@@ -399,7 +402,7 @@ void UIElements::setup(const Common::Point &pt) {
}
// Setup bottom-right hand buttons
- xp += 62;
+ xp = (g_vm->getGameID() == GType_Ringworld2) ? 255 : 253;
int yp = (g_vm->getGameID() == GType_BlueForce) ? 16 : 17;
_question.setup(1, 4, 7, xp, yp, 255);
_question.setEnabled(false);
@@ -410,7 +413,7 @@ void UIElements::setup(const Common::Point &pt) {
add(&_scrollLeft);
_scrollLeft._isLeft = true;
- xp += 22;
+ xp += (g_vm->getGameID() == GType_Ringworld2) ? 21 : 22;
_scrollRight.setup(1, 4, 4, xp, yp, 255);
add(&_scrollRight);
_scrollRight._isLeft = false;