aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2013-08-24 11:19:30 -0400
committerPaul Gilbert2013-08-24 11:19:30 -0400
commit23d64724a9f342e6341bf11655217fa544a7e099 (patch)
treee8bd84b492272bf358706b9d816183950d3dde18
parentbfd7d71c5ebd8c1948be64411f0eb5bf7c383ffe (diff)
downloadscummvm-rg350-23d64724a9f342e6341bf11655217fa544a7e099.tar.gz
scummvm-rg350-23d64724a9f342e6341bf11655217fa544a7e099.tar.bz2
scummvm-rg350-23d64724a9f342e6341bf11655217fa544a7e099.zip
TSAGE: Corrected usage of quinn and speaker classes across scenes
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes0.h4
-rw-r--r--engines/tsage/ringworld2/ringworld2_speakers.cpp118
-rw-r--r--engines/tsage/ringworld2/ringworld2_speakers.h14
3 files changed, 77 insertions, 59 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.h b/engines/tsage/ringworld2/ringworld2_scenes0.h
index 6cf561021b..fa2046364c 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes0.h
+++ b/engines/tsage/ringworld2/ringworld2_scenes0.h
@@ -598,8 +598,8 @@ class Scene500: public SceneExt {
public:
int _stripNumber;
byte _buffer[2710];
- SpeakerSeeker _seekerSpeaker;
- SpeakerQuinn _quinnSpeaker;
+ SpeakerSeeker500 _seekerSpeaker;
+ SpeakerQuinn500 _quinnSpeaker;
SceneHotspot _background, _item2;
ControlPanel _controlPanel;
SceneActor _object1;
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;
}
diff --git a/engines/tsage/ringworld2/ringworld2_speakers.h b/engines/tsage/ringworld2/ringworld2_speakers.h
index e0618fb4fc..4dfb500f2d 100644
--- a/engines/tsage/ringworld2/ringworld2_speakers.h
+++ b/engines/tsage/ringworld2/ringworld2_speakers.h
@@ -274,7 +274,6 @@ class SpeakerQuinn : public VisualSpeaker {
public:
SpeakerQuinn();
virtual Common::String getClassName() { return "SpeakerQuinn"; }
- virtual void proc15();
};
class SpeakerQuinn300 : public SpeakerQuinn {
@@ -283,6 +282,12 @@ public:
virtual void proc15();
};
+class SpeakerQuinn500 : public SpeakerQuinn {
+public:
+ virtual Common::String getClassName() { return "SpeakerQuinn500"; }
+ virtual void proc15();
+};
+
class SpeakerQuinn1100 : public SpeakerQuinn {
public:
virtual Common::String getClassName() { return "SpeakerQuinn1100"; }
@@ -413,7 +418,6 @@ class SpeakerSeeker : public VisualSpeaker {
public:
SpeakerSeeker();
virtual Common::String getClassName() { return "SpeakerSeeker"; }
- virtual void proc15();
};
class SpeakerSeeker300 : public SpeakerSeeker {
@@ -422,6 +426,12 @@ public:
virtual void proc15();
};
+class SpeakerSeeker500 : public SpeakerSeeker {
+public:
+ virtual Common::String getClassName() { return "SpeakerSeeker500"; }
+ virtual void proc15();
+};
+
class SpeakerSeeker1100 : public SpeakerSeeker {
public:
virtual Common::String getClassName() { return "SpeakerSeeker1100"; }