Skip to content

Commit

Permalink
FULLPIPE: Implemented StaticANIObject::countMovements()
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Sep 6, 2013
1 parent 4d215a8 commit 74b6625
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 3 deletions.
2 changes: 2 additions & 0 deletions engines/fullpipe/fullpipe.h
Expand Up @@ -91,6 +91,8 @@ class FullpipeEngine : public ::Engine {
GameProject *_gameProject;
bool loadGam(const char *fname);

CGameVar *getGameLoaderGameVar();

int _gameProjectVersion;
int _pictureScale;
int _scrollSpeed;
Expand Down
7 changes: 7 additions & 0 deletions engines/fullpipe/gameloader.cpp
Expand Up @@ -184,4 +184,11 @@ void CGameLoader::applyPicAniInfos(Scene *sc, PicAniInfo **picAniInfo, int picAn
warning("STUB: CGameLoader::applyPicAniInfo()");
}

CGameVar *FullpipeEngine::getGameLoaderGameVar() {
if (_gameLoader)
return _gameLoader->_gameVar;
else
return 0;
}

} // End of namespace Fullpipe
1 change: 1 addition & 0 deletions engines/fullpipe/gfx.h
Expand Up @@ -128,6 +128,7 @@ class GameObject : public CObject {
void renumPictures(CPtrList *lst);
void setFlags(int16 flags) { _flags = flags; }
void clearFlags() { _flags = 0; }
const char *getName() { return _objectName; }
};

class PictureObject : public GameObject {
Expand Down
2 changes: 1 addition & 1 deletion engines/fullpipe/objects.h
Expand Up @@ -162,7 +162,7 @@ class CGameVar : public CObject {
int getSubVarAsInt(const char *name);
CGameVar *addSubVarAsInt(const char *name, int value);
bool addSubVar(CGameVar *subvar);

int getSubVarsCount();
};

struct PreloadItem {
Expand Down
10 changes: 10 additions & 0 deletions engines/fullpipe/stateloader.cpp
Expand Up @@ -384,6 +384,16 @@ bool CGameVar::addSubVar(CGameVar *subvar) {
return false;
}

int CGameVar::getSubVarsCount() {
int res;
CGameVar *sub = _subVars;

for (res = 0; sub; res++)
sub = sub->_nextVarObj;

return res;
}

Sc2::Sc2() {
_sceneId = 0;
_field_2 = 0;
Expand Down
24 changes: 22 additions & 2 deletions engines/fullpipe/statics.cpp
Expand Up @@ -239,9 +239,29 @@ void StaticANIObject::draw2() {
}

MovTable *StaticANIObject::countMovements() {
warning("STUB: StaticANIObject::countMovements()");
CGameVar *preloadSubVar = g_fullpipe->getGameLoaderGameVar()->getSubVarByName(getName())->getSubVarByName("PRELOAD");

return 0;
if (preloadSubVar || preloadSubVar->getSubVarsCount() == 0)
return 0;

MovTable *movTable = new MovTable;

movTable->count = _movements.size();
movTable->movs = (int16 *)calloc(_movements.size(), sizeof(int16));

for (uint i = 0; i < _movements.size(); i++) {
GameObject *obj = (GameObject *)_movements[i];
movTable->movs[i] = 2;

for (CGameVar *sub = preloadSubVar->_subVars; sub; sub = sub->_nextVarObj) {
if (scumm_stricmp(obj->getName(), sub->_varName) == 0) {
movTable->movs[i] = 1;
break;
}
}
}

return movTable;
}

void StaticANIObject::setSpeed(int speed) {
Expand Down

0 comments on commit 74b6625

Please sign in to comment.