aboutsummaryrefslogtreecommitdiff
path: root/engines/tsage
diff options
context:
space:
mode:
authorStrangerke2011-11-23 10:52:08 +0100
committerStrangerke2011-11-23 10:52:36 +0100
commit8a2500cd64afa063557014b3d0e9490abd6c1096 (patch)
tree93cfc3dbec5b1291681e3bdfe391b35c7adc026c /engines/tsage
parent54fc8e55638c0b5c3198cb785825106a79bc4978 (diff)
downloadscummvm-rg350-8a2500cd64afa063557014b3d0e9490abd6c1096.tar.gz
scummvm-rg350-8a2500cd64afa063557014b3d0e9490abd6c1096.tar.bz2
scummvm-rg350-8a2500cd64afa063557014b3d0e9490abd6c1096.zip
TSAGE: R2R - Replace oldSceneNumber by an array, as each character has its own
Diffstat (limited to 'engines/tsage')
-rw-r--r--engines/tsage/core.cpp7
-rw-r--r--engines/tsage/core.h3
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes0.cpp14
3 files changed, 10 insertions, 14 deletions
diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp
index ff7b9e3228..b991e4677b 100644
--- a/engines/tsage/core.cpp
+++ b/engines/tsage/core.cpp
@@ -2982,13 +2982,12 @@ Player::Player(): SceneObject() {
// Return to Ringworld specific fields
_characterIndex = 0;
- _oldSceneNumber = 0;
- _fieldBC = 0;
for (int i = 0; i < MAX_CHARACTERS; ++i) {
_characterScene[i] = 0;
_characterStrip[i] = 0;
_characterFrame[i] = 0;
+ _oldCharacterScene[i] = 0;
}
}
@@ -3086,11 +3085,9 @@ void Player::synchronize(Serializer &s) {
if (g_vm->getGameID() == GType_Ringworld2) {
s.syncAsSint16LE(_characterIndex);
- s.syncAsSint16LE(_oldSceneNumber);
- s.syncAsSint16LE(_fieldBC);
-
for (int i = 0; i < MAX_CHARACTERS; ++i) {
s.syncAsSint16LE(_characterScene[i]);
+ s.syncAsSint16LE(_oldCharacterScene[i]);
s.syncAsSint16LE(_characterPos[i].x);
s.syncAsSint16LE(_characterPos[i].y);
s.syncAsSint16LE(_characterStrip[i]);
diff --git a/engines/tsage/core.h b/engines/tsage/core.h
index e4c7016f49..8a2e733549 100644
--- a/engines/tsage/core.h
+++ b/engines/tsage/core.h
@@ -631,9 +631,8 @@ public:
// Return to Ringworld specific fields
int _characterIndex;
- int _oldSceneNumber;
- int _fieldBC;
int _characterScene[MAX_CHARACTERS];
+ int _oldCharacterScene[MAX_CHARACTERS];
Common::Point _characterPos[MAX_CHARACTERS];
int _characterStrip[MAX_CHARACTERS];
int _characterFrame[MAX_CHARACTERS];
diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.cpp b/engines/tsage/ringworld2/ringworld2_scenes0.cpp
index 5db5ee011c..53f47ce43c 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes0.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes0.cpp
@@ -579,7 +579,7 @@ bool Scene125::Item4::startAction(CursorType action, Event &event) {
Scene125 *scene = (Scene125 *)R2_GLOBALS._sceneManager._scene;
switch (action) {
case CURSOR_USE:
- if (R2_INVENTORY.getObjectScene(R2_OPTO_DISK) == R2_GLOBALS._player._oldSceneNumber) {
+ if (R2_INVENTORY.getObjectScene(R2_OPTO_DISK) == R2_GLOBALS._player._oldCharacterScene[1]) {
R2_GLOBALS._player.disableControl();
scene->_sceneMode = 126;
scene->setAction(&scene->_sequenceManager, scene, 126, &scene->_object7, NULL);
@@ -621,13 +621,13 @@ void Scene125::postInit(SceneObjectList *OwnerList) {
if (R2_GLOBALS._sceneManager._previousScene != 125)
// Save the prior scene to return to when the console is turned off
- R2_GLOBALS._player._oldSceneNumber = R2_GLOBALS._sceneManager._previousScene;
+ R2_GLOBALS._player._oldCharacterScene[1] = R2_GLOBALS._sceneManager._previousScene;
R2_GLOBALS._player.postInit();
R2_GLOBALS._player.hide();
R2_GLOBALS._player.disableControl();
- if (R2_INVENTORY.getObjectScene(R2_OPTO_DISK) == R2_GLOBALS._player._oldSceneNumber) {
+ if (R2_INVENTORY.getObjectScene(R2_OPTO_DISK) == R2_GLOBALS._player._oldCharacterScene[1]) {
_object7.postInit();
_object7.setup(160, 3, 5);
_object7.setPosition(Common::Point(47, 167));
@@ -783,7 +783,7 @@ void Scene125::signal() {
}
break;
case 125:
- R2_INVENTORY.setObjectScene(R2_OPTO_DISK, R2_GLOBALS._player._oldSceneNumber);
+ R2_INVENTORY.setObjectScene(R2_OPTO_DISK, R2_GLOBALS._player._oldCharacterScene[1]);
break;
case 126:
R2_INVENTORY.setObjectScene(R2_OPTO_DISK, 1);
@@ -884,7 +884,7 @@ void Scene125::consoleAction(int id) {
_icon2.setIcon(23);
break;
case 6:
- R2_GLOBALS._sceneManager.changeScene(R2_GLOBALS._player._oldSceneNumber);
+ R2_GLOBALS._sceneManager.changeScene(R2_GLOBALS._player._oldCharacterScene[1]);
break;
case 7:
if (_consoleMode == 11)
@@ -947,7 +947,7 @@ void Scene125::consoleAction(int id) {
break;
case 13:
consoleAction(2);
- if (R2_INVENTORY.getObjectScene(R2_OPTO_DISK) != R2_GLOBALS._player._oldSceneNumber) {
+ if (R2_INVENTORY.getObjectScene(R2_OPTO_DISK) != R2_GLOBALS._player._oldCharacterScene[1]) {
SceneItem::display2(126, 17);
} else {
R2_GLOBALS._player.disableControl();
@@ -1852,7 +1852,7 @@ void Scene300::postInit(SceneObjectList *OwnerList) {
case 3:
if (R2_GLOBALS._sceneManager._previousScene == 1500) {
- R2_GLOBALS._player._fieldBC = 3150;
+ R2_GLOBALS._player._oldCharacterScene[3] = 3150;
R2_GLOBALS._player._characterScene[3] = 3150;
R2_GLOBALS._player._effect = 0;
R2_GLOBALS._player.setAction(NULL);