the big cvar value -> int_val audit. seems to work ok

This commit is contained in:
Bill Currie 2000-10-17 03:17:42 +00:00
parent 4478b82af4
commit 2682888425
50 changed files with 332 additions and 332 deletions

View File

@ -118,7 +118,7 @@ qboolean Cam_DrawViewModel(void)
if (!cl.spectator)
return true;
if (autocam && locked && cl_chasecam->value)
if (autocam && locked && cl_chasecam->int_val)
return true;
return false;
}
@ -126,7 +126,7 @@ qboolean Cam_DrawViewModel(void)
// returns true if we should draw this player, we don't if we are chase camming
qboolean Cam_DrawPlayer(int playernum)
{
if (cl.spectator && autocam && locked && cl_chasecam->value &&
if (cl.spectator && autocam && locked && cl_chasecam->int_val &&
spec_track == playernum)
return false;
return true;
@ -345,7 +345,7 @@ void Cam_Track(usercmd_t *cmd)
if (!cl.spectator)
return;
if (cl_hightrack->value && !locked)
if (cl_hightrack->int_val && !locked)
Cam_CheckHighTarget();
if (!autocam || cls.state != ca_active)
@ -353,7 +353,7 @@ void Cam_Track(usercmd_t *cmd)
if (locked && (!cl.players[spec_track].name[0] || cl.players[spec_track].spectator)) {
locked = false;
if (cl_hightrack->value)
if (cl_hightrack->int_val)
Cam_CheckHighTarget();
else
Cam_Unlock();
@ -377,7 +377,7 @@ void Cam_Track(usercmd_t *cmd)
if (!locked || !autocam)
return;
if (cl_chasecam->value) {
if (cl_chasecam->int_val) {
cmd->forwardmove = cmd->sidemove = cmd->upmove = 0;
VectorCopy(player->viewangles, cl.viewangles);
@ -538,7 +538,7 @@ void Cam_FinishMove(usercmd_t *cmd)
return;
}
if (autocam && cl_hightrack->value) {
if (autocam && cl_hightrack->int_val) {
Cam_CheckHighTarget();
return;
}

View File

@ -520,10 +520,10 @@ void CL_LinkPacketEntities (void)
continue;
// Hack hack hack
if (cl_deadbodyfilter->value && s1->modelindex == cl_playerindex
if (cl_deadbodyfilter->int_val && s1->modelindex == cl_playerindex
&& ( (i=s1->frame)==49 || i==60 || i==69 || i==84 || i==93 || i==102) )
continue;
if (cl_gibfilter->value &&
if (cl_gibfilter->int_val &&
(s1->modelindex == cl_h_playerindex || s1->modelindex == cl_gib1index
|| s1->modelindex == cl_gib2index || s1->modelindex == cl_gib3index))
continue;
@ -936,7 +936,7 @@ void CL_LinkPlayers (void)
// FIXME: Use a findvar or something for gl_flashblend --KB
// spawn light flashes, even ones coming from invisible objects
if (!gl_flashblend->value || j != cl.playernum) {
if (!gl_flashblend->int_val || j != cl.playernum) {
if (j == cl.playernum) {
VectorCopy (cl.simorg, org);
@ -963,7 +963,7 @@ void CL_LinkPlayers (void)
continue;
// Hack hack hack
if (cl_deadbodyfilter->value && state->modelindex == cl_playerindex
if (cl_deadbodyfilter->int_val && state->modelindex == cl_playerindex
&& ( (i=state->frame)==49 || i==60 || i==69 || i==84 || i==93 || i==102) )
continue;
@ -1003,7 +1003,7 @@ void CL_LinkPlayers (void)
// only predict half the move to minimize overruns
msec = 500*(playertime - state->state_time);
if (msec <= 0 || (!cl_predict_players->value && !cl_predict_players2->value))
if (msec <= 0 || (!cl_predict_players->int_val && !cl_predict_players2->int_val))
{
VectorCopy (state->origin, ent->origin);
//Con_DPrintf ("nopredict\n");
@ -1124,7 +1124,7 @@ void CL_SetUpPlayerPrediction(qboolean dopred)
// only predict half the move to minimize overruns
msec = 500*(playertime - state->state_time);
if (msec <= 0 ||
(!cl_predict_players->value && !cl_predict_players2->value) ||
(!cl_predict_players->int_val && !cl_predict_players2->int_val) ||
!dopred)
{
VectorCopy (state->origin, pplayer->origin);
@ -1163,7 +1163,7 @@ void CL_SetSolidPlayers (int playernum)
struct predicted_player *pplayer;
physent_t *pent;
if (!cl_solid_players->value)
if (!cl_solid_players->int_val)
return;
pent = pmove.physents + pmove.numphysent;

View File

@ -145,7 +145,7 @@ void IN_KLookUp (void) {KeyUp(&in_klook);}
void IN_MLookDown (void) {KeyDown(&in_mlook);}
void IN_MLookUp (void) {
KeyUp(&in_mlook);
if ( !freelook && lookspring->value)
if ( !freelook && lookspring->int_val)
V_StartPitchDrift();
}
void IN_UpDown(void) {KeyDown(&in_up);}
@ -499,7 +499,7 @@ void CL_SendCmd (void)
if (cls.netchan.outgoing_sequence - cl.validsequence >= UPDATE_BACKUP-1)
cl.validsequence = 0;
if (cl.validsequence && !cl_nodelta->value && cls.state == ca_active &&
if (cl.validsequence && !cl_nodelta->int_val && cls.state == ca_active &&
!cls.demorecording)
{
cl.frames[cls.netchan.outgoing_sequence&UPDATE_MASK].delta_sequence = cl.validsequence;

View File

@ -1457,7 +1457,7 @@ qboolean Host_SimulationTime(float time)
if (oldrealtime > realtime)
oldrealtime = 0;
if (cl_maxfps->value)
if (cl_maxfps->int_val)
fps = max(30.0, min(cl_maxfps->value, 72.0));
else
fps = max(30.0, min(rate->value/80.0, 72.0));
@ -1540,12 +1540,12 @@ void Host_Frame (float time)
CL_EmitEntities ();
// update video
if (host_speeds->value)
if (host_speeds->int_val)
time1 = Sys_DoubleTime ();
SCR_UpdateScreen ();
if (host_speeds->value)
if (host_speeds->int_val)
time2 = Sys_DoubleTime ();
// update audio
@ -1559,7 +1559,7 @@ void Host_Frame (float time)
CDAudio_Update();
if (host_speeds->value)
if (host_speeds->int_val)
{
pass1 = (time1 - time3)*1000;
time3 = Sys_DoubleTime ();

View File

@ -609,11 +609,11 @@ void CL_ParseServerData (void)
//ZOID--run the autoexec.cfg in the gamedir
//if it exists
if (cflag) {
int cl_warncmd_val = cl_warncmd->value;
int cl_warncmd_val = cl_warncmd->int_val;
Cbuf_AddText ("cl_warncmd 0\n");
Cbuf_AddText ("exec config.cfg\n");
Cbuf_AddText ("exec frontend.cfg\n");
if (cl_autoexec->value) {
if (cl_autoexec->int_val) {
Cbuf_AddText ("exec autoexec.cfg\n");
}
snprintf(fn,sizeof(fn), "cl_warncmd %d\n", cl_warncmd_val);
@ -1093,7 +1093,7 @@ void CL_MuzzleFlash (void)
return;
// don't draw our own muzzle flash in gl if flashblending
if (i-1 == cl.playernum && gl_flashblend->value)
if (i-1 == cl.playernum && gl_flashblend->int_val)
return;
pl = &cl.frames[parsecountmod].playerstate[i-1];
@ -1112,7 +1112,7 @@ void CL_MuzzleFlash (void)
}
#define SHOWNET(x) if (cl_shownet->value == 2) Con_Printf ("%3i:%s\n", msg_readcount-1, x);
#define SHOWNET(x) if (cl_shownet->int_val == 2) Con_Printf ("%3i:%s\n", msg_readcount-1, x);
/*
=====================
CL_ParseServerMessage
@ -1132,9 +1132,9 @@ void CL_ParseServerMessage (void)
//
// if recording demos, copy the message out
//
if (cl_shownet->value == 1)
if (cl_shownet->int_val == 1)
Con_Printf ("%i ",net_message.cursize);
else if (cl_shownet->value == 2)
else if (cl_shownet->int_val == 2)
Con_Printf ("------------------\n");
@ -1188,7 +1188,7 @@ void CL_ParseServerMessage (void)
{
// TODO: cl_nofake 2 -- accept fake messages from teammates
char *p;
if (cl_nofake->value) {
if (cl_nofake->int_val) {
for (p = s; *p; p++)
if (*p == 13)
*p = '#';

View File

@ -171,7 +171,7 @@ void CL_PredictMove (void)
cls.state = ca_active;
}
if (cl_nopred->value)
if (cl_nopred->int_val)
{
VectorCopy (from->playerstate[cl.playernum].velocity, cl.simvel);
VectorCopy (from->playerstate[cl.playernum].origin, cl.simorg);

View File

@ -402,7 +402,7 @@ void Cmd_Exec_f (void)
Con_Printf ("couldn't exec %s\n",Cmd_Argv(1));
return;
}
if (!Cvar_Command () && (cl_warncmd->value || developer->value))
if (!Cvar_Command () && (cl_warncmd->int_val || developer->int_val))
Con_Printf ("execing %s\n",Cmd_Argv(1));
Cbuf_InsertText (f);
@ -878,7 +878,7 @@ void Cmd_ExecuteString (char *text)
}
}
if (cl_warncmd->value || developer->value)
if (cl_warncmd->int_val || developer->int_val)
Con_Printf ("Unknown command \"%s\"\n", Cmd_Argv(0));
}

View File

@ -416,7 +416,7 @@ void Con_DPrintf (char *fmt, ...)
va_list argptr;
char msg[MAXPRINTMSG];
if (!developer->value)
if (!developer->int_val)
return; // don't confuse non-developers with techie stuff...
va_start (argptr, fmt);

View File

@ -270,7 +270,7 @@ x11_set_vidmode(int width, int height)
}
Con_Printf ("hasvidmode = %i\nnummodes = %i\n", hasvidmode, nummodes);
if (hasvidmode && vid_fullscreen->value) {
if (hasvidmode && vid_fullscreen->int_val) {
int smallest_mode=0, x=INT_MAX, y=INT_MAX;
// FIXME: does this depend on mode line order in XF86Config?
@ -316,7 +316,7 @@ x11_create_window (int width, int height)
attr.event_mask = X_MASK;
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
if (hasvidmode && vid_fullscreen->value) {
if (hasvidmode && vid_fullscreen->int_val) {
attr.override_redirect=1;
mask|=CWOverrideRedirect;
}
@ -382,7 +382,7 @@ void
x11_grab_keyboard (void)
{
#ifdef HAVE_VIDMODE
if (hasvidmode && vid_fullscreen->value) {
if (hasvidmode && vid_fullscreen->int_val) {
XGrabKeyboard(x_disp, x_win, 1, GrabModeAsync, GrabModeAsync,
CurrentTime);
}

View File

@ -364,7 +364,7 @@ void Cvar_Toggle_f (void)
return;
}
Cvar_Set (var, var->value ? "0" : "1");
Cvar_Set (var, var->int_val ? "0" : "1");
}
void Cvar_Help_f (void)

View File

@ -194,7 +194,7 @@ void D_DrawSurfaces (void)
VectorCopy (transformed_modelorg, world_transformed_modelorg);
// TODO: could preset a lot of this at mode set time
if (r_drawflat->value)
if (r_drawflat->int_val)
{
for (s = &surfaces[1] ; s<surface_p ; s++)
{
@ -240,7 +240,7 @@ void D_DrawSurfaces (void)
d_zistepv = 0;
d_ziorigin = -0.9;
D_DrawSolidSurface (s, (int)r_clearcolor->value & 0xFF);
D_DrawSolidSurface (s, r_clearcolor->int_val & 0xFF);
D_DrawZSpans (s->spans);
}
else if (s->flags & SURF_DRAWTURB)

View File

@ -153,7 +153,7 @@ void D_SetupFrame (void)
d_scalemip[i] = basemip[i] * d_mipscale->value;
#ifdef USE_INTEL_ASM
if (d_subdiv16->value)
if (d_subdiv16->int_val)
d_drawspans = D_DrawSpans16;
else
d_drawspans = D_DrawSpans8;

View File

@ -304,11 +304,11 @@ void Draw_Crosshair(void)
int x, y;
extern cvar_t *crosshair, *cl_crossx, *cl_crossy, *crosshaircolor;
extern vrect_t scr_vrect;
byte c = (byte)crosshaircolor->value;
byte c = crosshaircolor->int_val;
if (crosshair->value == 2) {
x = scr_vrect.x + scr_vrect.width/2 + cl_crossx->value;
y = scr_vrect.y + scr_vrect.height/2 + cl_crossy->value;
if (crosshair->int_val == 2) {
x = scr_vrect.x + scr_vrect.width/2 + cl_crossx->int_val;
y = scr_vrect.y + scr_vrect.height/2 + cl_crossy->int_val;
Draw_Pixel(x - 1, y, c);
Draw_Pixel(x - 3, y, c);
Draw_Pixel(x + 1, y, c);
@ -317,10 +317,10 @@ void Draw_Crosshair(void)
Draw_Pixel(x, y - 3, c);
Draw_Pixel(x, y + 1, c);
Draw_Pixel(x, y + 3, c);
} else if (crosshair->value)
} else if (crosshair->int_val)
Draw_Character8 (
scr_vrect.x + scr_vrect.width/2-4 + cl_crossx->value,
scr_vrect.y + scr_vrect.height/2-4 + cl_crossy->value,
scr_vrect.x + scr_vrect.width/2-4 + cl_crossx->int_val,
scr_vrect.y + scr_vrect.height/2-4 + cl_crossy->int_val,
'+');
}

View File

@ -426,7 +426,7 @@ void Draw_Init (void)
// LordHavoc: 3DFX's dithering has terrible artifacting when using lightmode 1
if (!strncasecmp ((char *)gl_renderer, "3dfx",4))
Cvar_Set (gl_lightmode, "0");
lighthalf = gl_lightmode->value != 0; // to avoid re-rendering all lightmaps on first frame
lighthalf = gl_lightmode->int_val != 0; // to avoid re-rendering all lightmaps on first frame
if (lighthalf) {
lighthalf_v[0] = lighthalf_v[1] = lighthalf_v[2] = 128;
} else {
@ -553,20 +553,20 @@ void Draw_Crosshair(void)
extern vrect_t scr_vrect;
unsigned char *pColor;
switch ((int) crosshair->value) {
switch (crosshair->int_val) {
case 0:
break;
case 1:
default:
Draw_Character8 (
scr_vrect.x + scr_vrect.width/2-4 + cl_crossx->value,
scr_vrect.y + scr_vrect.height/2-4 + cl_crossy->value, '+');
scr_vrect.x + scr_vrect.width/2-4 + cl_crossx->int_val,
scr_vrect.y + scr_vrect.height/2-4 + cl_crossy->int_val, '+');
break;
case 2:
x = scr_vrect.x + scr_vrect.width/2 - 3 + cl_crossx->value;
y = scr_vrect.y + scr_vrect.height/2 - 3 + cl_crossy->value;
x = scr_vrect.x + scr_vrect.width/2 - 3 + cl_crossx->int_val;
y = scr_vrect.y + scr_vrect.height/2 - 3 + cl_crossy->int_val;
pColor = (unsigned char *) &d_8to24table[(byte) crosshaircolor->value];
pColor = (unsigned char *) &d_8to24table[crosshaircolor->int_val];
if (lighthalf)
glColor4ub((byte) ((int) pColor[0] >> 1),(byte) ((int) pColor[1] >> 1), (byte) ((int) pColor[2] >> 1), pColor[3]);
else
@ -1094,11 +1094,11 @@ static void GL_Upload32 (unsigned int *data, int width, int height, qboolean mip
for (scaled_width = 1 ; scaled_width < width ; scaled_width<<=1) ;
for (scaled_height = 1 ; scaled_height < height ; scaled_height<<=1) ;
scaled_width >>= (int)gl_picmip->value;
scaled_height >>= (int)gl_picmip->value;
scaled_width >>= gl_picmip->int_val;
scaled_height >>= gl_picmip->int_val;
scaled_width = min(scaled_width, gl_max_size->value);
scaled_height = min(scaled_height, gl_max_size->value);
scaled_width = min(scaled_width, gl_max_size->int_val);
scaled_height = min(scaled_height, gl_max_size->int_val);
if (!(scaled = malloc(scaled_width * scaled_height * 4 * sizeof(unsigned int))))
Sys_Error ("GL_LoadTexture: too big");
@ -1153,11 +1153,11 @@ void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboole
for (scaled_width = 1 ; scaled_width < width ; scaled_width<<=1) ;
for (scaled_height = 1 ; scaled_height < height ; scaled_height<<=1) ;
scaled_width >>= (int)gl_picmip->value;
scaled_height >>= (int)gl_picmip->value;
scaled_width >>= gl_picmip->int_val;
scaled_height >>= gl_picmip->int_val;
scaled_width = min(scaled_width, gl_max_size->value);
scaled_height = min(scaled_height, gl_max_size->value);
scaled_width = min(scaled_width, gl_max_size->int_val);
scaled_height = min(scaled_height, gl_max_size->int_val);
if (!(scaled = malloc(scaled_width * scaled_height)))
Sys_Error ("GL_LoadTexture: too big");

View File

@ -182,7 +182,7 @@ void R_ParticleExplosion (vec3_t org)
int i, j;
particle_t *p;
if (!gl_particles->value)
if (!gl_particles->int_val)
return;
for (i=0 ; i<1024 ; i++)
@ -229,7 +229,7 @@ void R_BlobExplosion (vec3_t org)
int i, j;
particle_t *p;
if (!gl_particles->value)
if (!gl_particles->int_val)
return;
for (i=0 ; i<1024 ; i++)
@ -278,7 +278,7 @@ void R_RunParticleEffect (vec3_t org, vec3_t dir, int color, int count)
particle_t *p;
int scale;
if (!gl_particles->value)
if (!gl_particles->int_val)
return;
if (count > 130)
@ -322,7 +322,7 @@ void R_LavaSplash (vec3_t org)
float vel;
vec3_t dir;
if (!gl_particles->value)
if (!gl_particles->int_val)
return;
for (i=-16 ; i<16 ; i++)
@ -367,7 +367,7 @@ void R_TeleportSplash (vec3_t org)
float vel;
vec3_t dir;
if (!gl_particles->value)
if (!gl_particles->int_val)
return;
for (i=-16 ; i<16 ; i+=4)
@ -409,7 +409,7 @@ void R_RocketTrail (vec3_t start, vec3_t end, int type, entity_t *ent)
if (type == 0)
R_AddFire (start, end, ent);
if (!gl_particles->value)
if (!gl_particles->int_val)
return;
VectorSubtract (end, start, vec);
@ -674,7 +674,7 @@ R_AddFire (vec3_t start, vec3_t end, entity_t *ent)
vec3_t vec;
int key;
if (!gl_fires->value)
if (!gl_fires->int_val)
return;
VectorSubtract (end, start, vec);
@ -808,7 +808,7 @@ R_UpdateFires (void)
int i;
fire_t *f;
if (!gl_fires->value)
if (!gl_fires->int_val)
return;
glDepthMask(GL_FALSE);

View File

@ -179,7 +179,7 @@ void R_RenderDlights (void)
int i;
dlight_t *l;
if (!gl_flashblend->value)
if (!gl_flashblend->int_val)
return;
r_dlightframecount = r_framecount + 1; // because the count hasn't
@ -187,7 +187,7 @@ void R_RenderDlights (void)
glDepthMask(GL_FALSE);
glDisable (GL_TEXTURE_2D);
glBlendFunc (GL_ONE, GL_ONE);
if (gl_smoothdlights->value)
if (gl_smoothdlights->int_val)
glShadeModel (GL_SMOOTH);
l = cl_dlights;
@ -198,7 +198,7 @@ void R_RenderDlights (void)
R_RenderDlight (l);
}
if (!gl_smooth->value)
if (!gl_smooth->int_val)
glShadeModel (GL_FLAT);
glColor3ubv(lighthalf_v);
glEnable (GL_TEXTURE_2D);

View File

@ -573,7 +573,7 @@ static void R_DrawAliasModel (entity_t *e)
if (!strcmp(clmodel->name, "progs/player.mdl"))
{
shadelight = max(shadelight, 8);
} else if (!gl_fb_models->value && (
} else if (!gl_fb_models->int_val && (
!strcmp (clmodel->name, "progs/flame.mdl") ||
!strcmp (clmodel->name, "progs/flame2.mdl"))) {
// HACK HACK HACK -- no fullbright colors, so make torches full light
@ -620,7 +620,7 @@ static void R_DrawAliasModel (entity_t *e)
// we can't dynamically colormap textures, so they are cached
// seperately for the players. Heads are just uncolored.
if (currententity->scoreboard && !gl_nocolors->value)
if (currententity->scoreboard && !gl_nocolors->int_val)
{
i = currententity->scoreboard - cl.players;
if (!currententity->scoreboard->skin)
@ -632,24 +632,24 @@ static void R_DrawAliasModel (entity_t *e)
glBindTexture (GL_TEXTURE_2D, playertextures + i);
}
if (gl_affinemodels->value)
if (gl_affinemodels->int_val)
glHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
R_SetupAliasFrame (currententity->frame, paliashdr, false);
// This block is GL fullbright support for objects...
if (clmodel->hasfullbrights && gl_fb_models->value &&
if (clmodel->hasfullbrights && gl_fb_models->int_val &&
paliashdr->gl_fb_texturenum[currententity->skinnum][anim]) {
glBindTexture (GL_TEXTURE_2D, paliashdr->gl_fb_texturenum[currententity->skinnum][anim]);
R_SetupAliasFrame (currententity->frame, paliashdr, true);
}
if (gl_affinemodels->value)
if (gl_affinemodels->int_val)
glHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
glPopMatrix ();
if (r_shadows->value)
if (r_shadows->int_val)
{
glPushMatrix ();
R_RotateForEntity (e);
@ -674,7 +674,7 @@ static void R_DrawEntitiesOnList (void)
{
int i;
if (!r_drawentities->value)
if (!r_drawentities->int_val)
return;
// LordHavoc: split into 3 loops to simplify state changes
@ -717,10 +717,10 @@ R_DrawViewModel
static void R_DrawViewModel (void)
{
currententity = &cl.viewent;
if (!r_drawviewmodel->value
if (!r_drawviewmodel->int_val
|| !Cam_DrawViewModel()
|| envmap
|| !r_drawentities->value
|| !r_drawentities->int_val
|| (cl.stats[STAT_ITEMS] & IT_INVISIBILITY)
|| cl.stats[STAT_HEALTH] <= 0
|| !currententity->model)
@ -899,7 +899,7 @@ static void R_SetupGL (void)
//
// set drawing parms
//
if (gl_cull->value)
if (gl_cull->int_val)
glEnable (GL_CULL_FACE);
else
glDisable (GL_CULL_FACE);
@ -907,7 +907,7 @@ static void R_SetupGL (void)
glDisable (GL_ALPHA_TEST);
glAlphaFunc (GL_GREATER, 0.5);
glEnable (GL_DEPTH_TEST);
if (gl_smooth->value)
if (gl_smooth->int_val)
glShadeModel (GL_SMOOTH);
else
glShadeModel (GL_FLAT);
@ -949,7 +949,7 @@ R_Clear
*/
static void R_Clear (void)
{
if (gl_clear->value)
if (gl_clear->int_val)
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
else
glClear (GL_DEPTH_BUFFER_BIT);
@ -969,7 +969,7 @@ r_refdef must be set before the first call
*/
void R_RenderView (void)
{
if (r_norefresh->value)
if (r_norefresh->int_val)
return;
if (!r_worldentity.model || !cl.worldmodel)

View File

@ -392,12 +392,12 @@ void R_TranslatePlayerSkin (int playernum)
#endif
// FIXME deek: This 512x256 limit sucks!
scaled_width = min(gl_max_size->value, 512);
scaled_height = min(gl_max_size->value, 256);
scaled_width = min(gl_max_size->int_val, 512);
scaled_height = min(gl_max_size->int_val, 256);
// allow users to crunch sizes down even more if they want
scaled_width >>= (int)gl_playermip->value;
scaled_height >>= (int)gl_playermip->value;
scaled_width >>= gl_playermip->int_val;
scaled_height >>= gl_playermip->int_val;
if (VID_Is8bit()) { // 8bit texture upload
byte *out2;

View File

@ -283,7 +283,7 @@ R_BuildLightMap (msurface_t *surf, byte *dest, int stride)
store:
// bound and shift
if (gl_colorlights->value) {
if (gl_colorlights->int_val) {
stride -= smax * 3;
bl = blocklights;
if (lighthalf) {
@ -432,7 +432,7 @@ void R_DrawMultitexturePoly (msurface_t *s)
glEnable(GL_TEXTURE_2D);
// check for lightmap modification
if (r_dynamic->value)
if (r_dynamic->int_val)
{
for (maps = 0;maps < MAXLIGHTMAPS && s->styles[maps] != 255;maps++)
if (d_lightstylevalue[s->styles[maps]] != s->cached_light[maps])
@ -593,7 +593,7 @@ void R_RenderBrushPoly (msurface_t *fa)
|| fa->cached_dlight) // dynamic previously
{
dynamic:
if (r_dynamic->value)
if (r_dynamic->int_val)
{
lightmap_modified[fa->lightmaptexturenum] = true;
theRect = &lightmap_rectchange[fa->lightmaptexturenum];
@ -771,7 +771,7 @@ void R_DrawBrushModel (entity_t *e)
// calculate dynamic lighting for bmodel if it's not an
// instanced model
if (clmodel->firstmodelsurface != 0 && !gl_flashblend->value)
if (clmodel->firstmodelsurface != 0 && !gl_flashblend->int_val)
{
vec3_t lightorigin;
for (k=0 ; k<MAX_DLIGHTS ; k++)
@ -814,17 +814,17 @@ void R_DrawBrushModel (entity_t *e)
{
if (psurf->flags & SURF_DRAWTURB)
GL_WaterSurface(psurf);
else if (gl_texsort->value)
else if (gl_texsort->int_val)
R_RenderBrushPoly (psurf);
else
R_DrawMultitexturePoly (psurf);
}
}
if (gl_texsort->value)
if (gl_texsort->int_val)
R_BlendLightmaps ();
if (gl_fb_bmodels->value)
if (gl_fb_bmodels->int_val)
R_RenderFullbrights ();
glPopMatrix ();
@ -935,7 +935,7 @@ void R_RecursiveWorldNode (mnode_t *node)
surf->texturechain = waterchain;
waterchain = surf;
}
else if (gl_texsort->value)
else if (gl_texsort->int_val)
{
surf->texturechain = surf->texinfo->texture->texturechain;
surf->texinfo->texture->texturechain = surf;
@ -983,10 +983,10 @@ void R_DrawWorld (void)
DrawTextureChains ();
if (gl_texsort->value)
if (gl_texsort->int_val)
R_BlendLightmaps ();
if (gl_fb_bmodels->value)
if (gl_fb_bmodels->int_val)
R_RenderFullbrights ();
}
@ -1003,13 +1003,13 @@ void R_MarkLeaves (void)
int i;
byte solid[4096];
if (r_oldviewleaf == r_viewleaf && !r_novis->value)
if (r_oldviewleaf == r_viewleaf && !r_novis->int_val)
return;
r_visframecount++;
r_oldviewleaf = r_viewleaf;
if (r_novis->value)
if (r_novis->int_val)
{
vis = solid;
memset (solid, 0xff, (cl.worldmodel->numleafs+7)>>3);
@ -1170,7 +1170,7 @@ void BuildSurfaceDisplayList (msurface_t *fa)
//
// remove co-linear points - Ed
//
if (!gl_keeptjunctions->value && !(fa->flags & SURF_UNDERWATER) )
if (!gl_keeptjunctions->int_val && !(fa->flags & SURF_UNDERWATER) )
{
for (i = 0 ; i < lnumverts ; ++i)
{
@ -1258,7 +1258,7 @@ void GL_BuildLightmaps (void)
gl_colorlights = Cvar_Get ("gl_colorlights", "1", CVAR_ROM,
"Whether to use RGB lightmaps or not");
if (gl_colorlights->value)
if (gl_colorlights->int_val)
{
gl_lightmap_format = GL_RGB;
lightmap_bytes = 3;
@ -1289,7 +1289,7 @@ void GL_BuildLightmaps (void)
}
}
if (gl_mtexable && !gl_texsort->value)
if (gl_mtexable && !gl_texsort->int_val)
qglSelectTexture (gl_mtex_enum+1);
//
@ -1312,7 +1312,7 @@ void GL_BuildLightmaps (void)
GL_UNSIGNED_BYTE, lightmaps[i]);
}
if (gl_mtexable && !gl_texsort->value)
if (gl_mtexable && !gl_texsort->int_val)
qglSelectTexture (gl_mtex_enum+0);
}

View File

@ -307,7 +307,7 @@ static void SCR_CalcRefdef (void)
//========================================
// bound viewsize
Cvar_SetValue (scr_viewsize, bound (30, scr_viewsize->value, 120));
Cvar_SetValue (scr_viewsize, bound (30, scr_viewsize->int_val, 120));
// bound field of view
Cvar_SetValue (scr_fov, bound (10, scr_fov->value, 170));
@ -316,7 +316,7 @@ static void SCR_CalcRefdef (void)
if (cl.intermission)
size = 120;
else
size = scr_viewsize->value;
size = scr_viewsize->int_val;
if (size >= 120)
sb_lines = 0; // no status bar at all
@ -325,11 +325,11 @@ static void SCR_CalcRefdef (void)
else
sb_lines = 24+16+8;
if (scr_viewsize->value >= 100.0) {
if (scr_viewsize->int_val >= 100) {
full = true;
size = 100.0;
} else {
size = scr_viewsize->value;
size = scr_viewsize->int_val;
}
if (cl.intermission)
{
@ -339,7 +339,7 @@ static void SCR_CalcRefdef (void)
}
size /= 100.0;
if (!cl_sbar->value && full)
if (!cl_sbar->int_val && full)
h = vid.height;
else
h = vid.height - sb_lines;
@ -352,7 +352,7 @@ static void SCR_CalcRefdef (void)
}
r_refdef.vrect.height = vid.height * size;
if (cl_sbar->value || !full) {
if (cl_sbar->int_val || !full) {
if (r_refdef.vrect.height > vid.height - sb_lines)
r_refdef.vrect.height = vid.height - sb_lines;
} else if (r_refdef.vrect.height > vid.height)
@ -379,7 +379,7 @@ Keybinding command
*/
void SCR_SizeUp_f (void)
{
Cvar_SetValue (scr_viewsize, scr_viewsize->value+10);
Cvar_SetValue (scr_viewsize, scr_viewsize->int_val+10);
vid.recalc_refdef = 1;
}
@ -394,7 +394,7 @@ Keybinding command
*/
void SCR_SizeDown_f (void)
{
Cvar_SetValue (scr_viewsize, scr_viewsize->value-10);
Cvar_SetValue (scr_viewsize, scr_viewsize->int_val-10);
vid.recalc_refdef = 1;
}
@ -446,7 +446,7 @@ void SCR_DrawTurtle (void)
{
static int count;
if (!scr_showturtle->value)
if (!scr_showturtle->int_val)
return;
if (host_frametime < 0.1)
@ -487,7 +487,7 @@ void SCR_DrawFPS (void)
int x, y;
char st[80];
if (!show_fps->value)
if (!show_fps->int_val)
return;
t = Sys_DoubleTime();
@ -513,7 +513,7 @@ void SCR_DrawPause (void)
{
qpic_t *pic;
if (!scr_showpause->value) // turn off for screenshots
if (!scr_showpause->int_val) // turn off for screenshots
return;
if (!cl.paused)
@ -1025,7 +1025,7 @@ void SCR_UpdateScreen (void)
if (block_drawing)
return;
vid.numpages = 2 + (int) gl_triplebuffer->value;
vid.numpages = 2 + gl_triplebuffer->int_val;
scr_copytop = 0;
scr_copyeverything = 0;
@ -1045,14 +1045,14 @@ void SCR_UpdateScreen (void)
return; // not initialized yet
if (oldsbar != cl_sbar->value) {
oldsbar = cl_sbar->value;
if (oldsbar != cl_sbar->int_val) {
oldsbar = cl_sbar->int_val;
vid.recalc_refdef = true;
}
GL_BeginRendering (&glx, &gly, &glwidth, &glheight);
if (r_speeds->value)
if (r_speeds->int_val)
{
time1 = Sys_DoubleTime ();
c_brush_polys = 0;
@ -1097,7 +1097,7 @@ void SCR_UpdateScreen (void)
//
SCR_TileClear ();
if (r_netgraph->value)
if (r_netgraph->int_val)
R_NetGraph ();
if (cl.intermission == 1 && key_dest == key_game) {
@ -1148,7 +1148,7 @@ void SCR_UpdateScreen (void)
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
Cvar_SetValue (contrast, bound (0.1, contrast->value, 1));
if ((gl_polyblend->value && v_blend[3]) || contrast->value < 0.999) // epsilon
if ((gl_polyblend->int_val && v_blend[3]) || contrast->value < 0.999) // epsilon
{
glBegin (GL_QUADS);
if (contrast->value < 0.999) // epsilon
@ -1160,7 +1160,7 @@ void SCR_UpdateScreen (void)
glVertex2f (0, vid.height);
}
if (gl_polyblend->value && v_blend[3])
if (gl_polyblend->int_val && v_blend[3])
{
glColor4fv (v_blend);
glVertex2f (0,0);
@ -1176,7 +1176,7 @@ void SCR_UpdateScreen (void)
V_UpdatePalette ();
if (r_speeds->value)
if (r_speeds->int_val)
{
// glFinish ();
time2 = Sys_DoubleTime ();

View File

@ -737,7 +737,7 @@ R_DrawSkyDome (void)
glEnable (GL_BLEND);
// clouds
if (gl_skymultipass->value) {
if (gl_skymultipass->int_val) {
glBindTexture (GL_TEXTURE_2D, alphaskytexture);
domescale[0] = 512;
domescale[1] = 512;

View File

@ -717,7 +717,7 @@ void IN_MouseMove (usercmd_t *cmd)
mouse_y *= sensitivity->value;
// add mouse X/Y movement to cmd
if ( (in_strafe.state & 1) || (lookstrafe->value && freelook))
if ( (in_strafe.state & 1) || (lookstrafe->int_val && freelook))
cmd->sidemove += m_side->value * mouse_x;
else
cl.viewangles[YAW] -= m_yaw->value * mouse_x;
@ -914,7 +914,7 @@ static void Joy_AdvancedUpdate_f (void)
pdwRawValue[i] = RawValuePointer(i);
}
if( joy_advanced->value == 0.0)
if( joy_advanced->int_val)
{
// default joystick initialization
// 2 axes only with joystick control
@ -933,22 +933,22 @@ static void Joy_AdvancedUpdate_f (void)
// advanced initialization here
// data supplied by user via joy_axisn cvars
dwTemp = (DWORD) joy_advaxisx->value;
dwTemp = joy_advaxisx->int_val;
dwAxisMap[JOY_AXIS_X] = dwTemp & 0x0000000f;
dwControlMap[JOY_AXIS_X] = dwTemp & JOY_RELATIVE_AXIS;
dwTemp = (DWORD) joy_advaxisy->value;
dwTemp = joy_advaxisy->int_val;
dwAxisMap[JOY_AXIS_Y] = dwTemp & 0x0000000f;
dwControlMap[JOY_AXIS_Y] = dwTemp & JOY_RELATIVE_AXIS;
dwTemp = (DWORD) joy_advaxisz->value;
dwTemp = joy_advaxisz->int_val;
dwAxisMap[JOY_AXIS_Z] = dwTemp & 0x0000000f;
dwControlMap[JOY_AXIS_Z] = dwTemp & JOY_RELATIVE_AXIS;
dwTemp = (DWORD) joy_advaxisr->value;
dwTemp = joy_advaxisr->int_val;
dwAxisMap[JOY_AXIS_R] = dwTemp & 0x0000000f;
dwControlMap[JOY_AXIS_R] = dwTemp & JOY_RELATIVE_AXIS;
dwTemp = (DWORD) joy_advaxisu->value;
dwTemp = joy_advaxisu->int_val;
dwAxisMap[JOY_AXIS_U] = dwTemp & 0x0000000f;
dwControlMap[JOY_AXIS_U] = dwTemp & JOY_RELATIVE_AXIS;
dwTemp = (DWORD) joy_advaxisv->value;
dwTemp = joy_advaxisv->int_val;
dwAxisMap[JOY_AXIS_V] = dwTemp & 0x0000000f;
dwControlMap[JOY_AXIS_V] = dwTemp & JOY_RELATIVE_AXIS;
}
@ -1052,7 +1052,7 @@ static qboolean IN_ReadJoystick (void)
// this is a hack -- there is a bug in the Logitech WingMan Warrior DirectInput Driver
// rather than having 32768 be the zero point, they have the zero point at 32668
// go figure -- anyway, now we get the full resolution out of the device
if (joy_wwhack1->value != 0.0)
if (joy_wwhack1->int_val)
{
ji.dwUpos += 100;
}
@ -1090,7 +1090,7 @@ static void IN_JoyMove (usercmd_t *cmd)
}
// verify joystick is available and that the user wants to use it
if (!joy_avail || !in_joystick->value)
if (!joy_avail || !in_joystick->int_val)
{
return;
}
@ -1115,7 +1115,7 @@ static void IN_JoyMove (usercmd_t *cmd)
// move centerpoint to zero
fAxisValue -= 32768.0;
if (joy_wwhack2->value != 0.0)
if (joy_wwhack2->int_val)
{
if (dwAxisMap[i] == AxisTurn)
{
@ -1137,7 +1137,7 @@ static void IN_JoyMove (usercmd_t *cmd)
switch (dwAxisMap[i])
{
case AxisForward:
if ((joy_advanced->value == 0.0) && freelook)
if (!joy_advanced->int_val && freelook)
{
// user wants forward control to become look control
if (fabs(fAxisValue) > joy_pitchthreshold->value)
@ -1160,7 +1160,7 @@ static void IN_JoyMove (usercmd_t *cmd)
// disable pitch return-to-center unless requested by user
// *** this code can be removed when the lookspring bug is fixed
// *** the bug always has the lookspring feature on
if (lookspring->value == 0.0)
if (!lookspring->int_val)
V_StopPitchDrift();
}
}
@ -1182,7 +1182,7 @@ static void IN_JoyMove (usercmd_t *cmd)
break;
case AxisTurn:
if ((in_strafe.state & 1) || (lookstrafe->value && freelook))
if ((in_strafe.state & 1) || (lookstrafe->int_val && freelook))
{
// user wants turn control to become side control
if (fabs(fAxisValue) > joy_sidethreshold->value)
@ -1230,7 +1230,7 @@ static void IN_JoyMove (usercmd_t *cmd)
// disable pitch return-to-center unless requested by user
// *** this code can be removed when the lookspring bug is fixed
// *** the bug always has the lookspring feature on
if(lookspring->value == 0.0)
if (!lookspring->int_val)
V_StopPitchDrift();
}
}

View File

@ -270,15 +270,15 @@ static void
event_motion(XEvent *event)
{
#ifdef HAVE_DGA
if (in_dgamouse->value) {
if (in_dgamouse->int_val) {
mouse_x += event->xmotion.x_root * in_dga_mouseaccel->value;
mouse_y += event->xmotion.y_root * in_dga_mouseaccel->value;
} else
#endif
{
//printf("_windowed_mouse: %f\n", _windowed_mouse->value);
//printf("_windowed_mouse: %f\n", _windowed_mouse->int_val);
//printf("CurrentTime: %ld\n", CurrentTime);
if (_windowed_mouse->value) {
if (_windowed_mouse->int_val) {
if (!event->xmotion.send_event) {
mouse_x += (event->xmotion.x - p_mouse_x);
mouse_y += (event->xmotion.y - p_mouse_y);
@ -376,14 +376,14 @@ static void IN_ExtraOptionDraw(unsigned int options_draw_cursor)
{
// Windowed Mouse
M_Print(16, options_draw_cursor+=8, " Use Mouse");
M_DrawCheckbox(220, options_draw_cursor, _windowed_mouse->value);
M_DrawCheckbox(220, options_draw_cursor, _windowed_mouse->int_val);
}
static void IN_ExtraOptionCmd(int option_cursor)
{
switch (option_cursor) {
case 1: // _windowed_mouse
Cvar_SetValue (_windowed_mouse, !_windowed_mouse->value);
Cvar_SetValue (_windowed_mouse, !_windowed_mouse->int_val);
break;
}
}
@ -451,7 +451,7 @@ IN_Init (void)
"grab keyboard and mouse input when using -nodga");
if (COM_CheckParm ("-nodga")) {
if (in_nodga_grab->value) {
if (in_nodga_grab->int_val) {
XGrabKeyboard (x_disp, x_win, True, GrabModeAsync,
GrabModeAsync, CurrentTime);

View File

@ -282,9 +282,9 @@ Key_Console ( int key )
goto no_lf;
else if (key_lines[edit_line][1] == '\\' || key_lines[edit_line][1] == '/')
Cbuf_AddText (key_lines[edit_line]+2); // skip the ]/
else if (cl_chatmode->value != 1 && CheckForCommand())
else if (cl_chatmode->int_val != 1 && CheckForCommand())
Cbuf_AddText (key_lines[edit_line]+1); // valid command
else if ((cls.state >= ca_connected && cl_chatmode->value == 2) || cl_chatmode->value == 1)
else if ((cls.state >= ca_connected && cl_chatmode->int_val == 2) || cl_chatmode->int_val == 1)
{
if (cls.state < ca_connected) // can happen if cl_chatmode is 1
goto no_lf; // the text goes to /dev/null :)

View File

@ -407,7 +407,7 @@ void M_AdjustSliders (int dir)
switch (options_cursor) {
case 3: // screen size
Cvar_SetValue (scr_viewsize, bound (30, (int)scr_viewsize->value + (dir * 10), 120));
Cvar_SetValue (scr_viewsize, bound (30, scr_viewsize->int_val + (dir * 10), 120));
break;
case 4: // Brightness
Cvar_SetValue (brightness, bound (1, brightness->value + (dir * 0.25), 5));
@ -444,23 +444,23 @@ void M_AdjustSliders (int dir)
break;
case 11: // lookspring
Cvar_SetValue (lookspring, !lookspring->value);
Cvar_SetValue (lookspring, !lookspring->int_val);
break;
case 12: // lookstrafe
Cvar_SetValue (lookstrafe, !lookstrafe->value);
Cvar_SetValue (lookstrafe, !lookstrafe->int_val);
break;
case 13: // Use old-style sbar
Cvar_SetValue (cl_sbar, !cl_sbar->value);
Cvar_SetValue (cl_sbar, !cl_sbar->int_val);
break;
case 14: // HUD on left side
Cvar_SetValue (cl_hudswap, !cl_hudswap->value);
Cvar_SetValue (cl_hudswap, !cl_hudswap->int_val);
break;
case 16: // _windowed_mouse
Cvar_SetValue (_windowed_mouse, !_windowed_mouse->value);
Cvar_SetValue (_windowed_mouse, !_windowed_mouse->int_val);
break;
}
}
@ -506,7 +506,7 @@ void M_Options_Draw (void)
M_Print (16, 48, " Reset to defaults");
M_Print (16, 56, " Screen size");
r = (scr_viewsize->value - 30) / (120 - 30);
r = (scr_viewsize->int_val - 30) / (120 - 30);
M_DrawSlider (220, 56, r);
M_Print (16, 64, " Brightness");
@ -536,16 +536,16 @@ void M_Options_Draw (void)
M_DrawCheckbox (220, 112, m_pitch->value < 0);
M_Print (16, 120, " Lookspring");
M_DrawCheckbox (220, 120, lookspring->value);
M_DrawCheckbox (220, 120, lookspring->int_val);
M_Print (16, 128, " Lookstrafe");
M_DrawCheckbox (220, 128, lookstrafe->value);
M_DrawCheckbox (220, 128, lookstrafe->int_val);
M_Print (16, 136, " Use old status bar");
M_DrawCheckbox (220, 136, cl_sbar->value);
M_DrawCheckbox (220, 136, cl_sbar->int_val);
M_Print (16, 144, " HUD on left side");
M_DrawCheckbox (220, 144, cl_hudswap->value);
M_DrawCheckbox (220, 144, cl_hudswap->int_val);
if (vid_menudrawfn)
M_Print (16, 152, " Video Options");
@ -555,7 +555,7 @@ void M_Options_Draw (void)
#endif
if (_windowed_mouse) {
M_Print (16, 160, " Use Mouse");
M_DrawCheckbox (220, 160, _windowed_mouse->value);
M_DrawCheckbox (220, 160, _windowed_mouse->int_val);
}
#ifdef _WIN32
}

View File

@ -332,7 +332,7 @@ void Netchan_Transmit (netchan_t *chan, int length, byte *data)
if (ServerPaused())
chan->cleartime = realtime;
if (showpackets->value)
if (showpackets->int_val)
Con_Printf ("--> s=%i(%i) a=%i(%i) %i\n"
, chan->outgoing_sequence
, send_reliable
@ -383,7 +383,7 @@ qboolean Netchan_Process (netchan_t *chan)
sequence &= ~(1<<31);
sequence_ack &= ~(1<<31);
if (showpackets->value)
if (showpackets->int_val)
Con_Printf ("<-- s=%i(%i) a=%i(%i) %i\n"
, sequence
, reliable_message
@ -426,7 +426,7 @@ qboolean Netchan_Process (netchan_t *chan)
//
if (sequence <= (unsigned int)chan->incoming_sequence)
{
if (showdrop->value)
if (showdrop->int_val)
Con_Printf ("%s:Out of order packet %i at %i\n"
, NET_AdrToString (chan->remote_address)
, sequence
@ -442,7 +442,7 @@ qboolean Netchan_Process (netchan_t *chan)
{
chan->drop_count += 1;
if (showdrop->value)
if (showdrop->int_val)
Con_Printf ("%s:Dropped %i packets at %i\n"
, NET_AdrToString (chan->remote_address)
, sequence-(chan->incoming_sequence+1)

View File

@ -1247,7 +1247,7 @@ void PF_aim (void)
VectorMA (start, 2048, dir, end);
tr = SV_Move (start, vec3_origin, vec3_origin, end, false, ent);
if (tr.ent && tr.ent->v.takedamage == DAMAGE_AIM
&& (!teamplay->value || ent->v.team <=0 || ent->v.team != tr.ent->v.team) )
&& (!teamplay->int_val || ent->v.team <=0 || ent->v.team != tr.ent->v.team) )
{
VectorCopy (pr_global_struct->v_forward, G_VECTOR(OFS_RETURN));
return;
@ -1266,7 +1266,7 @@ void PF_aim (void)
continue;
if (check == ent)
continue;
if (teamplay->value && ent->v.team > 0 && ent->v.team == check->v.team)
if (teamplay->int_val && ent->v.team > 0 && ent->v.team == check->v.team)
continue; // don't aim at teammate
for (j=0 ; j<3 ; j++)
end[j] = check->v.origin[j]

View File

@ -147,7 +147,7 @@ void R_BeginEdgeFrame (void)
surfaces[1].flags = SURF_DRAWBACKGROUND;
// put the background behind everything in the world
if (r_draworder->value)
if (r_draworder->int_val)
{
pdrawfunc = R_GenerateSpansBackward;
surfaces[1].key = 0;

View File

@ -288,7 +288,7 @@ void R_NewMap (void)
r_viewleaf = NULL;
R_ClearParticles ();
r_cnumsurfs = r_maxsurfs->value;
r_cnumsurfs = r_maxsurfs->int_val;
if (r_cnumsurfs <= MINSURFACES)
r_cnumsurfs = MINSURFACES;
@ -312,7 +312,7 @@ void R_NewMap (void)
r_maxedgesseen = 0;
r_maxsurfsseen = 0;
r_numallocatededges = r_maxedges->value;
r_numallocatededges = r_maxedges->int_val;
if (r_numallocatededges < MINEDGES)
r_numallocatededges = MINEDGES;
@ -343,11 +343,11 @@ void R_SetVrect (vrect_t *pvrectin, vrect_t *pvrect, int lineadj)
float size;
qboolean full = false;
if (scr_viewsize->value >= 100.0) {
if (scr_viewsize->int_val >= 100) {
size = 100.0;
full = true;
} else
size = scr_viewsize->value;
size = scr_viewsize->int_val;
if (cl.intermission)
{
@ -357,12 +357,12 @@ void R_SetVrect (vrect_t *pvrectin, vrect_t *pvrect, int lineadj)
}
size /= 100.0;
if (!cl_sbar->value && full)
if (!cl_sbar->int_val && full)
h = pvrectin->height;
else
h = pvrectin->height - lineadj;
// h = (!cl_sbar->value && size==1.0) ? pvrectin->height : (pvrectin->height - lineadj);
// h = (!cl_sbar->int_val && size==1.0) ? pvrectin->height : (pvrectin->height - lineadj);
// h = pvrectin->height - lineadj;
if (full)
pvrect->width = pvrectin->width;
@ -375,7 +375,7 @@ void R_SetVrect (vrect_t *pvrectin, vrect_t *pvrect, int lineadj)
}
pvrect->width &= ~7;
pvrect->height = pvrectin->height * size;
if (cl_sbar->value || !full) {
if (cl_sbar->int_val || !full) {
if (pvrect->height > pvrectin->height - lineadj)
pvrect->height = pvrectin->height - lineadj;
} else
@ -579,7 +579,7 @@ void R_DrawEntitiesOnList (void)
vec3_t dist;
float add;
if (!r_drawentities->value)
if (!r_drawentities->int_val)
return;
for (i=0 ; i<cl_numvisedicts ; i++)
@ -655,7 +655,7 @@ void R_DrawViewModel (void)
float add;
dlight_t *dl;
if (!r_drawviewmodel->value || r_fov_greater_than_90 || !Cam_DrawViewModel())
if (!r_drawviewmodel->int_val || r_fov_greater_than_90 || !Cam_DrawViewModel())
return;
if (cl.stats[STAT_ITEMS] & IT_INVISIBILITY)
@ -786,7 +786,7 @@ void R_DrawBEntitiesOnList (void)
model_t *clmodel;
float minmaxs[6];
if (!r_drawentities->value)
if (!r_drawentities->int_val)
return;
VectorCopy (modelorg, oldorigin);
@ -941,7 +941,7 @@ void R_EdgeDrawing (void)
R_BeginEdgeFrame ();
if (r_dspeeds->value)
if (r_dspeeds->int_val)
{
rw_time1 = Sys_DoubleTime ();
}
@ -955,7 +955,7 @@ void R_EdgeDrawing (void)
// z writes, so have the driver turn z compares on now
D_TurnZOn ();
if (r_dspeeds->value)
if (r_dspeeds->int_val)
{
rw_time2 = Sys_DoubleTime ();
db_time1 = rw_time2;
@ -963,13 +963,13 @@ void R_EdgeDrawing (void)
R_DrawBEntitiesOnList ();
if (r_dspeeds->value)
if (r_dspeeds->int_val)
{
db_time2 = Sys_DoubleTime ();
se_time1 = db_time2;
}
if (!r_dspeeds->value)
if (!r_dspeeds->int_val)
{
VID_UnlockBuffer ();
S_ExtraUpdate (); // don't let sound get messed up if going slow
@ -994,7 +994,7 @@ void R_RenderView_ (void)
r_warpbuffer = warpbuffer;
if (r_timegraph->value || r_speeds->value || r_dspeeds->value)
if (r_timegraph->int_val || r_speeds->int_val || r_dspeeds->int_val)
r_time1 = Sys_DoubleTime ();
R_SetupFrame ();
@ -1014,7 +1014,7 @@ SetVisibilityByPassages ();
if (!r_worldentity.model || !cl.worldmodel)
Sys_Error ("R_RenderView: NULL worldmodel");
if (!r_dspeeds->value)
if (!r_dspeeds->int_val)
{
VID_UnlockBuffer ();
S_ExtraUpdate (); // don't let sound get messed up if going slow
@ -1023,14 +1023,14 @@ SetVisibilityByPassages ();
R_EdgeDrawing ();
if (!r_dspeeds->value)
if (!r_dspeeds->int_val)
{
VID_UnlockBuffer ();
S_ExtraUpdate (); // don't let sound get messed up if going slow
VID_LockBuffer ();
}
if (r_dspeeds->value)
if (r_dspeeds->int_val)
{
se_time2 = Sys_DoubleTime ();
de_time1 = se_time2;
@ -1038,7 +1038,7 @@ SetVisibilityByPassages ();
R_DrawEntitiesOnList ();
if (r_dspeeds->value)
if (r_dspeeds->int_val)
{
de_time2 = Sys_DoubleTime ();
dv_time1 = de_time2;
@ -1046,7 +1046,7 @@ SetVisibilityByPassages ();
R_DrawViewModel ();
if (r_dspeeds->value)
if (r_dspeeds->int_val)
{
dv_time2 = Sys_DoubleTime ();
dp_time1 = Sys_DoubleTime ();
@ -1054,7 +1054,7 @@ SetVisibilityByPassages ();
R_DrawParticles ();
if (r_dspeeds->value)
if (r_dspeeds->int_val)
dp_time2 = Sys_DoubleTime ();
if (r_dowarp)
@ -1062,28 +1062,28 @@ SetVisibilityByPassages ();
V_SetContentsColor (r_viewleaf->contents);
if (r_timegraph->value)
if (r_timegraph->int_val)
R_TimeGraph ();
if (r_netgraph->value)
if (r_netgraph->int_val)
R_NetGraph ();
if (r_zgraph->value)
if (r_zgraph->int_val)
R_ZGraph ();
if (r_aliasstats->value)
if (r_aliasstats->int_val)
R_PrintAliasStats ();
if (r_speeds->value)
if (r_speeds->int_val)
R_PrintTimes ();
if (r_dspeeds->value)
if (r_dspeeds->int_val)
R_PrintDSpeeds ();
if (r_reportsurfout->value && r_outofsurfaces)
if (r_reportsurfout->int_val && r_outofsurfaces)
Con_Printf ("Short %d surfaces\n", r_outofsurfaces);
if (r_reportedgeout->value && r_outofedges)
if (r_reportedgeout->int_val && r_outofedges)
Con_Printf ("Short roughly %d edges\n", r_outofedges * 2 / 3);
// back to high floating-point precision

View File

@ -147,7 +147,7 @@ void R_LineGraph (int x, int y, int h)
dest = vid.buffer + vid.rowbytes*y + x;
s = r_graphheight->value;
s = r_graphheight->int_val;
if (h == 10000)
color = 0x6f; // yellow
@ -244,9 +244,9 @@ void R_NetGraph (void)
w = NET_TIMINGS;
x = w - ((vid.width - 320)>>1);
y = vid.height - sb_lines - 24 - (int)r_graphheight->value*2 - 2;
y = vid.height - sb_lines - 24 - r_graphheight->int_val*2 - 2;
M_DrawTextBox (x, y, (w+7)/8, ((int)r_graphheight->value*2+7)/8 + 1);
M_DrawTextBox (x, y, (w+7)/8, (r_graphheight->int_val*2+7)/8 + 1);
y2 = y + 8;
y = vid.height - sb_lines - 8 - 2;
@ -475,7 +475,7 @@ void R_SetupFrame (void)
Cvar_SetValue(r_ambient, 0);
Cvar_SetValue(r_drawflat, 0);
if (r_numsurfs->value) {
if (r_numsurfs->int_val) {
if ((surface_p - surfaces) > r_maxsurfsseen)
r_maxsurfsseen = surface_p - surfaces;
@ -483,7 +483,7 @@ void R_SetupFrame (void)
surf_max - surfaces, r_maxsurfsseen);
}
if (r_numedges->value) {
if (r_numedges->int_val) {
edgecount = edge_p - r_edges;
if (edgecount > r_maxedgesseen)
@ -526,7 +526,7 @@ void R_SetupFrame (void)
r_viewleaf = Mod_PointInLeaf (r_origin, cl.worldmodel);
r_dowarpold = r_dowarp;
r_dowarp = r_waterwarp->value && (r_viewleaf->contents <= CONTENTS_WATER);
r_dowarp = r_waterwarp->int_val && (r_viewleaf->contents <= CONTENTS_WATER);
if ((r_dowarp != r_dowarpold) || r_viewchanged)
{

View File

@ -404,7 +404,7 @@ Underwater, lava, etc each has a color shift
*/
void V_SetContentsColor (int contents)
{
if (!v_contentblend->value) {
if (!v_contentblend->int_val) {
cl.cshifts[CSHIFT_CONTENTS] = cshift_empty;
return;
}
@ -686,13 +686,13 @@ void V_CalcRefdef (void)
// fudge position around to keep amount of weapon visible
// roughly equal with different FOV
if (scr_viewsize->value == 110)
if (scr_viewsize->int_val == 110)
view->origin[2] += 1;
else if (scr_viewsize->value == 100)
else if (scr_viewsize->int_val == 100)
view->origin[2] += 2;
else if (scr_viewsize->value == 90)
else if (scr_viewsize->int_val == 90)
view->origin[2] += 1;
else if (scr_viewsize->value == 80)
else if (scr_viewsize->int_val == 80)
view->origin[2] += 0.5;
if (view_message->flags & (PF_GIB|PF_DEAD) )

View File

@ -524,8 +524,8 @@ void Sbar_DrawInventory (void)
qboolean headsup;
qboolean hudswap;
headsup = !(cl_sbar->value || scr_viewsize->value<100);
hudswap = cl_hudswap->value; // Get that nasty float out :)
headsup = !(cl_sbar->int_val || scr_viewsize->int_val<100);
hudswap = cl_hudswap->int_val;
if (!headsup)
Sbar_DrawPic (0, -24, sb_ibar);
@ -736,7 +736,7 @@ Sbar_DrawNormal
*/
void Sbar_DrawNormal (void)
{
if (cl_sbar->value || scr_viewsize->value<100)
if (cl_sbar->int_val || scr_viewsize->int_val<100)
Sbar_DrawPic (0, 0, sb_sbar);
// armor
@ -788,7 +788,7 @@ void Sbar_Draw (void)
qboolean headsup;
char st[512];
headsup = !(cl_sbar->value || scr_viewsize->value<100);
headsup = !(cl_sbar->int_val || scr_viewsize->int_val<100);
if ((sb_updates >= vid.numpages) && !headsup)
return;

View File

@ -103,8 +103,8 @@ int scr_copyeverything;
float scr_con_current;
float scr_conlines; // lines of console to display
float oldscreensize, oldfov;
float oldsbar;
int oldscreensize, oldfov;
int oldsbar;
cvar_t *scr_viewsize;
cvar_t *scr_fov; // 10 - 170
cvar_t *scr_conspeed;
@ -309,16 +309,16 @@ static void SCR_CalcRefdef (void)
//========================================
// bound viewsize
if (scr_viewsize->value < 30)
if (scr_viewsize->int_val < 30)
Cvar_Set (scr_viewsize,"30");
if (scr_viewsize->value > 120)
if (scr_viewsize->int_val > 120)
Cvar_Set (scr_viewsize,"120");
// intermission is always full screen
if (cl.intermission)
size = 120;
else
size = scr_viewsize->value;
size = scr_viewsize->int_val;
if (size >= 120)
sb_lines = 0; // no status bar at all
@ -365,8 +365,8 @@ Keybinding command
*/
void SCR_SizeUp_f (void)
{
if (scr_viewsize->value < 120) {
Cvar_SetValue (scr_viewsize, scr_viewsize->value+10);
if (scr_viewsize->int_val < 120) {
Cvar_SetValue (scr_viewsize, scr_viewsize->int_val+10);
vid.recalc_refdef = 1;
}
}
@ -381,7 +381,7 @@ Keybinding command
*/
void SCR_SizeDown_f (void)
{
Cvar_SetValue (scr_viewsize, scr_viewsize->value-10);
Cvar_SetValue (scr_viewsize, scr_viewsize->int_val-10);
vid.recalc_refdef = 1;
}
@ -432,7 +432,7 @@ SCR_DrawRam
*/
void SCR_DrawRam (void)
{
if (!scr_showram->value)
if (!scr_showram->int_val)
return;
if (!r_cache_thrash)
@ -450,7 +450,7 @@ void SCR_DrawTurtle (void)
{
static int count;
if (!scr_showturtle->value)
if (!scr_showturtle->int_val)
return;
if (host_frametime < 0.1)
@ -491,7 +491,7 @@ void SCR_DrawFPS (void)
int x, y;
char st[80];
if (!show_fps->value)
if (!show_fps->int_val)
return;
t = Sys_DoubleTime();
@ -516,7 +516,7 @@ void SCR_DrawPause (void)
{
qpic_t *pic;
if (!scr_showpause->value) // turn off for screenshots
if (!scr_showpause->int_val) // turn off for screenshots
return;
if (!cl.paused)
@ -827,7 +827,7 @@ void SCR_RSShot_f (void)
if (cls.state < ca_onserver)
return; // gotta be connected
if (!scr_allowsnap->value) {
if (!scr_allowsnap->int_val) {
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
SZ_Print (&cls.netchan.message, "snap\n");
Con_Printf("Refusing remote screen shot request.\n");
@ -1003,9 +1003,9 @@ void SCR_UpdateScreen (void)
if (!scr_initialized || !con_initialized)
return; // not initialized yet
if (scr_viewsize->value != oldscr_viewsize)
if (scr_viewsize->int_val != oldscr_viewsize)
{
oldscr_viewsize = scr_viewsize->value;
oldscr_viewsize = scr_viewsize->int_val;
vid.recalc_refdef = 1;
}
@ -1018,15 +1018,15 @@ void SCR_UpdateScreen (void)
vid.recalc_refdef = true;
}
if (oldscreensize != scr_viewsize->value)
if (oldscreensize != scr_viewsize->int_val)
{
oldscreensize = scr_viewsize->value;
oldscreensize = scr_viewsize->int_val;
vid.recalc_refdef = true;
}
if (oldsbar != cl_sbar->value)
if (oldsbar != cl_sbar->int_val)
{
oldsbar = cl_sbar->value;
oldsbar = cl_sbar->int_val;
vid.recalc_refdef = true;
}
@ -1074,7 +1074,7 @@ void SCR_UpdateScreen (void)
}
else
{
if (crosshair->value)
if (crosshair->int_val)
Draw_Crosshair ();
SCR_DrawRam ();

View File

@ -122,7 +122,7 @@ byte *Skin_Cache (skin_t *skin)
if (cls.downloadtype == dl_skin)
return NULL; // use base until downloaded
if (noskins->value == 1) // JACK: So NOSKINS > 1 will show skins, but
if (noskins->int_val == 1) // JACK: So NOSKINS > 1 will show skins, but
return NULL; // not download new ones.
if (skin->failedload)
@ -251,7 +251,7 @@ void Skin_NextDownload (void)
if (!sc->name[0])
continue;
Skin_Find (sc);
if (noskins->value)
if (noskins->int_val)
continue;
if (!CL_CheckOrDownloadFile(va("skins/%s.pcx", sc->skin->name)))
return; // started a download

View File

@ -357,13 +357,13 @@ sfx_t *S_PrecacheSound (char *name)
{
sfx_t *sfx;
if (!sound_started || nosound->value)
if (!sound_started || nosound->int_val)
return NULL;
sfx = S_FindName (name);
// cache it in
if (precache->value)
if (precache->int_val)
S_LoadSound (sfx);
return sfx;
@ -488,7 +488,7 @@ void S_StartSound(int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float f
if (!sfx)
return;
if (nosound->value)
if (nosound->int_val)
return;
vol = fvol*255;
@ -817,7 +817,7 @@ void S_Update(vec3_t origin, vec3_t forward, vec3_t right, vec3_t up)
//
// debugging output
//
if (snd_show->value)
if (snd_show->int_val)
{
total = 0;
ch = channels;
@ -871,7 +871,7 @@ void S_ExtraUpdate (void)
IN_Accumulate ();
#endif
if (snd_noextraupdate->value)
if (snd_noextraupdate->int_val)
return; // don't pollute timings
S_Update_();
}
@ -1011,7 +1011,7 @@ void S_LocalSound (char *sound)
{
sfx_t *sfx;
if (nosound->value)
if (nosound->int_val)
return;
if (!sound_started)
return;

View File

@ -51,7 +51,7 @@ void Cvar_Info (cvar_t *var)
{
unsigned char info[1024], *p, *c;
if (! sv_highchars->value) {
if (! sv_highchars->int_val) {
for (p=info, c=var->string; *c && (p-info<sizeof(info)-1); ) {
*c &= 0x7f;
if (*c >= 32) *p++ = *c;

View File

@ -403,7 +403,7 @@ int CheckForFlood(flood_enum_t cmdtype)
static double lastmessagetime=0;
int oldest;
if (!sv_netdosprotect->value)
if (!sv_netdosprotect->int_val)
return 0;
oldestTime = 0x7fffffff;
@ -471,7 +471,7 @@ void SVC_Status (void)
int ping;
int top, bottom;
if (!sv_allow_status->value) return;
if (!sv_allow_status->int_val) return;
if (CheckForFlood(FLOOD_STATUS)) return;
Cmd_TokenizeString ("status");
@ -539,7 +539,7 @@ void SVC_Log (void)
int seq;
char data[MAX_DATAGRAM+64];
if (!sv_allow_log->value) return;
if (!sv_allow_log->int_val) return;
if (CheckForFlood(FLOOD_LOG)) return;
if (Cmd_Argc() == 2)
@ -576,7 +576,7 @@ void SVC_Ping (void)
{
char data;
if (!sv_allow_ping->value) return;
if (!sv_allow_ping->int_val) return;
if (CheckForFlood(FLOOD_PING)) return;
data = A2A_ACK;
@ -729,7 +729,7 @@ void SVC_DirectConnect (void)
newcl->userid = userid;
// works properly
if (!sv_highchars->value) {
if (!sv_highchars->int_val) {
byte *p, *q;
for (p = (byte *)newcl->userinfo, q = (byte *)userinfo;
@ -774,14 +774,14 @@ void SVC_DirectConnect (void)
}
// if at server limits, refuse connection
if ( maxclients->value > MAX_CLIENTS )
if ( maxclients->int_val > MAX_CLIENTS )
Cvar_SetValue (maxclients, MAX_CLIENTS);
if (maxspectators->value > MAX_CLIENTS)
if (maxspectators->int_val > MAX_CLIENTS)
Cvar_SetValue (maxspectators, MAX_CLIENTS);
if (maxspectators->value + maxclients->value > MAX_CLIENTS)
Cvar_SetValue (maxspectators, MAX_CLIENTS - maxclients->value);
if ( (spectator && spectators >= (int)maxspectators->value)
|| (!spectator && clients >= (int)maxclients->value) )
if (maxspectators->int_val + maxclients->int_val > MAX_CLIENTS)
Cvar_SetValue (maxspectators, MAX_CLIENTS - maxclients->int_val);
if ( (spectator && spectators >= maxspectators->int_val)
|| (!spectator && clients >= maxclients->int_val) )
{
Con_Printf ("%s:full connect\n", NET_AdrToString (adr));
Netchan_OutOfBandPrint (adr, "%c\nserver is full\n\n", A2C_PRINT);
@ -1182,7 +1182,7 @@ void SV_netDoSexpire_f (void)
Con_Printf ("Current DoS prot. expire settings: ");
for (i=0;i<DOSFLOODCMDS;i++) Con_Printf("%f ",netdosexpire[i]);
Con_Printf("\n");
if (!sv_netdosprotect->value) Con_Printf("(disabled)\n");
if (!sv_netdosprotect->int_val) Con_Printf("(disabled)\n");
return;
}
@ -1214,7 +1214,7 @@ void SV_netDoSvalues_f (void)
Con_Printf ("Current DoS prot. value settings: ");
for (i=0;i<DOSFLOODCMDS;i++) Con_Printf("%f ",netdosvalues[i]);
Con_Printf("\n");
if (!sv_netdosprotect->value) Con_Printf("(disabled)\n");
if (!sv_netdosprotect->int_val) Con_Printf("(disabled)\n");
return;
}
@ -1264,9 +1264,9 @@ qboolean SV_FilterPacket (void)
for (i=0 ; i<numipfilters ; i++)
if ( (in & ipfilters[i].mask) == ipfilters[i].compare)
return filterban->value;
return filterban->int_val;
return !filterban->value;
return !filterban->int_val; // FIXME eh?
}
//============================================================================

View File

@ -165,7 +165,7 @@ void Con_Printf (char *fmt, ...)
}
}
if (sv_timestamps && sv_timefmt && sv_timefmt->string && sv_timestamps->value)
if (sv_timestamps && sv_timefmt && sv_timefmt->string && sv_timestamps->int_val)
timestamps = true;
if (timestamps) {
@ -196,7 +196,7 @@ void Con_DPrintf (char *fmt, ...)
va_list argptr;
char msg[MAXPRINTMSG];
if (!developer->value)
if (!developer->int_val)
return;
va_start (argptr, fmt);
@ -438,7 +438,7 @@ void SV_StartSound (edict_t *entity, int channel, char *sample, int volume,
ent = NUM_FOR_EDICT(entity);
if ((channel & 8) || !sv_phs->value) // no PHS flag
if ((channel & 8) || !sv_phs->int_val) // no PHS flag
{
if (channel & 8)
reliable = true; // sounds that break the phs are reliable

View File

@ -208,8 +208,8 @@ int main(int argc, char *argv[])
// extrasleep is just a way to generate a fucked up connection on
// purpose
if (sys_extrasleep->value)
usleep (sys_extrasleep->value);
if (sys_extrasleep->int_val)
usleep (sys_extrasleep->int_val);
}
return 1;
}

View File

@ -246,7 +246,7 @@ int main (int argc, char **argv)
{
// Now we want to give some processing time to other applications,
// such as qw_client, running on this machine.
sleep_msec = sys_sleep->value;
sleep_msec = sys_sleep->int_val;
if (sleep_msec > 0)
{
if (sleep_msec > 13)

View File

@ -293,7 +293,7 @@ void SV_PreSpawn_f (void)
// Con_DPrintf("Client check = %d\n", check);
if (sv_mapcheck->value && check != sv.worldmodel->checksum &&
if (sv_mapcheck->int_val && check != sv.worldmodel->checksum &&
check != sv.worldmodel->checksum2) {
SV_ClientPrintf (host_client, PRINT_HIGH,
"Map model file does not match (%s), %i != %i/%i.\n"
@ -700,19 +700,19 @@ void SV_BeginDownload_f(void)
name = Cmd_Argv(1);
// hacked by zoid to allow more conrol over download
// first off, no .. or global allow check
if (strstr (name, "..") || !allow_download->value
if (strstr (name, "..") || !allow_download->int_val
// leading dot is no good
|| *name == '.'
// leading slash bad as well, must be in subdir
|| *name == '/'
// next up, skin check
|| (strncmp(name, "skins/", 6) == 0 && !allow_download_skins->value)
|| (strncmp(name, "skins/", 6) == 0 && !allow_download_skins->int_val)
// now models
|| (strncmp(name, "progs/", 6) == 0 && !allow_download_models->value)
|| (strncmp(name, "progs/", 6) == 0 && !allow_download_models->int_val)
// now sounds
|| (strncmp(name, "sound/", 6) == 0 && !allow_download_sounds->value)
|| (strncmp(name, "sound/", 6) == 0 && !allow_download_sounds->int_val)
// now maps (note special case for maps, must not be in pak)
|| (strncmp(name, "maps/", 6) == 0 && !allow_download_maps->value)
|| (strncmp(name, "maps/", 6) == 0 && !allow_download_maps->int_val)
// MUST be in a subdirectory
|| !strstr (name, "/") )
{ // don't allow anything with .. path
@ -798,7 +798,7 @@ void SV_Say (qboolean team)
t1[31] = 0;
}
if (host_client->spectator && (!sv_spectalk->value || team))
if (host_client->spectator && (!sv_spectalk->int_val || team))
snprintf (text, sizeof(text), "[SPEC] %s: ", host_client->name);
else if (team)
snprintf (text, sizeof(text), "(%s): ", host_client->name);
@ -850,7 +850,7 @@ void SV_Say (qboolean team)
{
if (client->state != cs_spawned)
continue;
if (host_client->spectator && !sv_spectalk->value)
if (host_client->spectator && !sv_spectalk->int_val)
if (!client->spectator)
continue;
@ -987,7 +987,7 @@ void SV_Pause_f (void)
lastpausetime=currenttime;
if (!pausable->value) {
if (!pausable->int_val) {
SV_ClientPrintf (host_client, PRINT_HIGH, "Pause not allowed.\n");
return;
}
@ -1449,7 +1449,7 @@ void SV_RunCmd (usercmd_t *ucmd, qboolean inside)
if (!inside) {
host_client->msecs += ucmd->msec;
if ((sv_timekick->value >= 1) &&
if ((sv_timekick->int_val >= 1) &&
(tmp_time = realtime - host_client->last_check) >=
sv_timekick_interval->value) {
tmp_time *= (1000 + sv_timekick_fuzz->value);
@ -1458,9 +1458,9 @@ void SV_RunCmd (usercmd_t *ucmd, qboolean inside)
SV_BroadcastPrintf( PRINT_HIGH,
va("%s thinks %d msecs pass in %f msecs. (Strike %d/%d)\n",
host_client->name, host_client->msecs, tmp_time,
host_client->msec_cheating, (int)sv_timekick->value));
host_client->msec_cheating, sv_timekick->int_val));
if (host_client->msec_cheating >= sv_timekick->value) {
if (host_client->msec_cheating >= sv_timekick->int_val) {
SV_BroadcastPrintf(PRINT_HIGH, va("Strike %d for %s!!\n",
host_client->msec_cheating, host_client->name));
SV_BroadcastPrintf(PRINT_HIGH, "Please see http://www.quakeforge.net/speed_cheat.php for infomation on QuakeForge's time cheat protection, and to explain how some may be cheating without knowing it.\n"

View File

@ -101,7 +101,7 @@ void Sys_Printf (char *fmt, ...)
unsigned char *p;
if (sys_nostdout->value)
if (sys_nostdout->int_val)
return;
va_start (argptr, fmt);

View File

@ -119,7 +119,7 @@ void Sys_Printf (char *fmt, ...)
unsigned char *p;
if (sys_nostdout->value)
if (sys_nostdout->int_val)
return;
va_start (argptr, fmt);

View File

@ -107,7 +107,7 @@ char *Team_ParseSay (char *s)
char c, chr, *t1, t2[128], t3[128];
static location_t *location = NULL;
if (!cl_parsesay->value)
if (!cl_parsesay->int_val)
return s;
i = 0;

View File

@ -941,15 +941,15 @@ IN_Commands (void)
/* Only supported by LibGII 0.7 or later. */
#ifdef GII_CMDCODE_PREFER_RELPTR
if (old_windowed_mouse != _windowed_mouse->value) {
if (old_windowed_mouse != _windowed_mouse->int_val) {
gii_event ev;
old_windowed_mouse = _windowed_mouse->value;
old_windowed_mouse = _windowed_mouse->int_val;
ev.cmd.size = sizeof(gii_cmd_nodata_event);
ev.cmd.type = evCommand;
ev.cmd.target = GII_EV_TARGET_ALL;
ev.cmd.code = (int)_windowed_mouse->value ? GII_CMDCODE_PREFER_RELPTR
ev.cmd.code = _windowed_mouse->int_val ? GII_CMDCODE_PREFER_RELPTR
: GII_CMDCODE_PREFER_ABSPTR;
ggiEventSend(ggivis, &ev);

View File

@ -199,8 +199,8 @@ void VID_RememberWindowPos (void)
(rect.right > 0) &&
(rect.bottom > 0))
{
Cvar_SetValue (vid_window_x, (float)rect.left);
Cvar_SetValue (vid_window_y, (float)rect.top);
Cvar_SetValue (vid_window_x, rect.left);
Cvar_SetValue (vid_window_y, rect.top);
}
}
}
@ -214,10 +214,10 @@ VID_CheckWindowXY
void VID_CheckWindowXY (void)
{
if (((int)vid_window_x->value > (GetSystemMetrics (SM_CXSCREEN) - 160)) ||
((int)vid_window_y->value > (GetSystemMetrics (SM_CYSCREEN) - 120)) ||
((int)vid_window_x->value < 0) ||
((int)vid_window_y->value < 0))
if ((vid_window_x->int_val > (GetSystemMetrics (SM_CXSCREEN) - 160)) ||
(vid_window_y->int_val > (GetSystemMetrics (SM_CYSCREEN) - 120)) ||
(vid_window_x->int_val < 0) ||
(vid_window_y->int_val < 0))
{
Cvar_SetValue (vid_window_x, 0.0);
Cvar_SetValue (vid_window_y, 0.0 );
@ -378,7 +378,7 @@ int VID_Suspend (MGLDC *dc, int flags)
if (flags & MGL_DEACTIVATE)
{
// FIXME: this doesn't currently work on NT
if (block_switch->value && !WinNT)
if (block_switch->int_val && !WinNT)
{
return MGL_NO_DEACTIVATE;
}
@ -1094,14 +1094,14 @@ void VID_CheckModedescFixup (int mode)
int x, y, stretch;
if (mode == MODE_SETTABLE_WINDOW) {
modelist[mode].stretched = (int) vid_stretch_by_2->value;
modelist[mode].stretched = vid_stretch_by_2->int_val;
stretch = modelist[mode].stretched;
Cvar_SetValue (vid_config_x, max (vid_config_x->value, 320 << stretch));
Cvar_SetValue (vid_config_y, max (vid_config_y->value, 200 << stretch));
Cvar_SetValue (vid_config_x, max (vid_config_x->int_val, 320 << stretch));
Cvar_SetValue (vid_config_y, max (vid_config_y->int_val, 200 << stretch));
x = (int) vid_config_x->value;
y = (int) vid_config_y->value;
x = vid_config_x->int_val;
y = vid_config_y->int_val;
snprintf (modelist[mode].modedesc, sizeof(modelist[mode].modedesc), "%dx%d", x, y);
modelist[mode].width = x;
modelist[mode].height = y;
@ -1374,8 +1374,8 @@ qboolean VID_SetWindowedMode (int modenum)
// position and show the DIB window
VID_CheckWindowXY ();
SetWindowPos (mainwindow, NULL, (int)vid_window_x->value,
(int)vid_window_y->value, 0, 0,
SetWindowPos (mainwindow, NULL, vid_window_x->int_val,
vid_window_y->int_val, 0, 0,
SWP_NOSIZE | SWP_NOZORDER | SWP_SHOWWINDOW | SWP_DRAWFRAME);
if (force_minimized)
@ -1442,7 +1442,7 @@ qboolean VID_SetFullscreenMode (int modenum)
mgldc = memdc = NULL;
if ((mgldc = createDisplayDC (modelist[modenum].stretched ||
(int)vid_nopageflip->value)) == NULL)
vid_nopageflip->int_val)) == NULL)
{
return false;
}
@ -1638,11 +1638,11 @@ int VID_SetMode (int modenum, unsigned char *palette)
modenum = vid_default;
}
Cvar_SetValue (vid_mode, (float)modenum);
Cvar_SetValue (vid_mode, modenum);
}
else
{
Cvar_SetValue (vid_mode, (float)vid_modenum);
Cvar_SetValue (vid_mode, vid_modenum);
return 0;
}
}
@ -1666,7 +1666,7 @@ int VID_SetMode (int modenum, unsigned char *palette)
// Set either the fullscreen or windowed mode
if (modelist[modenum].type == MS_WINDOWED)
{
if (_windowed_mouse->value && key_dest == key_game)
if (_windowed_mouse->int_val && key_dest == key_game)
{
stat = VID_SetWindowedMode(modenum);
IN_ActivateMouse ();
@ -1729,7 +1729,7 @@ int VID_SetMode (int modenum, unsigned char *palette)
ReleaseDC(NULL,hdc);
vid_modenum = modenum;
Cvar_SetValue (vid_mode, (float)vid_modenum);
Cvar_SetValue (vid_mode, vid_modenum);
if (!VID_AllocBuffers (vid.width, vid.height))
{
@ -2055,7 +2055,7 @@ VID_Windowed_f
void VID_Windowed_f (void)
{
VID_SetMode ((int)vid_windowed_mode->value, vid_curpal);
VID_SetMode (vid_windowed_mode->int_val, vid_curpal);
}
@ -2067,7 +2067,7 @@ VID_Fullscreen_f
void VID_Fullscreen_f (void)
{
VID_SetMode ((int)vid_fullscreen_mode->value, vid_curpal);
VID_SetMode (vid_fullscreen_mode->int_val, vid_curpal);
}
/*
@ -2366,8 +2366,8 @@ void VID_Update (vrect_t *rects)
{
GetWindowRect (mainwindow, &trect);
if ((trect.left != (int)vid_window_x->value) ||
(trect.top != (int)vid_window_y->value))
if ((trect.left != vid_window_x->int_val) ||
(trect.top != vid_window_y->int_val))
{
if (COM_CheckParm ("-resetwinpos"))
{
@ -2376,14 +2376,14 @@ void VID_Update (vrect_t *rects)
}
VID_CheckWindowXY ();
SetWindowPos (mainwindow, NULL, (int)vid_window_x->value,
(int)vid_window_y->value, 0, 0,
SetWindowPos (mainwindow, NULL, vid_window_x->int_val,
vid_window_y->int_val, 0, 0,
SWP_NOSIZE | SWP_NOZORDER | SWP_SHOWWINDOW | SWP_DRAWFRAME);
}
}
if ((_vid_default_mode_win->value != vid_default) &&
(!startwindowed || (_vid_default_mode_win->value < MODE_FULLSCREEN_DEFAULT)))
if ((_vid_default_mode_win->int_val != vid_default) &&
(!startwindowed || (_vid_default_mode_win->int_val < MODE_FULLSCREEN_DEFAULT)))
{
firstupdate = 0;
@ -2393,13 +2393,13 @@ void VID_Update (vrect_t *rects)
Cvar_SetValue (vid_window_y, 0.0);
}
if ((_vid_default_mode_win->value < 0) ||
(_vid_default_mode_win->value >= nummodes))
if ((_vid_default_mode_win->int_val < 0) ||
(_vid_default_mode_win->int_val >= nummodes))
{
Cvar_SetValue (_vid_default_mode_win, windowed_default);
}
Cvar_SetValue (vid_mode, _vid_default_mode_win->value);
Cvar_SetValue (vid_mode, _vid_default_mode_win->int_val);
}
}
@ -2416,10 +2416,10 @@ void VID_Update (vrect_t *rects)
}
else
{
if ((int)vid_mode->value != vid_realmode)
if (vid_mode->int_val != vid_realmode)
{
VID_SetMode ((int)vid_mode->value, vid_curpal);
Cvar_SetValue (vid_mode, (float)vid_modenum);
VID_SetMode (vid_mode->int_val, vid_curpal);
Cvar_SetValue (vid_mode, vid_modenum);
// so if mode set fails, we don't keep on
// trying to set that mode
vid_realmode = vid_modenum;
@ -2429,7 +2429,7 @@ void VID_Update (vrect_t *rects)
// handle the mouse state when windowed if that's changed
if (modestate == MS_WINDOWED)
{
if (!_windowed_mouse->value) {
if (!_windowed_mouse->int_val) {
if (windowed_mouse) {
IN_DeactivateMouse ();
IN_ShowMouse ();
@ -2810,7 +2810,7 @@ void AppActivate(BOOL fActive, BOOL minimize)
IN_ActivateMouse ();
IN_HideMouse ();
}
else if ((modestate == MS_WINDOWED) && _windowed_mouse->value && key_dest == key_game)
else if ((modestate == MS_WINDOWED) && _windowed_mouse->int_val && key_dest == key_game)
{
IN_ActivateMouse ();
IN_HideMouse ();
@ -2842,7 +2842,7 @@ void AppActivate(BOOL fActive, BOOL minimize)
IN_DeactivateMouse ();
IN_ShowMouse ();
}
else if ((modestate == MS_WINDOWED) && _windowed_mouse->value /* && mouseactive */)
else if ((modestate == MS_WINDOWED) && _windowed_mouse->int_val /* && mouseactive */)
{
IN_DeactivateMouse ();
IN_ShowMouse ();
@ -2860,7 +2860,7 @@ VID_HandlePause
void VID_HandlePause (qboolean pause)
{
#if 0
if ((modestate == MS_WINDOWED) && _windowed_mouse->value)
if ((modestate == MS_WINDOWED) && _windowed_mouse->int_val)
{
if (pause)
{
@ -2926,7 +2926,7 @@ LONG WINAPI MainWndProc (
force_mode_set = false;
}
VID_SetMode ((int)vid_fullscreen_mode->value, vid_curpal);
VID_SetMode (vid_fullscreen_mode->int_val, vid_curpal);
break;
case SC_SCREENSAVE:
@ -3306,7 +3306,7 @@ void VID_MenuDraw (void)
M_Print (2*8, 36 + MODE_AREA_HEIGHT * 8 + 8*5, temp);
}
ptr = VID_GetModeDescription2 ((int)_vid_default_mode_win->value);
ptr = VID_GetModeDescription2 (_vid_default_mode_win->int_val);
if (ptr)
{

View File

@ -394,7 +394,7 @@ void IN_SendKeyEvents (void)
break;
case SDL_MOUSEMOTION:
if (_windowed_mouse->value)
if (_windowed_mouse->int_val)
{
if ((event.motion.x != (vid.width/2))
|| (event.motion.y != (vid.height/2)) )
@ -451,7 +451,7 @@ IN_Init (void)
_windowed_mouse = Cvar_Get ("_windowed_mouse","0",CVAR_ARCHIVE,"None");
if ( COM_CheckParm("-nomouse") && !_windowed_mouse->value)
if ( COM_CheckParm("-nomouse") && !_windowed_mouse->int_val)
return;
mouse_x = mouse_y = 0.0;
@ -498,7 +498,7 @@ IN_Move (usercmd_t *cmd)
mouse_x *= sensitivity->value;
mouse_y *= sensitivity->value;
if ( (in_strafe.state & 1) || (lookstrafe->value && freelook))
if ( (in_strafe.state & 1) || (lookstrafe->int_val && freelook))
cmd->sidemove += m_side->value * mouse_x;
else
cl.viewangles[YAW] -= m_yaw->value * mouse_x;

View File

@ -368,7 +368,7 @@ VID_Init (unsigned char *palette)
Sys_Error ("Couldn't initialize SDL: %s\n", SDL_GetError ());
// Check if we want fullscreen
if (vid_fullscreen->value) {
if (vid_fullscreen->int_val) {
flags |= SDL_FULLSCREEN;
// Don't annoy Mesa/3dfx folks
#ifndef WIN32
@ -591,7 +591,7 @@ IN_SendKeyEvents (void)
break;
case SDL_MOUSEMOTION:
if (_windowed_mouse->value) {
if (_windowed_mouse->int_val) {
if ((event.motion.x != (vid.width/2)) ||
(event.motion.y != (vid.height/2)) ) {
mouse_x = event.motion.xrel*2;
@ -627,7 +627,7 @@ IN_Init (void)
_windowed_mouse = Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, "Grab mouse and keyboard input");
m_filter = Cvar_Get ("m_filter", "0", CVAR_ARCHIVE, "None");
if (COM_CheckParm ("-nomouse") && !_windowed_mouse->value)
if (COM_CheckParm ("-nomouse") && !_windowed_mouse->int_val)
return;
mouse_x = mouse_y = 0.0;
@ -672,7 +672,7 @@ IN_Move (usercmd_t *cmd)
if (!mouse_avail)
return;
if (m_filter->value) {
if (m_filter->int_val) {
mouse_x = (mouse_x + old_mouse_x) * 0.5;
mouse_y = (mouse_y + old_mouse_y) * 0.5;
}
@ -683,7 +683,7 @@ IN_Move (usercmd_t *cmd)
mouse_x *= sensitivity->value;
mouse_y *= sensitivity->value;
if ((in_strafe.state & 1) || (lookstrafe->value && freelook))
if ((in_strafe.state & 1) || (lookstrafe->int_val && freelook))
cmd->sidemove += m_side->value * mouse_x;
else
cl.viewangles[YAW] -= m_yaw->value * mouse_x;

View File

@ -573,13 +573,13 @@ VID_Update(vrect_t *rects)
return;
}
if (vid_waitforrefresh->value) {
if (vid_waitforrefresh->int_val) {
vga_waitretrace();
}
if (VGA_planar) {
VGA_UpdatePlanarScreen(vid.buffer);
} else if (vid_redrawfull->value) {
} else if (vid_redrawfull->int_val) {
int total = vid.rowbytes * vid.height;
int offset;
@ -625,8 +625,8 @@ VID_Update(vrect_t *rects)
}
}
if (vid_mode->value != current_mode) {
VID_SetMode ((int)vid_mode->value, vid_current_palette);
if (vid_mode->int_val != current_mode) {
VID_SetMode (vid_mode->int_val, vid_current_palette);
}
}

View File

@ -415,7 +415,7 @@ int VID_SetMode (int modenum, unsigned char *palette)
// Set either the fullscreen or windowed mode
if (modelist[modenum].type == MS_WINDOWED)
{
if (_windowed_mouse->value && key_dest == key_game)
if (_windowed_mouse->int_val && key_dest == key_game)
{
stat = VID_SetWindowedMode(modenum);
IN_ActivateMouse ();
@ -683,7 +683,7 @@ void GL_EndRendering (void)
// handle the mouse state when windowed if that's changed
if (modestate == MS_WINDOWED)
{
if (!_windowed_mouse->value) {
if (!_windowed_mouse->int_val) {
if (windowed_mouse) {
IN_DeactivateMouse ();
IN_ShowMouse ();
@ -1016,7 +1016,7 @@ void AppActivate(BOOL fActive, BOOL minimize)
ShowWindow(mainwindow, SW_SHOWNORMAL);
}
}
else if ((modestate == MS_WINDOWED) && _windowed_mouse->value && key_dest == key_game)
else if ((modestate == MS_WINDOWED) && _windowed_mouse->int_val && key_dest == key_game)
{
IN_ActivateMouse ();
IN_HideMouse ();
@ -1034,7 +1034,7 @@ void AppActivate(BOOL fActive, BOOL minimize)
vid_wassuspended = true;
}
}
else if ((modestate == MS_WINDOWED) && _windowed_mouse->value)
else if ((modestate == MS_WINDOWED) && _windowed_mouse->int_val)
{
IN_DeactivateMouse ();
IN_ShowMouse ();