MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / DupSprite

Function DupSprite

src/spritecache.cpp:684–696  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

682
683
684void DupSprite(SpriteID old_spr, SpriteID new_spr)
685{
686 SpriteCache *scnew = AllocateSpriteCache(new_spr); // may reallocate: so put it first
687 SpriteCache *scold = GetSpriteCache(old_spr);
688
689 scnew->file = scold->file;
690 scnew->file_pos = scold->file_pos;
691 scnew->ClearSpriteData();
692 scnew->id = scold->id;
693 scnew->type = scold->type;
694 scnew->warned = false;
695 scnew->control_flags = scold->control_flags;
696}
697
698/**
699 * Delete entries from the sprite cache to remove the requested number of bytes.

Callers 3

ActivateOldShoreFunction · 0.85
ActivateOldTramDepotFunction · 0.85
GraphicsNewFunction · 0.85

Calls 3

AllocateSpriteCacheFunction · 0.85
GetSpriteCacheFunction · 0.85
ClearSpriteDataMethod · 0.80

Tested by

no test coverage detected