added mixed scalers, using them proved difficult

will revisit later
This commit is contained in:
Shaun Inman 2023-02-16 20:31:52 -05:00
parent 29e743645d
commit 2eb550826d
3 changed files with 102 additions and 2 deletions

View file

@ -2242,7 +2242,6 @@ static void selectScaler_PAR(int width, int height, int pitch) {
}
}
}
//////////////////////////////
// DEBUG HUD
@ -2266,8 +2265,8 @@ static void selectScaler_AR(int width, int height, int pitch) {
if (scale>2) scale = 4; // TODO: pillar/letterboxing at 3x produces vertical banding (some kind of alignment issue?)
// reduce scale if we don't have enough memory to accomodate it
// TODO: some resolutions are getting through here unadjusted? oh maybe because of aspect ratio adjustments below? revisit
// scaled width and height can't be greater than our fixed page width or height
// TODO: some resolutions are getting through here unadjusted? oh maybe because of aspect ratio adjustments below? revisit
while (src_w * scale * FIXED_BPP * src_h * scale > PAGE_SIZE || src_w * scale > PAGE_WIDTH || src_h * scale > PAGE_HEIGHT) scale -= 1;
int dst_w = src_w * scale;
@ -2317,6 +2316,20 @@ static void selectScaler_AR(int width, int height, int pitch) {
case 3: renderer.scaler = scale3x_n16; break;
case 2: renderer.scaler = scale2x_n16; break;
default: renderer.scaler = scale1x_n16; break;
// case 4:
// if (scale_y==2) renderer.scaler = scale4x2_c16;
// else renderer.scaler = scale4x_c16;
// break;
// case 3:
// if (scale_x==2) renderer.scaler = scale2x3_c16;
// else renderer.scaler = scale3x_c16;
// break;
// case 2:
// if (scale_x==1) renderer.scaler = scale1x2_c16;
// else if (scale_y==1) renderer.scaler = scale2x1_c16;
// else renderer.scaler = scale2x_c16;
// break;
// default: renderer.scaler = scale1x_n16; break;
}
if (scaler_surface) SDL_FreeSurface(scaler_surface);