From d4592b6077aebaf1630b05d1904723c6544d4537 Mon Sep 17 00:00:00 2001 From: Joseph-Eugene Winzer Date: Sat, 14 Apr 2018 11:40:08 +0200 Subject: 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. --- engines/supernova/state.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'engines/supernova/state.h') 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(); -- cgit v1.2.3