equal
deleted
inserted
replaced
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 } |