aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorThierry Crozat2018-07-01 23:57:00 +0100
committerThierry Crozat2018-07-08 16:54:51 +0100
commit89f1b1c96eaa8cbb4f4938bd6524cab6c15227c1 (patch)
treed3fb95fd998ec656b4493fc2d685045881a5f979 /gui
parentadacb4fcfd743aa3980b3e08c62578f32de2d0b3 (diff)
downloadscummvm-rg350-89f1b1c96eaa8cbb4f4938bd6524cab6c15227c1.tar.gz
scummvm-rg350-89f1b1c96eaa8cbb4f4938bd6524cab6c15227c1.tar.bz2
scummvm-rg350-89f1b1c96eaa8cbb4f4938bd6524cab6c15227c1.zip
GUI: Add Stretch Mode selection in Options dialog
Diffstat (limited to 'gui')
-rw-r--r--gui/options.cpp69
-rw-r--r--gui/options.h2
-rw-r--r--gui/themes/default.inc16
-rw-r--r--gui/themes/scummclassic.zipbin129144 -> 129635 bytes
-rw-r--r--gui/themes/scummclassic/classic_layout.stx8
-rw-r--r--gui/themes/scummclassic/classic_layout_lowres.stx8
-rw-r--r--gui/themes/scummmodern.zipbin1648684 -> 1649175 bytes
-rw-r--r--gui/themes/scummmodern/scummmodern_layout.stx8
-rw-r--r--gui/themes/scummmodern/scummmodern_layout_lowres.stx8
9 files changed, 118 insertions, 1 deletions
diff --git a/gui/options.cpp b/gui/options.cpp
index 6083a2ccbf..bee161e2c9 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -154,6 +154,8 @@ void OptionsDialog::init() {
_gfxPopUpDesc = 0;
_renderModePopUp = 0;
_renderModePopUpDesc = 0;
+ _stretchPopUp = 0;
+ _stretchPopUpDesc = 0;
_fullscreenCheckbox = 0;
_filteringCheckbox = 0;
_aspectCheckbox = 0;
@@ -285,6 +287,25 @@ void OptionsDialog::build() {
_renderModePopUp->setSelectedTag(sel);
}
+ _stretchPopUp->setSelected(0);
+
+ if (g_system->hasFeature(OSystem::kFeatureStretchMode)) {
+ if (ConfMan.hasKey("stretch_mode", _domain)) {
+ const OSystem::GraphicsMode *sm = g_system->getSupportedStretchModes();
+ Common::String stretchMode(ConfMan.get("stretch_mode", _domain));
+ int stretchCount = 1;
+ while (sm->name) {
+ stretchCount++;
+ if (scumm_stricmp(sm->name, stretchMode.c_str()) == 0)
+ _stretchPopUp->setSelected(stretchCount);
+ sm++;
+ }
+ }
+ } else {
+ _stretchPopUpDesc->setVisible(false);
+ _stretchPopUp->setVisible(false);
+ }
+
#ifdef GUI_ONLY_FULLSCREEN
_fullscreenCheckbox->setState(true);
_fullscreenCheckbox->setEnabled(false);
@@ -470,6 +491,23 @@ void OptionsDialog::apply() {
if ((int32)_renderModePopUp->getSelectedTag() >= 0)
ConfMan.set("render_mode", Common::getRenderModeCode((Common::RenderMode)_renderModePopUp->getSelectedTag()), _domain);
+
+ isSet = false;
+ if ((int32)_stretchPopUp->getSelectedTag() >= 0) {
+ const OSystem::GraphicsMode *sm = g_system->getSupportedStretchModes();
+ while (sm->name) {
+ if (sm->id == (int)_stretchPopUp->getSelectedTag()) {
+ if (ConfMan.get("stretch_mode", _domain) != sm->name)
+ graphicsModeChanged = true;
+ ConfMan.set("stretch_mode", sm->name, _domain);
+ isSet = true;
+ break;
+ }
+ sm++;
+ }
+ }
+ if (!isSet)
+ ConfMan.removeKey("stretch_mode", _domain);
} else {
ConfMan.removeKey("fullscreen", _domain);
ConfMan.removeKey("filtering", _domain);
@@ -484,6 +522,8 @@ void OptionsDialog::apply() {
g_system->beginGFXTransaction();
g_system->setGraphicsMode(ConfMan.get("gfx_mode", _domain).c_str());
+ if (ConfMan.hasKey("stretch_mode"))
+ g_system->setStretchMode(ConfMan.get("stretch_mode", _domain).c_str());
if (ConfMan.hasKey("aspect_ratio"))
g_system->setFeatureState(OSystem::kFeatureAspectRatioCorrection, ConfMan.getBool("aspect_ratio", _domain));
if (ConfMan.hasKey("fullscreen"))
@@ -519,7 +559,20 @@ void OptionsDialog::apply() {
gm++;
}
message += "\n";
- message += _("the video mode could not be changed.");
+ message += _("the video mode could not be changed");
+ }
+
+ if (gfxError & OSystem::kTransactionStretchModeSwitchFailed) {
+ const OSystem::GraphicsMode *sm = g_system->getSupportedStretchModes();
+ while (sm->name) {
+ if (sm->id == g_system->getStretchMode()) {
+ ConfMan.set("stretch_mode", sm->name, _domain);
+ break;
+ }
+ sm++;
+ }
+ message += "\n";
+ message += _("the stretch mode could not be changed");
}
if (gfxError & OSystem::kTransactionAspectRatioFailed) {
@@ -805,6 +858,8 @@ void OptionsDialog::setGraphicSettingsState(bool enabled) {
_gfxPopUp->setEnabled(enabled);
_renderModePopUpDesc->setEnabled(enabled);
_renderModePopUp->setEnabled(enabled);
+ _stretchPopUpDesc->setEnabled(enabled);
+ _stretchPopUp->setEnabled(enabled);
_filteringCheckbox->setEnabled(enabled);
#ifndef GUI_ENABLE_KEYSDIALOG
#ifndef GUI_ONLY_FULLSCREEN
@@ -1014,6 +1069,18 @@ void OptionsDialog::addGraphicControls(GuiObject *boss, const Common::String &pr
_renderModePopUp->appendEntry(_c(rm->description, context), rm->id);
}
+ // The Stretch mode popup
+ const OSystem::GraphicsMode *sm = g_system->getSupportedStretchModes();
+ _stretchPopUpDesc = new StaticTextWidget(boss, prefix + "grStretchModePopupDesc", _("Stretch mode:"));
+ _stretchPopUp = new PopUpWidget(boss, prefix + "grStretchModePopup");
+
+ _stretchPopUp->appendEntry(_("<default>"));
+ _stretchPopUp->appendEntry("");
+ while (sm->name) {
+ _stretchPopUp->appendEntry(_c(sm->description, context), sm->id);
+ sm++;
+ }
+
// Fullscreen checkbox
_fullscreenCheckbox = new CheckboxWidget(boss, prefix + "grFullscreenCheckbox", _("Fullscreen mode"));
diff --git a/gui/options.h b/gui/options.h
index bc58d7a63e..a2dec898dd 100644
--- a/gui/options.h
+++ b/gui/options.h
@@ -138,6 +138,8 @@ private:
bool _enableGraphicSettings;
StaticTextWidget *_gfxPopUpDesc;
PopUpWidget *_gfxPopUp;
+ StaticTextWidget *_stretchPopUpDesc;
+ PopUpWidget *_stretchPopUp;
CheckboxWidget *_fullscreenCheckbox;
CheckboxWidget *_filteringCheckbox;
CheckboxWidget *_aspectCheckbox;
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index fe48acd1a0..098c8734cc 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -866,6 +866,14 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"type='PopUp' "
"/>"
"</layout>"
+"<layout type='horizontal' padding='0,0,0,0' spacing='10' center='true'>"
+"<widget name='grStretchModePopupDesc' "
+"type='OptionsLabel' "
+"/>"
+"<widget name='grStretchModePopup' "
+"type='PopUp' "
+"/>"
+"</layout>"
"<widget name='grAspectCheckbox' "
"type='Checkbox' "
"/>"
@@ -2447,6 +2455,14 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"type='PopUp' "
"/>"
"</layout>"
+"<layout type='horizontal' padding='0,0,0,0' spacing='6' center='true'>"
+"<widget name='grStretchModePopupDesc' "
+"type='OptionsLabel' "
+"/>"
+"<widget name='grStretchModePopup' "
+"type='PopUp' "
+"/>"
+"</layout>"
"<widget name='grAspectCheckbox' "
"type='Checkbox' "
"/>"
diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip
index 4f7e3ce68d..8b5b52fbfb 100644
--- a/gui/themes/scummclassic.zip
+++ b/gui/themes/scummclassic.zip
Binary files differ
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index e3411dcb3e..23f8acaa26 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -292,6 +292,14 @@
type = 'PopUp'
/>
</layout>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
+ <widget name = 'grStretchModePopupDesc'
+ type = 'OptionsLabel'
+ />
+ <widget name = 'grStretchModePopup'
+ type = 'PopUp'
+ />
+ </layout>
<widget name = 'grAspectCheckbox'
type = 'Checkbox'
/>
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index 4b710b8999..ae3a6eefe3 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -289,6 +289,14 @@
type = 'PopUp'
/>
</layout>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '6' center = 'true'>
+ <widget name = 'grStretchModePopupDesc'
+ type = 'OptionsLabel'
+ />
+ <widget name = 'grStretchModePopup'
+ type = 'PopUp'
+ />
+ </layout>
<widget name = 'grAspectCheckbox'
type = 'Checkbox'
/>
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index fae746b72c..de7c587e6a 100644
--- a/gui/themes/scummmodern.zip
+++ b/gui/themes/scummmodern.zip
Binary files differ
diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx
index 34b66e2274..5cf22f90b4 100644
--- a/gui/themes/scummmodern/scummmodern_layout.stx
+++ b/gui/themes/scummmodern/scummmodern_layout.stx
@@ -306,6 +306,14 @@
type = 'PopUp'
/>
</layout>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
+ <widget name = 'grStretchModePopupDesc'
+ type = 'OptionsLabel'
+ />
+ <widget name = 'grStretchModePopup'
+ type = 'PopUp'
+ />
+ </layout>
<widget name = 'grAspectCheckbox'
type = 'Checkbox'
/>
diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
index 506a97520e..651efb4a48 100644
--- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx
+++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
@@ -287,6 +287,14 @@
type = 'PopUp'
/>
</layout>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '6' center = 'true'>
+ <widget name = 'grStretchModePopupDesc'
+ type = 'OptionsLabel'
+ />
+ <widget name = 'grStretchModePopup'
+ type = 'PopUp'
+ />
+ </layout>
<widget name = 'grAspectCheckbox'
type = 'Checkbox'
/>