diff options
author | strangerke | 2011-04-02 18:00:58 +0200 |
---|---|---|
committer | strangerke | 2011-04-02 18:00:58 +0200 |
commit | 80f51e5768db35c4ce3b379bc240e43bf1c36532 (patch) | |
tree | 1ae158a9fa068ffca267236f46e023539624d4d5 /engines | |
parent | 65e5a51eaf8eb2d35a4d46db7a10c1d8d8a04f6d (diff) | |
download | scummvm-rg350-80f51e5768db35c4ce3b379bc240e43bf1c36532.tar.gz scummvm-rg350-80f51e5768db35c4ce3b379bc240e43bf1c36532.tar.bz2 scummvm-rg350-80f51e5768db35c4ce3b379bc240e43bf1c36532.zip |
TSAGE: Implement Scene 9360, move Scene9350::Object1 to a separated subclass, Fix bug in scene 9350
Diffstat (limited to 'engines')
-rw-r--r-- | engines/tsage/ringworld_logic.cpp | 1 | ||||
-rw-r--r-- | engines/tsage/ringworld_scenes10.cpp | 117 | ||||
-rw-r--r-- | engines/tsage/ringworld_scenes10.h | 34 |
3 files changed, 123 insertions, 29 deletions
diff --git a/engines/tsage/ringworld_logic.cpp b/engines/tsage/ringworld_logic.cpp index dd4eab820a..3900083c98 100644 --- a/engines/tsage/ringworld_logic.cpp +++ b/engines/tsage/ringworld_logic.cpp @@ -149,6 +149,7 @@ Scene *SceneFactory::createScene(int sceneNumber) { case 9200: return new Scene9200(); case 9300: return new Scene9300(); case 9350: return new Scene9350(); + case 9360: return new Scene9360(); case 9700: return new Scene9700(); case 9750: return new Scene9750(); case 9999: return new Scene9999(); diff --git a/engines/tsage/ringworld_scenes10.cpp b/engines/tsage/ringworld_scenes10.cpp index cc04edb8d8..bebf199a2d 100644 --- a/engines/tsage/ringworld_scenes10.cpp +++ b/engines/tsage/ringworld_scenes10.cpp @@ -36,6 +36,15 @@ Scene2::Scene2() { _sceneState = 0; } +void Object9350::postInit(SceneObjectList *OwnerList) { + warning("Object9350::postInit - Weird cast to be verified"); + _globals->_sceneManager.postInit((SceneObjectList*) &_globals->_sceneManager._sceneChangeListeners); +} + +void Object9350::draw() { + warning("Scene9350::Object1::draw - TODO"); +} + /*-------------------------------------------------------------------------- * Scene 9100 * @@ -527,14 +536,6 @@ void Scene9300::postInit(SceneObjectList *OwnerList) { * Scene 9350 * *--------------------------------------------------------------------------*/ -void Scene9350::Object1::postInit(SceneObjectList *OwnerList) { - warning("Scene9350::Object1::postInit - Weird cast to be verified"); - _globals->_sceneManager.postInit((SceneObjectList*) &_globals->_sceneManager._sceneChangeListeners); -} - -void Scene9350::Object1::draw() { - warning("Scene9350::Object1::draw - TODO"); -} void Scene9350::signal() { switch (_sceneState ++) { @@ -561,20 +562,18 @@ void Scene9350::signal() { void Scene9350::dispatch() { if (_action == 0) { - if ((_globals->_player._position.x <= 300) || (_globals->_player._position.y >= 160)) { - if ((_globals->_player._position.x <= 110) || (_globals->_player._position.y < 195)) { - _globals->_player.disableControl(); - _sceneState = 9355; - Scene::setAction(&_sequenceManager, this, 9355, &_globals->_player, &_object2, 0); - } else { - _globals->_player.disableControl(); - _sceneState = 9357; - Scene::setAction(&_sequenceManager, this, 9357, &_globals->_player, &_object2, 0); - } - } else { + if ((_globals->_player._position.x > 300) && (_globals->_player._position.y < 160)) { _globals->_player.disableControl(); _sceneState = 9356; - Scene::setAction(&_sequenceManager, this, 9356, &_globals->_player, &_object2, 0); + setAction(&_sequenceManager, this, 9356, &_globals->_player, &_object2, 0); + } else if ((_globals->_player._position.x > 110) && (_globals->_player._position.y >= 195)) { + _globals->_player.disableControl(); + _sceneState = 9357; + setAction(&_sequenceManager, this, 9357, &_globals->_player, &_object2, 0); + } else if ((_globals->_player._position.x < 10) || ((_globals->_player._position.x <= 110) && (_globals->_player._position.y >= 195))) { + _globals->_player.disableControl(); + _sceneState = 9355; + setAction(&_sequenceManager, this, 9355, &_globals->_player, &_object2, 0); } } else { Scene::dispatch(); @@ -620,6 +619,84 @@ void Scene9350::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- + * Scene 9360 + * + *--------------------------------------------------------------------------*/ + +void Scene9360::signal() { + switch (_sceneState ++) { + case 0: + case 9362: + case 9363: + case 9364: + _globals->_player.enableControl(); + break; + case 9365: + _globals->_sceneManager.changeScene(9350); + break; + case 9366: + _globals->_sceneManager.changeScene(9200); + break; + case 9367: + _globals->_sceneManager.changeScene(9450); + break; + default: + break; + } +} + +void Scene9360::dispatch() { + if (_action == 0) { + if ((_globals->_player._position.x > 300) && (_globals->_player._position.y < 160)) { + _globals->_player.disableControl(); + _sceneState = 9366; + setAction(&_sequenceManager, this, 9366, &_globals->_player, 0); + } else if ((_globals->_player._position.x > 110) && (_globals->_player._position.y >= 195)) { + _globals->_player.disableControl(); + _sceneState = 9367; + setAction(&_sequenceManager, this, 9367, &_globals->_player, 0); + } else if ((_globals->_player._position.x < 10) || ((_globals->_player._position.x <= 110) && (_globals->_player._position.y >= 195))) { + _globals->_player.disableControl(); + _sceneState = 9365; + setAction(&_sequenceManager, this, 9365, &_globals->_player, 0); + } + } else { + Scene::dispatch(); + } +} + +void Scene9360::postInit(SceneObjectList *OwnerList) { + Scene::postInit(); + 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); + _globals->_events.setCursor(CURSOR_WALK); + _globals->_player.disableControl(); + if (_globals->_sceneManager._previousScene == 9350) { + _globals->_player.disableControl(); + _sceneState = 9364; + setAction(&_sequenceManager, this, 9364, &_globals->_player, 0); + } else if (_globals->_sceneManager._previousScene == 9450) { + _globals->_player.disableControl(); + _sceneState = 9363; + setAction(&_sequenceManager, this, 9363, &_globals->_player, 0); + } else { + _globals->_player.disableControl(); + _sceneState = 9362; + setAction(&_sequenceManager, this, 9362, &_globals->_player, 0); + } + _object1.quickInit(9351, 1, 1, 131, 90, 0); +} + +/*-------------------------------------------------------------------------- * Scene 9700 * *--------------------------------------------------------------------------*/ diff --git a/engines/tsage/ringworld_scenes10.h b/engines/tsage/ringworld_scenes10.h index dd305f4f6f..c321d53e85 100644 --- a/engines/tsage/ringworld_scenes10.h +++ b/engines/tsage/ringworld_scenes10.h @@ -46,6 +46,12 @@ public : } }; +class Object9350: public SceneObject { +public: + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void draw(); +}; + class Scene9100: public Scene { /* Items */ class SceneHotspot1: public SceneHotspot_3 { @@ -154,16 +160,8 @@ class Scene9300: public Scene { }; class Scene9350: public Scene2 { - /* Objects */ - class Object1: public SceneObject { - public: - virtual void postInit(SceneObjectList *OwnerList = NULL); - virtual void draw(); - }; - -public: SequenceManager _sequenceManager; - Object1 _object1; + Object9350 _object1; SceneObject _object2; SceneHotspot_3 _sceneHotspot1; SceneHotspot_3 _sceneHotspot2; @@ -176,6 +174,24 @@ public: virtual void dispatch(); }; +class Scene9360: public Scene2 { + 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; + + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void signal(); + virtual void dispatch(); +}; + class Scene9700: public Scene2 { SequenceManager _sequenceManager; SceneObject _object1; |