aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2013-06-03 00:18:49 +0300
committerEugene Sandulenko2013-09-06 14:48:07 +0300
commit4eb91762744a1235129467200f16754e85e4d3c2 (patch)
treebcf06285c45a09e886df209ed1b0a425e72b87c5
parent146e5a92249e3b0ea7f4057d3a620b2ff837a57e (diff)
downloadscummvm-rg350-4eb91762744a1235129467200f16754e85e4d3c2.tar.gz
scummvm-rg350-4eb91762744a1235129467200f16754e85e4d3c2.tar.bz2
scummvm-rg350-4eb91762744a1235129467200f16754e85e4d3c2.zip
FULLPIPE: Moved global variables to fullpipe.cpp
-rw-r--r--engines/fullpipe/fullpipe.cpp4
-rw-r--r--engines/fullpipe/fullpipe.h5
-rw-r--r--engines/fullpipe/stateloader.cpp30
3 files changed, 28 insertions, 11 deletions
diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp
index ca430fc868..f4d502d6a7 100644
--- a/engines/fullpipe/fullpipe.cpp
+++ b/engines/fullpipe/fullpipe.cpp
@@ -32,6 +32,10 @@
namespace Fullpipe {
+int g_gameProjectVersion = 0;
+int g_gameProjectValue = 0;
+int g_scrollSpeed = 0;
+
FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) {
// Setup mixer
if (!_mixer->isReady()) {
diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h
index d7bbe14795..a6a58ffb1b 100644
--- a/engines/fullpipe/fullpipe.h
+++ b/engines/fullpipe/fullpipe.h
@@ -45,6 +45,11 @@ enum FullpipeGameFeatures {
class CGameLoader;
+extern int g_gameProjectVersion;
+extern int g_gameProjectValue;
+extern int g_scrollSpeed;
+
+
class FullpipeEngine : public ::Engine {
protected:
diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp
index e50bbb2399..ffeb0b6391 100644
--- a/engines/fullpipe/stateloader.cpp
+++ b/engines/fullpipe/stateloader.cpp
@@ -48,14 +48,23 @@ bool CGameLoader::loadFile(const char *fname) {
return false;
_gameName = file.readPascalString();
+ debug(0, "_gameName: %s", _gameName);
_gameProject = new GameProject(file);
+ if (g_gameProjectVersion < 12) {
+ error("Old gameProjectVersion: %d", g_gameProjectVersion);
+ }
+
+ _gameName = file.readPascalString();
+ debug(0, "_gameName: %s", _gameName);
+
return true;
}
CGameLoader::~CGameLoader() {
free(_gameName);
+ delete _gameProject;
}
GameProject::GameProject(CFile &file) {
@@ -63,24 +72,23 @@ GameProject::GameProject(CFile &file) {
_headerFilename = 0;
_field_10 = 12;
- // FIXME
- int _gameProjectVersion = file.readUint32LE();
- int _gameProjectValue = file.readUint16LE();
- int _scrollSpeed = file.readUint32LE();
+ g_gameProjectVersion = file.readUint32LE();
+ g_gameProjectValue = file.readUint16LE();
+ g_scrollSpeed = file.readUint32LE();
_headerFilename = file.readPascalString();
- _sceneTagList = new SceneTagList(file);
-
- debug(0, "_gameProjectVersion = %d", _gameProjectVersion);
- debug(0, "_gameProjectValue = %d", _gameProjectValue);
- debug(0, "_scrollSpeed = %d", _scrollSpeed);
+ debug(0, "_gameProjectVersion = %d", g_gameProjectVersion);
+ debug(0, "_gameProjectValue = %d", g_gameProjectValue);
+ debug(0, "_scrollSpeed = %d", g_scrollSpeed);
debug(0, "_headerFilename = %s", _headerFilename);
- if (_gameProjectVersion >= 3)
+ _sceneTagList = new SceneTagList(file);
+
+ if (g_gameProjectVersion >= 3)
_field_4 = file.readUint32LE();
- if (_gameProjectVersion >= 5) {
+ if (g_gameProjectVersion >= 5) {
file.readUint32LE();
file.readUint32LE();
}