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 "sbar.h"
#define PM_SPECTATORMAXSPEED 500
#define PM_STOPSPEED 100
#define PM_MAXSPEED 320
#define PM_SPECTATORMAXSPEED 500
#define PM_STOPSPEED 100
#define PM_MAXSPEED 320
#define BUTTON_JUMP 2
#define BUTTON_ATTACK 1
#define MAX_ANGLE_TURN 10
@ -83,7 +83,7 @@ int autocam = CAM_NONE;
static void
vectoangles (vec3_t vec, vec3_t ang)
{
float forward, pitch, yaw;
float forward, pitch, yaw;
if (vec[1] == 0 && vec[0] == 0) {
yaw = 0;
@ -92,12 +92,12 @@ vectoangles (vec3_t vec, vec3_t ang)
else
pitch = 270;
} 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)
yaw += 360;
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)
pitch += 360;
}
@ -151,7 +151,7 @@ Cam_Unlock (void)
void
Cam_Lock (int playernum)
{
char st[40];
char st[40];
snprintf (st, sizeof (st), "ptrack %i", playernum);
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;
vectoangles (vec, v);
// v[0] = -v[0];
// v[0] = -v[0];
VectorCopy (v, pmove.angles);
VectorNormalize (vec);
VectorMA (player->origin, 800, vec, v);
@ -235,8 +235,7 @@ static qboolean
InitFlyby (player_state_t * self, player_state_t * player, int checkvis)
{
float f, max;
vec3_t vec, vec2;
vec3_t forward, right, up;
vec3_t forward, right, up, vec, vec2;
VectorCopy (player->viewangles, vec);
vec[0] = 0;
@ -324,8 +323,8 @@ InitFlyby (player_state_t * self, player_state_t * player, int checkvis)
static void
Cam_CheckHighTarget (void)
{
int i, j, max;
player_info_t *s;
int i, j, max;
player_info_t *s;
j = -1;
for (i = 0, max = -9999; i < MAX_CLIENTS; i++) {
@ -349,10 +348,10 @@ Cam_CheckHighTarget (void)
void
Cam_Track (usercmd_t *cmd)
{
float len;
frame_t *frame;
float len;
frame_t *frame;
player_state_t *player, *self;
vec3_t vec;
vec3_t vec;
if (!cl.spectator)
return;
@ -433,7 +432,7 @@ Cam_Track (usercmd_t *cmd)
static float
adjustang (float current, float ideal, float speed)
{
float move;
float move;
current = anglemod (current);
ideal = anglemod (ideal);
@ -466,9 +465,9 @@ adjustang (float current, float ideal, float speed)
void
Cam_SetView (void)
{
frame_t *frame;
frame_t *frame;
player_state_t *player, *self;
vec3_t vec, vec2;
vec3_t vec, vec2;
if (cls.state != ca_active || !cl.spectator || !autocam || !locked)
return;
@ -501,8 +500,8 @@ Cam_SetView (void)
void
Cam_FinishMove (usercmd_t *cmd)
{
int end, i;
player_info_t *s;
int end, i;
player_info_t *s;
if (cls.state != ca_active)
return;
@ -606,14 +605,14 @@ Cam_Reset (void)
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,
"highest camera pitch in spectator mode");
cl_camera_maxyaw = Cvar_Get ("cl_camera_maxyaw", "30", CVAR_NONE, NULL,
"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
CL_WriteDemoCmd (usercmd_t *pcmd)
{
byte c;
float fl;
int i;
usercmd_t cmd;
byte c;
float fl;
int i;
usercmd_t cmd;
// Con_Printf("write: %ld bytes, %4.4f\n", msg->cursize, realtime);
@ -151,9 +151,9 @@ CL_WriteDemoCmd (usercmd_t *pcmd)
void
CL_WriteDemoMessage (sizebuf_t *msg)
{
byte c;
float fl;
int len;
byte c;
float fl;
int len;
// Con_Printf("write: %ld bytes, %4.4f\n", msg->cursize, realtime);
@ -176,10 +176,10 @@ CL_WriteDemoMessage (sizebuf_t *msg)
qboolean
CL_GetDemoMessage (void)
{
byte c;
float demotime, f;
byte c;
float demotime, f;
static float cached_demotime;
int r, i, j;
int r, i, j;
usercmd_t *pcmd;
// read the time from the packet
@ -259,7 +259,8 @@ CL_GetDemoMessage (void)
case dem_read:
// get the next message
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);
if (net_message->message->cursize > MAX_MSGLEN)
// Sys_Error ("Demo message > MAX_MSGLEN");
@ -341,9 +342,9 @@ CL_Stop_f (void)
void
CL_WriteRecordDemoMessage (sizebuf_t *msg, int seq)
{
byte c;
float fl;
int len, i;
byte c;
float fl;
int len, i;
// Con_Printf("write: %ld bytes, %4.4f\n", msg->cursize, realtime);
@ -371,9 +372,9 @@ CL_WriteRecordDemoMessage (sizebuf_t *msg, int seq)
void
CL_WriteSetDemoMessage (void)
{
byte c;
float fl;
int len;
byte c;
float fl;
int len;
// Con_Printf("write: %ld bytes, %4.4f\n", msg->cursize, realtime);
@ -402,14 +403,14 @@ CL_WriteSetDemoMessage (void)
void
CL_Record_f (void)
{
char buf_data[MAX_MSGLEN], name[MAX_OSPATH];
char *s;
int c, n, i, j;
int seq = 1;
char buf_data[MAX_MSGLEN], name[MAX_OSPATH];
char *s;
int c, n, i, j;
int seq = 1;
entity_t *ent;
entity_state_t *es, blankes;
player_info_t *player;
sizebuf_t buf;
sizebuf_t buf;
extern char gamedirfile[];
@ -683,8 +684,8 @@ CL_Record_f (void)
void
CL_ReRecord_f (void)
{
char name[MAX_OSPATH];
int c;
char name[MAX_OSPATH];
int c;
c = Cmd_Argc ();
if (c != 2) {
@ -726,7 +727,7 @@ CL_ReRecord_f (void)
void
CL_PlayDemo_f (void)
{
char name[MAX_OSPATH];
char name[MAX_OSPATH];
if (Cmd_Argc () != 2) {
Con_Printf ("play <demoname> : plays a demo\n");
@ -758,8 +759,8 @@ CL_PlayDemo_f (void)
void
CL_FinishTimeDemo (void)
{
float time;
int frames;
float time;
int frames;
cls.timedemo = false;
@ -841,11 +842,11 @@ CL_TimeFrames_AddTimestamp (void)
void CL_TimeFrames_DumpLog (void)
{
char e_path[MAX_OSPATH];
char *filename = "timeframes.txt";
long frame;
int i;
VFile *outputfile;
char e_path[MAX_OSPATH];
char *filename = "timeframes.txt";
int i;
long frame;
VFile *outputfile;
if (cl_timeframes_isactive == 0)
return;

View file

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

View file

@ -34,8 +34,8 @@
#include "QF/sys.h"
#include "host.h"
#include "compat.h"
#include "host.h"
qboolean
@ -47,8 +47,8 @@ ServerPaused (void)
void
SV_Error (char *error, ...)
{
va_list argptr;
static char string[1024];
static char string[1024];
va_list argptr;
va_start (argptr, error);
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 ();
// 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->oldbuttons = pmove.oldbuttons; // Tonik
// to->oldbuttons = pmove.cmd.buttons;
@ -104,8 +104,8 @@ void
CL_PredictMove (void)
{
float f;
frame_t *from, *to = NULL;
int oldphysent, i;
frame_t *from, *to = NULL;
if (cl_pushlatency->value > 0)
Cvar_Set (cl_pushlatency, "0");
@ -215,10 +215,10 @@ CL_PredictMove (void)
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,
"Set to turn off client prediction");
cl_nostatpred = Cvar_Get ("cl_nostatpred", "0", CVAR_NONE, NULL,
"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
V_CalcRoll (vec3_t angles, vec3_t velocity)
{
float side, sign, value;
vec3_t forward, right, up;
float side, sign, value;
vec3_t forward, right, up;
AngleVectors (angles, forward, right, up);
side = DotProduct (velocity, right);
@ -121,9 +121,9 @@ V_CalcRoll (vec3_t angles, vec3_t velocity)
float
V_CalcBob (void)
{
static double bobtime;
float cycle;
static float bob;
static double bobtime;
float cycle;
static float bob;
if (cl.spectator)
return 0;
@ -191,7 +191,7 @@ V_StopPitchDrift (void)
void
V_DriftPitch (void)
{
float delta, move;
float delta, move;
if (view_message->onground == -1 || cls.demoplayback) {
cl.driftmove = 0;
@ -246,9 +246,9 @@ V_DriftPitch (void)
void
V_ParseDamage (void)
{
float count, side;
int armor, blood, i;
vec3_t forward, from, right, up;
float count, side;
int armor, blood, i;
vec3_t forward, from, right, up;
armor = MSG_ReadByte (net_message);
blood = MSG_ReadByte (net_message);
@ -408,12 +408,12 @@ V_CalcPowerupCshift (void)
void
V_CalcBlend (void)
{
float a2, a3;
float r = 0, g = 0, b = 0, a = 0;
int i;
float a2, a3;
float r = 0, g = 0, b = 0, a = 0;
int 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)
continue;
@ -435,16 +435,16 @@ V_CalcBlend (void)
b *= a2;
}
v_blend[0] = min (r, 255.0) / 255.0;
v_blend[1] = min (g, 255.0) / 255.0;
v_blend[2] = min (b, 255.0) / 255.0;
v_blend[0] = min (r, 255.0) * (1.0 / 255.0);
v_blend[1] = min (g, 255.0) * (1.0 / 255.0);
v_blend[2] = min (b, 255.0) * (1.0 / 255.0);
v_blend[3] = bound (0.0, a, 1.0);
}
void
V_PrepBlend (void)
{
int i, j;
int i, j;
if (cl_cshift_powerup->int_val
|| (atoi (Info_ValueForKey (cl.serverinfo, "cshifts"))
@ -583,7 +583,7 @@ V_AddIdle (void)
void
V_CalcViewRoll (void)
{
float side;
float side;
side = V_CalcRoll (cl.simangles, cl.simvel);
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
// disappear when viewed with the eye exactly on it.
// 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[1] += 1.0 / 16;
r_refdef.vieworg[2] += 1.0 / 16;
r_refdef.vieworg[0] += (1.0 / 16.0);
r_refdef.vieworg[1] += (1.0 / 16.0);
r_refdef.vieworg[2] += (1.0 / 16.0);
VectorCopy (cl.simangles, r_refdef.viewangles);
V_CalcViewRoll ();
@ -766,15 +766,15 @@ V_RenderView (void)
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 "
"pick up an item");
Cmd_AddCommand ("centerview", V_StartPitchDrift, "Centers the player's "
"view ahead after +lookup or +lookdown \n"
"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