FilterFunc initFilter(const Filter f, const int srcWidth) { FilterFunc func = Filters[f].func32; if (func) switch (f) { case kStretch1x: sdlStretchInit(0, srcWidth); break; case kStretch2x: sdlStretchInit(1, srcWidth); break; case kStretch3x: sdlStretchInit(2, srcWidth); break; case kStretch4x: sdlStretchInit(3, srcWidth); break; case k2xSaI: case kSuper2xSaI: case kSuperEagle: Init_2xSaI(32); break; case khq2x: case klq2x: hq2x_init(32); break; default: break; } return func; }
FilterFunc initFilter(const int f, const int colorDepth, const int srcWidth) { FilterFunc func; switch (colorDepth) { case 15: case 16: func = Filters[f].func16; break; case 24: func = Filters[f].func24; break; case 32: func = Filters[f].func32; break; default: func = 0; break; } if (func) switch (f) { case kStretch1x: sdlStretchInit(colorDepth, 0, srcWidth); break; case kStretch2x: sdlStretchInit(colorDepth, 1, srcWidth); break; case kStretch3x: sdlStretchInit(colorDepth, 2, srcWidth); break; case kStretch4x: sdlStretchInit(colorDepth, 3, srcWidth); break; case k2xSaI: case kSuper2xSaI: case kSuperEagle: if (colorDepth == 15) Init_2xSaI(555); else if (colorDepth == 16) Init_2xSaI(565); else Init_2xSaI(colorDepth); break; case khq2x: case klq2x: hq2x_init(colorDepth); break; default: break; } return func; }