FULLPIPE: Move Sc2 to gameloader.h

This commit is contained in:
Eugene Sandulenko 2013-09-12 22:50:55 +03:00
parent 6cd830fb1b
commit e8f4c28d10
4 changed files with 96 additions and 97 deletions

View file

@ -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()");