Changed crosshairalpha to gl_crosshairalpha and made it floating point.

(1.0 = opaque, 0.0 = clear).
This commit is contained in:
Tony Tyson 2000-04-28 04:43:21 +00:00
parent ae2ab25a34
commit 3e10387288
2 changed files with 7 additions and 5 deletions

View file

@ -41,7 +41,7 @@
#include <lib_replace.h>
extern unsigned char d_15to8table[65536];
extern cvar_t *crosshair, *cl_crossx, *cl_crossy, *crosshaircolor, *crosshairalpha;
extern cvar_t *crosshair, *cl_crossx, *cl_crossy, *crosshaircolor;
cvar_t *gl_nobind;
cvar_t *gl_max_size;
@ -49,6 +49,7 @@ cvar_t *gl_picmip;
cvar_t *gl_conspin;
cvar_t *gl_conalpha;
cvar_t *gl_constretch;
cvar_t *gl_crosshairalpha;
byte *draw_chars; // 8*8 graphic characters
qpic_t *draw_disc;
@ -409,6 +410,9 @@ void Draw_Init (void)
gl_constretch = Cvar_Get ("gl_constretch", "0", CVAR_NONE,
"If set to 1 will stretch the console image instead "
"of sliding it up and down. (default 0)");
gl_crosshairalpha = Cvar_Get ("gl_crosshairalpha", "1.0",
CVAR_ARCHIVE, "Crosshair Alpha");
// 3dfx can only handle 256 wide textures
if (!Q_strncasecmp ((char *)gl_renderer, "3dfx",4) ||
@ -544,7 +548,7 @@ Draw_Crosshair(void)
glTexEnvf ( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
uColor = d_8to24table[(byte) crosshaircolor->value] & 0x00ffffff;
uColor |= ((unsigned)crosshairalpha->value & 0xff) << 24;
uColor |= ((unsigned)(gl_crosshairalpha->value*255.0) & 0xff) << 24;
glColor4ubv((unsigned char *)&uColor);
GL_Bind (cs_texture3);
@ -576,7 +580,7 @@ Draw_Crosshair(void)
glTexEnvf ( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
uColor = d_8to24table[(byte) crosshaircolor->value] & 0x00ffffff;
uColor |= ((unsigned)crosshairalpha->value & 0xff) << 24;
uColor |= ((unsigned)(gl_crosshairalpha->value*255.0) & 0xff) << 24;
glColor4ubv((unsigned char *)&uColor);
GL_Bind (cs_texture);

View file

@ -79,7 +79,6 @@ cvar_t *v_idlescale;
cvar_t *crosshair;
cvar_t *crosshaircolor;
cvar_t *crosshairalpha;
cvar_t *cl_crossx;
cvar_t *cl_crossy;
@ -1073,7 +1072,6 @@ V_Init ( void )
v_idlescale = Cvar_Get ("v_idlescale", "0", CVAR_NONE, "None");
crosshaircolor = Cvar_Get ("crosshaircolor", "79", CVAR_ARCHIVE, "Crosshair Color");
crosshairalpha = Cvar_Get ("crosshairalpha", "255", CVAR_ARCHIVE, "Crosshair Alpha");
crosshair = Cvar_Get ("crosshair", "0", CVAR_ARCHIVE, "Crosshair selection");
cl_crossx = Cvar_Get ("cl_crossx", "0", CVAR_ARCHIVE, "Crosshair X location");
cl_crossy = Cvar_Get ("cl_crossy", "0", CVAR_ARCHIVE, "Crosshair Y location");