diff options
Diffstat (limited to 'engines/fullpipe/stateloader.cpp')
-rw-r--r-- | engines/fullpipe/stateloader.cpp | 63 |
1 files changed, 62 insertions, 1 deletions
diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp index 1959bffd47..9a45fadcee 100644 --- a/engines/fullpipe/stateloader.cpp +++ b/engines/fullpipe/stateloader.cpp @@ -21,11 +21,14 @@ */ #include "fullpipe/fullpipe.h" + +#include "common/file.h" + #include "fullpipe/objects.h" namespace Fullpipe { -bool FullpipeEngine::loadGam(char *fname) { +bool FullpipeEngine::loadGam(const char *fname) { g_gameLoader = new CGameLoader(); if (g_gameLoader->loadFile(fname)) { @@ -36,4 +39,62 @@ bool FullpipeEngine::loadGam(char *fname) { return true; } +bool CGameLoader::loadFile(const char *fname) { + Common::File file; + + if (!file.open(fname)) + return false; + + char *tmp; + int len = file.readByte(); + tmp = (char *)calloc(len + 1, 1); + file.read(tmp, len); + + _gameName = tmp; + + _gameProject = new GameProject(file); + + return true; +} + +CGameLoader::~CGameLoader() { + free(_gameName); +} + +GameProject::GameProject(Common::File &file) { + _field_4 = 0; + _headerFilename = 0; + _field_10 = 12; + + // FIXME + int _gameProjectVersion = file.readUint32LE(); + int _gameProjectValue = file.readUint16LE(); + int _scrollSpeed = file.readUint32LE(); + + char *tmp; + int len = file.readByte(); + tmp = (char *)calloc(len + 1, 1); + file.read(tmp, len); + + _headerFilename = tmp; + + _sceneTagList = new SceneTagList(file); + + debug(0, "_gameProjectVersion = %d", _gameProjectVersion); + debug(0, "_gameProjectValue = %d", _gameProjectValue); + debug(0, "_scrollSpeed = %d", _scrollSpeed); + debug(0, "_headerFilename = %s", _headerFilename); + + if (_gameProjectVersion >= 3) + _field_4 = file.readUint32LE(); + + if (_gameProjectVersion >= 5) { + file.readUint32LE(); + file.readUint32LE(); + } +} + +SceneTagList::SceneTagList(Common::File &file) { +} + } // End of namespace Fullpipe |