From f99e47de6e47910be0857e2f1e056447edba220e Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 14 Aug 2016 20:00:14 +0200 Subject: [PATCH] FULLPIPE: Rename MGM class to AniHandler --- engines/fullpipe/anihandler.cpp | 64 ++++++++++++++--------------- engines/fullpipe/anihandler.h | 8 ++-- engines/fullpipe/fullpipe.cpp | 2 +- engines/fullpipe/fullpipe.h | 4 +- engines/fullpipe/motion.h | 4 +- engines/fullpipe/scenes.h | 6 +-- engines/fullpipe/scenes/scene04.cpp | 12 +++--- engines/fullpipe/scenes/scene22.cpp | 2 +- 8 files changed, 51 insertions(+), 51 deletions(-) diff --git a/engines/fullpipe/anihandler.cpp b/engines/fullpipe/anihandler.cpp index 62fbb1ff6dc..a1baed9aeab 100644 --- a/engines/fullpipe/anihandler.cpp +++ b/engines/fullpipe/anihandler.cpp @@ -29,12 +29,12 @@ namespace Fullpipe { -void MGM::clear() { +void AniHandler::clear() { _items.clear(); } -MessageQueue *MGM::genMQ(StaticANIObject *ani, int staticsIndex, int staticsId, int *resStatId, Common::Point **pointArr) { - debugC(4, kDebugPathfinding, "MGM::genMQ(*%d, %d, %d, res, point)", ani->_id, staticsIndex, staticsId); +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); int idx = getItemIndexById(ani->_id); @@ -131,8 +131,8 @@ MGMSubItem::MGMSubItem() { y = 0; } -void MGM::addItem(int objId) { - debugC(4, kDebugPathfinding, "MGM::addItem(%d)", objId); +void AniHandler::addItem(int objId) { + debugC(4, kDebugPathfinding, "AniHandler::addItem(%d)", objId); if (getItemIndexById(objId) == -1) { MGMItem *item = new MGMItem(); @@ -143,13 +143,13 @@ void MGM::addItem(int objId) { rebuildTables(objId); } -void MGM::rebuildTables(int objId) { +void AniHandler::rebuildTables(int objId) { int idx = getItemIndexById(objId); if (idx == -1) return; - debugC(3, kDebugPathfinding, "MGM::rebuildTables. (1) movements1 sz: %d movements2 sz: %d", _items[idx]->movements1.size(), _items[idx]->movements2.size()); + debugC(3, kDebugPathfinding, "AniHandler::rebuildTables. (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 MGM::rebuildTables(int objId) { _items[idx]->movements2.push_back(0); } - debugC(3, kDebugPathfinding, "MGM::rebuildTables. (2) movements1 sz: %d movements2 sz: %d", _items[idx]->movements1.size(), _items[idx]->movements2.size()); + debugC(3, kDebugPathfinding, "AniHandler::rebuildTables. (2) movements1 sz: %d movements2 sz: %d", _items[idx]->movements1.size(), _items[idx]->movements2.size()); } -int MGM::getItemIndexById(int objId) { +int AniHandler::getItemIndexById(int objId) { for (uint i = 0; i < _items.size(); i++) if (_items[i]->objId == objId) return i; @@ -185,8 +185,8 @@ int MGM::getItemIndexById(int objId) { return -1; } -MessageQueue *MGM::genMovement(MGMInfo *mgminfo) { - debugC(4, kDebugPathfinding, "MGM::genMovement(*%d)", mgminfo->ani ? mgminfo->ani->_id : -1); +MessageQueue *AniHandler::genMovement(MGMInfo *mgminfo) { + debugC(4, kDebugPathfinding, "AniHandler::genMovement(*%d)", mgminfo->ani ? mgminfo->ani->_id : -1); if (!mgminfo->ani) return 0; @@ -235,7 +235,7 @@ MessageQueue *MGM::genMovement(MGMInfo *mgminfo) { int st1idx = getStaticsIndexById(itemIdx, mov->_staticsObj2->_staticsId); int subOffset = getStaticsIndexById(itemIdx, mgminfo->staticsId2); - debugC(3, kDebugPathfinding, "MGM::genMovement. (1) movements1 sz: %d movements2 sz: %d", _items[itemIdx]->movements1.size(), _items[itemIdx]->movements2.size()); + 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); @@ -393,12 +393,12 @@ MessageQueue *MGM::genMovement(MGMInfo *mgminfo) { mq->addExCommandToEnd(ex); - debugC(3, kDebugPathfinding, "MGM::genMovement. (2) movements1 sz: %d movements2 sz: %d", _items[itemIdx]->movements1.size(), _items[itemIdx]->movements2.size()); + debugC(3, kDebugPathfinding, "AniHandler::genMovement. (2) movements1 sz: %d movements2 sz: %d", _items[itemIdx]->movements1.size(), _items[itemIdx]->movements2.size()); return mq; } -int MGM::countPhases(int idx, int subIdx, int endIdx, int flag) { +int AniHandler::countPhases(int idx, int subIdx, int endIdx, int flag) { int res = 0; if (endIdx < 0) @@ -415,8 +415,8 @@ int MGM::countPhases(int idx, int subIdx, int endIdx, int flag) { return res; } -void MGM::updateAnimStatics(StaticANIObject *ani, int staticsId) { - debugC(4, kDebugPathfinding, "MGM::updateAnimStatics(*%d, %d)", ani->_id, staticsId); +void AniHandler::updateAnimStatics(StaticANIObject *ani, int staticsId) { + debugC(4, kDebugPathfinding, "AniHandler::updateAnimStatics(*%d, %d)", ani->_id, staticsId); if (getItemIndexById(ani->_id) == -1) return; @@ -445,8 +445,8 @@ void MGM::updateAnimStatics(StaticANIObject *ani, int staticsId) { } } -Common::Point *MGM::getPoint(Common::Point *point, int objectId, int staticsId1, int staticsId2) { - debugC(4, kDebugPathfinding, "MGM::getPoint([%d, %d], %d, %d, %d)", point->x, point->y, objectId, staticsId1, staticsId2); +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); int idx = getItemIndexById(objectId); @@ -488,7 +488,7 @@ Common::Point *MGM::getPoint(Common::Point *point, int objectId, int staticsId1, return point; } -int MGM::getStaticsIndexById(int idx, int16 id) { +int AniHandler::getStaticsIndexById(int idx, int16 id) { if (!_items[idx]->statics.size()) return -1; @@ -500,7 +500,7 @@ int MGM::getStaticsIndexById(int idx, int16 id) { return -1; } -int MGM::getStaticsIndex(int idx, Statics *st) { +int AniHandler::getStaticsIndex(int idx, Statics *st) { if (!_items[idx]->statics.size()) return -1; @@ -512,20 +512,20 @@ int MGM::getStaticsIndex(int idx, Statics *st) { return -1; } -void MGM::clearMovements2(int idx) { - debugC(2, kDebugPathfinding, "MGM::clearMovements2(%d)", idx); +void AniHandler::clearMovements2(int idx) { + debugC(2, kDebugPathfinding, "AniHandler::clearMovements2(%d)", idx); for (uint i = 0; i < _items[idx]->movements2.size(); i++) _items[idx]->movements2[i] = 0; - debugC(3, kDebugPathfinding, "MGM::clearMovements2. movements1 sz: %d movements2 sz: %d", _items[idx]->movements1.size(), _items[idx]->movements2.size()); + debugC(3, kDebugPathfinding, "AniHandler::clearMovements2. movements1 sz: %d movements2 sz: %d", _items[idx]->movements1.size(), _items[idx]->movements2.size()); } -int MGM::recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool flop) { +int AniHandler::recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool flop) { MGMItem *item = _items[idx]; int subIdx = st1idx + st2idx * item->statics.size(); - debugC(2, kDebugPathfinding, "MGM::recalcOffsets(%d, %d, %d, %d, %d)", idx, st1idx, st2idx, flip, flop); + debugC(2, kDebugPathfinding, "AniHandler::recalcOffsets(%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 MGM::recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool flop) { Common::Point point; - debugC(3, kDebugPathfinding, "MGM::recalcOffsets. movements1 sz: %d movements2 sz: %d", item->movements1.size(), item->movements2.size()); + debugC(3, kDebugPathfinding, "AniHandler::recalcOffsets. 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]; @@ -551,7 +551,7 @@ int MGM::recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool flop) { int stidx = getStaticsIndex(idx, mov->_staticsObj2); int recalc = recalcOffsets(idx, stidx, st2idx, flip, flop); int sz = mov->_currMovement ? mov->_currMovement->_dynamicPhases.size() : mov->_dynamicPhases.size(); - debugC(1, kDebugPathfinding, "MGM::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::recalcOffsets, 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; @@ -608,8 +608,8 @@ int MGM::recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool flop) { return -1; } -int MGM::refreshOffsets(int objectId, int idx1, int idx2) { - debugC(4, kDebugPathfinding, "MGM::refreshOffsets(%d, %d, %d)", objectId, idx1, idx2); +int AniHandler::refreshOffsets(int objectId, int idx1, int idx2) { + debugC(4, kDebugPathfinding, "AniHandler::refreshOffsets(%d, %d, %d)", objectId, idx1, idx2); int idx = getItemIndexById(objectId); @@ -631,7 +631,7 @@ int MGM::refreshOffsets(int objectId, int idx1, int idx2) { return idx; } -Common::Point *MGM::calcLength(Common::Point *pRes, Movement *mov, int x, int y, int *mult, int *len, int flag) { +Common::Point *AniHandler::calcLength(Common::Point *pRes, Movement *mov, int x, int y, int *mult, int *len, int flag) { Common::Point point; mov->calcSomeXY(point, 0, -1); @@ -707,8 +707,8 @@ Common::Point *MGM::calcLength(Common::Point *pRes, Movement *mov, int x, int y, return pRes; } -ExCommand2 *MGM::buildExCommand2(Movement *mov, int objId, int x1, int y1, Common::Point *x2, Common::Point *y2, int len) { - debugC(2, kDebugPathfinding, "MGM::buildExCommand2(mov, %d, %d, %d, [%d, %d], [%d, %d], %d)", objId, x1, y1, x2->x, x2->y, y2->x, y2->y, len); +ExCommand2 *AniHandler::buildExCommand2(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); uint cnt; diff --git a/engines/fullpipe/anihandler.h b/engines/fullpipe/anihandler.h index 13195891dac..5632a8f9860 100644 --- a/engines/fullpipe/anihandler.h +++ b/engines/fullpipe/anihandler.h @@ -20,8 +20,8 @@ * */ -#ifndef FULLPIPE_MGM_H -#define FULLPIPE_MGM_H +#ifndef FULLPIPE_ANIHANDLER_H +#define FULLPIPE_ANIHANDLER_H namespace Fullpipe { @@ -66,7 +66,7 @@ struct MGMInfo { MGMInfo() { memset(this, 0, sizeof(MGMInfo)); } }; -class MGM : public CObject { +class AniHandler : public CObject { public: Common::Array _items; @@ -92,4 +92,4 @@ public: } // End of namespace Fullpipe -#endif /* FULLPIPE_MGM_H */ +#endif /* FULLPIPE_ANIHANDLER_H */ diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp index 164c5992c24..f62fde2e032 100644 --- a/engines/fullpipe/fullpipe.cpp +++ b/engines/fullpipe/fullpipe.cpp @@ -217,7 +217,7 @@ void FullpipeEngine::initialize() { _sceneRect.bottom = 599; _floaters = new Floaters; - _mgm = new MGM; + _mgm = new AniHandler; } void FullpipeEngine::restartGame() { diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h index eb387bbf3c4..6b57eb1c5ea 100644 --- a/engines/fullpipe/fullpipe.h +++ b/engines/fullpipe/fullpipe.h @@ -74,7 +74,7 @@ class GlobalMessageQueueList; struct MessageHandler; class MessageQueue; struct MovTable; -class MGM; +class AniHandler; class NGIArchive; class PictureObject; struct PreloadItem; @@ -210,7 +210,7 @@ public: MovTable *_movTable; Floaters *_floaters; - MGM *_mgm; + AniHandler *_mgm; Common::Array _arcadeKeys; diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h index 2b39d25f505..b67c9b1a570 100644 --- a/engines/fullpipe/motion.h +++ b/engines/fullpipe/motion.h @@ -149,7 +149,7 @@ public: int _ladder_field_20; int _ladder_field_24; Common::Array _ladmovements; - MGM _mgm; + AniHandler _mgm; public: MctlLadder(); @@ -282,7 +282,7 @@ public: int _field_44; Common::Array _items; MovArr *(*_callback1)(StaticANIObject *ani, Common::Array *items, signed int counter); - MGM _mgm; + AniHandler _mgm; public: MovGraph(); diff --git a/engines/fullpipe/scenes.h b/engines/fullpipe/scenes.h index 17ef5c3140c..43b1bf7dcf1 100644 --- a/engines/fullpipe/scenes.h +++ b/engines/fullpipe/scenes.h @@ -28,7 +28,7 @@ namespace Fullpipe { struct Bat; struct BehaviorMove; struct Hanger; -class MGM; +class AniHandler; class MctlLadder; struct Ring; class StaticANIObject; @@ -396,7 +396,7 @@ public: StaticANIObject *scene11_boots; StaticANIObject *scene11_dudeOnSwing; PictureObject *scene11_hint; - MGM scene11_mgm; + AniHandler scene11_mgm; bool scene11_arcadeIsOn; bool scene11_scrollIsEnabled; bool scene11_scrollIsMaximized; @@ -612,7 +612,7 @@ public: Common::Array scene29_bearders; int scene29_manX; int scene29_manY; - MGM scene29_mgm; + AniHandler scene29_mgm; StaticANIObject *scene30_leg; int scene30_liftFlag; diff --git a/engines/fullpipe/scenes/scene04.cpp b/engines/fullpipe/scenes/scene04.cpp index 6c361d6f1ab..c32bfbb77f0 100644 --- a/engines/fullpipe/scenes/scene04.cpp +++ b/engines/fullpipe/scenes/scene04.cpp @@ -395,7 +395,7 @@ void sceneHandler04_jumpOnLadder() { g_fp->_aniMan->_flags |= 1; - MGM mgm; + AniHandler mgm; MGMInfo mgminfo; mgm.addItem(ANI_MAN); @@ -460,7 +460,7 @@ void sceneHandler04_dropBottle() { } void sceneHandler04_gotoLadder(ExCommand *ex) { - MGM mgm; + AniHandler mgm; MGMInfo mgminfo; mgm.addItem(ANI_MAN); @@ -550,7 +550,7 @@ void sceneHandler04_raisePlank() { } MessageQueue *sceneHandler04_kozFly3(StaticANIObject *ani, double phase) { - MGM mgm; + AniHandler mgm; MGMInfo mgminfo; mgm.addItem(ANI_KOZAWKA); @@ -599,7 +599,7 @@ MessageQueue *sceneHandler04_kozFly3(StaticANIObject *ani, double phase) { } MessageQueue *sceneHandler04_kozFly5(StaticANIObject *ani, double phase) { - MGM mgm; + AniHandler mgm; MGMInfo mgminfo; mgm.addItem(ANI_KOZAWKA); @@ -670,7 +670,7 @@ MessageQueue *sceneHandler04_kozFly5(StaticANIObject *ani, double phase) { } MessageQueue *sceneHandler04_kozFly6(StaticANIObject *ani) { - MGM mgm; + AniHandler mgm; MGMInfo mgminfo; mgm.addItem(ANI_KOZAWKA); @@ -728,7 +728,7 @@ void sceneHandler04_kozMove(Movement *mov, int from, int to, Common::Point *poin } MessageQueue *sceneHandler04_kozFly7(StaticANIObject *ani, double phase) { - MGM mgm; + AniHandler mgm; MGMInfo mgminfo; mgm.addItem(ANI_KOZAWKA); diff --git a/engines/fullpipe/scenes/scene22.cpp b/engines/fullpipe/scenes/scene22.cpp index f51469da690..ce060dce49f 100644 --- a/engines/fullpipe/scenes/scene22.cpp +++ b/engines/fullpipe/scenes/scene22.cpp @@ -239,7 +239,7 @@ void sceneHandler22_stoolLogic(ExCommand *cmd) { goto LABEL_31; } - MGM mgm; + AniHandler mgm; MGMInfo mgminfo; mgm.addItem(ANI_MAN);