MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / GetFilePath

Method GetFilePath

src/openrct2/PlatformEnvironment.cpp:143–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141 }
142
143 u8string GetFilePath(PathId pathid) const override
144 {
145 auto dirbase = GetDefaultBaseDirectory(pathid);
146 auto basePath = GetDirectoryPath(dirbase);
147 auto fileName = kFileNames[EnumValue(pathid)];
148
149 auto assetPath = Platform::GetAssetPath();
150 if (!assetPath.empty())
151 {
152 auto combinedAssetPath = Path::Combine(assetPath, basePath, fileName);
153 if (File::Exists(combinedAssetPath))
154 {
155 return combinedAssetPath;
156 }
157 }
158
159 return Path::Combine(basePath, fileName);
160 }
161
162 u8string FindFile(DirBase base, DirId did, u8string_view fileName) const override
163 {

Callers 14

HandleCommandSetRCT2Function · 0.80
ScenarioFileIndexMethod · 0.80
LoadScoresMethod · 0.80
LoadLegacyScoresMethod · 0.80
SaveHighscoresMethod · 0.80
ReadFavouritesMethod · 0.80
TrackDesignFileIndexMethod · 0.80
LoadSharedStorageMethod · 0.80
SaveSharedStorageMethod · 0.80
ObjectFileIndexMethod · 0.80
GetTextMethod · 0.80

Calls 5

EnumValueFunction · 0.85
ExistsFunction · 0.85
GetAssetPathFunction · 0.50
CombineFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected