diff options
| -rw-r--r-- | engines/fullpipe/objects.h | 28 | ||||
| -rw-r--r-- | engines/fullpipe/stateloader.cpp | 21 | ||||
| -rw-r--r-- | engines/fullpipe/utils.cpp | 12 | 
3 files changed, 49 insertions, 12 deletions
| diff --git a/engines/fullpipe/objects.h b/engines/fullpipe/objects.h index 5f547902ee..a974852dba 100644 --- a/engines/fullpipe/objects.h +++ b/engines/fullpipe/objects.h @@ -29,6 +29,8 @@ class CObject {   public:  	virtual bool load(MfcArchive &in) { return true; }  	virtual ~CObject() {} + +	bool loadFile(const char *fname);  };  class CObList : public Common::List<CObject>, public CObject { @@ -66,6 +68,7 @@ struct CNode {  typedef Common::Array<void *> CPtrList;  class SceneTag : public CObject { + public:  	int _field_4;  	char *_tag;  	int _scene; @@ -173,8 +176,26 @@ class CInputController {  	CInputController();  }; -class Sc2Array { -	CObArray _objs; +class Sc2 : public CObject { +	int16 _sceneId; +	int16 _field_2; +	//Scene *_scene; +	//CMotionController *_motionController; +	int _data1; +	int _count1; +	int _defPicAniInfos; +	int _defPicAniInfosCount; +	int _picAniInfos; +	int _picAniInfosCount; +	int _isLoaded; +	int _entranceData; +	int _entranceDataCount; + + public: +	virtual bool load(MfcArchive &file); +}; + +class Sc2Array : public Common::Array<Sc2> {  };  union VarValue { @@ -367,12 +388,11 @@ class PreloadItems : public Common::Array<PreloadItem>, public CObject {  	virtual bool load(MfcArchive &file);  }; -class CGameLoader { +class CGameLoader : public CObject {   public:  	CGameLoader();  	virtual ~CGameLoader(); -	bool loadFile(const char *fname);  	virtual bool load(MfcArchive &file);   private: diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp index e9c5c3aea2..4602cee487 100644 --- a/engines/fullpipe/stateloader.cpp +++ b/engines/fullpipe/stateloader.cpp @@ -76,7 +76,7 @@ CGameLoader::~CGameLoader() {  	delete _gameProject;  } -bool CGameLoader::loadFile(const char *fname) { +bool CObject::loadFile(const char *fname) {  	MfcArchive file;  	if (!file.open(fname)) @@ -106,7 +106,18 @@ bool CGameLoader::load(MfcArchive &file) {  	debug(6, "sceneTag count: %d", _gameProject->_sceneTagList->size()); -	// TODO: Load Sc2 +	_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(0, "sc: %d", it->_sceneId); + +		_sc2array[i].loadFile((const char *)tmp); +	}  	_preloadItems.load(file); @@ -469,4 +480,10 @@ bool CGameVar::load(MfcArchive &file) {  	return true;  } +bool Sc2::load(MfcArchive &file) { +	_sceneId = file.readUint16LE(); + +	return true; +} +  } // End of namespace Fullpipe diff --git a/engines/fullpipe/utils.cpp b/engines/fullpipe/utils.cpp index d85a01dd33..764da5abea 100644 --- a/engines/fullpipe/utils.cpp +++ b/engines/fullpipe/utils.cpp @@ -56,12 +56,12 @@ int MfcArchive::readCount() {  }  enum { -	kNullObject = 0, -	kCInteraction = 1, -	kMessageQueue = 2, -	kExCommand = 3, -	kCObjstateCommand = 4, -	kCGameVar = 5 +	kNullObject, +	kCInteraction, +	kMessageQueue, +	kExCommand, +	kCObjstateCommand, +	kCGameVar  };  const struct { | 
