1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-10-31 00:07:39 +02:00

Merge pull request #5127 from IvanSavenko/hotfix

[1.6.1] Fixes for 1.6.0 issues reported on Discord
This commit is contained in:
Ivan Savenko
2024-12-25 00:12:55 +02:00
committed by GitHub
6 changed files with 115 additions and 42 deletions

View File

@@ -356,6 +356,10 @@ EUpscalingFilter ScreenHandler::loadUpscalingFilter() const
return filter;
// else - autoselect
#ifdef VCMI_MOBILE
// to help with performance - only if player explicitly enabled xbrz
return EUpscalingFilter::NONE;
#else
Point outputResolution = getRenderResolution();
Point logicalResolution = getPreferredLogicalResolution();
@@ -363,6 +367,14 @@ EUpscalingFilter ScreenHandler::loadUpscalingFilter() const
float scaleY = static_cast<float>(outputResolution.x) / logicalResolution.x;
float scaling = std::min(scaleX, scaleY);
if (scaling <= 1.001f)
return EUpscalingFilter::NONE; // running at original resolution or even lower than that - no need for xbrz
else
return EUpscalingFilter::XBRZ_2;
#endif
#if 0
// Old version, most optimal, but rather performance-heavy
if (scaling <= 1.001f)
return EUpscalingFilter::NONE; // running at original resolution or even lower than that - no need for xbrz
if (scaling <= 2.001f)
@@ -371,6 +383,7 @@ EUpscalingFilter ScreenHandler::loadUpscalingFilter() const
return EUpscalingFilter::XBRZ_3; // resolutions below 2400p (including 1440p and 2160p / 4K)
return EUpscalingFilter::XBRZ_4; // Only for massive displays, e.g. 8K
#endif
}
void ScreenHandler::selectUpscalingFilter()