diff options
-rw-r--r-- | engines/tsage/ringworld_scenes3.cpp | 93 | ||||
-rw-r--r-- | engines/tsage/ringworld_scenes3.h | 26 |
2 files changed, 117 insertions, 2 deletions
diff --git a/engines/tsage/ringworld_scenes3.cpp b/engines/tsage/ringworld_scenes3.cpp index ddc0fb4b44..b115015336 100644 --- a/engines/tsage/ringworld_scenes3.cpp +++ b/engines/tsage/ringworld_scenes3.cpp @@ -485,6 +485,7 @@ void Scene2000::stripCallback(int v) { *--------------------------------------------------------------------------*/ void Scene2100::Action1::signal() { + } void Scene2100::Action2::signal() { @@ -561,6 +562,57 @@ void Scene2100::Object1::doAction(int action) { /*--------------------------------------------------------------------------*/ +Scene2100::SceneArea::SceneArea() { + _savedArea = NULL; + _pt.x = _pt.y = 0; +} + +Scene2100::SceneArea::~SceneArea() { + delete _savedArea; +} + +void Scene2100::SceneArea::setup(int resNum, int rlbNum, int subNum, int actionId) { + _resNum = resNum; + _rlbNum = rlbNum; + _subNum = subNum; + _actionId = actionId; + _field20 = 0; + + _surface = surfaceFromRes(resNum, rlbNum, subNum); +} + +void Scene2100::SceneArea::draw() { + _surface.draw(Common::Point(_bounds.left, _bounds.top)); +} + +void Scene2100::SceneArea::display() { + _bounds.left = _pt.x - (_surface.getBounds().width() / 2); + _bounds.top = _pt.y + 1 - _surface.getBounds().height(); + _bounds.setWidth(_surface.getBounds().width()); + _bounds.setHeight(_surface.getBounds().height()); + + _savedArea = Surface_getArea(_globals->_gfxManagerInstance.getSurface(), _bounds); + draw(); +} + +void Scene2100::SceneArea::draw2(bool flag) { + _surface = surfaceFromRes(_resNum, _rlbNum, flag ? _subNum + 1 : _subNum); + _surface.draw(Common::Point(_bounds.left, _bounds.top)); +} + +void Scene2100::SceneArea::synchronise(Serialiser &s) { + s.syncAsSint16LE(_pt.x); + s.syncAsSint16LE(_pt.y); + s.syncAsSint32LE(_resNum); + s.syncAsSint32LE(_rlbNum); + s.syncAsSint32LE(_subNum); + s.syncAsSint32LE(_actionId); + _bounds.synchronise(s); + s.syncAsSint32LE(_field20); +} + +/*--------------------------------------------------------------------------*/ + Scene2100::Scene2100(): _hotspot1(0, 2100, 2, LIST_END) { } @@ -686,7 +738,14 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { &_hotspot5, &_object7, &_object8, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6, &_hotspot1, NULL); - // TODO: Load visages + _area1.setup(2153, 2, 1, 2100); + _area1._pt = Common::Point(200, 31); + _area2.setup(2153, 3, 1, 2150); + _area2._pt = Common::Point(200, 50); + _area3.setup(2153, 4, 1, 2320); + _area3._pt = Common::Point(200, 75); + _area4.setup(2153, 1, 1, OBJECT_TRANSLATOR); + _area4._pt = Common::Point(237, 77); _globals->_player.postInit(); _globals->_player.setVisage(_globals->getFlag(13) ? 2170 : 0); @@ -923,4 +982,36 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; } +void Scene2100::signal() { + switch (_sceneMode) { + case 2101: + _field1800 = 1; + _globals->_player._uiEnabled = true; + _globals->_events.setCursor(CURSOR_USE); + break; + case 2102: + _field1800 = 0; + _globals->_player.enableControl(); + break; + case 2103: + _globals->_stripNum = 9000; + _globals->_sceneManager.changeScene(4000); + break; + case 2106: + _globals->_sceneManager.changeScene(7000); + break; + case 2107: + _globals->_sceneManager.changeScene(5000); + break; + case 2104: + case 2105: + case 2108: + case 2110: + case 2111: + case 2112: + _globals->_player.enableControl(); + break; + } +} + } // End of namespace tSage diff --git a/engines/tsage/ringworld_scenes3.h b/engines/tsage/ringworld_scenes3.h index 8920b24845..bdafd972e3 100644 --- a/engines/tsage/ringworld_scenes3.h +++ b/engines/tsage/ringworld_scenes3.h @@ -197,12 +197,34 @@ class Scene2100: public Scene { }; /* Hotspots */ - class Hotspot2: public SceneHotspot { public: virtual void doAction(int action); }; + /* Custom classes */ + class SceneArea: public SavedObject { + public: + GfxSurface _surface; + GfxSurface *_savedArea; + Common::Point _pt; + int _resNum; + int _rlbNum; + int _subNum; + int _actionId; + Rect _bounds; + int _field20; + public: + SceneArea(); + ~SceneArea(); + + void setup(int resNum, int rlbNum, int subNum, int actionId); + void draw(); + void display(); + void draw2(bool flag); + + virtual void synchronise(Serialiser &s); + }; public: SequenceManager _sequenceManager; SoundHandler _soundHandler; @@ -241,9 +263,11 @@ public: Action16 _action16; Action17 _action17; int _field1800; + SceneArea _area1, _area2, _area3, _area4; Scene2100(); virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void signal(); }; } // End of namespace tSage |