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

Function GetScreenshotProvider

src/screenshot.cpp:49–58  ·  view source on GitHub ↗

* Get the screenshot provider for the selected format. * If the selected provider is not found, then the first provider will be used instead. * @returns ScreenshotProvider, or null if none exist. */

Source from the content-addressed store, hash-verified

47 * @returns ScreenshotProvider, or null if none exist.
48 */
49static const ScreenshotProvider *GetScreenshotProvider()
50{
51 const auto &providers = ProviderManager<ScreenshotProvider>::GetProviders();
52 if (providers.empty()) return nullptr;
53
54 auto it = std::ranges::find(providers, _screenshot_format_name, &ScreenshotProvider::GetName);
55 if (it != std::end(providers)) return *it;
56
57 return providers.front();
58}
59
60/** Get filename extension of current screenshot file format. */
61std::string_view GetCurrentScreenshotExtension()

Callers 6

MakeSmallScreenshotFunction · 0.85
MakeLargeWorldScreenshotFunction · 0.85
MakeHeightmapScreenshotFunction · 0.85
RealMakeScreenshotFunction · 0.85

Calls 3

findFunction · 0.50
endFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected