Changed tveffect name to scanlines, made it a bit better

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@203 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
gewlitys
2002-11-09 16:52:25 +00:00
parent 5deba0b23f
commit 47b62b5b1c
3 changed files with 27 additions and 16 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ enum
#define TFB_GFXFLAGS_FULLSCREEN (1<<0) #define TFB_GFXFLAGS_FULLSCREEN (1<<0)
#define TFB_GFXFLAGS_BILINEAR_FILTERING (1<<1) #define TFB_GFXFLAGS_BILINEAR_FILTERING (1<<1)
#define TFB_GFXFLAGS_SHOWFPS (1<<2) #define TFB_GFXFLAGS_SHOWFPS (1<<2)
#define TFB_GFXFLAGS_TVEFFECT (1<<3) #define TFB_GFXFLAGS_SCANLINES (1<<3)
int TFB_InitGraphics (int driver, int flags, int width, int height, int bpp); int TFB_InitGraphics (int driver, int flags, int width, int height, int bpp);
+20 -9
View File
@@ -25,7 +25,7 @@ static SDL_Surface *format_conv_surf;
static int ScreenFilterMode; static int ScreenFilterMode;
static unsigned int DisplayTexture; static unsigned int DisplayTexture;
static unsigned int TransitionTexture; static unsigned int TransitionTexture;
static BOOLEAN tveffect; static BOOLEAN scanlines;
static BOOLEAN upload_transitiontexture = FALSE; static BOOLEAN upload_transitiontexture = FALSE;
@@ -154,10 +154,10 @@ TFB_GL_InitGraphics (int driver, int flags, int width, int height, int bpp)
else else
ScreenFilterMode = GL_NEAREST; ScreenFilterMode = GL_NEAREST;
if (flags & TFB_GFXFLAGS_TVEFFECT) if (flags & TFB_GFXFLAGS_SCANLINES)
tveffect = TRUE; scanlines = TRUE;
else else
tveffect = FALSE; scanlines = FALSE;
glViewport (0, 0, ScreenWidthActual, ScreenHeightActual); glViewport (0, 0, ScreenWidthActual, ScreenHeightActual);
glClearColor (0,0,0,0); glClearColor (0,0,0,0);
@@ -190,14 +190,14 @@ void TFB_GL_UploadTransitionScreen (void)
} }
void void
TFB_GL_TVEffect (void) TFB_GL_ScanLines (void)
{ {
int y; int y;
glDisable (GL_TEXTURE_2D); glDisable (GL_TEXTURE_2D);
glEnable (GL_BLEND); glEnable (GL_BLEND);
glBlendFunc (GL_DST_COLOR, GL_ONE); glBlendFunc (GL_DST_COLOR, GL_ZERO);
glColor3f (0.5, 0.5, 0.5); glColor3f (0.85f, 0.85f, 0.85f);
for (y = 0; y < ScreenHeightActual; y += 2) for (y = 0; y < ScreenHeightActual; y += 2)
{ {
@@ -206,6 +206,17 @@ TFB_GL_TVEffect (void)
glVertex2i (ScreenWidthActual, y); glVertex2i (ScreenWidthActual, y);
glEnd (); glEnd ();
} }
glBlendFunc (GL_DST_COLOR, GL_ONE);
glColor3f (0.2f, 0.2f, 0.2f);
for (y = 1; y < ScreenHeightActual; y += 2)
{
glBegin (GL_LINES);
glVertex2i (0, y);
glVertex2i (ScreenWidthActual, y);
glEnd ();
}
} }
void void
@@ -317,8 +328,8 @@ TFB_GL_SwapBuffers (void)
TFB_GL_DrawQuad (); TFB_GL_DrawQuad ();
} }
if (tveffect) if (scanlines)
TFB_GL_TVEffect (); TFB_GL_ScanLines ();
SDL_GL_SwapBuffers (); SDL_GL_SwapBuffers ();
} }
+6 -6
View File
@@ -69,7 +69,7 @@ main (int argc, char *argv[])
{"opengl", 0, NULL, 'o'}, {"opengl", 0, NULL, 'o'},
{"bilinear", 0, NULL, 'b'}, {"bilinear", 0, NULL, 'b'},
{"fps", 0, NULL, 'p'}, {"fps", 0, NULL, 'p'},
{"tv", 0, NULL, 't'}, {"scanlines", 0, NULL, 's'},
{"contentdir", 1, NULL, 'c'}, {"contentdir", 1, NULL, 'c'},
{"help", 0, NULL, 'h'}, {"help", 0, NULL, 'h'},
{"musicvol", 1, NULL, 'M'}, {"musicvol", 1, NULL, 'M'},
@@ -85,7 +85,7 @@ main (int argc, char *argv[])
strcpy (contentdir, "content"); strcpy (contentdir, "content");
while ((c = getopt_long(argc, argv, "r:d:fob:ptc:?hM:S:T:emq:", long_options, &option_index)) != -1) while ((c = getopt_long(argc, argv, "r:d:fob:psc:?hM:S:T:emq:", long_options, &option_index)) != -1)
{ {
switch (c) { switch (c) {
case 'r': case 'r':
@@ -106,8 +106,8 @@ main (int argc, char *argv[])
case 'p': case 'p':
gfxflags |= TFB_GFXFLAGS_SHOWFPS; gfxflags |= TFB_GFXFLAGS_SHOWFPS;
break; break;
case 't': case 's':
gfxflags |= TFB_GFXFLAGS_TVEFFECT; gfxflags |= TFB_GFXFLAGS_SCANLINES;
break; break;
case 'c': case 'c':
sscanf(optarg, "%s", contentdir); sscanf(optarg, "%s", contentdir);
@@ -166,12 +166,12 @@ main (int argc, char *argv[])
case 'h': case 'h':
printf("\nOptions:\n"); printf("\nOptions:\n");
printf(" -r, --res=WIDTHxHEIGHT (default 640x480, others work only with --opengl)\n"); printf(" -r, --res=WIDTHxHEIGHT (default 640x480, others work only with --opengl)\n");
printf(" -d, --bpp=BITSPERPIXEL (default 16)\n"); printf(" -d, --bpp=BITSPERPIXEL (default 16, use 24 or 32 for better gfx quality)\n");
printf(" -f, --fullscreen (default off)\n"); printf(" -f, --fullscreen (default off)\n");
printf(" -o, --opengl (default off, usage recommended if TNT2 or better gfx card)\n"); printf(" -o, --opengl (default off, usage recommended if TNT2 or better gfx card)\n");
printf(" -b, --bilinear (default off, only works with --opengl)\n"); printf(" -b, --bilinear (default off, only works with --opengl)\n");
printf(" -p, --fps (default off)\n"); printf(" -p, --fps (default off)\n");
printf(" -t, --tv (default off, only works with --opengl\n"); printf(" -s, --scanlines (default off, only works with --opengl\n");
printf(" -c, --contentdir=CONTENTDIR\n"); printf(" -c, --contentdir=CONTENTDIR\n");
printf(" -M, --musicvol=VOLUME (0-100, default 100)\n"); printf(" -M, --musicvol=VOLUME (0-100, default 100)\n");
printf(" -S, --sfxvol=VOLUME (0-100, default 100)\n"); printf(" -S, --sfxvol=VOLUME (0-100, default 100)\n");