GS: Support saving WebP screenshots

This commit is contained in:
Stenzek 2024-03-28 17:03:21 +10:00 committed by Connor McLaughlin
parent 590b81a782
commit ebf0cf91b6
4 changed files with 8 additions and 1 deletions

View File

@ -426,6 +426,11 @@
<string>JPEG</string>
</property>
</item>
<item>
<property name="text">
<string>WebP</string>
</property>
</item>
</widget>
</item>
<item>

View File

@ -326,6 +326,7 @@ enum class GSScreenshotFormat : u8
{
PNG,
JPEG,
WebP,
Count,
};

View File

@ -422,7 +422,7 @@ static GSVector4i CalculateDrawSrcRect(const GSTexture* src, const GSVector2i re
static const char* GetScreenshotSuffix()
{
static constexpr const char* suffixes[static_cast<u8>(GSScreenshotFormat::Count)] = {
"png", "jpg"};
"png", "jpg", "webp"};
return suffixes[static_cast<u8>(GSConfig.ScreenshotFormat)];
}

View File

@ -3219,6 +3219,7 @@ void FullscreenUI::DrawGraphicsSettingsPage()
static constexpr const char* s_screenshot_formats[] = {
FSUI_NSTR("PNG"),
FSUI_NSTR("JPEG"),
FSUI_NSTR("WebP"),
};
SettingsInterface* bsi = GetEditingSettingsInterface();