mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 22:28:10 +00:00
SDL: Set better default scaler for high-resolution games
Now that we have higher scale factors than 3, it makes sense to try and figure out a default scaler for high-resolution games that approximate the window size of a low resolution game. That also means that we are not necessarily restricted to the normal scaler, since AdvMame has both 2x and 4x versions.
This commit is contained in:
parent
dcf4fb5d2d
commit
b5f27b5950
@ -716,12 +716,20 @@ void SurfaceSdlGraphicsManager::initSize(uint w, uint h, const Graphics::PixelFo
|
||||
|
||||
if ((int)w != _videoMode.screenWidth || (int)h != _videoMode.screenHeight) {
|
||||
const bool useDefault = defaultGraphicsModeConfig();
|
||||
int scaleFactor = ConfMan.getInt("scale_factor");
|
||||
int mode = _videoMode.scalerIndex;
|
||||
if (useDefault && w > 320) {
|
||||
// Only the normal scaler has a 1x mode
|
||||
setScaler(ScalerMan.findScalerPluginIndex("normal"), 1);
|
||||
} else {
|
||||
setScaler(_videoMode.scalerIndex, ConfMan.getInt("scale_factor"));
|
||||
// The default scaler is assumed to be for low
|
||||
// resolution games. For high resolution games, pick
|
||||
// the largest scale factor that gives at most the
|
||||
// same window width.
|
||||
scaleFactor = MAX<uint>(1, (scaleFactor * 320) / w);
|
||||
|
||||
// Only the normal scaler has a 1x mode.
|
||||
if (scaleFactor == 1)
|
||||
mode = ScalerMan.findScalerPluginIndex("normal");
|
||||
}
|
||||
setScaler(mode, scaleFactor);
|
||||
}
|
||||
|
||||
_videoMode.screenWidth = w;
|
||||
|
Loading…
Reference in New Issue
Block a user