| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
#if defined (SCALERLINEAR) |
| 22 |
static void conc4d(SCALERNAME,SBPP,DBPP,L)(const void *s) { |
| 23 |
#else |
| 24 |
static void conc4d(SCALERNAME,SBPP,DBPP,R)(const void *s) { |
| 25 |
#endif |
| 26 |
#ifdef RENDER_NULL_INPUT |
| 27 |
if (!s) { |
| 28 |
render.scale.cacheRead += render.scale.cachePitch; |
| 29 |
#if defined(SCALERLINEAR) |
| 30 |
Bitu skipLines = SCALERHEIGHT; |
| 31 |
#else |
| 32 |
Bitu skipLines = Scaler_Aspect[ render.scale.outLine++ ]; |
| 33 |
#endif |
| 34 |
ScalerAddLines( 0, skipLines ); |
| 35 |
return; |
| 36 |
} |
| 37 |
#endif |
| 38 |
|
| 39 |
Bitu hadChange = 0; |
| 40 |
const SRCTYPE *src = (SRCTYPE*)s; |
| 41 |
SRCTYPE *cache = (SRCTYPE*)(render.scale.cacheRead); |
| 42 |
render.scale.cacheRead += render.scale.cachePitch; |
| 43 |
PTYPE * line0=(PTYPE *)(render.scale.outWrite); |
| 44 |
#if (SBPP == 9) |
| 45 |
for (Bits x=render.src.width;x>0;) { |
| 46 |
if (*(Bit32u const*)src == *(Bit32u*)cache && !( |
| 47 |
render.pal.modified[src[0]] | |
| 48 |
render.pal.modified[src[1]] | |
| 49 |
render.pal.modified[src[2]] | |
| 50 |
render.pal.modified[src[3]] )) { |
| 51 |
x-=4; |
| 52 |
src+=4; |
| 53 |
cache+=4; |
| 54 |
line0+=4*SCALERWIDTH; |
| 55 |
#else |
| 56 |
for (Bits x=render.src.width;x>0;) { |
| 57 |
if (*(Bitu const*)src == *(Bitu*)cache) { |
| 58 |
x-=(sizeof(Bitu)/sizeof(SRCTYPE)); |
| 59 |
src+=(sizeof(Bitu)/sizeof(SRCTYPE)); |
| 60 |
cache+=(sizeof(Bitu)/sizeof(SRCTYPE)); |
| 61 |
line0+=(sizeof(Bitu)/sizeof(SRCTYPE))*SCALERWIDTH; |
| 62 |
#endif |
| 63 |
} else { |
| 64 |
#if defined(SCALERLINEAR) |
| 65 |
#if (SCALERHEIGHT > 1) |
| 66 |
PTYPE *line1 = WC[0]; |
| 67 |
#endif |
| 68 |
#if (SCALERHEIGHT > 2) |
| 69 |
PTYPE *line2 = WC[1]; |
| 70 |
#endif |
| 71 |
#else |
| 72 |
#if (SCALERHEIGHT > 1) |
| 73 |
PTYPE *line1 = (PTYPE *)(((Bit8u*)line0)+ render.scale.outPitch); |
| 74 |
#endif |
| 75 |
#if (SCALERHEIGHT > 2) |
| 76 |
PTYPE *line2 = (PTYPE *)(((Bit8u*)line0)+ render.scale.outPitch * 2); |
| 77 |
#endif |
| 78 |
#endif |
| 79 |
hadChange = 1; |
| 80 |
for (Bitu i = x > 32 ? 32 : x;i>0;i--,x--) { |
| 81 |
const SRCTYPE S = *src; |
| 82 |
*cache = S; |
| 83 |
src++;cache++; |
| 84 |
const PTYPE P = PMAKE(S); |
| 85 |
SCALERFUNC; |
| 86 |
line0 += SCALERWIDTH; |
| 87 |
#if (SCALERHEIGHT > 1) |
| 88 |
line1 += SCALERWIDTH; |
| 89 |
#endif |
| 90 |
#if (SCALERHEIGHT > 2) |
| 91 |
line2 += SCALERWIDTH; |
| 92 |
#endif |
| 93 |
} |
| 94 |
#if defined(SCALERLINEAR) |
| 95 |
#if (SCALERHEIGHT > 1) |
| 96 |
Bitu copyLen = (Bitu)((Bit8u*)line1 - (Bit8u*)WC[0]); |
| 97 |
BituMove(((Bit8u*)line0)-copyLen+render.scale.outPitch ,WC[0], copyLen ); |
| 98 |
#endif |
| 99 |
#if (SCALERHEIGHT > 2) |
| 100 |
BituMove(((Bit8u*)line0)-copyLen+render.scale.outPitch*2,WC[1], copyLen ); |
| 101 |
#endif |
| 102 |
#endif |
| 103 |
} |
| 104 |
} |
| 105 |
#if defined(SCALERLINEAR) |
| 106 |
Bitu scaleLines = SCALERHEIGHT; |
| 107 |
#else |
| 108 |
Bitu scaleLines = Scaler_Aspect[ render.scale.outLine++ ]; |
| 109 |
if ( scaleLines - SCALERHEIGHT && hadChange ) { |
| 110 |
BituMove( render.scale.outWrite + render.scale.outPitch * SCALERHEIGHT, |
| 111 |
render.scale.outWrite + render.scale.outPitch * (SCALERHEIGHT-1), |
| 112 |
render.src.width * SCALERWIDTH * PSIZE); |
| 113 |
} |
| 114 |
#endif |
| 115 |
ScalerAddLines( hadChange, scaleLines ); |
| 116 |
} |
| 117 |
|
| 118 |
#if !defined(SCALERLINEAR) |
| 119 |
#define SCALERLINEAR 1 |
| 120 |
#include "render_simple.h" |
| 121 |
#undef SCALERLINEAR |
| 122 |
#endif |