src/newgrf_spritegroup.cpp
branchnoai
changeset 9694 e72987579514
parent 9631 8a2d1c2ceb88
child 9703 d2a6acdbd665
equal deleted inserted replaced
9693:31fcaa5375a1 9694:e72987579514
    60 /* Allocate a new SpriteGroup */
    60 /* Allocate a new SpriteGroup */
    61 SpriteGroup *AllocateSpriteGroup()
    61 SpriteGroup *AllocateSpriteGroup()
    62 {
    62 {
    63 	/* This is totally different to the other pool allocators, as we never remove an item from the pool. */
    63 	/* This is totally different to the other pool allocators, as we never remove an item from the pool. */
    64 	if (_spritegroup_count == GetSpriteGroupPoolSize()) {
    64 	if (_spritegroup_count == GetSpriteGroupPoolSize()) {
    65 		if (!AddBlockToPool(&_SpriteGroup_pool)) return NULL;
    65 		if (!_SpriteGroup_pool.AddBlockToPool()) return NULL;
    66 	}
    66 	}
    67 
    67 
    68 	return GetSpriteGroup(_spritegroup_count++);
    68 	return GetSpriteGroup(_spritegroup_count++);
    69 }
    69 }
    70 
    70 
    71 
    71 
    72 void InitializeSpriteGroupPool()
    72 void InitializeSpriteGroupPool()
    73 {
    73 {
    74 	CleanPool(&_SpriteGroup_pool);
    74 	_SpriteGroup_pool.CleanPool();
    75 
    75 
    76 	_spritegroup_count = 0;
    76 	_spritegroup_count = 0;
    77 }
    77 }
    78 
    78 
    79 uint32 _temp_store[0x110];
    79 uint32 _temp_store[0x110];