Ticket #8342: scale4x.patch
File scale4x.patch, 7.1 KB (added by , 20 years ago) |
---|
-
scummvm/README
RCS file: /cvsroot/scummvm/scummvm/README,v retrieving revision 1.268 diff -u -r1.268 README
435 435 normal - No filtering, no scaling. Fastest. 436 436 2x - No filtering, factor 2x (default for non 640x480 games). 437 437 3x - No filtering, factor 3x. 438 4x - No filtering, factor 4x. 438 439 2xsai - 2xsai filter, factor 2x. 439 440 super2xsai - Enhanced 2xsai filtering, factor 2x. 440 441 supereagle - Less blurry than 2xsai, but slower. Factor 2x. … … 935 936 936 937 fullscreen bool Fullscreen mode 937 938 aspect_ratio bool Enable aspect ratio correction 938 gfx_mode string Graphics mode (normal, 2x, 3x, 2xsai,939 gfx_mode string Graphics mode (normal, 2x, 3x, 4x, 2xsai, 939 940 super2xsai, supereagle, advmame2x, advmame3x, 940 941 hq2x, hq3x, tv2x, dotmatrix) 941 942 -
scummvm/backends/sdl/events.cpp
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/events.cpp,v retrieving revision 1.4 diff -u -r1.4 events.cpp
39 39 #define JOY_BUT_F5 5 40 40 41 41 42 static const int s_gfxModeSwitchTable[][ 4] = {43 { GFX_NORMAL, GFX_DOUBLESIZE, GFX_TRIPLESIZE, -1 },44 { GFX_NORMAL, GFX_ADVMAME2X, GFX_ADVMAME3X, -1 },45 { GFX_NORMAL, GFX_HQ2X, GFX_HQ3X, -1 },46 { GFX_NORMAL, GFX_2XSAI, -1, -1 },47 { GFX_NORMAL, GFX_SUPER2XSAI, -1, -1 },48 { GFX_NORMAL, GFX_SUPEREAGLE, -1, -1 },49 { GFX_NORMAL, GFX_TV2X, -1, -1 },50 { GFX_NORMAL, GFX_DOTMATRIX, -1, -1 }42 static const int s_gfxModeSwitchTable[][5] = { 43 { GFX_NORMAL, GFX_DOUBLESIZE, GFX_TRIPLESIZE, GFX_QUADRUPLESIZE, -1 }, 44 { GFX_NORMAL, GFX_ADVMAME2X, GFX_ADVMAME3X, -1, -1 }, 45 { GFX_NORMAL, GFX_HQ2X, GFX_HQ3X, -1, -1 }, 46 { GFX_NORMAL, GFX_2XSAI, -1, -1, -1 }, 47 { GFX_NORMAL, GFX_SUPER2XSAI, -1, -1, -1 }, 48 { GFX_NORMAL, GFX_SUPEREAGLE, -1, -1, -1 }, 49 { GFX_NORMAL, GFX_TV2X, -1, -1, -1 }, 50 { GFX_NORMAL, GFX_DOTMATRIX, -1, -1, -1 } 51 51 }; 52 52 53 53 -
scummvm/backends/sdl/graphics.cpp
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/graphics.cpp,v retrieving revision 1.10 diff -u -r1.10 graphics.cpp
29 29 {"1x", "Normal (no scaling)", GFX_NORMAL}, 30 30 {"2x", "2x", GFX_DOUBLESIZE}, 31 31 {"3x", "3x", GFX_TRIPLESIZE}, 32 {"4x", "4x", GFX_QUADRUPLESIZE}, 32 33 {"2xsai", "2xSAI", GFX_2XSAI}, 33 34 {"super2xsai", "Super2xSAI", GFX_SUPER2XSAI}, 34 35 {"supereagle", "SuperEagle", GFX_SUPEREAGLE}, … … 68 69 newScaleFactor = 3; 69 70 newScalerProc = Normal3x; 70 71 break; 72 case GFX_QUADRUPLESIZE: 73 newScaleFactor = 4; 74 newScalerProc = Normal4x; 75 break; 71 76 72 77 case GFX_2XSAI: 73 78 newScaleFactor = 2; -
scummvm/common/scaler.cpp
RCS file: /cvsroot/scummvm/scummvm/common/scaler.cpp,v retrieving revision 1.57 diff -u -r1.57 scaler.cpp
167 167 } 168 168 169 169 /** 170 * Trivial nearest-neighbour 4x scaler. 171 */ 172 void Normal4x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, 173 int width, int height) { 174 uint8 *r; 175 uint32 dstPitch2 = dstPitch * 2; 176 uint32 dstPitch3 = dstPitch * 3; 177 uint32 dstPitch4 = dstPitch * 4; 178 179 while (height--) { 180 r = dstPtr; 181 for (int i = 0; i < width; ++i, r += 8) { 182 uint16 color = *(((const uint16 *)srcPtr) + i); 183 184 *(uint16 *)(r + 0) = color; 185 *(uint16 *)(r + 2) = color; 186 *(uint16 *)(r + 4) = color; 187 *(uint16 *)(r + 6) = color; 188 *(uint16 *)(r + 0 + dstPitch) = color; 189 *(uint16 *)(r + 2 + dstPitch) = color; 190 *(uint16 *)(r + 4 + dstPitch) = color; 191 *(uint16 *)(r + 6 + dstPitch) = color; 192 *(uint16 *)(r + 0 + dstPitch2) = color; 193 *(uint16 *)(r + 2 + dstPitch2) = color; 194 *(uint16 *)(r + 4 + dstPitch2) = color; 195 *(uint16 *)(r + 6 + dstPitch2) = color; 196 *(uint16 *)(r + 0 + dstPitch3) = color; 197 *(uint16 *)(r + 2 + dstPitch3) = color; 198 *(uint16 *)(r + 4 + dstPitch3) = color; 199 *(uint16 *)(r + 6 + dstPitch3) = color; 200 } 201 srcPtr += srcPitch; 202 dstPtr += dstPitch4; 203 } 204 } 205 206 /** 170 207 * The Scale2x filter, also known as AdvMame2x. 171 208 * See also http://scale2x.sourceforge.net 172 209 */ -
scummvm/common/scaler.h
RCS file: /cvsroot/scummvm/scummvm/common/scaler.h,v retrieving revision 1.25 diff -u -r1.25 scaler.h
41 41 DECLARE_SCALER(Normal1x); 42 42 DECLARE_SCALER(Normal2x); 43 43 DECLARE_SCALER(Normal3x); 44 DECLARE_SCALER(Normal4x); 44 45 DECLARE_SCALER(TV2x); 45 46 DECLARE_SCALER(DotMatrix); 46 47 DECLARE_SCALER(HQ2x); … … 62 63 GFX_NORMAL = 0, 63 64 GFX_DOUBLESIZE = 1, 64 65 GFX_TRIPLESIZE = 2, 65 GFX_2XSAI = 3, 66 GFX_SUPER2XSAI = 4, 67 GFX_SUPEREAGLE = 5, 68 GFX_ADVMAME2X = 6, 69 GFX_ADVMAME3X = 7, 70 GFX_HQ2X = 8, 71 GFX_HQ3X = 9, 72 GFX_TV2X = 10, 73 GFX_DOTMATRIX = 11, 66 GFX_QUADRUPLESIZE = 3, 67 GFX_2XSAI = 4, 68 GFX_SUPER2XSAI = 5, 69 GFX_SUPEREAGLE = 6, 70 GFX_ADVMAME2X = 7, 71 GFX_ADVMAME3X = 8, 72 GFX_HQ2X = 9, 73 GFX_HQ3X = 10, 74 GFX_TV2X = 11, 75 GFX_DOTMATRIX = 12, 74 76 75 77 GFX_FLIPPING = 100, // Palmos 76 78 GFX_BUFFERED = 101, // Palmos -
scummvm/doc/05_03.tex
RCS file: /cvsroot/scummvm/scummvm/doc/05_03.tex,v retrieving revision 1.3 diff -u -r1.3 05_03.tex
19 19 normal & No filtering, no scaling. Fastest.\\ 20 20 2x & No filtering, factor 2x (default for non 640x480 games).\\ 21 21 3x & No filtering, factor 3x.\\ 22 4x & No filtering, factor 4x.\\ 22 23 2xsai & 2xsai filter, factor 2x.\\ 23 24 super2xsai & Enhanced 2xsai filtering, factor 2x.\\ 24 25 supereagle & Less blurry than 2xsai, but slower. Factor 2x.\\ -
scummvm/doc/08.tex
RCS file: /cvsroot/scummvm/scummvm/doc/08.tex,v retrieving revision 1.7 diff -u -r1.7 08.tex
83 83 \\ 84 84 fullscreen &bool Fullscreen mode\\ 85 85 aspect\_ratio &bool Enable aspect ratio correction\\ 86 gfx\_mode &string Graphics mode (normal, 2x, 3x, 2xsai,\\86 gfx\_mode &string Graphics mode (normal, 2x, 3x, 4x, 2xsai,\\ 87 87 & super2xsai, supereagle, advmame2x, advmame3x,\\ 88 88 & hq2x, hq3x, tv2x, dotmatrix)\\ 89 89 \\