improved UI and doc for interpolation (unavailable for Software renderer)

This commit is contained in:
Thomas Jentzsch 2021-10-27 11:39:43 +02:00
parent 3fc5f6d75e
commit 7ab27618a7
5 changed files with 37 additions and 14 deletions

View File

@ -1429,7 +1429,7 @@
<td>Control + F</td> <td>Control + F</td>
</tr> </tr>
<tr> <tr>
<td>Toggle display interpolation</td> <td>Toggle display interpolation (not available for Software renderer)</td>
<td>Control + I</td> <td>Control + I</td>
<td>Control + I</td> <td>Control + I</td>
</tr> </tr>
@ -2845,7 +2845,7 @@
<tr> <tr>
<td><pre>-tia.inter &lt;1|0&gt;</pre></td> <td><pre>-tia.inter &lt;1|0&gt;</pre></td>
<td>Use interpolation for the TIA image (results in blending/smoothing <td>Use interpolation for the TIA image (results in blending/smoothing
of the image).</td> of the image, not available for Software renderer).</td>
</tr> </tr>
<tr> <tr>
@ -3707,7 +3707,7 @@
<table border="1" cellpadding="4"> <table border="1" cellpadding="4">
<tr><th>Item</th><th>Brief description</th><th>For more information,<br>see <a href="#CommandLine">Command Line</a></th></tr> <tr><th>Item</th><th>Brief description</th><th>For more information,<br>see <a href="#CommandLine">Command Line</a></th></tr>
<tr><td>Renderer</td><td>Use specified rendering mode.</td><td>-video</td></tr> <tr><td>Renderer</td><td>Use specified rendering mode.</td><td>-video</td></tr>
<tr><td>Interpolation</td><td>Enable interpolation of the TIA image.</td><td>-tia.inter</td></tr> <tr><td>Interpolation</td><td>Enable interpolation of the TIA image (not available for Software renderer).</td><td>-tia.inter</td></tr>
<tr><td>Zoom</td><td>Adjust the zoom level of the TIA image</td><td>-tia.zoom</td></tr> <tr><td>Zoom</td><td>Adjust the zoom level of the TIA image</td><td>-tia.zoom</td></tr>
<tr><td>Fullscreen</td><td>Self-explanatory - Note that colors may slightly change. <tr><td>Fullscreen</td><td>Self-explanatory - Note that colors may slightly change.
This depends on the OS and renderer used.</td><td>-fullscreen</td></tr> This depends on the OS and renderer used.</td><td>-fullscreen</td></tr>

View File

@ -514,19 +514,25 @@ void Console::enableColorLoss(bool state)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::toggleInter(bool toggle) void Console::toggleInter(bool toggle)
{ {
bool enabled = myOSystem.settings().getBool("tia.inter"); if(myOSystem.settings().getString("video") != "software")
{
bool enabled = myOSystem.settings().getBool("tia.inter");
if(toggle) if(toggle)
enabled = !enabled; enabled = !enabled;
myOSystem.settings().setValue("tia.inter", enabled); myOSystem.settings().setValue("tia.inter", enabled);
// ... and apply potential setting changes to the TIA surface // ... and apply potential setting changes to the TIA surface
myOSystem.frameBuffer().tiaSurface().updateSurfaceSettings(); myOSystem.frameBuffer().tiaSurface().updateSurfaceSettings();
ostringstream ss; ostringstream ss;
ss << "Interpolation " << (enabled ? "enabled" : "disabled"); ss << "Interpolation " << (enabled ? "enabled" : "disabled");
myOSystem.frameBuffer().showTextMessage(ss.str()); myOSystem.frameBuffer().showTextMessage(ss.str());
}
else
myOSystem.frameBuffer().showTextMessage(
"Interpolation not available for Software renderer");
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -420,6 +420,8 @@ bool EventHandler::skipAVSetting() const
myOSystem.settings().getString("palette") == PaletteHandler::SETTING_CUSTOM; myOSystem.settings().getString("palette") == PaletteHandler::SETTING_CUSTOM;
const bool isCustomFilter = const bool isCustomFilter =
myOSystem.settings().getInt("tv.filter") == int(NTSCFilter::Preset::CUSTOM); myOSystem.settings().getInt("tv.filter") == int(NTSCFilter::Preset::CUSTOM);
const bool isSoftwareRenderer =
myOSystem.settings().getString("video") == "software";
return (myAdjustSetting == AdjustSetting::OVERSCAN && !isFullScreen) return (myAdjustSetting == AdjustSetting::OVERSCAN && !isFullScreen)
#ifdef ADAPTABLE_REFRESH_SUPPORT #ifdef ADAPTABLE_REFRESH_SUPPORT
@ -430,7 +432,8 @@ bool EventHandler::skipAVSetting() const
&& !isCustomPalette) && !isCustomPalette)
|| (myAdjustSetting >= AdjustSetting::NTSC_SHARPNESS || (myAdjustSetting >= AdjustSetting::NTSC_SHARPNESS
&& myAdjustSetting <= AdjustSetting::NTSC_BLEEDING && myAdjustSetting <= AdjustSetting::NTSC_BLEEDING
&& !isCustomFilter); && !isCustomFilter)
|| (myAdjustSetting == AdjustSetting::INTERPOLATION && isSoftwareRenderer);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -121,7 +121,7 @@ void VideoAudioDialog::addDisplayTab()
// Video renderer // Video renderer
myRenderer = new PopUpWidget(myTab, _font, xpos, ypos, pwidth, lineHeight, myRenderer = new PopUpWidget(myTab, _font, xpos, ypos, pwidth, lineHeight,
instance().frameBuffer().supportedRenderers(), instance().frameBuffer().supportedRenderers(),
"Renderer ", lwidth); "Renderer ", lwidth, kRendererChanged);
myRenderer->setToolTip("Select renderer used for displaying screen."); myRenderer->setToolTip("Select renderer used for displaying screen.");
wid.push_back(myRenderer); wid.push_back(myRenderer);
const int swidth = myRenderer->getWidth() - lwidth; const int swidth = myRenderer->getWidth() - lwidth;
@ -544,6 +544,7 @@ void VideoAudioDialog::loadConfig()
// Display tab // Display tab
// Renderer settings // Renderer settings
myRenderer->setSelected(settings.getString("video"), "default"); myRenderer->setSelected(settings.getString("video"), "default");
handleRendererChanged();
// TIA interpolation // TIA interpolation
myTIAInterpolate->setState(settings.getBool("tia.inter")); myTIAInterpolate->setState(settings.getBool("tia.inter"));
@ -945,6 +946,13 @@ void VideoAudioDialog::loadTVAdjustables(NTSCFilter::Preset preset)
myTVBleed->setValue(adj.bleed); myTVBleed->setValue(adj.bleed);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void VideoAudioDialog::handleRendererChanged()
{
bool enable = myRenderer->getSelectedTag().toString() != "software";
myTIAInterpolate->setEnabled(enable);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void VideoAudioDialog::handlePaletteChange() void VideoAudioDialog::handlePaletteChange()
{ {
@ -1093,6 +1101,10 @@ void VideoAudioDialog::handleCommand(CommandSender* sender, int cmd,
handleShiftChanged(myTVBlueShift); handleShiftChanged(myTVBlueShift);
break; break;
case kRendererChanged:
handleRendererChanged();
break;
case kVSizeChanged: case kVSizeChanged:
{ {
int adjust = myVSizeAdjust->getValue(); int adjust = myVSizeAdjust->getValue();

View File

@ -52,6 +52,7 @@ class VideoAudioDialog : public Dialog
void addAudioTab(); void addAudioTab();
void handleTVModeChange(NTSCFilter::Preset); void handleTVModeChange(NTSCFilter::Preset);
void loadTVAdjustables(NTSCFilter::Preset preset); void loadTVAdjustables(NTSCFilter::Preset preset);
void handleRendererChanged();
void handlePaletteChange(); void handlePaletteChange();
void handleShiftChanged(SliderWidget* widget); void handleShiftChanged(SliderWidget* widget);
void handlePaletteUpdate(); void handlePaletteUpdate();
@ -136,6 +137,7 @@ class VideoAudioDialog : public Dialog
PaletteHandler::Adjustable myPaletteAdj; PaletteHandler::Adjustable myPaletteAdj;
enum { enum {
kRendererChanged = 'VDRe',
kZoomChanged = 'VDZo', kZoomChanged = 'VDZo',
kVSizeChanged = 'VDVs', kVSizeChanged = 'VDVs',
kFullScreenChanged = 'VDFs', kFullScreenChanged = 'VDFs',