Console no longer "grows" in GL. New GL cvar scr_consize as a side-effect

used in debugging, defaults to .5 for half the screen.
This commit is contained in:
Joseph Carter 2000-03-10 17:39:54 +00:00
parent a8ba72ab0f
commit f0cf5f7776
2 changed files with 20 additions and 17 deletions

View file

@ -770,7 +770,7 @@ void Draw_ConsoleBackground (int lines)
qpic_t *conback; qpic_t *conback;
glpic_t *gl; glpic_t *gl;
float alpha; float alpha;
int ofs; float ofs;
conback = Draw_CachePic ("gfx/conback.lmp"); conback = Draw_CachePic ("gfx/conback.lmp");
gl = (glpic_t *)conback->data; gl = (glpic_t *)conback->data;
@ -781,8 +781,6 @@ void Draw_ConsoleBackground (int lines)
else else
alpha = (float)(gl_conalpha->value * 2 * lines)/y; alpha = (float)(gl_conalpha->value * 2 * lines)/y;
ofs = vid.height == lines ? 0: 0-lines;
if (gl_conspin->value) if (gl_conspin->value)
{ {
static float xangle = 0; static float xangle = 0;
@ -811,11 +809,13 @@ void Draw_ConsoleBackground (int lines)
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
} }
ofs = (vid.height - lines)/(float)vid.height;
glBegin (GL_QUADS); glBegin (GL_QUADS);
glTexCoord2f (gl->sl, gl->tl); glTexCoord2f (gl->sl, gl->tl + ofs);
glVertex2f (0, ofs); glVertex2f (0, 0);
glTexCoord2f (gl->sh, gl->tl); glTexCoord2f (gl->sh, gl->tl + ofs);
glVertex2f (vid.width, ofs); glVertex2f (vid.width, 0);
glTexCoord2f (gl->sh, gl->th); glTexCoord2f (gl->sh, gl->th);
glVertex2f (vid.width, lines); glVertex2f (vid.width, lines);
glTexCoord2f (gl->sl, gl->th); glTexCoord2f (gl->sl, gl->th);

View file

@ -108,6 +108,7 @@ cvar_t *scr_showturtle;
cvar_t *scr_showpause; cvar_t *scr_showpause;
cvar_t *scr_printspeed; cvar_t *scr_printspeed;
cvar_t *scr_allowsnap; cvar_t *scr_allowsnap;
cvar_t *scr_consize;
cvar_t *gl_triplebuffer; cvar_t *gl_triplebuffer;
extern cvar_t *crosshair; extern cvar_t *crosshair;
@ -383,15 +384,17 @@ void SCR_SizeDown_f (void)
void SCR_InitCvars (void) void SCR_InitCvars (void)
{ {
scr_fov = Cvar_Get ("fov","90",0,"None"); scr_fov = Cvar_Get ("fov","90",CVAR_NONE,"None");
scr_viewsize = Cvar_Get ("viewsize","100",CVAR_ARCHIVE,"None"); scr_viewsize = Cvar_Get ("viewsize","100",CVAR_ARCHIVE,"None");
scr_conspeed = Cvar_Get ("scr_conspeed","300",CVAR_ARCHIVE,"None"); scr_conspeed = Cvar_Get ("scr_conspeed","300",CVAR_ARCHIVE,"None");
scr_showram = Cvar_Get ("scr_showram","1",0,"None"); scr_showram = Cvar_Get ("scr_showram","1",CVAR_NONE,"None");
scr_showturtle = Cvar_Get ("scr_showturtle","0",0,"None"); scr_showturtle = Cvar_Get ("scr_showturtle","0",CVAR_NONE,"None");
scr_showpause = Cvar_Get ("scr_showpause","1",0,"None"); scr_showpause = Cvar_Get ("scr_showpause","1",CVAR_NONE,"None");
scr_centertime = Cvar_Get ("scr_centertime","2",0,"None"); scr_centertime = Cvar_Get ("scr_centertime","2",CVAR_NONE,"None");
scr_printspeed = Cvar_Get ("scr_printspeed","8",0,"None"); scr_printspeed = Cvar_Get ("scr_printspeed","8",CVAR_NONE,"None");
scr_allowsnap = Cvar_Get ("scr_allowsnap","1",0,"None"); scr_allowsnap = Cvar_Get ("scr_allowsnap","1",CVAR_NONE,"None");
scr_consize = Cvar_Get ("scr_consize", "0.5", CVAR_NONE,
"sets console size (0.5 is half screen");
gl_triplebuffer = Cvar_Get ("gl_triplebuffer","1",CVAR_ARCHIVE,"None"); gl_triplebuffer = Cvar_Get ("gl_triplebuffer","1",CVAR_ARCHIVE,"None");
} }
@ -579,7 +582,7 @@ void SCR_SetUpToDrawConsole (void)
scr_con_current = scr_conlines; scr_con_current = scr_conlines;
} }
else if (key_dest == key_console) else if (key_dest == key_console)
scr_conlines = vid.height/2; // half screen scr_conlines = vid.height * scr_consize->value;
else else
scr_conlines = 0; // none visible scr_conlines = 0; // none visible