diff options
author | Paul Gilbert | 2014-05-18 16:12:40 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-05-18 16:12:40 -0400 |
commit | 96aaf48f44c9c832e5b0daa66a57726ca732b9d9 (patch) | |
tree | 53d86a566955b5167c63ce5303ba4e34b8fabb02 | |
parent | cacd7c51ed9e06abc8a5c9e301054a585b7aab45 (diff) | |
download | scummvm-rg350-96aaf48f44c9c832e5b0daa66a57726ca732b9d9.tar.gz scummvm-rg350-96aaf48f44c9c832e5b0daa66a57726ca732b9d9.tar.bz2 scummvm-rg350-96aaf48f44c9c832e5b0daa66a57726ca732b9d9.zip |
MADS: Changed 16-bit globals over to be 32-bits
-rw-r--r-- | engines/mads/globals.cpp | 24 | ||||
-rw-r--r-- | engines/mads/globals.h | 15 | ||||
-rw-r--r-- | engines/mads/nebular/globals_nebular.cpp | 2 | ||||
-rw-r--r-- | engines/mads/nebular/globals_nebular.h | 10 |
4 files changed, 10 insertions, 41 deletions
diff --git a/engines/mads/globals.cpp b/engines/mads/globals.cpp index f46ca1eb65..1d088992ea 100644 --- a/engines/mads/globals.cpp +++ b/engines/mads/globals.cpp @@ -26,28 +26,8 @@ namespace MADS { void Globals::reset() { - for (uint i = 0; i < _data.size(); ++i) - _data[i] = 0; + for (uint i = 0; i < size(); ++i) + (*this)[i] = 0; } -void Globals::synchronize(Common::Serializer &s) { - int count = _data.size(); - s.syncAsUint16LE(count); - int16 v; - - if (s.isSaving()) { - for (int idx = 0; idx < count; ++idx) { - v = _data[idx]; - s.syncAsSint16LE(v); - } - } else { - _data.clear(); - for (int idx = 0; idx < count; ++idx) { - s.syncAsSint16LE(v); - _data.push_back(v); - } - } -} - - } // End of namespace MADS diff --git a/engines/mads/globals.h b/engines/mads/globals.h index 92e9d96f3e..92cd0bb403 100644 --- a/engines/mads/globals.h +++ b/engines/mads/globals.h @@ -26,31 +26,20 @@ #include "common/scummsys.h" #include "common/array.h" #include "common/serializer.h" +#include "mads/resources.h" namespace MADS { -class Globals { -protected: - Common::Array<int16> _data; +class Globals: public SynchronizedList { public: Globals() {} virtual ~Globals() {} - /** - * Square brackets operator for accessing flags - */ - int16 &operator[](int idx) { return _data[idx]; } - /* * Resets all the globals to empty */ void reset(); - - /** - * Synchronize the globals data - */ - virtual void synchronize(Common::Serializer &s); }; } // End of namespace MADS diff --git a/engines/mads/nebular/globals_nebular.cpp b/engines/mads/nebular/globals_nebular.cpp index 2e50794b60..7bb89a570c 100644 --- a/engines/mads/nebular/globals_nebular.cpp +++ b/engines/mads/nebular/globals_nebular.cpp @@ -30,7 +30,7 @@ namespace Nebular { NebularGlobals::NebularGlobals(): Globals() { // Initialize lists - _data.resize(210); + resize(210); _spriteIndexes.resize(30); _sequenceIndexes.resize(30); diff --git a/engines/mads/nebular/globals_nebular.h b/engines/mads/nebular/globals_nebular.h index fea90c515e..980e6ea1eb 100644 --- a/engines/mads/nebular/globals_nebular.h +++ b/engines/mads/nebular/globals_nebular.h @@ -36,7 +36,7 @@ enum GlobalId { kSexOfRex = 0, kOldSexOfRex = 1, kWalkerTiming = 2, - kWalkerTiming0 = 3, +// kWalkerTiming0 = 3, kTalkInanimateCount = 4, kCopyProtectFailed = 5, @@ -162,9 +162,9 @@ enum GlobalId { /* Section #6 Time-Bomb Variables */ kTimebombClock = 142, - kTimebombClock0 = 143, +// kTimebombClock0 = 143, kTimebombTimer = 144, - kTimebombTimer0 = 145, +// kTimebombTimer0 = 145, kWarnedFloodCity = 146, /* Section #7 Variables */ @@ -175,9 +175,9 @@ enum GlobalId { /* Section #8 Variables */ kAntigravClock = 160, - kAntigravClock0 = 161, +// kAntigravClock0 = 161, kAntigravTiming = 162, - kAntigravTiming0 = 163, +// kAntigravTiming0 = 163, kWindowFixed = 164, kInSpace = 165, kReturnFromCut = 166, |