Switched New Interframe filter to using string comparison.

This commit is contained in:
Arthur Moore 2015-06-17 15:28:51 -04:00
parent 1b25eeded8
commit 4358056e3b
5 changed files with 12 additions and 23 deletions

View File

@ -40,30 +40,21 @@ public:
bool exists() {return true;}
};
//WX
enum ifbfunc {
// this order must match order of option enum and selector widget
IFB_NONE, IFB_SMART, IFB_MOTION_BLUR
};
///Use this to select/create the filter to use
class interframe_factory
{
public:
static filter_base * createIFB(ifbfunc filter_select,unsigned int width,unsigned int height)
static filter_base * createIFB(std::string filterName,unsigned int width,unsigned int height)
{
switch(filter_select)
if(filterName == "Smart interframe blending")
{
case IFB_SMART:
return new SmartIB(width,height);
break;
case IFB_MOTION_BLUR:
return new MotionBlurIB(width,height);
break;
default:
return new filter_base(width,height);
break;
return new SmartIB(width,height);
}
else if(filterName == "Interframe motion blur")
{
return new MotionBlurIB(width,height);
}
return new filter_base(width,height);
}
};

View File

@ -2008,8 +2008,6 @@ EVT_HANDLER_MASK(ChangeFilter, "Change Pixel Filter", CMDEN_NREC_ANY)
EVT_HANDLER_MASK(ChangeIFB, "Change Interframe Blending", CMDEN_NREC_ANY)
{
gopts.ifb = (gopts.ifb + 1) % 3;
update_opts();
if(panel->panel)
{
panel->panel->Delete();

View File

@ -133,13 +133,13 @@ opt_desc opts[] = {
#ifdef MMX
BOOLOPT("Display/EnableMMX", wxTRANSLATE("Enable MMX"), gopts.cpu_mmx),
#endif
STROPT("Display/Filter", wxTRANSLATE("Full-screen filter to apply"), gopts.filter),
STROPT ("Display/Filter", wxTRANSLATE("Full-screen filter to apply"), gopts.filter),
BOOLOPT("Display/Fullscreen", wxTRANSLATE("Enter fullscreen mode at startup"), gopts.fullscreen),
INTOPT ("Display/FullscreenDepth", wxTRANSLATE("Fullscreen mode color depth (0 = any)"), gopts.fs_mode.bpp, 0, 999),
INTOPT ("Display/FullscreenFreq", wxTRANSLATE("Fullscreen mode frequency (0 = any)"), gopts.fs_mode.refresh, 0, 999),
INTOPT ("Display/FullscreenHeight", wxTRANSLATE("Fullscreen mode height (0 = desktop)"), gopts.fs_mode.h, 0, 99999),
INTOPT ("Display/FullscreenWidth", wxTRANSLATE("Fullscreen mode width (0 = desktop)"), gopts.fs_mode.w, 0, 99999),
ENUMOPT("Display/IFB", wxTRANSLATE("Interframe blending function"), gopts.ifb, wxTRANSLATE("none|smart|motionblur")),
STROPT ("Display/IFB", wxTRANSLATE("Interframe blending function"), gopts.ifb),
INTOPT ("Display/MaxScale", wxTRANSLATE("Maximum scale factor (0 = no limit)"), gopts.max_scale, 0, 100),
INTOPT ("Display/MaxThreads", wxTRANSLATE("Maximum number of threads to run filters in"), gopts.max_threads, 1, 8),
ENUMOPT("Display/RenderMethod", wxTRANSLATE("Render method; if unsupported, simple method will be used"), gopts.render_method,

View File

@ -15,7 +15,7 @@ extern struct opts_t {
bool cpu_mmx;
bool no_osd_status;
wxString filter;
int ifb;
wxString ifb;
bool fullscreen;
wxVideoMode fs_mode;
int max_scale;

View File

@ -1099,7 +1099,7 @@ DrawingPanel::DrawingPanel(int _width, int _height) :
threads[i].band_lower = band_height * i;
threads[i].dst = reinterpret_cast<u32 *>(&todraw);
threads[i].mainFilter=filter_factory::createFilter(ToString(gopts.filter),width,band_height);
threads[i].iFilter=interframe_factory::createIFB((ifbfunc)gopts.ifb,width,band_height);
threads[i].iFilter=interframe_factory::createIFB(ToString(gopts.ifb),width,band_height);
threads[i].done = &filt_done;
threads[i].lock.Lock();
threads[i].Create();