diff options
Diffstat (limited to 'engines/tsage')
-rw-r--r-- | engines/tsage/converse.cpp | 212 | ||||
-rw-r--r-- | engines/tsage/converse.h | 71 | ||||
-rw-r--r-- | engines/tsage/module.mk | 3 | ||||
-rw-r--r-- | engines/tsage/ringworld_logic.cpp | 333 | ||||
-rw-r--r-- | engines/tsage/ringworld_logic.h | 144 | ||||
-rw-r--r-- | engines/tsage/ringworld_scenes1.cpp (renamed from engines/tsage/scene_logic.cpp) | 89 | ||||
-rw-r--r-- | engines/tsage/ringworld_scenes1.h (renamed from engines/tsage/scene_logic.h) | 38 | ||||
-rw-r--r-- | engines/tsage/scenes.cpp | 2 |
8 files changed, 484 insertions, 408 deletions
diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp index e00603bc05..823ee9da8a 100644 --- a/engines/tsage/converse.cpp +++ b/engines/tsage/converse.cpp @@ -911,81 +911,6 @@ void ScreenSpeaker::setText(const Common::String &msg) { /*--------------------------------------------------------------------------*/ -SpeakerGText::SpeakerGText() { - _speakerName = "GTEXT"; - _textWidth = 160; - _textPos = Common::Point(130, 10); - _colour1 = 42; - _hideObjects = false; -} - -void SpeakerGText::setText(const Common::String &msg) { - // Set the animation properties - _sceneObject.postInit(); - _sceneObject.setVisage(9405); - _sceneObject.setStrip2(3); - _sceneObject.setPriority2(255); - _sceneObject.changeZoom(100); - _sceneObject._frame = 1; - _sceneObject.setPosition(Common::Point(183, 71)); - _sceneObject.animate(ANIM_MODE_7, 0, NULL); - - // Set the text - Rect textRect; - _globals->gfxManager()._font.getStringBounds(msg.c_str(), textRect, _textWidth); - textRect.centre(_sceneObject._position.x, _sceneObject._position.y); - _textPos.x = textRect.left; - setText(msg); -} - -void SpeakerGText::removeText() { - _sceneObject.remove(); - removeText(); -} - -/*--------------------------------------------------------------------------*/ - -SpeakerOText::SpeakerOText(): SpeakerGText() { - _speakerName = "OTEXT"; - _textWidth = 240; - _textPos = Common::Point(130, 10); - _colour1 = 42; - _hideObjects = false; -} - -/*--------------------------------------------------------------------------*/ - -SpeakerQText::SpeakerQText(): ScreenSpeaker() { - _speakerName = "QTEXT"; - _textPos = Common::Point(160, 40); - _colour1 = 35; - _textWidth = 240; - _textMode = ALIGN_CENTRE; - _hideObjects = false; -} - -/*--------------------------------------------------------------------------*/ - -SpeakerSText::SpeakerSText(): ScreenSpeaker() { - _speakerName = "STEXT"; - _colour1 = 13; - _textWidth = 240; - _textMode = ALIGN_CENTRE; - _hideObjects = false; -} - -/*--------------------------------------------------------------------------*/ - -SpeakerMText::SpeakerMText() { - _speakerName = "MTEXT"; - _colour1 = 11; - _textWidth = 160; - _textMode = ALIGN_CENTRE; - _hideObjects = false; -} - -/*--------------------------------------------------------------------------*/ - void SpeakerAction::signal() { switch (_actionIndex++) { case 0: @@ -1014,141 +939,4 @@ void AnimatedSpeaker::removeText() { _objectList.draw(); } -/*--------------------------------------------------------------------------*/ - -SpeakerQL::SpeakerQL(): AnimatedSpeaker() { - _speakerName = "QL"; - _newSceneNumber = 2610; - _textPos = Common::Point(160, 30); - _colour1 = 35; - _textMode = ALIGN_CENTRE; -} - -void SpeakerQL::setText(const Common::String &msg) { - _object1.postInit(&_objectList); - _object1.setVisage(2612); - _object1.setStrip2(2); - _object1.setPriority2(255); - _object1.changeZoom(100); - _object1._frame = 1; - _object1.setPosition(Common::Point(128, 146)); - _object1.animate(ANIM_MODE_7, 0, NULL); - - _object2.postInit(&_objectList); - _object2.setVisage(2612); - _object2.setStrip2(1); - _object2.setPriority2(255); - _object2.changeZoom(100); - _object2._frame = 1; - _object2.setPosition(Common::Point(122, 84)); - _object2.setAction(&_speakerAction, NULL); - - Speaker::setText(msg); -} - -/*--------------------------------------------------------------------------*/ - -SpeakerSR::SpeakerSR() { - _speakerName = "SR"; - _newSceneNumber = 2811; - _textPos = Common::Point(10, 30); - _colour1 = 13; - _textMode = ALIGN_CENTRE; -} - -void SpeakerSR::setText(const Common::String &msg) { - _object1.postInit(&_objectList); - _object1.setVisage(2813); - _object1.setStrip2(2); - _object1.setPriority2(255); - _object1.changeZoom(100); - _object1._frame = 1; - _object1.setPosition(Common::Point(224, 198)); - _object1.animate(ANIM_MODE_7, 0, NULL); - - _object2.postInit(&_objectList); - _object2.setVisage(2813); - _object2.setStrip2(1); - _object2.setPriority2(255); - _object2.changeZoom(100); - _object2._frame = 1; - _object2.setPosition(Common::Point(203, 96)); - _object2.setAction(&_speakerAction, NULL); - - _object3.postInit(&_objectList); - _object3.setVisage(2813); - _object3.setStrip(3); - _object3.setPosition(Common::Point(204, 91)); - _object3.setPriority2(199); - _object3._numFrames = 3; - _object3.animate(ANIM_MODE_7, 0, NULL); - - Speaker::setText(msg); -} - -/*--------------------------------------------------------------------------*/ - -SpeakerSL::SpeakerSL() { - _speakerName = "SL"; - _newSceneNumber = 2810; - _textPos = Common::Point(140, 30); - _textWidth = 160; - _colour1 = 13; - _textMode = ALIGN_CENTRE; -} - -void SpeakerSL::setText(const Common::String &msg) { - _object1.postInit(&_objectList); - _object1.setVisage(2812); - _object1.setStrip2(2); - _object1.setPriority2(255); - _object1.changeZoom(100); - _object1._frame = 1; - _object1.setPosition(Common::Point(95, 198)); - _object1.animate(ANIM_MODE_7, 0, NULL); - - _object2.postInit(&_objectList); - _object2.setVisage(2812); - _object2.setStrip2(1); - _object2.setPriority2(255); - _object2.changeZoom(100); - _object2._frame = 1; - _object2.setPosition(Common::Point(116, 96)); - _object2.setAction(&_speakerAction, NULL); - - Speaker::setText(msg); -} - -/*--------------------------------------------------------------------------*/ - -SpeakerQR::SpeakerQR() { - _speakerName = "QR"; - _newSceneNumber = 2611; - _textPos = Common::Point(10, 30); - _colour1 = 13; - _textMode = ALIGN_CENTRE; -} - -void SpeakerQR::setText(const Common::String &msg) { - _object1.postInit(&_objectList); - _object1.setVisage(2613); - _object1.setStrip2(2); - _object1.setPriority2(255); - _object1.changeZoom(100); - _object1._frame = 1; - _object1.setPosition(Common::Point(191, 146)); - _object1.animate(ANIM_MODE_7, 0, NULL); - - _object2.postInit(&_objectList); - _object2.setVisage(2613); - _object2.setStrip2(1); - _object2.setPriority2(255); - _object2.changeZoom(100); - _object2._frame = 1; - _object2.setPosition(Common::Point(197, 84)); - _object2.setAction(&_speakerAction, NULL); - - Speaker::setText(msg); -} - } // end of namespace tSage diff --git a/engines/tsage/converse.h b/engines/tsage/converse.h index 8687913594..6159b2f782 100644 --- a/engines/tsage/converse.h +++ b/engines/tsage/converse.h @@ -112,45 +112,6 @@ public: virtual void setText(const Common::String &msg); }; -class SpeakerGText: public Speaker { -public: - SceneObject _sceneObject; -public: - SpeakerGText(); - - virtual Common::String getClassName() { return "SpeakerGText"; } - virtual void setText(const Common::String &msg); - virtual void removeText(); -}; - -class SpeakerOText: public SpeakerGText { -public: - SpeakerOText(); - - virtual Common::String getClassName() { return "SpeakerOText"; } -}; - -class SpeakerSText: public ScreenSpeaker { -public: - SpeakerSText(); - - virtual Common::String getClassName() { return "SpeakerSText"; } -}; - -class SpeakerQText: public ScreenSpeaker { -public: - SpeakerQText(); - - virtual Common::String getClassName() { return "SpeakerQText"; } -}; - -class SpeakerMText: public ScreenSpeaker { -public: - SpeakerMText(); - - virtual Common::String getClassName() { return "SpeakerMText"; } -}; - class SpeakerAction: public Action { public: virtual void signal(); @@ -168,38 +129,6 @@ public: virtual void removeText(); }; -class SpeakerQL: public AnimatedSpeaker { -public: - SpeakerQL(); - - virtual Common::String getClassName() { return "SpeakerQL"; } - virtual void setText(const Common::String &msg); -}; - -class SpeakerSR: public AnimatedSpeaker { -public: - SceneObject _object3; -public: - SpeakerSR(); - - virtual Common::String getClassName() { return "SpeakerSR"; } - void setText(const Common::String &msg); -}; - -class SpeakerSL: public AnimatedSpeaker { -public: - SpeakerSL(); - - virtual void setText(const Common::String &msg); -}; - -class SpeakerQR: public AnimatedSpeaker { -public: - SpeakerQR(); - - void setText(const Common::String &msg); -}; - class ChoiceEntry { public: Common::String _msg; diff --git a/engines/tsage/module.mk b/engines/tsage/module.mk index fc42ad932b..3126169528 100644 --- a/engines/tsage/module.mk +++ b/engines/tsage/module.mk @@ -10,8 +10,9 @@ MODULE_OBJS := \ globals.o \ graphics.o \ resources.o \ + ringworld_logic.o \ + ringworld_scenes1.o \ saveload.o \ - scene_logic.o \ scenes.o \ sound.o \ staticres.o \ diff --git a/engines/tsage/ringworld_logic.cpp b/engines/tsage/ringworld_logic.cpp new file mode 100644 index 0000000000..86d128677c --- /dev/null +++ b/engines/tsage/ringworld_logic.cpp @@ -0,0 +1,333 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL: https://scummvm-misc.svn.sourceforge.net/svnroot/scummvm-misc/trunk/engines/tsage/scene_logic.cpp $ + * $Id: scene_logic.cpp 232 2011-02-12 11:56:38Z dreammaster $ + * + */ + +#include "tsage/ringworld_logic.h" +#include "tsage/scenes.h" +#include "tsage/tsage.h" +#include "tsage/staticres.h" +#include "tsage/ringworld_scenes1.h" + +namespace tSage { + +Scene *SceneFactory::createScene(int sceneNumber) { + switch (sceneNumber) { + // Kziniti Palace (Introduction) + case 10: return new Scene10(); + // Outer Space (Introduction) + case 15: return new Scene15(); + // Cut-scenes for Ch'mee house in distance + case 20: return new Scene20(); + // Outside Ch'mee residence + case 30: return new Scene30(); + // Chmeee Home + case 40: return new Scene40(); + // By Flycycles + case 50: return new Scene50(); + // Flycycle controls + case 60: return new Scene60(); + // + case 90: return new Scene90(); + // + case 95: return new Scene95(); + // Title screen + case 1000: return new Scene1000(); + // Sunflower navigation sequence + case 6100: return new Scene6100(); + + default: + error("Unknown scene number - %d", sceneNumber); + break; + } +} + +/*--------------------------------------------------------------------------*/ + +DisplayHotspot::DisplayHotspot(int regionId, ...) { + _sceneRegionId = regionId; + + // Load up the actions + va_list va; + va_start(va, regionId); + + int param = va_arg(va, int); + while (param != LIST_END) { + _actions.push_back(param); + param = va_arg(va, int); + } + + va_end(va); +} + +bool DisplayHotspot::performAction(int action) { + for (uint i = 0; i < _actions.size(); i += 3) { + if (_actions[i] == action) { + display(_actions[i + 1], _actions[i + 2], SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + return true; + } + } + + return false; +} + +/*--------------------------------------------------------------------------*/ + +DisplayObject::DisplayObject(int firstAction, ...) { + // Load up the actions + va_list va; + va_start(va, firstAction); + + int param = firstAction; + while (param != LIST_END) { + _actions.push_back(param); + param = va_arg(va, int); + } + + va_end(va); +} + +bool DisplayObject::performAction(int action) { + for (uint i = 0; i < _actions.size(); i += 3) { + if (_actions[i] == action) { + display(_actions[i + 1], _actions[i + 2], SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + return true; + } + } + + return false; +} + +/*--------------------------------------------------------------------------*/ + +SpeakerGText::SpeakerGText() { + _speakerName = "GTEXT"; + _textWidth = 160; + _textPos = Common::Point(130, 10); + _colour1 = 42; + _hideObjects = false; +} + +void SpeakerGText::setText(const Common::String &msg) { + // Set the animation properties + _sceneObject.postInit(); + _sceneObject.setVisage(9405); + _sceneObject.setStrip2(3); + _sceneObject.setPriority2(255); + _sceneObject.changeZoom(100); + _sceneObject._frame = 1; + _sceneObject.setPosition(Common::Point(183, 71)); + _sceneObject.animate(ANIM_MODE_7, 0, NULL); + + // Set the text + Rect textRect; + _globals->gfxManager()._font.getStringBounds(msg.c_str(), textRect, _textWidth); + textRect.centre(_sceneObject._position.x, _sceneObject._position.y); + _textPos.x = textRect.left; + setText(msg); +} + +void SpeakerGText::removeText() { + _sceneObject.remove(); + removeText(); +} + +/*--------------------------------------------------------------------------*/ + +SpeakerOText::SpeakerOText(): SpeakerGText() { + _speakerName = "OTEXT"; + _textWidth = 240; + _textPos = Common::Point(130, 10); + _colour1 = 42; + _hideObjects = false; +} + +/*--------------------------------------------------------------------------*/ + +SpeakerQText::SpeakerQText(): ScreenSpeaker() { + _speakerName = "QTEXT"; + _textPos = Common::Point(160, 40); + _colour1 = 35; + _textWidth = 240; + _textMode = ALIGN_CENTRE; + _hideObjects = false; +} + +/*--------------------------------------------------------------------------*/ + +SpeakerSText::SpeakerSText(): ScreenSpeaker() { + _speakerName = "STEXT"; + _colour1 = 13; + _textWidth = 240; + _textMode = ALIGN_CENTRE; + _hideObjects = false; +} + +/*--------------------------------------------------------------------------*/ + +SpeakerMText::SpeakerMText() { + _speakerName = "MTEXT"; + _colour1 = 11; + _textWidth = 160; + _textMode = ALIGN_CENTRE; + _hideObjects = false; +} + +/*--------------------------------------------------------------------------*/ + +SpeakerQL::SpeakerQL(): AnimatedSpeaker() { + _speakerName = "QL"; + _newSceneNumber = 2610; + _textPos = Common::Point(160, 30); + _colour1 = 35; + _textMode = ALIGN_CENTRE; +} + +void SpeakerQL::setText(const Common::String &msg) { + _object1.postInit(&_objectList); + _object1.setVisage(2612); + _object1.setStrip2(2); + _object1.setPriority2(255); + _object1.changeZoom(100); + _object1._frame = 1; + _object1.setPosition(Common::Point(128, 146)); + _object1.animate(ANIM_MODE_7, 0, NULL); + + _object2.postInit(&_objectList); + _object2.setVisage(2612); + _object2.setStrip2(1); + _object2.setPriority2(255); + _object2.changeZoom(100); + _object2._frame = 1; + _object2.setPosition(Common::Point(122, 84)); + _object2.setAction(&_speakerAction, NULL); + + Speaker::setText(msg); +} + +/*--------------------------------------------------------------------------*/ + +SpeakerSR::SpeakerSR() { + _speakerName = "SR"; + _newSceneNumber = 2811; + _textPos = Common::Point(10, 30); + _colour1 = 13; + _textMode = ALIGN_CENTRE; +} + +void SpeakerSR::setText(const Common::String &msg) { + _object1.postInit(&_objectList); + _object1.setVisage(2813); + _object1.setStrip2(2); + _object1.setPriority2(255); + _object1.changeZoom(100); + _object1._frame = 1; + _object1.setPosition(Common::Point(224, 198)); + _object1.animate(ANIM_MODE_7, 0, NULL); + + _object2.postInit(&_objectList); + _object2.setVisage(2813); + _object2.setStrip2(1); + _object2.setPriority2(255); + _object2.changeZoom(100); + _object2._frame = 1; + _object2.setPosition(Common::Point(203, 96)); + _object2.setAction(&_speakerAction, NULL); + + _object3.postInit(&_objectList); + _object3.setVisage(2813); + _object3.setStrip(3); + _object3.setPosition(Common::Point(204, 91)); + _object3.setPriority2(199); + _object3._numFrames = 3; + _object3.animate(ANIM_MODE_7, 0, NULL); + + Speaker::setText(msg); +} + +/*--------------------------------------------------------------------------*/ + +SpeakerSL::SpeakerSL() { + _speakerName = "SL"; + _newSceneNumber = 2810; + _textPos = Common::Point(140, 30); + _textWidth = 160; + _colour1 = 13; + _textMode = ALIGN_CENTRE; +} + +void SpeakerSL::setText(const Common::String &msg) { + _object1.postInit(&_objectList); + _object1.setVisage(2812); + _object1.setStrip2(2); + _object1.setPriority2(255); + _object1.changeZoom(100); + _object1._frame = 1; + _object1.setPosition(Common::Point(95, 198)); + _object1.animate(ANIM_MODE_7, 0, NULL); + + _object2.postInit(&_objectList); + _object2.setVisage(2812); + _object2.setStrip2(1); + _object2.setPriority2(255); + _object2.changeZoom(100); + _object2._frame = 1; + _object2.setPosition(Common::Point(116, 96)); + _object2.setAction(&_speakerAction, NULL); + + Speaker::setText(msg); +} + +/*--------------------------------------------------------------------------*/ + +SpeakerQR::SpeakerQR() { + _speakerName = "QR"; + _newSceneNumber = 2611; + _textPos = Common::Point(10, 30); + _colour1 = 13; + _textMode = ALIGN_CENTRE; +} + +void SpeakerQR::setText(const Common::String &msg) { + _object1.postInit(&_objectList); + _object1.setVisage(2613); + _object1.setStrip2(2); + _object1.setPriority2(255); + _object1.changeZoom(100); + _object1._frame = 1; + _object1.setPosition(Common::Point(191, 146)); + _object1.animate(ANIM_MODE_7, 0, NULL); + + _object2.postInit(&_objectList); + _object2.setVisage(2613); + _object2.setStrip2(1); + _object2.setPriority2(255); + _object2.changeZoom(100); + _object2._frame = 1; + _object2.setPosition(Common::Point(197, 84)); + _object2.setAction(&_speakerAction, NULL); + + Speaker::setText(msg); +} + +} // End of namespace tSage diff --git a/engines/tsage/ringworld_logic.h b/engines/tsage/ringworld_logic.h new file mode 100644 index 0000000000..2b777e749c --- /dev/null +++ b/engines/tsage/ringworld_logic.h @@ -0,0 +1,144 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL: https://scummvm-misc.svn.sourceforge.net/svnroot/scummvm-misc/trunk/engines/tsage/scene_logic.h $ + * $Id: scene_logic.h 232 2011-02-12 11:56:38Z dreammaster $ + * + */ + +#ifndef TSAGE_RINGWORLD_LOGIC_H +#define TSAGE_RINGWORLD_LOGIC_H + +#include "common/scummsys.h" +#include "tsage/events.h" +#include "tsage/core.h" +#include "tsage/scenes.h" +#include "tsage/globals.h" + +namespace tSage { + +class SceneFactory { +public: + static Scene *createScene(int sceneNumber); +}; + +class DisplayHotspot: public SceneHotspot { +private: + Common::Array<int> _actions; + bool performAction(int action); +public: + DisplayHotspot(int regionId, ...); + + virtual void doAction(int action) { + if (!performAction(action)) + SceneHotspot::doAction(action); + } +}; + +class DisplayObject: public SceneObject { +private: + Common::Array<int> _actions; + bool performAction(int action); +public: + DisplayObject(int firstAction, ...); + + virtual void doAction(int action) { + if (!performAction(action)) + SceneHotspot::doAction(action); + } +}; + +/*--------------------------------------------------------------------------*/ +// Ringworld specific game speakers + +class SpeakerGText: public Speaker { +public: + SceneObject _sceneObject; +public: + SpeakerGText(); + + virtual Common::String getClassName() { return "SpeakerGText"; } + virtual void setText(const Common::String &msg); + virtual void removeText(); +}; + +class SpeakerOText: public SpeakerGText { +public: + SpeakerOText(); + + virtual Common::String getClassName() { return "SpeakerOText"; } +}; + +class SpeakerSText: public ScreenSpeaker { +public: + SpeakerSText(); + + virtual Common::String getClassName() { return "SpeakerSText"; } +}; + +class SpeakerQText: public ScreenSpeaker { +public: + SpeakerQText(); + + virtual Common::String getClassName() { return "SpeakerQText"; } +}; + +class SpeakerMText: public ScreenSpeaker { +public: + SpeakerMText(); + + virtual Common::String getClassName() { return "SpeakerMText"; } +}; + +class SpeakerQL: public AnimatedSpeaker { +public: + SpeakerQL(); + + virtual Common::String getClassName() { return "SpeakerQL"; } + virtual void setText(const Common::String &msg); +}; + +class SpeakerSR: public AnimatedSpeaker { +public: + SceneObject _object3; +public: + SpeakerSR(); + + virtual Common::String getClassName() { return "SpeakerSR"; } + void setText(const Common::String &msg); +}; + +class SpeakerSL: public AnimatedSpeaker { +public: + SpeakerSL(); + + virtual void setText(const Common::String &msg); +}; + +class SpeakerQR: public AnimatedSpeaker { +public: + SpeakerQR(); + + void setText(const Common::String &msg); +}; + +} // End of namespace tSage + +#endif diff --git a/engines/tsage/scene_logic.cpp b/engines/tsage/ringworld_scenes1.cpp index b5d301080e..f83c8a1d6e 100644 --- a/engines/tsage/scene_logic.cpp +++ b/engines/tsage/ringworld_scenes1.cpp @@ -23,100 +23,13 @@ * */ -#include "tsage/scene_logic.h" +#include "tsage/ringworld_scenes1.h" #include "tsage/scenes.h" #include "tsage/tsage.h" #include "tsage/staticres.h" namespace tSage { -Scene *SceneFactory::createScene(int sceneNumber) { - switch (sceneNumber) { - // Kziniti Palace (Introduction) - case 10: return new Scene10(); - // Outer Space (Introduction) - case 15: return new Scene15(); - // Cut-scenes for Ch'mee house in distance - case 20: return new Scene20(); - // Outside Ch'mee residence - case 30: return new Scene30(); - // Chmeee Home - case 40: return new Scene40(); - // By Flycycles - case 50: return new Scene50(); - // Flycycle controls - case 60: return new Scene60(); - // - case 90: return new Scene90(); - // - case 95: return new Scene95(); - // Title screen - case 1000: return new Scene1000(); - // Sunflower navigation sequence - case 6100: return new Scene6100(); - - default: - error("Unknown scene number - %d", sceneNumber); - break; - } -} - -/*--------------------------------------------------------------------------*/ - -DisplayHotspot::DisplayHotspot(int regionId, ...) { - _sceneRegionId = regionId; - - // Load up the actions - va_list va; - va_start(va, regionId); - - int param = va_arg(va, int); - while (param != LIST_END) { - _actions.push_back(param); - param = va_arg(va, int); - } - - va_end(va); -} - -bool DisplayHotspot::performAction(int action) { - for (uint i = 0; i < _actions.size(); i += 3) { - if (_actions[i] == action) { - display(_actions[i + 1], _actions[i + 2], SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); - return true; - } - } - - return false; -} - -/*--------------------------------------------------------------------------*/ - -DisplayObject::DisplayObject(int firstAction, ...) { - // Load up the actions - va_list va; - va_start(va, firstAction); - - int param = firstAction; - while (param != LIST_END) { - _actions.push_back(param); - param = va_arg(va, int); - } - - va_end(va); -} - -bool DisplayObject::performAction(int action) { - for (uint i = 0; i < _actions.size(); i += 3) { - if (_actions[i] == action) { - display(_actions[i + 1], _actions[i + 2], SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); - return true; - } - } - - return false; -} - /*-------------------------------------------------------------------------- * Scene 10 - Kziniti Palace (Introduction) * diff --git a/engines/tsage/scene_logic.h b/engines/tsage/ringworld_scenes1.h index af4d06463d..479d5946c5 100644 --- a/engines/tsage/scene_logic.h +++ b/engines/tsage/ringworld_scenes1.h @@ -23,10 +23,11 @@ * */ -#ifndef TSAGE_SCENE_LOGIC_H -#define TSAGE_SCENE_LOGIC_H +#ifndef TSAGE_RINGWORLD_SCENES1_H +#define TSAGE_RINGWORLD_SCENES1_H #include "common/scummsys.h" +#include "tsage/ringworld_logic.h" #include "tsage/events.h" #include "tsage/core.h" #include "tsage/scenes.h" @@ -34,39 +35,6 @@ namespace tSage { -class SceneFactory { -public: - static Scene *createScene(int sceneNumber); -}; - -class DisplayHotspot: public SceneHotspot { -private: - Common::Array<int> _actions; - bool performAction(int action); -public: - DisplayHotspot(int regionId, ...); - - virtual void doAction(int action) { - if (!performAction(action)) - SceneHotspot::doAction(action); - } -}; - -class DisplayObject: public SceneObject { -private: - Common::Array<int> _actions; - bool performAction(int action); -public: - DisplayObject(int firstAction, ...); - - virtual void doAction(int action) { - if (!performAction(action)) - SceneHotspot::doAction(action); - } -}; - -/*--------------------------------------------------------------------------*/ - class Scene10: public Scene { /* Actions */ class Scene10_Action1: public Action { diff --git a/engines/tsage/scenes.cpp b/engines/tsage/scenes.cpp index 4a6d7f8d8a..f9c26cfbda 100644 --- a/engines/tsage/scenes.cpp +++ b/engines/tsage/scenes.cpp @@ -25,7 +25,7 @@ #include "tsage/scenes.h" #include "tsage/globals.h" -#include "tsage/scene_logic.h" +#include "tsage/ringworld_logic.h" #include "tsage/tsage.h" namespace tSage { |