Some gl_draw cleanups for glpic.

Some sbar cleanups (still broken, suspect driver issues.).
Removal of pmodel and emodel infokeys, waste of info space.
For servers allow people downloading to hear people talking.
This commit is contained in:
Zephaniah E. Hull 2001-06-02 20:39:54 +00:00
parent 3f47a8d0a7
commit 380dcf5c9b
5 changed files with 31 additions and 63 deletions

View file

@ -78,8 +78,7 @@ static byte cs_data[64] = {
typedef struct {
int texnum;
int bytesperpixel;
float sl, tl, sh, th;
// float sl, tl, sh, th;
} glpic_t;
extern int gl_filter_min, gl_filter_max;
@ -107,11 +106,7 @@ Draw_PicFromWad (char *name)
p = W_GetLumpName (name);
gl = (glpic_t *) p->data;
gl->texnum = GL_LoadTexture ("", p->width, p->height, p->data, false, true, 1);
gl->sl = 0;
gl->sh = 1;
gl->tl = 0;
gl->th = 1;
gl->texnum = GL_LoadTexture (name, p->width, p->height, p->data, false, true, 1);
return p;
}
@ -166,12 +161,6 @@ Draw_CachePic (char *path, qboolean alpha)
gl = (glpic_t *) pic->pic.data;
gl->texnum = GL_LoadTexture ("", dat->width, dat->height, dat->data, false, alpha, 1);
// Alignment stuff..
gl->sl = 0;
gl->sh = 1;
gl->tl = 0;
gl->th = 1;
// Now lets mark this cache entry as used..
pic->dirty = false;
numcachepics++;
@ -403,13 +392,13 @@ Draw_Pic (int x, int y, qpic_t *pic)
glBindTexture (GL_TEXTURE_2D, gl->texnum);
glBegin (GL_QUADS);
glTexCoord2f (gl->sl, gl->tl);
glTexCoord2f (0, 0);
glVertex2f (x, y);
glTexCoord2f (gl->sh, gl->tl);
glTexCoord2f (1, 0);
glVertex2f (x + pic->width, y);
glTexCoord2f (gl->sh, gl->th);
glTexCoord2f (1, 1);
glVertex2f (x + pic->width, y + pic->height);
glTexCoord2f (gl->sl, gl->th);
glTexCoord2f (0, 1);
glVertex2f (x, y + pic->height);
glEnd ();
}
@ -421,18 +410,14 @@ Draw_SubPic (int x, int y, qpic_t *pic, int srcx, int srcy, int width,
{
glpic_t *gl;
float newsl, newtl, newsh, newth;
float oldglwidth, oldglheight;
gl = (glpic_t *) pic->data;
oldglwidth = gl->sh - gl->sl;
oldglheight = gl->th - gl->tl;
newsl = (float) srcx / (float) pic->width;
newsh = newsl + (float) width / (float) pic->width;
newsl = gl->sl + (srcx * oldglwidth) / pic->width;
newsh = newsl + (width * oldglwidth) / pic->width;
newtl = gl->tl + (srcy * oldglheight) / pic->height;
newth = newtl + (height * oldglheight) / pic->height;
newtl = (float) srcy / (float) pic->height;
newth = newtl + (float) height / (float) pic->height;
glColor3f (0.8, 0.8, 0.8);
glBindTexture (GL_TEXTURE_2D, gl->texnum);
@ -555,13 +540,13 @@ Draw_ConsoleBackground (int lines)
// draw the console texture
glBindTexture (GL_TEXTURE_2D, gl->texnum);
glBegin (GL_QUADS);
glTexCoord2f (gl->sl, gl->tl + ofs);
glTexCoord2f (0, 0 + ofs);
glVertex2f (0, 0);
glTexCoord2f (gl->sh, gl->tl + ofs);
glTexCoord2f (1, 0 + ofs);
glVertex2f (vid.conwidth, 0);
glTexCoord2f (gl->sh, gl->th);
glTexCoord2f (1, 1);
glVertex2f (vid.conwidth, lines);
glTexCoord2f (gl->sl, gl->th);
glTexCoord2f (0, 1);
glVertex2f (0, lines);
glEnd ();

View file

@ -200,8 +200,6 @@ void Master_Connect_f (void);
char *server_version = NULL; // version of server we connected to
char emodel_name[] = "emodel";
char pmodel_name[] = "pmodel";
char prespawn_name[] = "prespawn %i 0 %i";
char modellist_name[] = "modellist %i %i";
char soundlist_name[] = "soundlist %i %i";
@ -690,9 +688,6 @@ CL_FullInfo_f (void)
if (*s)
s++;
if (strcaseequal (key, pmodel_name) || strcaseequal (key, emodel_name))
continue;
Info_SetValueForKey (cls.userinfo, key, value, MAX_INFO_STRING);
}
}
@ -714,10 +709,6 @@ CL_SetInfo_f (void)
Con_Printf ("usage: setinfo [ <key> <value> ]\n");
return;
}
if (strcaseequal (Cmd_Argv (1), pmodel_name)
|| strcaseequal (Cmd_Argv (1), emodel_name))
return;
Info_SetValueForKey (cls.userinfo, Cmd_Argv (1), Cmd_Argv (2),
MAX_INFO_STRING);
if (cls.state >= ca_connected)

