From 111791e0f670beffc0c7ca711a39de65c7bd2a5a Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 27 Sep 2000 06:07:10 +0000 Subject: [PATCH] cvar usage audit. value -> int_val where appropriate. tested with x11 glx and svga. --- source/.gdbinit | 2 +- source/cl_input.c | 2 +- source/cl_main.c | 8 ++--- source/cl_parse.c | 6 ++-- source/cmd.c | 4 +-- source/console.c | 2 +- source/context_x11.c | 6 ++-- source/cvar.c | 2 +- source/d_edge.c | 4 +-- source/d_init.c | 4 +-- source/gl_draw.c | 32 +++++++++---------- source/gl_part.c | 4 +-- source/gl_rlight.c | 4 +-- source/gl_rmain.c | 32 +++++++++---------- source/gl_rmisc.c | 8 ++--- source/gl_rsurf.c | 34 ++++++++++---------- source/gl_screen.c | 32 +++++++++---------- source/gl_warp.c | 2 +- source/host.c | 8 ++--- source/host_cmd.c | 6 ++-- source/in_dos.c | 12 +++---- source/in_sun.c | 6 ++-- source/in_svgalib.c | 4 +-- source/in_win.c | 32 +++++++++---------- source/in_x11.c | 22 ++++++------- source/menu.c | 62 ++++++++++++++++++------------------- source/net_main.c | 6 ++-- source/pr_cmds.c | 4 +-- source/pr_edict.c | 2 +- source/quakefs.c | 4 +-- source/r_edge.c | 2 +- source/r_main.c | 48 ++++++++++++++-------------- source/r_misc.c | 16 +++++----- source/r_part.c | 2 +- source/r_surf.c | 2 +- source/r_view.c | 2 +- source/sbar.c | 20 ++++++------ source/screen.c | 10 +++--- source/snd_dma.c | 12 +++---- source/snd_mem.c | 2 +- source/sv_main.c | 12 +++---- source/sv_phys.c | 2 +- source/sw_view.c | 6 ++-- source/sys_dos.c | 2 +- source/sys_unix.c | 2 +- source/sys_unixd.c | 2 +- source/vid_dos.c | 18 +++++------ source/vid_ext.c | 12 +++---- source/vid_ggi.c | 10 +++--- source/vid_mgl.c | 70 ++++++++++++++++++++--------------------- source/vid_sdl.c | 12 +++---- source/vid_sgl.c | 16 +++++----- source/vid_sunx.c | 4 +-- source/vid_sunxil.c | 18 +++++------ source/vid_svgalib.c | 12 +++---- source/vid_vga.c | 4 +-- source/vid_wgl.c | 8 ++--- source/vid_win.c | 74 ++++++++++++++++++++++---------------------- 58 files changed, 378 insertions(+), 378 deletions(-) diff --git a/source/.gdbinit b/source/.gdbinit index dc48ee5..34600dc 100644 --- a/source/.gdbinit +++ b/source/.gdbinit @@ -1 +1 @@ -set args -nodga -nosound +set _windowed_mouse 0 +set args -nodga +set _windowed_mouse 0 diff --git a/source/cl_input.c b/source/cl_input.c index 35b4511..d2c1441 100644 --- a/source/cl_input.c +++ b/source/cl_input.c @@ -132,7 +132,7 @@ void IN_KLookUp (void) {KeyUp(&in_klook);} void IN_MLookDown (void) {KeyDown(&in_mlook);} void IN_MLookUp (void) { KeyUp(&in_mlook); -if ( !(in_mlook.state&1) && lookspring->value) +if ( !(in_mlook.state&1) && lookspring->int_val) V_StartPitchDrift(); } void IN_UpDown(void) {KeyDown(&in_up);} diff --git a/source/cl_main.c b/source/cl_main.c index cb6989e..1be63cc 100644 --- a/source/cl_main.c +++ b/source/cl_main.c @@ -248,7 +248,7 @@ Con_DPrintf ("CL_SignonReply: %i\n", cls.signon); MSG_WriteString (&cls.message, va("name \"%s\"\n", cl_name->string)); MSG_WriteByte (&cls.message, clc_stringcmd); - MSG_WriteString (&cls.message, va("color %i %i\n", ((int)cl_color->value)>>4, ((int)cl_color->value)&15)); + MSG_WriteString (&cls.message, va("color %i %i\n", (cl_color->int_val)>>4, (cl_color->int_val)&15)); MSG_WriteByte (&cls.message, clc_stringcmd); snprintf (str, sizeof(str), "spawn %s", cls.spawnparms); @@ -496,7 +496,7 @@ float CL_LerpPoint (void) f = cl.mtime[0] - cl.mtime[1]; - if (!f || cl_nolerp->value || cls.timedemo || sv.active) + if (!f || cl_nolerp->int_val || cls.timedemo || sv.active) { cl.time = cl.mtime[0]; return 1; @@ -707,7 +707,7 @@ void CL_RelinkEntities (void) ent->forcelink = false; - if (i == cl.viewentity && !chase_active->value) + if (i == cl.viewentity && !chase_active->int_val) continue; #ifdef QUAKE2 @@ -750,7 +750,7 @@ int CL_ReadFromServer (void) CL_ParseServerMessage (); } while (ret && cls.state == ca_connected); - if (cl_shownet->value) + if (cl_shownet->int_val) Con_Printf ("\n"); CL_RelinkEntities (); diff --git a/source/cl_parse.c b/source/cl_parse.c index 4660999..f06743c 100644 --- a/source/cl_parse.c +++ b/source/cl_parse.c @@ -721,7 +721,7 @@ void CL_ParseStaticSound (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); /* ===================== @@ -736,9 +736,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"); cl.onground = false; // unless the server says otherwise diff --git a/source/cmd.c b/source/cmd.c index 3b73075..2a1aeda 100644 --- a/source/cmd.c +++ b/source/cmd.c @@ -384,7 +384,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); @@ -862,7 +862,7 @@ void Cmd_ExecuteString (char *text, cmd_source_t src) } } - if (cl_warncmd->value || developer->value) + if (cl_warncmd->int_val || developer->int_val) Con_Printf ("Unknown command \"%s\"\n", Cmd_Argv(0)); } diff --git a/source/console.c b/source/console.c index e5b9f9a..7f0804a 100644 --- a/source/console.c +++ b/source/console.c @@ -445,7 +445,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); diff --git a/source/context_x11.c b/source/context_x11.c index 3215913..c6a1b2e 100644 --- a/source/context_x11.c +++ b/source/context_x11.c @@ -268,7 +268,7 @@ x11_set_vidmode(int width, int height) } Con_SafePrintf ("hasvidmode = %i\nnummodes = %i\n", hasvidmode, nummodes); - if (hasvidmode && vid_fullscreen->value) { + if (hasvidmode && vid_fullscreen->int_val) { int smallest_mode=0, x=MAXINT, y=MAXINT; // FIXME: does this depend on mode line order in XF86Config? @@ -311,7 +311,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; } @@ -349,7 +349,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); } diff --git a/source/cvar.c b/source/cvar.c index cd4b309..74991be 100644 --- a/source/cvar.c +++ b/source/cvar.c @@ -371,7 +371,7 @@ void Cvar_Toggle_f (void) return; } - Cvar_Set (var, var->value ? "0" : "1"); + Cvar_Set (var, var->value ? "0" : "1"); //XXX should be int or float? } void Cvar_Help_f (void) diff --git a/source/d_edge.c b/source/d_edge.c index 1b58e20..23fbd91 100644 --- a/source/d_edge.c +++ b/source/d_edge.c @@ -195,7 +195,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] ; svalue & 0xFF); + D_DrawSolidSurface (s, r_clearcolor->int_val & 0xFF); D_DrawZSpans (s->spans); } else if (s->flags & SURF_DRAWTURB) diff --git a/source/d_init.c b/source/d_init.c index 60c1d9e..ed10092 100644 --- a/source/d_init.c +++ b/source/d_init.c @@ -145,7 +145,7 @@ void D_SetupFrame (void) d_roverwrapped = false; d_initial_rover = sc_rover; - d_minmip = d_mipcap->value; + d_minmip = d_mipcap->int_val; if (d_minmip > 3) d_minmip = 3; else if (d_minmip < 0) @@ -155,7 +155,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; diff --git a/source/gl_draw.c b/source/gl_draw.c index 264f2a9..0c81162 100644 --- a/source/gl_draw.c +++ b/source/gl_draw.c @@ -438,7 +438,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 Cmd_AddCommand ("gl_texturemode", &Draw_TextureMode_f); @@ -565,12 +565,12 @@ void Draw_Crosshair(void) extern vrect_t scr_vrect; unsigned char *pColor; - if (crosshair->value == 2) + if (crosshair->int_val == 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[(byte) crosshaircolor->int_val]; if (lighthalf) glColor4ub((byte) ((int) pColor[0] >> 1),(byte) ((int) pColor[1] >> 1), (byte) ((int) pColor[2] >> 1), pColor[3]); else @@ -588,9 +588,9 @@ void Draw_Crosshair(void) glVertex2f (x - 4, y+12); glEnd (); } - else if (crosshair->value) - Draw_Character8 (scr_vrect.x + scr_vrect.width/2-4 + cl_crossx->value, - scr_vrect.y + scr_vrect.height/2-4 + cl_crossy->value, '+'); + else if (crosshair->int_val) + Draw_Character8 (scr_vrect.x + scr_vrect.width/2-4 + cl_crossx->int_val, + scr_vrect.y + scr_vrect.height/2-4 + cl_crossy->int_val, '+'); } /* @@ -1104,11 +1104,11 @@ static unsigned scaled[1024*512]; // [512*256]; 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_width * scaled_height > sizeof(scaled)/4) Sys_Error ("GL_LoadTexture: too big"); @@ -1203,11 +1203,11 @@ void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboole 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_width * scaled_height > sizeof(scaled)) Sys_Error ("GL_LoadTexture: too big"); diff --git a/source/gl_part.c b/source/gl_part.c index d8376c3..1e86b9c 100644 --- a/source/gl_part.c +++ b/source/gl_part.c @@ -226,7 +226,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); @@ -359,7 +359,7 @@ R_UpdateFires (void) int i; fire_t *f; - if (!gl_fires->value) + if (!gl_fires->int_val) return; glDepthMask (0); diff --git a/source/gl_rlight.c b/source/gl_rlight.c index f1f5f0c..9df5b55 100644 --- a/source/gl_rlight.c +++ b/source/gl_rlight.c @@ -158,7 +158,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 @@ -303,7 +303,7 @@ void R_PushDlights (vec3_t entorigin) dlight_t *l; vec3_t lightorigin; - if (gl_flashblend->value) + if (gl_flashblend->int_val) return; r_dlightframecount = r_framecount + 1; // because the count hasn't diff --git a/source/gl_rmain.c b/source/gl_rmain.c index 5764c49..18f506e 100644 --- a/source/gl_rmain.c +++ b/source/gl_rmain.c @@ -579,7 +579,7 @@ static void R_DrawAliasModel (entity_t *e) if (shadelight < 8) shadelight = 8; } - else if (!gl_fb_models->value && (!strcmp (clmodel->name, "progs/flame.mdl") || !strcmp (clmodel->name, "progs/flame2.mdl"))) + 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 shadelight = 200; @@ -628,23 +628,23 @@ 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->colormap != vid.colormap && !gl_nocolors->value) + if (currententity->colormap != vid.colormap && !gl_nocolors->int_val) { i = currententity - cl_entities; if (i >= 1 && i<=cl.maxclients /* && !strcmp (currententity->model->name, "progs/player.mdl") */) glBindTexture (GL_TEXTURE_2D, playertextures - 1 + i); } - if (gl_smoothmodels->value) + if (gl_smoothmodels->int_val) glShadeModel (GL_SMOOTH); - if (gl_affinemodels->value) + if (gl_affinemodels->int_val) glHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); R_SetupAliasFrame (currententity->frame, paliashdr, false); // This block is GL fullbright support for objects... - if (clmodel->hasfullbrights && gl_fb_models->value && paliashdr->gl_fb_texturenum[currententity->skinnum][anim]) + if (clmodel->hasfullbrights && gl_fb_models->int_val && paliashdr->gl_fb_texturenum[currententity->skinnum][anim]) { glBlendFunc(GL_ONE, GL_ONE); glEnable (GL_BLEND); @@ -657,12 +657,12 @@ static void R_DrawAliasModel (entity_t *e) } glShadeModel (GL_FLAT); - if (gl_affinemodels->value) + if (gl_affinemodels->int_val) glHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); glPopMatrix (); - if (r_shadows->value) + if (r_shadows->int_val) { glPushMatrix (); R_RotateForEntity (e); @@ -687,7 +687,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 @@ -727,10 +727,10 @@ R_DrawViewModel static void R_DrawViewModel (void) { currententity = &cl.viewent; - if (!r_drawviewmodel->value - || chase_active->value + if (!r_drawviewmodel->int_val + || chase_active->int_val || envmap - || !r_drawentities->value + || !r_drawentities->int_val || (cl.items & IT_INVISIBILITY) || cl.stats[STAT_HEALTH] <= 0 || !currententity->model) @@ -803,8 +803,8 @@ R_SetupFrame static void R_SetupFrame (void) { // don't allow cheats in multiplayer - r_fullbright->value = 0; - r_lightmap->value = 0; + Cvar_SetValue (r_fullbright, 0); + Cvar_SetValue (r_lightmap, 0); R_AnimateLight (); @@ -918,7 +918,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); @@ -966,7 +966,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); @@ -1054,7 +1054,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) diff --git a/source/gl_rmisc.c b/source/gl_rmisc.c index 59b1e6a..82154ad 100644 --- a/source/gl_rmisc.c +++ b/source/gl_rmisc.c @@ -373,12 +373,12 @@ void R_TranslatePlayerSkin (int playernum) // don't mipmap these, because it takes too long GL_Upload8 (translated, paliashdr->skinwidth, paliashdr->skinheight, false, false, true); #else - scaled_width = gl_max_size->value < 512 ? gl_max_size->value : 512; - scaled_height = gl_max_size->value < 256 ? gl_max_size->value : 256; + scaled_width = gl_max_size->int_val < 512 ? gl_max_size->int_val : 512; + scaled_height = gl_max_size->int_val < 256 ? 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; diff --git a/source/gl_rsurf.c b/source/gl_rsurf.c index eca709e..190be21 100644 --- a/source/gl_rsurf.c +++ b/source/gl_rsurf.c @@ -252,7 +252,7 @@ R_BuildLightMap (msurface_t *surf, byte *dest, int stride) lightmap = surf->samples; // set to full bright if no light data - if (/*r_fullbright->value ||*/ !cl.worldmodel->lightdata) + if (/*r_fullbright->int_val ||*/ !cl.worldmodel->lightdata) { bl = blocklights; for (i=0 ; ivalue) + if (gl_colorlights->int_val) { stride -= smax * 3; bl = blocklights; @@ -455,7 +455,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]) @@ -620,7 +620,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]; @@ -793,7 +793,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 ; kvalue = 1; + Cvar_SetValue (gl_texsort, 1); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); @@ -838,14 +838,14 @@ 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->int_val) @@ -963,7 +963,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; @@ -1000,7 +1000,7 @@ void R_DrawWorld (void) // LordHavoc: anyone without multitexture won't want texsort 0 anyway... if (!gl_mtexable) - gl_texsort->value = 1; + Cvar_SetValue (gl_texsort, 1); glColor3f (1.0, 1.0, 1.0); memset (lightmap_polys, 0, sizeof(lightmap_polys)); @@ -1015,7 +1015,7 @@ void R_DrawWorld (void) DrawTextureChains (); - if (gl_texsort->value) + if (gl_texsort->int_val) R_BlendLightmaps (); if (gl_fb_bmodels->int_val) @@ -1039,7 +1039,7 @@ 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; if (mirror) @@ -1048,7 +1048,7 @@ void R_MarkLeaves (void) 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); @@ -1209,7 +1209,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) { @@ -1297,7 +1297,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; @@ -1328,7 +1328,7 @@ void GL_BuildLightmaps (void) } } - if (gl_mtexable && !gl_texsort->value) + if (gl_mtexable && !gl_texsort->int_val) qglSelectTexture (gl_mtex_enum+1); // @@ -1351,7 +1351,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); } diff --git a/source/gl_screen.c b/source/gl_screen.c index 61fe8b8..559edd1 100644 --- a/source/gl_screen.c +++ b/source/gl_screen.c @@ -343,7 +343,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; @@ -355,7 +355,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 { @@ -449,7 +449,7 @@ SCR_DrawRam */ void SCR_DrawRam (void) { - if (!scr_showram->value) + if (!scr_showram->int_val) return; if (!r_cache_thrash) @@ -467,7 +467,7 @@ void SCR_DrawTurtle (void) { static int count; - if (!scr_showturtle->value) + if (!scr_showturtle->int_val) return; if (host_frametime < 0.1) @@ -499,7 +499,7 @@ void SCR_DrawFPS (void) int x, y; char st[80]; - if (!show_fps->value) + if (!show_fps->int_val) return; t = Sys_DoubleTime(); @@ -525,7 +525,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) @@ -896,7 +896,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; @@ -917,7 +917,7 @@ void SCR_UpdateScreen (void) GL_BeginRendering (&glx, &gly, &glwidth, &glheight); - if (r_speeds->value) + if (r_speeds->int_val) { time1 = Sys_DoubleTime (); c_brush_polys = 0; @@ -941,9 +941,9 @@ void SCR_UpdateScreen (void) // // LordHavoc: set lighthalf based on gl_lightmode cvar - if (lighthalf != (gl_lightmode->value != 0)) + if (lighthalf != (gl_lightmode->int_val != 0)) { - lighthalf = gl_lightmode->value != 0; + lighthalf = gl_lightmode->int_val != 0; R_ForceLightUpdate(); } @@ -981,7 +981,7 @@ void SCR_UpdateScreen (void) } else { - if (crosshair->value) + if (crosshair->int_val) Draw_Crosshair(); SCR_DrawRam (); @@ -998,7 +998,7 @@ void SCR_UpdateScreen (void) // also makes polyblend apply to whole screen glDisable(GL_TEXTURE_2D); glEnable(GL_BLEND); - brightness->value = bound(1, brightness->value, 5); + Cvar_SetValue (brightness, bound(1, brightness->value, 5)); if (lighthalf) // LordHavoc: render was done at half brightness f = brightness->value * 2; else @@ -1022,8 +1022,8 @@ void SCR_UpdateScreen (void) glEnd (); } glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - contrast->value = bound(0.2, contrast->value, 1.0); - if ((gl_polyblend->value && v_blend[3]) || contrast->value < 1) + Cvar_SetValue (contrast, bound(0.2, contrast->value, 1.0)); + if ((gl_polyblend->int_val && v_blend[3]) || contrast->value < 1) { glBegin (GL_QUADS); if (contrast->value < 1) @@ -1034,7 +1034,7 @@ void SCR_UpdateScreen (void) glVertex2f (vid.width, vid.height); 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); @@ -1050,7 +1050,7 @@ void SCR_UpdateScreen (void) V_UpdatePalette (); - if (r_speeds->value) + if (r_speeds->int_val) { // glFinish (); time2 = Sys_DoubleTime (); diff --git a/source/gl_warp.c b/source/gl_warp.c index fd7657b..dc46c57 100644 --- a/source/gl_warp.c +++ b/source/gl_warp.c @@ -676,7 +676,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; diff --git a/source/host.c b/source/host.c index 8a82967..cec37e7 100644 --- a/source/host.c +++ b/source/host.c @@ -725,12 +725,12 @@ void _Host_Frame (float time) } // 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 @@ -744,7 +744,7 @@ void _Host_Frame (float time) CDAudio_Update(); - if (host_speeds->value) + if (host_speeds->int_val) { pass1 = (time1 - time3)*1000; time3 = Sys_DoubleTime (); @@ -765,7 +765,7 @@ void Host_Frame (float time) static int timecount; int i, c, m; - if (!serverprofile->value) + if (!serverprofile->int_val) { _Host_Frame (time); return; diff --git a/source/host_cmd.c b/source/host_cmd.c index 24ac21c..4358411 100644 --- a/source/host_cmd.c +++ b/source/host_cmd.c @@ -1095,7 +1095,7 @@ void Host_Say(qboolean teamonly) { if (!client || !client->active || !client->spawned) continue; - if (teamplay->value && teamonly && client->edict->v.team != save->edict->v.team) + if (teamplay->int_val && teamonly && client->edict->v.team != save->edict->v.team) continue; host_client = client; SV_ClientPrintf("%s", text); @@ -1182,7 +1182,7 @@ void Host_Color_f(void) if (Cmd_Argc() == 1) { - Con_Printf ("\"color\" is \"%i %i\"\n", ((int)cl_color->value) >> 4, ((int)cl_color->value) & 0x0f); + Con_Printf ("\"color\" is \"%i %i\"\n", (cl_color->int_val) >> 4, (cl_color->int_val) & 0x0f); Con_Printf ("color <0-13> [0-13]\n"); return; } @@ -1259,7 +1259,7 @@ void Host_Pause_f (void) Cmd_ForwardToServer (); return; } - if (!pausable->value) + if (!pausable->int_val) SV_ClientPrintf ("Pause not allowed.\n"); else { diff --git a/source/in_dos.c b/source/in_dos.c index 81ec5cc..9389767 100644 --- a/source/in_dos.c +++ b/source/in_dos.c @@ -122,7 +122,7 @@ qboolean IN_ReadJoystick (void); void Toggle_AuxLook_f (void) { - if (aux_look->value) + if (aux_look->int_val) Cvar_Set ("auxlook","0"); else Cvar_Set ("auxlook","1"); @@ -236,7 +236,7 @@ void IN_Commands (void) { joy_buttonstate = ((dos_inportb(0x201) >> 4)&15)^15; // perform button actions - for (i=0 ; ivalue ; i++) + for (i=0 ; iint_val ; i++) { if ( (joy_buttonstate & (1<value) + if (m_filter->int_val) { mouse_x = (mx + old_mouse_x) * 0.5; mouse_y = (my + old_mouse_y) * 0.5; @@ -312,7 +312,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 && (in_mlook.state & 1) )) + if ( (in_strafe.state & 1) || (lookstrafe->int_val && (in_mlook.state & 1) )) cmd->sidemove += m_side->value * mouse_x; else cl.viewangles[YAW] -= m_yaw->value * mouse_x; @@ -346,7 +346,7 @@ void IN_JoyMove (usercmd_t *cmd) { float speed, aspeed; - if (!joy_avail || !in_joystick->value) + if (!joy_avail || !in_joystick->int_val) return; IN_ReadJoystick (); @@ -617,7 +617,7 @@ Con_DPrintf("OUT: y:%f p:%f r:%f f:%f s:%f u:%f\n", extern_control->viewangles[Y if (cl.viewangles[PITCH] < -70) cl.viewangles[PITCH] = -70; - freelook = (extern_control->flags & AUX_FLAG_FREELOOK || aux_look->value || in_mlook.state & 1); + freelook = (extern_control->flags & AUX_FLAG_FREELOOK || aux_look->int_val || in_mlook.state & 1); if (freelook) V_StopPitchDrift (); diff --git a/source/in_sun.c b/source/in_sun.c index 184c4e6..a6f2e59 100644 --- a/source/in_sun.c +++ b/source/in_sun.c @@ -103,7 +103,7 @@ void IN_CenterMouse( void ) // static void CheckMouseState(void) { - if (x_focus && _windowed_mouse->value && !x_grabbed) { + if (x_focus && _windowed_mouse->int_val && !x_grabbed) { x_grabbed = true; printf("fooling with mouse!\n"); if (XGetPointerControl( x_disp, &x_mouse_num, &x_mouse_denom, &x_mouse_thresh )) @@ -125,7 +125,7 @@ static void CheckMouseState(void) // safe initial values x_root = x_root_old = vid.width >> 1; y_root = y_root_old = vid.height >> 1; - } else if (x_grabbed && (!_windowed_mouse->value || !x_focus)) { + } else if (x_grabbed && (!_windowed_mouse->int_val || !x_focus)) { printf("fooling with mouse!\n"); x_grabbed = false; // undo mouse warp @@ -235,7 +235,7 @@ IN_Move (usercmd_t *cmd) } // add mouse X/Y movement to cmd - if ((in_strafe.state & 1) || (lookstrafe->value && (in_mlook.state & 1))) + if ((in_strafe.state & 1) || (lookstrafe->int_val && (in_mlook.state & 1))) cmd->sidemove += m_side->value * dx; else cl.viewangles[YAW] -= m_yaw->value * dx; diff --git a/source/in_svgalib.c b/source/in_svgalib.c index ad36c81..9cf94f1 100644 --- a/source/in_svgalib.c +++ b/source/in_svgalib.c @@ -347,7 +347,7 @@ void IN_Move(usercmd_t *cmd) while (mouse_update()) ; - if (m_filter->value) { + if (m_filter->int_val) { mouse_x = (mx + old_mouse_x) * 0.5; mouse_y = (my + old_mouse_y) * 0.5; } else { @@ -364,7 +364,7 @@ void IN_Move(usercmd_t *cmd) /* Add mouse X/Y movement to cmd */ if ( (in_strafe.state & 1) || - (lookstrafe->value && (in_mlook.state & 1) )) { + (lookstrafe->int_val && (in_mlook.state & 1) )) { cmd->sidemove += m_side->value * mouse_x; } else { cl.viewangles[YAW] -= m_yaw->value * mouse_x; diff --git a/source/in_win.c b/source/in_win.c index c857a07..9ac3b03 100644 --- a/source/in_win.c +++ b/source/in_win.c @@ -689,7 +689,7 @@ void IN_MouseMove (usercmd_t *cmd) //if (mx || my) // Con_DPrintf("mx=%d, my=%d\n", mx, my); - if (m_filter->value) + if (m_filter->int_val) { mouse_x = (mx + old_mouse_x) * 0.5; mouse_y = (my + old_mouse_y) * 0.5; @@ -707,7 +707,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 && (in_mlook.state & 1) )) + if ( (in_strafe.state & 1) || (lookstrafe->int_val && (in_mlook.state & 1) )) cmd->sidemove += m_side->value * mouse_x; else cl.viewangles[YAW] -= m_yaw->value * mouse_x; @@ -913,7 +913,7 @@ void Joy_AdvancedUpdate_f (void) pdwRawValue[i] = RawValuePointer(i); } - if( joy_advanced->value == 0.0) + if( joy_advanced->int_val == 0.0) { // default joystick initialization // 2 axes only with joystick control @@ -932,22 +932,22 @@ 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; } @@ -1051,7 +1051,7 @@ 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; } @@ -1089,7 +1089,7 @@ 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; } @@ -1114,7 +1114,7 @@ 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) { @@ -1136,7 +1136,7 @@ void IN_JoyMove (usercmd_t *cmd) switch (dwAxisMap[i]) { case AxisForward: - if ((joy_advanced->value == 0.0) && (in_mlook.state & 1)) + if ((!joy_advanced->int_val) && (in_mlook.state & 1)) { // user wants forward control to become look control if (fabs(fAxisValue) > joy_pitchthreshold->value) @@ -1159,7 +1159,7 @@ 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(); } } @@ -1181,7 +1181,7 @@ void IN_JoyMove (usercmd_t *cmd) break; case AxisTurn: - if ((in_strafe.state & 1) || (lookstrafe->value && (in_mlook.state & 1))) + if ((in_strafe.state & 1) || (lookstrafe->int_val && (in_mlook.state & 1))) { // user wants turn control to become side control if (fabs(fAxisValue) > joy_sidethreshold->value) @@ -1229,7 +1229,7 @@ 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(); } } diff --git a/source/in_x11.c b/source/in_x11.c index 870a27b..72dfec3 100644 --- a/source/in_x11.c +++ b/source/in_x11.c @@ -267,15 +267,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: %s\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); @@ -303,10 +303,10 @@ void IN_Commands (void) { JOY_Command (); - if (old__windowed_mouse != _windowed_mouse->value) { - old__windowed_mouse = _windowed_mouse->value; + if (old__windowed_mouse != _windowed_mouse->int_val) { + old__windowed_mouse = _windowed_mouse->int_val; - if (!_windowed_mouse->value) { + if (!_windowed_mouse->int_val) { /* ungrab the pointer */ XUngrabPointer(x_disp,CurrentTime); } else { @@ -336,7 +336,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; } @@ -347,7 +347,7 @@ IN_Move (usercmd_t *cmd) mouse_x *= sensitivity->value; mouse_y *= sensitivity->value; - if ( (in_strafe.state & 1) || (lookstrafe->value && (in_mlook.state & 1) )) + if ( (in_strafe.state & 1) || (lookstrafe->int_val && (in_mlook.state & 1) )) cmd->sidemove += m_side->value * mouse_x; else cl.viewangles[YAW] -= m_yaw->value * mouse_x; @@ -371,14 +371,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 - _windowed_mouse->value = !_windowed_mouse->value; + Cvar_SetValue (_windowed_mouse, !_windowed_mouse->int_val); break; } } @@ -444,7 +444,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); diff --git a/source/menu.c b/source/menu.c index e9a59bd..30fa1db 100644 --- a/source/menu.c +++ b/source/menu.c @@ -731,8 +731,8 @@ void M_Menu_Setup_f (void) m_entersound = true; strcpy(setup_myname, cl_name->string); strcpy(setup_hostname, hostname->string); - setup_top = setup_oldtop = ((int)cl_color->value) >> 4; - setup_bottom = setup_oldbottom = ((int)cl_color->value) & 15; + setup_top = setup_oldtop = (cl_color->int_val) >> 4; + setup_bottom = setup_oldbottom = (cl_color->int_val) & 15; } @@ -1099,7 +1099,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 @@ -1141,15 +1141,15 @@ 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 14: // _windowed_mouse - Cvar_SetValue(_windowed_mouse, !_windowed_mouse->value); + Cvar_SetValue(_windowed_mouse, !_windowed_mouse->int_val); break; } } @@ -1238,7 +1238,7 @@ void M_Options_Draw (void) #endif if (_windowed_mouse) { M_Print (16, 144, " Use Mouse"); - M_DrawCheckbox (220, 144, _windowed_mouse->value); + M_DrawCheckbox (220, 144, _windowed_mouse->int_val); } #ifdef _WIN32 } @@ -2572,7 +2572,7 @@ void M_GameOptions_Draw (void) M_Print (160, 56, va("%i", maxplayers) ); M_Print (0, 64, " Game Type"); - if (coop->value) + if (coop->int_val) M_Print (160, 64, "Cooperative"); else M_Print (160, 64, "Deathmatch"); @@ -2582,7 +2582,7 @@ void M_GameOptions_Draw (void) { char *msg; - switch((int)teamplay->value) + switch(teamplay->int_val) { case 1: msg = "No Friendly Fire"; break; case 2: msg = "Friendly Fire"; break; @@ -2598,7 +2598,7 @@ void M_GameOptions_Draw (void) { char *msg; - switch((int)teamplay->value) + switch(teamplay->int_val) { case 1: msg = "No Friendly Fire"; break; case 2: msg = "Friendly Fire"; break; @@ -2608,26 +2608,26 @@ void M_GameOptions_Draw (void) } M_Print (0, 80, " Skill"); - if (skill->value == 0) + if (skill->int_val == 0) M_Print (160, 80, "Easy difficulty"); - else if (skill->value == 1) + else if (skill->int_val == 1) M_Print (160, 80, "Normal difficulty"); - else if (skill->value == 2) + else if (skill->int_val == 2) M_Print (160, 80, "Hard difficulty"); else M_Print (160, 80, "Nightmare difficulty"); M_Print (0, 88, " Frag Limit"); - if (fraglimit->value == 0) + if (fraglimit->int_val == 0) M_Print (160, 88, "none"); else - M_Print (160, 88, va("%i frags", (int)fraglimit->value)); + M_Print (160, 88, va("%i frags", fraglimit->int_val)); M_Print (0, 96, " Time Limit"); - if (timelimit->value == 0) + if (timelimit->int_val == 0) M_Print (160, 96, "none"); else - M_Print (160, 96, va("%i minutes", (int)timelimit->value)); + M_Print (160, 96, va("%i minutes", timelimit->int_val)); M_Print (0, 112, " Episode"); //MED 01/06/97 added hipnotic episodes @@ -2700,7 +2700,7 @@ void M_NetStart_Change (int dir) break; case 2: - Cvar_SetValue(coop, coop->value ? 0 : 1); + Cvar_SetValue(coop, coop->int_val ? 0 : 1); break; case 3: @@ -2709,34 +2709,34 @@ void M_NetStart_Change (int dir) else count = 2; - Cvar_SetValue(teamplay, teamplay->value + dir); - if (teamplay->value > count) + Cvar_SetValue(teamplay, teamplay->int_val + dir); + if (teamplay->int_val > count) Cvar_SetValue(teamplay, 0); - else if (teamplay->value < 0) + else if (teamplay->int_val < 0) Cvar_SetValue(teamplay, count); break; case 4: - Cvar_SetValue(skill, skill->value + dir); - if (skill->value > 3) + Cvar_SetValue(skill, skill->int_val + dir); + if (skill->int_val > 3) Cvar_SetValue(skill, 0); - if (skill->value < 0) + if (skill->int_val < 0) Cvar_SetValue(skill, 3); break; case 5: - Cvar_SetValue(fraglimit, fraglimit->value + dir*10); - if (fraglimit->value > 100) + Cvar_SetValue(fraglimit, fraglimit->int_val + dir*10); + if (fraglimit->int_val > 100) Cvar_SetValue(fraglimit, 0); - if (fraglimit->value < 0) + if (fraglimit->int_val < 0) Cvar_SetValue(fraglimit, 100); break; case 6: - Cvar_SetValue(timelimit, timelimit->value + dir*5); - if (timelimit->value > 60) + Cvar_SetValue(timelimit, timelimit->int_val + dir*5); + if (timelimit->int_val > 60) Cvar_SetValue(timelimit, 0); - if (timelimit->value < 0) + if (timelimit->int_val < 0) Cvar_SetValue(timelimit, 60); break; @@ -2749,7 +2749,7 @@ void M_NetStart_Change (int dir) //PGM 03/02/97 added 1 for dmatch episode else if (rogue) count = 4; - else if (registered->value) + else if (registered->int_val) count = 7; else count = 2; diff --git a/source/net_main.c b/source/net_main.c index 5927872..a3b21fa 100644 --- a/source/net_main.c +++ b/source/net_main.c @@ -951,11 +951,11 @@ void NET_Poll(void) { if (serialAvailable) { - if (config_com_modem->value == 1.0) + if (config_com_modem->int_val) useModem = true; else useModem = false; - SetComPortConfig (0, (int)config_com_port->value, (int)config_com_irq->value, (int)config_com_baud->value, useModem); + SetComPortConfig (0, config_com_port->int_val, config_com_irq->int_val, config_com_baud->int_val, useModem); SetModemConfig (0, config_modem_dialtype->string, config_modem_clear->string, config_modem_init->string, config_modem_hangup->string); } configRestored = true; @@ -1002,7 +1002,7 @@ void SchedulePollProcedure(PollProcedure *proc, double timeOffset) qboolean IsID(struct qsockaddr *addr) { - if (idgods->value == 0.0) + if (!idgods->int_val) return false; if (addr->sa_family != 2) diff --git a/source/pr_cmds.c b/source/pr_cmds.c index 5be5bb3..ca7c2a3 100644 --- a/source/pr_cmds.c +++ b/source/pr_cmds.c @@ -1380,7 +1380,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; @@ -1399,7 +1399,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] diff --git a/source/pr_edict.c b/source/pr_edict.c index 7d813b4..cc050a3 100644 --- a/source/pr_edict.c +++ b/source/pr_edict.c @@ -948,7 +948,7 @@ void ED_LoadFromFile (char *data) data = ED_ParseEdict (data, ent); // remove things from different skill levels or deathmatch - if (deathmatch->value) + if (deathmatch->int_val) { if (((int)ent->v.spawnflags & SPAWNFLAG_NOT_DEATHMATCH)) { diff --git a/source/quakefs.c b/source/quakefs.c index acf378f..60d4c38 100644 --- a/source/quakefs.c +++ b/source/quakefs.c @@ -460,7 +460,7 @@ COM_FOpenFile (char *filename, QFile **gzfile) #endif if (fn) { // found it! - if (developer->value) + if (developer->int_val) Sys_Printf ("PackFile: %s : %s\n",pak->filename, fn); // open a new file on the pakfile *gzfile=COM_OpenRead(pak->filename,pak->files[i].filepos, @@ -487,7 +487,7 @@ COM_FOpenFile (char *filename, QFile **gzfile) continue; } - if(developer->value) + if(developer->int_val) Sys_Printf ("FindFile: %s\n",netpath); *gzfile=COM_OpenRead(netpath,-1,-1); diff --git a/source/r_edge.c b/source/r_edge.c index 9d808f2..20d745e 100644 --- a/source/r_edge.c +++ b/source/r_edge.c @@ -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; diff --git a/source/r_main.c b/source/r_main.c index b7bacce..0687f02 100644 --- a/source/r_main.c +++ b/source/r_main.c @@ -271,7 +271,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; @@ -295,7 +295,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,7 +343,7 @@ void R_SetVrect (vrect_t *pvrectin, vrect_t *pvrect, int lineadj) } size /= 100; - if (!cl_sbar->value && full) + if (!cl_sbar->int_val && full) h = pvrectin->height; else h = pvrectin->height - lineadj; @@ -362,7 +362,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 { @@ -574,7 +574,7 @@ void R_DrawEntitiesOnList (void) vec3_t dist; float add; - if (!r_drawentities->value) + if (!r_drawentities->int_val) return; for (i=0 ; ivalue || r_fov_greater_than_90) + if (!r_drawviewmodel->int_val || r_fov_greater_than_90) return; if (cl.items & IT_INVISIBILITY) @@ -788,7 +788,7 @@ void R_DrawBEntitiesOnList (void) model_t *clmodel; float minmaxs[6]; - if (!r_drawentities->value) + if (!r_drawentities->int_val) return; VectorCopy (modelorg, oldorigin); @@ -945,7 +945,7 @@ void R_EdgeDrawing (void) R_BeginEdgeFrame (); - if (r_dspeeds->value) + if (r_dspeeds->int_val) { rw_time1 = Sys_DoubleTime (); } @@ -959,7 +959,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; @@ -967,13 +967,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 @@ -998,7 +998,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 (); @@ -1018,7 +1018,7 @@ SetVisibilityByPassages (); if (!cl_entities[0].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 @@ -1027,14 +1027,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; @@ -1042,7 +1042,7 @@ SetVisibilityByPassages (); R_DrawEntitiesOnList (); - if (r_dspeeds->value) + if (r_dspeeds->int_val) { de_time2 = Sys_DoubleTime (); dv_time1 = de_time2; @@ -1050,7 +1050,7 @@ SetVisibilityByPassages (); R_DrawViewModel (); - if (r_dspeeds->value) + if (r_dspeeds->int_val) { dv_time2 = Sys_DoubleTime (); dp_time1 = Sys_DoubleTime (); @@ -1058,7 +1058,7 @@ SetVisibilityByPassages (); R_DrawParticles (); - if (r_dspeeds->value) + if (r_dspeeds->int_val) dp_time2 = Sys_DoubleTime (); if (r_dowarp) @@ -1066,22 +1066,22 @@ SetVisibilityByPassages (); V_SetContentsColor (r_viewleaf->contents); - if (r_timegraph->value) + if (r_timegraph->int_val) R_TimeGraph (); - 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 diff --git a/source/r_misc.c b/source/r_misc.c index abe6661..bc0f83e 100644 --- a/source/r_misc.c +++ b/source/r_misc.c @@ -45,11 +45,11 @@ R_CheckVariables */ void R_CheckVariables (void) { - static float oldbright; + static int oldbright; - if (r_fullbright->value != oldbright) + if (r_fullbright->int_val != oldbright) { - oldbright = r_fullbright->value; + oldbright = r_fullbright->int_val; D_FlushCaches (); // so all lighting changes } } @@ -136,7 +136,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>s) h = s; @@ -394,7 +394,7 @@ void R_SetupFrame (void) Cvar_Set(r_drawflat, "0"); } - if (r_numsurfs->value) + if (r_numsurfs->int_val) { if ((surface_p - surfaces) > r_maxsurfsseen) r_maxsurfsseen = surface_p - surfaces; @@ -403,7 +403,7 @@ void R_SetupFrame (void) surf_max - surfaces, r_maxsurfsseen); } - if (r_numedges->value) + if (r_numedges->int_val) { edgecount = edge_p - r_edges; @@ -420,7 +420,7 @@ void R_SetupFrame (void) r_refdef.ambientlight = 0; if (!sv.active) - r_draworder->value = 0; // don't let cheaters look behind walls + Cvar_SetValue (r_draworder, 0); // don't let cheaters look behind walls R_CheckVariables (); @@ -451,7 +451,7 @@ r_refdef.viewangles[2]= 0; 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 || lcd_x->value) { diff --git a/source/r_part.c b/source/r_part.c index a862577..9ce4cdc 100644 --- a/source/r_part.c +++ b/source/r_part.c @@ -565,7 +565,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); diff --git a/source/r_surf.c b/source/r_surf.c index c05ed34..85b2a8b 100644 --- a/source/r_surf.c +++ b/source/r_surf.c @@ -174,7 +174,7 @@ void R_BuildLightMap (void) size = smax*tmax; lightmap = surf->samples; - if (r_fullbright->value || !cl.worldmodel->lightdata) + if (r_fullbright->int_val || !cl.worldmodel->lightdata) { for (i=0 ; iorigin[2] - oldz > 0) else oldz = ent->origin[2]; - if (chase_active->value) + if (chase_active->int_val) Chase_Update (); } diff --git a/source/sbar.c b/source/sbar.c index 8c25623..8c50744 100644 --- a/source/sbar.c +++ b/source/sbar.c @@ -273,7 +273,7 @@ Sbar_DrawPic */ void Sbar_DrawPic (int x, int y, qpic_t *pic) { - if ((cl_sbar->value && !cl.gametype == GAME_DEATHMATCH) && (hipnotic || rogue)) + if ((cl_sbar->int_val && !cl.gametype == GAME_DEATHMATCH) && (hipnotic || rogue)) Draw_Pic (x + ((vid.width - 320)>>1), y + (vid.height-SBAR_HEIGHT), pic); else Draw_Pic (x, y + (vid.height-SBAR_HEIGHT), pic); @@ -288,7 +288,7 @@ JACK: Draws a portion of the picture in the status bar. void Sbar_DrawSubPic(int x, int y, qpic_t *pic, int srcx, int srcy, int width, int height) { - if ((cl_sbar->value && !cl.gametype == GAME_DEATHMATCH) && (hipnotic || rogue)) + if ((cl_sbar->int_val && !cl.gametype == GAME_DEATHMATCH) && (hipnotic || rogue)) Draw_SubPic (x + ((vid.width - 320)>>1), y + (vid.height - SBAR_HEIGHT), pic, srcx, srcy, width, height); else Draw_SubPic (x, y + (vid.height - SBAR_HEIGHT), pic, srcx, srcy, width, height); @@ -301,7 +301,7 @@ Sbar_DrawTransPic */ void Sbar_DrawTransPic (int x, int y, qpic_t *pic) { - if ((cl_sbar->value && !cl.gametype == GAME_DEATHMATCH) && (hipnotic || rogue)) + if ((cl_sbar->int_val && !cl.gametype == GAME_DEATHMATCH) && (hipnotic || rogue)) Draw_TransPic (x + ((vid.width - 320)>>1), y + (vid.height-SBAR_HEIGHT), pic); else Draw_TransPic (x, y + (vid.height-SBAR_HEIGHT), pic); @@ -316,7 +316,7 @@ Draws one solid graphics character */ void Sbar_DrawCharacter (int x, int y, int num) { - if ((cl_sbar->value && !cl.gametype == GAME_DEATHMATCH) && (hipnotic || rogue)) + if ((cl_sbar->int_val && !cl.gametype == GAME_DEATHMATCH) && (hipnotic || rogue)) Draw_Character8 (x + ((vid.width - 320)>>1) + 4 , y + vid.height-SBAR_HEIGHT, num); else Draw_Character8 (x + 4 , y + vid.height-SBAR_HEIGHT, num); @@ -329,7 +329,7 @@ Sbar_DrawString */ void Sbar_DrawString (int x, int y, char *str) { - if ((cl_sbar->value && !cl.gametype == GAME_DEATHMATCH) && (hipnotic || rogue)) + if ((cl_sbar->int_val && !cl.gametype == GAME_DEATHMATCH) && (hipnotic || rogue)) Draw_String8 (x + ((vid.width - 320)>>1), y+ vid.height-SBAR_HEIGHT, str); else Draw_String8 (x, y+ vid.height-SBAR_HEIGHT, str); @@ -529,8 +529,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->value<100); + hudswap = cl_hudswap->int_val; if (hipnotic) headsup = false; @@ -795,7 +795,7 @@ void Sbar_DrawFace (void) // PGM 01/19/97 - team color drawing // PGM 03/02/97 - fixed so color swatch only appears in CTF modes if (rogue && (cl.maxclients != 1) - && (teamplay->value > 3) && (teamplay->value < 7)) { + && (teamplay->int_val > 3) && (teamplay->int_val < 7)) { int top, bottom; int xofs; @@ -882,7 +882,7 @@ Sbar_DrawNormal */ void Sbar_DrawNormal (void) { - if (cl_sbar->value || scr_viewsize->value < 100) + if (cl_sbar->int_val || scr_viewsize->value < 100) Sbar_DrawPic (0, 0, sb_sbar); if (hipnotic) { @@ -961,7 +961,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->value<100); if ((sb_updates >= vid.numpages) && !headsup) return; diff --git a/source/screen.c b/source/screen.c index e0d893c..d59dfc3 100644 --- a/source/screen.c +++ b/source/screen.c @@ -373,7 +373,7 @@ SCR_DrawRam */ void SCR_DrawRam (void) { - if (!scr_showram->value) + if (!scr_showram->int_val) return; if (!r_cache_thrash) @@ -391,7 +391,7 @@ void SCR_DrawTurtle (void) { static int count; - if (!scr_showturtle->value) + if (!scr_showturtle->int_val) return; if (host_frametime < 0.1) @@ -431,7 +431,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) @@ -890,9 +890,9 @@ void SCR_UpdateScreen (void) 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; } diff --git a/source/snd_dma.c b/source/snd_dma.c index 559b318..b3a4914 100644 --- a/source/snd_dma.c +++ b/source/snd_dma.c @@ -354,13 +354,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; @@ -485,7 +485,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; @@ -812,7 +812,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_(); } @@ -1009,7 +1009,7 @@ void S_LocalSound (char *sound) { sfx_t *sfx; - if (nosound->value) + if (nosound->int_val) return; if (!sound_started) return; diff --git a/source/snd_mem.c b/source/snd_mem.c index 42c92b7..6f162dd 100644 --- a/source/snd_mem.c +++ b/source/snd_mem.c @@ -68,7 +68,7 @@ void ResampleSfx (sfx_t *sfx, int inrate, int inwidth, byte *data) sc->loopstart = sc->loopstart / stepscale; sc->speed = shm->speed; - if (loadas8bit->value) + if (loadas8bit->int_val) sc->width = 1; else sc->width = inwidth; diff --git a/source/sv_main.c b/source/sv_main.c index e77457d..d882ad0 100644 --- a/source/sv_main.c +++ b/source/sv_main.c @@ -205,7 +205,7 @@ void SV_SendServerinfo (client_t *client) MSG_WriteLong (&client->message, PROTOCOL_VERSION); MSG_WriteByte (&client->message, svs.maxclients); - if (!coop->value && deathmatch->value) + if (!coop->int_val && deathmatch->int_val) MSG_WriteByte (&client->message, GAME_DEATHMATCH); else MSG_WriteByte (&client->message, GAME_COOP); @@ -1071,9 +1071,9 @@ void SV_SpawnServer (char *server) // // make cvars consistant // - if (coop->value) + if (coop->int_val) Cvar_SetValue(deathmatch, 0); - current_skill = (int)(skill->value + 0.5); + current_skill = skill->int_val; if (current_skill < 0) current_skill = 0; if (current_skill > 3) @@ -1164,10 +1164,10 @@ void SV_SpawnServer (char *server) ent->v.solid = SOLID_BSP; ent->v.movetype = MOVETYPE_PUSH; - if (coop->value) - pr_global_struct->coop = coop->value; + if (coop->int_val) + pr_global_struct->coop = coop->int_val; else - pr_global_struct->deathmatch = deathmatch->value; + pr_global_struct->deathmatch = deathmatch->int_val; pr_global_struct->mapname = sv.name - pr_strings; #ifdef QUAKE2 diff --git a/source/sv_phys.c b/source/sv_phys.c index 4b57fa0..9d23c56 100644 --- a/source/sv_phys.c +++ b/source/sv_phys.c @@ -999,7 +999,7 @@ void SV_WalkMove (edict_t *ent) if (ent->v.movetype != MOVETYPE_WALK) return; // gibbed by a trigger - if (sv_nostep->value) + if (sv_nostep->int_val) return; if ( (int)sv_player->v.flags & FL_WATERJUMP ) diff --git a/source/sw_view.c b/source/sw_view.c index 680d15b..865f7be 100644 --- a/source/sw_view.c +++ b/source/sw_view.c @@ -181,9 +181,9 @@ void V_RenderView (void) R_RenderView (); } - if (crosshair->value) - Draw_Character8 (scr_vrect.x + scr_vrect.width/2 + cl_crossx->value, - scr_vrect.y + scr_vrect.height/2 + cl_crossy->value, '+'); + if (crosshair->int_val) + Draw_Character8 (scr_vrect.x + scr_vrect.width/2 + cl_crossx->int_val, + scr_vrect.y + scr_vrect.height/2 + cl_crossy->int_val, '+'); } void diff --git a/source/sys_dos.c b/source/sys_dos.c index 674db4b..692ffc5 100644 --- a/source/sys_dos.c +++ b/source/sys_dos.c @@ -583,7 +583,7 @@ void Sys_Quit (void) // load the sell screen before shuting everything down - if (registered->value) + if (registered->int_val) d = COM_LoadHunkFile ("end2.bin"); else d = COM_LoadHunkFile ("end1.bin"); diff --git a/source/sys_unix.c b/source/sys_unix.c index ccad267..f9c5bb6 100644 --- a/source/sys_unix.c +++ b/source/sys_unix.c @@ -270,7 +270,7 @@ Sys_Printf (char *fmt, ...) if (nostdout) return; - if (timestamps && timeformat && timestamps->value && timeformat->string) { + if (timestamps && timeformat && timestamps->int_val && timeformat->string) { mytime = time (NULL); local = localtime (&mytime); strftime (stamp, sizeof (stamp), timeformat->string, local); diff --git a/source/sys_unixd.c b/source/sys_unixd.c index 9d8407c..1aa8bb3 100644 --- a/source/sys_unixd.c +++ b/source/sys_unixd.c @@ -261,7 +261,7 @@ Sys_Printf (char *fmt, ...) if (nostdout) return; - if (timestamps && timeformat && timestamps && timeformat && timeformat->string && timestamps->value) { + if (timestamps && timeformat && timestamps && timeformat && timeformat->string && timestamps->int_val) { mytime = time (NULL); local = localtime (&mytime); strftime (stamp, sizeof (stamp), timeformat->string, local); diff --git a/source/vid_dos.c b/source/vid_dos.c index eaa5a28..f91390b 100644 --- a/source/vid_dos.c +++ b/source/vid_dos.c @@ -131,7 +131,7 @@ void VID_Init (unsigned char *palette) vid_testingmode = 0; - vid_modenum = vid_mode->value; + vid_modenum = vid_mode->int_val; VID_SetMode (vid_modenum, palette); @@ -338,13 +338,13 @@ VID_Update */ void VID_Update (vrect_t *rects) { - if (firstupdate && _vid_default_mode->value) + if (firstupdate && _vid_default_mode->int_val) { - if(_vid_default_mode->value >= numvidmodes) + if(_vid_default_mode->int_val >= numvidmodes) Cvar_SetValue(_vid_default_mode, 0); firstupdate = 0; - Cvar_SetValue(vid_mode, _vid_default_mode->value); + Cvar_SetValue(vid_mode, _vid_default_mode->int_val); } (*pcurrentmode->swapbuffers)(&vid, pcurrentmode, rects); @@ -361,9 +361,9 @@ void VID_Update (vrect_t *rects) } else { - if (vid_mode->value != vid_realmode) + if (vid_mode->int_val != vid_realmode) { - VID_SetMode ((int)vid_mode->value, vid_current_palette); + VID_SetMode (vid_mode->int_val, vid_current_palette); Cvar_SetValue(vid_mode, (float)vid_modenum); // so if mode set fails, we don't keep on // trying to set that mode @@ -440,7 +440,7 @@ void VID_DescribeModes_f (void) Con_Printf ("\n%s\n", pheader); if (VGA_CheckAdequateMem (pv->width, pv->height, pv->rowbytes, - (pv->numpages == 1) || vid_nopageflip->value)) + (pv->numpages == 1) || vid_nopageflip->int_val)) { Con_Printf ("%2d: %s\n", i, pinfo); } @@ -472,7 +472,7 @@ char *VID_GetModeDescription (int mode) pinfo = VID_ModeInfo (mode, &pheader); if (VGA_CheckAdequateMem (pv->width, pv->height, pv->rowbytes, - (pv->numpages == 1) || vid_nopageflip->value)) + (pv->numpages == 1) || vid_nopageflip->int_val)) { return pinfo; } @@ -682,7 +682,7 @@ void VID_MenuDraw (void) ptr = VID_GetModeDescription (vid_modenum); snprintf (temp, sizeof(temp), "D to make %s the default", ptr); M_Print (6*8, 36 + MAX_COLUMN_SIZE * 8 + 8*5, temp); - ptr = VID_GetModeDescription ((int)_vid_default_mode->value); + ptr = VID_GetModeDescription (_vid_default_mode->int_val); if (ptr) { diff --git a/source/vid_ext.c b/source/vid_ext.c index 12e9cce..8ebc786 100644 --- a/source/vid_ext.c +++ b/source/vid_ext.c @@ -596,7 +596,7 @@ int VID_ExtraInitMode (viddef_t *lvid, vmode_t *pcurrentmode) pextra = pcurrentmode->pextradata; - if (vid_nopageflip->value) + if (vid_nopageflip->int_val) lvid->numpages = 1; else lvid->numpages = pcurrentmode->numpages; @@ -637,7 +637,7 @@ int VID_ExtraInitMode (viddef_t *lvid, vmode_t *pcurrentmode) if (!pextra->vga_incompatible && (lvid->numpages == 3) && de_exists && - (_vid_wait_override->value == 0.0)) + !_vid_wait_override->int_val) { Cvar_SetValue(vid_wait, (float)VID_WAIT_DISPLAY_ENABLE); @@ -646,7 +646,7 @@ int VID_ExtraInitMode (viddef_t *lvid, vmode_t *pcurrentmode) } else { - if ((lvid->numpages == 1) && (_vid_wait_override->value == 0.0)) + if ((lvid->numpages == 1) && !_vid_wait_override->int_val) { Cvar_SetValue(vid_wait, (float)VID_WAIT_NONE); VID_displayedpage = VID_currentpage = 0; @@ -734,9 +734,9 @@ void VID_ExtraSwapBuffers (viddef_t *lvid, vmode_t *pcurrentmode, // page flipped regs.x.ax = 0x4f07; - if (vid_wait->value != VID_WAIT_VSYNC) + if (vid_wait->int_val != VID_WAIT_VSYNC) { - if ((vid_wait->value == VID_WAIT_DISPLAY_ENABLE) && de_exists) + if ((vid_wait->int_val == VID_WAIT_DISPLAY_ENABLE) && de_exists) VID_ExtraWaitDisplayEnable (); regs.x.bx = VESA_DONT_WAIT_VSYNC; @@ -778,7 +778,7 @@ void VID_ExtraSwapBuffers (viddef_t *lvid, vmode_t *pcurrentmode, else { // non-page-flipped - if (vsync_exists && (vid_wait->value == VID_WAIT_VSYNC)) + if (vsync_exists && (vid_wait->int_val == VID_WAIT_VSYNC)) { VGA_WaitVsync (); } diff --git a/source/vid_ggi.c b/source/vid_ggi.c index 203b479..9eae715 100644 --- a/source/vid_ggi.c +++ b/source/vid_ggi.c @@ -912,15 +912,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 = (int)_windowed_mouse->int_val ? GII_CMDCODE_PREFER_RELPTR : GII_CMDCODE_PREFER_ABSPTR; ggiEventSend(ggivis, &ev); @@ -934,7 +934,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; } @@ -945,7 +945,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; diff --git a/source/vid_mgl.c b/source/vid_mgl.c index c11a930..64337c9 100644 --- a/source/vid_mgl.c +++ b/source/vid_mgl.c @@ -217,10 +217,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 ); @@ -381,7 +381,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; } @@ -1098,17 +1098,17 @@ void VID_CheckModedescFixup (int mode) 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; - if (vid_config_x->value < (320 << stretch)) - vid_config_x->value = 320 << stretch; + if (vid_config_x->int_val < (320 << stretch)) + vid_config_x->int_val = 320 << stretch; - if (vid_config_y->value < (200 << stretch)) - vid_config_y->value = 200 << stretch; + if (vid_config_y->int_val < (200 << stretch)) + 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; @@ -1384,8 +1384,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) @@ -1452,7 +1452,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; } @@ -1676,7 +1676,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 (); @@ -2072,7 +2072,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); } @@ -2084,7 +2084,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); } /* @@ -2386,8 +2386,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")) { @@ -2396,14 +2396,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; @@ -2413,13 +2413,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); } } @@ -2436,9 +2436,9 @@ 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); + VID_SetMode (vid_mode->int_val, vid_curpal); Cvar_SetValue (vid_mode, (float)vid_modenum); // so if mode set fails, we don't keep on // trying to set that mode @@ -2449,7 +2449,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 (); @@ -2830,7 +2830,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 (); @@ -2862,7 +2862,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 (); @@ -2880,7 +2880,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) { @@ -2946,7 +2946,7 @@ LONG WINAPI MainWndProc ( force_mode_set = false; } - VID_SetMode ((int)vid_fullscreen_mode->value, vid_curpal); + VID_SetMode ((int)vid_fullscreen_mode->int_val, vid_curpal); break; case SC_SCREENSAVE: @@ -3326,7 +3326,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) { diff --git a/source/vid_sdl.c b/source/vid_sdl.c index 9f3e203..a7099c3 100644 --- a/source/vid_sdl.c +++ b/source/vid_sdl.c @@ -392,7 +392,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)) ) @@ -427,10 +427,10 @@ void IN_SendKeyEvents (void) void IN_Commands (void) { - if (old_windowed_mouse != _windowed_mouse->value) + if (old_windowed_mouse != _windowed_mouse->int_val) { - old_windowed_mouse = _windowed_mouse->value; - if (!_windowed_mouse->value) + old_windowed_mouse = _windowed_mouse->int_val; + if (!_windowed_mouse->int_val) SDL_WM_GrabInput (SDL_GRAB_OFF); else SDL_WM_GrabInput (SDL_GRAB_ON); @@ -441,7 +441,7 @@ void 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; @@ -481,7 +481,7 @@ void IN_Move (usercmd_t *cmd) mouse_x *= sensitivity->value; mouse_y *= sensitivity->value; - if ( (in_strafe.state & 1) || (lookstrafe->value && (in_mlook.state & 1) )) + if ( (in_strafe.state & 1) || (lookstrafe->int_val && (in_mlook.state & 1) )) cmd->sidemove += m_side->value * mouse_x; else cl.viewangles[YAW] -= m_yaw->value * mouse_x; diff --git a/source/vid_sgl.c b/source/vid_sgl.c index 0aaf998..d8b2540 100644 --- a/source/vid_sgl.c +++ b/source/vid_sgl.c @@ -380,7 +380,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 @@ -603,7 +603,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; @@ -637,7 +637,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; @@ -656,10 +656,10 @@ IN_Shutdown (void) void IN_Commands(void) { - if (old__windowed_mouse != _windowed_mouse->value) { - old__windowed_mouse = _windowed_mouse->value; + if (old__windowed_mouse != _windowed_mouse->int_val) { + old__windowed_mouse = _windowed_mouse->int_val; - if (_windowed_mouse->value) { // grab the pointer + if (_windowed_mouse->int_val) { // grab the pointer SDL_ShowCursor (0); SDL_WM_GrabInput (SDL_GRAB_ON); } else { // ungrab the pointer @@ -675,7 +675,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; } @@ -686,7 +686,7 @@ IN_Move(usercmd_t *cmd) mouse_x *= sensitivity->value; mouse_y *= sensitivity->value; - if ( (in_strafe.state & 1) || (lookstrafe->value && (in_mlook.state & 1) )) + if ( (in_strafe.state & 1) || (lookstrafe->int_val && (in_mlook.state & 1) )) cmd->sidemove += m_side->value * mouse_x; else cl.viewangles[YAW] -= m_yaw->value * mouse_x; diff --git a/source/vid_sunx.c b/source/vid_sunx.c index cac8b51..ba1d446 100644 --- a/source/vid_sunx.c +++ b/source/vid_sunx.c @@ -1236,7 +1236,7 @@ void 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; } @@ -1247,7 +1247,7 @@ void IN_Move (usercmd_t *cmd) mouse_x *= sensitivity->value; mouse_y *= sensitivity->value; - if ( (in_strafe.state & 1) || (lookstrafe->value && (in_mlook.state & 1) )) + if ( (in_strafe.state & 1) || (lookstrafe->int_val && (in_mlook.state & 1) )) cmd->sidemove += m_side->value * mouse_x; else cl.viewangles[YAW] -= m_yaw->value * mouse_x; diff --git a/source/vid_sunxil.c b/source/vid_sunxil.c index 38e293a..683d9bb 100644 --- a/source/vid_sunxil.c +++ b/source/vid_sunxil.c @@ -240,7 +240,7 @@ qboolean CheckPixelMultiply (void) unsigned int value_mask; int old_pixel; - if ((m = (int)pixel_multiply->value) != current_pixel_multiply) { + if ((m = pixel_multiply->int_val) != current_pixel_multiply) { if (m < 1) m = 1; if (m > 4) @@ -519,9 +519,9 @@ void VID_Init (unsigned char *palette) // // See if we're going to do pixel multiply // - if (pixel_multiply->value < 1 || pixel_multiply->value > 4) + if (pixel_multiply->int_val < 1 || pixel_multiply->int_val > 4) Cvar_SetValue(pixel_multiply, 2); - current_pixel_multiply = pixel_multiply->value; + current_pixel_multiply = pixel_multiply->int_val; w = 320*current_pixel_multiply; // minimum width h = 200*current_pixel_multiply; // minimum height @@ -851,7 +851,7 @@ void GetEvent(void) case MotionNotify: - if (_windowed_mouse->value) { + if (_windowed_mouse->int_val) { mouse_x = (float) ((int)x_event.xmotion.x - (int)(vid.width/2)); mouse_y = (float) ((int)x_event.xmotion.y - (int)(vid.height/2)); //printf("m: x=%d,y=%d, mx=%3.2f,my=%3.2f\n", @@ -919,10 +919,10 @@ void GetEvent(void) #endif } - if (old_windowed_mouse != _windowed_mouse->value) { - old_windowed_mouse = _windowed_mouse->value; + if (old_windowed_mouse != _windowed_mouse->int_val) { + old_windowed_mouse = _windowed_mouse->int_val; - if (!_windowed_mouse->value) { + if (!_windowed_mouse->int_val) { /* ungrab the pointer */ XUngrabPointer(x_disp,CurrentTime); } else { @@ -1261,7 +1261,7 @@ void 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; } @@ -1272,7 +1272,7 @@ void IN_Move (usercmd_t *cmd) mouse_x *= sensitivity->value; mouse_y *= sensitivity->value; - if ( (in_strafe.state & 1) || (lookstrafe->value && (in_mlook.state & 1) )) + if ( (in_strafe.state & 1) || (lookstrafe->int_val && (in_mlook.state & 1) )) cmd->sidemove += m_side->value * mouse_x; else cl.viewangles[YAW] -= m_yaw->value * mouse_x; diff --git a/source/vid_svgalib.c b/source/vid_svgalib.c index fdb9842..5d94e13 100644 --- a/source/vid_svgalib.c +++ b/source/vid_svgalib.c @@ -411,14 +411,14 @@ VID_SetMode(int modenum, unsigned char *palette) int err; if ((modenum >= num_modes) || (modenum < 0) || !modes[modenum].width){ - vid_mode->value = (float)current_mode; + vid_mode->int_val = (float)current_mode; Con_Printf("No such video mode: %d\n",modenum); return 0; } - vid_mode->value = (float)modenum; + vid_mode->int_val = modenum; current_mode=modenum; @@ -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); } } diff --git a/source/vid_vga.c b/source/vid_vga.c index 275cbcb..c9ff6fc 100644 --- a/source/vid_vga.c +++ b/source/vid_vga.c @@ -394,7 +394,7 @@ int VGA_InitMode (viddef_t *lvid, vmode_t *pcurrentmode) VGA_ClearVideoMem (pcurrentmode->planar); - if (_vid_wait_override->value) + if (_vid_wait_override->int_val) { Cvar_SetValue(vid_wait, (float)VID_WAIT_VSYNC); } @@ -476,7 +476,7 @@ void VGA_SwapBuffers (viddef_t *lvid, vmode_t *pcurrentmode, vrect_t *rects) { UNUSED(lvid); - if (vid_wait->value == VID_WAIT_VSYNC) + if (vid_wait->int_val == VID_WAIT_VSYNC) VGA_WaitVsync (); VGA_SwapBuffersCopy (lvid, pcurrentmode, rects); diff --git a/source/vid_wgl.c b/source/vid_wgl.c index b3a51be..2541d13 100644 --- a/source/vid_wgl.c +++ b/source/vid_wgl.c @@ -424,7 +424,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 (); @@ -691,7 +691,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 (); @@ -1024,7 +1024,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 (); @@ -1042,7 +1042,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 (); diff --git a/source/vid_win.c b/source/vid_win.c index 27d7d8e..1ef87eb 100644 --- a/source/vid_win.c +++ b/source/vid_win.c @@ -192,10 +192,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 ); @@ -325,7 +325,7 @@ int VID_Suspend (MGLDC *dc,m_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; } @@ -1045,17 +1045,17 @@ void VID_CheckModedescFixup (int mode) 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; - if (vid_config_x->value < (320 << stretch)) - vid_config_x->value = 320 << stretch; + if (vid_config_x->int_val < (320 << stretch)) + vid_config_x->int_val = 320 << stretch; - if (vid_config_y->value < (200 << stretch)) - vid_config_y->value = 200 << stretch; + if (vid_config_y->int_val < (200 << stretch)) + 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; @@ -1332,8 +1332,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) @@ -1400,7 +1400,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; } @@ -1624,7 +1624,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) + if (_windowed_mouse->int_val) { stat = VID_SetWindowedMode(modenum); IN_ActivateMouse (); @@ -2017,7 +2017,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); } @@ -2029,7 +2029,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); } @@ -2339,8 +2339,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")) { @@ -2349,14 +2349,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; @@ -2366,13 +2366,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); } } @@ -2389,9 +2389,9 @@ 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); + VID_SetMode (vid_mode->int_val, vid_curpal); Cvar_SetValue(vid_mode, (float)vid_modenum); // so if mode set fails, we don't keep on // trying to set that mode @@ -2402,9 +2402,9 @@ void VID_Update (vrect_t *rects) // handle the mouse state when windowed if that's changed if (modestate == MS_WINDOWED) { - if ((int)_windowed_mouse->value != windowed_mouse) + if (_windowed_mouse->int_val != windowed_mouse) { - if (_windowed_mouse->value) + if (_windowed_mouse->int_val) { IN_ActivateMouse (); IN_HideMouse (); @@ -2415,7 +2415,7 @@ void VID_Update (vrect_t *rects) IN_ShowMouse (); } - windowed_mouse = (int)_windowed_mouse->value; + windowed_mouse = _windowed_mouse->int_val; } } } @@ -2750,7 +2750,7 @@ void AppActivate(BOOL fActive, BOOL minimize) IN_ActivateMouse (); IN_HideMouse (); } - else if ((modestate == MS_WINDOWED) && _windowed_mouse->value) + else if ((modestate == MS_WINDOWED) && _windowed_mouse->int_val) { IN_ActivateMouse (); IN_HideMouse (); @@ -2782,7 +2782,7 @@ void AppActivate(BOOL fActive, BOOL minimize) IN_DeactivateMouse (); IN_ShowMouse (); } - else if ((modestate == MS_WINDOWED) && _windowed_mouse->value) + else if ((modestate == MS_WINDOWED) && _windowed_mouse->int_val) { IN_DeactivateMouse (); IN_ShowMouse (); @@ -2800,7 +2800,7 @@ VID_HandlePause void VID_HandlePause (qboolean pause) { - if ((modestate == MS_WINDOWED) && _windowed_mouse->value) + if ((modestate == MS_WINDOWED) && _windowed_mouse->int_val) { if (pause) { @@ -2859,7 +2859,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: @@ -3240,7 +3240,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) {