Commit 3f5440bb authored by Thomas Jentzsch's avatar Thomas Jentzsch
Browse files

some minor UI cosmetics

parent be775b53
......@@ -63,7 +63,7 @@ void Properties::set(PropertyType key, const string& value)
case Display_PPBlend:
{
int blend = atoi(myProperties[key].c_str());
if(blend < 1 || blend > 100)
if(blend < 0 || blend > 100)
myProperties[key] = ourDefaultProperties[key];
break;
}
......
......@@ -111,14 +111,14 @@ GameInfoDialog::GameInfoDialog(
myFormatDetected = new StaticTextWidget(myTab, ifont, myFormat->getRight() + 8, ypos + 4, "SECAM60 detected");
// Phosphor
ypos += lineHeight + VGAP;
myPhosphor = new CheckboxWidget(myTab, font, HBORDER, ypos + 1, "Phosphor", kPhosphorChanged);
ypos += lineHeight + VGAP * 2;
myPhosphor = new CheckboxWidget(myTab, font, HBORDER, ypos + 1, "Phosphor (enabled for all ROMs)", kPhosphorChanged);
wid.push_back(myPhosphor);
ypos += lineHeight + VGAP;
myPPBlend = new SliderWidget(myTab, font,
HBORDER + 20, ypos,
"Blend ", 0, kPPBlendChanged, 7 * fontWidth, "%");
"Blend ", 0, kPPBlendChanged, 4 * fontWidth, "%");
myPPBlend->setMinValue(0); myPPBlend->setMaxValue(100);
myPPBlend->setTickmarkInterval(2);
wid.push_back(myPPBlend);
......@@ -392,12 +392,14 @@ void GameInfoDialog::loadEmulationProperties(const Properties& props)
bool usePhosphor = props.get(Display_Phosphor) == "YES";
myPhosphor->setState(usePhosphor);
myPhosphor->setEnabled(!alwaysPhosphor);
if (alwaysPhosphor)
myPhosphor->setLabel("Phosphor (enabled for all ROMs)");
else
myPhosphor->setLabel("Phosphor");
myPPBlend->setEnabled(!alwaysPhosphor && usePhosphor);
const string& blend = props.get(Display_PPBlend);
myPPBlend->setValue(atoi(blend.c_str()));
myPPBlend->setValueLabel(blend == "0" ? "Default" : blend);
myPPBlend->setValueUnit(blend == "0" ? "" : "%");
mySound->setState(props.get(Cartridge_Sound) == "STEREO");
// if stereo is always enabled, disable game specific stereo setting
......@@ -511,7 +513,7 @@ void GameInfoDialog::saveConfig()
myGameProperties.set(Display_Format, myFormat->getSelectedTag().toString());
myGameProperties.set(Display_Phosphor, myPhosphor->getState() ? "YES" : "NO");
myGameProperties.set(Display_PPBlend, myPPBlend->getValueLabel() == "Default" ? "0" :
myGameProperties.set(Display_PPBlend, myPPBlend->getValueLabel() == "Off" ? "0" :
myPPBlend->getValueLabel());
myGameProperties.set(Cartridge_Sound, mySound->getState() ? "STEREO" : "MONO");
......@@ -700,7 +702,7 @@ void GameInfoDialog::handleCommand(CommandSender* sender, int cmd,
case kPPBlendChanged:
if(myPPBlend->getValue() == 0)
{
myPPBlend->setValueLabel("Default");
myPPBlend->setValueLabel("Off");
myPPBlend->setValueUnit("");
}
else
......
......@@ -265,9 +265,9 @@ void StellaSettingsDialog::setDefaults()
// TV effects
myTVMode->setSelected("0", "0");
// TV scanline intensity
myTVScanIntense->setValue(4); // = 26%
myTVScanIntense->setValue(0); // = off
// TV phosphor blend
myTVPhosLevel->setValue(6); // = 45%
myTVPhosLevel->setValue(0); // = off
// Load the default game properties
Properties defaultProperties;
......@@ -295,12 +295,12 @@ void StellaSettingsDialog::handleCommand(CommandSender* sender, int cmd,
case kScanlinesChanged:
if(myTVScanIntense->getValue() == 0)
myTVScanIntense->setValueLabel("off");
myTVScanIntense->setValueLabel("Off");
break;
case kPhosphorChanged:
if(myTVPhosLevel->getValue() == 0)
myTVPhosLevel->setValueLabel("off");
myTVPhosLevel->setValueLabel("Off");
break;
default:
......
......@@ -246,25 +246,25 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
xpos += INDENT - 2; ypos += 0;
lwidth = font.getStringWidth("Saturation ");
#define CREATE_CUSTOM_SLIDERS(obj, desc) \
#define CREATE_CUSTOM_SLIDERS(obj, desc, cmd) \
myTV ## obj = \
new SliderWidget(myTab, font, xpos, ypos-1, swidth, lineHeight, \
desc, lwidth, 0, fontWidth*4, "%"); \
desc, lwidth, cmd, fontWidth*4, "%"); \
myTV ## obj->setMinValue(0); myTV ## obj->setMaxValue(100); \
myTV ## obj->setTickmarkInterval(2); \
wid.push_back(myTV ## obj); \
ypos += lineHeight + VGAP;
CREATE_CUSTOM_SLIDERS(Contrast, "Contrast ")
CREATE_CUSTOM_SLIDERS(Bright, "Brightness ")
CREATE_CUSTOM_SLIDERS(Hue, "Hue ")
CREATE_CUSTOM_SLIDERS(Satur, "Saturation ")
CREATE_CUSTOM_SLIDERS(Gamma, "Gamma ")
CREATE_CUSTOM_SLIDERS(Sharp, "Sharpness ")
CREATE_CUSTOM_SLIDERS(Res, "Resolution ")
CREATE_CUSTOM_SLIDERS(Artifacts, "Artifacts ")
CREATE_CUSTOM_SLIDERS(Fringe, "Fringing ")
CREATE_CUSTOM_SLIDERS(Bleed, "Bleeding ")
CREATE_CUSTOM_SLIDERS(Contrast, "Contrast ", 0)
CREATE_CUSTOM_SLIDERS(Bright, "Brightness ", 0)
CREATE_CUSTOM_SLIDERS(Hue, "Hue ", 0)
CREATE_CUSTOM_SLIDERS(Satur, "Saturation ", 0)
CREATE_CUSTOM_SLIDERS(Gamma, "Gamma ", 0)
CREATE_CUSTOM_SLIDERS(Sharp, "Sharpness ", 0)
CREATE_CUSTOM_SLIDERS(Res, "Resolution ", 0)
CREATE_CUSTOM_SLIDERS(Artifacts, "Artifacts ", 0)
CREATE_CUSTOM_SLIDERS(Fringe, "Fringing ", 0)
CREATE_CUSTOM_SLIDERS(Bleed, "Bleeding ", 0)
xpos += myTVContrast->getWidth() + 30;
ypos = VBORDER;
......@@ -279,7 +279,7 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
// TV Phosphor blend level
xpos += INDENT;
swidth = font.getMaxCharWidth() * 10;
CREATE_CUSTOM_SLIDERS(PhosLevel, "Blend ")
CREATE_CUSTOM_SLIDERS(PhosLevel, "Blend ", kPhosBlendChanged)
ypos += 8;
// Scanline intensity and interpolation
......@@ -288,7 +288,7 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
ypos += lineHeight + VGAP / 2;
xpos += INDENT;
CREATE_CUSTOM_SLIDERS(ScanIntense, "Intensity ")
CREATE_CUSTOM_SLIDERS(ScanIntense, "Intensity ", kScanlinesChanged)
ypos += lineHeight + 2;
// Adjustable presets
......@@ -580,7 +580,7 @@ void VideoDialog::handlePhosphorChange()
void VideoDialog::handleCommand(CommandSender* sender, int cmd,
int data, int id)
{
switch(cmd)
switch (cmd)
{
case GuiObject::kOKCmd:
saveConfig();
......@@ -610,10 +610,30 @@ void VideoDialog::handleCommand(CommandSender* sender, int cmd,
case kCloneCustomCmd: loadTVAdjustables(NTSCFilter::PRESET_CUSTOM);
break;
case kScanlinesChanged:
if (myTVScanIntense->getValue() == 0)
{
myTVScanIntense->setValueLabel("Off");
myTVScanIntense->setValueUnit("");
}
else
myTVScanIntense->setValueUnit("%");
break;
case kPhosphorChanged:
handlePhosphorChange();
break;
case kPhosBlendChanged:
if (myTVPhosLevel->getValue() == 0)
{
myTVPhosLevel->setValueLabel("Off");
myTVPhosLevel->setValueUnit("");
}
else
myTVPhosLevel->setValueUnit("%");
break;
default:
Dialog::handleCommand(sender, cmd, data, 0);
break;
......
......@@ -106,7 +106,9 @@ class VideoDialog : public Dialog
kCloneRGBCmd = 'CLrb',
kCloneBadCmd = 'CLbd',
kCloneCustomCmd = 'CLcu',
kPhosphorChanged = 'VDph'
kPhosphorChanged = 'VDph',
kPhosBlendChanged = 'VDbl',
kScanlinesChanged = 'VDsc'
};
private:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment