1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-23 12:14:11 +01:00

Codefix: Move provider instances to static members. (#14501)

Avoids misnaming in global scope.
This commit is contained in:
Peter Nelson
2025-08-07 09:21:44 +01:00
committed by GitHub
parent 2b6cb8a2d2
commit ed1262cab9
6 changed files with 24 additions and 6 deletions

View File

@@ -145,6 +145,9 @@ public:
return true;
}
private:
static ScreenshotProvider_Bmp instance;
};
static ScreenshotProvider_Bmp s_screenshot_provider_bmp;
/* static */ ScreenshotProvider_Bmp ScreenshotProvider_Bmp::instance{};

View File

@@ -149,6 +149,9 @@ public:
return success;
}
private:
static ScreenshotProvider_Pcx instance;
};
static const ScreenshotProvider_Pcx s_screenshot_provider_pcx;
/* static */ ScreenshotProvider_Pcx ScreenshotProvider_Pcx::instance{};

View File

@@ -177,6 +177,9 @@ private:
{
Debug(misc, 1, "[libpng] warning: {} - {}", message, *static_cast<std::string_view *>(png_get_error_ptr(png_ptr)));
}
private:
static ScreenshotProvider_Png instance;
};
static ScreenshotProvider_Png s_screenshot_provider_png;
/* static */ ScreenshotProvider_Png ScreenshotProvider_Png::instance{};

View File

@@ -83,6 +83,9 @@ public:
return true;
}
private:
static SoundLoader_Opus instance;
};
static SoundLoader_Opus s_sound_loader_opus;
/* static */ SoundLoader_Opus SoundLoader_Opus::instance{};

View File

@@ -47,6 +47,9 @@ public:
return true;
}
private:
static SoundLoader_Raw instance;
};
static SoundLoader_Raw s_sound_loader_raw;
/* static */ SoundLoader_Raw SoundLoader_Raw::instance{};

View File

@@ -96,6 +96,9 @@ public:
return false;
}
private:
static SoundLoader_Wav instance;
};
static SoundLoader_Wav s_sound_loader_wav;
/* static */ SoundLoader_Wav SoundLoader_Wav::instance{};