Skip to content

Commit

Permalink
Enable only NTSC filter on OSX.
Browse files Browse the repository at this point in the history
  • Loading branch information
Optiroc committed Dec 15, 2016
1 parent 432894f commit 4f7b82a
Showing 1 changed file with 43 additions and 23 deletions.
66 changes: 43 additions & 23 deletions snesfilter/snesfilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <QtGui>

#include <nall/config.hpp>
#include <nall/detect.hpp>
#include <nall/platform.hpp>
#include <nall/string.hpp>
using namespace nall;
Expand All @@ -22,15 +23,21 @@ const uint32_t *colortable;
configuration *config;

#include "direct/direct.cpp"
#include "pixellate2x/pixellate2x.cpp"
#include "scale2x/scale2x.cpp"
#include "2xsai/2xsai.cpp"
#include "lq2x/lq2x.cpp"
#include "hq2x/hq2x.cpp"
#include "ntsc/ntsc.cpp"
#if !defined(PLATFORM_OSX)
#include "pixellate2x/pixellate2x.cpp"
#include "scale2x/scale2x.cpp"
#include "2xsai/2xsai.cpp"
#include "lq2x/lq2x.cpp"
#include "hq2x/hq2x.cpp"
#endif

bsnesexport const char* snesfilter_supported() {
return "Pixellate2x;Scale2x;2xSaI;Super 2xSaI;Super Eagle;LQ2x;HQ2x;NTSC";
#if defined(PLATFORM_OSX)
return "NTSC";
#else
return "Pixellate2x;Scale2x;2xSaI;Super 2xSaI;Super Eagle;LQ2x;HQ2x;NTSC";
#endif
}

bsnesexport void snesfilter_configuration(configuration &config_) {
Expand All @@ -47,14 +54,18 @@ bsnesexport void snesfilter_colortable(const uint32_t *colortable_) {
bsnesexport void snesfilter_size(unsigned filter, unsigned &outwidth, unsigned &outheight, unsigned width, unsigned height) {
switch(filter) {
default: return filter_direct.size(outwidth, outheight, width, height);
case 1: return filter_pixellate2x.size(outwidth, outheight, width, height);
case 2: return filter_scale2x.size(outwidth, outheight, width, height);
case 3: return filter_2xsai.size(outwidth, outheight, width, height);
case 4: return filter_super2xsai.size(outwidth, outheight, width, height);
case 5: return filter_supereagle.size(outwidth, outheight, width, height);
case 6: return filter_lq2x.size(outwidth, outheight, width, height);
case 7: return filter_hq2x.size(outwidth, outheight, width, height);
case 8: return filter_ntsc.size(outwidth, outheight, width, height);
#if defined(PLATFORM_OSX)
case 1: return filter_ntsc.size(outwidth, outheight, width, height);
#else
case 1: return filter_pixellate2x.size(outwidth, outheight, width, height);
case 2: return filter_scale2x.size(outwidth, outheight, width, height);
case 3: return filter_2xsai.size(outwidth, outheight, width, height);
case 4: return filter_super2xsai.size(outwidth, outheight, width, height);
case 5: return filter_supereagle.size(outwidth, outheight, width, height);
case 6: return filter_lq2x.size(outwidth, outheight, width, height);
case 7: return filter_hq2x.size(outwidth, outheight, width, height);
case 8: return filter_ntsc.size(outwidth, outheight, width, height);
#endif
}
}

Expand All @@ -64,20 +75,29 @@ bsnesexport void snesfilter_render(
) {
switch(filter) {
default: return filter_direct.render(output, outpitch, input, pitch, width, height);
case 1: return filter_pixellate2x.render(output, outpitch, input, pitch, width, height);
case 2: return filter_scale2x.render(output, outpitch, input, pitch, width, height);
case 3: return filter_2xsai.render(output, outpitch, input, pitch, width, height);
case 4: return filter_super2xsai.render(output, outpitch, input, pitch, width, height);
case 5: return filter_supereagle.render(output, outpitch, input, pitch, width, height);
case 6: return filter_lq2x.render(output, outpitch, input, pitch, width, height);
case 7: return filter_hq2x.render(output, outpitch, input, pitch, width, height);
case 8: return filter_ntsc.render(output, outpitch, input, pitch, width, height);
#if defined(PLATFORM_OSX)
case 1: return filter_ntsc.render(output, outpitch, input, pitch, width, height);
#else
case 1: return filter_pixellate2x.render(output, outpitch, input, pitch, width, height);
case 2: return filter_scale2x.render(output, outpitch, input, pitch, width, height);
case 3: return filter_2xsai.render(output, outpitch, input, pitch, width, height);
case 4: return filter_super2xsai.render(output, outpitch, input, pitch, width, height);
case 5: return filter_supereagle.render(output, outpitch, input, pitch, width, height);
case 6: return filter_lq2x.render(output, outpitch, input, pitch, width, height);
case 7: return filter_hq2x.render(output, outpitch, input, pitch, width, height);
case 8: return filter_ntsc.render(output, outpitch, input, pitch, width, height);
#endif
}
}

bsnesexport QWidget* snesfilter_settings(unsigned filter) {
switch(filter) {
default: return 0;
case 8: return filter_ntsc.settings();
#if defined(PLATFORM_OSX)
case 1:
#else
case 8:
#endif
return filter_ntsc.settings();
}
}

0 comments on commit 4f7b82a

Please sign in to comment.