1
0
Fork 0

(svn r6155) -Codechange: split Destroy routine from SpriteGroupPoolCleanBlock

Last change is to prepare for new pool system.
release/0.5
truelight 2006-08-26 19:47:13 +00:00
parent 5d991a87d4
commit b3cf0189a3
1 changed files with 23 additions and 22 deletions

View File

@ -16,14 +16,8 @@ enum {
static uint _spritegroup_count = 0; static uint _spritegroup_count = 0;
static MemoryPool _spritegroup_pool; static MemoryPool _spritegroup_pool;
void DestroySpriteGroup(SpriteGroup *group)
static void SpriteGroupPoolCleanBlock(uint start_item, uint end_item)
{ {
uint i;
for (i = start_item; i <= end_item; i++) {
SpriteGroup *group = (SpriteGroup*)GetItemFromPool(&_spritegroup_pool, i);
/* Free dynamically allocated memory */ /* Free dynamically allocated memory */
switch (group->type) { switch (group->type) {
case SGT_REAL: case SGT_REAL:
@ -43,9 +37,16 @@ static void SpriteGroupPoolCleanBlock(uint start_item, uint end_item)
default: default:
break; break;
} }
}
} }
static void SpriteGroupPoolCleanBlock(uint start_item, uint end_item)
{
uint i;
for (i = start_item; i <= end_item; i++) {
DestroySpriteGroup((SpriteGroup*)GetItemFromPool(&_spritegroup_pool, i));
}
}
/* Initialize the SpriteGroup pool */ /* Initialize the SpriteGroup pool */
static MemoryPool _spritegroup_pool = { "SpriteGr", SPRITEGROUP_POOL_MAX_BLOCKS, SPRITEGROUP_POOL_BLOCK_SIZE_BITS, sizeof(SpriteGroup), NULL, &SpriteGroupPoolCleanBlock, 0, 0, NULL }; static MemoryPool _spritegroup_pool = { "SpriteGr", SPRITEGROUP_POOL_MAX_BLOCKS, SPRITEGROUP_POOL_BLOCK_SIZE_BITS, sizeof(SpriteGroup), NULL, &SpriteGroupPoolCleanBlock, 0, 0, NULL };