diff options
author | Eugene Sandulenko | 2013-07-28 15:53:43 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2013-09-06 14:51:07 +0300 |
commit | 74b662516dec82d17d897510e7ef3a322e7fdd26 (patch) | |
tree | 3945c5c457b1251493efaacbd6ae868301d5360a /engines | |
parent | 4d215a849ddc7289615e9ba0a6916974c4d64b2a (diff) | |
download | scummvm-rg350-74b662516dec82d17d897510e7ef3a322e7fdd26.tar.gz scummvm-rg350-74b662516dec82d17d897510e7ef3a322e7fdd26.tar.bz2 scummvm-rg350-74b662516dec82d17d897510e7ef3a322e7fdd26.zip |
FULLPIPE: Implemented StaticANIObject::countMovements()
Diffstat (limited to 'engines')
-rw-r--r-- | engines/fullpipe/fullpipe.h | 2 | ||||
-rw-r--r-- | engines/fullpipe/gameloader.cpp | 7 | ||||
-rw-r--r-- | engines/fullpipe/gfx.h | 1 | ||||
-rw-r--r-- | engines/fullpipe/objects.h | 2 | ||||
-rw-r--r-- | engines/fullpipe/stateloader.cpp | 10 | ||||
-rw-r--r-- | engines/fullpipe/statics.cpp | 24 |
6 files changed, 43 insertions, 3 deletions
diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h index 0ae837d7b9..c058022312 100644 --- a/engines/fullpipe/fullpipe.h +++ b/engines/fullpipe/fullpipe.h @@ -91,6 +91,8 @@ public: GameProject *_gameProject; bool loadGam(const char *fname); + CGameVar *getGameLoaderGameVar(); + int _gameProjectVersion; int _pictureScale; int _scrollSpeed; diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp index 1641d4d81e..1049e1cc3d 100644 --- a/engines/fullpipe/gameloader.cpp +++ b/engines/fullpipe/gameloader.cpp @@ -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 diff --git a/engines/fullpipe/gfx.h b/engines/fullpipe/gfx.h index bfe21aaed1..27be7c474f 100644 --- a/engines/fullpipe/gfx.h +++ b/engines/fullpipe/gfx.h @@ -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 { diff --git a/engines/fullpipe/objects.h b/engines/fullpipe/objects.h index cc6fef581c..ba65181cf8 100644 --- a/engines/fullpipe/objects.h +++ b/engines/fullpipe/objects.h @@ -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 { diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp index 82c72b8eb9..6470b1c687 100644 --- a/engines/fullpipe/stateloader.cpp +++ b/engines/fullpipe/stateloader.cpp @@ -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; diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index 1f87721f01..cca12cef65 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -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) { |