FULLPIPE: Continue parsing CInteraction
This commit is contained in:
parent
0c03278937
commit
72aeac3f36
4 changed files with 40 additions and 9 deletions
|
@ -111,6 +111,21 @@ class GameProject : public CObject {
|
|||
virtual bool load(MfcArchive &file);
|
||||
};
|
||||
|
||||
class MessageQueue : public CObject {
|
||||
int _id;
|
||||
int _flags;
|
||||
char *_stringObj;
|
||||
int16 _dataId;
|
||||
int16 _field_12;
|
||||
int _field_14;
|
||||
CPtrList _exCommands;
|
||||
int _counter;
|
||||
int _field_38;
|
||||
int _isFinished;
|
||||
int _parId;
|
||||
int _flag1;
|
||||
};
|
||||
|
||||
class CInteraction : public CObject {
|
||||
int16 _objectId1;
|
||||
int16 _objectId2;
|
||||
|
@ -122,7 +137,7 @@ class CInteraction : public CObject {
|
|||
int _objectState2;
|
||||
int _xOffs;
|
||||
int _yOffs;
|
||||
int _messageQueue;
|
||||
MessageQueue *_messageQueue;
|
||||
int _sceneId;
|
||||
int _field_28;
|
||||
int _flags;
|
||||
|
|
|
@ -237,6 +237,8 @@ bool CInteractionController::load(MfcArchive &file) {
|
|||
bool CObList::load(MfcArchive &file) {
|
||||
int count = file.readCount();
|
||||
|
||||
debug(0, "CObList::count: %d", count);
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
CObject *t = file.parseClass();
|
||||
t->load(file);
|
||||
|
@ -281,8 +283,10 @@ bool CInteraction::load(MfcArchive &file) {
|
|||
_flags = file.readUint32LE();
|
||||
_stringObj = file.readPascalString();
|
||||
|
||||
// messageQueue
|
||||
debug(0, "CInteraction::_stringObj = %s", _stringObj);
|
||||
|
||||
// messageQueue
|
||||
_messageQueue = (MessageQueue *)file.parseClass();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,9 +29,15 @@
|
|||
|
||||
namespace Fullpipe {
|
||||
|
||||
char *MfcArchive::readPascalString() {
|
||||
char *MfcArchive::readPascalString(bool twoByte) {
|
||||
char *tmp;
|
||||
int len = readByte();
|
||||
int len;
|
||||
|
||||
if (twoByte)
|
||||
len = readUint16LE();
|
||||
else
|
||||
len = readByte();
|
||||
|
||||
tmp = (char *)calloc(len + 1, 1);
|
||||
read(tmp, len);
|
||||
|
||||
|
@ -73,17 +79,21 @@ CObject *MfcArchive::parseClass() {
|
|||
|
||||
uint obTag = readUint16LE();
|
||||
|
||||
debug(0, "parseClass::obTag = %d", obTag);
|
||||
|
||||
if (obTag == 0xffff) {
|
||||
int schema = readUint16LE();
|
||||
|
||||
name = readPascalString();
|
||||
debug(0, "parseClass::schema = %d", schema);
|
||||
|
||||
name = readPascalString(true);
|
||||
|
||||
if (!_classMap.contains(name)) {
|
||||
error("Unknown class in MfcArchive: %s", name);
|
||||
error("Unknown class in MfcArchive: <%s>", name);
|
||||
}
|
||||
|
||||
_objectMap[_lastIndex] = objectId = _classMap[name];
|
||||
_lastIndex++;
|
||||
objectId = _classMap[name];
|
||||
_objectMap.push_back(objectId);
|
||||
} else {
|
||||
obTag &= ~0x8000;
|
||||
|
||||
|
@ -93,6 +103,8 @@ CObject *MfcArchive::parseClass() {
|
|||
|
||||
objectId = _objectMap[obTag];
|
||||
}
|
||||
|
||||
debug(0, "objectId: %d", objectId);
|
||||
|
||||
switch (objectId) {
|
||||
case kCInteraction:
|
||||
|
|
|
@ -41,7 +41,7 @@ class MfcArchive : public Common::File {
|
|||
public:
|
||||
MfcArchive();
|
||||
|
||||
char *readPascalString();
|
||||
char *readPascalString(bool twoByte = false);
|
||||
int readCount();
|
||||
CObject *parseClass();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue