aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2011-12-11 17:41:44 +1100
committerPaul Gilbert2011-12-11 17:41:44 +1100
commitd315521c67df814e88c28cbb2914f1b075349fa0 (patch)
tree6a2bc06af7fb2750db76ca30ec52a576cb1631ff
parentd14e75cdc7507c041f4fcb5a588107ddc3fb7c53 (diff)
downloadscummvm-rg350-d315521c67df814e88c28cbb2914f1b075349fa0.tar.gz
scummvm-rg350-d315521c67df814e88c28cbb2914f1b075349fa0.tar.bz2
scummvm-rg350-d315521c67df814e88c28cbb2914f1b075349fa0.zip
TSAGE: Added loading of conversation data that will be needed for R2R
-rw-r--r--engines/tsage/converse.cpp44
-rw-r--r--engines/tsage/converse.h4
2 files changed, 36 insertions, 12 deletions
diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp
index b98f6f609d..0337774cd3 100644
--- a/engines/tsage/converse.cpp
+++ b/engines/tsage/converse.cpp
@@ -531,29 +531,51 @@ void ConversationChoiceDialog::draw() {
/*--------------------------------------------------------------------------*/
void Obj44::load(const byte *dataP) {
- _id = READ_LE_UINT16(dataP);
+ Common::MemoryReadStream s(dataP, (g_vm->getGameID() == GType_Ringworld2) ? 126 : 68);
+
+ if (g_vm->getGameID() == GType_Ringworld2) {
+ _mode = s.readSint16LE();
+ s.readSint16LE();
+ _field4 = s.readSint16LE();
+ _field6 = s.readSint16LE();
+ _field8 = s.readSint16LE();
+ }
+
+ _id = s.readSint16LE();
for (int idx = 0; idx < OBJ44_LIST_SIZE; ++idx)
- _field2[idx] = READ_LE_UINT16(dataP + 2 + idx * 2);
+ _callbackId[idx] = s.readSint16LE();
+
+ if (g_vm->getGameID() == GType_Ringworld2) {
+ _field16 = s.readSint16LE();
+ s.skip(20);
+ } else {
+ s.skip(4);
+ }
- const byte *listP = dataP + 0x10;
- for (int idx = 0; idx < OBJ44_LIST_SIZE; ++idx, listP += 10) {
- _list[idx]._id = READ_LE_UINT16(listP);
- _list[idx]._scriptOffset = READ_LE_UINT16(listP + 2);
+ for (int idx = 0; idx < OBJ44_LIST_SIZE; ++idx) {
+ _list[idx]._id = s.readSint16LE();
+ _list[idx]._scriptOffset = s.readSint16LE();
+ s.skip(6);
}
- _speakerOffset = READ_LE_UINT16(dataP + 0x42);
+ _speakerOffset = s.readSint16LE();
}
void Obj44::synchronize(Serializer &s) {
s.syncAsSint32LE(_id);
for (int idx = 0; idx < OBJ44_LIST_SIZE; ++idx)
- s.syncAsSint32LE(_field2[idx]);
+ s.syncAsSint32LE(_callbackId[idx]);
for (int idx = 0; idx < OBJ44_LIST_SIZE; ++idx)
_list[idx].synchronize(s);
s.syncAsUint32LE(_speakerOffset);
- if (g_vm->getGameID() == GType_Ringworld2)
+ if (g_vm->getGameID() == GType_Ringworld2) {
s.syncAsSint16LE(_mode);
+ s.syncAsSint16LE(_field4);
+ s.syncAsSint16LE(_field6);
+ s.syncAsSint16LE(_field8);
+ s.syncAsSint16LE(_field16);
+ }
}
/*--------------------------------------------------------------------------*/
@@ -779,10 +801,10 @@ void StripManager::signal() {
if (_callbackObject) {
for (idx = 0; idx < OBJ44_LIST_SIZE; ++idx) {
- if (!obj44._field2[idx])
+ if (!obj44._callbackId[idx])
break;
- _callbackObject->stripCallback(obj44._field2[idx]);
+ _callbackObject->stripCallback(obj44._callbackId[idx]);
}
}
diff --git a/engines/tsage/converse.h b/engines/tsage/converse.h
index db05913e08..f645e2ce5b 100644
--- a/engines/tsage/converse.h
+++ b/engines/tsage/converse.h
@@ -182,12 +182,14 @@ public:
class Obj44 : public Serialisable {
public:
int _id;
- int _field2[OBJ44_LIST_SIZE];
+ int _callbackId[OBJ44_LIST_SIZE];
Obj0A _list[OBJ44_LIST_SIZE];
uint _speakerOffset;
// Return to Ringworld specific field
int _mode;
+ int _field4, _field6, _field8;
+ int _field16;
public:
void load(const byte *dataP);
virtual void synchronize(Serializer &s);