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);
|
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 {
|
class CInteraction : public CObject {
|
||||||
int16 _objectId1;
|
int16 _objectId1;
|
||||||
int16 _objectId2;
|
int16 _objectId2;
|
||||||
|
@ -122,7 +137,7 @@ class CInteraction : public CObject {
|
||||||
int _objectState2;
|
int _objectState2;
|
||||||
int _xOffs;
|
int _xOffs;
|
||||||
int _yOffs;
|
int _yOffs;
|
||||||
int _messageQueue;
|
MessageQueue *_messageQueue;
|
||||||
int _sceneId;
|
int _sceneId;
|
||||||
int _field_28;
|
int _field_28;
|
||||||
int _flags;
|
int _flags;
|
||||||
|
|
|
@ -237,6 +237,8 @@ bool CInteractionController::load(MfcArchive &file) {
|
||||||
bool CObList::load(MfcArchive &file) {
|
bool CObList::load(MfcArchive &file) {
|
||||||
int count = file.readCount();
|
int count = file.readCount();
|
||||||
|
|
||||||
|
debug(0, "CObList::count: %d", count);
|
||||||
|
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
CObject *t = file.parseClass();
|
CObject *t = file.parseClass();
|
||||||
t->load(file);
|
t->load(file);
|
||||||
|
@ -281,8 +283,10 @@ bool CInteraction::load(MfcArchive &file) {
|
||||||
_flags = file.readUint32LE();
|
_flags = file.readUint32LE();
|
||||||
_stringObj = file.readPascalString();
|
_stringObj = file.readPascalString();
|
||||||
|
|
||||||
// messageQueue
|
debug(0, "CInteraction::_stringObj = %s", _stringObj);
|
||||||
|
|
||||||
|
// messageQueue
|
||||||
|
_messageQueue = (MessageQueue *)file.parseClass();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,9 +29,15 @@
|
||||||
|
|
||||||
namespace Fullpipe {
|
namespace Fullpipe {
|
||||||
|
|
||||||
char *MfcArchive::readPascalString() {
|
char *MfcArchive::readPascalString(bool twoByte) {
|
||||||
char *tmp;
|
char *tmp;
|
||||||
int len = readByte();
|
int len;
|
||||||
|
|
||||||
|
if (twoByte)
|
||||||
|
len = readUint16LE();
|
||||||
|
else
|
||||||
|
len = readByte();
|
||||||
|
|
||||||
tmp = (char *)calloc(len + 1, 1);
|
tmp = (char *)calloc(len + 1, 1);
|
||||||
read(tmp, len);
|
read(tmp, len);
|
||||||
|
|
||||||
|
@ -73,17 +79,21 @@ CObject *MfcArchive::parseClass() {
|
||||||
|
|
||||||
uint obTag = readUint16LE();
|
uint obTag = readUint16LE();
|
||||||
|
|
||||||
|
debug(0, "parseClass::obTag = %d", obTag);
|
||||||
|
|
||||||
if (obTag == 0xffff) {
|
if (obTag == 0xffff) {
|
||||||
int schema = readUint16LE();
|
int schema = readUint16LE();
|
||||||
|
|
||||||
name = readPascalString();
|
debug(0, "parseClass::schema = %d", schema);
|
||||||
|
|
||||||
|
name = readPascalString(true);
|
||||||
|
|
||||||
if (!_classMap.contains(name)) {
|
if (!_classMap.contains(name)) {
|
||||||
error("Unknown class in MfcArchive: %s", name);
|
error("Unknown class in MfcArchive: <%s>", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
_objectMap[_lastIndex] = objectId = _classMap[name];
|
objectId = _classMap[name];
|
||||||
_lastIndex++;
|
_objectMap.push_back(objectId);
|
||||||
} else {
|
} else {
|
||||||
obTag &= ~0x8000;
|
obTag &= ~0x8000;
|
||||||
|
|
||||||
|
@ -94,6 +104,8 @@ CObject *MfcArchive::parseClass() {
|
||||||
objectId = _objectMap[obTag];
|
objectId = _objectMap[obTag];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
debug(0, "objectId: %d", objectId);
|
||||||
|
|
||||||
switch (objectId) {
|
switch (objectId) {
|
||||||
case kCInteraction:
|
case kCInteraction:
|
||||||
return new CInteraction();
|
return new CInteraction();
|
||||||
|
|
|
@ -41,7 +41,7 @@ class MfcArchive : public Common::File {
|
||||||
public:
|
public:
|
||||||
MfcArchive();
|
MfcArchive();
|
||||||
|
|
||||||
char *readPascalString();
|
char *readPascalString(bool twoByte = false);
|
||||||
int readCount();
|
int readCount();
|
||||||
CObject *parseClass();
|
CObject *parseClass();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue