mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-10 03:40:25 +00:00
OPENGL: Restrict window scaling if current desktop resolution is not big enough.
svn-id: r52057
This commit is contained in:
parent
610f041930
commit
503578ac10
@ -433,6 +433,13 @@ bool OpenGLSdlGraphicsManager::handleScalerHotkeys(Common::KeyCode key) {
|
||||
int factor = _videoMode.scaleFactor;
|
||||
factor += (sdlKey == SDLK_MINUS || sdlKey == SDLK_KP_MINUS) ? -1 : +1;
|
||||
if (0 < factor && factor < 4) {
|
||||
// Check if the desktop resolution has been detected
|
||||
if (_desktopWidth > 0 && _desktopHeight > 0)
|
||||
// If the new scale factor is too big, do not scale
|
||||
if (_videoMode.screenWidth * factor > _desktopWidth ||
|
||||
_videoMode.screenHeight * factor > _desktopHeight)
|
||||
return false;
|
||||
|
||||
beginGFXTransaction();
|
||||
setScale(factor);
|
||||
endGFXTransaction();
|
||||
|
Loading…
Reference in New Issue
Block a user