aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/nebular
diff options
context:
space:
mode:
Diffstat (limited to 'engines/mads/nebular')
-rw-r--r--engines/mads/nebular/game_nebular.h5
-rw-r--r--engines/mads/nebular/globals_nebular.cpp7
-rw-r--r--engines/mads/nebular/globals_nebular.h16
-rw-r--r--engines/mads/nebular/nebular_scenes.h2
4 files changed, 8 insertions, 22 deletions
diff --git a/engines/mads/nebular/game_nebular.h b/engines/mads/nebular/game_nebular.h
index 4d011c2f4a..7d64e3e49f 100644
--- a/engines/mads/nebular/game_nebular.h
+++ b/engines/mads/nebular/game_nebular.h
@@ -25,6 +25,7 @@
#include "common/scummsys.h"
#include "mads/game.h"
+#include "mads/globals.h"
#include "mads/nebular/globals_nebular.h"
namespace MADS {
@@ -62,9 +63,11 @@ protected:
virtual void checkShowDialog();
public:
- Globals _globals;
+ NebularGlobals _globals;
StoryMode _storyMode;
+ virtual Globals &globals() { return _globals; }
+
virtual void doObjectAction();
virtual void unhandledAction();
diff --git a/engines/mads/nebular/globals_nebular.cpp b/engines/mads/nebular/globals_nebular.cpp
index 11c2b81502..3e9a9f7e2f 100644
--- a/engines/mads/nebular/globals_nebular.cpp
+++ b/engines/mads/nebular/globals_nebular.cpp
@@ -28,7 +28,7 @@ namespace MADS {
namespace Nebular {
-Globals::Globals() {
+NebularGlobals::NebularGlobals(): Globals() {
// Initialize lists
_flags.resize(210);
_spriteIndexes.resize(30);
@@ -53,11 +53,6 @@ Globals::Globals() {
_v84268 = 0;
}
-void Globals::reset() {
- for (uint i = 0; i < _flags.size(); ++i)
- _flags[i] = 0;
-}
-
} // End of namespace Nebular
} // End of namespace MADS
diff --git a/engines/mads/nebular/globals_nebular.h b/engines/mads/nebular/globals_nebular.h
index 242e0d1b7b..b8fe17f333 100644
--- a/engines/mads/nebular/globals_nebular.h
+++ b/engines/mads/nebular/globals_nebular.h
@@ -279,9 +279,7 @@ enum {
#define TELEPORTER_WORK_COUNT 6 // Total number that actually work
-class Globals {
-private:
- Common::Array<int16> _flags;
+class NebularGlobals: public Globals {
public:
Common::Array<int> _spriteIndexes;
Common::Array<int> _sequenceIndexes;
@@ -302,17 +300,7 @@ public:
/**
* Constructor
*/
- Globals();
-
- /**
- * Square brackets operator for accessing flags
- */
- int16 &operator[](int idx) { return _flags[idx]; }
-
- /*
- * Resets all the globals to empty
- */
- void reset();
+ NebularGlobals();
};
} // End of namespace Nebular
diff --git a/engines/mads/nebular/nebular_scenes.h b/engines/mads/nebular/nebular_scenes.h
index 56ea52d2c8..a227b7658a 100644
--- a/engines/mads/nebular/nebular_scenes.h
+++ b/engines/mads/nebular/nebular_scenes.h
@@ -111,7 +111,7 @@ public:
*/
class NebularScene : public SceneLogic {
protected:
- Globals &_globals;
+ NebularGlobals &_globals;
GameNebular &_game;
MADSAction &_action;