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

Function GetFileByFilename

src/newgrf.cpp:116–121  ·  view source on GitHub ↗

* Obtain a NewGRF file by its filename * @param filename The filename to obtain the file for. * @return The file. */

Source from the content-addressed store, hash-verified

114 * @return The file.
115 */
116static GRFFile *GetFileByFilename(const std::string &filename)
117{
118 auto it = std::ranges::find(_grf_files, filename, &GRFFile::filename);
119 if (it != std::end(_grf_files)) return &*it;
120 return nullptr;
121}
122
123/** Reset all NewGRFData that was used only while processing data */
124static void ClearTemporaryNewGRFData(GRFFile *gf)

Callers 2

InitNewGRFFileFunction · 0.85
LoadNewGRFFileFunction · 0.85

Calls 2

findFunction · 0.50
endFunction · 0.50

Tested by

no test coverage detected