Skip to content

Commit

Permalink
FULLPIPE: Implement StaticANIObject::changeStatics2()
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Dec 11, 2013
1 parent edbf2d4 commit 8caec76
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 2 deletions.
3 changes: 3 additions & 0 deletions engines/fullpipe/fullpipe.cpp
Expand Up @@ -35,6 +35,7 @@
#include "fullpipe/input.h"
#include "fullpipe/scenes.h"
#include "fullpipe/floaters.h"
#include "fullpipe/motion.h"
#include "fullpipe/console.h"

namespace Fullpipe {
Expand Down Expand Up @@ -100,6 +101,7 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc)
_scene2 = 0;
_movTable = 0;
_floaters = 0;
_mgm = 0;

_globalMessageQueueList = 0;
_messageHandlers = 0;
Expand Down Expand Up @@ -168,6 +170,7 @@ void FullpipeEngine::initialize() {
_sceneRect.bottom = 599;

_floaters = new Floaters;
_mgm = new MGM;
}

Common::Error FullpipeEngine::run() {
Expand Down
2 changes: 2 additions & 0 deletions engines/fullpipe/fullpipe.h
Expand Up @@ -61,6 +61,7 @@ class GameObject;
class GlobalMessageQueueList;
struct MessageHandler;
struct MovTable;
class MGM;
class NGIArchive;
class Scene;
class SoundList;
Expand Down Expand Up @@ -173,6 +174,7 @@ class FullpipeEngine : public ::Engine {
MovTable *_movTable;

Floaters *_floaters;
MGM *_mgm;

void initMap();
void updateMapPiece(int mapId, int update);
Expand Down
4 changes: 4 additions & 0 deletions engines/fullpipe/motion.cpp
Expand Up @@ -1519,6 +1519,10 @@ MessageQueue *MGM::genMovement(MGMInfo *mgminfo) {
return 0;
}

void MGM::updateAnimStatics(StaticANIObject *ani, int staticsId) {
warning("STUB: MGM::updateAnimStatics()");
}

MovGraphLink::MovGraphLink() {
_distance = 0;
_angle = 0;
Expand Down
1 change: 1 addition & 0 deletions engines/fullpipe/motion.h
Expand Up @@ -159,6 +159,7 @@ class MGM : public CObject {
int getItemIndexById(int objId);

MessageQueue *genMovement(MGMInfo *mgminfo);
void updateAnimStatics(StaticANIObject *ani, int staticsId);
};

struct MctlLadderMovementVars {
Expand Down
21 changes: 19 additions & 2 deletions engines/fullpipe/statics.cpp
Expand Up @@ -27,6 +27,7 @@
#include "fullpipe/statics.h"
#include "fullpipe/messages.h"
#include "fullpipe/interaction.h"
#include "fullpipe/motion.h"

#include "fullpipe/constants.h"
#include "fullpipe/objectnames.h"
Expand Down Expand Up @@ -880,7 +881,23 @@ MessageQueue *StaticANIObject::changeStatics1(int msgNum) {
}

void StaticANIObject::changeStatics2(int objId) {
warning("STUB: StaticANIObject::changeStatics2(%d)", objId);
_animExFlag = 0;

deleteFromGlobalMessageQueue();

if (_movement || _statics) {
g_fullpipe->_mgm->addItem(_id);
g_fullpipe->_mgm->updateAnimStatics(this, objId);
} else {
_statics = getStaticsById(objId);
}

if (_messageQueueId) {
if (g_fullpipe->_globalMessageQueueList->getMessageQueueById(_messageQueueId))
g_fullpipe->_globalMessageQueueList->deleteQueueById(_messageQueueId);

_messageQueueId = 0;
}
}

void StaticANIObject::hide() {
Expand Down Expand Up @@ -1664,7 +1681,7 @@ bool Movement::gotoNextFrame(void (*callback1)(int, Common::Point *point, int, i
point.x = _framePosOffsets[_currDynamicPhaseIndex]->x;
point.y = _framePosOffsets[_currDynamicPhaseIndex]->y;

//callback1(_currDynamicPhaseIndex, &point, _ox, _oy);
callback1(_currDynamicPhaseIndex, &point, _ox, _oy);
_ox += point.x;
_oy += point.y;
} else if (oldDynIndex >= _currDynamicPhaseIndex) {
Expand Down

0 comments on commit 8caec76

Please sign in to comment.