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

Function GetCachedSpriteFileByName

src/spritecache.cpp:61–69  ·  view source on GitHub ↗

* Get the cached SpriteFile given the name of the file. * @param filename The name of the file at the disk. * @return The SpriteFile or \c null. */

Source from the content-addressed store, hash-verified

59 * @return The SpriteFile or \c null.
60 */
61static SpriteFile *GetCachedSpriteFileByName(const std::string &filename)
62{
63 for (auto &f : _sprite_files) {
64 if (f->GetFilename() == filename) {
65 return f.get();
66 }
67 }
68 return nullptr;
69}
70
71/**
72 * Get the list of cached SpriteFiles.

Callers 2

spritecache.cppFile · 0.85
GetSpriteCountForFileFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected