aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2013-09-14 00:14:49 +0300
committerEugene Sandulenko2013-09-14 00:14:49 +0300
commit4db215a511e9829734fb3cae0785a7adb353e816 (patch)
tree3ac85d796bf66f03491209106c98cec6c5b585aa /engines
parent1e72640cbacac854d87090f86f6a79ba9ccdd522 (diff)
downloadscummvm-rg350-4db215a511e9829734fb3cae0785a7adb353e816.tar.gz
scummvm-rg350-4db215a511e9829734fb3cae0785a7adb353e816.tar.bz2
scummvm-rg350-4db215a511e9829734fb3cae0785a7adb353e816.zip
FULLPIPE: Move PreloadItem methods where they belong
Diffstat (limited to 'engines')
-rw-r--r--engines/fullpipe/gameloader.cpp34
-rw-r--r--engines/fullpipe/gameloader.h2
-rw-r--r--engines/fullpipe/stateloader.cpp20
3 files changed, 28 insertions, 28 deletions
diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp
index fa8eddf7f1..2a8f64dac9 100644
--- a/engines/fullpipe/gameloader.cpp
+++ b/engines/fullpipe/gameloader.cpp
@@ -246,7 +246,7 @@ bool CGameLoader::preloadScene(int sceneId, int entranceId) {
int idx = -1;
for (uint i = 0; i < _preloadItems.size(); i++)
- if (_preloadItems[i].preloadId1 == sceneId && _preloadItems[i].preloadId2 == entranceId) {
+ if (_preloadItems[i]->preloadId1 == sceneId && _preloadItems[i]->preloadId2 == entranceId) {
idx = i;
break;
}
@@ -258,7 +258,7 @@ bool CGameLoader::preloadScene(int sceneId, int entranceId) {
}
if (_preloadCallback) {
- if (!_preloadCallback(_preloadItems[idx], 0))
+ if (!_preloadCallback(*_preloadItems[idx], 0))
return false;
}
@@ -270,19 +270,19 @@ bool CGameLoader::preloadScene(int sceneId, int entranceId) {
unloadScene(sceneId);
if (_preloadCallback)
- _preloadCallback(_preloadItems[idx], 50);
+ _preloadCallback(*_preloadItems[idx], 50);
- loadScene(_preloadItems[idx].sceneId);
+ loadScene(_preloadItems[idx]->sceneId);
- ExCommand *ex = new ExCommand(_preloadItems[idx].sceneId, 17, 62, 0, 0, 0, 1, 0, 0, 0);
+ ExCommand *ex = new ExCommand(_preloadItems[idx]->sceneId, 17, 62, 0, 0, 0, 1, 0, 0, 0);
ex->_excFlags = 2;
- ex->_keyCode = _preloadItems[idx].keyCode;
+ ex->_keyCode = _preloadItems[idx]->keyCode;
_preloadSceneId = 0;
_preloadEntranceId = 0;
if (_preloadCallback)
- _preloadCallback(_preloadItems[idx], 100);
+ _preloadCallback(*_preloadItems[idx], 100);
ex->postMessage();
@@ -476,6 +476,26 @@ bool Sc2::load(MfcArchive &file) {
return true;
}
+bool PreloadItems::load(MfcArchive &file) {
+ debug(5, "PreloadItems::load()");
+
+ 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->keyCode = file.readUint32LE();
+
+ push_back(t);
+ }
+
+ return true;
+}
+
CGameVar *FullpipeEngine::getGameLoaderGameVar() {
if (_gameLoader)
return _gameLoader->_gameVar;
diff --git a/engines/fullpipe/gameloader.h b/engines/fullpipe/gameloader.h
index 87cd1f1a35..2f1f57a5e2 100644
--- a/engines/fullpipe/gameloader.h
+++ b/engines/fullpipe/gameloader.h
@@ -67,7 +67,7 @@ struct PreloadItem {
bool preloadCallback(const PreloadItem &pre, int flag);
-class PreloadItems : public Common::Array<PreloadItem>, public CObject {
+class PreloadItems : public Common::Array<PreloadItem *>, public CObject {
public:
virtual bool load(MfcArchive &file);
};
diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp
index dd00361ce9..55d74c4c86 100644
--- a/engines/fullpipe/stateloader.cpp
+++ b/engines/fullpipe/stateloader.cpp
@@ -143,26 +143,6 @@ GameProject::~GameProject() {
free(_headerFilename);
}
-bool PreloadItems::load(MfcArchive &file) {
- debug(5, "PreloadItems::load()");
-
- 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->keyCode = file.readUint32LE();
-
- push_back(*t);
- }
-
- return true;
-}
-
CGameVar::CGameVar() {
_subVars = 0;
_parentVarObj = 0;