diff options
Diffstat (limited to 'engines/tsage/ringworld2/ringworld2_speakers.cpp')
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_speakers.cpp | 118 |
1 files changed, 63 insertions, 55 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_speakers.cpp b/engines/tsage/ringworld2/ringworld2_speakers.cpp index cc60f97444..e7109829b0 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.cpp +++ b/engines/tsage/ringworld2/ringworld2_speakers.cpp @@ -1172,23 +1172,20 @@ SpeakerQuinn::SpeakerQuinn(): VisualSpeaker() { _numFrames = 0; } -void SpeakerQuinn::proc15() { +void SpeakerQuinn300::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + if (R2_GLOBALS._player._characterIndex == 3) { _object2 = &R2_GLOBALS._player; } else { - assert(R2_GLOBALS._sceneManager._sceneNumber == 500); - Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; - _object2 = &scene->_seeker; + assert(R2_GLOBALS._sceneManager._sceneNumber == 300); + Scene300 *scene = (Scene300 *)R2_GLOBALS._sceneManager._scene; + _object2 = &scene->_quinn; } _object2->hide(); - _object1.postInit(); - _object1._effect = _object2->_effect; - _object1._shade = _object2->_shade; _object1.setPosition(_object2->_position); if (_object2->_mover) @@ -1197,19 +1194,25 @@ void SpeakerQuinn::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); + } else if (v == 100) { + _numFrames = 0; + ((SceneItem *)_action)->_sceneRegionId = 0; + + _object1.setStrip(_object1._strip - 1); + _object1.setFrame(_object1.getFrameCount()); + _object1.animate(ANIM_MODE_6, this); } else { ((SceneItem *)_action)->_sceneRegionId = 0; switch (_object2->_visage) { case 10: - _object1.setup(4021, (v == 1) ? 5 : 7, 1); + _object1.setup((v - 1) / 4 + 4010, ((v - ((v - 1) / 4 * 4) - 1) % 8) * 2 + 1, 1); break; - - case 1500: - _object1.setup(4021, (v == 1) ? 1 : 3, 1); + case 302: + _object1.setup(308, (v - 1) % 8 + 1, 1); break; - - default: + case 308: + _object1.setup(308, 5, 1); break; } @@ -1217,19 +1220,23 @@ void SpeakerQuinn::proc15() { } } -void SpeakerQuinn300::proc15() { +void SpeakerQuinn500::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 3) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { _object2 = &R2_GLOBALS._player; } else { - Scene300 *scene = (Scene300 *)R2_GLOBALS._sceneManager._scene; - _object2 = &scene->_quinn; + assert(R2_GLOBALS._sceneManager._sceneNumber == 500); + Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; + _object2 = &scene->_seeker; } _object2->hide(); + _object1.postInit(); + _object1._effect = _object2->_effect; + _object1._shade = _object2->_shade; _object1.setPosition(_object2->_position); if (_object2->_mover) @@ -1238,25 +1245,19 @@ void SpeakerQuinn300::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); - } else if (v == 100) { - _numFrames = 0; - ((SceneItem *)_action)->_sceneRegionId = 0; - - _object1.setStrip(_object1._strip - 1); - _object1.setFrame(_object1.getFrameCount()); - _object1.animate(ANIM_MODE_6, this); } else { ((SceneItem *)_action)->_sceneRegionId = 0; switch (_object2->_visage) { case 10: - _object1.setup((v - 1) / 4 + 4010, ((v - ((v - 1) / 4 * 4) - 1) % 8) * 2 + 1, 1); + _object1.setup(4021, (v == 1) ? 5 : 7, 1); break; - case 302: - _object1.setup(308, (v - 1) % 8 + 1, 1); + + case 1500: + _object1.setup(4021, (v == 1) ? 1 : 3, 1); break; - case 308: - _object1.setup(308, 5, 1); + + default: break; } @@ -1274,6 +1275,7 @@ void SpeakerQuinn1100::proc15() { if (R2_GLOBALS._player._characterIndex == 1) { _object2 = &R2_GLOBALS._player; } else { + assert(R2_GLOBALS._sceneManager._sceneNumber == 1100); Scene1100 *scene = (Scene1100 *)R2_GLOBALS._sceneManager._scene; _object2 = &scene->_seeker; } @@ -1319,6 +1321,7 @@ void SpeakerQuinn2435::proc15() { if (R2_GLOBALS._player._characterIndex == 1) { _object2 = &R2_GLOBALS._player; } else { + assert(R2_GLOBALS._sceneManager._sceneNumber == 2435); Scene2435 *scene = (Scene2435 *)R2_GLOBALS._sceneManager._scene; _object2 = &scene->_actor1; } @@ -1345,6 +1348,7 @@ void SpeakerQuinn2450::proc15() { if (R2_GLOBALS._player._characterIndex == 1) { _object2 = &R2_GLOBALS._player; } else { + assert(R2_GLOBALS._sceneManager._sceneNumber == 2435); Scene2435 *scene = (Scene2435 *)R2_GLOBALS._sceneManager._scene; _object2 = &scene->_actor1; } @@ -1988,23 +1992,20 @@ SpeakerSeeker::SpeakerSeeker(): VisualSpeaker() { _numFrames = 0; } -void SpeakerSeeker::proc15() { +void SpeakerSeeker300::proc15() { int v = _speakerMode; if (!_object2) { if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { _object2 = &R2_GLOBALS._player; - } else { - assert(R2_GLOBALS._sceneManager._sceneNumber == 500); - Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; + } else {assert(R2_GLOBALS._sceneManager._sceneNumber == 300); + Scene300 *scene = (Scene300 *)R2_GLOBALS._sceneManager._scene; _object2 = &scene->_seeker; } _object2->hide(); _object1.postInit(); - - _object1._effect = _object2->_effect; - _object1._shade = _object2->_shade; + _object1.fixPriority(140); _object1.setPosition(_object2->_position); if (_object2->_mover) @@ -2013,32 +2014,37 @@ void SpeakerSeeker::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); - } else { + } else if (v == 100) { + _numFrames = 0; ((SceneItem *)_action)->_sceneRegionId = 0; - if (v == 1) - _object1.setup(4041, 3, 1); - else - _object1.setup(4041, 1, 1); - + _object1.setStrip(_object1._strip - 1); + _object1.setFrame(_object1.getFrameCount()); + _object1.animate(ANIM_MODE_6, this); + } else { + ((SceneItem *)_action)->_sceneRegionId = 0; + _object1.setup(306, v * 2 - 1, 1); _object1.animate(ANIM_MODE_5, this); } } -void SpeakerSeeker300::proc15() { +void SpeakerSeeker500::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { _object2 = &R2_GLOBALS._player; } else { - Scene300 *scene = (Scene300 *)R2_GLOBALS._sceneManager._scene; + assert(R2_GLOBALS._sceneManager._sceneNumber == 500); + Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; _object2 = &scene->_seeker; } _object2->hide(); _object1.postInit(); - _object1.fixPriority(140); + + _object1._effect = _object2->_effect; + _object1._shade = _object2->_shade; _object1.setPosition(_object2->_position); if (_object2->_mover) @@ -2047,16 +2053,14 @@ void SpeakerSeeker300::proc15() { if (v == 0) { _object1.animate(ANIM_MODE_2, NULL); - } else if (v == 100) { - _numFrames = 0; - ((SceneItem *)_action)->_sceneRegionId = 0; - - _object1.setStrip(_object1._strip - 1); - _object1.setFrame(_object1.getFrameCount()); - _object1.animate(ANIM_MODE_6, this); } else { ((SceneItem *)_action)->_sceneRegionId = 0; - _object1.setup(306, v * 2 - 1, 1); + + if (v == 1) + _object1.setup(4041, 3, 1); + else + _object1.setup(4041, 1, 1); + _object1.animate(ANIM_MODE_5, this); } } @@ -2071,6 +2075,7 @@ void SpeakerSeeker1100::proc15() { if (R2_GLOBALS._player._characterIndex == 2) { _object2 = &R2_GLOBALS._player; } else { + assert(R2_GLOBALS._sceneManager._sceneNumber == 1100); Scene1100 *scene = (Scene1100 *)R2_GLOBALS._sceneManager._scene; _object2 = &scene->_seeker; } @@ -2127,6 +2132,7 @@ void SpeakerSeeker1900::proc15() { if (R2_GLOBALS._player._characterIndex == 2) { _object2 = &R2_GLOBALS._player; } else { + assert(R2_GLOBALS._sceneManager._sceneNumber == 1900); Scene1900 *scene = (Scene1900 *)R2_GLOBALS._sceneManager._scene; _object2 = &scene->_actor1; } @@ -2157,6 +2163,7 @@ void SpeakerSeeker2435::proc15() { if (R2_GLOBALS._player._characterIndex == 2) { _object2 = &R2_GLOBALS._player; } else { + assert(R2_GLOBALS._sceneManager._sceneNumber == 2435); Scene2435 *scene = (Scene2435 *)R2_GLOBALS._sceneManager._scene; _object2 = &scene->_actor1; } @@ -2183,6 +2190,7 @@ void SpeakerSeeker2450::proc15() { if (R2_GLOBALS._player._characterIndex == 2) { _object2 = &R2_GLOBALS._player; } else { + assert(R2_GLOBALS._sceneManager._sceneNumber == 2450); Scene2450 *scene = (Scene2450 *)R2_GLOBALS._sceneManager._scene; _object2 = &scene->_actor1; } |