aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2011-12-12 19:45:58 +1100
committerPaul Gilbert2011-12-12 19:45:58 +1100
commit81ba2f4733aa7250deae8ce8187a4a3c0a10214c (patch)
treeafdcc2eba7aa8ac07bc7b69296262d85dccba302
parent2ff147352c01045b7571c1d44c6ef942b1e64d98 (diff)
downloadscummvm-rg350-81ba2f4733aa7250deae8ce8187a4a3c0a10214c.tar.gz
scummvm-rg350-81ba2f4733aa7250deae8ce8187a4a3c0a10214c.tar.bz2
scummvm-rg350-81ba2f4733aa7250deae8ce8187a4a3c0a10214c.zip
TSAGE: Implemented R2R changes to StripManager::signal
-rw-r--r--engines/tsage/converse.cpp46
-rw-r--r--engines/tsage/converse.h4
2 files changed, 38 insertions, 12 deletions
diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp
index 0337774cd3..2424064dda 100644
--- a/engines/tsage/converse.cpp
+++ b/engines/tsage/converse.cpp
@@ -535,8 +535,8 @@ void Obj44::load(const byte *dataP) {
if (g_vm->getGameID() == GType_Ringworld2) {
_mode = s.readSint16LE();
- s.readSint16LE();
- _field4 = s.readSint16LE();
+ _lookupValue = s.readSint16LE();
+ _lookupIndex = s.readSint16LE();
_field6 = s.readSint16LE();
_field8 = s.readSint16LE();
}
@@ -571,7 +571,8 @@ void Obj44::synchronize(Serializer &s) {
if (g_vm->getGameID() == GType_Ringworld2) {
s.syncAsSint16LE(_mode);
- s.syncAsSint16LE(_field4);
+ s.syncAsSint16LE(_lookupValue);
+ s.syncAsSint16LE(_lookupIndex);
s.syncAsSint16LE(_field6);
s.syncAsSint16LE(_field8);
s.syncAsSint16LE(_field16);
@@ -753,11 +754,21 @@ void StripManager::signal() {
if (g_vm->getGameID() != GType_Ringworld2) {
_field2E8 = obj44._id;
} else {
- if (obj44._id)
- _field2E8 = obj44._id;
+ // Return to Ringworld specific handling
+ if (obj44._field6)
+ _field2E8 = obj44._field6;
switch (obj44._mode) {
case 1:
+ ++_lookupList[obj44._lookupIndex - 1];
+ break;
+ case 2:
+ --_lookupList[obj44._lookupIndex - 1];
+ break;
+ case 3:
+ _lookupList[obj44._lookupIndex - 1] = obj44._lookupValue;
+ break;
+ default:
break;
}
}
@@ -766,12 +777,27 @@ void StripManager::signal() {
// Build up a list of script entries
int idx;
- for (idx = 0; idx < OBJ44_LIST_SIZE; ++idx) {
- if (!obj44._list[idx]._id)
- break;
- // Get the next one
- choiceList.push_back((const char *)&_script[0] + obj44._list[idx]._scriptOffset);
+ if (g_vm->getGameID() == GType_Ringworld2 && obj44._field16) {
+ // Special loading mode used in Return to Ringworld
+ for (idx = 0; idx < OBJ44_LIST_SIZE; ++idx) {
+ int objIndex = _lookupList[obj44._field16 - 1];
+
+ if (!obj44._list[objIndex]._id)
+ break;
+
+ // Get the next one
+ choiceList.push_back((const char *)&_script[0] + obj44._list[objIndex]._scriptOffset);
+ }
+ } else {
+ // Standard choices loading
+ for (idx = 0; idx < OBJ44_LIST_SIZE; ++idx) {
+ if (!obj44._list[idx]._id)
+ break;
+
+ // Get the next one
+ choiceList.push_back((const char *)&_script[0] + obj44._list[idx]._scriptOffset);
+ }
}
int strIndex = 0;
diff --git a/engines/tsage/converse.h b/engines/tsage/converse.h
index f645e2ce5b..2a08c78b21 100644
--- a/engines/tsage/converse.h
+++ b/engines/tsage/converse.h
@@ -188,8 +188,8 @@ public:
// Return to Ringworld specific field
int _mode;
- int _field4, _field6, _field8;
- int _field16;
+ int _lookupValue, _lookupIndex, _field6;
+ int _field8, _field16;
public:
void load(const byte *dataP);
virtual void synchronize(Serializer &s);