aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe
diff options
context:
space:
mode:
authorEugene Sandulenko2013-07-13 11:51:36 +0300
committerEugene Sandulenko2013-09-06 14:48:17 +0300
commitcb38892ce8dbb3841b5731554e63214803109b08 (patch)
tree06305fbdcdd39c99e4d78bd3d652aef5b1a9112f /engines/fullpipe
parentd4e572843df01ce2307ca696ebc1db2775701205 (diff)
downloadscummvm-rg350-cb38892ce8dbb3841b5731554e63214803109b08.tar.gz
scummvm-rg350-cb38892ce8dbb3841b5731554e63214803109b08.tar.bz2
scummvm-rg350-cb38892ce8dbb3841b5731554e63214803109b08.zip
FULLPIPE: Continued on scene loading
Diffstat (limited to 'engines/fullpipe')
-rw-r--r--engines/fullpipe/gfx.cpp16
-rw-r--r--engines/fullpipe/objects.h5
-rw-r--r--engines/fullpipe/scene.cpp4
-rw-r--r--engines/fullpipe/scene.h1
-rw-r--r--engines/fullpipe/stateloader.cpp36
5 files changed, 60 insertions, 2 deletions
diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp
index 531bfd92bf..74037da238 100644
--- a/engines/fullpipe/gfx.cpp
+++ b/engines/fullpipe/gfx.cpp
@@ -92,7 +92,21 @@ void Background::addPictureObject(PictureObject *pct) {
}
void Background::renumPictures(PictureObject *pct) {
- warning("STUB: Background::renumPictures");
+ int *buf = (int *)calloc(_picObjList.size() + 2, sizeof(int));
+
+ for (uint i = 0; i < _picObjList.size(); i++) {
+ if (pct->_id == ((PictureObject *)_picObjList[i])->_id)
+ buf[((PictureObject *)_picObjList[i])->_field_4] = 1;
+ }
+
+ if (buf[pct->_field_4]) {
+ uint count;
+ for (count = 1; buf[count] && count < _picObjList.size() + 2; count++)
+ ;
+ pct->_field_4 = count;
+ }
+
+ free(buf);
}
PictureObject::PictureObject() {
diff --git a/engines/fullpipe/objects.h b/engines/fullpipe/objects.h
index 52383cc24c..0258ed4552 100644
--- a/engines/fullpipe/objects.h
+++ b/engines/fullpipe/objects.h
@@ -153,6 +153,7 @@ struct EntranceInfo {
class CMotionController;
class Sc2 : public CObject {
+ public:
int16 _sceneId;
int16 _field_2;
Scene *_scene;
@@ -254,6 +255,10 @@ class CGameLoader : public CObject {
virtual ~CGameLoader();
virtual bool load(MfcArchive &file);
+ bool loadScene(int num);
+
+ int getSceneTagBySceneId(int num, SceneTag **st);
+ void applyPicAniInfos(Scene *sc, PicAniInfo **picAniInfo, int picAniInfoCount);
CGameVar *_gameVar;
CInventory2 _inventory;
diff --git a/engines/fullpipe/scene.cpp b/engines/fullpipe/scene.cpp
index fb51b3b121..7a5d663bc3 100644
--- a/engines/fullpipe/scene.cpp
+++ b/engines/fullpipe/scene.cpp
@@ -225,4 +225,8 @@ void Scene::initStaticANIObjects() {
warning("STUB: Scene::initStaticANIObjects");
}
+void Scene::init() {
+ warning("STUB: Scene::init()");
+}
+
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scene.h b/engines/fullpipe/scene.h
index a797c69e02..e2bda176cf 100644
--- a/engines/fullpipe/scene.h
+++ b/engines/fullpipe/scene.h
@@ -42,6 +42,7 @@ class Scene : public Background {
Scene();
virtual bool load(MfcArchive &file);
void initStaticANIObjects();
+ void init();
};
class SceneTag : public CObject {
diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp
index 1f9b090d01..17faba41d5 100644
--- a/engines/fullpipe/stateloader.cpp
+++ b/engines/fullpipe/stateloader.cpp
@@ -100,7 +100,8 @@ bool FullpipeEngine::loadGam(const char *fname) {
#endif
_inventory->rebuildItemRects();
- // TODO
+
+ warning("STUB: loadGam()");
} else
return false;
@@ -185,6 +186,39 @@ bool CGameLoader::load(MfcArchive &file) {
return true;
}
+bool CGameLoader::loadScene(int num) {
+ SceneTag *st;
+
+ int idx = getSceneTagBySceneId(num, &st);
+
+ if (st->_scene)
+ st->loadScene();
+
+ if (st->_scene) {
+ st->_scene->init();
+
+ applyPicAniInfos(st->_scene, _sc2array[idx]._defPicAniInfos, _sc2array[idx]._defPicAniInfosCount);
+ applyPicAniInfos(st->_scene, _sc2array[idx]._picAniInfos, _sc2array[idx]._picAniInfosCount);
+
+ _sc2array[idx]._scene = st->_scene;
+ _sc2array[idx]._isLoaded = 1;
+
+ return true;
+ }
+
+ return false;
+}
+
+int CGameLoader::getSceneTagBySceneId(int num, SceneTag **st) {
+ warning("STUB: CGameLoader::getSceneTagBySceneId()");
+
+ return 0;
+}
+
+void CGameLoader::applyPicAniInfos(Scene *sc, PicAniInfo **picAniInfo, int picAniInfoCount) {
+ warning("STUB: CGameLoader::applyPicAniInfo()");
+}
+
GameProject::GameProject() {
_field_4 = 0;
_headerFilename = 0;