浏览代码

Make Entity variable members private.

legacy
Sam Hocevar sam 15 年前
父节点
当前提交
1ae1693d52
共有 3 个文件被更改,包括 7 次插入5 次删除
  1. +5
    -3
      src/entity.h
  2. +1
    -1
      src/font.cpp
  3. +1
    -1
      src/tileset.cpp

+ 5
- 3
src/entity.h 查看文件

@@ -32,13 +32,11 @@ protected:
virtual ~Entity(); virtual ~Entity();


virtual char const *GetName(); virtual char const *GetName();
inline int IsDestroying() { return destroy; }


virtual void TickGame(float deltams); virtual void TickGame(float deltams);
virtual void TickDraw(float deltams); virtual void TickDraw(float deltams);


Entity *gamenext, *drawnext, *autonext;
int ref, autorelease, destroy;

enum enum
{ {
GAMEGROUP_BEFORE = 0, GAMEGROUP_BEFORE = 0,
@@ -75,6 +73,10 @@ protected:
} }
state; state;
#endif #endif

private:
Entity *gamenext, *drawnext, *autonext;
int ref, autorelease, destroy;
}; };


#endif // __DH_ENTITY_H__ #endif // __DH_ENTITY_H__


+ 1
- 1
src/font.cpp 查看文件

@@ -84,7 +84,7 @@ void Font::TickDraw(float deltams)
{ {
Entity::TickDraw(deltams); Entity::TickDraw(deltams);


if (destroy)
if (IsDestroying())
{ {
if (data->img) if (data->img)
SDL_FreeSurface(data->img); SDL_FreeSurface(data->img);


+ 1
- 1
src/tileset.cpp 查看文件

@@ -103,7 +103,7 @@ void TileSet::TickDraw(float deltams)
{ {
Entity::TickDraw(deltams); Entity::TickDraw(deltams);


if (destroy)
if (IsDestroying())
{ {
if (data->img) if (data->img)
SDL_FreeSurface(data->img); SDL_FreeSurface(data->img);


正在加载...
取消
保存