diff options
-rw-r--r-- | engines/fullpipe/gameloader.cpp | 72 | ||||
-rw-r--r-- | engines/fullpipe/gameloader.h | 24 | ||||
-rw-r--r-- | engines/fullpipe/objects.h | 25 | ||||
-rw-r--r-- | engines/fullpipe/stateloader.cpp | 72 |
4 files changed, 96 insertions, 97 deletions
diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp index fef7f56d46..fa8eddf7f1 100644 --- a/engines/fullpipe/gameloader.cpp +++ b/engines/fullpipe/gameloader.cpp @@ -404,6 +404,78 @@ void CGameLoader::updateSystems(int counterdiff) { } } +Sc2::Sc2() { + _sceneId = 0; + _field_2 = 0; + _scene = 0; + _motionController = 0; + _data1 = 0; + _count1 = 0; + _defPicAniInfos = 0; + _defPicAniInfosCount = 0; + _picAniInfos = 0; + _picAniInfosCount = 0; + _isLoaded = 0; + _entranceData = 0; + _entranceDataCount = 0; +} + +bool Sc2::load(MfcArchive &file) { + debug(5, "Sc2::load()"); + + _sceneId = file.readUint16LE(); + + _motionController = (CMotionController *)file.readClass(); + + _count1 = file.readUint32LE(); + debug(4, "count1: %d", _count1); + if (_count1 > 0) { + _data1 = (int32 *)malloc(_count1 * sizeof(int32)); + + for (int i = 0; i < _count1; i++) { + _data1[i] = file.readUint32LE(); + } + } else { + _data1 = 0; + } + + _defPicAniInfosCount = file.readUint32LE(); + debug(4, "defPicAniInfos: %d", _defPicAniInfosCount); + if (_defPicAniInfosCount > 0) { + _defPicAniInfos = (PicAniInfo **)malloc(_defPicAniInfosCount * sizeof(PicAniInfo *)); + + for (int i = 0; i < _defPicAniInfosCount; i++) { + _defPicAniInfos[i] = new PicAniInfo(); + + _defPicAniInfos[i]->load(file); + } + } else { + _defPicAniInfos = 0; + } + + _picAniInfos = 0; + _picAniInfosCount = 0; + + _entranceDataCount = file.readUint32LE(); + debug(4, "_entranceData: %d", _entranceDataCount); + + if (_entranceDataCount > 0) { + _entranceData = (EntranceInfo **)malloc(_entranceDataCount * sizeof(EntranceInfo *)); + + for (int i = 0; i < _entranceDataCount; i++) { + _entranceData[i] = new EntranceInfo(); + _entranceData[i]->load(file); + } + } else { + _entranceData = 0; + } + + if (file.size() - file.pos() > 0) + error("Sc2::load(): (%d bytes left)", file.size() - file.pos()); + + return true; +} + CGameVar *FullpipeEngine::getGameLoaderGameVar() { if (_gameLoader) return _gameLoader->_gameVar; diff --git a/engines/fullpipe/gameloader.h b/engines/fullpipe/gameloader.h index 6db9c98fb9..87cd1f1a35 100644 --- a/engines/fullpipe/gameloader.h +++ b/engines/fullpipe/gameloader.h @@ -33,6 +33,30 @@ class SceneTag; class CMctlCompound; class CInputController; class CInteractionController; +class CMotionController; + +class Sc2 : public CObject { + public: + int16 _sceneId; + int16 _field_2; + Scene *_scene; + CMotionController *_motionController; + int32 *_data1; // FIXME, could be a struct + int _count1; + PicAniInfo **_defPicAniInfos; + int _defPicAniInfosCount; + PicAniInfo **_picAniInfos; + int _picAniInfosCount; + int _isLoaded; + EntranceInfo **_entranceData; + int _entranceDataCount; + + public: + Sc2(); + virtual bool load(MfcArchive &file); +}; + +typedef Common::Array<Sc2> Sc2Array; struct PreloadItem { int preloadId1; diff --git a/engines/fullpipe/objects.h b/engines/fullpipe/objects.h index 008e684a68..9e7c7531a7 100644 --- a/engines/fullpipe/objects.h +++ b/engines/fullpipe/objects.h @@ -63,31 +63,6 @@ struct PicAniInfo { bool load(MfcArchive &file); }; -class CMotionController; - -class Sc2 : public CObject { - public: - int16 _sceneId; - int16 _field_2; - Scene *_scene; - CMotionController *_motionController; - int32 *_data1; // FIXME, could be a struct - int _count1; - PicAniInfo **_defPicAniInfos; - int _defPicAniInfosCount; - PicAniInfo **_picAniInfos; - int _picAniInfosCount; - int _isLoaded; - EntranceInfo **_entranceData; - int _entranceDataCount; - - public: - Sc2(); - virtual bool load(MfcArchive &file); -}; - -typedef Common::Array<Sc2> Sc2Array; - union VarValue { float floatValue; int32 intValue; diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp index 366872c277..dd00361ce9 100644 --- a/engines/fullpipe/stateloader.cpp +++ b/engines/fullpipe/stateloader.cpp @@ -314,78 +314,6 @@ CGameVar *CGameVar::getSubVarByIndex(int idx) { return sub; } -Sc2::Sc2() { - _sceneId = 0; - _field_2 = 0; - _scene = 0; - _motionController = 0; - _data1 = 0; - _count1 = 0; - _defPicAniInfos = 0; - _defPicAniInfosCount = 0; - _picAniInfos = 0; - _picAniInfosCount = 0; - _isLoaded = 0; - _entranceData = 0; - _entranceDataCount = 0; -} - -bool Sc2::load(MfcArchive &file) { - debug(5, "Sc2::load()"); - - _sceneId = file.readUint16LE(); - - _motionController = (CMotionController *)file.readClass(); - - _count1 = file.readUint32LE(); - debug(4, "count1: %d", _count1); - if (_count1 > 0) { - _data1 = (int32 *)malloc(_count1 * sizeof(int32)); - - for (int i = 0; i < _count1; i++) { - _data1[i] = file.readUint32LE(); - } - } else { - _data1 = 0; - } - - _defPicAniInfosCount = file.readUint32LE(); - debug(4, "defPicAniInfos: %d", _defPicAniInfosCount); - if (_defPicAniInfosCount > 0) { - _defPicAniInfos = (PicAniInfo **)malloc(_defPicAniInfosCount * sizeof(PicAniInfo *)); - - for (int i = 0; i < _defPicAniInfosCount; i++) { - _defPicAniInfos[i] = new PicAniInfo(); - - _defPicAniInfos[i]->load(file); - } - } else { - _defPicAniInfos = 0; - } - - _picAniInfos = 0; - _picAniInfosCount = 0; - - _entranceDataCount = file.readUint32LE(); - debug(4, "_entranceData: %d", _entranceDataCount); - - if (_entranceDataCount > 0) { - _entranceData = (EntranceInfo **)malloc(_entranceDataCount * sizeof(EntranceInfo *)); - - for (int i = 0; i < _entranceDataCount; i++) { - _entranceData[i] = new EntranceInfo(); - _entranceData[i]->load(file); - } - } else { - _entranceData = 0; - } - - if (file.size() - file.pos() > 0) - error("Sc2::load(): (%d bytes left)", file.size() - file.pos()); - - return true; -} - bool PicAniInfo::load(MfcArchive &file) { debug(5, "PicAniInfo::load()"); |