GUI: Ommit aspect ratio checkbox if this feature is missing
Also fix compilation when building for --disable-aspect (buggy end bracket in backends/graphics/surfacesdl/surfacesdl-graphics.cpp)
This commit is contained in:
parent
d7517eb8e3
commit
cc73fd7f5f
3 changed files with 29 additions and 16 deletions
|
@ -108,7 +108,9 @@ OpenGLGraphicsManager::~OpenGLGraphicsManager() {
|
|||
|
||||
bool OpenGLGraphicsManager::hasFeature(OSystem::Feature f) const {
|
||||
switch (f) {
|
||||
#ifdef USE_ASPECT
|
||||
case OSystem::kFeatureAspectRatioCorrection:
|
||||
#endif
|
||||
case OSystem::kFeatureCursorPalette:
|
||||
case OSystem::kFeatureFilteringMode:
|
||||
case OSystem::kFeatureStretchMode:
|
||||
|
|
|
@ -1381,8 +1381,8 @@ void SurfaceSdlGraphicsManager::internUpdateScreen() {
|
|||
#ifdef USE_ASPECT
|
||||
if (_videoMode.aspectRatioCorrection && orig_dst_y < height && !_overlayInGUI)
|
||||
r->h = stretch200To240((uint8 *) _hwScreen->pixels, dstPitch, r->w, r->h, r->x, r->y, orig_dst_y * scale1, _videoMode.filtering, convertSDLPixelFormat(_hwScreen->format));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
SDL_UnlockSurface(srcSurf);
|
||||
SDL_UnlockSurface(_hwScreen);
|
||||
|
|
|
@ -366,12 +366,14 @@ void OptionsDialog::build() {
|
|||
}
|
||||
|
||||
// Aspect ratio setting
|
||||
if (_guioptions.contains(GUIO_NOASPECT)) {
|
||||
_aspectCheckbox->setState(false);
|
||||
_aspectCheckbox->setEnabled(false);
|
||||
} else {
|
||||
_aspectCheckbox->setEnabled(true);
|
||||
_aspectCheckbox->setState(ConfMan.getBool("aspect_ratio", _domain));
|
||||
if (g_system->hasFeature(OSystem::kFeatureAspectRatioCorrection)) {
|
||||
if (_guioptions.contains(GUIO_NOASPECT)) {
|
||||
_aspectCheckbox->setState(false);
|
||||
_aspectCheckbox->setEnabled(false);
|
||||
} else {
|
||||
_aspectCheckbox->setEnabled(true);
|
||||
_aspectCheckbox->setState(ConfMan.getBool("aspect_ratio", _domain));
|
||||
}
|
||||
}
|
||||
|
||||
if (g_system->hasFeature(OSystem::kFeatureVSync)) {
|
||||
|
@ -612,8 +614,10 @@ void OptionsDialog::apply() {
|
|||
ConfMan.setBool("fullscreen", _fullscreenCheckbox->getState(), _domain);
|
||||
_fullscreenCheckbox->setOverride(false);
|
||||
}
|
||||
if (ConfMan.getBool("aspect_ratio", _domain) != _aspectCheckbox->getState())
|
||||
graphicsModeChanged = true;
|
||||
if (g_system->hasFeature(OSystem::kFeatureAspectRatioCorrection)) {
|
||||
if (ConfMan.getBool("aspect_ratio", _domain) != _aspectCheckbox->getState())
|
||||
graphicsModeChanged = true;
|
||||
}
|
||||
if (g_system->hasFeature(OSystem::kFeatureVSync)) {
|
||||
if (ConfMan.getBool("vsync", _domain) != _vsyncCheckbox->getState()) {
|
||||
graphicsModeChanged = true;
|
||||
|
@ -622,7 +626,9 @@ void OptionsDialog::apply() {
|
|||
}
|
||||
}
|
||||
|
||||
ConfMan.setBool("aspect_ratio", _aspectCheckbox->getState(), _domain);
|
||||
if (g_system->hasFeature(OSystem::kFeatureAspectRatioCorrection)) {
|
||||
ConfMan.setBool("aspect_ratio", _aspectCheckbox->getState(), _domain);
|
||||
}
|
||||
|
||||
bool isSet = false;
|
||||
|
||||
|
@ -1291,10 +1297,12 @@ void OptionsDialog::setGraphicSettingsState(bool enabled) {
|
|||
else
|
||||
_fullscreenCheckbox->setEnabled(false);
|
||||
|
||||
if (_guioptions.contains(GUIO_NOASPECT))
|
||||
_aspectCheckbox->setEnabled(false);
|
||||
else
|
||||
_aspectCheckbox->setEnabled(enabled);
|
||||
if (g_system->hasFeature(OSystem::kFeatureAspectRatioCorrection)) {
|
||||
if (_guioptions.contains(GUIO_NOASPECT))
|
||||
_aspectCheckbox->setEnabled(false);
|
||||
else
|
||||
_aspectCheckbox->setEnabled(enabled);
|
||||
}
|
||||
|
||||
if (g_system->hasFeature(OSystem::kFeatureVSync))
|
||||
_vsyncCheckbox->setEnabled(enabled);
|
||||
|
@ -1699,7 +1707,8 @@ void OptionsDialog::addGraphicControls(GuiObject *boss, const Common::String &pr
|
|||
_filteringCheckbox = new CheckboxWidget(boss, prefix + "grFilteringCheckbox", _("Filter graphics"), _("Use linear filtering when scaling graphics"));
|
||||
|
||||
// Aspect ratio checkbox
|
||||
_aspectCheckbox = new CheckboxWidget(boss, prefix + "grAspectCheckbox", _("Aspect ratio correction"), _("Correct aspect ratio for games"));
|
||||
if (g_system->hasFeature(OSystem::kFeatureAspectRatioCorrection))
|
||||
_aspectCheckbox = new CheckboxWidget(boss, prefix + "grAspectCheckbox", _("Aspect ratio correction"), _("Correct aspect ratio for games"));
|
||||
|
||||
_enableGraphicSettings = true;
|
||||
}
|
||||
|
@ -2047,7 +2056,9 @@ void OptionsDialog::setupGraphicsTab() {
|
|||
if (g_system->hasFeature(OSystem::kFeatureFilteringMode))
|
||||
_filteringCheckbox->setVisible(true);
|
||||
|
||||
_aspectCheckbox->setVisible(true);
|
||||
if (g_system->hasFeature(OSystem::kFeatureAspectRatioCorrection))
|
||||
_aspectCheckbox->setVisible(true);
|
||||
|
||||
_renderModePopUpDesc->setVisible(true);
|
||||
_renderModePopUp->setVisible(true);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue