aboutsummaryrefslogtreecommitdiff
path: root/engines/supernova/state.h
diff options
context:
space:
mode:
authorJoseph-Eugene Winzer2018-04-14 11:40:08 +0200
committerThierry Crozat2018-04-15 18:47:33 +0100
commitd4592b6077aebaf1630b05d1904723c6544d4537 (patch)
treea5aea1e248fec56f337a19d789de46d1686cbffd /engines/supernova/state.h
parent94ebc96705314eb1e0846fa605943aec20afad72 (diff)
downloadscummvm-rg350-d4592b6077aebaf1630b05d1904723c6544d4537.tar.gz
scummvm-rg350-d4592b6077aebaf1630b05d1904723c6544d4537.tar.bz2
scummvm-rg350-d4592b6077aebaf1630b05d1904723c6544d4537.zip
SUPERNOVA: Removes global nullObject
Before nullObject was a static member of Object class and now a member of GameManager. Also the Inventory constructor was extended for taking a pointer to the nullObject that Invetory::get() returns if no Object was found.
Diffstat (limited to 'engines/supernova/state.h')
-rw-r--r--engines/supernova/state.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/engines/supernova/state.h b/engines/supernova/state.h
index e3de0eb94b..1b885ccbdd 100644
--- a/engines/supernova/state.h
+++ b/engines/supernova/state.h
@@ -65,8 +65,9 @@ struct GameState {
class Inventory {
public:
- Inventory(int &inventoryScroll)
+ Inventory(Object *nullObject, int &inventoryScroll)
: _numObjects(0)
+ , _nullObject(nullObject)
, _inventoryScroll(inventoryScroll)
{}
@@ -79,6 +80,7 @@ public:
private:
Object *_inventory[kMaxCarry];
+ Object *_nullObject;
int &_inventoryScroll;
int _numObjects;
};
@@ -154,6 +156,7 @@ public:
bool _animationEnabled;
byte _roomBrightness;
Action _inputVerb;
+ Object _nullObject;
Object *_currentInputObject;
Object *_inputObject[2];
bool _waitEvent;
@@ -175,6 +178,8 @@ public:
byte _rowsStart[6];
void takeObject(Object &obj);
+ void setObjectNull(Object *&obj);
+ bool isNullObject(Object *obj);
void initState();
void initRooms();