SVN r4420

Update the template for more complicated scalers to potentially support
higher scale factors as well
This commit is contained in:
Allofich
2021-03-06 21:55:52 +09:00
parent cdbfc3e24a
commit 94a5d13e78

View File

@@ -56,6 +56,12 @@ lastagain:
#endif
#if (SCALERHEIGHT > 2)
PTYPE * line2;
#endif
#if (SCALERHEIGHT > 3)
PTYPE * line3;
#endif
#if (SCALERHEIGHT > 4)
PTYPE * line4;
#endif
/* Clear this block being dirty marker */
const Bitu changeType = changed[b];
@@ -71,6 +77,12 @@ lastagain:
#endif
#if (SCALERHEIGHT > 2)
line2 = (PTYPE *)(((uint8_t*)line0)+ render.scale.outPitch * 2);
#endif
#if (SCALERHEIGHT > 3)
line3 = (PTYPE *)(((uint8_t*)line0)+ render.scale.outPitch * 3);
#endif
#if (SCALERHEIGHT > 4)
line4 = (PTYPE *)(((uint8_t*)line0)+ render.scale.outPitch * 4);
#endif
SCALERFUNC;
line0 += SCALERWIDTH * SCALER_BLOCKSIZE;
@@ -82,6 +94,12 @@ lastagain:
#endif
#if (SCALERHEIGHT > 2)
line2 = (PTYPE *)(((uint8_t*)line0)+ render.scale.outPitch * 2);
#endif
#if (SCALERHEIGHT > 3)
line3 = (PTYPE *)(((uint8_t*)line0)+ render.scale.outPitch * 3);
#endif
#if (SCALERHEIGHT > 4)
line4 = (PTYPE *)(((uint8_t*)line0)+ render.scale.outPitch * 4);
#endif
SCALERFUNC;
case SCALE_RIGHT:
@@ -90,6 +108,12 @@ lastagain:
#endif
#if (SCALERHEIGHT > 2)
line2 = (PTYPE *)(((uint8_t*)line0)+ render.scale.outPitch * 2);
#endif
#if (SCALERHEIGHT > 3)
line3 = (PTYPE *)(((uint8_t*)line0)+ render.scale.outPitch * 3);
#endif
#if (SCALERHEIGHT > 4)
line4 = (PTYPE *)(((uint8_t*)line0)+ render.scale.outPitch * 4);
#endif
line0 += SCALERWIDTH * (SCALER_BLOCKSIZE -1);
#if (SCALERHEIGHT > 1)
@@ -97,6 +121,12 @@ lastagain:
#endif
#if (SCALERHEIGHT > 2)
line2 += SCALERWIDTH * (SCALER_BLOCKSIZE -1);
#endif
#if (SCALERHEIGHT > 3)
line3 += SCALERWIDTH * (SCALER_BLOCKSIZE -1);
#endif
#if (SCALERHEIGHT > 4)
line4 += SCALERWIDTH * (SCALER_BLOCKSIZE -1);
#endif
fc += SCALER_BLOCKSIZE -1;
SCALERFUNC;
@@ -111,6 +141,12 @@ lastagain:
#if (SCALERHEIGHT > 2)
line2 = WC[1];
#endif
#if (SCALERHEIGHT > 3)
line3 = WC[2];
#endif
#if (SCALERHEIGHT > 4)
line4 = WC[3];
#endif
#else
#if (SCALERHEIGHT > 1)
line1 = (PTYPE *)(((uint8_t*)line0)+ render.scale.outPitch);
@@ -118,6 +154,12 @@ lastagain:
#if (SCALERHEIGHT > 2)
line2 = (PTYPE *)(((uint8_t*)line0)+ render.scale.outPitch * 2);
#endif
#if (SCALERHEIGHT > 3)
line3 = (PTYPE *)(((uint8_t*)line0)+ render.scale.outPitch * 3);
#endif
#if (SCALERHEIGHT > 4)
line4 = (PTYPE *)(((uint8_t*)line0)+ render.scale.outPitch * 4);
#endif
#endif //defined(SCALERLINEAR)
for (Bitu i = 0; i<SCALER_BLOCKSIZE;i++) {
SCALERFUNC;
@@ -127,6 +169,12 @@ lastagain:
#endif
#if (SCALERHEIGHT > 2)
line2 += SCALERWIDTH;
#endif
#if (SCALERHEIGHT > 3)
line3 += SCALERWIDTH;
#endif
#if (SCALERHEIGHT > 4)
line4 += SCALERWIDTH;
#endif
fc++;
}
@@ -137,6 +185,12 @@ lastagain:
#if (SCALERHEIGHT > 2)
BituMove((uint8_t*)(&line0[-SCALER_BLOCKSIZE*SCALERWIDTH])+render.scale.outPitch*2,WC[1], SCALER_BLOCKSIZE *SCALERWIDTH*PSIZE);
#endif
#if (SCALERHEIGHT > 3)
BituMove((uint8_t*)(&line0[-SCALER_BLOCKSIZE*SCALERWIDTH])+render.scale.outPitch*3,WC[2], SCALER_BLOCKSIZE *SCALERWIDTH*PSIZE);
#endif
#if (SCALERHEIGHT > 4)
BituMove((uint8_t*)(&line0[-SCALER_BLOCKSIZE*SCALERWIDTH])+render.scale.outPitch*4,WC[3], SCALER_BLOCKSIZE *SCALERWIDTH*PSIZE);
#endif
#endif //defined(SCALERLINEAR)
break;
}