Browse Source

Do not tick destroyed objects.

legacy
Sam Hocevar sam 14 years ago
parent
commit
183b24bf51
2 changed files with 7 additions and 4 deletions
  1. +4
    -2
      src/ticker.cpp
  2. +3
    -2
      src/tileset.h

+ 4
- 2
src/ticker.cpp View File

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


+ 3
- 2
src/tileset.h View File

@@ -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__


Loading…
Cancel
Save