[Scummvm-devel] New GFX filter: "TV Mode"
Gregory.Montoir at ens.insa-rennes.fr
Gregory.Montoir at ens.insa-rennes.fr
Mon Jan 6 10:37:03 CET 2003
Hi,
Just another filter as "requested" in the forum's
thread "My favorite filter missing: TV scanlines!".
Hope it fills the request.
Gregory
-------------- next part --------------
diff -ur scummvm-20030106\backends\gp32\gp32.cpp scummvm-20030106_tvmode\backends\gp32\gp32.cpp
--- scummvm-20030106\backends\gp32\gp32.cpp Mon Jan 06 09:38:12 2003
+++ scummvm-20030106_tvmode\backends\gp32\gp32.cpp Mon Jan 06 17:13:28 2003
@@ -1034,7 +1034,7 @@
break;
case PROP_SET_GFX_MODE:
- if (value->gfx_mode >= 7)
+ if (value->gfx_mode >= 8)
return 0;
_mode = value->gfx_mode;
hotswap_gfx_mode();
diff -ur scummvm-20030106\backends\sdl\sdl-common.cpp scummvm-20030106_tvmode\backends\sdl\sdl-common.cpp
--- scummvm-20030106\backends\sdl\sdl-common.cpp Mon Jan 06 09:38:50 2003
+++ scummvm-20030106_tvmode\backends\sdl\sdl-common.cpp Mon Jan 06 17:13:36 2003
@@ -475,9 +475,9 @@
quit();
break;
}
- // Ctr-Alt-1 till Ctrl-Alt-7 will change the GFX mode
+ // Ctr-Alt-1 till Ctrl-Alt-8 will change the GFX mode
if (b == (KBD_CTRL|KBD_ALT) &&
- (ev.key.keysym.sym>='1') && (ev.key.keysym.sym<='7')) {
+ (ev.key.keysym.sym>='1') && (ev.key.keysym.sym<='8')) {
Property prop;
prop.gfx_mode = ev.key.keysym.sym - '1';
property(PROP_SET_GFX_MODE, &prop);
diff -ur scummvm-20030106\backends\sdl\sdl.cpp scummvm-20030106_tvmode\backends\sdl\sdl.cpp
--- scummvm-20030106\backends\sdl\sdl.cpp Mon Jan 06 09:38:50 2003
+++ scummvm-20030106_tvmode\backends\sdl\sdl.cpp Mon Jan 06 17:13:46 2003
@@ -99,6 +99,10 @@
_scaleFactor = 2;
_scaler_proc = AdvMame2x;
break;
+ case GFX_TVMODE:
+ _scaleFactor = 2;
+ _scaler_proc = TVMode;
+ break;
case GFX_DOUBLESIZE:
_scaleFactor = 2;
@@ -339,7 +343,7 @@
#endif
return 1;
} else if (param == PROP_SET_GFX_MODE) {
- if (value->gfx_mode >= 7)
+ if (value->gfx_mode >= 8)
return 0;
_mode = value->gfx_mode;
diff -ur scummvm-20030106\common\gameDetector.cpp scummvm-20030106_tvmode\common\gameDetector.cpp
--- scummvm-20030106\common\gameDetector.cpp Mon Jan 06 09:35:26 2003
+++ scummvm-20030106_tvmode\common\gameDetector.cpp Mon Jan 06 17:12:54 2003
@@ -47,7 +47,7 @@
"\t-p<path> - look for game in <path>\n"
"\t-x[<num>] - load this savegame (default: 0 - autosave)\n"
"\t-f - fullscreen mode\n"
- "\t-g<mode> - graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle,advmame2x)\n"
+ "\t-g<mode> - graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle,advmame2x,tvmode)\n"
"\t-e<mode> - set music engine (see README for details)\n"
"\t-a - specify game is amiga version\n"
"\n"
@@ -178,6 +178,7 @@
{"super2xsai", "Super2xSAI", GFX_SUPER2XSAI},
{"supereagle", "SuperEagle", GFX_SUPEREAGLE},
{"advmame2x", "AdvMAME2x", GFX_ADVMAME2X},
+ {"tvmode", "TVMode", GFX_TVMODE},
{0, 0}
};
diff -ur scummvm-20030106\common\scaler.cpp scummvm-20030106_tvmode\common\scaler.cpp
--- scummvm-20030106\common\scaler.cpp Mon Jan 06 09:35:32 2003
+++ scummvm-20030106_tvmode\common\scaler.cpp Mon Jan 06 17:11:54 2003
@@ -810,3 +810,28 @@
dstPtr += dstPitch3;
}
}
+
+void TVMode(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch,
+ int width, int height)
+{
+ unsigned int nextlineSrc = srcPitch / sizeof(short);
+ short *p = (short *)srcPtr;
+
+ unsigned nextlineDst = dstPitch / sizeof(short);
+ short *q = (short *)dstPtr;
+
+ while(height--) {
+ for (int i = 0; i < width; ++i) {
+ unsigned short p1 = *(p + i);
+ unsigned short p2 = *(p + i + nextlineSrc);
+ unsigned short pi = (unsigned short)((INTERPOLATE(p1, p2) & colorMask) >> 1);
+
+ *(q + (i << 1)) = p1;
+ *(q + (i << 1) + 1) = p1;
+ *(q + (i << 1) + nextlineDst) = pi;
+ *(q + (i << 1) + nextlineDst + 1) = pi;
+ }
+ p += nextlineSrc;
+ q += nextlineDst << 1;
+ }
+}
diff -ur scummvm-20030106\common\scaler.h scummvm-20030106_tvmode\common\scaler.h
--- scummvm-20030106\common\scaler.h Mon Jan 06 09:35:32 2003
+++ scummvm-20030106_tvmode\common\scaler.h Mon Jan 06 17:11:54 2003
@@ -36,5 +36,7 @@
uint8 *dstPtr, uint32 dstPitch, int width, int height);
extern void Normal3x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
uint8 *dstPtr, uint32 dstPitch, int width, int height);
+extern void TVMode(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
+ uint8 *dstPtr, uint32 dstPitch, int width, int height);
#endif
diff -ur scummvm-20030106\common\system.h scummvm-20030106_tvmode\common\system.h
--- scummvm-20030106\common\system.h Mon Jan 06 09:35:42 2003
+++ scummvm-20030106_tvmode\common\system.h Mon Jan 06 17:13:02 2003
@@ -215,7 +215,8 @@
GFX_2XSAI = 3,
GFX_SUPER2XSAI = 4,
GFX_SUPEREAGLE = 5,
- GFX_ADVMAME2X = 6
+ GFX_ADVMAME2X = 6,
+ GFX_TVMODE = 7
};
diff -ur scummvm-20030106\gui\options.cpp scummvm-20030106_tvmode\gui\options.cpp
--- scummvm-20030106\gui\options.cpp Mon Jan 06 09:36:20 2003
+++ scummvm-20030106_tvmode\gui\options.cpp Mon Jan 06 17:13:10 2003
@@ -69,6 +69,7 @@
gfxPopUp->appendEntry("Super2xSAI");
gfxPopUp->appendEntry("SuperEagle");
gfxPopUp->appendEntry("AdvMAME2x");
+ gfxPopUp->appendEntry("TVMode");
gfxPopUp->setSelected(0);
// The MIDI mode popup & a label
Only in scummvm-20030106_tvmode: scumm___MP3_Enabled_Release
Only in scummvm-20030106_tvmode: scummvm.ncb
Only in scummvm-20030106_tvmode: scummvm.opt
Only in scummvm-20030106_tvmode: scummvm___MP3_Enabled_Release
Only in scummvm-20030106_tvmode: simon___MP3_Enabled_Release
More information about the Scummvm-devel
mailing list