diff options
author | Colin Snover | 2017-02-17 11:50:33 -0600 |
---|---|---|
committer | Colin Snover | 2017-04-23 13:07:25 -0500 |
commit | 2906ca994716d77cca73928a0c053ac5f2aadd94 (patch) | |
tree | febf3028a7aba0cfcde112bf425e2dad512d7846 /engines/sci/engine | |
parent | cb50682b15c308cb075b7c46ce24b499827f4260 (diff) | |
download | scummvm-rg350-2906ca994716d77cca73928a0c053ac5f2aadd94.tar.gz scummvm-rg350-2906ca994716d77cca73928a0c053ac5f2aadd94.tar.bz2 scummvm-rg350-2906ca994716d77cca73928a0c053ac5f2aadd94.zip |
SCI: Replace mostly-unused flags property with a single boolean
There does not appear to be any reason to use a bit field instead
of a simple boolean for this one flag, since there are no other
flags that need to be set on Object like this.
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/object.h | 19 | ||||
-rw-r--r-- | engines/sci/engine/savegame.cpp | 2 |
2 files changed, 10 insertions, 11 deletions
diff --git a/engines/sci/engine/object.h b/engines/sci/engine/object.h index 4fd1385c79..1af3b7b645 100644 --- a/engines/sci/engine/object.h +++ b/engines/sci/engine/object.h @@ -35,11 +35,6 @@ namespace Sci { class SegManager; -/** Clone has been marked as 'freed' */ -enum { - OBJECT_FLAG_FREED = (1 << 0) -}; - enum infoSelectorFlags { kInfoFlagClone = 0x0001, #ifdef ENABLE_SCI32 @@ -75,7 +70,7 @@ class Object { public: Object() : _offset(getSciVersion() < SCI_VERSION_1_1 ? 0 : 5), - _flags(0), + _isFreed(false), _baseObj(), _baseVars(), _methodCount(0), @@ -86,7 +81,7 @@ public: _baseMethod = other._baseMethod; _variables = other._variables; _methodCount = other._methodCount; - _flags = other._flags; + _isFreed = other._isFreed; _offset = other._offset; _pos = other._pos; _baseVars = other._baseVars; @@ -246,8 +241,8 @@ public: bool isClass() const { return (getInfoSelector().getOffset() & kInfoFlagClass); } const Object *getClass(SegManager *segMan) const; - void markAsFreed() { _flags |= OBJECT_FLAG_FREED; } - bool isFreed() const { return _flags & OBJECT_FLAG_FREED; } + void markAsFreed() { _isFreed = true; } + bool isFreed() const { return _isFreed; } uint getVarCount() const { return _variables.size(); } @@ -317,7 +312,11 @@ private: * The number of methods on the object. */ uint16 _methodCount; - int _flags; + + /** + * Whether or not a clone object has been marked as 'freed'. + */ + bool _isFreed; /** * For SCI0 through SCI2.1, an extra index offset used when looking up diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index a82499adc4..2306fc6f0b 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -414,7 +414,7 @@ void LocalVariables::saveLoadWithSerializer(Common::Serializer &s) { } void Object::saveLoadWithSerializer(Common::Serializer &s) { - s.syncAsSint32LE(_flags); + s.syncAsSint32LE(_isFreed); syncWithSerializer(s, _pos); s.syncAsSint32LE(_methodCount); // that's actually a uint16 |