ソースを参照

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);


読み込み中…
キャンセル
保存