From 1ae1693d52e3159fb5518ac4ee2376eca90277d3 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Tue, 1 Feb 2011 17:08:29 +0000 Subject: [PATCH] Make Entity variable members private. --- src/entity.h | 8 +++++--- src/font.cpp | 2 +- src/tileset.cpp | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) 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);