View file

@ -290,13 +290,6 @@ Model_NextDownload (void)
return;
}
if (strequal (cl.model_name[i], "progs/player.mdl")
&& cl.model_precache[i]->type == mod_alias)
info_key = pmodel_name;
if (strequal (cl.model_name[i], "progs/eyes.mdl")
&& cl.model_precache[i]->type == mod_alias)
info_key = emodel_name;
if (info_key) {
aliashdr_t *ahdr = (aliashdr_t *) Mod_Extradata (cl.model_precache[i]);
Info_SetValueForKey (cls.userinfo, info_key, va ("%d", ahdr->crc),

View file

@ -55,6 +55,7 @@
int sb_updates; // if >= vid.numpages, no update needed
#define STAT_MINUS 10 // num frame for '-' stats digit
qpic_t *sb_nums[2][11];
qpic_t *sb_colon, *sb_slash;
qpic_t *sb_ibar;
@ -535,31 +536,29 @@ Sbar_DrawInventory (void)
// ammo counts
for (i = 0; i < 4; i++) {
snprintf (num, sizeof (num), "%3i", cl.stats[STAT_SHELLS + i]);
snprintf (num, sizeof (num), "%3i", min (cl.stats[STAT_SHELLS + i], 999));
if (headsup) {
// Sbar_DrawSubPic(3, -24, sb_ibar, 3, 0, 42, 11);
Sbar_DrawSubPic ((hudswap) ? 0 : (vid.width - 42),
-24 - (4 - i) * 11, sb_ibar, 3 + (i * 48), 0, 42,
11);
#define HUD_X(dist) ((hudswap) ? dist : (vid.width - (42 - dist)))
#define HUD_Y(n) (-24 - (4 - n) * 11)
Sbar_DrawSubPic (HUD_X (0), HUD_Y (i), sb_ibar,
3 + (i * 48), 0, 42, 11);
if (num[0] != ' ')
Sbar_DrawCharacter ((hudswap) ? 3 : (vid.width - 39),
-24 - (4 - i) * 11, 18 + num[0] - '0');
Sbar_DrawCharacter (HUD_X (3), HUD_Y (i), 18 + num[0] - '0');
if (num[1] != ' ')
Sbar_DrawCharacter ((hudswap) ? 11 : (vid.width - 31),
-24 - (4 - i) * 11, 18 + num[1] - '0');
Sbar_DrawCharacter (HUD_X (11), HUD_Y (i), 18 + num[1] - '0');
if (num[2] != ' ')
Sbar_DrawCharacter ((hudswap) ? 19 : (vid.width - 23),
-24 - (4 - i) * 11, 18 + num[2] - '0');
Sbar_DrawCharacter (HUD_X (19), HUD_Y (i), 18 + num[2] - '0');
#undef HUD_X
#undef HUD_Y
} else {
#define HUD_X(n, dist) ((6 * n + dist) * 8 - 2)
if (num[0] != ' ')
Sbar_DrawCharacter ((6 * i + 1) * 8 - 2, -24,
18 + num[0] - '0');
Sbar_DrawCharacter (HUD_X(i, 1), -24, 18 + num[0] - '0');
if (num[1] != ' ')
Sbar_DrawCharacter ((6 * i + 2) * 8 - 2, -24,
18 + num[1] - '0');
Sbar_DrawCharacter (HUD_X(i, 2), -24, 18 + num[1] - '0');
if (num[2] != ' ')
Sbar_DrawCharacter ((6 * i + 3) * 8 - 2, -24,
18 + num[2] - '0');
Sbar_DrawCharacter (HUD_X(i, 3), -24, 18 + num[2] - '0');
#undef HUD_X
}
}

View file

@ -823,7 +823,7 @@ SV_Say (qboolean team)
Con_Printf ("%s", text);
for (j = 0, client = svs.clients; j < MAX_CLIENTS; j++, client++) {
if (client->state != cs_spawned)
if (client->state < cs_connected) // Clients connecting can hear.
continue;
if (host_client->spectator && !sv_spectalk->int_val)
if (!client->spectator)