From 444e256efe52274caf464e941cd76abc9ccf1d61 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Tue, 10 May 2016 15:40:52 -0400 Subject: bug/memory fixes --- include/entities.hpp | 18 +++++++++++------- include/world.hpp | 4 ++++ 2 files changed, 15 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/entities.hpp b/include/entities.hpp index 3e78687..85b0ec1 100644 --- a/include/entities.hpp +++ b/include/entities.hpp @@ -25,12 +25,13 @@ * An entity type enumerator for identifying entities. */ enum _TYPE { - OBJECTT = -2, /**< an object (Object) */ - STRUCTURET, /**< a structure (Structures *) */ - PLAYERT, /**< the player (Player *) */ - NPCT, /**< an NPC (NPC *) */ - MERCHT, /**< a merchant (Merchant *) */ - MOBT /**< A mob (Mob *) */ + UNKNOWNT = -999, /**< who knows? */ + OBJECTT = -2, /**< an object (Object) */ + STRUCTURET, /**< a structure (Structures *) */ + PLAYERT, /**< the player (Player *) */ + NPCT, /**< an NPC (NPC *) */ + MERCHT, /**< a merchant (Merchant *) */ + MOBT /**< A mob (Mob *) */ }; /** @@ -279,6 +280,9 @@ public: // returns true if the coordinate is within the entity bool isInside(vec2 coord) const; + // a common constructor, clears variables + Entity(void); + // frees memory taken by the entity virtual ~Entity(){} }; @@ -329,7 +333,7 @@ public: virtual void wander(int); }; -class Merchant : public NPC{ +class Merchant : public NPC { public: std::vectortrade; uint currTrade; diff --git a/include/world.hpp b/include/world.hpp index ac17580..c40f5f5 100644 --- a/include/world.hpp +++ b/include/world.hpp @@ -154,6 +154,10 @@ protected: // frees entities and clears vectors that contain them void deleteEntities(void); +protected: + + void drawBackgrounds(); + public: // entity vectors that need to be public because we're based -- cgit v1.2.3