OPENGL: Improve aspect ratio correction mode selection.
svn-id: r51752
This commit is contained in:
parent
4b5138483e
commit
f97809a9a6
3 changed files with 21 additions and 3 deletions
|
@ -38,6 +38,9 @@ OpenGLGraphicsManager::OpenGLGraphicsManager()
|
||||||
:
|
:
|
||||||
#ifdef USE_OSD
|
#ifdef USE_OSD
|
||||||
_osdTexture(0), _osdAlpha(0), _osdFadeStartTime(0),
|
_osdTexture(0), _osdAlpha(0), _osdFadeStartTime(0),
|
||||||
|
#endif
|
||||||
|
#ifndef USE_ALL_ASR
|
||||||
|
_desiredAspectRatio(kAspectRatio4_3),
|
||||||
#endif
|
#endif
|
||||||
_gameTexture(0), _overlayTexture(0), _cursorTexture(0),
|
_gameTexture(0), _overlayTexture(0), _cursorTexture(0),
|
||||||
_screenChangeCount(0), _screenNeedsRedraw(false),
|
_screenChangeCount(0), _screenNeedsRedraw(false),
|
||||||
|
@ -65,6 +68,14 @@ OpenGLGraphicsManager::OpenGLGraphicsManager()
|
||||||
|
|
||||||
// Register the graphics manager as a event observer
|
// Register the graphics manager as a event observer
|
||||||
g_system->getEventManager()->getEventDispatcher()->registerObserver(this, 2, false);
|
g_system->getEventManager()->getEventDispatcher()->registerObserver(this, 2, false);
|
||||||
|
|
||||||
|
#ifndef USE_ALL_ASR
|
||||||
|
Common::String desiredAspectRatio = ConfMan.get("desired_screen_aspect_ratio");
|
||||||
|
if (!scumm_stricmp(desiredAspectRatio.c_str(), "16/9"))
|
||||||
|
_desiredAspectRatio = kAspectRatio16_9;
|
||||||
|
else if (!scumm_stricmp(desiredAspectRatio.c_str(), "16/10"))
|
||||||
|
_desiredAspectRatio = kAspectRatio16_10;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
OpenGLGraphicsManager::~OpenGLGraphicsManager() {
|
OpenGLGraphicsManager::~OpenGLGraphicsManager() {
|
||||||
|
@ -1178,7 +1189,12 @@ void OpenGLGraphicsManager::setAspectRatioCorrection(int ratio) {
|
||||||
#ifdef USE_ALL_ASR
|
#ifdef USE_ALL_ASR
|
||||||
_videoMode.aspectRatioCorrection = (_videoMode.aspectRatioCorrection + 1) % 5;
|
_videoMode.aspectRatioCorrection = (_videoMode.aspectRatioCorrection + 1) % 5;
|
||||||
#else
|
#else
|
||||||
_videoMode.aspectRatioCorrection = (_videoMode.aspectRatioCorrection + 1) % 3;
|
if (_videoMode.aspectRatioCorrection == kAspectRatioNone)
|
||||||
|
_videoMode.aspectRatioCorrection = kAspectRatioConserve;
|
||||||
|
else if (_videoMode.aspectRatioCorrection == kAspectRatioConserve)
|
||||||
|
_videoMode.aspectRatioCorrection = _desiredAspectRatio;
|
||||||
|
else
|
||||||
|
_videoMode.aspectRatioCorrection = kAspectRatioNone;
|
||||||
#endif
|
#endif
|
||||||
else
|
else
|
||||||
_videoMode.aspectRatioCorrection = ratio;
|
_videoMode.aspectRatioCorrection = ratio;
|
||||||
|
|
|
@ -189,6 +189,10 @@ protected:
|
||||||
int _aspectWidth;
|
int _aspectWidth;
|
||||||
int _aspectHeight;
|
int _aspectHeight;
|
||||||
|
|
||||||
|
#ifndef USE_ALL_ASR
|
||||||
|
int _desiredAspectRatio;
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the aspect ratio mode.
|
* Sets the aspect ratio mode.
|
||||||
* @mode the aspect ratio mode, if -1 it will switch to next mode.
|
* @mode the aspect ratio mode, if -1 it will switch to next mode.
|
||||||
|
|
|
@ -673,7 +673,6 @@ static void fixupResolutionForAspectRatio(AspectRatio desiredAspectRatio, int &w
|
||||||
continue;
|
continue;
|
||||||
if (mode->h * kw != mode->w * kh)
|
if (mode->h * kw != mode->w * kh)
|
||||||
continue;
|
continue;
|
||||||
//printf("%d %d\n", mode->w, mode->h);
|
|
||||||
|
|
||||||
uint metric = mode->w * mode->h - w * h;
|
uint metric = mode->w * mode->h - w * h;
|
||||||
if (metric > bestMetric)
|
if (metric > bestMetric)
|
||||||
|
@ -687,7 +686,6 @@ static void fixupResolutionForAspectRatio(AspectRatio desiredAspectRatio, int &w
|
||||||
warning("Unable to enforce the desired aspect ratio!");
|
warning("Unable to enforce the desired aspect ratio!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//printf("%d %d\n", bestMode->w, bestMode->h);
|
|
||||||
width = bestMode->w;
|
width = bestMode->w;
|
||||||
height = bestMode->h;
|
height = bestMode->h;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue