src/newgrf_spritegroup.cpp
branchgamebalance
changeset 9895 7bd07f43b0e3
parent 5873 ef74899fd5d7
child 6303 84c215fc8eb8
child 6658 59048224be55
equal deleted inserted replaced
9894:70d78ac95d6c 9895:7bd07f43b0e3
    47 	}
    47 	}
    48 }
    48 }
    49 
    49 
    50 
    50 
    51 /* Allocate a new SpriteGroup */
    51 /* Allocate a new SpriteGroup */
    52 SpriteGroup *AllocateSpriteGroup(void)
    52 SpriteGroup *AllocateSpriteGroup()
    53 {
    53 {
    54 	/* This is totally different to the other pool allocators, as we never remove an item from the pool. */
    54 	/* This is totally different to the other pool allocators, as we never remove an item from the pool. */
    55 	if (_spritegroup_count == GetSpriteGroupPoolSize()) {
    55 	if (_spritegroup_count == GetSpriteGroupPoolSize()) {
    56 		if (!AddBlockToPool(&_SpriteGroup_pool)) return NULL;
    56 		if (!AddBlockToPool(&_SpriteGroup_pool)) return NULL;
    57 	}
    57 	}
    58 
    58 
    59 	return GetSpriteGroup(_spritegroup_count++);
    59 	return GetSpriteGroup(_spritegroup_count++);
    60 }
    60 }
    61 
    61 
    62 
    62 
    63 void InitializeSpriteGroupPool(void)
    63 void InitializeSpriteGroupPool()
    64 {
    64 {
    65 	CleanPool(&_SpriteGroup_pool);
    65 	CleanPool(&_SpriteGroup_pool);
    66 
    66 
    67 	_spritegroup_count = 0;
    67 	_spritegroup_count = 0;
    68 }
    68 }