diff --git a/src/entity.h b/src/entity.h index bf3110f0..7a36317c 100644 --- a/src/entity.h +++ b/src/entity.h @@ -32,13 +32,11 @@ protected: virtual ~Entity(); virtual char const *GetName(); + inline int IsDestroying() { return destroy; } virtual void TickGame(float deltams); virtual void TickDraw(float deltams); - Entity *gamenext, *drawnext, *autonext; - int ref, autorelease, destroy; - enum { GAMEGROUP_BEFORE = 0, @@ -75,6 +73,10 @@ protected: } state; #endif + +private: + Entity *gamenext, *drawnext, *autonext; + int ref, autorelease, destroy; }; #endif // __DH_ENTITY_H__ diff --git a/src/font.cpp b/src/font.cpp index a0039414..5f3bb63a 100644 --- a/src/font.cpp +++ b/src/font.cpp @@ -84,7 +84,7 @@ void Font::TickDraw(float deltams) { Entity::TickDraw(deltams); - if (destroy) + if (IsDestroying()) { if (data->img) SDL_FreeSurface(data->img); diff --git a/src/tileset.cpp b/src/tileset.cpp index 9df113f4..98ab57cb 100644 --- a/src/tileset.cpp +++ b/src/tileset.cpp @@ -103,7 +103,7 @@ void TileSet::TickDraw(float deltams) { Entity::TickDraw(deltams); - if (destroy) + if (IsDestroying()) { if (data->img) SDL_FreeSurface(data->img);