aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2013-07-20 21:28:32 +0300
committerEugene Sandulenko2013-09-06 14:51:03 +0300
commit62cbdd81f0843ad10fb768e8cf97222144cb8a1e (patch)
tree690e5a8277f0ac28c91d749fddad36d5506dc6ad /engines
parentc76bec26467efc8cad4554cf44903c9f927d3a8c (diff)
downloadscummvm-rg350-62cbdd81f0843ad10fb768e8cf97222144cb8a1e.tar.gz
scummvm-rg350-62cbdd81f0843ad10fb768e8cf97222144cb8a1e.tar.bz2
scummvm-rg350-62cbdd81f0843ad10fb768e8cf97222144cb8a1e.zip
FULLPIPE: Further work on sceneSwitcher.
Reduced header dependency. Put CGameLoader into separate files.
Diffstat (limited to 'engines')
-rw-r--r--engines/fullpipe/fullpipe.cpp1
-rw-r--r--engines/fullpipe/fullpipe.h23
-rw-r--r--engines/fullpipe/gameloader.cpp143
-rw-r--r--engines/fullpipe/gameloader.h76
-rw-r--r--engines/fullpipe/gfx.cpp1
-rw-r--r--engines/fullpipe/gfx.h2
-rw-r--r--engines/fullpipe/inventory.cpp8
-rw-r--r--engines/fullpipe/inventory.h2
-rw-r--r--engines/fullpipe/module.mk2
-rw-r--r--engines/fullpipe/objects.h56
-rw-r--r--engines/fullpipe/scene.h5
-rw-r--r--engines/fullpipe/scenes.cpp88
-rw-r--r--engines/fullpipe/sound.cpp5
-rw-r--r--engines/fullpipe/sound.h4
-rw-r--r--engines/fullpipe/stateloader.cpp128
-rw-r--r--engines/fullpipe/statics.h5
16 files changed, 331 insertions, 218 deletions
diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp
index fb8a141646..1d0b237e96 100644
--- a/engines/fullpipe/fullpipe.cpp
+++ b/engines/fullpipe/fullpipe.cpp
@@ -30,6 +30,7 @@
#include "fullpipe/fullpipe.h"
#include "fullpipe/objectnames.h"
#include "fullpipe/objects.h"
+#include "fullpipe/gameloader.h"
#include "fullpipe/messagequeue.h"
namespace Fullpipe {
diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h
index 31f44fda76..6a10f231ee 100644
--- a/engines/fullpipe/fullpipe.h
+++ b/engines/fullpipe/fullpipe.h
@@ -44,13 +44,15 @@ enum FullpipeGameFeatures {
};
class CGameLoader;
-class GameProject;
class CGameVar;
class CInventory2;
-class Scene;
+class EntranceInfo;
+class GameProject;
+class GlobalMessageQueueList;
class NGIArchive;
+class Scene;
+class SoundList;
class StaticANIObject;
-class GlobalMessageQueueList;
class FullpipeEngine : public ::Engine {
protected:
@@ -86,14 +88,21 @@ public:
int _gameProjectVersion;
int _pictureScale;
int _scrollSpeed;
- int _currSoundListCount;
- bool _soundEnabled;
- bool _flgSoundList;
+ bool _savesEnabled;
+ bool _updateFlag;
+ bool _flgCanOpenMap;
Common::Rect _sceneRect;
+ int _sceneWidth;
+ int _sceneHeight;
Scene *_scene2;
StaticANIObject *_aniMan;
+ SoundList *_currSoundList1[11];
+ int _currSoundListCount;
+ bool _soundEnabled;
+ bool _flgSoundList;
+
GlobalMessageQueueList *_globalMessageQueueList;
bool _needQuit;
@@ -106,11 +115,13 @@ public:
CGameVar *_swallowedEgg2;
CGameVar *_swallowedEgg3;
+ Scene *_inventoryScene;
CInventory2 *_inventory;
void setObjectState(const char *name, int state);
int getObjectEnumState(const char *name, const char *state);
+ bool sceneSwitcher(EntranceInfo *entrance);
Scene *accessScene(int sceneId);
NGIArchive *_currArchive;
diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp
new file mode 100644
index 0000000000..0f35fb7a72
--- /dev/null
+++ b/engines/fullpipe/gameloader.cpp
@@ -0,0 +1,143 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "fullpipe/fullpipe.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/scene.h"
+
+namespace Fullpipe {
+
+CGameLoader::CGameLoader() {
+ _interactionController = new CInteractionController();
+
+ _gameProject = 0;
+ //_gameName = "untitled";
+
+ //addMessageHandler2(CGameLoader_messageHandler1, 0, 0);
+ //insertMessageHandler(CGameLoader_messageHandler2, 0, 128);
+ //insertMessageHandler(CGameLoader_messageHandler3, 0, 1);
+
+ _field_FA = 0;
+ _field_F8 = 0;
+ _sceneSwitcher = 0;
+ _preloadCallback = 0;
+ _readSavegameCallback = 0;
+ _gameVar = 0;
+ _preloadId1 = 0;
+ _preloadId2 = 0;
+ _updateCounter = 0;
+
+ //g_x = 0;
+ //g_y = 0;
+ //dword_478480 = 0;
+ //g_objectId2 = 0;
+ //g_id = 0;
+}
+
+CGameLoader::~CGameLoader() {
+ free(_gameName);
+ delete _gameProject;
+}
+
+bool CGameLoader::load(MfcArchive &file) {
+ debug(5, "CGameLoader::load()");
+
+ _gameName = file.readPascalString();
+ debug(6, "_gameName: %s", _gameName);
+
+ _gameProject = new GameProject();
+
+ _gameProject->load(file);
+
+ g_fullpipe->_gameProject = _gameProject;
+
+ if (g_fullpipe->_gameProjectVersion < 12) {
+ error("Old gameProjectVersion: %d", g_fullpipe->_gameProjectVersion);
+ }
+
+ _gameName = file.readPascalString();
+ debug(6, "_gameName: %s", _gameName);
+
+ _inventory.load(file);
+
+ _interactionController->load(file);
+
+ debug(6, "sceneTag count: %d", _gameProject->_sceneTagList->size());
+
+ _sc2array.resize(_gameProject->_sceneTagList->size());
+
+ int i = 0;
+ for (SceneTagList::const_iterator it = _gameProject->_sceneTagList->begin(); it != _gameProject->_sceneTagList->end(); ++it, i++) {
+ char tmp[12];
+
+ snprintf(tmp, 11, "%04d.sc2", it->_sceneId);
+
+ debug(2, "sc: %s", tmp);
+
+ _sc2array[i].loadFile((const char *)tmp);
+ }
+
+ _preloadItems.load(file);
+
+ _field_FA = file.readUint16LE();
+ _field_F8 = file.readUint16LE();
+
+ _gameVar = (CGameVar *)file.readClass();
+
+ 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()");
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/gameloader.h b/engines/fullpipe/gameloader.h
new file mode 100644
index 0000000000..9322e458b0
--- /dev/null
+++ b/engines/fullpipe/gameloader.h
@@ -0,0 +1,76 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef FULLPIPE_GAMELOADER_H
+#define FULLPIPE_GAMELOADER_H
+
+#include "fullpipe/objects.h"
+#include "fullpipe/inventory.h"
+
+namespace Fullpipe {
+
+class SceneTag;
+
+class CGameLoader : public CObject {
+ public:
+ CGameLoader();
+ 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;
+
+ private:
+ GameProject *_gameProject;
+ CInteractionController *_interactionController;
+ int _field_C;
+ int _field_10;
+ int _field_14;
+ int _field_18;
+ int _field_1C;
+ int _field_20;
+ int _field_24;
+ int _field_28;
+ int _field_2C;
+ CInputController _inputController;
+ Sc2Array _sc2array;
+ void *_sceneSwitcher;
+ void *_preloadCallback;
+ void *_readSavegameCallback;
+ int16 _field_F8;
+ int16 _field_FA;
+ PreloadItems _preloadItems;
+ char *_gameName;
+ ExCommand _exCommand;
+ int _updateCounter;
+ int _preloadId1;
+ int _preloadId2;
+};
+
+} // End of namespace Fullpipe
+
+#endif /* FULLPIPE_GAMELOADER_H */
diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp
index 241b799168..5f6d75b33b 100644
--- a/engines/fullpipe/gfx.cpp
+++ b/engines/fullpipe/gfx.cpp
@@ -23,6 +23,7 @@
#include "fullpipe/fullpipe.h"
#include "fullpipe/objects.h"
+#include "fullpipe/gfx.h"
#include "common/memstream.h"
diff --git a/engines/fullpipe/gfx.h b/engines/fullpipe/gfx.h
index c420ffe9a2..3340b20e7c 100644
--- a/engines/fullpipe/gfx.h
+++ b/engines/fullpipe/gfx.h
@@ -124,6 +124,8 @@ class PictureObject : public GameObject {
};
class Background : public CObject {
+ friend class FullpipeEngine;
+
public:
CPtrList _picObjList;
diff --git a/engines/fullpipe/inventory.cpp b/engines/fullpipe/inventory.cpp
index 5c67e87d36..5ee85aab02 100644
--- a/engines/fullpipe/inventory.cpp
+++ b/engines/fullpipe/inventory.cpp
@@ -22,10 +22,16 @@
#include "fullpipe/fullpipe.h"
-#include "fullpipe/objects.h"
+#include "fullpipe/utils.h"
+#include "fullpipe/inventory.h"
+#include "fullpipe/gameloader.h"
namespace Fullpipe {
+CInventory2 *getGameLoaderInventory() {
+ return &g_fullpipe->_gameLoader->_inventory;
+}
+
bool CInventory::load(MfcArchive &file) {
debug(5, "CInventory::load()");
diff --git a/engines/fullpipe/inventory.h b/engines/fullpipe/inventory.h
index 36170b86bf..7991e2f3eb 100644
--- a/engines/fullpipe/inventory.h
+++ b/engines/fullpipe/inventory.h
@@ -103,6 +103,8 @@ class CInventory2 : public CInventory {
};
+CInventory2 *getGameLoaderInventory();
+
} // End of namespace Fullpipe
#endif /* FULLPIPE_INVENTORY_H */
diff --git a/engines/fullpipe/module.mk b/engines/fullpipe/module.mk
index 02a56269e4..cced876a25 100644
--- a/engines/fullpipe/module.mk
+++ b/engines/fullpipe/module.mk
@@ -3,12 +3,14 @@ MODULE := engines/fullpipe
MODULE_OBJS = \
detection.o \
fullpipe.o \
+ gameloader.o \
gfx.o \
inventory.o \
messagequeue.o \
motion.o \
ngiarchive.o \
scene.o \
+ scenes.o \
sound.o \
stateloader.o \
statics.o \
diff --git a/engines/fullpipe/objects.h b/engines/fullpipe/objects.h
index 6afab022f9..57f96b76c0 100644
--- a/engines/fullpipe/objects.h
+++ b/engines/fullpipe/objects.h
@@ -24,14 +24,11 @@
#define FULLPIPE_OBJECTS_H
#include "fullpipe/utils.h"
-#include "fullpipe/inventory.h"
-#include "fullpipe/gfx.h"
-#include "fullpipe/sound.h"
-#include "fullpipe/scene.h"
namespace Fullpipe {
class MessageQueue;
+class SceneTagList;
class GameProject : public CObject {
public:
@@ -124,11 +121,11 @@ struct PicAniInfo {
};
struct EntranceInfo {
- int32 sceneId;
- int32 field_4;
- int32 messageQueueId;
- byte gap_C[292]; // FIXME
- int32 field_130;
+ int32 _sceneId;
+ int32 _field_4;
+ int32 _messageQueueId;
+ byte _gap_C[292]; // FIXME
+ int32 _field_130;
bool load(MfcArchive &file);
};
@@ -232,47 +229,6 @@ class PreloadItems : public Common::Array<PreloadItem>, public CObject {
virtual bool load(MfcArchive &file);
};
-class CGameLoader : public CObject {
- public:
- CGameLoader();
- 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;
-
- private:
- GameProject *_gameProject;
- CInteractionController *_interactionController;
- int _field_C;
- int _field_10;
- int _field_14;
- int _field_18;
- int _field_1C;
- int _field_20;
- int _field_24;
- int _field_28;
- int _field_2C;
- CInputController _inputController;
- Sc2Array _sc2array;
- void *_sceneSwitcher;
- void *_preloadCallback;
- void *_readSavegameCallback;
- int16 _field_F8;
- int16 _field_FA;
- PreloadItems _preloadItems;
- char *_gameName;
- ExCommand _exCommand;
- int _updateCounter;
- int _preloadId1;
- int _preloadId2;
-};
-
class CObjstateCommand : public CObject {
ExCommand _cmd;
char *_objCommandName;
diff --git a/engines/fullpipe/scene.h b/engines/fullpipe/scene.h
index 8d1ea7ceb7..82041439cd 100644
--- a/engines/fullpipe/scene.h
+++ b/engines/fullpipe/scene.h
@@ -23,9 +23,14 @@
#ifndef FULLPIPE_SCENE_H
#define FULLPIPE_SCENE_H
+#include "fullpipe/gfx.h"
+
namespace Fullpipe {
class Scene : public Background {
+ friend class FullpipeEngine;
+
+ protected:
CPtrList _staticANIObjectList1;
CPtrList _staticANIObjectList2;
CPtrList _messageQueueList;
diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp
index 2dbe503e93..e3ebc22b80 100644
--- a/engines/fullpipe/scenes.cpp
+++ b/engines/fullpipe/scenes.cpp
@@ -22,27 +22,31 @@
#include "fullpipe/fullpipe.h"
+#include "fullpipe/utils.h"
+#include "fullpipe/gfx.h"
+#include "fullpipe/objects.h"
+#include "fullpipe/statics.h"
+#include "fullpipe/scene.h"
+#include "fullpipe/gameloader.h"
+#include "fullpipe/sound.h"
+
+#include "fullpipe/gameobj.h"
+
namespace Fullpipe {
-bool FullPipeEngine::sceneSwitcher(EntranceInfo *entrance) {
- CGameVar *sceneVar; // eax@21
- POINT *v6; // eax@3
- int v7; // eax@3
- CInventory2 *v8; // eax@4
- CInventory2 *v9; // eax@4
- int v10; // edi@8
- Sound *v11; // eax@9
- int v12; // ST08_4@12
- int v13; // eax@12
- Scene *v14; // edi@12
- int v15; // eax@13
- int v16; // eax@13
- int v17; // eax@13
- int v18; // eax@13
- CNode *v19; // edi@16
- CNode *v20; // eax@17
- Scene *v21; // eax@18
- PictureObject *v22; // eax@18
+bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
+ CGameVar *sceneVar;
+ int v12;
+ int v13;
+ Scene *v14;
+ int v15;
+ int v16;
+ int v17;
+ int v18;
+ CNode *v19;
+ CNode *v20;
+ Scene *v21;
+ PictureObject *v22;
Common::Point sceneDim;
Scene *scene = accessScene(entrance->_sceneId);
@@ -50,7 +54,7 @@ bool FullPipeEngine::sceneSwitcher(EntranceInfo *entrance) {
if (!scene)
return 0;
- ((PictureObject *)_picObjList.front())->getDimensions(&sceneDim);
+ ((PictureObject *)scene->_picObjList.front())->getDimensions(&sceneDim);
_sceneWidth = sceneDim.x;
_sceneHeight = sceneDim.y;
@@ -64,39 +68,39 @@ bool FullPipeEngine::sceneSwitcher(EntranceInfo *entrance) {
_aniMan->setOXY(0, 0);
_aniMan->clearFlags();
- _aniMan->callback1 = 0;
- _aniMan->callback2 = 0;
- _aniMan->shadowsOn = 1;
+ _aniMan->_callback1 = 0;
+ _aniMan->_callback2 = 0;
+ _aniMan->_shadowsOn = 1;
_scrollSpeed = 8;
- _savesEnabled = 1;
- _updateFlag = 1;
- _flgCanOpenMap = 1;
+ _savesEnabled = true;
+ _updateFlag = true;
+ _flgCanOpenMap = true;
- if (entrance->sceneId == SC_DBGMENU) {
+ if (entrance->_sceneId == SC_DBGMENU) {
_inventoryScene = 0;
} else {
_gameLoader->loadScene(SC_INV);
- v8 = getGameLoaderInventory();
- CInventory2_rebuildItemRects(v8);
- v9 = getGameLoaderInventory();
- g_inventoryScene = CInventory2_getScene(v9);
+ getGameLoaderInventory()->rebuildItemRects();
+ _inventoryScene = getGameLoaderInventory()->getScene();
}
- if (soundEnabled) {
- if (scene->soundList) {
- g_currSoundListCount = 2;
- v10 = 0;
- g_currSoundList1 = accessScene(SC_COMMON)->soundList;
- for (*(&g_currSoundList1 + 1) = scene->soundList; v10 < SoundList_getCount(scene->soundList); ++v10) {
- v11 = SoundList_getSoundByItemByIndex(scene->soundList, v10);
- (*(void (__thiscall **)(Sound *))(v11->MemoryObject.obj.vmt + offsetof(SoundVmt, updateVolume)))(v11);
+ if (_soundEnabled) {
+ if (scene->_soundList) {
+ _currSoundListCount = 2;
+ _currSoundList1[0] = accessScene(SC_COMMON)->_soundList;
+ _currSoundList1[1] = scene->_soundList;
+
+ for (int i = 0; i < scene->_soundList->getCount(); i++) {
+ scene->_soundList->getSoundByIndex(i)->updateVolume();
}
} else {
- g_currSoundListCount = 1;
- g_currSoundList1 = accessScene(SC_COMMON)->soundList;
+ _currSoundListCount = 1;
+ _currSoundList1[0] = accessScene(SC_COMMON)->_soundList;
}
}
+
+#if 0
v12 = scene->sceneId;
v13 = (int)getGameLoaderInteractionController();
CInteractionController_sortInteractions(v13, v12);
@@ -625,7 +629,7 @@ bool FullPipeEngine::sceneSwitcher(EntranceInfo *entrance) {
_behaviorManager->initBehavior(0, 0);
break;
}
-
+#endif
return true;
}
diff --git a/engines/fullpipe/sound.cpp b/engines/fullpipe/sound.cpp
index e1b2b331d9..8323a57bae 100644
--- a/engines/fullpipe/sound.cpp
+++ b/engines/fullpipe/sound.cpp
@@ -23,6 +23,7 @@
#include "fullpipe/fullpipe.h"
#include "fullpipe/objects.h"
+#include "fullpipe/sound.h"
#include "fullpipe/ngiarchive.h"
namespace Fullpipe {
@@ -101,4 +102,8 @@ bool Sound::load(MfcArchive &file, NGIArchive *archive) {
return true;
}
+void Sound::updateVolume() {
+ warning("STUB Sound::updateVolume()");
+}
+
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/sound.h b/engines/fullpipe/sound.h
index 4585aa79f7..93e994a720 100644
--- a/engines/fullpipe/sound.h
+++ b/engines/fullpipe/sound.h
@@ -37,6 +37,7 @@ class Sound : public MemoryObject {
public:
Sound();
bool load(MfcArchive &file, NGIArchive *archive);
+ void updateVolume();
};
class SoundList : public CObject {
@@ -48,6 +49,9 @@ class SoundList : public CObject {
SoundList();
bool load(MfcArchive &file, char *fname);
bool loadFile(const char *fname, char *libname);
+
+ int getCount() { return _soundItemsCount; }
+ Sound *getSoundByIndex(int idx) { return _soundItems[idx]; }
};
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp
index 4e9b0a3e42..08b09918aa 100644
--- a/engines/fullpipe/stateloader.cpp
+++ b/engines/fullpipe/stateloader.cpp
@@ -27,6 +27,9 @@
#include "common/list.h"
#include "fullpipe/objects.h"
+#include "fullpipe/gameloader.h"
+#include "fullpipe/scene.h"
+
#include "fullpipe/gameobj.h"
namespace Fullpipe {
@@ -40,7 +43,7 @@ bool FullpipeEngine::loadGam(const char *fname) {
//set_g_messageQueueCallback1(messageQueueCallback1);
//addMessageHandler2(global_messageHandler, 0, 4);
- _inventory = &_gameLoader->_inventory;
+ _inventory = getGameLoaderInventory();
_inventory->setItemFlags(ANI_INV_MAP, 0x10003);
_inventory->addItem(ANI_INV_MAP, 1);
@@ -117,119 +120,6 @@ bool FullpipeEngine::loadGam(const char *fname) {
return true;
}
-CGameLoader::CGameLoader() {
- _interactionController = new CInteractionController();
-
- _gameProject = 0;
- //_gameName = "untitled";
-
- //addMessageHandler2(CGameLoader_messageHandler1, 0, 0);
- //insertMessageHandler(CGameLoader_messageHandler2, 0, 128);
- //insertMessageHandler(CGameLoader_messageHandler3, 0, 1);
-
- _field_FA = 0;
- _field_F8 = 0;
- _sceneSwitcher = 0;
- _preloadCallback = 0;
- _readSavegameCallback = 0;
- _gameVar = 0;
- _preloadId1 = 0;
- _preloadId2 = 0;
- _updateCounter = 0;
-
- //g_x = 0;
- //g_y = 0;
- //dword_478480 = 0;
- //g_objectId2 = 0;
- //g_id = 0;
-}
-
-CGameLoader::~CGameLoader() {
- free(_gameName);
- delete _gameProject;
-}
-
-bool CGameLoader::load(MfcArchive &file) {
- debug(5, "CGameLoader::load()");
-
- _gameName = file.readPascalString();
- debug(6, "_gameName: %s", _gameName);
-
- _gameProject = new GameProject();
-
- _gameProject->load(file);
-
- g_fullpipe->_gameProject = _gameProject;
-
- if (g_fullpipe->_gameProjectVersion < 12) {
- error("Old gameProjectVersion: %d", g_fullpipe->_gameProjectVersion);
- }
-
- _gameName = file.readPascalString();
- debug(6, "_gameName: %s", _gameName);
-
- _inventory.load(file);
-
- _interactionController->load(file);
-
- debug(6, "sceneTag count: %d", _gameProject->_sceneTagList->size());
-
- _sc2array.resize(_gameProject->_sceneTagList->size());
-
- int i = 0;
- for (SceneTagList::const_iterator it = _gameProject->_sceneTagList->begin(); it != _gameProject->_sceneTagList->end(); ++it, i++) {
- char tmp[12];
-
- snprintf(tmp, 11, "%04d.sc2", it->_sceneId);
-
- debug(2, "sc: %s", tmp);
-
- _sc2array[i].loadFile((const char *)tmp);
- }
-
- _preloadItems.load(file);
-
- _field_FA = file.readUint16LE();
- _field_F8 = file.readUint16LE();
-
- _gameVar = (CGameVar *)file.readClass();
-
- 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;
@@ -631,11 +521,11 @@ bool PicAniInfo::load(MfcArchive &file) {
bool EntranceInfo::load(MfcArchive &file) {
debug(5, "EntranceInfo::load()");
- sceneId = file.readUint32LE();
- field_4 = file.readUint32LE();
- messageQueueId = file.readUint32LE();
- file.read(gap_C, 292); // FIXME, Ugh
- field_130 = file.readUint32LE();
+ _sceneId = file.readUint32LE();
+ _field_4 = file.readUint32LE();
+ _messageQueueId = file.readUint32LE();
+ file.read(_gap_C, 292); // FIXME, Ugh
+ _field_130 = file.readUint32LE();
return true;
}
diff --git a/engines/fullpipe/statics.h b/engines/fullpipe/statics.h
index d96435960a..f8df64ddc0 100644
--- a/engines/fullpipe/statics.h
+++ b/engines/fullpipe/statics.h
@@ -23,6 +23,8 @@
#ifndef FULLPIPE_STATICS_H
#define FULLPIPE_STATICS_H
+#include "fullpipe/gfx.h"
+
namespace Fullpipe {
class CStepArray : public CObject {
@@ -121,6 +123,9 @@ class Movement : public GameObject {
};
class StaticANIObject : public GameObject {
+ friend class FullpipeEngine;
+
+ protected:
Movement *_movementObj;
Statics *_staticsObj;
int _shadowsOn;