Whitespace.

This commit is contained in:
Ragnvald Maartmann-Moe IV 2001-09-10 17:32:22 +00:00
parent 95515e28d7
commit 05d3aaa0bb
6 changed files with 130 additions and 129 deletions

View file

@ -53,9 +53,9 @@
#include "pmove.h" #include "pmove.h"
#include "sbar.h" #include "sbar.h"
#define PM_SPECTATORMAXSPEED 500 #define PM_SPECTATORMAXSPEED 500
#define PM_STOPSPEED 100 #define PM_STOPSPEED 100
#define PM_MAXSPEED 320 #define PM_MAXSPEED 320
#define BUTTON_JUMP 2 #define BUTTON_JUMP 2
#define BUTTON_ATTACK 1 #define BUTTON_ATTACK 1
#define MAX_ANGLE_TURN 10 #define MAX_ANGLE_TURN 10
@ -83,7 +83,7 @@ int autocam = CAM_NONE;
static void static void
vectoangles (vec3_t vec, vec3_t ang) vectoangles (vec3_t vec, vec3_t ang)
{ {
float forward, pitch, yaw; float forward, pitch, yaw;
if (vec[1] == 0 && vec[0] == 0) { if (vec[1] == 0 && vec[0] == 0) {
yaw = 0; yaw = 0;
@ -92,12 +92,12 @@ vectoangles (vec3_t vec, vec3_t ang)
else else
pitch = 270; pitch = 270;
} else { } else {
yaw = (int) (atan2 (vec[1], vec[0]) * 180 / M_PI); yaw = (int) (atan2 (vec[1], vec[0]) * (180.0 / M_PI));
if (yaw < 0) if (yaw < 0)
yaw += 360; yaw += 360;
forward = sqrt (vec[0] * vec[0] + vec[1] * vec[1]); forward = sqrt (vec[0] * vec[0] + vec[1] * vec[1]);
pitch = (int) (atan2 (vec[2], forward) * 180 / M_PI); pitch = (int) (atan2 (vec[2], forward) * (180.0 / M_PI));
if (pitch < 0) if (pitch < 0)
pitch += 360; pitch += 360;
} }
@ -151,7 +151,7 @@ Cam_Unlock (void)
void void
Cam_Lock (int playernum) Cam_Lock (int playernum)
{ {
char st[40]; char st[40];
snprintf (st, sizeof (st), "ptrack %i", playernum); snprintf (st, sizeof (st), "ptrack %i", playernum);
MSG_WriteByte (&cls.netchan.message, clc_stringcmd); MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
@ -187,7 +187,7 @@ Cam_TryFlyby (player_state_t * self, player_state_t * player, vec3_t vec,
vec3_t v; vec3_t v;
vectoangles (vec, v); vectoangles (vec, v);
// v[0] = -v[0]; // v[0] = -v[0];
VectorCopy (v, pmove.angles); VectorCopy (v, pmove.angles);
VectorNormalize (vec); VectorNormalize (vec);
VectorMA (player->origin, 800, vec, v); VectorMA (player->origin, 800, vec, v);
@ -235,8 +235,7 @@ static qboolean
InitFlyby (player_state_t * self, player_state_t * player, int checkvis) InitFlyby (player_state_t * self, player_state_t * player, int checkvis)
{ {
float f, max; float f, max;
vec3_t vec, vec2; vec3_t forward, right, up, vec, vec2;
vec3_t forward, right, up;
VectorCopy (player->viewangles, vec); VectorCopy (player->viewangles, vec);
vec[0] = 0; vec[0] = 0;
@ -324,8 +323,8 @@ InitFlyby (player_state_t * self, player_state_t * player, int checkvis)
static void static void
Cam_CheckHighTarget (void) Cam_CheckHighTarget (void)
{ {
int i, j, max; int i, j, max;
player_info_t *s; player_info_t *s;
j = -1; j = -1;
for (i = 0, max = -9999; i < MAX_CLIENTS; i++) { for (i = 0, max = -9999; i < MAX_CLIENTS; i++) {
@ -349,10 +348,10 @@ Cam_CheckHighTarget (void)
void void
Cam_Track (usercmd_t *cmd) Cam_Track (usercmd_t *cmd)
{ {
float len; float len;
frame_t *frame; frame_t *frame;
player_state_t *player, *self; player_state_t *player, *self;
vec3_t vec; vec3_t vec;
if (!cl.spectator) if (!cl.spectator)
return; return;
@ -433,7 +432,7 @@ Cam_Track (usercmd_t *cmd)
static float static float
adjustang (float current, float ideal, float speed) adjustang (float current, float ideal, float speed)
{ {
float move; float move;
current = anglemod (current); current = anglemod (current);
ideal = anglemod (ideal); ideal = anglemod (ideal);
@ -466,9 +465,9 @@ adjustang (float current, float ideal, float speed)
void void
Cam_SetView (void) Cam_SetView (void)
{ {
frame_t *frame; frame_t *frame;
player_state_t *player, *self; player_state_t *player, *self;
vec3_t vec, vec2; vec3_t vec, vec2;
if (cls.state != ca_active || !cl.spectator || !autocam || !locked) if (cls.state != ca_active || !cl.spectator || !autocam || !locked)
return; return;
@ -501,8 +500,8 @@ Cam_SetView (void)
void void
Cam_FinishMove (usercmd_t *cmd) Cam_FinishMove (usercmd_t *cmd)
{ {
int end, i; int end, i;
player_info_t *s; player_info_t *s;
if (cls.state != ca_active) if (cls.state != ca_active)
return; return;
@ -606,14 +605,14 @@ Cam_Reset (void)
void void
CL_Cam_Init_Cvars (void) CL_Cam_Init_Cvars (void)
{ {
cl_hightrack = Cvar_Get ("cl_hightrack", "0", CVAR_NONE, NULL, "view the "
"player who has the most frags while you are in "
"spectator mode.");
cl_chasecam = Cvar_Get ("cl_chasecam", "0", CVAR_NONE, NULL, "get first "
"person view of the person you are tracking in "
"spectator mode");
cl_camera_maxpitch = Cvar_Get ("cl_camera_maxpitch", "10", CVAR_NONE, NULL, cl_camera_maxpitch = Cvar_Get ("cl_camera_maxpitch", "10", CVAR_NONE, NULL,
"highest camera pitch in spectator mode"); "highest camera pitch in spectator mode");
cl_camera_maxyaw = Cvar_Get ("cl_camera_maxyaw", "30", CVAR_NONE, NULL, cl_camera_maxyaw = Cvar_Get ("cl_camera_maxyaw", "30", CVAR_NONE, NULL,
"highest camera yaw in spectator mode"); "highest camera yaw in spectator mode");
cl_chasecam = Cvar_Get ("cl_chasecam", "0", CVAR_NONE, NULL, "get first "
"person view of the person you are tracking in "
"spectator mode");
cl_hightrack = Cvar_Get ("cl_hightrack", "0", CVAR_NONE, NULL, "view the "
"player who has the most frags while you are in "
"spectator mode.");
} }

View file

@ -111,10 +111,10 @@ CL_StopPlayback (void)
void void
CL_WriteDemoCmd (usercmd_t *pcmd) CL_WriteDemoCmd (usercmd_t *pcmd)
{ {
byte c; byte c;
float fl; float fl;
int i; int i;
usercmd_t cmd; usercmd_t cmd;
// Con_Printf("write: %ld bytes, %4.4f\n", msg->cursize, realtime); // Con_Printf("write: %ld bytes, %4.4f\n", msg->cursize, realtime);
@ -151,9 +151,9 @@ CL_WriteDemoCmd (usercmd_t *pcmd)
void void
CL_WriteDemoMessage (sizebuf_t *msg) CL_WriteDemoMessage (sizebuf_t *msg)
{ {
byte c; byte c;
float fl; float fl;
int len; int len;
// Con_Printf("write: %ld bytes, %4.4f\n", msg->cursize, realtime); // Con_Printf("write: %ld bytes, %4.4f\n", msg->cursize, realtime);
@ -176,10 +176,10 @@ CL_WriteDemoMessage (sizebuf_t *msg)
qboolean qboolean
CL_GetDemoMessage (void) CL_GetDemoMessage (void)
{ {
byte c; byte c;
float demotime, f; float demotime, f;
static float cached_demotime; static float cached_demotime;
int r, i, j; int r, i, j;
usercmd_t *pcmd; usercmd_t *pcmd;
// read the time from the packet // read the time from the packet
@ -259,7 +259,8 @@ CL_GetDemoMessage (void)
case dem_read: case dem_read:
// get the next message // get the next message
Qread (cls.demofile, &net_message->message->cursize, 4); Qread (cls.demofile, &net_message->message->cursize, 4);
net_message->message->cursize = LittleLong (net_message->message->cursize); net_message->message->cursize = LittleLong
(net_message->message->cursize);
// Con_Printf("read: %ld bytes\n", net_message->message->cursize); // Con_Printf("read: %ld bytes\n", net_message->message->cursize);
if (net_message->message->cursize > MAX_MSGLEN) if (net_message->message->cursize > MAX_MSGLEN)
// Sys_Error ("Demo message > MAX_MSGLEN"); // Sys_Error ("Demo message > MAX_MSGLEN");
@ -341,9 +342,9 @@ CL_Stop_f (void)
void void
CL_WriteRecordDemoMessage (sizebuf_t *msg, int seq) CL_WriteRecordDemoMessage (sizebuf_t *msg, int seq)
{ {
byte c; byte c;
float fl; float fl;
int len, i; int len, i;
// Con_Printf("write: %ld bytes, %4.4f\n", msg->cursize, realtime); // Con_Printf("write: %ld bytes, %4.4f\n", msg->cursize, realtime);
@ -371,9 +372,9 @@ CL_WriteRecordDemoMessage (sizebuf_t *msg, int seq)
void void
CL_WriteSetDemoMessage (void) CL_WriteSetDemoMessage (void)
{ {
byte c; byte c;
float fl; float fl;
int len; int len;
// Con_Printf("write: %ld bytes, %4.4f\n", msg->cursize, realtime); // Con_Printf("write: %ld bytes, %4.4f\n", msg->cursize, realtime);
@ -402,14 +403,14 @@ CL_WriteSetDemoMessage (void)
void void
CL_Record_f (void) CL_Record_f (void)
{ {
char buf_data[MAX_MSGLEN], name[MAX_OSPATH]; char buf_data[MAX_MSGLEN], name[MAX_OSPATH];
char *s; char *s;
int c, n, i, j; int c, n, i, j;
int seq = 1; int seq = 1;
entity_t *ent; entity_t *ent;
entity_state_t *es, blankes; entity_state_t *es, blankes;
player_info_t *player; player_info_t *player;
sizebuf_t buf; sizebuf_t buf;
extern char gamedirfile[]; extern char gamedirfile[];
@ -683,8 +684,8 @@ CL_Record_f (void)
void void
CL_ReRecord_f (void) CL_ReRecord_f (void)
{ {
char name[MAX_OSPATH]; char name[MAX_OSPATH];
int c; int c;
c = Cmd_Argc (); c = Cmd_Argc ();
if (c != 2) { if (c != 2) {
@ -726,7 +727,7 @@ CL_ReRecord_f (void)
void void
CL_PlayDemo_f (void) CL_PlayDemo_f (void)
{ {
char name[MAX_OSPATH]; char name[MAX_OSPATH];
if (Cmd_Argc () != 2) { if (Cmd_Argc () != 2) {
Con_Printf ("play <demoname> : plays a demo\n"); Con_Printf ("play <demoname> : plays a demo\n");
@ -758,8 +759,8 @@ CL_PlayDemo_f (void)
void void
CL_FinishTimeDemo (void) CL_FinishTimeDemo (void)
{ {
float time; float time;
int frames; int frames;
cls.timedemo = false; cls.timedemo = false;
@ -841,11 +842,11 @@ CL_TimeFrames_AddTimestamp (void)
void CL_TimeFrames_DumpLog (void) void CL_TimeFrames_DumpLog (void)
{ {
char e_path[MAX_OSPATH]; char e_path[MAX_OSPATH];
char *filename = "timeframes.txt"; char *filename = "timeframes.txt";
long frame; int i;
int i; long frame;
VFile *outputfile; VFile *outputfile;
if (cl_timeframes_isactive == 0) if (cl_timeframes_isactive == 0)
return; return;

View file

@ -57,9 +57,6 @@
#include "r_dynamic.h" #include "r_dynamic.h"
#include "view.h" #include "view.h"
extern cvar_t *cl_predict_players;
extern cvar_t *cl_solid_players;
static struct predicted_player { static struct predicted_player {
int flags; int flags;
qboolean active; qboolean active;
@ -70,11 +67,14 @@ entity_t cl_packet_ents[512]; // FIXME: magic number
entity_t cl_flag_ents[MAX_CLIENTS]; entity_t cl_flag_ents[MAX_CLIENTS];
entity_t cl_player_ents[MAX_CLIENTS]; entity_t cl_player_ents[MAX_CLIENTS];
extern cvar_t *cl_predict_players;
extern cvar_t *cl_solid_players;
void void
CL_ClearEnts () CL_ClearEnts ()
{ {
int i; int i;
for (i = 0; i < sizeof (cl_packet_ents) / sizeof (cl_packet_ents[0]); i++) for (i = 0; i < sizeof (cl_packet_ents) / sizeof (cl_packet_ents[0]); i++)
CL_Init_Entity (&cl_packet_ents[i]); CL_Init_Entity (&cl_packet_ents[i]);
@ -87,7 +87,7 @@ CL_ClearEnts ()
void void
CL_NewDlight (int key, vec3_t org, int effects) CL_NewDlight (int key, vec3_t org, int effects)
{ {
float radius; float radius;
dlight_t *dl; dlight_t *dl;
static vec3_t normal = {0.4, 0.2, 0.05}; static vec3_t normal = {0.4, 0.2, 0.05};
static vec3_t red = {0.5, 0.05, 0.05}; static vec3_t red = {0.5, 0.05, 0.05};
@ -134,7 +134,7 @@ int bitcounts[32]; // / just for protocol profiling
void void
CL_ParseDelta (entity_state_t *from, entity_state_t *to, int bits) CL_ParseDelta (entity_state_t *from, entity_state_t *to, int bits)
{ {
int i; int i;
// set everything to the state we are delta'ing from // set everything to the state we are delta'ing from
*to = *from; *to = *from;
@ -234,8 +234,8 @@ CL_ParseDelta (entity_state_t *from, entity_state_t *to, int bits)
void void
FlushEntityPacket (void) FlushEntityPacket (void)
{ {
entity_state_t olde, newe; entity_state_t olde, newe;
int word; int word;
Con_DPrintf ("FlushEntityPacket\n"); Con_DPrintf ("FlushEntityPacket\n");
@ -268,10 +268,10 @@ FlushEntityPacket (void)
void void
CL_ParsePacketEntities (qboolean delta) CL_ParsePacketEntities (qboolean delta)
{ {
byte from; byte from;
int oldindex, newindex, newnum, oldnum, oldpacket, newpacket, word; int oldindex, newindex, newnum, oldnum, oldpacket, newpacket, word;
packet_entities_t *oldp, *newp, dummy; packet_entities_t *oldp, *newp, dummy;
qboolean full; qboolean full;
newpacket = cls.netchan.incoming_sequence & UPDATE_MASK; newpacket = cls.netchan.incoming_sequence & UPDATE_MASK;
newp = &cl.frames[newpacket].packet_entities; newp = &cl.frames[newpacket].packet_entities;
@ -394,14 +394,15 @@ CL_ParsePacketEntities (qboolean delta)
void void
CL_LinkPacketEntities (void) CL_LinkPacketEntities (void)
{ {
dlight_t *dl; int pnum, i;
entity_t **ent; dlight_t *dl;
entity_t **ent;
entity_state_t *s1; entity_state_t *s1;
int pnum, i; model_t *model;
packet_entities_t *pack;
extern int cl_h_playerindex, cl_gib1index, cl_gib2index, cl_gib3index; extern int cl_h_playerindex, cl_gib1index, cl_gib2index, cl_gib3index;
extern int cl_playerindex; extern int cl_playerindex;
model_t *model;
packet_entities_t *pack;
pack = &cl.frames[cls.netchan.incoming_sequence & pack = &cl.frames[cls.netchan.incoming_sequence &
UPDATE_MASK].packet_entities; UPDATE_MASK].packet_entities;
@ -566,8 +567,8 @@ CL_ClearProjectiles (void)
void void
CL_ParseProjectiles (void) CL_ParseProjectiles (void)
{ {
int i, c, j; byte bits[6];
byte bits[6]; int i, c, j;
projectile_t *pr; projectile_t *pr;
c = MSG_ReadByte (net_message); c = MSG_ReadByte (net_message);
@ -593,8 +594,8 @@ CL_ParseProjectiles (void)
void void
CL_LinkProjectiles (void) CL_LinkProjectiles (void)
{ {
int i;
entity_t **ent; entity_t **ent;
int i;
projectile_t *pr; projectile_t *pr;
for (i = 0, pr = cl_projectiles; i < cl_num_projectiles; i++, pr++) { for (i = 0, pr = cl_projectiles; i < cl_num_projectiles; i++, pr++) {
@ -628,7 +629,7 @@ extern int cl_spikeindex, cl_playerindex, cl_flagindex, parsecountmod;
void void
CL_ParsePlayerinfo (void) CL_ParsePlayerinfo (void)
{ {
int flags, msec, num, i; int flags, msec, num, i;
player_state_t *state; player_state_t *state;
num = MSG_ReadByte (net_message); num = MSG_ReadByte (net_message);
@ -697,10 +698,10 @@ CL_ParsePlayerinfo (void)
void void
CL_AddFlagModels (entity_t *ent, int team) CL_AddFlagModels (entity_t *ent, int team)
{ {
float f;
int i;
entity_t **newent; entity_t **newent;
float f; vec3_t v_forward, v_right, v_up;
int i;
vec3_t v_forward, v_right, v_up;
if (cl_flagindex == -1) if (cl_flagindex == -1)
return; return;
@ -772,14 +773,14 @@ CL_AddFlagModels (entity_t *ent, int team)
void void
CL_LinkPlayers (void) CL_LinkPlayers (void)
{ {
double playertime; double playertime;
entity_t **ent; int msec, oldphysent, i, j;
frame_t *frame; entity_t **ent;
int msec, oldphysent, i, j; frame_t *frame;
player_info_t *info; player_info_t *info;
player_state_t exact; player_state_t exact;
player_state_t *state; player_state_t *state;
vec3_t org; vec3_t org;
playertime = realtime - cls.latency + 0.02; playertime = realtime - cls.latency + 0.02;
if (playertime > realtime) if (playertime > realtime)
@ -891,10 +892,10 @@ CL_LinkPlayers (void)
void void
CL_SetSolidEntities (void) CL_SetSolidEntities (void)
{ {
entity_state_t *state; int i;
frame_t *frame; entity_state_t *state;
int i; frame_t *frame;
packet_entities_t *pak; packet_entities_t *pak;
pmove.physents[0].model = cl.worldmodel; pmove.physents[0].model = cl.worldmodel;
VectorCopy (vec3_origin, pmove.physents[0].origin); VectorCopy (vec3_origin, pmove.physents[0].origin);
@ -934,10 +935,10 @@ CL_SetSolidEntities (void)
void void
CL_SetUpPlayerPrediction (qboolean dopred) CL_SetUpPlayerPrediction (qboolean dopred)
{ {
double playertime; double playertime;
frame_t *frame; frame_t *frame;
int msec, j; int msec, j;
player_state_t exact; player_state_t exact;
player_state_t *state; player_state_t *state;
struct predicted_player *pplayer; struct predicted_player *pplayer;
@ -997,8 +998,8 @@ CL_SetUpPlayerPrediction (qboolean dopred)
void void
CL_SetSolidPlayers (int playernum) CL_SetSolidPlayers (int playernum)
{ {
int j; int j;
physent_t *pent; physent_t *pent;
struct predicted_player *pplayer; struct predicted_player *pplayer;
extern vec3_t player_maxs, player_mins; extern vec3_t player_maxs, player_mins;

View file

@ -34,8 +34,8 @@
#include "QF/sys.h" #include "QF/sys.h"
#include "host.h"
#include "compat.h" #include "compat.h"
#include "host.h"
qboolean qboolean
@ -47,8 +47,8 @@ ServerPaused (void)
void void
SV_Error (char *error, ...) SV_Error (char *error, ...)
{ {
va_list argptr; static char string[1024];
static char string[1024]; va_list argptr;
va_start (argptr, error); va_start (argptr, error);
vsnprintf (string, sizeof (string), error, argptr); vsnprintf (string, sizeof (string), error, argptr);

View file

@ -89,7 +89,7 @@ CL_PredictUsercmd (player_state_t * from, player_state_t * to, usercmd_t *u,
PlayerMove (); PlayerMove ();
// for (i=0 ; i<3 ; i++) // for (i=0 ; i<3 ; i++)
// pmove.origin[i] = ((int)(pmove.origin[i]*8))*0.125; // pmove.origin[i] = ((int)(pmove.origin[i] * 8)) * 0.125;
to->waterjumptime = pmove.waterjumptime; to->waterjumptime = pmove.waterjumptime;
to->oldbuttons = pmove.oldbuttons; // Tonik to->oldbuttons = pmove.oldbuttons; // Tonik
// to->oldbuttons = pmove.cmd.buttons; // to->oldbuttons = pmove.cmd.buttons;
@ -104,8 +104,8 @@ void
CL_PredictMove (void) CL_PredictMove (void)
{ {
float f; float f;
frame_t *from, *to = NULL;
int oldphysent, i; int oldphysent, i;
frame_t *from, *to = NULL;
if (cl_pushlatency->value > 0) if (cl_pushlatency->value > 0)
Cvar_Set (cl_pushlatency, "0"); Cvar_Set (cl_pushlatency, "0");
@ -215,10 +215,10 @@ CL_PredictMove (void)
void void
CL_Prediction_Init_Cvars (void) CL_Prediction_Init_Cvars (void)
{ {
cl_pushlatency = Cvar_Get ("pushlatency", "-999", CVAR_NONE, NULL,
"How much prediction should the client make");
cl_nopred = Cvar_Get ("cl_nopred", "0", CVAR_NONE, NULL, cl_nopred = Cvar_Get ("cl_nopred", "0", CVAR_NONE, NULL,
"Set to turn off client prediction"); "Set to turn off client prediction");
cl_nostatpred = Cvar_Get ("cl_nostatpred", "0", CVAR_NONE, NULL, cl_nostatpred = Cvar_Get ("cl_nostatpred", "0", CVAR_NONE, NULL,
"Set to turn off static player prediction"); "Set to turn off static player prediction");
cl_pushlatency = Cvar_Get ("pushlatency", "-999", CVAR_NONE, NULL,
"How much prediction should the client make");
} }

View file

@ -100,8 +100,8 @@ extern cvar_t *vid_gamma;
float float
V_CalcRoll (vec3_t angles, vec3_t velocity) V_CalcRoll (vec3_t angles, vec3_t velocity)
{ {
float side, sign, value; float side, sign, value;
vec3_t forward, right, up; vec3_t forward, right, up;
AngleVectors (angles, forward, right, up); AngleVectors (angles, forward, right, up);
side = DotProduct (velocity, right); side = DotProduct (velocity, right);
@ -121,9 +121,9 @@ V_CalcRoll (vec3_t angles, vec3_t velocity)
float float
V_CalcBob (void) V_CalcBob (void)
{ {
static double bobtime; static double bobtime;
float cycle; float cycle;
static float bob; static float bob;
if (cl.spectator) if (cl.spectator)
return 0; return 0;
@ -191,7 +191,7 @@ V_StopPitchDrift (void)
void void
V_DriftPitch (void) V_DriftPitch (void)
{ {
float delta, move; float delta, move;
if (view_message->onground == -1 || cls.demoplayback) { if (view_message->onground == -1 || cls.demoplayback) {
cl.driftmove = 0; cl.driftmove = 0;
@ -246,9 +246,9 @@ V_DriftPitch (void)
void void
V_ParseDamage (void) V_ParseDamage (void)
{ {
float count, side; float count, side;
int armor, blood, i; int armor, blood, i;
vec3_t forward, from, right, up; vec3_t forward, from, right, up;
armor = MSG_ReadByte (net_message); armor = MSG_ReadByte (net_message);
blood = MSG_ReadByte (net_message); blood = MSG_ReadByte (net_message);
@ -408,12 +408,12 @@ V_CalcPowerupCshift (void)
void void
V_CalcBlend (void) V_CalcBlend (void)
{ {
float a2, a3; float a2, a3;
float r = 0, g = 0, b = 0, a = 0; float r = 0, g = 0, b = 0, a = 0;
int i; int i;
for (i = 0; i < NUM_CSHIFTS; i++) { for (i = 0; i < NUM_CSHIFTS; i++) {
a2 = cl.cshifts[i].percent / 255.0; a2 = cl.cshifts[i].percent * (1.0 / 255.0);
if (!a2) if (!a2)
continue; continue;
@ -435,16 +435,16 @@ V_CalcBlend (void)
b *= a2; b *= a2;
} }
v_blend[0] = min (r, 255.0) / 255.0; v_blend[0] = min (r, 255.0) * (1.0 / 255.0);
v_blend[1] = min (g, 255.0) / 255.0; v_blend[1] = min (g, 255.0) * (1.0 / 255.0);
v_blend[2] = min (b, 255.0) / 255.0; v_blend[2] = min (b, 255.0) * (1.0 / 255.0);
v_blend[3] = bound (0.0, a, 1.0); v_blend[3] = bound (0.0, a, 1.0);
} }
void void
V_PrepBlend (void) V_PrepBlend (void)
{ {
int i, j; int i, j;
if (cl_cshift_powerup->int_val if (cl_cshift_powerup->int_val
|| (atoi (Info_ValueForKey (cl.serverinfo, "cshifts")) || (atoi (Info_ValueForKey (cl.serverinfo, "cshifts"))
@ -583,7 +583,7 @@ V_AddIdle (void)
void void
V_CalcViewRoll (void) V_CalcViewRoll (void)
{ {
float side; float side;
side = V_CalcRoll (cl.simangles, cl.simvel); side = V_CalcRoll (cl.simangles, cl.simvel);
r_refdef.viewangles[ROLL] += side; r_refdef.viewangles[ROLL] += side;
@ -646,9 +646,9 @@ V_CalcRefdef (void)
// never let it sit exactly on a node line, because a water plane can // never let it sit exactly on a node line, because a water plane can
// disappear when viewed with the eye exactly on it. // disappear when viewed with the eye exactly on it.
// server protocol only specifies to 1/8 pixel, so add 1/16 in each axis // server protocol only specifies to 1/8 pixel, so add 1/16 in each axis
r_refdef.vieworg[0] += 1.0 / 16; r_refdef.vieworg[0] += (1.0 / 16.0);
r_refdef.vieworg[1] += 1.0 / 16; r_refdef.vieworg[1] += (1.0 / 16.0);
r_refdef.vieworg[2] += 1.0 / 16; r_refdef.vieworg[2] += (1.0 / 16.0);
VectorCopy (cl.simangles, r_refdef.viewangles); VectorCopy (cl.simangles, r_refdef.viewangles);
V_CalcViewRoll (); V_CalcViewRoll ();
@ -766,15 +766,15 @@ V_RenderView (void)
void void
V_Init (void) V_Init (void)
{ {
Cmd_AddCommand ("v_cshift", V_cshift_f, "This adjusts all of the colors "
"currently being displayed.\n"
"Used when you are underwater, hit, have the Ring of "
"Shadows, or Quad Damage. (v_cshift r g b intensity)");
Cmd_AddCommand ("bf", V_BonusFlash_f, "Background flash, used when you " Cmd_AddCommand ("bf", V_BonusFlash_f, "Background flash, used when you "
"pick up an item"); "pick up an item");
Cmd_AddCommand ("centerview", V_StartPitchDrift, "Centers the player's " Cmd_AddCommand ("centerview", V_StartPitchDrift, "Centers the player's "
"view ahead after +lookup or +lookdown \n" "view ahead after +lookup or +lookdown \n"
"Will not work while mlook is active or freelook is 1."); "Will not work while mlook is active or freelook is 1.");
Cmd_AddCommand ("v_cshift", V_cshift_f, "This adjusts all of the colors "
"currently being displayed.\n"
"Used when you are underwater, hit, have the Ring of "
"Shadows, or Quad Damage. (v_cshift r g b intensity)");
} }
void void