aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe
diff options
context:
space:
mode:
authorEugene Sandulenko2013-06-09 23:51:33 +0300
committerEugene Sandulenko2013-09-06 14:48:10 +0300
commit54624966ce933e8a43fbf32dff0731b0db517e4a (patch)
tree1fb2235a062e88acfe628b491ee76b02e071339b /engines/fullpipe
parentda00b7143e08a0ed95142e4401896bd7653b04ab (diff)
downloadscummvm-rg350-54624966ce933e8a43fbf32dff0731b0db517e4a.tar.gz
scummvm-rg350-54624966ce933e8a43fbf32dff0731b0db517e4a.tar.bz2
scummvm-rg350-54624966ce933e8a43fbf32dff0731b0db517e4a.zip
FULLPIPE: Finish loading CInteractions
Diffstat (limited to 'engines/fullpipe')
-rw-r--r--engines/fullpipe/stateloader.cpp7
-rw-r--r--engines/fullpipe/utils.cpp21
2 files changed, 16 insertions, 12 deletions
diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp
index fe67bf9b7d..c2a244b40e 100644
--- a/engines/fullpipe/stateloader.cpp
+++ b/engines/fullpipe/stateloader.cpp
@@ -290,11 +290,11 @@ bool CInteraction::load(MfcArchive &file) {
_flags = file.readUint32LE();
_stringObj = file.readPascalString();
- debug(0, "CInteraction::_stringObj = %s", _stringObj);
-
// messageQueue
_messageQueue = (MessageQueue *)file.parseClass();
- _messageQueue->load(file);
+
+ if (_messageQueue)
+ _messageQueue->load(file);
return true;
}
@@ -315,7 +315,6 @@ bool MessageQueue::load(MfcArchive &file) {
_stringObj = file.readPascalString();
debug(0, "MessageQueue::count = %d", count);
- debug(0, "MessageQueue::_stringObj = %s", _stringObj);
for (int i = 0; i < count; i++) {
CObject *tmp = file.parseClass();
diff --git a/engines/fullpipe/utils.cpp b/engines/fullpipe/utils.cpp
index 6534c64269..09f00b8042 100644
--- a/engines/fullpipe/utils.cpp
+++ b/engines/fullpipe/utils.cpp
@@ -41,6 +41,8 @@ char *MfcArchive::readPascalString(bool twoByte) {
tmp = (char *)calloc(len + 1, 1);
read(tmp, len);
+ debug(0, "readPascalString: %d <%s>", len, tmp);
+
return tmp;
}
@@ -54,10 +56,11 @@ int MfcArchive::readCount() {
}
enum {
- kCInteraction = 0,
- kMessageQueue = 1,
- kExCommand = 2,
- kCObjstateCommand = 3
+ kNullObject = 0,
+ kCInteraction = 1,
+ kMessageQueue = 2,
+ kExCommand = 3,
+ kCObjstateCommand = 4
};
const struct {
@@ -88,7 +91,7 @@ MfcArchive::MfcArchive() {
_lastIndex = 1;
- _objectMap.push_back(0);
+ _objectMap.push_back(kNullObject);
}
CObject *MfcArchive::parseClass() {
@@ -116,10 +119,9 @@ CObject *MfcArchive::parseClass() {
debug(0, "tag: %d (%x)", _objectMap.size() - 1, objectId);
objectId = _classMap[name];
+ } else if ((obTag & 0x8000) == 0) {
+ objectId = _objectMap[obTag];
} else {
- if ((obTag & 0x8000) == 0) {
- error("Wrong object index format: %d at 0x%08x", obTag, pos() - 2);
- }
obTag &= ~0x8000;
@@ -145,6 +147,9 @@ CObject *MfcArchive::parseClass() {
return new ExCommand();
case kCObjstateCommand:
return new CObjstateCommand();
+ case kNullObject:
+ warning("parseClass: NULL object at 0x%08x", pos() - 2);
+ return 0;
default:
error("Unknown objectId: %d", objectId);
}