FULLPIPE: Renamed rest of the AniHandler class methods

This commit is contained in:
Eugene Sandulenko 2016-08-14 21:40:03 +02:00
parent 1bcec8bcd9
commit 68508cb87e
5 changed files with 23 additions and 23 deletions

View File

@ -29,7 +29,7 @@
namespace Fullpipe { namespace Fullpipe {
void AniHandler::clear() { void AniHandler::detachAllObjects() {
_items.clear(); _items.clear();
} }
@ -269,7 +269,7 @@ MessageQueue *AniHandler::makeRunQueue(MakeQueueStruct *mkQueue) {
n2x *= mult; n2x *= mult;
n2y *= mult; n2y *= mult;
} else { } else {
calcLength(&point, mov, n1x, n1y, &mult, &len, 1); getNumCycles(&point, mov, n1x, n1y, &mult, &len, 1);
n2x = point.x; n2x = point.x;
n2y = point.y; n2y = point.y;
} }
@ -348,7 +348,7 @@ MessageQueue *AniHandler::makeRunQueue(MakeQueueStruct *mkQueue) {
for (int i = subIdx; i != st2idx;) { for (int i = subIdx; i != st2idx;) {
MGMSubItem *s = _items[itemIdx]->subItems[i + subOffset * _items[itemIdx]->statics.size()]; MGMSubItem *s = _items[itemIdx]->subItems[i + subOffset * _items[itemIdx]->statics.size()];
ex2 = buildExCommand2(s->movement, mkQueue->ani->_id, x1, y1, &x2, &y2, -1); ex2 = createCommand(s->movement, mkQueue->ani->_id, x1, y1, &x2, &y2, -1);
ex2->_parId = mq->_id; ex2->_parId = mq->_id;
ex2->_keyCode = mkQueue->ani->_okeyCode; ex2->_keyCode = mkQueue->ani->_okeyCode;
@ -365,7 +365,7 @@ MessageQueue *AniHandler::makeRunQueue(MakeQueueStruct *mkQueue) {
else else
plen = -1; plen = -1;
ex2 = buildExCommand2(mov, mkQueue->ani->_id, x1, y1, &x2, &y2, plen); ex2 = createCommand(mov, mkQueue->ani->_id, x1, y1, &x2, &y2, plen);
ex2->_parId = mq->_id; ex2->_parId = mq->_id;
ex2->_keyCode = mkQueue->ani->_okeyCode; ex2->_keyCode = mkQueue->ani->_okeyCode;
@ -375,7 +375,7 @@ MessageQueue *AniHandler::makeRunQueue(MakeQueueStruct *mkQueue) {
for (int j = st1idx; j != subOffset;) { for (int j = st1idx; j != subOffset;) {
MGMSubItem *s = _items[itemIdx]->subItems[j + subOffset * _items[itemIdx]->statics.size()]; MGMSubItem *s = _items[itemIdx]->subItems[j + subOffset * _items[itemIdx]->statics.size()];
ex2 = buildExCommand2(s->movement, mkQueue->ani->_id, x1, y1, &x2, &y2, -1); ex2 = createCommand(s->movement, mkQueue->ani->_id, x1, y1, &x2, &y2, -1);
ex2->_parId = mq->_id; ex2->_parId = mq->_id;
ex2->_keyCode = mkQueue->ani->_okeyCode; ex2->_keyCode = mkQueue->ani->_okeyCode;
@ -415,8 +415,8 @@ int AniHandler::getFramesCount(int idx, int subIdx, int endIdx, int flag) {
return res; return res;
} }
void AniHandler::updateAnimStatics(StaticANIObject *ani, int staticsId) { void AniHandler::putObjectToStatics(StaticANIObject *ani, int staticsId) {
debugC(4, kDebugPathfinding, "AniHandler::updateAnimStatics(*%d, %d)", ani->_id, staticsId); debugC(4, kDebugPathfinding, "AniHandler::putObjectToStatics(*%d, %d)", ani->_id, staticsId);
if (getIndex(ani->_id) == -1) if (getIndex(ani->_id) == -1)
return; return;
@ -631,7 +631,7 @@ int AniHandler::getNumMovements(int objectId, int idx1, int idx2) {
return idx; return idx;
} }
Common::Point *AniHandler::calcLength(Common::Point *pRes, Movement *mov, int x, int y, int *mult, int *len, int flag) { Common::Point *AniHandler::getNumCycles(Common::Point *pRes, Movement *mov, int x, int y, int *mult, int *len, int flag) {
Common::Point point; Common::Point point;
mov->calcSomeXY(point, 0, -1); mov->calcSomeXY(point, 0, -1);
@ -707,8 +707,8 @@ Common::Point *AniHandler::calcLength(Common::Point *pRes, Movement *mov, int x,
return pRes; return pRes;
} }
ExCommand2 *AniHandler::buildExCommand2(Movement *mov, int objId, int x1, int y1, Common::Point *x2, Common::Point *y2, int len) { ExCommand2 *AniHandler::createCommand(Movement *mov, int objId, int x1, int y1, Common::Point *x2, Common::Point *y2, int len) {
debugC(2, kDebugPathfinding, "AniHandler::buildExCommand2(mov, %d, %d, %d, [%d, %d], [%d, %d], %d)", objId, x1, y1, x2->x, x2->y, y2->x, y2->y, len); debugC(2, kDebugPathfinding, "AniHandler::createCommand(mov, %d, %d, %d, [%d, %d], [%d, %d], %d)", objId, x1, y1, x2->x, x2->y, y2->x, y2->y, len);
uint cnt; uint cnt;

View File

@ -71,20 +71,20 @@ public:
Common::Array<MGMItem *> _items; Common::Array<MGMItem *> _items;
public: public:
void clear(); void detachAllObjects();
void attachObject(int objId); void attachObject(int objId);
void resetData(int objId); void resetData(int objId);
int getIndex(int objId); int getIndex(int objId);
MessageQueue *makeRunQueue(MakeQueueStruct *mkQueue); MessageQueue *makeRunQueue(MakeQueueStruct *mkQueue);
void updateAnimStatics(StaticANIObject *ani, int staticsId); void putObjectToStatics(StaticANIObject *ani, int staticsId);
Common::Point *getTransitionSize(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 getStaticsIndexById(int idx, int16 id);
int getStaticsIndex(int idx, Statics *st); int getStaticsIndex(int idx, Statics *st);
void clearVisitsList(int idx); void clearVisitsList(int idx);
int seekWay(int idx, int st1idx, int st2idx, bool flip, bool flop); 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); Common::Point *getNumCycles(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); ExCommand2 *createCommand(Movement *mov, int objId, int x1, int y1, Common::Point *x2, Common::Point *y2, int len);
MessageQueue *makeQueue(StaticANIObject *ani, int staticsIndex, int staticsId, int *resStatId, Common::Point **pointArr); MessageQueue *makeQueue(StaticANIObject *ani, int staticsIndex, int staticsId, int *resStatId, Common::Point **pointArr);
int getFramesCount(int idx, int subIdx, int subOffset, int flag); int getFramesCount(int idx, int subIdx, int subOffset, int flag);
int getNumMovements(int objectId, int idx1, int idx2); int getNumMovements(int objectId, int idx1, int idx2);

View File

@ -413,7 +413,7 @@ bool MctlLadder::initMovement(StaticANIObject *ani, MctlLadderMovement *movement
void MctlLadder::detachAllObjects() { void MctlLadder::detachAllObjects() {
debugC(4, kDebugPathfinding, "MctlLadder::detachAllObjects()"); debugC(4, kDebugPathfinding, "MctlLadder::detachAllObjects()");
_aniHandler.clear(); _aniHandler.detachAllObjects();
for (uint i = 0; i < _ladmovements.size(); i++) { for (uint i = 0; i < _ladmovements.size(); i++) {
delete _ladmovements[i]->movVars; delete _ladmovements[i]->movVars;
@ -806,7 +806,7 @@ bool MovGraph::load(MfcArchive &file) {
void MovGraph::attachObject(StaticANIObject *obj) { void MovGraph::attachObject(StaticANIObject *obj) {
debugC(4, kDebugPathfinding, "MovGraph::attachObject(*%d)", obj->_id); debugC(4, kDebugPathfinding, "MovGraph::attachObject(*%d)", obj->_id);
_aniHandler.clear(); _aniHandler.detachAllObjects();
_aniHandler.attachObject(obj->_id); _aniHandler.attachObject(obj->_id);
for (uint i = 0; i < _items.size(); i++) for (uint i = 0; i < _items.size(); i++)
@ -2504,7 +2504,7 @@ MessageQueue *MovGraph2::genMovement(MovInfo1 *info) {
int a2 = 0; int a2 = 0;
int mgmLen; int mgmLen;
_aniHandler.calcLength(&point, _items2[info->index]->_subItems[info->subIndex]._walk[1]._mov, x, y, &mgmLen, &a2, info->flags & 1); _aniHandler.getNumCycles(&point, _items2[info->index]->_subItems[info->subIndex]._walk[1]._mov, x, y, &mgmLen, &a2, info->flags & 1);
int x1 = point.x; int x1 = point.x;
int y1 = point.y; int y1 = point.y;
@ -2619,7 +2619,7 @@ MessageQueue *MovGraph2::genMovement(MovInfo1 *info) {
ex->_excFlags |= 2; ex->_excFlags |= 2;
mq->addExCommandToEnd(ex); mq->addExCommandToEnd(ex);
ex = _aniHandler.buildExCommand2( ex = _aniHandler.createCommand(
_items2[info->index]->_subItems[info->subIndex]._walk[0]._mov, _items2[info->index]->_subItems[info->subIndex]._walk[0]._mov,
_items2[info->index]->_objectId, _items2[info->index]->_objectId,
x1, x1,
@ -2641,7 +2641,7 @@ MessageQueue *MovGraph2::genMovement(MovInfo1 *info) {
else else
par = -1; par = -1;
ex = _aniHandler.buildExCommand2( ex = _aniHandler.createCommand(
_items2[info->index]->_subItems[info->subIndex]._walk[1]._mov, _items2[info->index]->_subItems[info->subIndex]._walk[1]._mov,
_items2[info->index]->_objectId, _items2[info->index]->_objectId,
x1, x1,
@ -2655,7 +2655,7 @@ MessageQueue *MovGraph2::genMovement(MovInfo1 *info) {
} }
if (!(info->flags & 4)) { if (!(info->flags & 4)) {
ex = _aniHandler.buildExCommand2( ex = _aniHandler.createCommand(
_items2[info->index]->_subItems[info->subIndex]._walk[2]._mov, _items2[info->index]->_subItems[info->subIndex]._walk[2]._mov,
_items2[info->index]->_objectId, _items2[info->index]->_objectId,
x1, x1,

View File

@ -96,7 +96,7 @@ void scene11_setupMusic() {
void scene11_initScene(Scene *sc) { void scene11_initScene(Scene *sc) {
g_vars->scene11_swingie = sc->getStaticANIObject1ById(ANI_SWINGER, -1); g_vars->scene11_swingie = sc->getStaticANIObject1ById(ANI_SWINGER, -1);
g_vars->scene11_boots = sc->getStaticANIObject1ById(ANI_BOOTS_11, -1); g_vars->scene11_boots = sc->getStaticANIObject1ById(ANI_BOOTS_11, -1);
g_vars->scene11_aniHandler.clear(); g_vars->scene11_aniHandler.detachAllObjects();
g_vars->scene11_dudeOnSwing = sc->getStaticANIObject1ById(ANI_MAN11, -1); g_vars->scene11_dudeOnSwing = sc->getStaticANIObject1ById(ANI_MAN11, -1);
g_vars->scene11_dudeOnSwing->_callback2 = scene11_dudeSwingCallback; g_vars->scene11_dudeOnSwing->_callback2 = scene11_dudeSwingCallback;
g_vars->scene11_dudeOnSwing = sc->getStaticANIObject1ById(ANI_KACHELI, -1); g_vars->scene11_dudeOnSwing = sc->getStaticANIObject1ById(ANI_KACHELI, -1);

View File

@ -156,7 +156,7 @@ StaticANIObject::~StaticANIObject() {
_movements.clear(); _movements.clear();
g_fp->_aniHandler->clear(); g_fp->_aniHandler->detachAllObjects();
} }
StaticANIObject::StaticANIObject(StaticANIObject *src) : GameObject(src) { StaticANIObject::StaticANIObject(StaticANIObject *src) : GameObject(src) {
@ -1072,7 +1072,7 @@ void StaticANIObject::changeStatics2(int objId) {
if (_movement || _statics) { if (_movement || _statics) {
g_fp->_aniHandler->attachObject(_id); g_fp->_aniHandler->attachObject(_id);
g_fp->_aniHandler->updateAnimStatics(this, objId); g_fp->_aniHandler->putObjectToStatics(this, objId);
} else { } else {
_statics = getStaticsById(objId); _statics = getStaticsById(objId);
} }