forked from mirror/OpenTTD
(svn r3016) -NewGRF: Implement the start of reference counting for sprite groups. This will allow unloading.
This commit is contained in:
2
engine.c
2
engine.c
@@ -266,6 +266,7 @@ void SetWagonOverrideSprites(EngineID engine, SpriteGroup *group, byte *train_id
|
||||
* to prevent leaks. But first we need to refcount the SpriteGroup.
|
||||
* --pasky */
|
||||
wo->group = group;
|
||||
group->ref_count++;
|
||||
wo->trains = trains;
|
||||
wo->train_id = malloc(trains);
|
||||
memcpy(wo->train_id, train_id, trains);
|
||||
@@ -306,6 +307,7 @@ void SetCustomEngineSprites(EngineID engine, byte cargo, SpriteGroup *group)
|
||||
* to prevent leaks. But first we need to refcount the SpriteGroup.
|
||||
* --pasky */
|
||||
engine_custom_sprites[engine][cargo] = group;
|
||||
group->ref_count++;
|
||||
}
|
||||
|
||||
typedef SpriteGroup *(*resolve_callback)(const SpriteGroup *spritegroup,
|
||||
|
Reference in New Issue
Block a user