diff options
author | peter1138 <peter1138@openttd.org> | 2005-10-04 20:58:10 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2005-10-04 20:58:10 +0000 |
commit | c655e13e92aefef1503e7869b3dc3185cc1b2757 (patch) | |
tree | 3408008b6e4a19ccc27a823700b8189491c617d7 /engine.c | |
parent | d1591e864d2cc68ef7c1bfaa4d35093e64ae5a24 (diff) | |
download | openttd-c655e13e92aefef1503e7869b3dc3185cc1b2757.tar.xz |
(svn r3016) -NewGRF: Implement the start of reference counting for sprite groups. This will allow unloading.
Diffstat (limited to 'engine.c')
-rw-r--r-- | engine.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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, |