(svn r4486) - NewGRF: Create and use a memory pool to manage sprite groups. This

reduces the amount of house keeping we do and the chance of memory 
leaks.
This commit is contained in:
2006-04-20 20:51:57 +00:00
parent fe6dadad7b
commit 92d8af75db
7 changed files with 96 additions and 142 deletions

View File

@@ -118,6 +118,7 @@ typedef struct ResultSpriteGroup {
} ResultSpriteGroup;
typedef enum SpriteGroupType {
SGT_INVALID,
SGT_REAL,
SGT_DETERMINISTIC,
SGT_RANDOMIZED,
@@ -127,7 +128,6 @@ typedef enum SpriteGroupType {
struct SpriteGroup {
SpriteGroupType type;
byte ref_count;
union {
RealSpriteGroup real;
@@ -160,6 +160,4 @@ SpriteGroup *EvalRandomizedSpriteGroup(const RandomizedSpriteGroup *rsg, byte ra
* (then they are |ed to @waiting_triggers instead). */
byte RandomizedSpriteGroupTriggeredBits(const RandomizedSpriteGroup *rsg, byte triggers, byte *waiting_triggers);
void UnloadSpriteGroup(SpriteGroup **group_ptr);
#endif /* SPRITE_H */