aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe
diff options
context:
space:
mode:
authorEugene Sandulenko2016-08-14 21:24:51 +0200
committerEugene Sandulenko2016-08-14 21:40:29 +0200
commit1bcec8bcd9089e481a8b137f7bad0002fd773ca6 (patch)
tree23b1d86bfd24984f4de861499588502d5b1ce99b /engines/fullpipe
parent68828123da64c2b920b4db303424ef1f6520897f (diff)
downloadscummvm-rg350-1bcec8bcd9089e481a8b137f7bad0002fd773ca6.tar.gz
scummvm-rg350-1bcec8bcd9089e481a8b137f7bad0002fd773ca6.tar.bz2
scummvm-rg350-1bcec8bcd9089e481a8b137f7bad0002fd773ca6.zip
FULLPIPE: Further renames in AniHandler class
Diffstat (limited to 'engines/fullpipe')
-rw-r--r--engines/fullpipe/anihandler.cpp90
-rw-r--r--engines/fullpipe/anihandler.h16
-rw-r--r--engines/fullpipe/messages.cpp2
-rw-r--r--engines/fullpipe/messages.h2
-rw-r--r--engines/fullpipe/motion.cpp22
-rw-r--r--engines/fullpipe/statics.cpp2
6 files changed, 67 insertions, 67 deletions
diff --git a/engines/fullpipe/anihandler.cpp b/engines/fullpipe/anihandler.cpp
index a423b2b70d..219f20d6dd 100644
--- a/engines/fullpipe/anihandler.cpp
+++ b/engines/fullpipe/anihandler.cpp
@@ -33,10 +33,10 @@ void AniHandler::clear() {
_items.clear();
}
-MessageQueue *AniHandler::genMQ(StaticANIObject *ani, int staticsIndex, int staticsId, int *resStatId, Common::Point **pointArr) {
- debugC(4, kDebugPathfinding, "AniHandler::genMQ(*%d, %d, %d, res, point)", ani->_id, staticsIndex, staticsId);
+MessageQueue *AniHandler::makeQueue(StaticANIObject *ani, int staticsIndex, int staticsId, int *resStatId, Common::Point **pointArr) {
+ debugC(4, kDebugPathfinding, "AniHandler::makeQueue(*%d, %d, %d, res, point)", ani->_id, staticsIndex, staticsId);
- int idx = getItemIndexById(ani->_id);
+ int idx = getIndex(ani->_id);
if (idx == -1)
return 0;
@@ -62,8 +62,8 @@ MessageQueue *AniHandler::genMQ(StaticANIObject *ani, int staticsIndex, int stat
int subidx = startidx + endidx * _items[idx]->statics.size();
if (!_items[idx]->subItems[subidx]->movement) {
- clearMovements2(idx);
- recalcOffsets(idx, startidx, endidx, 0, 1);
+ clearVisitsList(idx);
+ seekWay(idx, startidx, endidx, 0, 1);
}
if (!_items[idx]->subItems[subidx]->movement)
@@ -134,22 +134,22 @@ MGMSubItem::MGMSubItem() {
void AniHandler::attachObject(int objId) {
debugC(4, kDebugPathfinding, "AniHandler::addItem(%d)", objId);
- if (getItemIndexById(objId) == -1) {
+ if (getIndex(objId) == -1) {
MGMItem *item = new MGMItem();
item->objId = objId;
_items.push_back(item);
}
- rebuildTables(objId);
+ resetData(objId);
}
-void AniHandler::rebuildTables(int objId) {
- int idx = getItemIndexById(objId);
+void AniHandler::resetData(int objId) {
+ int idx = getIndex(objId);
if (idx == -1)
return;
- debugC(3, kDebugPathfinding, "AniHandler::rebuildTables. (1) movements1 sz: %d movements2 sz: %d", _items[idx]->movements1.size(), _items[idx]->movements2.size());
+ debugC(3, kDebugPathfinding, "AniHandler::resetData. (1) movements1 sz: %d movements2 sz: %d", _items[idx]->movements1.size(), _items[idx]->movements2.size());
_items[idx]->subItems.clear();
_items[idx]->statics.clear();
@@ -174,10 +174,10 @@ void AniHandler::rebuildTables(int objId) {
_items[idx]->movements2.push_back(0);
}
- debugC(3, kDebugPathfinding, "AniHandler::rebuildTables. (2) movements1 sz: %d movements2 sz: %d", _items[idx]->movements1.size(), _items[idx]->movements2.size());
+ debugC(3, kDebugPathfinding, "AniHandler::resetData. (2) movements1 sz: %d movements2 sz: %d", _items[idx]->movements1.size(), _items[idx]->movements2.size());
}
-int AniHandler::getItemIndexById(int objId) {
+int AniHandler::getIndex(int objId) {
for (uint i = 0; i < _items.size(); i++)
if (_items[i]->objId == objId)
return i;
@@ -229,7 +229,7 @@ MessageQueue *AniHandler::makeRunQueue(MakeQueueStruct *mkQueue) {
return 0;
- int itemIdx = getItemIndexById(mkQueue->ani->_id);
+ int itemIdx = getIndex(mkQueue->ani->_id);
int subIdx = getStaticsIndexById(itemIdx, mkQueue->staticsId1);
int st2idx = getStaticsIndexById(itemIdx, mov->_staticsObj1->_staticsId);
int st1idx = getStaticsIndexById(itemIdx, mov->_staticsObj2->_staticsId);
@@ -237,10 +237,10 @@ MessageQueue *AniHandler::makeRunQueue(MakeQueueStruct *mkQueue) {
debugC(3, kDebugPathfinding, "AniHandler::genMovement. (1) movements1 sz: %d movements2 sz: %d", _items[itemIdx]->movements1.size(), _items[itemIdx]->movements2.size());
- clearMovements2(itemIdx);
- recalcOffsets(itemIdx, subIdx, st2idx, 0, 1);
- clearMovements2(itemIdx);
- recalcOffsets(itemIdx, st1idx, subOffset, 0, 1);
+ clearVisitsList(itemIdx);
+ seekWay(itemIdx, subIdx, st2idx, 0, 1);
+ clearVisitsList(itemIdx);
+ seekWay(itemIdx, st1idx, subOffset, 0, 1);
MGMSubItem *sub1 = _items[itemIdx]->subItems[subIdx + st2idx * _items[itemIdx]->statics.size()];
MGMSubItem *sub2 = _items[itemIdx]->subItems[st1idx + subOffset * _items[itemIdx]->statics.size()];
@@ -292,8 +292,8 @@ MessageQueue *AniHandler::makeRunQueue(MakeQueueStruct *mkQueue) {
int py = 0;
if (sub1->movement) {
- px = countPhases(itemIdx, subIdx, st2idx, 1);
- py = countPhases(itemIdx, subIdx, st2idx, 2);
+ px = getFramesCount(itemIdx, subIdx, st2idx, 1);
+ py = getFramesCount(itemIdx, subIdx, st2idx, 2);
}
if (mult > 1) {
@@ -307,8 +307,8 @@ MessageQueue *AniHandler::makeRunQueue(MakeQueueStruct *mkQueue) {
}
if (sub2->movement) {
- px += countPhases(itemIdx, st1idx, subOffset, 1);
- py += countPhases(itemIdx, st1idx, subOffset, 2);
+ px += getFramesCount(itemIdx, st1idx, subOffset, 1);
+ py += getFramesCount(itemIdx, st1idx, subOffset, 2);
}
int dx1 = n1x - n2x;
@@ -398,7 +398,7 @@ MessageQueue *AniHandler::makeRunQueue(MakeQueueStruct *mkQueue) {
return mq;
}
-int AniHandler::countPhases(int idx, int subIdx, int endIdx, int flag) {
+int AniHandler::getFramesCount(int idx, int subIdx, int endIdx, int flag) {
int res = 0;
if (endIdx < 0)
@@ -418,7 +418,7 @@ int AniHandler::countPhases(int idx, int subIdx, int endIdx, int flag) {
void AniHandler::updateAnimStatics(StaticANIObject *ani, int staticsId) {
debugC(4, kDebugPathfinding, "AniHandler::updateAnimStatics(*%d, %d)", ani->_id, staticsId);
- if (getItemIndexById(ani->_id) == -1)
+ if (getIndex(ani->_id) == -1)
return;
if (ani->_movement) {
@@ -437,7 +437,7 @@ void AniHandler::updateAnimStatics(StaticANIObject *ani, int staticsId) {
if (ani->_statics) {
Common::Point point;
- getPoint(&point, ani->_id, ani->_statics->_staticsId, staticsId);
+ getTransitionSize(&point, ani->_id, ani->_statics->_staticsId, staticsId);
ani->setOXY(ani->_ox + point.x, ani->_oy + point.y);
@@ -445,10 +445,10 @@ void AniHandler::updateAnimStatics(StaticANIObject *ani, int staticsId) {
}
}
-Common::Point *AniHandler::getPoint(Common::Point *point, int objectId, int staticsId1, int staticsId2) {
- debugC(4, kDebugPathfinding, "AniHandler::getPoint([%d, %d], %d, %d, %d)", point->x, point->y, objectId, staticsId1, staticsId2);
+Common::Point *AniHandler::getTransitionSize(Common::Point *point, int objectId, int staticsId1, int staticsId2) {
+ debugC(4, kDebugPathfinding, "AniHandler::getTransitionSize([%d, %d], %d, %d, %d)", point->x, point->y, objectId, staticsId1, staticsId2);
- int idx = getItemIndexById(objectId);
+ int idx = getIndex(objectId);
if (idx == -1) {
point->x = -1;
@@ -464,12 +464,12 @@ Common::Point *AniHandler::getPoint(Common::Point *point, int objectId, int stat
int subidx = st1idx + st2idx * _items[idx]->statics.size();
if (!_items[idx]->subItems[subidx]->movement) {
- clearMovements2(idx);
- recalcOffsets(idx, st1idx, st2idx, false, true);
+ clearVisitsList(idx);
+ seekWay(idx, st1idx, st2idx, false, true);
if (!_items[idx]->subItems[subidx]->movement) {
- clearMovements2(idx);
- recalcOffsets(idx, st1idx, st2idx, true, false);
+ clearVisitsList(idx);
+ seekWay(idx, st1idx, st2idx, true, false);
}
}
@@ -512,20 +512,20 @@ int AniHandler::getStaticsIndex(int idx, Statics *st) {
return -1;
}
-void AniHandler::clearMovements2(int idx) {
- debugC(2, kDebugPathfinding, "AniHandler::clearMovements2(%d)", idx);
+void AniHandler::clearVisitsList(int idx) {
+ debugC(2, kDebugPathfinding, "AniHandler::clearVisitsList(%d)", idx);
for (uint i = 0; i < _items[idx]->movements2.size(); i++)
_items[idx]->movements2[i] = 0;
- debugC(3, kDebugPathfinding, "AniHandler::clearMovements2. movements1 sz: %d movements2 sz: %d", _items[idx]->movements1.size(), _items[idx]->movements2.size());
+ debugC(3, kDebugPathfinding, "AniHandler::clearVisitsList. movements1 sz: %d movements2 sz: %d", _items[idx]->movements1.size(), _items[idx]->movements2.size());
}
-int AniHandler::recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool flop) {
+int AniHandler::seekWay(int idx, int st1idx, int st2idx, bool flip, bool flop) {
MGMItem *item = _items[idx];
int subIdx = st1idx + st2idx * item->statics.size();
- debugC(2, kDebugPathfinding, "AniHandler::recalcOffsets(%d, %d, %d, %d, %d)", idx, st1idx, st2idx, flip, flop);
+ debugC(2, kDebugPathfinding, "AniHandler::seekWay(%d, %d, %d, %d, %d)", idx, st1idx, st2idx, flip, flop);
if (st1idx == st2idx) {
memset(item->subItems[subIdx], 0, sizeof(*(item->subItems[subIdx])));
@@ -537,7 +537,7 @@ int AniHandler::recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool f
Common::Point point;
- debugC(3, kDebugPathfinding, "AniHandler::recalcOffsets. movements1 sz: %d movements2 sz: %d", item->movements1.size(), item->movements2.size());
+ debugC(3, kDebugPathfinding, "AniHandler::seekWay. movements1 sz: %d movements2 sz: %d", item->movements1.size(), item->movements2.size());
for (uint i = 0; i < item->movements1.size(); i++) {
Movement *mov = item->movements1[i];
@@ -549,9 +549,9 @@ int AniHandler::recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool f
item->movements2[i] = 1;
int stidx = getStaticsIndex(idx, mov->_staticsObj2);
- int recalc = recalcOffsets(idx, stidx, st2idx, flip, flop);
+ int recalc = seekWay(idx, stidx, st2idx, flip, flop);
int sz = mov->_currMovement ? mov->_currMovement->_dynamicPhases.size() : mov->_dynamicPhases.size();
- debugC(1, kDebugPathfinding, "AniHandler::recalcOffsets, want idx: %d, off: %d (%d + %d), sz: %d", idx, stidx + st2idx * _items[idx]->statics.size(), stidx, st2idx, item->subItems.size());
+ debugC(1, kDebugPathfinding, "AniHandler::seekWay, want idx: %d, off: %d (%d + %d), sz: %d", idx, stidx + st2idx * _items[idx]->statics.size(), stidx, st2idx, item->subItems.size());
int newsz = sz + item->subItems[stidx + st2idx * _items[idx]->statics.size()]->field_C;
@@ -580,7 +580,7 @@ int AniHandler::recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool f
item->movements2[i] = 1;
int stidx = getStaticsIndex(idx, mov->_staticsObj1);
- int recalc = recalcOffsets(idx, stidx, st2idx, flip, flop);
+ int recalc = seekWay(idx, stidx, st2idx, flip, flop);
if (recalc < 0)
continue;
@@ -608,10 +608,10 @@ int AniHandler::recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool f
return -1;
}
-int AniHandler::refreshOffsets(int objectId, int idx1, int idx2) {
- debugC(4, kDebugPathfinding, "AniHandler::refreshOffsets(%d, %d, %d)", objectId, idx1, idx2);
+int AniHandler::getNumMovements(int objectId, int idx1, int idx2) {
+ debugC(4, kDebugPathfinding, "AniHandler::getNumMovements(%d, %d, %d)", objectId, idx1, idx2);
- int idx = getItemIndexById(objectId);
+ int idx = getIndex(objectId);
if (idx != -1) {
int from = getStaticsIndexById(idx, idx1);
@@ -623,8 +623,8 @@ int AniHandler::refreshOffsets(int objectId, int idx1, int idx2) {
if (sub->movement) {
idx = sub->field_8;
} else {
- clearMovements2(idx);
- idx = recalcOffsets(idx, from, to, 0, 1);
+ clearVisitsList(idx);
+ idx = seekWay(idx, from, to, 0, 1);
}
}
diff --git a/engines/fullpipe/anihandler.h b/engines/fullpipe/anihandler.h
index ec0dcd0bd3..f0e535c428 100644
--- a/engines/fullpipe/anihandler.h
+++ b/engines/fullpipe/anihandler.h
@@ -73,21 +73,21 @@ public:
public:
void clear();
void attachObject(int objId);
- void rebuildTables(int objId);
- int getItemIndexById(int objId);
+ void resetData(int objId);
+ int getIndex(int objId);
MessageQueue *makeRunQueue(MakeQueueStruct *mkQueue);
void updateAnimStatics(StaticANIObject *ani, int staticsId);
- Common::Point *getPoint(Common::Point *point, int aniId, int staticsId1, int staticsId2);
+ Common::Point *getTransitionSize(Common::Point *point, int aniId, int staticsId1, int staticsId2);
int getStaticsIndexById(int idx, int16 id);
int getStaticsIndex(int idx, Statics *st);
- void clearMovements2(int idx);
- int recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool flop);
+ void clearVisitsList(int idx);
+ int seekWay(int idx, int st1idx, int st2idx, bool flip, bool flop);
Common::Point *calcLength(Common::Point *point, Movement *mov, int x, int y, int *mult, int *len, int flag);
ExCommand2 *buildExCommand2(Movement *mov, int objId, int x1, int y1, Common::Point *x2, Common::Point *y2, int len);
- MessageQueue *genMQ(StaticANIObject *ani, int staticsIndex, int staticsId, int *resStatId, Common::Point **pointArr);
- int countPhases(int idx, int subIdx, int subOffset, int flag);
- int refreshOffsets(int objectId, int idx1, int idx2);
+ MessageQueue *makeQueue(StaticANIObject *ani, int staticsIndex, int staticsId, int *resStatId, Common::Point **pointArr);
+ int getFramesCount(int idx, int subIdx, int subOffset, int flag);
+ int getNumMovements(int objectId, int idx1, int idx2);
};
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/messages.cpp b/engines/fullpipe/messages.cpp
index 8652223ed1..9085e92832 100644
--- a/engines/fullpipe/messages.cpp
+++ b/engines/fullpipe/messages.cpp
@@ -457,7 +457,7 @@ void MessageQueue::deleteExCommandByIndex(uint idx, bool doFree) {
_exCommands.erase(it);
}
-void MessageQueue::transferExCommands(MessageQueue *mq) {
+void MessageQueue::mergeQueue(MessageQueue *mq) { // Original belongs to AniHandler
while (mq->_exCommands.size()) {
_exCommands.push_back(mq->_exCommands.front());
mq->_exCommands.pop_front();
diff --git a/engines/fullpipe/messages.h b/engines/fullpipe/messages.h
index e6f7f05150..67fbb2a6cd 100644
--- a/engines/fullpipe/messages.h
+++ b/engines/fullpipe/messages.h
@@ -142,7 +142,7 @@ class MessageQueue : public CObject {
ExCommand *getExCommandByIndex(uint idx);
void deleteExCommandByIndex(uint idx, bool doFree);
- void transferExCommands(MessageQueue *mq);
+ void mergeQueue(MessageQueue *mq);
void replaceKeyCode(int key1, int key2);
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index 25ee191dc4..995ba39b46 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -551,7 +551,7 @@ MessageQueue *MctlLadder::doWalkTo(StaticANIObject *ani, int xpos, int ypos, int
}
if (ani->_statics->_staticsId != _ladmovements[pos]->staticIds[3]) {
- mq = _aniHandler.genMQ(ani, _ladmovements[pos]->staticIds[0], 0, 0, 0);
+ mq = _aniHandler.makeQueue(ani, _ladmovements[pos]->staticIds[0], 0, 0, 0);
if (!mq)
return 0;
@@ -559,7 +559,7 @@ MessageQueue *MctlLadder::doWalkTo(StaticANIObject *ani, int xpos, int ypos, int
int nx = ani->_ox;
int ny = ani->_oy;
- _aniHandler.getPoint(&point, ani->_id, ani->_statics->_staticsId, _ladmovements[pos]->staticIds[0]);
+ _aniHandler.getTransitionSize(&point, ani->_id, ani->_statics->_staticsId, _ladmovements[pos]->staticIds[0]);
nx += point.x;
ny += point.y;
@@ -572,7 +572,7 @@ MessageQueue *MctlLadder::doWalkTo(StaticANIObject *ani, int xpos, int ypos, int
MessageQueue *newmq = doWalkTo(ani, normx, normy, fuzzyMatch, staticsId);
- mq->transferExCommands(newmq);
+ mq->mergeQueue(newmq);
delete newmq;
@@ -1008,8 +1008,8 @@ bool MovGraph::resetPosition(StaticANIObject *ani, int flag) {
Statics *st;
if (ani->_statics) {
- int t = _aniHandler.refreshOffsets(ani->_id, ani->_statics->_staticsId, movarr._link->_dwordArray2[_field_44]);
- if (t > _aniHandler.refreshOffsets(ani->_id, ani->_statics->_staticsId, movarr._link->_dwordArray2[_field_44 + 1]))
+ int t = _aniHandler.getNumMovements(ani->_id, ani->_statics->_staticsId, movarr._link->_dwordArray2[_field_44]);
+ if (t > _aniHandler.getNumMovements(ani->_id, ani->_statics->_staticsId, movarr._link->_dwordArray2[_field_44 + 1]))
st = ani->getStaticsById(movarr._link->_dwordArray2[_field_44 + 1]);
else
st = ani->getStaticsById(movarr._link->_dwordArray2[_field_44]);
@@ -1251,7 +1251,7 @@ MessageQueue *MovGraph::makeWholeQueue(StaticANIObject *ani, MovArr *movarr, int
if (mq) {
if (newmq) {
- mq->transferExCommands(newmq);
+ mq->mergeQueue(newmq);
delete newmq;
}
@@ -1608,14 +1608,14 @@ bool MovGraph::getHitPoint(int idx, int x, int y, MovArr *arr, int a6) {
int offmin = 100;
for (int i = 0; i < arrSize; i++) {
- int off = _aniHandler.refreshOffsets(_items[idx]->ani->_id, staticsId, (*movarr)[i]->_link->_dwordArray2[_field_44]);
+ int off = _aniHandler.getNumMovements(_items[idx]->ani->_id, staticsId, (*movarr)[i]->_link->_dwordArray2[_field_44]);
if (off < offmin) {
offmin = off;
idxmin = i;
}
- off = _aniHandler.refreshOffsets(_items[idx]->ani->_id, staticsId, (*movarr)[i]->_link->_dwordArray2[_field_44 + 1]);
+ off = _aniHandler.getNumMovements(_items[idx]->ani->_id, staticsId, (*movarr)[i]->_link->_dwordArray2[_field_44 + 1]);
if (off < offmin) {
offmin = off;
idxmin = i;
@@ -1689,7 +1689,7 @@ int MovGraph2::getItemSubIndexByMGM(int index, StaticANIObject *ani) {
for (int i = 0; i < 4; i++) {
debugC(1, kDebugPathfinding, "WWW 5");
- int tmp = _aniHandler.refreshOffsets(ani->_id, ani->_statics->_staticsId, _items2[index]->_subItems[i]._staticsId1);
+ int tmp = _aniHandler.getNumMovements(ani->_id, ani->_statics->_staticsId, _items2[index]->_subItems[i]._staticsId1);
if (tmp >= 0 && (minidx == -1 || tmp < min)) {
minidx = i;
@@ -2024,7 +2024,7 @@ MessageQueue *MovGraph2::buildMovInfo1MessageQueue(MovInfo1 *movInfo) {
mkQueue.movementId = mg2i->_movementId;
MessageQueue *mq2 = _aniHandler.makeRunQueue(&mkQueue);
- mq->transferExCommands(mq2);
+ mq->mergeQueue(mq2);
delete mq2;
@@ -2078,7 +2078,7 @@ MessageQueue *MovGraph2::buildMovInfo1MessageQueue(MovInfo1 *movInfo) {
return 0;
}
- mq->transferExCommands(mq2);
+ mq->mergeQueue(mq2);
delete mq2;
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index c81b84de43..264de51c4b 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -1042,7 +1042,7 @@ void StaticANIObject::adjustSomeXY() {
MessageQueue *StaticANIObject::changeStatics1(int msgNum) {
g_fp->_aniHandler->attachObject(_id);
- MessageQueue *mq = g_fp->_aniHandler->genMQ(this, msgNum, 0, 0, 0);
+ MessageQueue *mq = g_fp->_aniHandler->makeQueue(this, msgNum, 0, 0, 0);
if (!mq)
return 0;