diff options
author | Paul Gilbert | 2013-09-28 09:57:51 -0400 |
---|---|---|
committer | Paul Gilbert | 2013-09-28 09:57:51 -0400 |
commit | 68d446c919763132bcf4fb01f657557d55e71021 (patch) | |
tree | fca6b4ede58ae442e822fb35d68f28bdde40196c /engines | |
parent | ac1be668d93a2cd83d8f20ff3fb7f8541ec878d7 (diff) | |
download | scummvm-rg350-68d446c919763132bcf4fb01f657557d55e71021.tar.gz scummvm-rg350-68d446c919763132bcf4fb01f657557d55e71021.tar.bz2 scummvm-rg350-68d446c919763132bcf4fb01f657557d55e71021.zip |
TSAGE: Bugfixes and renaming for R2R title screen
Diffstat (limited to 'engines')
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_logic.cpp | 14 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_logic.h | 2 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes0.cpp | 137 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes0.h | 8 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_speakers.cpp | 82 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_speakers.h | 17 |
6 files changed, 176 insertions, 84 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 4050c62a78..22ad35017c 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -38,8 +38,6 @@ namespace TsAGE { namespace Ringworld2 { Scene *Ringworld2Game::createScene(int sceneNumber) { - warning("Switching to scene %d", sceneNumber); - switch (sceneNumber) { /* Scene group #0 */ case 50: @@ -1118,10 +1116,10 @@ void Ringworld2Game::start() { if (slot >= 0) R2_GLOBALS._sceneHandler->_loadGameSlot = slot; else { - // Switch to the first game scene + // Switch to the first title screen R2_GLOBALS._events.setCursor(CURSOR_WALK); R2_GLOBALS._uiElements._active = true; - R2_GLOBALS._sceneManager.setNewScene(100); + R2_GLOBALS._sceneManager.setNewScene(180); } g_globals->_events.showCursor(); @@ -1132,7 +1130,7 @@ void Ringworld2Game::restart() { g_globals->_soundHandler.stop(); // Change to the first game scene - g_globals->_sceneManager.changeScene(100); + g_globals->_sceneManager.changeScene(180); } void Ringworld2Game::endGame(int resNum, int lineNum) { @@ -2087,7 +2085,7 @@ void AnimationPlayer::close() { _field38 = 0; if (g_globals != NULL) - R2_GLOBALS._animationCtr = MAX(R2_GLOBALS._animationCtr, 0); + R2_GLOBALS._animationCtr = MAX(R2_GLOBALS._animationCtr - 1, 0); } void AnimationPlayer::rleDecode(const byte *pSrc, byte *pDest, int size) { @@ -2133,13 +2131,13 @@ void AnimationPlayer::getSlices() { /*--------------------------------------------------------------------------*/ AnimationPlayerExt::AnimationPlayerExt(): AnimationPlayer() { - _v = 0; + _isActive = false; _field3A = 0; } void AnimationPlayerExt::synchronize(Serializer &s) { AnimationPlayer::synchronize(s); - s.syncAsSint16LE(_v); + s.syncAsSint16LE(_isActive); } /*--------------------------------------------------------------------------*/ diff --git a/engines/tsage/ringworld2/ringworld2_logic.h b/engines/tsage/ringworld2/ringworld2_logic.h index 57a30dcc13..a9fa0cfeea 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.h +++ b/engines/tsage/ringworld2/ringworld2_logic.h @@ -441,7 +441,7 @@ public: class AnimationPlayerExt: public AnimationPlayer { public: - int _v; + bool _isActive; public: AnimationPlayerExt(); diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.cpp b/engines/tsage/ringworld2/ringworld2_scenes0.cpp index 4eefa11de9..4ca8eee5de 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes0.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes0.cpp @@ -228,6 +228,7 @@ bool Scene100::Terminal::startAction(CursorType action, Event &event) { void Scene100::postInit(SceneObjectList *OwnerList) { loadScene(100); R2_GLOBALS._scenePalette.loadPalette(0); + R2_GLOBALS._scenePalette.setEntry(255, 255, 255, 255); SceneExt::postInit(); if (R2_GLOBALS._sceneManager._previousScene != 125) @@ -1480,14 +1481,14 @@ void Scene180::Action1::signal() { case 0: case 1: case 2: - scene->_object5.setStrip((_actionIndex == 1) ? 1 : 2); - scene->_object5.setFrame(1); - scene->_object5.animate(ANIM_MODE_5, this); + scene->_shipDisplay.setStrip((_actionIndex == 1) ? 1 : 2); + scene->_shipDisplay.setFrame(1); + scene->_shipDisplay.animate(ANIM_MODE_5, this); break; case 4: - scene->_object5.setStrip(3); - scene->_object5.setFrame(1); - scene->_object5.animate(ANIM_MODE_5, this); + scene->_shipDisplay.setStrip(3); + scene->_shipDisplay.setFrame(1); + scene->_shipDisplay.animate(ANIM_MODE_5, this); _actionIndex = 0; break; } @@ -1495,7 +1496,7 @@ void Scene180::Action1::signal() { /*--------------------------------------------------------------------------*/ -Scene180::Scene180(): SceneExt(), _webbsterSpeaker(27) { +Scene180::Scene180(): SceneExt() { _field412 = 0; _frameInc = 0; _frameNumber = R2_GLOBALS._events.getFrameNumber(); @@ -1562,7 +1563,7 @@ void Scene180::signal() { _field412 = 1; R2_GLOBALS._sceneManager._hasPalette = true; _animationPlayer._paletteMode = ANIMPALMODE_NONE; - _animationPlayer._v = 1; + _animationPlayer._isActive = true; _animationPlayer._objectMode = ANIMOBJMODE_1; R2_GLOBALS._scene180Mode = 1; @@ -1605,7 +1606,7 @@ void Scene180::signal() { case 5: _animationPlayer._paletteMode = ANIMPALMODE_NONE; - _animationPlayer._v = 1; + _animationPlayer._isActive = true; _animationPlayer._objectMode = ANIMOBJMODE_1; R2_GLOBALS._scene180Mode = 2; _animationPlayer.load(2); @@ -1648,9 +1649,9 @@ void Scene180::signal() { case 11: _field412 = 1; - _object4.postInit(); - _object5.postInit(); - setAction(&_sequenceManager, this, 4000, &_object4, &_object5, NULL); + _door.postInit(); + _shipDisplay.postInit(); + setAction(&_sequenceManager, this, 4000, &_door, &_shipDisplay, NULL); break; case 12: @@ -1666,37 +1667,37 @@ void Scene180::signal() { break; case 13: - setAction(&_sequenceManager, this, 4001, &_object4, &_object5, NULL); + setAction(&_sequenceManager, this, 4001, &_door, &_shipDisplay, NULL); break; case 15: - setAction(&_sequenceManager, this, 4002, &_object4, &_object5, NULL); + setAction(&_sequenceManager, this, 4002, &_door, &_shipDisplay, NULL); break; case 17: - setAction(&_sequenceManager, this, 4003, &_object4, &_object5, NULL); + setAction(&_sequenceManager, this, 4003, &_door, &_shipDisplay, NULL); break; case 19: - setAction(&_sequenceManager, this, 4004, &_object4, &_object5, NULL); + setAction(&_sequenceManager, this, 4004, &_door, &_shipDisplay, NULL); break; case 21: - setAction(&_sequenceManager, this, 4005, &_object4, &_object5, NULL); + setAction(&_sequenceManager, this, 4005, &_door, &_shipDisplay, NULL); break; case 23: - setAction(&_sequenceManager, this, 4006, &_object4, &_object5, NULL); + setAction(&_sequenceManager, this, 4006, &_door, &_shipDisplay, NULL); break; case 25: - setAction(&_sequenceManager, this, 4007, &_object4, &_object5, NULL); + setAction(&_sequenceManager, this, 4007, &_door, &_shipDisplay, NULL); break; case 27: _field412 = 0; - _object4.remove(); - _object5.remove(); + _door.remove(); + _shipDisplay.remove(); setSceneDelay(2); break; @@ -1710,7 +1711,7 @@ void Scene180::signal() { case 29: _field412 = 1; _animationPlayer._paletteMode = ANIMPALMODE_REPLACE_PALETTE; - _animationPlayer._v = 1; + _animationPlayer._isActive = true; _animationPlayer._objectMode = ANIMOBJMODE_42; R2_GLOBALS._scene180Mode = 3; _animationPlayer.load(3); @@ -1719,12 +1720,12 @@ void Scene180::signal() { case 31: R2_GLOBALS._sound2.play(7); - _object4.postInit(); - _object4.setVisage(76); - _object4.setStrip(1); - _object4.setFrame(1); - _object4.setPosition(Common::Point(288, 143)); - _object4.fixPriority(210); + _door.postInit(); + _door.setVisage(76); + _door.setStrip(1); + _door.setFrame(1); + _door.setPosition(Common::Point(288, 143)); + _door.fixPriority(210); loadScene(75); @@ -1739,68 +1740,71 @@ void Scene180::signal() { case 32: _field412 = 1; - _object2.postInit(); - _object2.setPosition(Common::Point(161, 97)); - _object2.hide(); + _teal.postInit(); + _teal.setPosition(Common::Point(161, 97)); + _teal.hide(); - _object3.postInit(); - _object3.setPosition(Common::Point(60, 96)); - _object3.hide(); - R2_GLOBALS._scenePalette.addFader(_palette._palette, 256, 11, this); + _webbser.postInit(); + _webbser.setPosition(Common::Point(60, 96)); + _webbser.hide(); + _stripManager.start(11, this); break; case 33: - _object2.hide(); + _teal.hide(); - _object3.setup(76, 4, 1); - _object3.setFrame(_object3.getFrameCount()); + _webbser.setup(76, 4, 1); + _webbser.setFrame(_webbser.getFrameCount()); - _object5.postInit(); - _object5.setup(75, 1, 1); - _object5.setPosition(Common::Point(221, 125)); - _object5.fixPriority(210); - _object5.setAction(&_action1); - R2_GLOBALS._scenePalette.addFader(_palette._palette, 256, 12, this); + _shipDisplay.postInit(); + _shipDisplay.setup(75, 1, 1); + _shipDisplay.setPosition(Common::Point(221, 125)); + _shipDisplay.fixPriority(210); + _shipDisplay.setAction(&_action1); + _stripManager.start(12, this); break; case 34: - _object2.hide(); - _object3.hide(); + _teal.hide(); + _webbser.hide(); - _object1.postInit(); - _object1.setup(76, 2, 1); - _object1.setPosition(Common::Point(287, 135)); - _object1.fixPriority(200); + _dutyOfficer.postInit(); + _dutyOfficer.setup(76, 2, 1); + _dutyOfficer.setPosition(Common::Point(287, 135)); + _dutyOfficer.fixPriority(200); _sound1.play(19); - R2_GLOBALS._scenePalette.addFader(_palette._palette, 256, 5, this); + _door.animate(ANIM_MODE_5, this); break; case 35: - R2_GLOBALS._scenePalette.addFader(_palette._palette, 256, 13, this); + _stripManager.start(13, this); break; case 36: - _object2.remove(); + _teal.remove(); _sound1.play(19); - - R2_GLOBALS._scenePalette.addFader(_palette._palette, 256, 6, this); + _door.animate(ANIM_MODE_6, this); break; case 37: _field412 = 0; - _object1.remove(); + _dutyOfficer.remove(); _palette.loadPalette(9998); R2_GLOBALS._scenePalette.addFader(_palette._palette, 256, 8, this); break; case 38: - _object4.remove(); - _object5.setAction(NULL); - _object5.remove(); - + _door.remove(); + _shipDisplay.setAction(NULL); + _shipDisplay.remove(); + + // TODO: Figure out why end action on sounds aren't firing. For now, I'm + // simply setting up a scene delay to ensure the signal() method gets + // called again after a brief delay + setSceneDelay(10); R2_GLOBALS._sound2.fadeOut2(NULL); - R2_GLOBALS._sound1.fadeOut2(NULL); + R2_GLOBALS._sound1.fadeOut2(NULL /* this */); break; case 39: @@ -1823,7 +1827,7 @@ void Scene180::signal() { case 41: _field412 = 1; - _animationPlayer._v = 1; + _animationPlayer._isActive = true; break; case 42: @@ -1842,13 +1846,14 @@ void Scene180::signal() { break; case 45: - R2_GLOBALS._scenePalette.addFader(_animationPlayer._subData._palData, 256, 28, this); + _field412 = 1; + _stripManager.start(28, this); break; case 48: _field412 = 1; _animationPlayer._paletteMode = ANIMPALMODE_NONE; - _animationPlayer._v = 1; + _animationPlayer._isActive = true; _animationPlayer._objectMode = ANIMOBJMODE_1; R2_GLOBALS._scene180Mode = 15; _animationPlayer.load(15, NULL); @@ -1905,9 +1910,9 @@ void Scene180::dispatch() { } } - if (_animationPlayer._v) { + if (_animationPlayer._isActive) { if (_animationPlayer.isCompleted()) { - _animationPlayer._v = 0; + _animationPlayer._isActive = false; _animationPlayer.close(); _animationPlayer.remove(); diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.h b/engines/tsage/ringworld2/ringworld2_scenes0.h index df0b4d8fc6..3153b86745 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes0.h +++ b/engines/tsage/ringworld2/ringworld2_scenes0.h @@ -197,11 +197,11 @@ class Scene180: public SceneExt { private: void setSceneDelay(int v); public: - SpeakerWebbster _webbsterSpeaker; - SpeakerDutyOfficer _dutyOfficerSpeaker; - SpeakerTeal _tealSpeaker; + SpeakerWebbster180 _webbsterSpeaker; + SpeakerDutyOfficer180 _dutyOfficerSpeaker; + SpeakerTeal180 _tealSpeaker; SpeakerGameText _gameTextSpeaker; - SceneActor _object1, _object2, _object3, _object4, _object5; + SceneActor _dutyOfficer, _teal, _webbser, _door, _shipDisplay; ScenePalette _palette; SceneText _textList[20]; AnimationPlayerExt _animationPlayer; diff --git a/engines/tsage/ringworld2/ringworld2_speakers.cpp b/engines/tsage/ringworld2/ringworld2_speakers.cpp index a661d3ed44..3091086980 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.cpp +++ b/engines/tsage/ringworld2/ringworld2_speakers.cpp @@ -2638,6 +2638,41 @@ SpeakerTealMode7::SpeakerTealMode7(): SpeakerTeal() { _displayMode = 7; } +void SpeakerTeal180::proc15() { + int v = _speakerMode; + + if (!_object2) { + Scene180 *scene = (Scene180 *)R2_GLOBALS._sceneManager._scene; + _object2 = &scene->_teal; + _object2->hide(); + + _object1.postInit(); + _object1.setPosition(_object2->_position); + + if (_object2->_mover) + _object2->addMover(NULL); + } + + switch (v) { + case 0: + _object1.animate(ANIM_MODE_2, NULL); + break; + case 1: + ((SceneItem *)_action)->_sceneRegionId = 0; + _object1.setup(75, 5, 1); + _object1.animate(ANIM_MODE_5, this); + break; + case 2: + ((SceneItem *)_action)->_sceneRegionId = 0; + _object1.setup(77, 1, 1); + _object1.animate(ANIM_MODE_5, this); + break; + default: + signal(); + break; + } +} + void SpeakerTeal300::proc15() { int v = _speakerMode; @@ -2890,6 +2925,47 @@ SpeakerWebbster::SpeakerWebbster(int color) { _numFrames = 0; } +void SpeakerWebbster180::proc15() { + Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; + + int v = _speakerMode; + + if (!_object2) { + _object2 = &scene->_webbster; + _object2->hide(); + _object1.postInit(); + _object1.setPosition(_object2->_position); + _object1._numFrames = 6; + + if (_object2->_mover) + _object2->addMover(NULL); + } + + switch (v) { + case 0: + _object1.animate(ANIM_MODE_2, NULL); + break; + case 1: + ((SceneItem *)_action)->_sceneRegionId = 0; + _object1.setup(75, 7, 1); + _object1.animate(ANIM_MODE_5, this); + break; + case 2: + ((SceneItem *)_action)->_sceneRegionId = 0; + _object1.setup(76, 4, 1); + _object1.animate(ANIM_MODE_5, this); + break; + case 3: + ((SceneItem *)_action)->_sceneRegionId = 0; + _object1.setup(75, 6, 1); + _object1.animate(ANIM_MODE_5, this); + break; + default: + signal(); + break; + } +} + void SpeakerWebbster3240::proc15() { int v = _speakerMode; Scene3240 *scene = (Scene3240 *)R2_GLOBALS._sceneManager._scene; @@ -3092,7 +3168,7 @@ void SpeakerWebbster3400::proc15() { //---------------------------------------------------------------------------- -SpeakerDutyOfficer::SpeakerDutyOfficer(): VisualSpeaker() { +SpeakerDutyOfficer180::SpeakerDutyOfficer180(): VisualSpeaker() { _speakerName = "DUTYOFFICER"; _color1 = 5; _color2 = 0; @@ -3104,13 +3180,13 @@ SpeakerDutyOfficer::SpeakerDutyOfficer(): VisualSpeaker() { _numFrames = 0; } -void SpeakerDutyOfficer::proc15() { +void SpeakerDutyOfficer180::proc15() { Scene180 *scene = (Scene180 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; if (!_object2) { - _object2 = &scene->_object2; + _object2 = &scene->_dutyOfficer; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); diff --git a/engines/tsage/ringworld2/ringworld2_speakers.h b/engines/tsage/ringworld2/ringworld2_speakers.h index 4dfb500f2d..1b87606381 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.h +++ b/engines/tsage/ringworld2/ringworld2_speakers.h @@ -547,6 +547,12 @@ public: virtual Common::String getClassName() { return "SpeakerTealMode7"; } }; +class SpeakerTeal180 : public SpeakerTeal { +public: + virtual Common::String getClassName() { return "SpeakerTeal180"; } + virtual void proc15(); +}; + class SpeakerTeal300 : public SpeakerTeal { public: virtual Common::String getClassName() { return "SpeakerTeal300"; } @@ -595,6 +601,13 @@ public: virtual Common::String getClassName() { return "SpeakerWebbster"; } }; +class SpeakerWebbster180 : public SpeakerWebbster { +public: + SpeakerWebbster180() : SpeakerWebbster(27) {} + virtual Common::String getClassName() { return "SpeakerWebbster180"; } + virtual void proc15(); +}; + class SpeakerWebbster2500 : public SpeakerWebbster { public: SpeakerWebbster2500() : SpeakerWebbster(27) {} @@ -641,9 +654,9 @@ public: virtual void proc15(); }; -class SpeakerDutyOfficer: public VisualSpeaker { +class SpeakerDutyOfficer180: public VisualSpeaker { public: - SpeakerDutyOfficer(); + SpeakerDutyOfficer180(); virtual Common::String getClassName() { return "SpeakerDutyOfficer"; } virtual void proc15(); |