diff noise reduction.

This commit is contained in:
Ragnvald Maartmann-Moe IV 2001-05-14 19:46:16 +00:00
parent 2c80bff085
commit 0c16f56c23
4 changed files with 118 additions and 192 deletions

View file

@ -56,9 +56,12 @@ byte *vid_colormap;
cvar_t *cl_name; cvar_t *cl_name;
cvar_t *cl_color; cvar_t *cl_color;
cvar_t *writecfg;
cvar_t *cl_shownet; cvar_t *cl_shownet;
cvar_t *cl_nolerp; cvar_t *cl_nolerp;
cvar_t *cl_sbar; cvar_t *cl_sbar;
cvar_t *cl_sbar_separator;
cvar_t *cl_hudswap; cvar_t *cl_hudswap;
cvar_t *cl_cshift_bonus; cvar_t *cl_cshift_bonus;
@ -175,9 +178,7 @@ CL_ClearState (void)
memset (cl_temp_entities, 0, sizeof (cl_temp_entities)); memset (cl_temp_entities, 0, sizeof (cl_temp_entities));
memset (cl_beams, 0, sizeof (cl_beams)); memset (cl_beams, 0, sizeof (cl_beams));
//
// allocate the efrags and chain together into a free list // allocate the efrags and chain together into a free list
//
cl.free_efrags = cl_efrags; cl.free_efrags = cl_efrags;
for (i = 0; i < MAX_EFRAGS - 1; i++) for (i = 0; i < MAX_EFRAGS - 1; i++)
cl.free_efrags[i].entnext = &cl.free_efrags[i + 1]; cl.free_efrags[i].entnext = &cl.free_efrags[i + 1];
@ -301,12 +302,10 @@ CL_SignonReply (void)
case 2: case 2:
MSG_WriteByte (&cls.message, clc_stringcmd); MSG_WriteByte (&cls.message, clc_stringcmd);
MSG_WriteString (&cls.message, va ("name \"%s\"\n", cl_name->string)); MSG_WriteString (&cls.message, va ("name \"%s\"\n", cl_name->string));
MSG_WriteByte (&cls.message, clc_stringcmd); MSG_WriteByte (&cls.message, clc_stringcmd);
MSG_WriteString (&cls.message, MSG_WriteString (&cls.message,
va ("color %i %i\n", (cl_color->int_val) >> 4, va ("color %i %i\n", (cl_color->int_val) >> 4,
(cl_color->int_val) & 15)); (cl_color->int_val) & 15));
MSG_WriteByte (&cls.message, clc_stringcmd); MSG_WriteByte (&cls.message, clc_stringcmd);
snprintf (str, sizeof (str), "spawn %s", cls.spawnparms); snprintf (str, sizeof (str), "spawn %s", cls.spawnparms);
MSG_WriteString (&cls.message, str); MSG_WriteString (&cls.message, str);
@ -374,11 +373,9 @@ CL_PrintEntities_f (void)
/* /*
===============
SetPal SetPal
Debugging tool, just flashes the screen Debugging tool, just flashes the screen
===============
*/ */
void void
SetPal (int i) SetPal (int i)
@ -507,12 +504,10 @@ CL_DecayLights (void)
/* /*
===============
CL_LerpPoint CL_LerpPoint
Determines the fraction between the last two messages that the objects Determines the fraction between the last two messages that the objects
should be put at. should be put at.
===============
*/ */
float float
CL_LerpPoint (void) CL_LerpPoint (void)
@ -569,9 +564,7 @@ CL_RelinkEntities (void)
cl_numvisedicts = 0; cl_numvisedicts = 0;
//
// interpolate player info // interpolate player info
//
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
cl.velocity[i] = cl.mvelocity[1][i] + cl.velocity[i] = cl.mvelocity[1][i] +
frac * (cl.mvelocity[0][i] - cl.mvelocity[1][i]); frac * (cl.mvelocity[0][i] - cl.mvelocity[1][i]);
@ -606,8 +599,7 @@ CL_RelinkEntities (void)
VectorCopy (ent->origin, oldorg); VectorCopy (ent->origin, oldorg);
if (ent->forcelink) { // the entity was not updated in the if (ent->forcelink) { // the entity was not updated in the
// last message // last message so move to the final spot
// so move to the final spot
VectorCopy (ent->msg_origins[0], ent->origin); VectorCopy (ent->msg_origins[0], ent->origin);
VectorCopy (ent->msg_angles[0], ent->angles); VectorCopy (ent->msg_angles[0], ent->angles);
} else { // if the delta is large, assume a } else { // if the delta is large, assume a
@ -616,8 +608,7 @@ CL_RelinkEntities (void)
for (j = 0; j < 3; j++) { for (j = 0; j < 3; j++) {
delta[j] = ent->msg_origins[0][j] - ent->msg_origins[1][j]; delta[j] = ent->msg_origins[0][j] - ent->msg_origins[1][j];
if (delta[j] > 100 || delta[j] < -100) if (delta[j] > 100 || delta[j] < -100)
f = 1; // assume a teleportation, not a f = 1; // assume a teleportation, not a motion
// motion
} }
// interpolate the origin and angles // interpolate the origin and angles
@ -690,7 +681,6 @@ CL_RelinkEntities (void)
dl->die = cl.time + 0.001; dl->die = cl.time + 0.001;
} }
#endif #endif
if (VectorDistance_fast(ent->msg_origins[1], ent->origin) > (256*256)) if (VectorDistance_fast(ent->msg_origins[1], ent->origin) > (256*256))
VectorCopy (ent ->origin, ent->msg_origins[1]); VectorCopy (ent ->origin, ent->msg_origins[1]);
if (ent->model->flags & EF_ROCKET) { if (ent->model->flags & EF_ROCKET) {
@ -717,7 +707,6 @@ CL_RelinkEntities (void)
if (i == cl.viewentity && !chase_active->int_val) if (i == cl.viewentity && !chase_active->int_val)
continue; continue;
#ifdef QUAKE2 #ifdef QUAKE2
if (ent->effects & EF_NODRAW) if (ent->effects & EF_NODRAW)
continue; continue;
@ -727,16 +716,13 @@ CL_RelinkEntities (void)
cl_numvisedicts++; cl_numvisedicts++;
} }
} }
} }
/* /*
===============
CL_ReadFromServer CL_ReadFromServer
Read all incoming data from the server Read all incoming data from the server
===============
*/ */
int int
CL_ReadFromServer (void) CL_ReadFromServer (void)
@ -763,17 +749,11 @@ CL_ReadFromServer (void)
CL_RelinkEntities (); CL_RelinkEntities ();
CL_UpdateTEnts (); CL_UpdateTEnts ();
//
// bring the links up to date // bring the links up to date
//
return 0; return 0;
} }
/*
=================
CL_SendCmd
=================
*/
void void
CL_SendCmd (void) CL_SendCmd (void)
{ {
@ -809,11 +789,7 @@ CL_SendCmd (void)
SZ_Clear (&cls.message); SZ_Clear (&cls.message);
} }
/*
=================
CL_Init
=================
*/
void void
CL_Init (void) CL_Init (void)
{ {

View file

@ -44,9 +44,7 @@
#include "client.h" #include "client.h"
#include "server.h" #include "server.h"
int sb_updates; // if >= vid.numpages, no update int sb_updates; // if >= vid.numpages, no update needed
// needed
#define STAT_MINUS 10 // num frame for '-' stats digit #define STAT_MINUS 10 // num frame for '-' stats digit
qpic_t *sb_nums[2][11]; qpic_t *sb_nums[2][11];
@ -55,17 +53,13 @@ qpic_t *sb_ibar;
qpic_t *sb_sbar; qpic_t *sb_sbar;
qpic_t *sb_scorebar; qpic_t *sb_scorebar;
qpic_t *sb_weapons[7][8]; // 0 is active, 1 is owned, 2-5 are qpic_t *sb_weapons[7][8]; // 0 is active, 1 is owned, 2-5 are flashes
// flashes
qpic_t *sb_ammo[4]; qpic_t *sb_ammo[4];
qpic_t *sb_sigil[4]; qpic_t *sb_sigil[4];
qpic_t *sb_armor[3]; qpic_t *sb_armor[3];
qpic_t *sb_items[32]; qpic_t *sb_items[32];
qpic_t *sb_faces[7][2]; // 0 is gibbed, 1 is dead, 2-6 are qpic_t *sb_faces[7][2]; // 0 is gibbed, 1 is dead, 2-6 are alive
// alive
// 0 is static, 1 is temporary animation // 0 is static, 1 is temporary animation
qpic_t *sb_face_invis; qpic_t *sb_face_invis;
qpic_t *sb_face_quad; qpic_t *sb_face_quad;
@ -85,17 +79,13 @@ int sb_lines; // scan lines to draw
// MED 01/04/97 added two more weapons + 3 // MED 01/04/97 added two more weapons + 3
// alternates for grenade launcher // alternates for grenade launcher
//qpic_t *hsb_weapons[7][5]; // 0 is active, 1 is owned, 2-5 are //qpic_t *hsb_weapons[7][5]; // 0 is active, 1 is owned, 2-5 are flashes
// flashes
// MED 01/04/97 added array to simplify // MED 01/04/97 added array to simplify
// weapon parsing // weapon parsing
//int hipweapons[4] = //int hipweapons[4] =
// { HIT_LASER_CANNON_BIT, HIT_MJOLNIR_BIT, 4, HIT_PROXIMITY_GUN_BIT }; // { HIT_LASER_CANNON_BIT, HIT_MJOLNIR_BIT, 4, HIT_PROXIMITY_GUN_BIT };
//qpic_t *hsb_items[2]; // MED 01/04/97 added hipnotic items //qpic_t *hsb_items[2]; // MED 01/04/97 added hipnotic items array
// array
qboolean headsup; qboolean headsup;
qboolean sbar_centered; qboolean sbar_centered;
@ -103,11 +93,6 @@ qboolean sbar_centered;
void Sbar_MiniDeathmatchOverlay (void); void Sbar_MiniDeathmatchOverlay (void);
void Sbar_DeathmatchOverlay (void); void Sbar_DeathmatchOverlay (void);
/*
*
* Status Bar Utility Functions
*
*/
/* /*
Sbar_ColorForMap Sbar_ColorForMap
@ -123,7 +108,6 @@ Sbar_ColorForMap (int m)
} }
/* /*
Sbar_ShowScores Sbar_ShowScores
@ -138,6 +122,7 @@ Sbar_ShowScores (void)
sb_updates = 0; sb_updates = 0;
} }
/* /*
Sbar_DontShowScores Sbar_DontShowScores
@ -152,6 +137,7 @@ Sbar_DontShowScores (void)
sb_updates = 0; sb_updates = 0;
} }
/* /*
Sbar_Changed Sbar_Changed
@ -205,6 +191,7 @@ Sbar_DrawSubPic (int x, int y, qpic_t *pic, int srcx, int srcy, int width,
height); height);
} }
/* /*
Sbar_DrawTransPic Sbar_DrawTransPic
@ -313,10 +300,8 @@ Sbar_DrawNum (int x, int y, int num, int digits, int color)
} }
} }
//=============================================================================
int fragsort[MAX_SCOREBOARD]; int fragsort[MAX_SCOREBOARD];
char scoreboardtext[MAX_SCOREBOARD][20]; char scoreboardtext[MAX_SCOREBOARD][20];
int scoreboardtop[MAX_SCOREBOARD]; int scoreboardtop[MAX_SCOREBOARD];
int scoreboardbottom[MAX_SCOREBOARD]; int scoreboardbottom[MAX_SCOREBOARD];
@ -417,9 +402,6 @@ Sbar_DrawScoreboard (void)
} }
//=============================================================================
void void
Sbar_DrawInventory (void) Sbar_DrawInventory (void)
{ {
@ -636,9 +618,6 @@ Sbar_DrawInventory (void)
} }
//=============================================================================
void void
Sbar_DrawFrags (void) Sbar_DrawFrags (void)
{ {
@ -695,9 +674,6 @@ Sbar_DrawFrags (void)
} }
//=============================================================================
void void
Sbar_DrawFace (void) Sbar_DrawFace (void)
{ {
@ -918,9 +894,6 @@ Sbar_Draw (void)
} }
//=============================================================================
void void
Sbar_IntermissionNumber (int x, int y, int num, int digits, int color) Sbar_IntermissionNumber (int x, int y, int num, int digits, int color)
{ {
@ -1278,4 +1251,3 @@ Sbar_Init (void)
// rsb_ammo[2] = Draw_PicFromWad ("r_ammoplasma"); // rsb_ammo[2] = Draw_PicFromWad ("r_ammoplasma");
// } // }
} }

View file

@ -118,7 +118,7 @@ cvar_t *cl_allow_cmd_pkt;
cvar_t *cl_timeout; cvar_t *cl_timeout;
cvar_t *cl_shownet; // can be 0, 1, or 2 cvar_t *cl_shownet;
cvar_t *cl_autoexec; cvar_t *cl_autoexec;
cvar_t *cl_sbar; cvar_t *cl_sbar;
cvar_t *cl_sbar_separator; cvar_t *cl_sbar_separator;

View file

@ -51,9 +51,7 @@
#include "client.h" #include "client.h"
#include "sbar.h" #include "sbar.h"
int sb_updates; // if >= vid.numpages, no update int sb_updates; // if >= vid.numpages, no update needed
// needed
#define STAT_MINUS 10 // num frame for '-' stats digit #define STAT_MINUS 10 // num frame for '-' stats digit
qpic_t *sb_nums[2][11]; qpic_t *sb_nums[2][11];
@ -62,17 +60,13 @@ qpic_t *sb_ibar;
qpic_t *sb_sbar; qpic_t *sb_sbar;
qpic_t *sb_scorebar; qpic_t *sb_scorebar;
qpic_t *sb_weapons[7][8]; // 0 is active, 1 is owned, 2-5 are qpic_t *sb_weapons[7][8]; // 0 is active, 1 is owned, 2-5 are flashes
// flashes
qpic_t *sb_ammo[4]; qpic_t *sb_ammo[4];
qpic_t *sb_sigil[4]; qpic_t *sb_sigil[4];
qpic_t *sb_armor[3]; qpic_t *sb_armor[3];
qpic_t *sb_items[32]; qpic_t *sb_items[32];
qpic_t *sb_faces[7][2]; // 0 is gibbed, 1 is dead, 2-6 are qpic_t *sb_faces[7][2]; // 0 is gibbed, 1 is dead, 2-6 are alive
// alive
// 0 is static, 1 is temporary animation // 0 is static, 1 is temporary animation
qpic_t *sb_face_invis; qpic_t *sb_face_invis;
qpic_t *sb_face_quad; qpic_t *sb_face_quad;
@ -235,11 +229,14 @@ Sbar_Init (void)
sb_face_invis_invuln = Draw_PicFromWad ("face_inv2"); sb_face_invis_invuln = Draw_PicFromWad ("face_inv2");
sb_face_quad = Draw_PicFromWad ("face_quad"); sb_face_quad = Draw_PicFromWad ("face_quad");
Cmd_AddCommand ("+showscores", Sbar_ShowScores, "Display information on everyone playing"); Cmd_AddCommand ("+showscores", Sbar_ShowScores,
Cmd_AddCommand ("-showscores", Sbar_DontShowScores, "Stop displaying information on everyone playing"); "Display information on everyone playing");
Cmd_AddCommand ("-showscores", Sbar_DontShowScores,
Cmd_AddCommand ("+showteamscores", Sbar_ShowTeamScores, "Display information for your team"); "Stop displaying information on everyone playing");
Cmd_AddCommand ("-showteamscores", Sbar_DontShowTeamScores, "Stop displaying information for your team"); Cmd_AddCommand ("+showteamscores", Sbar_ShowTeamScores,
"Display information for your team");
Cmd_AddCommand ("-showteamscores", Sbar_DontShowTeamScores,
"Stop displaying information for your team");
sb_sbar = Draw_PicFromWad ("sbar"); sb_sbar = Draw_PicFromWad ("sbar");
sb_ibar = Draw_PicFromWad ("ibar"); sb_ibar = Draw_PicFromWad ("ibar");
@ -247,16 +244,11 @@ Sbar_Init (void)
} }
//=============================================================================
// drawing routines are reletive to the status bar location // drawing routines are reletive to the status bar location
void void
Sbar_DrawPic (int x, int y, qpic_t *pic) Sbar_DrawPic (int x, int y, qpic_t *pic)
{ {
Draw_Pic (x /* + ((vid.width - 320)>>1) */ , y + (vid.height - SBAR_HEIGHT), Draw_Pic (x, y + (vid.height - SBAR_HEIGHT), pic);
pic);
} }
@ -277,7 +269,7 @@ Sbar_DrawSubPic (int x, int y, qpic_t *pic, int srcx, int srcy, int width,
void void
Sbar_DrawTransPic (int x, int y, qpic_t *pic) Sbar_DrawTransPic (int x, int y, qpic_t *pic)
{ {
Draw_Pic (x /* + ((vid.width - 320)>>1) */ , y + (vid.height - SBAR_HEIGHT), Draw_Pic (x, y + (vid.height - SBAR_HEIGHT),
pic); pic);
} }
@ -290,16 +282,14 @@ Sbar_DrawTransPic (int x, int y, qpic_t *pic)
void void
Sbar_DrawCharacter (int x, int y, int num) Sbar_DrawCharacter (int x, int y, int num)
{ {
Draw_Character8 (x /* + ((vid.width - 320)>>1) */ + 4, Draw_Character8 (x + 4, y + vid.height - SBAR_HEIGHT, num);
y + vid.height - SBAR_HEIGHT, num);
} }
void void
Sbar_DrawString (int x, int y, char *str) Sbar_DrawString (int x, int y, char *str)
{ {
Draw_String8 (x /* + ((vid.width - 320)>>1) */ , Draw_String8 (x, y + vid.height - SBAR_HEIGHT, str);
y + vid.height - SBAR_HEIGHT, str);
} }
@ -359,8 +349,6 @@ Sbar_DrawNum (int x, int y, int num, int digits, int color)
} }
//=============================================================================
//ZOID: this should be MAX_CLIENTS, not MAX_SCOREBOARD!! //ZOID: this should be MAX_CLIENTS, not MAX_SCOREBOARD!!
//int fragsort[MAX_SCOREBOARD]; //int fragsort[MAX_SCOREBOARD];
int fragsort[MAX_CLIENTS]; int fragsort[MAX_CLIENTS];
@ -495,9 +483,6 @@ Sbar_SoloScoreboard (void)
} }
//=============================================================================
void void
Sbar_DrawInventory (void) Sbar_DrawInventory (void)
{ {
@ -599,9 +584,6 @@ Sbar_DrawInventory (void)
} }
//=============================================================================
void void
Sbar_DrawFrags (void) Sbar_DrawFrags (void)
{ {
@ -659,9 +641,6 @@ Sbar_DrawFrags (void)
} }
//=============================================================================
void void
Sbar_DrawFace (void) Sbar_DrawFace (void)
{ {
@ -812,9 +791,6 @@ Sbar_Draw (void)
} }
//=============================================================================
void void
Sbar_IntermissionNumber (int x, int y, int num, int digits, int color) Sbar_IntermissionNumber (int x, int y, int num, int digits, int color)
{ {
@ -879,8 +855,9 @@ Sbar_TeamOverlay (void)
Draw_String8 (x, y, "low/avg/high team total players"); Draw_String8 (x, y, "low/avg/high team total players");
y += 8; y += 8;
// Draw_String8 (x, y, "------------ ---- ----- -------"); // Draw_String8 (x, y, "------------ ---- ----- -------");
Draw_String8 (x, y, Draw_String8 (x, y, "\x1d\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1f "
"\x1d\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1f \x1d\x1e\x1e\x1f \x1d\x1e\x1e\x1e\x1f \x1d\x1e\x1e\x1e\x1e\x1e\x1f"); "\x1d\x1e\x1e\x1f \x1d\x1e\x1e\x1e\x1f "
"\x1d\x1e\x1e\x1e\x1e\x1e\x1f");
y += 8; y += 8;
// sort the teams // sort the teams
@ -992,8 +969,9 @@ Sbar_DeathmatchOverlay (int start)
Draw_String8 (x, y, "ping pl time frags team name"); Draw_String8 (x, y, "ping pl time frags team name");
y += 8; y += 8;
// Draw_String8 ( x , y, "---- -- ---- ----- ---- ----------------"); // Draw_String8 ( x , y, "---- -- ---- ----- ---- ----------------");
Draw_String8 (x, y, Draw_String8 (x, y, "\x1d\x1e\x1e\x1f \x1d\x1f \x1d\x1e\x1e\x1f "
"\x1d\x1e\x1e\x1f \x1d\x1f \x1d\x1e\x1e\x1f \x1d\x1e\x1e\x1e\x1f \x1d\x1e\x1e\x1f \x1d\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1f"); "\x1d\x1e\x1e\x1e\x1f \x1d\x1e\x1e\x1f \x1d\x1e\x1e"
"\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1f");
y += 8; y += 8;
} else { } else {
x = 16; x = 16;
@ -1001,8 +979,9 @@ Sbar_DeathmatchOverlay (int start)
Draw_String8 (x, y, "ping pl time frags name"); Draw_String8 (x, y, "ping pl time frags name");
y += 8; y += 8;
// Draw_String8 ( x , y, "---- -- ---- ----- ----------------"); // Draw_String8 ( x , y, "---- -- ---- ----- ----------------");
Draw_String8 (x, y, Draw_String8 (x, y, "\x1d\x1e\x1e\x1f \x1d\x1f \x1d\x1e\x1e\x1f "
"\x1d\x1e\x1e\x1f \x1d\x1f \x1d\x1e\x1e\x1f \x1d\x1e\x1e\x1e\x1f \x1d\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1f"); "\x1d\x1e\x1e\x1e\x1f \x1d\x1e\x1e\x1e\x1e\x1e\x1e"
"\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1f");
y += 8; y += 8;
} }
@ -1086,8 +1065,7 @@ Sbar_DeathmatchOverlay (int start)
y += skip; y += skip;
} }
if (y >= vid.height - 10) // we ran over the screen size, if (y >= vid.height - 10) // we ran over the screen size, squish
// squish
largegame = true; largegame = true;
} }