diff --git a/src/ticker.cpp b/src/ticker.cpp index 8d73d56e..dbb92bbe 100644 --- a/src/ticker.cpp +++ b/src/ticker.cpp @@ -75,7 +75,8 @@ void Ticker::TickGame(float delta_time) /* Tick objects for the game loop */ for (int i = 0; i < Asset::GROUP_COUNT; i++) for (Asset *a = data->list[i]; a; a = a->next) - a->TickGame(delta_time); + if (!a->destroy) + a->TickGame(delta_time); } void Ticker::TickRender(float delta_time) @@ -83,6 +84,7 @@ void Ticker::TickRender(float delta_time) /* Tick objects for the render loop */ for (int i = 0; i < Asset::GROUP_COUNT; i++) for (Asset *a = data->list[i]; a; a = a->next) - a->TickRender(delta_time); + if (!a->destroy) + a->TickRender(delta_time); } diff --git a/src/tileset.h b/src/tileset.h index d15a5437..e24b423a 100644 --- a/src/tileset.h +++ b/src/tileset.h @@ -6,8 +6,9 @@ // // The TileSet class // ----------------- -// A TileSet contains the information necesary to blit tiles to the game -// screen. +// A TileSet is a collection of tiles stored in a texture. Texture uploading +// and freeing is done in the render tick method. When the refcount drops to +// zero, the texture is freed. // #if !defined __DH_TILESET_H__