2013-06-01 10:01:25 +00:00
|
|
|
/* 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"
|
2013-06-01 14:20:40 +00:00
|
|
|
|
|
|
|
#include "common/file.h"
|
2013-06-03 21:53:23 +00:00
|
|
|
#include "common/array.h"
|
2013-06-02 20:51:33 +00:00
|
|
|
#include "common/list.h"
|
2013-06-01 14:20:40 +00:00
|
|
|
|
2013-06-01 10:01:25 +00:00
|
|
|
#include "fullpipe/objects.h"
|
2013-07-20 18:28:32 +00:00
|
|
|
#include "fullpipe/gameloader.h"
|
|
|
|
#include "fullpipe/scene.h"
|
2013-07-27 20:54:06 +00:00
|
|
|
#include "fullpipe/statics.h"
|
2013-07-20 18:28:32 +00:00
|
|
|
|
2013-07-30 09:36:33 +00:00
|
|
|
#include "fullpipe/constants.h"
|
2013-06-01 10:01:25 +00:00
|
|
|
|
|
|
|
namespace Fullpipe {
|
|
|
|
|
2013-06-01 14:20:40 +00:00
|
|
|
bool FullpipeEngine::loadGam(const char *fname) {
|
2013-06-19 18:46:25 +00:00
|
|
|
_gameLoader = new CGameLoader();
|
2013-06-01 10:01:25 +00:00
|
|
|
|
2013-07-28 14:22:18 +00:00
|
|
|
if (!_gameLoader->loadFile(fname))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
_currSoundListCount = 0;
|
|
|
|
initObjectStates();
|
|
|
|
// set_g_messageQueueCallback1(messageQueueCallback1);
|
|
|
|
|
|
|
|
addMessageHandlerByIndex(global_messageHandler1, 0, 4);
|
|
|
|
|
|
|
|
_inventory = getGameLoaderInventory();
|
|
|
|
_inventory->setItemFlags(ANI_INV_MAP, 0x10003);
|
|
|
|
_inventory->addItem(ANI_INV_MAP, 1);
|
2013-06-20 19:26:21 +00:00
|
|
|
|
2013-07-28 14:22:18 +00:00
|
|
|
_inventory->rebuildItemRects();
|
2013-06-26 23:45:23 +00:00
|
|
|
|
2013-07-28 14:22:18 +00:00
|
|
|
for (CPtrList::iterator p = _inventory->getScene()->_picObjList.begin(); p != _inventory->getScene()->_picObjList.end(); ++p) {
|
|
|
|
((MemoryObject *)((PictureObject *)*p)->_picture)->load();
|
|
|
|
}
|
2013-07-06 19:45:11 +00:00
|
|
|
|
2013-07-28 14:22:18 +00:00
|
|
|
// _sceneSwitcher = sceneSwitcher;
|
|
|
|
// _preloadCallback = gameLoaderPreloadCallback
|
|
|
|
// _readSavegameCallback = gameLoaderReadSavegameCallback;
|
2013-07-20 13:08:05 +00:00
|
|
|
|
2013-07-28 14:22:18 +00:00
|
|
|
_aniMan = accessScene(SC_COMMON)->getAniMan();
|
|
|
|
_scene2 = 0;
|
2013-07-28 11:54:25 +00:00
|
|
|
|
2013-07-28 14:22:18 +00:00
|
|
|
_movTable = _aniMan->countMovements();
|
2013-07-27 20:54:06 +00:00
|
|
|
|
2013-07-28 14:22:18 +00:00
|
|
|
_aniMan->setSpeed(1);
|
2013-07-27 20:54:06 +00:00
|
|
|
|
2013-07-28 14:22:18 +00:00
|
|
|
PictureObject *pic = accessScene(SC_INV)->getPictureObjectById(PIC_INV_MENU, 0);
|
2013-07-27 20:54:06 +00:00
|
|
|
|
2013-07-28 14:22:18 +00:00
|
|
|
pic->setFlags(pic->_flags & 0xFFFB);
|
2013-07-27 20:54:06 +00:00
|
|
|
|
2013-07-28 14:22:18 +00:00
|
|
|
// Not used in full game
|
|
|
|
//_evalVersionPic = accessScene(SC_COMMON)->getPictureObjectById(PIC_CMN_EVAL, 0);
|
2013-07-27 20:54:06 +00:00
|
|
|
|
2013-07-28 14:22:18 +00:00
|
|
|
initMap();
|
|
|
|
initCursors();
|
2013-07-27 20:54:06 +00:00
|
|
|
|
2013-07-28 14:22:18 +00:00
|
|
|
setMusicAllowed(_gameLoader->_gameVar->getSubVarAsInt("MUSIC_ALLOWED"));
|
2013-07-27 20:54:06 +00:00
|
|
|
|
2013-07-28 14:22:18 +00:00
|
|
|
if (_flgPlayIntro) {
|
|
|
|
_gameLoader->loadScene(SC_INTRO1);
|
|
|
|
_gameLoader->gotoScene(SC_INTRO1, TrubaUp);
|
|
|
|
} else {
|
|
|
|
_gameLoader->loadScene(SC_1);
|
|
|
|
_gameLoader->gotoScene(SC_1, TrubaLeft);
|
|
|
|
}
|
2013-07-28 11:54:25 +00:00
|
|
|
|
2013-07-28 14:22:18 +00:00
|
|
|
if (!_currentScene)
|
2013-06-01 10:01:25 +00:00
|
|
|
return false;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-06-06 20:52:43 +00:00
|
|
|
GameProject::GameProject() {
|
2013-06-01 14:20:40 +00:00
|
|
|
_field_4 = 0;
|
|
|
|
_headerFilename = 0;
|
|
|
|
_field_10 = 12;
|
2013-06-06 20:52:43 +00:00
|
|
|
}
|
2013-06-01 14:20:40 +00:00
|
|
|
|
2013-06-06 20:52:43 +00:00
|
|
|
bool GameProject::load(MfcArchive &file) {
|
2013-07-12 06:03:02 +00:00
|
|
|
debug(5, "GameProject::load()");
|
|
|
|
|
2013-06-08 21:27:42 +00:00
|
|
|
_field_4 = 0;
|
|
|
|
_headerFilename = 0;
|
|
|
|
_field_10 = 12;
|
|
|
|
|
2013-06-20 22:13:18 +00:00
|
|
|
g_fullpipe->_gameProjectVersion = file.readUint32LE();
|
2013-07-12 06:03:02 +00:00
|
|
|
g_fullpipe->_pictureScale = file.readUint16LE();
|
2013-06-20 22:13:18 +00:00
|
|
|
g_fullpipe->_scrollSpeed = file.readUint32LE();
|
2013-06-01 14:20:40 +00:00
|
|
|
|
2013-06-02 19:52:37 +00:00
|
|
|
_headerFilename = file.readPascalString();
|
2013-06-01 14:20:40 +00:00
|
|
|
|
2013-06-20 22:13:18 +00:00
|
|
|
debug(1, "_gameProjectVersion = %d", g_fullpipe->_gameProjectVersion);
|
2013-07-12 06:03:02 +00:00
|
|
|
debug(1, "_pictureScale = %d", g_fullpipe->_pictureScale);
|
2013-06-20 22:13:18 +00:00
|
|
|
debug(1, "_scrollSpeed = %d", g_fullpipe->_scrollSpeed);
|
2013-06-10 22:34:37 +00:00
|
|
|
debug(1, "_headerFilename = %s", _headerFilename);
|
2013-06-01 14:20:40 +00:00
|
|
|
|
2013-06-06 20:52:43 +00:00
|
|
|
_sceneTagList = new SceneTagList();
|
|
|
|
|
|
|
|
_sceneTagList->load(file);
|
2013-06-02 21:18:49 +00:00
|
|
|
|
2013-06-20 22:13:18 +00:00
|
|
|
if (g_fullpipe->_gameProjectVersion >= 3)
|
2013-06-01 14:20:40 +00:00
|
|
|
_field_4 = file.readUint32LE();
|
|
|
|
|
2013-06-20 22:13:18 +00:00
|
|
|
if (g_fullpipe->_gameProjectVersion >= 5) {
|
2013-06-01 14:20:40 +00:00
|
|
|
file.readUint32LE();
|
|
|
|
file.readUint32LE();
|
|
|
|
}
|
2013-06-06 20:52:43 +00:00
|
|
|
|
|
|
|
return true;
|
2013-06-01 14:20:40 +00:00
|
|
|
}
|
|
|
|
|
2013-06-02 19:52:37 +00:00
|
|
|
GameProject::~GameProject() {
|
|
|
|
free(_headerFilename);
|
|
|
|
}
|
|
|
|
|
2013-06-06 21:49:50 +00:00
|
|
|
bool CInteractionController::load(MfcArchive &file) {
|
2013-07-12 06:03:02 +00:00
|
|
|
debug(5, "CInteractionController::load()");
|
|
|
|
|
2013-06-06 21:49:50 +00:00
|
|
|
return _interactions.load(file);
|
|
|
|
}
|
|
|
|
|
2013-07-20 20:55:04 +00:00
|
|
|
void CInteractionController::sortInteractions(int sceneId) {
|
|
|
|
warning("STUB: CInteractionController::sortInteractions(%d)", sceneId);
|
|
|
|
}
|
|
|
|
|
2013-06-07 20:56:40 +00:00
|
|
|
CInteraction::CInteraction() {
|
|
|
|
_objectId1 = 0;
|
|
|
|
_objectId2 = 0;
|
|
|
|
_staticsId1 = 0;
|
|
|
|
_objectId3 = 0;
|
|
|
|
_objectState2 = 0;
|
|
|
|
_objectState1 = 0;
|
|
|
|
_messageQueue = 0;
|
|
|
|
_flags = 0;
|
|
|
|
_yOffs = 0;
|
|
|
|
_xOffs = 0;
|
|
|
|
_staticsId2 = 0;
|
|
|
|
_field_28 = 0;
|
|
|
|
_sceneId = -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CInteraction::load(MfcArchive &file) {
|
2013-07-12 06:03:02 +00:00
|
|
|
debug(5, "CInteraction::load()");
|
|
|
|
|
2013-06-07 20:56:40 +00:00
|
|
|
_objectId1 = file.readUint16LE();
|
|
|
|
_objectId2 = file.readUint16LE();
|
|
|
|
_staticsId1 = file.readUint16LE();
|
|
|
|
_staticsId2 = file.readUint16LE();
|
|
|
|
_objectId3 = file.readUint16LE();
|
|
|
|
_objectState2 = file.readUint32LE();
|
|
|
|
_objectState1 = file.readUint32LE();
|
|
|
|
_xOffs = file.readUint32LE();
|
|
|
|
_yOffs = file.readUint32LE();
|
|
|
|
_sceneId = file.readUint32LE();
|
|
|
|
_flags = file.readUint32LE();
|
2013-07-19 15:13:00 +00:00
|
|
|
_actionName = file.readPascalString();
|
2013-06-07 20:56:40 +00:00
|
|
|
|
2013-06-09 22:03:15 +00:00
|
|
|
_messageQueue = (MessageQueue *)file.readClass();
|
2013-06-08 21:27:42 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-06-09 22:03:15 +00:00
|
|
|
bool PreloadItems::load(MfcArchive &file) {
|
2013-07-12 06:03:02 +00:00
|
|
|
debug(5, "PreloadItems::load()");
|
|
|
|
|
2013-06-09 22:03:15 +00:00
|
|
|
int count = file.readCount();
|
|
|
|
|
|
|
|
resize(count);
|
|
|
|
|
|
|
|
for (int i = 0; i < count; i++) {
|
|
|
|
PreloadItem *t = new PreloadItem();
|
|
|
|
t->preloadId1 = file.readUint32LE();
|
|
|
|
t->preloadId2 = file.readUint32LE();
|
|
|
|
t->sceneId = file.readUint32LE();
|
|
|
|
t->field_C = file.readUint32LE();
|
|
|
|
|
|
|
|
push_back(*t);
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
CGameVar::CGameVar() {
|
|
|
|
_subVars = 0;
|
|
|
|
_parentVarObj = 0;
|
|
|
|
_nextVarObj = 0;
|
|
|
|
_prevVarObj = 0;
|
|
|
|
_field_14 = 0;
|
|
|
|
_varType = 0;
|
|
|
|
_value.floatValue = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CGameVar::load(MfcArchive &file) {
|
2013-07-19 15:13:00 +00:00
|
|
|
_varName = file.readPascalString();
|
2013-06-09 22:03:15 +00:00
|
|
|
_varType = file.readUint32LE();
|
|
|
|
|
2013-06-10 22:34:37 +00:00
|
|
|
debugN(6, "[%03d] ", file.getLevel());
|
|
|
|
for (int i = 0; i < file.getLevel(); i++)
|
|
|
|
debugN(6, " ");
|
|
|
|
|
2013-07-19 15:13:00 +00:00
|
|
|
debugN(6, "<%s>: ", transCyrillic((byte *)_varName));
|
2013-06-10 22:34:37 +00:00
|
|
|
|
2013-06-09 22:03:15 +00:00
|
|
|
switch (_varType) {
|
|
|
|
case 0:
|
|
|
|
_value.intValue = file.readUint32LE();
|
2013-06-10 22:34:37 +00:00
|
|
|
debug(6, "d --> %d", _value.intValue);
|
2013-06-09 22:03:15 +00:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
_value.intValue = file.readUint32LE(); // FIXME
|
2013-06-10 22:34:37 +00:00
|
|
|
debug(6, "f --> %f", _value.floatValue);
|
2013-06-09 22:03:15 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
_value.stringValue = file.readPascalString();
|
2013-06-10 22:34:37 +00:00
|
|
|
debug(6, "s --> %s", _value.stringValue);
|
2013-06-09 22:03:15 +00:00
|
|
|
break;
|
|
|
|
default:
|
2013-06-10 22:17:11 +00:00
|
|
|
error("Unknown var type: %d (0x%x)", _varType, _varType);
|
2013-06-09 22:03:15 +00:00
|
|
|
}
|
|
|
|
|
2013-06-10 22:34:37 +00:00
|
|
|
file.incLevel();
|
2013-06-09 22:03:15 +00:00
|
|
|
_parentVarObj = (CGameVar *)file.readClass();
|
|
|
|
_prevVarObj = (CGameVar *)file.readClass();
|
|
|
|
_nextVarObj = (CGameVar *)file.readClass();
|
|
|
|
_field_14 = (CGameVar *)file.readClass();
|
|
|
|
_subVars = (CGameVar *)file.readClass();
|
2013-06-10 22:34:37 +00:00
|
|
|
file.decLevel();
|
2013-06-09 22:03:15 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-06-19 18:46:25 +00:00
|
|
|
CGameVar *CGameVar::getSubVarByName(const char *name) {
|
2013-07-06 19:56:11 +00:00
|
|
|
CGameVar *sv = 0;
|
2013-06-19 18:46:25 +00:00
|
|
|
|
2013-07-06 19:56:11 +00:00
|
|
|
if (_subVars != 0) {
|
|
|
|
sv = _subVars;
|
2013-07-19 15:13:00 +00:00
|
|
|
for (;sv && scumm_stricmp(sv->_varName, name); sv = sv->_nextVarObj)
|
2013-07-06 19:56:11 +00:00
|
|
|
;
|
|
|
|
}
|
|
|
|
return sv;
|
2013-06-19 18:46:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool CGameVar::setSubVarAsInt(const char *name, int value) {
|
2013-07-06 19:56:11 +00:00
|
|
|
CGameVar *var = getSubVarByName(name);
|
2013-06-19 18:46:25 +00:00
|
|
|
|
2013-07-06 19:56:11 +00:00
|
|
|
if (var) {
|
|
|
|
if (var->_varType == 0) {
|
|
|
|
var->_value.intValue = value;
|
2013-06-19 18:46:25 +00:00
|
|
|
|
2013-07-06 19:56:11 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2013-06-19 18:46:25 +00:00
|
|
|
|
2013-07-06 19:56:11 +00:00
|
|
|
var = new CGameVar();
|
|
|
|
var->_varType = 0;
|
|
|
|
var->_value.intValue = value;
|
2013-07-19 15:13:00 +00:00
|
|
|
var->_varName = (char *)calloc(strlen(name) + 1, 1);
|
|
|
|
strcpy(var->_varName, name);
|
2013-06-19 18:46:25 +00:00
|
|
|
|
2013-07-06 19:56:11 +00:00
|
|
|
return addSubVar(var);
|
2013-06-19 18:46:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int CGameVar::getSubVarAsInt(const char *name) {
|
2013-07-06 19:56:11 +00:00
|
|
|
CGameVar *var = getSubVarByName(name);
|
2013-06-19 18:46:25 +00:00
|
|
|
|
2013-07-06 19:56:11 +00:00
|
|
|
if (var)
|
|
|
|
return var->_value.intValue;
|
|
|
|
else
|
|
|
|
return 0;
|
2013-06-19 18:46:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
CGameVar *CGameVar::addSubVarAsInt(const char *name, int value) {
|
2013-07-06 19:56:11 +00:00
|
|
|
if (getSubVarByName(name)) {
|
|
|
|
return 0;
|
|
|
|
} else {
|
|
|
|
CGameVar *var = new CGameVar();
|
2013-06-19 18:46:25 +00:00
|
|
|
|
2013-07-06 19:56:11 +00:00
|
|
|
var->_varType = 0;
|
|
|
|
var->_value.intValue = value;
|
2013-06-19 18:46:25 +00:00
|
|
|
|
2013-07-19 15:13:00 +00:00
|
|
|
var->_varName = (char *)calloc(strlen(name) + 1, 1);
|
|
|
|
strcpy(var->_varName, name);
|
2013-06-19 18:46:25 +00:00
|
|
|
|
2013-07-06 19:56:11 +00:00
|
|
|
return (addSubVar(var) != 0) ? var : 0;
|
|
|
|
}
|
2013-06-19 18:46:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool CGameVar::addSubVar(CGameVar *subvar) {
|
2013-07-06 19:56:11 +00:00
|
|
|
CGameVar *var = _subVars;
|
2013-06-19 18:46:25 +00:00
|
|
|
|
2013-07-06 19:56:11 +00:00
|
|
|
if (var) {
|
|
|
|
for (CGameVar *i = var->_nextVarObj; i; i = i->_nextVarObj)
|
|
|
|
var = i;
|
2013-06-19 18:46:25 +00:00
|
|
|
|
2013-07-06 19:56:11 +00:00
|
|
|
var->_nextVarObj = subvar;
|
|
|
|
subvar->_prevVarObj = var;
|
|
|
|
subvar->_parentVarObj = var;
|
2013-06-19 18:46:25 +00:00
|
|
|
|
2013-07-06 19:56:11 +00:00
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
var->_subVars = subvar;
|
|
|
|
subvar->_parentVarObj = var;
|
2013-06-19 18:46:25 +00:00
|
|
|
|
2013-07-06 19:56:11 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2013-06-19 18:46:25 +00:00
|
|
|
}
|
|
|
|
|
2013-07-28 12:53:43 +00:00
|
|
|
int CGameVar::getSubVarsCount() {
|
|
|
|
int res;
|
|
|
|
CGameVar *sub = _subVars;
|
|
|
|
|
|
|
|
for (res = 0; sub; res++)
|
|
|
|
sub = sub->_nextVarObj;
|
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2013-06-13 21:12:01 +00:00
|
|
|
Sc2::Sc2() {
|
|
|
|
_sceneId = 0;
|
|
|
|
_field_2 = 0;
|
2013-06-18 21:07:28 +00:00
|
|
|
_scene = 0;
|
2013-06-13 21:12:01 +00:00
|
|
|
_motionController = 0;
|
|
|
|
_data1 = 0;
|
|
|
|
_count1 = 0;
|
|
|
|
_defPicAniInfos = 0;
|
|
|
|
_defPicAniInfosCount = 0;
|
|
|
|
_picAniInfos = 0;
|
|
|
|
_picAniInfosCount = 0;
|
|
|
|
_isLoaded = 0;
|
|
|
|
_entranceData = 0;
|
|
|
|
_entranceDataCount = 0;
|
|
|
|
}
|
|
|
|
|
2013-06-12 21:57:54 +00:00
|
|
|
bool Sc2::load(MfcArchive &file) {
|
2013-07-12 06:03:02 +00:00
|
|
|
debug(5, "Sc2::load()");
|
|
|
|
|
2013-06-12 21:57:54 +00:00
|
|
|
_sceneId = file.readUint16LE();
|
|
|
|
|
2013-06-14 22:19:45 +00:00
|
|
|
_motionController = (CMotionController *)file.readClass();
|
2013-06-13 21:12:01 +00:00
|
|
|
|
2013-06-18 21:07:28 +00:00
|
|
|
_count1 = file.readUint32LE();
|
2013-06-18 21:27:17 +00:00
|
|
|
debug(4, "count1: %d", _count1);
|
2013-06-18 21:07:28 +00:00
|
|
|
if (_count1 > 0) {
|
2013-07-06 19:56:11 +00:00
|
|
|
_data1 = (int32 *)malloc(_count1 * sizeof(int32));
|
|
|
|
|
|
|
|
for (int i = 0; i < _count1; i++) {
|
|
|
|
_data1[i] = file.readUint32LE();
|
|
|
|
}
|
2013-06-18 21:07:28 +00:00
|
|
|
} else {
|
2013-07-06 19:56:11 +00:00
|
|
|
_data1 = 0;
|
2013-06-18 21:07:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
_defPicAniInfosCount = file.readUint32LE();
|
2013-06-18 21:27:17 +00:00
|
|
|
debug(4, "defPicAniInfos: %d", _defPicAniInfosCount);
|
2013-06-18 21:07:28 +00:00
|
|
|
if (_defPicAniInfosCount > 0) {
|
2013-07-06 19:56:11 +00:00
|
|
|
_defPicAniInfos = (PicAniInfo **)malloc(_defPicAniInfosCount * sizeof(PicAniInfo *));
|
2013-06-18 21:07:28 +00:00
|
|
|
|
2013-07-06 19:56:11 +00:00
|
|
|
for (int i = 0; i < _defPicAniInfosCount; i++) {
|
|
|
|
_defPicAniInfos[i] = new PicAniInfo();
|
2013-06-18 21:07:28 +00:00
|
|
|
|
2013-07-06 19:56:11 +00:00
|
|
|
_defPicAniInfos[i]->load(file);
|
|
|
|
}
|
2013-06-18 21:07:28 +00:00
|
|
|
} else {
|
2013-07-06 19:56:11 +00:00
|
|
|
_defPicAniInfos = 0;
|
2013-06-18 21:07:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
_picAniInfos = 0;
|
|
|
|
_picAniInfosCount = 0;
|
|
|
|
|
|
|
|
_entranceDataCount = file.readUint32LE();
|
2013-06-18 21:27:17 +00:00
|
|
|
debug(4, "_entranceData: %d", _entranceDataCount);
|
2013-06-18 21:07:28 +00:00
|
|
|
|
|
|
|
if (_entranceDataCount > 0) {
|
2013-07-06 19:56:11 +00:00
|
|
|
_entranceData = (EntranceInfo **)malloc(_defPicAniInfosCount * sizeof(EntranceInfo *));
|
2013-06-18 21:07:28 +00:00
|
|
|
|
2013-07-06 19:56:11 +00:00
|
|
|
for (int i = 0; i < _entranceDataCount; i++) {
|
|
|
|
_entranceData[i] = new EntranceInfo();
|
|
|
|
_entranceData[i]->load(file);
|
|
|
|
}
|
2013-06-18 21:07:28 +00:00
|
|
|
} else {
|
2013-07-06 19:56:11 +00:00
|
|
|
_entranceData = 0;
|
2013-06-18 21:07:28 +00:00
|
|
|
}
|
|
|
|
|
2013-07-24 21:34:15 +00:00
|
|
|
if (file.size() - file.pos() > 0)
|
|
|
|
error("Sc2::load(): (%d bytes left)", file.size() - file.pos());
|
2013-06-18 21:07:28 +00:00
|
|
|
|
2013-06-13 21:12:01 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-06-18 21:07:28 +00:00
|
|
|
bool PicAniInfo::load(MfcArchive &file) {
|
2013-07-12 06:03:02 +00:00
|
|
|
debug(5, "PicAniInfo::load()");
|
|
|
|
|
2013-07-06 19:56:11 +00:00
|
|
|
type = file.readUint32LE();
|
|
|
|
objectId = file.readUint16LE();
|
|
|
|
field_6 = file.readUint16LE();
|
|
|
|
field_8 = file.readUint32LE();
|
|
|
|
field_C = file.readUint16LE();
|
|
|
|
field_E = file.readUint16LE();
|
|
|
|
ox = file.readUint32LE();
|
|
|
|
oy = file.readUint32LE();
|
|
|
|
priority = file.readUint32LE();
|
|
|
|
staticsId = file.readUint16LE();
|
|
|
|
movementId = file.readUint16LE();
|
|
|
|
dynamicPhaseIndex = file.readUint16LE();
|
|
|
|
flags = file.readUint16LE();
|
|
|
|
field_24 = file.readUint32LE();
|
|
|
|
someDynamicPhaseIndex = file.readUint32LE();
|
|
|
|
|
|
|
|
return true;
|
2013-06-18 21:07:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool EntranceInfo::load(MfcArchive &file) {
|
2013-07-12 06:03:02 +00:00
|
|
|
debug(5, "EntranceInfo::load()");
|
|
|
|
|
2013-07-20 18:28:32 +00:00
|
|
|
_sceneId = file.readUint32LE();
|
|
|
|
_field_4 = file.readUint32LE();
|
|
|
|
_messageQueueId = file.readUint32LE();
|
|
|
|
file.read(_gap_C, 292); // FIXME, Ugh
|
|
|
|
_field_130 = file.readUint32LE();
|
2013-06-18 21:07:28 +00:00
|
|
|
|
2013-07-06 19:56:11 +00:00
|
|
|
return true;
|
2013-06-18 21:07:28 +00:00
|
|
|
}
|
|
|
|
|
2013-06-01 10:01:25 +00:00
|
|
|
} // End of namespace Fullpipe
|