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:
@@ -39,7 +39,7 @@ enum
|
||||
#define TFB_GFXFLAGS_FULLSCREEN (1<<0)
|
||||
#define TFB_GFXFLAGS_BILINEAR_FILTERING (1<<1)
|
||||
#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);
|
||||
|
||||
@@ -25,7 +25,7 @@ static SDL_Surface *format_conv_surf;
|
||||
static int ScreenFilterMode;
|
||||
static unsigned int DisplayTexture;
|
||||
static unsigned int TransitionTexture;
|
||||
static BOOLEAN tveffect;
|
||||
static BOOLEAN scanlines;
|
||||
static BOOLEAN upload_transitiontexture = FALSE;
|
||||
|
||||
|
||||
@@ -154,10 +154,10 @@ TFB_GL_InitGraphics (int driver, int flags, int width, int height, int bpp)
|
||||
else
|
||||
ScreenFilterMode = GL_NEAREST;
|
||||
|
||||
if (flags & TFB_GFXFLAGS_TVEFFECT)
|
||||
tveffect = TRUE;
|
||||
if (flags & TFB_GFXFLAGS_SCANLINES)
|
||||
scanlines = TRUE;
|
||||
else
|
||||
tveffect = FALSE;
|
||||
scanlines = FALSE;
|
||||
|
||||
glViewport (0, 0, ScreenWidthActual, ScreenHeightActual);
|
||||
glClearColor (0,0,0,0);
|
||||
@@ -190,14 +190,14 @@ void TFB_GL_UploadTransitionScreen (void)
|
||||
}
|
||||
|
||||
void
|
||||
TFB_GL_TVEffect (void)
|
||||
TFB_GL_ScanLines (void)
|
||||
{
|
||||
int y;
|
||||
|
||||
glDisable (GL_TEXTURE_2D);
|
||||
glEnable (GL_BLEND);
|
||||
glBlendFunc (GL_DST_COLOR, GL_ONE);
|
||||
glColor3f (0.5, 0.5, 0.5);
|
||||
glBlendFunc (GL_DST_COLOR, GL_ZERO);
|
||||
glColor3f (0.85f, 0.85f, 0.85f);
|
||||
|
||||
for (y = 0; y < ScreenHeightActual; y += 2)
|
||||
{
|
||||
@@ -206,6 +206,17 @@ TFB_GL_TVEffect (void)
|
||||
glVertex2i (ScreenWidthActual, y);
|
||||
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
|
||||
@@ -317,8 +328,8 @@ TFB_GL_SwapBuffers (void)
|
||||
TFB_GL_DrawQuad ();
|
||||
}
|
||||
|
||||
if (tveffect)
|
||||
TFB_GL_TVEffect ();
|
||||
if (scanlines)
|
||||
TFB_GL_ScanLines ();
|
||||
|
||||
SDL_GL_SwapBuffers ();
|
||||
}
|
||||
|
||||
+6
-6
@@ -69,7 +69,7 @@ main (int argc, char *argv[])
|
||||
{"opengl", 0, NULL, 'o'},
|
||||
{"bilinear", 0, NULL, 'b'},
|
||||
{"fps", 0, NULL, 'p'},
|
||||
{"tv", 0, NULL, 't'},
|
||||
{"scanlines", 0, NULL, 's'},
|
||||
{"contentdir", 1, NULL, 'c'},
|
||||
{"help", 0, NULL, 'h'},
|
||||
{"musicvol", 1, NULL, 'M'},
|
||||
@@ -85,7 +85,7 @@ main (int argc, char *argv[])
|
||||
|
||||
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) {
|
||||
case 'r':
|
||||
@@ -106,8 +106,8 @@ main (int argc, char *argv[])
|
||||
case 'p':
|
||||
gfxflags |= TFB_GFXFLAGS_SHOWFPS;
|
||||
break;
|
||||
case 't':
|
||||
gfxflags |= TFB_GFXFLAGS_TVEFFECT;
|
||||
case 's':
|
||||
gfxflags |= TFB_GFXFLAGS_SCANLINES;
|
||||
break;
|
||||
case 'c':
|
||||
sscanf(optarg, "%s", contentdir);
|
||||
@@ -166,12 +166,12 @@ main (int argc, char *argv[])
|
||||
case 'h':
|
||||
printf("\nOptions:\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(" -o, --opengl (default off, usage recommended if TNT2 or better gfx card)\n");
|
||||
printf(" -b, --bilinear (default off, only works with --opengl)\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(" -M, --musicvol=VOLUME (0-100, default 100)\n");
|
||||
printf(" -S, --sfxvol=VOLUME (0-100, default 100)\n");
|
||||
|
||||
Reference in New Issue
Block a user