Skip to content

Commit

Permalink
FULLPIPE: Several methods for motion controller
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Sep 6, 2013
1 parent c4499bb commit 82b596a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
8 changes: 8 additions & 0 deletions engines/fullpipe/gameloader.cpp
Expand Up @@ -31,6 +31,14 @@ CInventory2 *getGameLoaderInventory() {
return &g_fullpipe->_gameLoader->_inventory;
}

CMctlCompound *getSc2MctlCompoundBySceneId(int16 sceneId) {
for (uint i = 0; i < g_fullpipe->_gameLoader->_sc2array.size(); i++)
if (g_fullpipe->_gameLoader->_sc2array[i]._sceneId == sceneId)
return (CMctlCompound *)g_fullpipe->_gameLoader->_sc2array[i]._motionController;

return 0;
}

CInteractionController *getGameLoaderInteractionController() {
return g_fullpipe->_gameLoader->_interactionController;
}
Expand Down
4 changes: 3 additions & 1 deletion engines/fullpipe/gameloader.h
Expand Up @@ -29,6 +29,7 @@
namespace Fullpipe {

class SceneTag;
class CMctlCompound;

class CGameLoader : public CObject {
public:
Expand All @@ -44,6 +45,7 @@ class CGameLoader : public CObject {
CGameVar *_gameVar;
CInventory2 _inventory;
CInteractionController *_interactionController;
Sc2Array _sc2array;

private:
GameProject *_gameProject;
Expand All @@ -57,7 +59,6 @@ class CGameLoader : public CObject {
int _field_28;
int _field_2C;
CInputController _inputController;
Sc2Array _sc2array;
void *_sceneSwitcher;
void *_preloadCallback;
void *_readSavegameCallback;
Expand All @@ -73,6 +74,7 @@ class CGameLoader : public CObject {

CInventory2 *getGameLoaderInventory();
CInteractionController *getGameLoaderInteractionController();
CMctlCompound *getSc2MctlCompoundBySceneId(int16 sceneId);

} // End of namespace Fullpipe

Expand Down
17 changes: 14 additions & 3 deletions engines/fullpipe/motion.h
Expand Up @@ -27,11 +27,16 @@ namespace Fullpipe {

class CMotionController : public CObject {
int _field_4;
int _isEnabled;
bool _isEnabled;

public:
CMotionController() : _isEnabled(1) {}
CMotionController() : _isEnabled(true) {}
virtual bool load(MfcArchive &file);

void setEnabled() { _isEnabled = true; }
void clearEnabled() { _isEnabled = false; }

virtual void addObject(StaticANIObject *obj) {}
};

class CMctlCompoundArray : public Common::Array<CObject>, public CObject {
Expand All @@ -49,6 +54,9 @@ class CMctlCompound : public CMotionController {

public:
virtual bool load(MfcArchive &file);

virtual void addObject(StaticANIObject *obj);
void initMovGraph2();
};

class Unk2 : public CObject {
Expand Down Expand Up @@ -76,10 +84,11 @@ class CMovGraphReact : public CObject {
// Empty
};

class CMctlCompoundArrayItem : public CMotionController {
class CMctlCompoundArrayItem : public CObject {
friend class CMctlCompound;

protected:
CMotionController *_motionControllerObj;
CMovGraphReact *_movGraphReactObj;
CMctlConnectionPointsArray _connectionPoints;
int _field_20;
Expand Down Expand Up @@ -149,6 +158,8 @@ class CMovGraph : public CMotionController {
public:
CMovGraph();
virtual bool load(MfcArchive &file);

virtual void addObject(StaticANIObject *obj);
};

class CMctlConnectionPoint : public CObject {
Expand Down
10 changes: 6 additions & 4 deletions engines/fullpipe/scenes.cpp
Expand Up @@ -29,6 +29,7 @@
#include "fullpipe/scene.h"
#include "fullpipe/gameloader.h"
#include "fullpipe/sound.h"
#include "fullpipe/motion.h"

#include "fullpipe/gameobj.h"

Expand Down Expand Up @@ -97,18 +98,19 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
_aniMan->_staticsObj = _aniMan->getStaticsById(ST_MAN_EMPTY);
_aniMan->setOXY(0, 0);

#if 0
if (_aniMan) {
_aniMan2 = _aniMan;
getSc2MotionControllerBySceneId(entrance->_sceneId)->initMovGraph2();
getSc2MotionControllerBySceneId(entrance->_sceneId)->addObject(_aniMan);
getSc2MotionControllerBySceneId(entrance->_sceneId)->setEnabled();
CMctlCompound *cmp = getSc2MctlCompoundBySceneId(entrance->_sceneId);
cmp->initMovGraph2();
cmp->addObject(_aniMan);
cmp->setEnabled();
getGameLoaderInteractionController()->enableFlag24();
input_setInputDisabled(0);
} else {
_aniMan2 = 0;
}

#if 0
scene->setPictureObjectsFlag4();

for (CPtrList::iterator s = scene->_staticANIObjectList1.begin(); s != scene->_staticANIObjectList1.end(); ++s) {
Expand Down

0 comments on commit 82b596a

Please sign in to comment.