diff options
author | Paul Gilbert | 2014-04-21 20:50:05 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-04-21 20:50:05 -0400 |
commit | 692af23f6f0a698e9089fcef0592fcb20e56efa6 (patch) | |
tree | 101e3135a7e22f1e97d40893897b253fbf16d8f1 /engines/mads/nebular | |
parent | ff70186855bec22fe77043d89917b189218ff856 (diff) | |
download | scummvm-rg350-692af23f6f0a698e9089fcef0592fcb20e56efa6.tar.gz scummvm-rg350-692af23f6f0a698e9089fcef0592fcb20e56efa6.tar.bz2 scummvm-rg350-692af23f6f0a698e9089fcef0592fcb20e56efa6.zip |
MADS: Create a Globals base class that the games will derive from
Diffstat (limited to 'engines/mads/nebular')
-rw-r--r-- | engines/mads/nebular/game_nebular.h | 5 | ||||
-rw-r--r-- | engines/mads/nebular/globals_nebular.cpp | 7 | ||||
-rw-r--r-- | engines/mads/nebular/globals_nebular.h | 16 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes.h | 2 |
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; |