aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/phantom
diff options
context:
space:
mode:
authorFilippos Karapetis2014-10-14 02:03:53 +0300
committerFilippos Karapetis2014-10-14 02:03:53 +0300
commitf83b839e21c6f79a008c34666ddd96d8fdc3b15c (patch)
treed0c4b4c5c4db6d40458a6321fde2aecc48b69918 /engines/mads/phantom
parente6a14f403ff3bf0b42eae8fb91086ddec0e48752 (diff)
downloadscummvm-rg350-f83b839e21c6f79a008c34666ddd96d8fdc3b15c.tar.gz
scummvm-rg350-f83b839e21c6f79a008c34666ddd96d8fdc3b15c.tar.bz2
scummvm-rg350-f83b839e21c6f79a008c34666ddd96d8fdc3b15c.zip
MADS: Initial implementation of the Phantom globals class
Diffstat (limited to 'engines/mads/phantom')
-rw-r--r--engines/mads/phantom/game_phantom.cpp4
-rw-r--r--engines/mads/phantom/game_phantom.h11
-rw-r--r--engines/mads/phantom/globals_phantom.cpp49
-rw-r--r--engines/mads/phantom/globals_phantom.h75
4 files changed, 128 insertions, 11 deletions
diff --git a/engines/mads/phantom/game_phantom.cpp b/engines/mads/phantom/game_phantom.cpp
index 0b2531ef65..2384b94dec 100644
--- a/engines/mads/phantom/game_phantom.cpp
+++ b/engines/mads/phantom/game_phantom.cpp
@@ -28,7 +28,7 @@
#include "mads/msurface.h"
#include "mads/phantom/game_phantom.h"
//#include "mads/nebular/dialogs_nebular.h"
-//#include "mads/nebular/globals_nebular.h"
+#include "mads/phantom/globals_phantom.h"
#include "mads/phantom/phantom_scenes.h"
namespace MADS {
@@ -57,6 +57,8 @@ void GamePhantom::initializeGlobals() {
_player._facing = FACING_NORTH;
_player._turnToFacing = FACING_NORTH;
+ _globals[kCurrentYear] = 1993;
+
/* Section #1 variables */
// TODO
diff --git a/engines/mads/phantom/game_phantom.h b/engines/mads/phantom/game_phantom.h
index 99cc2c1230..654ec86ba3 100644
--- a/engines/mads/phantom/game_phantom.h
+++ b/engines/mads/phantom/game_phantom.h
@@ -26,7 +26,7 @@
#include "common/scummsys.h"
#include "mads/game.h"
#include "mads/globals.h"
-//#include "mads/nebular/globals_nebular.h"
+#include "mads/phantom/globals_phantom.h"
namespace MADS {
@@ -64,15 +64,6 @@ enum InventoryObject {
OBJ_OAR = 24
};
-// HACK: A stub for now, remove from here once it's implemented properly
-class PhantomGlobals : public Globals {
-public:
- PhantomGlobals() {
- resize(210); // Rex has 210 globals
- }
- virtual ~PhantomGlobals() {}
-};
-
class GamePhantom : public Game {
friend class Game;
protected:
diff --git a/engines/mads/phantom/globals_phantom.cpp b/engines/mads/phantom/globals_phantom.cpp
new file mode 100644
index 0000000000..e0db0a1bb0
--- /dev/null
+++ b/engines/mads/phantom/globals_phantom.cpp
@@ -0,0 +1,49 @@
+/* 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 "common/scummsys.h"
+#include "common/config-manager.h"
+#include "mads/phantom/globals_phantom.h"
+
+namespace MADS {
+
+namespace Phantom {
+
+PhantomGlobals::PhantomGlobals()
+ : Globals() {
+ // Initialize lists
+ resize(210);
+ _spriteIndexes.resize(30);
+ _sequenceIndexes.resize(30);
+}
+
+void PhantomGlobals::synchronize(Common::Serializer &s) {
+ Globals::synchronize(s);
+
+ _spriteIndexes.synchronize(s);
+ _sequenceIndexes.synchronize(s);
+}
+
+
+} // End of namespace Phantom
+
+} // End of namespace MADS
diff --git a/engines/mads/phantom/globals_phantom.h b/engines/mads/phantom/globals_phantom.h
new file mode 100644
index 0000000000..44d8c9e4bc
--- /dev/null
+++ b/engines/mads/phantom/globals_phantom.h
@@ -0,0 +1,75 @@
+/* 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.
+ *
+ */
+
+#ifndef MADS_GLOBALS_PHANTOM_H
+#define MADS_GLOBALS_PHANTOM_H
+
+#include "common/scummsys.h"
+#include "common/array.h"
+#include "mads/game.h"
+#include "mads/resources.h"
+
+namespace MADS {
+
+namespace Phantom {
+
+enum GlobalId {
+ kWalkerTiming = 0,
+// kWalkerTiming0 = 1,
+
+ kCurrentYear = 10, // current year (1881 or 1993)
+
+ //kTalkInanimateCount = 4,
+
+ /* Section #1 variables */
+
+ /* Section #2 variables */
+
+ /* Section #3 Variables */
+
+ /* Section #4 Variables */
+
+ /* Section #5 Variables */
+
+};
+
+class PhantomGlobals : public Globals {
+public:
+ SynchronizedList _spriteIndexes;
+ SynchronizedList _sequenceIndexes;
+public:
+ /**
+ * Constructor
+ */
+ PhantomGlobals();
+
+ /**
+ * Synchronize the globals data
+ */
+ virtual void synchronize(Common::Serializer &s);
+};
+
+} // End of namespace Phantom
+
+} // End of namespace MADS
+
+#endif /* MADS_GLOBALS_PHANTOM_H */