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

Function AllocateSpriteCache

src/spritecache.cpp:42–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42SpriteCache *AllocateSpriteCache(uint index)
43{
44 if (index >= _spritecache.size()) {
45 /* Add another 1024 items to the 'pool' */
46 uint items = Align(index + 1, 1024);
47
48 Debug(sprite, 4, "Increasing sprite cache to {} items ({} bytes)", items, items * sizeof(SpriteCache));
49
50 _spritecache.resize(items);
51 }
52
53 return GetSpriteCache(index);
54}
55
56/**
57 * Get the cached SpriteFile given the name of the file.

Callers 3

LoadNextSpriteFunction · 0.85
DupSpriteFunction · 0.85
MockLoadNextSpriteFunction · 0.85

Calls 4

AlignFunction · 0.85
GetSpriteCacheFunction · 0.85
resizeMethod · 0.80
sizeMethod · 0.45

Tested by 1

MockLoadNextSpriteFunction · 0.68