FULLPIPE: Make _exCommands private
This commit is contained in:
parent
185cf9ea3c
commit
edbf2d49fb
6 changed files with 27 additions and 19 deletions
|
@ -209,7 +209,7 @@ bool GameLoader::gotoScene(int sceneId, int entranceId) {
|
||||||
ex->_messageNum = 0;
|
ex->_messageNum = 0;
|
||||||
ex->_excFlags |= 3;
|
ex->_excFlags |= 3;
|
||||||
|
|
||||||
mq->_exCommands.push_back(ex);
|
mq->addExCommandToEnd(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
mq->setFlags(mq->getFlags() | 1);
|
mq->setFlags(mq->getFlags() | 1);
|
||||||
|
|
|
@ -186,7 +186,7 @@ bool InteractionController::handleInteraction(StaticANIObject *subj, GameObject
|
||||||
ex->_excFlags = 3;
|
ex->_excFlags = 3;
|
||||||
ex->_field_14 = (obj->_objtype != kObjTypePictureObject);
|
ex->_field_14 = (obj->_objtype != kObjTypePictureObject);
|
||||||
ex->_field_20 = invId;
|
ex->_field_20 = invId;
|
||||||
mq->_exCommands.push_back(ex);
|
mq->addExCommandToEnd(ex);
|
||||||
|
|
||||||
if (mq->_isFinished) {
|
if (mq->_isFinished) {
|
||||||
mq->_isFinished = 0;
|
mq->_isFinished = 0;
|
||||||
|
@ -255,7 +255,7 @@ LABEL_38:
|
||||||
ex->_field_14 = 0x100;
|
ex->_field_14 = 0x100;
|
||||||
ex->_messageNum = 0;
|
ex->_messageNum = 0;
|
||||||
ex->_excFlags = 3;
|
ex->_excFlags = 3;
|
||||||
mq->_exCommands.push_back(ex);
|
mq->addExCommandToEnd(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
ex = new ExCommand(obj->_id, 34, 0x100, 0, 0, 0, 1, 0, 0, 0);
|
ex = new ExCommand(obj->_id, 34, 0x100, 0, 0, 0, 1, 0, 0, 0);
|
||||||
|
@ -263,19 +263,19 @@ LABEL_38:
|
||||||
ex->_field_14 = 0x100;
|
ex->_field_14 = 0x100;
|
||||||
ex->_messageNum = 0;
|
ex->_messageNum = 0;
|
||||||
ex->_excFlags = 3;
|
ex->_excFlags = 3;
|
||||||
mq->_exCommands.push_back(ex);
|
mq->addExCommandToEnd(ex);
|
||||||
|
|
||||||
ex = new ExCommand(subj->_id, 34, 0x100, 0, 0, 0, 1, 0, 0, 0);
|
ex = new ExCommand(subj->_id, 34, 0x100, 0, 0, 0, 1, 0, 0, 0);
|
||||||
ex->_keyCode = subj->_okeyCode;
|
ex->_keyCode = subj->_okeyCode;
|
||||||
ex->_field_14 = 0x100;
|
ex->_field_14 = 0x100;
|
||||||
ex->_messageNum = 0;
|
ex->_messageNum = 0;
|
||||||
ex->_excFlags = 3;
|
ex->_excFlags = 3;
|
||||||
mq->_exCommands.push_back(ex);
|
mq->addExCommandToEnd(ex);
|
||||||
|
|
||||||
ex = new ExCommand(subj->_id, 17, 0x40, 0, 0, 0, 1, 0, 0, 0);
|
ex = new ExCommand(subj->_id, 17, 0x40, 0, 0, 0, 1, 0, 0, 0);
|
||||||
ex->_excFlags |= 3;
|
ex->_excFlags |= 3;
|
||||||
ex->_keyCode = 0;
|
ex->_keyCode = 0;
|
||||||
mq->_exCommands.push_back(ex);
|
mq->addExCommandToEnd(ex);
|
||||||
|
|
||||||
if (!mq->chain(subj)) {
|
if (!mq->chain(subj)) {
|
||||||
delete mq;
|
delete mq;
|
||||||
|
@ -317,7 +317,7 @@ LABEL_38:
|
||||||
ex->_excFlags = 3;
|
ex->_excFlags = 3;
|
||||||
ex->_field_20 = invId;
|
ex->_field_20 = invId;
|
||||||
ex->_field_14 = (obj->_objtype != kObjTypePictureObject);
|
ex->_field_14 = (obj->_objtype != kObjTypePictureObject);
|
||||||
mq->_exCommands.push_back(ex);
|
mq->addExCommandToEnd(ex);
|
||||||
|
|
||||||
someFlag = true;
|
someFlag = true;
|
||||||
|
|
||||||
|
@ -357,14 +357,14 @@ LABEL_38:
|
||||||
ex->_field_14 = 0x80;
|
ex->_field_14 = 0x80;
|
||||||
ex->_keyCode = ani->_okeyCode;
|
ex->_keyCode = ani->_okeyCode;
|
||||||
ex->_excFlags = 3;
|
ex->_excFlags = 3;
|
||||||
mq->_exCommands.push_back(ex);
|
mq->addExCommandToEnd(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ex = new ExCommand(ani->_id, 34, 0x100, 0, 0, 0, 1, 0, 0, 0);
|
ex = new ExCommand(ani->_id, 34, 0x100, 0, 0, 0, 1, 0, 0, 0);
|
||||||
ex->_keyCode = ani->_okeyCode;
|
ex->_keyCode = ani->_okeyCode;
|
||||||
ex->_field_14 = 0x100;
|
ex->_field_14 = 0x100;
|
||||||
ex->_excFlags = 3;
|
ex->_excFlags = 3;
|
||||||
mq->_exCommands.push_back(ex);
|
mq->addExCommandToEnd(ex);
|
||||||
} else {
|
} else {
|
||||||
ex = new ExCommand(subj->_id, 55, 0, 0, 0, 0, 1, 0, 0, 0);
|
ex = new ExCommand(subj->_id, 55, 0, 0, 0, 0, 1, 0, 0, 0);
|
||||||
ex->_x = ani->_id;
|
ex->_x = ani->_id;
|
||||||
|
@ -373,7 +373,7 @@ LABEL_38:
|
||||||
ex->_excFlags = 2;
|
ex->_excFlags = 2;
|
||||||
ex->_field_14 = (obj->_objtype != kObjTypePictureObject);
|
ex->_field_14 = (obj->_objtype != kObjTypePictureObject);
|
||||||
ex->_field_20 = invId;
|
ex->_field_20 = invId;
|
||||||
mq->_exCommands.push_back(ex);
|
mq->addExCommandToEnd(ex);
|
||||||
|
|
||||||
if (!mq->_isFinished)
|
if (!mq->_isFinished)
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -326,6 +326,10 @@ void MessageQueue::addExCommand(ExCommand *ex) {
|
||||||
_exCommands.push_front(ex);
|
_exCommands.push_front(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MessageQueue::addExCommandToEnd(ExCommand *ex) {
|
||||||
|
_exCommands.push_back(ex);
|
||||||
|
}
|
||||||
|
|
||||||
ExCommand *MessageQueue::getExCommandByIndex(uint idx) {
|
ExCommand *MessageQueue::getExCommandByIndex(uint idx) {
|
||||||
if (idx > _exCommands.size())
|
if (idx > _exCommands.size())
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -492,7 +496,7 @@ int MessageQueue::calcDuration(StaticANIObject *obj) {
|
||||||
ExCommand *ex;
|
ExCommand *ex;
|
||||||
Movement *mov;
|
Movement *mov;
|
||||||
|
|
||||||
for (uint i = 0; (ex = getExCommandByIndex(i)); i++)
|
for (uint i = 0; (ex = getExCommandByIndex(i)); i++) {
|
||||||
if (ex->_parentId == obj->_id) {
|
if (ex->_parentId == obj->_id) {
|
||||||
if (ex->_messageKind == 1 || ex->_messageKind == 20) {
|
if (ex->_messageKind == 1 || ex->_messageKind == 20) {
|
||||||
if ((mov = obj->getMovementById(ex->_messageNum)) != 0) {
|
if ((mov = obj->getMovementById(ex->_messageNum)) != 0) {
|
||||||
|
@ -503,6 +507,7 @@ int MessageQueue::calcDuration(StaticANIObject *obj) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,13 +100,15 @@ class MessageQueue : public CObject {
|
||||||
char *_queueName;
|
char *_queueName;
|
||||||
int16 _dataId;
|
int16 _dataId;
|
||||||
CObject *_field_14;
|
CObject *_field_14;
|
||||||
Common::List<ExCommand *> _exCommands;
|
|
||||||
int _counter;
|
int _counter;
|
||||||
int _field_38;
|
int _field_38;
|
||||||
int _isFinished;
|
int _isFinished;
|
||||||
int _parId;
|
int _parId;
|
||||||
int _flag1;
|
int _flag1;
|
||||||
|
|
||||||
|
private:
|
||||||
|
Common::List<ExCommand *> _exCommands;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MessageQueue();
|
MessageQueue();
|
||||||
MessageQueue(int dataId);
|
MessageQueue(int dataId);
|
||||||
|
@ -121,6 +123,7 @@ class MessageQueue : public CObject {
|
||||||
uint getCount() { return _exCommands.size(); }
|
uint getCount() { return _exCommands.size(); }
|
||||||
|
|
||||||
void addExCommand(ExCommand *ex);
|
void addExCommand(ExCommand *ex);
|
||||||
|
void addExCommandToEnd(ExCommand *ex);
|
||||||
ExCommand *getExCommandByIndex(uint idx);
|
ExCommand *getExCommandByIndex(uint idx);
|
||||||
void deleteExCommandByIndex(uint idx, bool doFree);
|
void deleteExCommandByIndex(uint idx, bool doFree);
|
||||||
|
|
||||||
|
|
|
@ -170,7 +170,7 @@ MessageQueue *MctlCompound::doWalkTo(StaticANIObject *subj, int xpos, int ypos,
|
||||||
for (uint i = 0; i < closestP->_messageQueueObj->getCount(); i++) {
|
for (uint i = 0; i < closestP->_messageQueueObj->getCount(); i++) {
|
||||||
ex = new ExCommand(closestP->_messageQueueObj->getExCommandByIndex(i));
|
ex = new ExCommand(closestP->_messageQueueObj->getExCommandByIndex(i));
|
||||||
ex->_excFlags |= 2;
|
ex->_excFlags |= 2;
|
||||||
mq->_exCommands.push_back(ex);
|
mq->addExCommandToEnd(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
ex = new ExCommand(subj->_id, 51, 0, xpos, ypos, 0, 1, 0, 0, 0);
|
ex = new ExCommand(subj->_id, 51, 0, xpos, ypos, 0, 1, 0, 0, 0);
|
||||||
|
@ -179,7 +179,7 @@ MessageQueue *MctlCompound::doWalkTo(StaticANIObject *subj, int xpos, int ypos,
|
||||||
ex->_keyCode = subj->_okeyCode;
|
ex->_keyCode = subj->_okeyCode;
|
||||||
ex->_excFlags |= 2;
|
ex->_excFlags |= 2;
|
||||||
|
|
||||||
mq->_exCommands.push_back(ex);
|
mq->addExCommandToEnd(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
return mq;
|
return mq;
|
||||||
|
@ -817,7 +817,7 @@ MessageQueue *MovGraph2::buildMovInfo1MessageQueue(MovInfo1 *movInfo) {
|
||||||
ex->_keyCode = _items2[movInfo->field_0]->_obj->_okeyCode;
|
ex->_keyCode = _items2[movInfo->field_0]->_obj->_okeyCode;
|
||||||
ex->_field_24 = 1;
|
ex->_field_24 = 1;
|
||||||
ex->_field_14 = -1;
|
ex->_field_14 = -1;
|
||||||
mq->_exCommands.push_back(ex);
|
mq->addExCommandToEnd(ex);
|
||||||
|
|
||||||
curX += mg2i->_mx;
|
curX += mg2i->_mx;
|
||||||
curY += mg2i->_my;
|
curY += mg2i->_my;
|
||||||
|
@ -1046,20 +1046,20 @@ MessageQueue *MovGraph2::doWalkTo(StaticANIObject *obj, int xpos, int ypos, int
|
||||||
ex->_keyCode = picAniInfo.field_8;
|
ex->_keyCode = picAniInfo.field_8;
|
||||||
ex->_excFlags |= 2;
|
ex->_excFlags |= 2;
|
||||||
|
|
||||||
mq->_exCommands.push_back(ex);
|
mq->addExCommandToEnd(ex);
|
||||||
} else {
|
} else {
|
||||||
ExCommand *ex = new ExCommand(picAniInfo.objectId, 22, obj->_statics->_staticsId, 0, 0, 0, 1, 0, 0, 0);
|
ExCommand *ex = new ExCommand(picAniInfo.objectId, 22, obj->_statics->_staticsId, 0, 0, 0, 1, 0, 0, 0);
|
||||||
|
|
||||||
ex->_keyCode = picAniInfo.field_8;
|
ex->_keyCode = picAniInfo.field_8;
|
||||||
ex->_excFlags |= 3;
|
ex->_excFlags |= 3;
|
||||||
mq->_exCommands.push_back(ex);
|
mq->addExCommandToEnd(ex);
|
||||||
|
|
||||||
ex = new ExCommand(picAniInfo.objectId, 5, -1, obj->_ox, obj->_oy, 0, 1, 0, 0, 0);
|
ex = new ExCommand(picAniInfo.objectId, 5, -1, obj->_ox, obj->_oy, 0, 1, 0, 0, 0);
|
||||||
|
|
||||||
ex->_field_14 = -1;
|
ex->_field_14 = -1;
|
||||||
ex->_keyCode = picAniInfo.field_8;
|
ex->_keyCode = picAniInfo.field_8;
|
||||||
ex->_excFlags |= 3;
|
ex->_excFlags |= 3;
|
||||||
mq->_exCommands.push_back(ex);
|
mq->addExCommandToEnd(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
obj->setPicAniInfo(&picAniInfo);
|
obj->setPicAniInfo(&picAniInfo);
|
||||||
|
|
|
@ -420,7 +420,7 @@ void sceneHandler04_sub1(ExCommand *ex) {
|
||||||
if (ex) {
|
if (ex) {
|
||||||
ExCommand *newex = new ExCommand(ex);
|
ExCommand *newex = new ExCommand(ex);
|
||||||
|
|
||||||
mq->_exCommands.push_back(newex);
|
mq->addExCommandToEnd(newex);
|
||||||
}
|
}
|
||||||
|
|
||||||
mq->_flags |= 1;
|
mq->_flags |= 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue