diff --git a/libs/gamecode/pr_edict.c b/libs/gamecode/pr_edict.c index e63468b09..ecec64297 100644 --- a/libs/gamecode/pr_edict.c +++ b/libs/gamecode/pr_edict.c @@ -1207,7 +1207,7 @@ void PR_Init_Cvars (void) { pr_boundscheck = - Cvar_Get ("pr_boundscheck", "1", CVAR_NONE, 0, + Cvar_Get ("pr_boundscheck", "1", CVAR_NONE, NULL, "Server progs bounds checking"); } diff --git a/libs/util/cvar.c b/libs/util/cvar.c index ff09b5fce..84b217cce 100644 --- a/libs/util/cvar.c +++ b/libs/util/cvar.c @@ -4,7 +4,6 @@ dynamic variable tracking Copyright (C) 1996-1997 Id Software, Inc. - Copyright (C) 1999,2000 Nelson Rush. Copyright (C) 1999,2000 contributors of the QuakeForge project Please see the file "AUTHORS" for a list of contributors @@ -316,7 +315,7 @@ Cvar_Set_f (void) Cvar_Set (var, value); } } else { - var = Cvar_Get (var_name, value, CVAR_USER_CREATED, 0, + var = Cvar_Get (var_name, value, CVAR_USER_CREATED, NULL, "User-created cvar"); } } @@ -347,7 +346,7 @@ Cvar_Setrom_f (void) Cvar_SetFlags (var, var->flags | CVAR_ROM); } } else { - var = Cvar_Get (var_name, value, CVAR_USER_CREATED | CVAR_ROM, 0, + var = Cvar_Get (var_name, value, CVAR_USER_CREATED | CVAR_ROM, NULL, "User-created READ-ONLY Cvar"); } } @@ -460,7 +459,8 @@ Cvar_Init_Hash (void) void Cvar_Init (void) { - developer = Cvar_Get ("developer", "0", CVAR_NONE, 0, "set to enable extra debugging information"); + developer = Cvar_Get ("developer", "0", CVAR_NONE, NULL, + "set to enable extra debugging information"); Cmd_AddCommand ("set", Cvar_Set_f, "Set the selected variable, useful on the command line (+set variablename setting)"); Cmd_AddCommand ("setrom", Cvar_Setrom_f, "Set the selected variable and make it read only, useful on the command line.\n" diff --git a/libs/util/quakefs.c b/libs/util/quakefs.c index be30902c8..bf8a7af6b 100644 --- a/libs/util/quakefs.c +++ b/libs/util/quakefs.c @@ -1037,11 +1037,11 @@ COM_Filesystem_Init (void) void COM_Filesystem_Init_Cvars (void) { - fs_sharepath = Cvar_Get ("fs_sharepath", FS_SHAREPATH, CVAR_ROM, 0, + fs_sharepath = Cvar_Get ("fs_sharepath", FS_SHAREPATH, CVAR_ROM, NULL, "location of shared (read only) game directories"); - fs_userpath = Cvar_Get ("fs_userpath", FS_USERPATH, CVAR_ROM, 0, + fs_userpath = Cvar_Get ("fs_userpath", FS_USERPATH, CVAR_ROM, NULL, "location of your game directories"); - fs_basegame = Cvar_Get ("fs_basegame", "id1", CVAR_ROM, 0, + fs_basegame = Cvar_Get ("fs_basegame", "id1", CVAR_ROM, NULL, "game to use by default"); } diff --git a/nq/source/cl_cam.c b/nq/source/cl_cam.c index a627233f0..b547e9f44 100644 --- a/nq/source/cl_cam.c +++ b/nq/source/cl_cam.c @@ -52,10 +52,10 @@ vec3_t chase_dest_angles; void Chase_Init (void) { - chase_back = Cvar_Get ("chase_back", "100", CVAR_NONE, 0, "None"); - chase_up = Cvar_Get ("chase_up", "16", CVAR_NONE, 0, "None"); - chase_right = Cvar_Get ("chase_right", "0", CVAR_NONE, 0, "None"); - chase_active = Cvar_Get ("chase_active", "0", CVAR_NONE, 0, "None"); + chase_back = Cvar_Get ("chase_back", "100", CVAR_NONE, NULL, "None"); + chase_up = Cvar_Get ("chase_up", "16", CVAR_NONE, NULL, "None"); + chase_right = Cvar_Get ("chase_right", "0", CVAR_NONE, NULL, "None"); + chase_active = Cvar_Get ("chase_active", "0", CVAR_NONE, NULL, "None"); } void diff --git a/nq/source/cl_main.c b/nq/source/cl_main.c index 81ba1fdc3..f7679dc01 100644 --- a/nq/source/cl_main.c +++ b/nq/source/cl_main.c @@ -90,59 +90,70 @@ void CL_InitCvars (void) { show_fps = - Cvar_Get ("show_fps", "0", CVAR_NONE, 0, + Cvar_Get ("show_fps", "0", CVAR_NONE, NULL, "display realtime frames per second"); // Misty: I like to be able to see the time when I play - show_time = Cvar_Get ("show_time", "0", CVAR_NONE, 0, + show_time = Cvar_Get ("show_time", "0", CVAR_NONE, NULL, "display the current time"); cl_warncmd = - Cvar_Get ("cl_warncmd", "0", CVAR_NONE, 0, + Cvar_Get ("cl_warncmd", "0", CVAR_NONE, NULL, "inform when execing a command"); - cl_name = Cvar_Get ("_cl_name", "player", CVAR_ARCHIVE, 0, "Player name"); - cl_color = Cvar_Get ("_cl_color", "0", CVAR_ARCHIVE, 0, "Player color"); + cl_name = Cvar_Get ("_cl_name", "player", CVAR_ARCHIVE, NULL, + "Player name"); + cl_color = Cvar_Get ("_cl_color", "0", CVAR_ARCHIVE, NULL, "Player color"); cl_upspeed = - Cvar_Get ("cl_upspeed", "200", CVAR_NONE, 0, "swim/fly up/down speed"); + Cvar_Get ("cl_upspeed", "200", CVAR_NONE, NULL, + "swim/fly up/down speed"); cl_forwardspeed = - Cvar_Get ("cl_forwardspeed", "200", CVAR_ARCHIVE, 0, "forward speed"); + Cvar_Get ("cl_forwardspeed", "200", CVAR_ARCHIVE, NULL, + "forward speed"); cl_backspeed = - Cvar_Get ("cl_backspeed", "200", CVAR_ARCHIVE, 0, "backward speed"); - cl_sidespeed = Cvar_Get ("cl_sidespeed", "350", CVAR_NONE, 0, "strafe speed"); + Cvar_Get ("cl_backspeed", "200", CVAR_ARCHIVE, NULL, "backward speed"); + cl_sidespeed = Cvar_Get ("cl_sidespeed", "350", CVAR_NONE, NULL, + "strafe speed"); cl_movespeedkey = - Cvar_Get ("cl_movespeedkey", "2.0", CVAR_NONE, 0, + Cvar_Get ("cl_movespeedkey", "2.0", CVAR_NONE, NULL, "move `run' speed multiplier"); - cl_yawspeed = Cvar_Get ("cl_yawspeed", "140", CVAR_NONE, 0, "turning speed"); + cl_yawspeed = Cvar_Get ("cl_yawspeed", "140", CVAR_NONE, NULL, + "turning speed"); cl_pitchspeed = - Cvar_Get ("cl_pitchspeed", "150", CVAR_NONE, 0, "look up/down speed"); + Cvar_Get ("cl_pitchspeed", "150", CVAR_NONE, NULL, + "look up/down speed"); cl_anglespeedkey = - Cvar_Get ("cl_anglespeedkey", "1.5", CVAR_NONE, 0, + Cvar_Get ("cl_anglespeedkey", "1.5", CVAR_NONE, NULL, "turn `run' speed multiplier"); cl_shownet = - Cvar_Get ("cl_shownet", "0", CVAR_NONE, 0, + Cvar_Get ("cl_shownet", "0", CVAR_NONE, NULL, "show network packets. 0=off, 1=basic, 2=verbose"); cl_nolerp = - Cvar_Get ("cl_nolerp", "0", CVAR_NONE, 0, "linear motion interpolation"); - cl_sbar = Cvar_Get ("cl_sbar", "0", CVAR_ARCHIVE, 0, "status bar mode"); + Cvar_Get ("cl_nolerp", "0", CVAR_NONE, NULL, + "linear motion interpolation"); + cl_sbar = Cvar_Get ("cl_sbar", "0", CVAR_ARCHIVE, NULL, "status bar mode"); cl_hudswap = - Cvar_Get ("cl_hudswap", "0", CVAR_ARCHIVE, 0, "new HUD on left side?"); - cl_freelook = Cvar_Get ("freelook", "0", CVAR_ARCHIVE, 0, "force +mlook"); + Cvar_Get ("cl_hudswap", "0", CVAR_ARCHIVE, NULL, + "new HUD on left side?"); + cl_freelook = Cvar_Get ("freelook", "0", CVAR_ARCHIVE, NULL, + "force +mlook"); lookspring = - Cvar_Get ("lookspring", "0", CVAR_ARCHIVE, 0, + Cvar_Get ("lookspring", "0", CVAR_ARCHIVE, NULL, "Snap view to center when moving and no mlook/klook"); lookstrafe = - Cvar_Get ("lookstrafe", "0", CVAR_ARCHIVE, 0, + Cvar_Get ("lookstrafe", "0", CVAR_ARCHIVE, NULL, "when mlook/klook on player will strafe"); sensitivity = - Cvar_Get ("sensitivity", "3", CVAR_ARCHIVE, 0, + Cvar_Get ("sensitivity", "3", CVAR_ARCHIVE, NULL, "mouse sensitivity multiplier"); m_pitch = - Cvar_Get ("m_pitch", "0.022", CVAR_ARCHIVE, 0, + Cvar_Get ("m_pitch", "0.022", CVAR_ARCHIVE, NULL, "mouse pitch (up/down) multipier"); m_yaw = - Cvar_Get ("m_yaw", "0.022", CVAR_ARCHIVE, 0, + Cvar_Get ("m_yaw", "0.022", CVAR_ARCHIVE, NULL, "mouse yaw (left/right) multipiler"); m_forward = - Cvar_Get ("m_forward", "1", CVAR_ARCHIVE, 0, "mouse forward/back speed"); - m_side = Cvar_Get ("m_side", "0.8", CVAR_ARCHIVE, 0, "mouse strafe speed"); + Cvar_Get ("m_forward", "1", CVAR_ARCHIVE, NULL, + "mouse forward/back speed"); + m_side = Cvar_Get ("m_side", "0.8", CVAR_ARCHIVE, NULL, + "mouse strafe speed"); } /* diff --git a/nq/source/com.c b/nq/source/com.c index 815c5ca00..112706fc7 100644 --- a/nq/source/com.c +++ b/nq/source/com.c @@ -82,7 +82,7 @@ COM_Init void COM_Init () { - registered = Cvar_Get ("registered", "0", CVAR_NONE, 0, "None"); + registered = Cvar_Get ("registered", "0", CVAR_NONE, NULL, "None"); cmdline = Cvar_Get ("cmdline", "0", CVAR_SERVERINFO, Cvar_Info, "None"); Cmd_AddCommand ("path", COM_Path_f, "No Description"); @@ -90,3 +90,4 @@ COM_Init () COM_Filesystem_Init (); COM_CheckRegistered (); } + diff --git a/nq/source/console.c b/nq/source/console.c index 579b4cc8a..6d6633751 100644 --- a/nq/source/console.c +++ b/nq/source/console.c @@ -271,7 +271,7 @@ void Con_Init_Cvars (void) { con_notifytime = - Cvar_Get ("con_notifytime", "3", CVAR_NONE, 0, + Cvar_Get ("con_notifytime", "3", CVAR_NONE, NULL, "How long in seconds messages are displayed on screen"); } diff --git a/nq/source/context_x11.c b/nq/source/context_x11.c index 4c859b432..ec694d050 100644 --- a/nq/source/context_x11.c +++ b/nq/source/context_x11.c @@ -292,7 +292,7 @@ x11_set_vidmode (int width, int height) void x11_Init_Cvars () { - vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_ROM, 0, + vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_ROM, NULL, "Toggles fullscreen game mode"); } diff --git a/nq/source/d_init.c b/nq/source/d_init.c index 76bb22b35..46d45b55e 100644 --- a/nq/source/d_init.c +++ b/nq/source/d_init.c @@ -62,9 +62,9 @@ D_Init (void) r_skydirect = 1; - d_subdiv16 = Cvar_Get ("d_subdiv16", "1", CVAR_NONE, 0, "None"); - d_mipcap = Cvar_Get ("d_mipcap", "0", CVAR_NONE, 0, "None"); - d_mipscale = Cvar_Get ("d_mipscale", "1", CVAR_NONE, 0, "None"); + d_subdiv16 = Cvar_Get ("d_subdiv16", "1", CVAR_NONE, NULL, "None"); + d_mipcap = Cvar_Get ("d_mipcap", "0", CVAR_NONE, NULL, "None"); + d_mipscale = Cvar_Get ("d_mipscale", "1", CVAR_NONE, NULL, "None"); r_drawpolys = false; r_worldpolysbacktofront = false; diff --git a/nq/source/gl_draw.c b/nq/source/gl_draw.c index c49ecb324..a38192350 100644 --- a/nq/source/gl_draw.c +++ b/nq/source/gl_draw.c @@ -413,33 +413,23 @@ Draw_Init (void) int i; // LordHavoc: lighting mode - gl_lightmode = Cvar_Get ("gl_lightmode", "0", CVAR_ARCHIVE, 0, + gl_lightmode = Cvar_Get ("gl_lightmode", "0", CVAR_ARCHIVE, NULL, "Lighting mode (0 = GLQuake style, 1 = new style)"); - gl_nobind = Cvar_Get ("gl_nobind", "0", CVAR_NONE, 0, + gl_nobind = Cvar_Get ("gl_nobind", "0", CVAR_NONE, NULL, "whether or not to inhibit texture binding"); - gl_max_size = Cvar_Get ("gl_max_size", "1024", CVAR_NONE, 0, "None"); // CVAR_FIXME - // - // - // - - // set - // a - // description - gl_picmip = Cvar_Get ("gl_picmip", "0", CVAR_NONE, 0, "None"); // CVAR_FIXME - // - // - // - set a - // description + gl_max_size = Cvar_Get ("gl_max_size", "1024", CVAR_NONE, NULL, "None"); + gl_picmip = Cvar_Get ("gl_picmip", "0", CVAR_NONE, 0, "None"); // Console effects --KB - gl_constretch = Cvar_Get ("gl_constretch", "0", CVAR_ARCHIVE, 0, + gl_constretch = Cvar_Get ("gl_constretch", "0", CVAR_ARCHIVE, NULL, "whether slide the console or stretch it"); - gl_conalpha = Cvar_Get ("gl_conalpha", "0.6", CVAR_ARCHIVE, 0, + gl_conalpha = Cvar_Get ("gl_conalpha", "0.6", CVAR_ARCHIVE, NULL, "alpha value for the console background"); - gl_conspin = Cvar_Get ("gl_conspin", "0", CVAR_ARCHIVE, 0, + gl_conspin = Cvar_Get ("gl_conspin", "0", CVAR_ARCHIVE, NULL, "speed at which the console spins"); - cl_verstring = Cvar_Get ("cl_verstring", PROGRAM " " VERSION, CVAR_NONE, 0, - "client version string"); + cl_verstring = Cvar_Get ("cl_verstring", PROGRAM " " VERSION, CVAR_NONE, + NULL, "client version string"); // 3dfx can only handle 256 wide textures if (!strncasecmp ((char *) gl_renderer, "3dfx", 4) || diff --git a/nq/source/gl_rmisc.c b/nq/source/gl_rmisc.c index 9700988f1..ae0dcee79 100644 --- a/nq/source/gl_rmisc.c +++ b/nq/source/gl_rmisc.c @@ -245,50 +245,54 @@ R_Init (void) Cmd_AddCommand ("r_firecolor", R_FireColor_f, "No Description"); - r_norefresh = Cvar_Get ("r_norefresh", "0", CVAR_NONE, 0, "None"); - r_lightmap = Cvar_Get ("r_lightmap", "0", CVAR_NONE, 0, "None"); - r_fullbright = Cvar_Get ("r_fullbright", "0", CVAR_NONE, 0, "None"); - r_drawentities = Cvar_Get ("r_drawentities", "1", CVAR_NONE, 0, "None"); - r_drawviewmodel = Cvar_Get ("r_drawviewmodel", "1", CVAR_NONE, 0, "None"); - r_shadows = Cvar_Get ("r_shadows", "0", CVAR_NONE, 0, "None"); - r_mirroralpha = Cvar_Get ("r_mirroralpha", "1", CVAR_NONE, 0, "None"); - r_wateralpha = Cvar_Get ("r_wateralpha", "1", CVAR_NONE, 0, "None"); - r_waterripple = Cvar_Get ("r_waterripple", "0", CVAR_NONE, 0, "None"); - r_dynamic = Cvar_Get ("r_dynamic", "1", CVAR_NONE, 0, "None"); - r_novis = Cvar_Get ("r_novis", "0", CVAR_NONE, 0, "None"); - r_speeds = Cvar_Get ("r_speeds", "0", CVAR_NONE, 0, "None"); - r_netgraph = Cvar_Get ("r_netgraph", "0", CVAR_NONE, 0, "None"); + r_norefresh = Cvar_Get ("r_norefresh", "0", CVAR_NONE, NULL, "None"); + r_lightmap = Cvar_Get ("r_lightmap", "0", CVAR_NONE, NULL, "None"); + r_fullbright = Cvar_Get ("r_fullbright", "0", CVAR_NONE, NULL, "None"); + r_drawentities = Cvar_Get ("r_drawentities", "1", CVAR_NONE, NULL, "None"); + r_drawviewmodel = Cvar_Get ("r_drawviewmodel", "1", CVAR_NONE, NULL, + "None"); + r_shadows = Cvar_Get ("r_shadows", "0", CVAR_NONE, NULL, "None"); + r_mirroralpha = Cvar_Get ("r_mirroralpha", "1", CVAR_NONE, NULL, "None"); + r_wateralpha = Cvar_Get ("r_wateralpha", "1", CVAR_NONE, NULL, "None"); + r_waterripple = Cvar_Get ("r_waterripple", "0", CVAR_NONE, NULL, "None"); + r_dynamic = Cvar_Get ("r_dynamic", "1", CVAR_NONE, NULL, "None"); + r_novis = Cvar_Get ("r_novis", "0", CVAR_NONE, NULL, "None"); + r_speeds = Cvar_Get ("r_speeds", "0", CVAR_NONE, NULL, "None"); + r_netgraph = Cvar_Get ("r_netgraph", "0", CVAR_NONE, NULL, "None"); - gl_clear = Cvar_Get ("gl_clear", "0", CVAR_NONE, 0, "None"); - gl_texsort = Cvar_Get ("gl_texsort", "1", CVAR_NONE, 0, "None"); + gl_clear = Cvar_Get ("gl_clear", "0", CVAR_NONE, NULL, "None"); + gl_texsort = Cvar_Get ("gl_texsort", "1", CVAR_NONE, NULL, "None"); - gl_cull = Cvar_Get ("gl_cull", "1", CVAR_NONE, 0, "None"); - gl_smoothmodels = Cvar_Get ("gl_smoothmodels", "1", CVAR_NONE, 0, "None"); - gl_affinemodels = Cvar_Get ("gl_affinemodels", "0", CVAR_NONE, 0, "None"); - gl_polyblend = Cvar_Get ("gl_polyblend", "1", CVAR_NONE, 0, "None"); - gl_flashblend = Cvar_Get ("gl_flashblend", "0", CVAR_NONE, 0, "None"); - gl_playermip = Cvar_Get ("gl_playermip", "0", CVAR_NONE, 0, "None"); - gl_nocolors = Cvar_Get ("gl_nocolors", "0", CVAR_NONE, 0, "None"); + gl_cull = Cvar_Get ("gl_cull", "1", CVAR_NONE, NULL, "None"); + gl_smoothmodels = Cvar_Get ("gl_smoothmodels", "1", CVAR_NONE, NULL, + "None"); + gl_affinemodels = Cvar_Get ("gl_affinemodels", "0", CVAR_NONE, NULL, + "None"); + gl_polyblend = Cvar_Get ("gl_polyblend", "1", CVAR_NONE, NULL, "None"); + gl_flashblend = Cvar_Get ("gl_flashblend", "0", CVAR_NONE, NULL, "None"); + gl_playermip = Cvar_Get ("gl_playermip", "0", CVAR_NONE, NULL, "None"); + gl_nocolors = Cvar_Get ("gl_nocolors", "0", CVAR_NONE, NULL, "None"); - gl_fires = Cvar_Get ("gl_fires", "0", CVAR_ARCHIVE, 0, + gl_fires = Cvar_Get ("gl_fires", "0", CVAR_ARCHIVE, NULL, "Toggles lavaball and rocket fireballs"); - gl_particles = Cvar_Get ("gl_particles", "1", CVAR_ARCHIVE, 0, + gl_particles = Cvar_Get ("gl_particles", "1", CVAR_ARCHIVE, NULL, "whether or not to draw particles"); - gl_fb_models = Cvar_Get ("gl_fb_models", "1", CVAR_ARCHIVE, 0, + gl_fb_models = Cvar_Get ("gl_fb_models", "1", CVAR_ARCHIVE, NULL, "Toggles fullbright color support for models.. " "This is very handy, but costs me 2 FPS.. (=:]"); - gl_fb_bmodels = Cvar_Get ("gl_fb_bmodels", "1", CVAR_ARCHIVE, 0, + gl_fb_bmodels = Cvar_Get ("gl_fb_bmodels", "1", CVAR_ARCHIVE, NULL, "Toggles fullbright color support for bmodels"); - gl_keeptjunctions = Cvar_Get ("gl_keeptjunctions", "1", CVAR_NONE, 0, "None"); + gl_keeptjunctions = Cvar_Get ("gl_keeptjunctions", "1", CVAR_NONE, NULL, + "None"); gl_reporttjunctions = - Cvar_Get ("gl_reporttjunctions", "0", CVAR_NONE, 0, "None"); + Cvar_Get ("gl_reporttjunctions", "0", CVAR_NONE, NULL, "None"); - r_skyname = Cvar_Get ("r_skyname", "none", CVAR_NONE, 0, + r_skyname = Cvar_Get ("r_skyname", "none", CVAR_NONE, NULL, "name of the current skybox"); - gl_skymultipass = Cvar_Get ("gl_skymultipass", "1", CVAR_NONE, 0, + gl_skymultipass = Cvar_Get ("gl_skymultipass", "1", CVAR_NONE, NULL, "controls wether the skydome is single or double pass"); R_InitBubble (); diff --git a/nq/source/gl_rsurf.c b/nq/source/gl_rsurf.c index efd1e4a7b..f39f220c4 100644 --- a/nq/source/gl_rsurf.c +++ b/nq/source/gl_rsurf.c @@ -1280,7 +1280,7 @@ GL_BuildLightmaps (void) texture_extension_number += MAX_LIGHTMAPS; } - gl_colorlights = Cvar_Get ("gl_colorlights", "1", CVAR_ROM, 0, + gl_colorlights = Cvar_Get ("gl_colorlights", "1", CVAR_ROM, NULL, "Whether to use RGB lightmaps or not"); if (gl_colorlights->int_val) { diff --git a/nq/source/gl_screen.c b/nq/source/gl_screen.c index 324146b34..96f516605 100644 --- a/nq/source/gl_screen.c +++ b/nq/source/gl_screen.c @@ -417,16 +417,17 @@ SCR_Init void SCR_InitCvars (void) { - scr_fov = Cvar_Get ("fov", "90", CVAR_NONE, 0, "10 - 170"); - scr_viewsize = Cvar_Get ("viewsize", "100", CVAR_ARCHIVE, 0, "None"); - scr_conspeed = Cvar_Get ("scr_conspeed", "300", CVAR_NONE, 0, "None"); - scr_showram = Cvar_Get ("showram", "1", CVAR_NONE, 0, "None"); - scr_showturtle = Cvar_Get ("showturtle", "0", CVAR_NONE, 0, "None"); - scr_showpause = Cvar_Get ("showpause", "1", CVAR_NONE, 0, "None"); - scr_centertime = Cvar_Get ("scr_centertime", "2", CVAR_NONE, 0, "None"); - scr_printspeed = Cvar_Get ("scr_printspeed", "8", CVAR_NONE, 0, "None"); - scr_allowsnap = Cvar_Get ("scr_allowsnap", "1", CVAR_NONE, 0, "None"); - gl_triplebuffer = Cvar_Get ("gl_triplebuffer", "1", CVAR_ARCHIVE, 0, "None"); + scr_fov = Cvar_Get ("fov", "90", CVAR_NONE, NULL, "10 - 170"); + scr_viewsize = Cvar_Get ("viewsize", "100", CVAR_ARCHIVE, NULL, "None"); + scr_conspeed = Cvar_Get ("scr_conspeed", "300", CVAR_NONE, NULL, "None"); + scr_showram = Cvar_Get ("showram", "1", CVAR_NONE, NULL, "None"); + scr_showturtle = Cvar_Get ("showturtle", "0", CVAR_NONE, NULL, "None"); + scr_showpause = Cvar_Get ("showpause", "1", CVAR_NONE, NULL, "None"); + scr_centertime = Cvar_Get ("scr_centertime", "2", CVAR_NONE, NULL, "None"); + scr_printspeed = Cvar_Get ("scr_printspeed", "8", CVAR_NONE, NULL, "None"); + scr_allowsnap = Cvar_Get ("scr_allowsnap", "1", CVAR_NONE, NULL, "None"); + gl_triplebuffer = Cvar_Get ("gl_triplebuffer", "1", CVAR_ARCHIVE, NULL, + "None"); } void diff --git a/nq/source/host.c b/nq/source/host.c index 5e869afa6..310ac3e40 100644 --- a/nq/source/host.c +++ b/nq/source/host.c @@ -242,25 +242,27 @@ Host_InitLocal (void) Host_InitCommands (); host_framerate = - Cvar_Get ("host_framerate", "0", CVAR_NONE, 0, "set for slow motion"); + Cvar_Get ("host_framerate", "0", CVAR_NONE, NULL, + "set for slow motion"); host_speeds = - Cvar_Get ("host_speeds", "0", CVAR_NONE, 0, "set for running times"); + Cvar_Get ("host_speeds", "0", CVAR_NONE, NULL, + "set for running times"); - sys_ticrate = Cvar_Get ("sys_ticrate", "0.05", CVAR_NONE, 0, "None"); - serverprofile = Cvar_Get ("serverprofile", "0", CVAR_NONE, 0, "None"); + sys_ticrate = Cvar_Get ("sys_ticrate", "0.05", CVAR_NONE, NULL, "None"); + serverprofile = Cvar_Get ("serverprofile", "0", CVAR_NONE, NULL, "None"); fraglimit = Cvar_Get ("fraglimit", "0", CVAR_SERVERINFO, Cvar_Info, "None"); timelimit = Cvar_Get ("timelimit", "0", CVAR_SERVERINFO, Cvar_Info, "None"); teamplay = Cvar_Get ("teamplay", "0", CVAR_SERVERINFO, Cvar_Info, "None"); - samelevel = Cvar_Get ("samelevel", "0", CVAR_NONE, 0, "None"); + samelevel = Cvar_Get ("samelevel", "0", CVAR_NONE, NULL, "None"); noexit = Cvar_Get ("noexit", "0", CVAR_SERVERINFO, Cvar_Info, "None"); - skill = Cvar_Get ("skill", "1", CVAR_NONE, 0, "0 - 3"); - deathmatch = Cvar_Get ("deathmatch", "0", CVAR_NONE, 0, "0, 1, or 2"); - coop = Cvar_Get ("coop", "0", CVAR_NONE, 0, "0 or 1"); + skill = Cvar_Get ("skill", "1", CVAR_NONE, NULL, "0 - 3"); + deathmatch = Cvar_Get ("deathmatch", "0", CVAR_NONE, NULL, "0, 1, or 2"); + coop = Cvar_Get ("coop", "0", CVAR_NONE, NULL, "0 or 1"); - pausable = Cvar_Get ("pausable", "1", CVAR_NONE, 0, "None"); + pausable = Cvar_Get ("pausable", "1", CVAR_NONE, NULL, "None"); - temp1 = Cvar_Get ("temp1", "0", CVAR_NONE, 0, "None"); + temp1 = Cvar_Get ("temp1", "0", CVAR_NONE, NULL, "None"); Host_FindMaxClients (); @@ -913,7 +915,7 @@ Host_Init (quakeparms_t *parms) // only reads from within the quake file system, and changing that is // probably Not A Good Thing (tm). fs_globalcfg = Cvar_Get ("fs_globalcfg", FS_GLOBALCFG, - CVAR_ROM, 0, "global configuration file"); + CVAR_ROM, NULL, "global configuration file"); Cmd_Exec_File (fs_globalcfg->string); Cbuf_Execute_Sets (); diff --git a/nq/source/in_dos.c b/nq/source/in_dos.c index b44ef0da5..d1404817e 100644 --- a/nq/source/in_dos.c +++ b/nq/source/in_dos.c @@ -1,4 +1,3 @@ - /* in_dos.c @@ -173,10 +172,10 @@ IN_Init (void) { int i; - m_filter = Cvar_Get ("m_filter", "0", CVAR_ARCHIVE, 0, "None"); - in_joystick = Cvar_Get ("joystick", "0", CVAR_ARCHIVE, 0, "None"); - joy_numbuttons = Cvar_Get ("joybuttons", "4", CVAR_ARCHIVE, 0, "None"); - aux_look = Cvar_Get ("auxlook", "1", CVAR_ARCHIVE, 0, "None"); + m_filter = Cvar_Get ("m_filter", "0", CVAR_ARCHIVE, NULL, "None"); + in_joystick = Cvar_Get ("joystick", "0", CVAR_ARCHIVE, NULL, "None"); + joy_numbuttons = Cvar_Get ("joybuttons", "4", CVAR_ARCHIVE, NULL, "None"); + aux_look = Cvar_Get ("auxlook", "1", CVAR_ARCHIVE, NULL, "None"); Cmd_AddCommand ("toggle_auxlook", Toggle_AuxLook_f, "No Description"); Cmd_AddCommand ("force_centerview", Force_CenterView_f, "No Description"); diff --git a/nq/source/in_sdl.c b/nq/source/in_sdl.c index 096512049..58bfeaf54 100644 --- a/nq/source/in_sdl.c +++ b/nq/source/in_sdl.c @@ -1,4 +1,3 @@ - /* in_sdl.c @@ -358,10 +357,10 @@ IN_Init_Cvars (void) JOY_Init_Cvars (); _windowed_mouse = - Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, 0, + Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, NULL, "If set to 1, quake will grab the mouse in X"); - // m_filter = Cvar_Get ("m_filter", "0", CVAR_ARCHIVE, 0, "Toggle mouse - // input filtering"); + // m_filter = Cvar_Get ("m_filter", "0", CVAR_ARCHIVE, NULL, + // "Toggle mouse input filtering"); } void diff --git a/nq/source/in_sun.c b/nq/source/in_sun.c index 23e75a93f..25cd59783 100644 --- a/nq/source/in_sun.c +++ b/nq/source/in_sun.c @@ -1,4 +1,3 @@ - /* in_sun.c @@ -158,7 +157,8 @@ IN_Init (void) if (!x_disp) Sys_Error ("X display not open!\n"); - _windowed_mouse = Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, 0, "None"); + _windowed_mouse = Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, NULL, + "None"); // we really really want to clean these up... atexit (IN_Shutdown); diff --git a/nq/source/in_svgalib.c b/nq/source/in_svgalib.c index 776fd7134..c94eb6cce 100644 --- a/nq/source/in_svgalib.c +++ b/nq/source/in_svgalib.c @@ -135,7 +135,8 @@ void IN_Init_Cvars (void) { JOY_Init_Cvars (); - m_filter = Cvar_Get ("m_filter", "0", CVAR_NONE, 0, "Toggle mouse input filtering."); + m_filter = Cvar_Get ("m_filter", "0", CVAR_NONE, NULL, + "Toggle mouse input filtering."); } static void diff --git a/nq/source/in_win.c b/nq/source/in_win.c index 955c03e7b..794fae901 100644 --- a/nq/source/in_win.c +++ b/nq/source/in_win.c @@ -1,4 +1,3 @@ - /* in_win.c @@ -503,35 +502,36 @@ void IN_Init_Cvars (void) { // mouse variables - m_filter = Cvar_Get ("m_filter", "0", CVAR_NONE, 0, "None"); + m_filter = Cvar_Get ("m_filter", "0", CVAR_NONE, NULL, "None"); // joystick variables - in_joystick = Cvar_Get ("joystick", "0", CVAR_ARCHIVE, 0, "None"); - joy_name = Cvar_Get ("joyname", "joystick", CVAR_NONE, 0, "None"); - joy_advanced = Cvar_Get ("joyadvanced", "0", CVAR_NONE, 0, "None"); - joy_advaxisx = Cvar_Get ("joyadvaxisx", "0", CVAR_NONE, 0, "None"); - joy_advaxisy = Cvar_Get ("joyadvaxisy", "0", CVAR_NONE, 0, "None"); - joy_advaxisz = Cvar_Get ("joyadvaxisz", "0", CVAR_NONE, 0, "None"); - joy_advaxisr = Cvar_Get ("joyadvaxisr", "0", CVAR_NONE, 0, "None"); - joy_advaxisu = Cvar_Get ("joyadvaxisu", "0", CVAR_NONE, 0, "None"); - joy_advaxisv = Cvar_Get ("joyadvaxisv", "0", CVAR_NONE, 0, "None"); + in_joystick = Cvar_Get ("joystick", "0", CVAR_ARCHIVE, NULL, "None"); + joy_name = Cvar_Get ("joyname", "joystick", CVAR_NONE, NULL, "None"); + joy_advanced = Cvar_Get ("joyadvanced", "0", CVAR_NONE, NULL, "None"); + joy_advaxisx = Cvar_Get ("joyadvaxisx", "0", CVAR_NONE, NULL, "None"); + joy_advaxisy = Cvar_Get ("joyadvaxisy", "0", CVAR_NONE, NULL, "None"); + joy_advaxisz = Cvar_Get ("joyadvaxisz", "0", CVAR_NONE, NULL, "None"); + joy_advaxisr = Cvar_Get ("joyadvaxisr", "0", CVAR_NONE, NULL, "None"); + joy_advaxisu = Cvar_Get ("joyadvaxisu", "0", CVAR_NONE, NULL, "None"); + joy_advaxisv = Cvar_Get ("joyadvaxisv", "0", CVAR_NONE, NULL, "None"); joy_forwardthreshold = - Cvar_Get ("joyforwardthreshold", "0.15", CVAR_NONE, 0, "None"); + Cvar_Get ("joyforwardthreshold", "0.15", CVAR_NONE, NULL, "None"); joy_sidethreshold = - Cvar_Get ("joysidethreshold", "0.15", CVAR_NONE, 0, "None"); + Cvar_Get ("joysidethreshold", "0.15", CVAR_NONE, NULL, "None"); joy_pitchthreshold = - Cvar_Get ("joypitchthreshold", "0.15", CVAR_NONE, 0, "None"); - joy_yawthreshold = Cvar_Get ("joyyawthreshold", "0.15", CVAR_NONE, 0, "None"); + Cvar_Get ("joypitchthreshold", "0.15", CVAR_NONE, NULL, "None"); + joy_yawthreshold = Cvar_Get ("joyyawthreshold", "0.15", CVAR_NONE, NULL, + "None"); joy_forwardsensitivity = - Cvar_Get ("joyforwardsensitivity", "-1.0", CVAR_NONE, 0, "None"); + Cvar_Get ("joyforwardsensitivity", "-1.0", CVAR_NONE, NULL, "None"); joy_sidesensitivity = - Cvar_Get ("joysidesensitivity", "-1.0", CVAR_NONE, 0, "None"); + Cvar_Get ("joysidesensitivity", "-1.0", CVAR_NONE, NULL, "None"); joy_pitchsensitivity = - Cvar_Get ("joypitchsensitivity", "1.0", CVAR_NONE, 0, "None"); + Cvar_Get ("joypitchsensitivity", "1.0", CVAR_NONE, NULL, "None"); joy_yawsensitivity = - Cvar_Get ("joyyawsensitivity", "-1.0", CVAR_NONE, 0, "None"); - joy_wwhack1 = Cvar_Get ("joywwhack1", "0.0", CVAR_NONE, 0, "None"); - joy_wwhack2 = Cvar_Get ("joywwhack2", "0.0", CVAR_NONE, 0, "None"); + Cvar_Get ("joyyawsensitivity", "-1.0", CVAR_NONE, NULL, "None"); + joy_wwhack1 = Cvar_Get ("joywwhack1", "0.0", CVAR_NONE, NULL, "None"); + joy_wwhack2 = Cvar_Get ("joywwhack2", "0.0", CVAR_NONE, NULL, "None"); } /* diff --git a/nq/source/in_x11.c b/nq/source/in_x11.c index b52c06cc4..124fe128f 100644 --- a/nq/source/in_x11.c +++ b/nq/source/in_x11.c @@ -1,4 +1,3 @@ - /* in_x11.c @@ -552,13 +551,13 @@ IN_Init_Cvars (void) { JOY_Init_Cvars (); _windowed_mouse = - Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, 0, + Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, NULL, "With this set to 1, quake will grab the mouse from X"); m_filter = - Cvar_Get ("m_filter", "0", CVAR_ARCHIVE, 0, + Cvar_Get ("m_filter", "0", CVAR_ARCHIVE, NULL, "Toggle mouse input filtering."); - in_dga = Cvar_Get ("in_dga", "1", CVAR_ARCHIVE, 0, "DGA Input support"); - in_dga_mouseaccel = Cvar_Get ("in_dga_mouseaccel", "1", CVAR_ARCHIVE, 0, + in_dga = Cvar_Get ("in_dga", "1", CVAR_ARCHIVE, NULL, "DGA Input support"); + in_dga_mouseaccel = Cvar_Get ("in_dga_mouseaccel", "1", CVAR_ARCHIVE, NULL, "DGA Mouse accelleration multiplier"); } diff --git a/nq/source/joy_linux.c b/nq/source/joy_linux.c index 75b18783a..46de79eea 100644 --- a/nq/source/joy_linux.c +++ b/nq/source/joy_linux.c @@ -196,19 +196,19 @@ JOY_Init_Cvars (void) int i; joy_device = - Cvar_Get ("joy_device", "/dev/js0", CVAR_NONE | CVAR_ROM, 0, + Cvar_Get ("joy_device", "/dev/js0", CVAR_NONE | CVAR_ROM, NULL, "Joystick device"); joy_enable = - Cvar_Get ("joy_enable", "1", CVAR_NONE | CVAR_ARCHIVE, 0, + Cvar_Get ("joy_enable", "1", CVAR_NONE | CVAR_ARCHIVE, NULL, "Joystick enable flag"); joy_sensitivity = - Cvar_Get ("joy_sensitivity", "1", CVAR_NONE | CVAR_ARCHIVE, 0, + Cvar_Get ("joy_sensitivity", "1", CVAR_NONE | CVAR_ARCHIVE, NULL, "Joystick sensitivity"); for (i = 0; i < JOY_MAX_AXES; i++) { joy_axes[i].axis = Cvar_Get (joy_axes[i].var.name, joy_axes[i].var.string, - CVAR_ARCHIVE, 0, "Set joystick axes"); + CVAR_ARCHIVE, NULL, "Set joystick axes"); } } diff --git a/nq/source/joy_null.c b/nq/source/joy_null.c index 9d5e3f31c..bf8db767e 100644 --- a/nq/source/joy_null.c +++ b/nq/source/joy_null.c @@ -64,13 +64,13 @@ void JOY_Init_Cvars (void) { joy_device = - Cvar_Get ("joy_device", "none", CVAR_NONE | CVAR_ROM, 0, + Cvar_Get ("joy_device", "none", CVAR_NONE | CVAR_ROM, NULL, "Joystick device"); joy_enable = - Cvar_Get ("joy_enable", "1", CVAR_NONE | CVAR_ARCHIVE, 0, + Cvar_Get ("joy_enable", "1", CVAR_NONE | CVAR_ARCHIVE, NULL, "Joystick enable flag"); joy_sensitivity = - Cvar_Get ("joy_sensitivity", "1", CVAR_NONE | CVAR_ARCHIVE, 0, + Cvar_Get ("joy_sensitivity", "1", CVAR_NONE | CVAR_ARCHIVE, NULL, "Joystick sensitivity"); } diff --git a/nq/source/keys.c b/nq/source/keys.c index e6af5abad..d913da01b 100644 --- a/nq/source/keys.c +++ b/nq/source/keys.c @@ -748,7 +748,7 @@ Key_Init (void) void Key_Init_Cvars (void) { - cl_chatmode = Cvar_Get ("cl_chatmode", "2", CVAR_NONE, 0, + cl_chatmode = Cvar_Get ("cl_chatmode", "2", CVAR_NONE, NULL, "Controls when console text will be treated as a chat message: 0 - never, 1 - always, 2 - smart"); } diff --git a/nq/source/model.c b/nq/source/model.c index f4189ecb9..0a80d78b0 100644 --- a/nq/source/model.c +++ b/nq/source/model.c @@ -66,7 +66,7 @@ void Mod_Init (void) { gl_subdivide_size = - Cvar_Get ("gl_subdivide_size", "128", CVAR_ARCHIVE, 0, "None"); + Cvar_Get ("gl_subdivide_size", "128", CVAR_ARCHIVE, NULL, "None"); memset (mod_novis, 0xff, sizeof (mod_novis)); } diff --git a/nq/source/net_main.c b/nq/source/net_main.c index 944852926..625b8ff35 100644 --- a/nq/source/net_main.c +++ b/nq/source/net_main.c @@ -844,23 +844,24 @@ NET_Init (void) SZ_Alloc (&_net_message_message, NET_MAXMESSAGE); net_messagetimeout = - Cvar_Get ("net_messagetimeout", "300", CVAR_NONE, 0, "None"); - hostname = Cvar_Get ("hostname", "UNNAMED", CVAR_NONE, 0, "None"); + Cvar_Get ("net_messagetimeout", "300", CVAR_NONE, NULL, "None"); + hostname = Cvar_Get ("hostname", "UNNAMED", CVAR_NONE, NULL, "None"); config_com_port = - Cvar_Get ("_config_com_port", "0x3f8", CVAR_ARCHIVE, 0, "None"); - config_com_irq = Cvar_Get ("_config_com_irq", "4", CVAR_ARCHIVE, 0, "None"); + Cvar_Get ("_config_com_port", "0x3f8", CVAR_ARCHIVE, NULL, "None"); + config_com_irq = Cvar_Get ("_config_com_irq", "4", CVAR_ARCHIVE, NULL, + "None"); config_com_baud = - Cvar_Get ("_config_com_baud", "57600", CVAR_ARCHIVE, 0, "None"); + Cvar_Get ("_config_com_baud", "57600", CVAR_ARCHIVE, NULL, "None"); config_com_modem = - Cvar_Get ("_config_com_modem", "1", CVAR_ARCHIVE, 0, "None"); + Cvar_Get ("_config_com_modem", "1", CVAR_ARCHIVE, NULL, "None"); config_modem_dialtype = - Cvar_Get ("_config_modem_dialtype", "T", CVAR_ARCHIVE, 0, "None"); + Cvar_Get ("_config_modem_dialtype", "T", CVAR_ARCHIVE, NULL, "None"); config_modem_clear = - Cvar_Get ("_config_modem_clear", "ATZ", CVAR_ARCHIVE, 0, "None"); + Cvar_Get ("_config_modem_clear", "ATZ", CVAR_ARCHIVE, NULL, "None"); config_modem_init = - Cvar_Get ("_config_modem_init", "", CVAR_ARCHIVE, 0, "None"); + Cvar_Get ("_config_modem_init", "", CVAR_ARCHIVE, NULL, "None"); config_modem_hangup = - Cvar_Get ("_config_modem_hangup", "AT H", CVAR_ARCHIVE, 0, "None"); + Cvar_Get ("_config_modem_hangup", "AT H", CVAR_ARCHIVE, NULL, "None"); Cmd_AddCommand ("slist", NET_Slist_f, "No Description"); Cmd_AddCommand ("listen", NET_Listen_f, "No Description"); diff --git a/nq/source/r_view.c b/nq/source/r_view.c index f7f77612c..edeb8af2a 100644 --- a/nq/source/r_view.c +++ b/nq/source/r_view.c @@ -768,37 +768,41 @@ V_Init (void) Cmd_AddCommand ("bf", V_BonusFlash_f, "No Description"); Cmd_AddCommand ("centerview", V_StartPitchDrift, "No Description"); - v_centermove = Cvar_Get ("v_centermove", "0.15", CVAR_NONE, 0, "None"); - v_centerspeed = Cvar_Get ("v_centerspeed", "500", CVAR_NONE, 0, "None"); + v_centermove = Cvar_Get ("v_centermove", "0.15", CVAR_NONE, NULL, "None"); + v_centerspeed = Cvar_Get ("v_centerspeed", "500", CVAR_NONE, NULL, "None"); - v_iyaw_cycle = Cvar_Get ("v_iyaw_cycle", "2", CVAR_NONE, 0, "None"); - v_iroll_cycle = Cvar_Get ("v_iroll_cycle", "0.5", CVAR_NONE, 0, "None"); - v_ipitch_cycle = Cvar_Get ("v_ipitch_cycle", "1", CVAR_NONE, 0, "None"); - v_iyaw_level = Cvar_Get ("v_iyaw_level", "0.3", CVAR_NONE, 0, "None"); - v_iroll_level = Cvar_Get ("v_iroll_level", "0.1", CVAR_NONE, 0, "None"); - v_ipitch_level = Cvar_Get ("v_ipitch_level", "0.3", CVAR_NONE, 0, "None"); + v_iyaw_cycle = Cvar_Get ("v_iyaw_cycle", "2", CVAR_NONE, NULL, "None"); + v_iroll_cycle = Cvar_Get ("v_iroll_cycle", "0.5", CVAR_NONE, NULL, "None"); + v_ipitch_cycle = Cvar_Get ("v_ipitch_cycle", "1", CVAR_NONE, NULL, "None"); + v_iyaw_level = Cvar_Get ("v_iyaw_level", "0.3", CVAR_NONE, NULL, "None"); + v_iroll_level = Cvar_Get ("v_iroll_level", "0.1", CVAR_NONE, NULL, "None"); + v_ipitch_level = Cvar_Get ("v_ipitch_level", "0.3", CVAR_NONE, NULL, + "None"); - v_idlescale = Cvar_Get ("v_idlescale", "0", CVAR_NONE, 0, "None"); - crosshair = Cvar_Get ("crosshair", "0", CVAR_ARCHIVE, 0, "None"); - crosshaircolor = Cvar_Get ("crosshaircolor", "79", CVAR_ARCHIVE, 0, "None"); - cl_crossx = Cvar_Get ("cl_crossx", "0", CVAR_NONE, 0, "None"); - cl_crossy = Cvar_Get ("cl_crossy", "0", CVAR_NONE, 0, "None"); - gl_cshiftpercent = Cvar_Get ("gl_cshiftpercent", "100", CVAR_NONE, 0, "None"); + v_idlescale = Cvar_Get ("v_idlescale", "0", CVAR_NONE, NULL, "None"); + crosshair = Cvar_Get ("crosshair", "0", CVAR_ARCHIVE, NULL, "None"); + crosshaircolor = Cvar_Get ("crosshaircolor", "79", CVAR_ARCHIVE, NULL, + "None"); + cl_crossx = Cvar_Get ("cl_crossx", "0", CVAR_NONE, NULL, "None"); + cl_crossy = Cvar_Get ("cl_crossy", "0", CVAR_NONE, NULL, "None"); + gl_cshiftpercent = Cvar_Get ("gl_cshiftpercent", "100", CVAR_NONE, NULL, + "None"); - scr_ofsx = Cvar_Get ("scr_ofsx", "0", CVAR_NONE, 0, "None"); - scr_ofsy = Cvar_Get ("scr_ofsy", "0", CVAR_NONE, 0, "None"); - scr_ofsz = Cvar_Get ("scr_ofsz", "0", CVAR_NONE, 0, "None"); - cl_rollspeed = Cvar_Get ("cl_rollspeed", "200", CVAR_NONE, 0, "None"); - cl_rollangle = Cvar_Get ("cl_rollangle", "2.0", CVAR_NONE, 0, "None"); - cl_bob = Cvar_Get ("cl_bob", "0.02", CVAR_NONE, 0, "None"); - cl_bobcycle = Cvar_Get ("cl_bobcycle", "0.6", CVAR_NONE, 0, "None"); - cl_bobup = Cvar_Get ("cl_bobup", "0.5", CVAR_NONE, 0, "None"); + scr_ofsx = Cvar_Get ("scr_ofsx", "0", CVAR_NONE, NULL, "None"); + scr_ofsy = Cvar_Get ("scr_ofsy", "0", CVAR_NONE, NULL, "None"); + scr_ofsz = Cvar_Get ("scr_ofsz", "0", CVAR_NONE, NULL, "None"); + cl_rollspeed = Cvar_Get ("cl_rollspeed", "200", CVAR_NONE, NULL, "None"); + cl_rollangle = Cvar_Get ("cl_rollangle", "2.0", CVAR_NONE, NULL, "None"); + cl_bob = Cvar_Get ("cl_bob", "0.02", CVAR_NONE, NULL, "None"); + cl_bobcycle = Cvar_Get ("cl_bobcycle", "0.6", CVAR_NONE, NULL, "None"); + cl_bobup = Cvar_Get ("cl_bobup", "0.5", CVAR_NONE, NULL, "None"); - v_kicktime = Cvar_Get ("v_kicktime", "0.5", CVAR_NONE, 0, "None"); - v_kickroll = Cvar_Get ("v_kickroll", "0.6", CVAR_NONE, 0, "None"); - v_kickpitch = Cvar_Get ("v_kickpitch", "0.6", CVAR_NONE, 0, "None"); + v_kicktime = Cvar_Get ("v_kicktime", "0.5", CVAR_NONE, NULL, "None"); + v_kickroll = Cvar_Get ("v_kickroll", "0.6", CVAR_NONE, NULL, "None"); + v_kickpitch = Cvar_Get ("v_kickpitch", "0.6", CVAR_NONE, NULL, "None"); BuildGammaTable (1.0, 1.0); // no gamma yet - brightness = Cvar_Get ("brightness", "1", CVAR_ARCHIVE, 0, "None"); - contrast = Cvar_Get ("contrast", "1", CVAR_ARCHIVE, 0, "None"); + brightness = Cvar_Get ("brightness", "1", CVAR_ARCHIVE, NULL, "None"); + contrast = Cvar_Get ("contrast", "1", CVAR_ARCHIVE, NULL, "None"); } + diff --git a/nq/source/screen.c b/nq/source/screen.c index cd048f058..ca73a46a6 100644 --- a/nq/source/screen.c +++ b/nq/source/screen.c @@ -350,14 +350,14 @@ SCR_Init void SCR_Init (void) { - scr_fov = Cvar_Get ("fov", "90", CVAR_NONE, 0, "10 - 170"); - scr_viewsize = Cvar_Get ("viewsize", "100", CVAR_ARCHIVE, 0, "None"); - scr_conspeed = Cvar_Get ("scr_conspeed", "300", CVAR_NONE, 0, "None"); - scr_showram = Cvar_Get ("showram", "1", CVAR_NONE, 0, "None"); - scr_showturtle = Cvar_Get ("showturtle", "0", CVAR_NONE, 0, "None"); - scr_showpause = Cvar_Get ("showpause", "1", CVAR_NONE, 0, "None"); - scr_centertime = Cvar_Get ("scr_centertime", "2", CVAR_NONE, 0, "None"); - scr_printspeed = Cvar_Get ("scr_printspeed", "8", CVAR_NONE, 0, "None"); + scr_fov = Cvar_Get ("fov", "90", CVAR_NONE, NULL, "10 - 170"); + scr_viewsize = Cvar_Get ("viewsize", "100", CVAR_ARCHIVE, NULL, "None"); + scr_conspeed = Cvar_Get ("scr_conspeed", "300", CVAR_NONE, NULL, "None"); + scr_showram = Cvar_Get ("showram", "1", CVAR_NONE, NULL, "None"); + scr_showturtle = Cvar_Get ("showturtle", "0", CVAR_NONE, NULL, "None"); + scr_showpause = Cvar_Get ("showpause", "1", CVAR_NONE, NULL, "None"); + scr_centertime = Cvar_Get ("scr_centertime", "2", CVAR_NONE, NULL, "None"); + scr_printspeed = Cvar_Get ("scr_printspeed", "8", CVAR_NONE, NULL, "None"); // // register our commands diff --git a/nq/source/snd_dma.c b/nq/source/snd_dma.c new file mode 100644 index 000000000..ae9036544 --- /dev/null +++ b/nq/source/snd_dma.c @@ -0,0 +1,1020 @@ +/* + snd_dma.c + + main control for any streaming sound output device + + Copyright (C) 1996-1997 Id Software, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + + $Id$ +*/ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif +#ifdef HAVE_STRING_H +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif + +#include + +#include "client.h" +#include "QF/cmd.h" +#include "QF/console.h" +#include "host.h" +#include "QF/model.h" +#include "QF/qargs.h" +#include "QF/sys.h" +#include "sound.h" + +#ifdef _WIN32 +#include "winquake.h" +#include "in_win.h" +#endif + +void S_Play (void); +void S_PlayVol (void); +void S_SoundList (void); +void S_Update_ (void); +void S_StopAllSounds (qboolean clear); +void S_StopAllSoundsC (void); + +// QuakeWorld hack... +//#define viewentity playernum+1 + +// ======================================================================= +// Internal sound data & structures +// ======================================================================= + +channel_t channels[MAX_CHANNELS]; +int total_channels; + +int snd_blocked = 0; +static qboolean snd_ambient = 1; +qboolean snd_initialized = false; + +// pointer should go away +volatile dma_t *shm = 0; +volatile dma_t sn; + +vec3_t listener_origin; +vec3_t listener_forward; +vec3_t listener_right; +vec3_t listener_up; +vec_t sound_nominal_clip_dist = 1000.0; + +int soundtime; // sample PAIRS +int paintedtime; // sample PAIRS + + +#define MAX_SFX 512 +sfx_t *known_sfx; // hunk allocated [MAX_SFX] +int num_sfx; + +sfx_t *ambient_sfx[NUM_AMBIENTS]; + +int desired_speed = 11025; +int desired_bits = 16; + +int sound_started = 0; + +cvar_t *bgmvolume; +cvar_t *volume; + +cvar_t *snd_device; +cvar_t *snd_rate; +cvar_t *snd_bits; +cvar_t *snd_stereo; +cvar_t *nosound; +cvar_t *precache; +cvar_t *loadas8bit; +cvar_t *ambient_level; +cvar_t *ambient_fade; +cvar_t *snd_noextraupdate; +cvar_t *snd_show; +cvar_t *snd_interp; +cvar_t *snd_phasesep; +cvar_t *snd_volumesep; +cvar_t *_snd_mixahead; + + +// ==================================================================== +// User-setable variables +// ==================================================================== + + +// +// Fake dma is a synchronous faking of the DMA progress used for +// isolating performance in the renderer. The fakedma_updates is +// number of times S_Update() is called per second. +// + +qboolean fakedma = false; +int fakedma_updates = 15; + + +void +S_AmbientOff (void) +{ + snd_ambient = false; +} + + +void +S_AmbientOn (void) +{ + snd_ambient = true; +} + + +void +S_SoundInfo_f (void) +{ + if (!sound_started || !shm) { + Con_Printf ("sound system not started\n"); + return; + } + + Con_Printf ("%5d stereo\n", shm->channels - 1); + Con_Printf ("%5d samples\n", shm->samples); + Con_Printf ("%5d samplepos\n", shm->samplepos); + Con_Printf ("%5d samplebits\n", shm->samplebits); + Con_Printf ("%5d submission_chunk\n", shm->submission_chunk); + Con_Printf ("%5d speed\n", shm->speed); + Con_Printf ("0x%lx dma buffer\n", (unsigned long) shm->buffer); + Con_Printf ("%5d total_channels\n", total_channels); +} + + +/* + S_Startup +*/ + +void +S_Startup (void) +{ + int rc; + + if (!snd_initialized) + return; + + if (!fakedma) { + rc = SNDDMA_Init (); + + if (!rc) { +#ifndef _WIN32 + Con_Printf ("S_Startup: SNDDMA_Init failed.\n"); +#endif + sound_started = 0; + return; + } + } + + sound_started = 1; +} + + +/* + S_Init +*/ +void +S_Init (void) +{ + + Con_Printf ("\nSound Initialization\n"); + + Cmd_AddCommand ("play", S_Play, + "Play selected sound effect (play pathto/sound.wav)"); + Cmd_AddCommand ("playvol", S_PlayVol, + "Play selected sound effect at selected volume (playvol pathto/sound.wav num"); + Cmd_AddCommand ("stopsound", S_StopAllSoundsC, + "Stops all sounds currently being played"); + Cmd_AddCommand ("soundlist", S_SoundList, + "Reports a list of sounds in the cache"); + Cmd_AddCommand ("soundinfo", S_SoundInfo_f, + "Report information on the sound system"); + + if (COM_CheckParm ("-nosound")) + return; + + if (COM_CheckParm ("-simsound")) + fakedma = true; + + if (host_parms.memsize < 0x800000) { + Cvar_Set (loadas8bit, "1"); + Con_Printf ("loading all sounds as 8bit\n"); + } + + + snd_initialized = true; + + S_Startup (); + + if (sound_started == 0) // sound startup failed? Bail out. + return; + + SND_InitScaletable (); + + known_sfx = Hunk_AllocName (MAX_SFX * sizeof (sfx_t), "sfx_t"); + + num_sfx = 0; + +// create a piece of DMA memory + + if (fakedma) { + shm = (void *) Hunk_AllocName (sizeof (*shm), "shm"); + shm->splitbuffer = 0; + shm->samplebits = 16; + shm->speed = 22050; + shm->channels = 2; + shm->samples = 32768; + shm->samplepos = 0; + shm->soundalive = true; + shm->gamealive = true; + shm->submission_chunk = 1; + shm->buffer = Hunk_AllocName (1 << 16, "shmbuf"); + } +// Con_Printf ("Sound sampling rate: %i\n", shm->speed); + + // provides a tick sound until washed clean + +// if (shm->buffer) +// shm->buffer[4] = shm->buffer[5] = 0x7f; // force a pop for debugging + + ambient_sfx[AMBIENT_WATER] = S_PrecacheSound ("ambience/water1.wav"); + ambient_sfx[AMBIENT_SKY] = S_PrecacheSound ("ambience/wind2.wav"); + + S_StopAllSounds (true); +} + +void +S_Init_Cvars (void) +{ + snd_device = Cvar_Get ("snd_device", "", CVAR_ROM, NULL, + "sound device. \"\" is system default"); + snd_rate = Cvar_Get ("snd_rate", "0", CVAR_ROM, NULL, + "sound playback rate. 0 is system default"); + snd_bits = Cvar_Get ("snd_bits", "0", CVAR_ROM, NULL, + "sound sample depth. 0 is system default"); + snd_stereo = Cvar_Get ("snd_stereo", "1", CVAR_ROM, NULL, + "sound stereo output"); + nosound = Cvar_Get ("nosound", "0", CVAR_NONE, NULL, + "Set to turn sound off"); + volume = + Cvar_Get ("volume", "0.7", CVAR_ARCHIVE, NULL, + "Set the volume for sound playback"); + precache = + Cvar_Get ("precache", "1", CVAR_NONE, NULL, + "Toggle the use of a precache"); + loadas8bit = + Cvar_Get ("loadas8bit", "0", CVAR_NONE, NULL, + "Toggles if sounds are loaded as 8-bit samples"); + bgmvolume = Cvar_Get ("bgmvolume", "1", CVAR_ARCHIVE, NULL, + "Volume of CD music"); + ambient_level = + Cvar_Get ("ambient_level", "0.3", CVAR_NONE, NULL, + "Ambient sounds' volume"); + ambient_fade = + Cvar_Get ("ambient_fade", "100", CVAR_NONE, NULL, + "How quickly ambient sounds fade in or out"); + snd_noextraupdate = + Cvar_Get ("snd_noextraupdate", "0", CVAR_NONE, NULL, + "Toggles the correct value display in host_speeds. Usually messes up sound playback when in effect"); + snd_show = + Cvar_Get ("snd_show", "0", CVAR_NONE, NULL, + "Toggles the display of sounds currently being played"); + snd_interp = + Cvar_Get ("snd_interp", "1", CVAR_ARCHIVE, NULL, + "control sample interpolation"); + snd_phasesep = + Cvar_Get ("snd_phasesep", "0.0", CVAR_ARCHIVE, NULL, + "max stereo phase separation in ms. 0.6 is for 20cm head"); + snd_volumesep = + Cvar_Get ("snd_volumesep", "1.0", CVAR_ARCHIVE, NULL, + "max stereo volume separation in ms. 1.0 is max"); + _snd_mixahead = + Cvar_Get ("_snd_mixahead", "0.1", CVAR_ARCHIVE, NULL, + "Delay time for sounds"); +} + + +// ======================================================================= +// Shutdown sound engine +// ======================================================================= + +void +S_Shutdown (void) +{ + + if (!sound_started) + return; + + if (shm) + shm->gamealive = 0; + + shm = 0; + sound_started = 0; + + if (!fakedma) { + SNDDMA_Shutdown (); + } +} + + +// ======================================================================= +// Load a sound +// ======================================================================= + +/* + S_FindName +*/ +sfx_t * +S_FindName (char *name) +{ + int i; + sfx_t *sfx; + + if (!name) + Sys_Error ("S_FindName: NULL\n"); + + if (strlen (name) >= MAX_QPATH) + Sys_Error ("Sound name too long: %s", name); + +// see if already loaded + for (i = 0; i < num_sfx; i++) + if (!strcmp (known_sfx[i].name, name)) { + return &known_sfx[i]; + } + + if (num_sfx == MAX_SFX) + Sys_Error ("S_FindName: out of sfx_t"); + + sfx = &known_sfx[i]; + strcpy (sfx->name, name); + + num_sfx++; + + return sfx; +} + + +/* + S_TouchSound +*/ +void +S_TouchSound (char *name) +{ + sfx_t *sfx; + + if (!sound_started) + return; + + sfx = S_FindName (name); + Cache_Check (&sfx->cache); +} + +/* + S_PrecacheSound +*/ +sfx_t * +S_PrecacheSound (char *name) +{ + sfx_t *sfx; + + if (!sound_started || nosound->int_val) + return NULL; + + sfx = S_FindName (name); + +// cache it in + if (precache->int_val) + S_LoadSound (sfx); + + return sfx; +} + + +//============================================================================= + +/* + SND_PickChannel +*/ +channel_t * +SND_PickChannel (int entnum, int entchannel) +{ + int ch_idx; + int first_to_die; + int life_left; + +// Check for replacement sound, or find the best one to replace + first_to_die = -1; + life_left = 0x7fffffff; + for (ch_idx = NUM_AMBIENTS; ch_idx < NUM_AMBIENTS + MAX_DYNAMIC_CHANNELS; + ch_idx++) { + if (entchannel != 0 // channel 0 never overrides + && channels[ch_idx].entnum == entnum + && (channels[ch_idx].entchannel == entchannel || entchannel == -1)) { + // always override sound from same entity + first_to_die = ch_idx; + break; + } + // don't let monster sounds override player sounds + if (channels[ch_idx].entnum == cl.viewentity && entnum != cl.viewentity + && channels[ch_idx].sfx) + continue; + + if (channels[ch_idx].end - paintedtime < life_left) { + life_left = channels[ch_idx].end - paintedtime; + first_to_die = ch_idx; + } + } + + if (first_to_die == -1) + return NULL; + + if (channels[first_to_die].sfx) + channels[first_to_die].sfx = NULL; + + return &channels[first_to_die]; +} + +/* + SND_Spatialize +*/ +void +SND_Spatialize (channel_t *ch) +{ + vec_t dot; + vec_t dist; + int phase; // in samples + vec_t lscale, rscale, scale; + vec3_t source_vec; + sfx_t *snd; + +// anything coming from the view entity will always be full volume + if (ch->entnum == cl.viewentity) { + ch->leftvol = ch->master_vol; + ch->rightvol = ch->master_vol; + ch->phase = 0; + return; + } +// calculate stereo seperation and distance attenuation + + snd = ch->sfx; + VectorSubtract (ch->origin, listener_origin, source_vec); + + dist = VectorNormalize (source_vec) * ch->dist_mult; + + dot = DotProduct (listener_right, source_vec); + + if (shm->channels == 1) { + rscale = 1.0; + lscale = 1.0; + phase = 0; + } else { + rscale = 1.0 + dot * snd_volumesep->value; + lscale = 1.0 - dot * snd_volumesep->value; + phase = snd_phasesep->value * 0.001 * shm->speed * dot; + } + +// add in distance effect + scale = (1.0 - dist) * rscale; + ch->rightvol = (int) (ch->master_vol * scale); + if (ch->rightvol < 0) + ch->rightvol = 0; + + scale = (1.0 - dist) * lscale; + ch->leftvol = (int) (ch->master_vol * scale); + if (ch->leftvol < 0) + ch->leftvol = 0; + + ch->phase = phase; +} + + +// ======================================================================= +// Start a sound effect +// ======================================================================= + +void +S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, + float attenuation) +{ + channel_t *target_chan, *check; + sfxcache_t *sc; + int vol; + int ch_idx; + int skip; + + if (!sound_started) + return; + + if (!sfx) + return; + + if (nosound->int_val) + return; + + vol = fvol * 255; + +// pick a channel to play on + target_chan = SND_PickChannel (entnum, entchannel); + if (!target_chan) + return; + +// spatialize + memset (target_chan, 0, sizeof (*target_chan)); + VectorCopy (origin, target_chan->origin); + target_chan->dist_mult = attenuation / sound_nominal_clip_dist; + target_chan->master_vol = vol; + target_chan->entnum = entnum; + target_chan->entchannel = entchannel; + SND_Spatialize (target_chan); + + if (!target_chan->leftvol && !target_chan->rightvol) + return; // not audible at all + +// new channel + sc = S_LoadSound (sfx); + if (!sc) { + target_chan->sfx = NULL; + return; // couldn't load the sound's data + } + + target_chan->sfx = sfx; + target_chan->pos = 0.0; + target_chan->end = paintedtime + sc->length; + +// if an identical sound has also been started this frame, offset the pos +// a bit to keep it from just making the first one louder + check = &channels[NUM_AMBIENTS]; + for (ch_idx = NUM_AMBIENTS; ch_idx < NUM_AMBIENTS + MAX_DYNAMIC_CHANNELS; + ch_idx++, check++) { + if (check == target_chan) + continue; + if (check->sfx == sfx && !check->pos) { + skip = rand () % (int) (0.1 * shm->speed); + if (skip >= target_chan->end) + skip = target_chan->end - 1; + target_chan->pos += skip; + target_chan->end -= skip; + break; + } + + } +} + +void +S_StopSound (int entnum, int entchannel) +{ + int i; + + for (i = 0; i < MAX_DYNAMIC_CHANNELS; i++) { + if (channels[i].entnum == entnum + && channels[i].entchannel == entchannel) { + channels[i].end = 0; + channels[i].sfx = NULL; + return; + } + } +} + +void +S_StopAllSounds (qboolean clear) +{ + int i; + + if (!sound_started) + return; + + total_channels = MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS; // no statics + + for (i = 0; i < MAX_CHANNELS; i++) + if (channels[i].sfx) + channels[i].sfx = NULL; + + memset (channels, 0, MAX_CHANNELS * sizeof (channel_t)); + + if (clear) + S_ClearBuffer (); +} + +void +S_StopAllSoundsC (void) +{ + S_StopAllSounds (true); +} + +void +S_ClearBuffer (void) +{ + int clear; + +#ifdef _WIN32 + if (!sound_started || !shm || (!shm->buffer && !pDSBuf)) +#else + if (!sound_started || !shm || !shm->buffer) +#endif + return; + + if (shm->samplebits == 8) + clear = 0x80; + else + clear = 0; + +#ifdef _WIN32 + if (pDSBuf) + DSOUND_ClearBuffer (clear); + else +#endif + { + memset (shm->buffer, clear, shm->samples * shm->samplebits / 8); + } +} + + +/* + S_StaticSound +*/ +void +S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation) +{ + channel_t *ss; + sfxcache_t *sc; + + if (!sfx) + return; + + if (total_channels == MAX_CHANNELS) { + Con_Printf ("total_channels == MAX_CHANNELS\n"); + return; + } + + ss = &channels[total_channels]; + total_channels++; + + sc = S_LoadSound (sfx); + if (!sc) + return; + + if (sc->loopstart == -1) { + Con_Printf ("Sound %s not looped\n", sfx->name); + return; + } + + ss->sfx = sfx; + VectorCopy (origin, ss->origin); + ss->master_vol = vol; + ss->dist_mult = (attenuation / 64) / sound_nominal_clip_dist; + ss->end = paintedtime + sc->length; + + SND_Spatialize (ss); + ss->oldphase = ss->phase; +} + + +//============================================================================= + +/* + S_UpdateAmbientSounds +*/ +void +S_UpdateAmbientSounds (void) +{ + mleaf_t *l; + float vol; + int ambient_channel; + channel_t *chan; + + if (!snd_ambient) + return; + +// calc ambient sound levels + if (!cl.worldmodel) + return; + + l = Mod_PointInLeaf (listener_origin, cl.worldmodel); + if (!l || !ambient_level->value) { + for (ambient_channel = 0; ambient_channel < NUM_AMBIENTS; + ambient_channel++) + channels[ambient_channel].sfx = NULL; + return; + } + + for (ambient_channel = 0; ambient_channel < NUM_AMBIENTS; ambient_channel++) { + chan = &channels[ambient_channel]; + chan->sfx = ambient_sfx[ambient_channel]; + + vol = ambient_level->value * l->ambient_sound_level[ambient_channel]; + if (vol < 8) + vol = 0; + + // don't adjust volume too fast + if (chan->master_vol < vol) { + chan->master_vol += host_frametime * ambient_fade->value; + if (chan->master_vol > vol) + chan->master_vol = vol; + } else if (chan->master_vol > vol) { + chan->master_vol -= host_frametime * ambient_fade->value; + if (chan->master_vol < vol) + chan->master_vol = vol; + } + + chan->leftvol = chan->rightvol = chan->master_vol; + } +} + + +/* + S_Update + + Called once each time through the main loop +*/ +void +S_Update (vec3_t origin, vec3_t forward, vec3_t right, vec3_t up) +{ + int i, j; + int total; + channel_t *ch; + channel_t *combine; + + if (!sound_started || (snd_blocked > 0)) + return; + + VectorCopy (origin, listener_origin); + VectorCopy (forward, listener_forward); + VectorCopy (right, listener_right); + VectorCopy (up, listener_up); + +// update general area ambient sound sources + S_UpdateAmbientSounds (); + + combine = NULL; + +// update spatialization for static and dynamic sounds + ch = channels + NUM_AMBIENTS; + for (i = NUM_AMBIENTS; i < total_channels; i++, ch++) { + if (!ch->sfx) + continue; + ch->oldphase = ch->phase; // prepare to lerp from prev to next + // phase + SND_Spatialize (ch); // respatialize channel + if (!ch->leftvol && !ch->rightvol) + continue; + + // try to combine static sounds with a previous channel of the same + // sound effect so we don't mix five torches every frame + + if (i >= MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS) { + // see if it can just use the last one + if (combine && combine->sfx == ch->sfx) { + combine->leftvol += ch->leftvol; + combine->rightvol += ch->rightvol; + ch->leftvol = ch->rightvol = 0; + continue; + } + // search for one + combine = channels + MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS; + for (j = MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS; j < i; j++, combine++) + if (combine->sfx == ch->sfx) + break; + + if (j == total_channels) { + combine = NULL; + } else { + if (combine != ch) { + combine->leftvol += ch->leftvol; + combine->rightvol += ch->rightvol; + ch->leftvol = ch->rightvol = 0; + } + continue; + } + } + + + } + +// +// debugging output +// + if (snd_show->int_val) { + total = 0; + ch = channels; + for (i = 0; i < total_channels; i++, ch++) + if (ch->sfx && (ch->leftvol || ch->rightvol)) { + // Con_Printf ("%3i %3i %s\n", ch->leftvol, ch->rightvol, + // ch->sfx->name); + total++; + } + + Con_Printf ("----(%i)----\n", total); + } +// mix some sound + S_Update_ (); +} + +void +GetSoundtime (void) +{ + int samplepos; + static int buffers; + static int oldsamplepos; + int fullsamples; + + fullsamples = shm->samples / shm->channels; + +// it is possible to miscount buffers if it has wrapped twice between +// calls to S_Update. Oh well. + samplepos = SNDDMA_GetDMAPos (); + + if (samplepos < oldsamplepos) { + buffers++; // buffer wrapped + + if (paintedtime > 0x40000000) { // time to chop things off to avoid + // 32 bit limits + buffers = 0; + paintedtime = fullsamples; + S_StopAllSounds (true); + } + } + oldsamplepos = samplepos; + + soundtime = buffers * fullsamples + samplepos / shm->channels; +} + +void +S_ExtraUpdate (void) +{ + +#ifdef _WIN32 + IN_Accumulate (); +#endif + + if (snd_noextraupdate->int_val) + return; // don't pollute timings + S_Update_ (); +} + + + +void +S_Update_ (void) +{ + unsigned int endtime; + int samps; + + if (!sound_started || (snd_blocked > 0)) + return; + +// Updates DMA time + GetSoundtime (); + +// check to make sure that we haven't overshot + if (paintedtime < soundtime) { + // Con_Printf ("S_Update_ : overflow\n"); + paintedtime = soundtime; + } +// mix ahead of current position + endtime = soundtime + _snd_mixahead->value * shm->speed; + samps = shm->samples >> (shm->channels - 1); + if (endtime - soundtime > samps) + endtime = soundtime + samps; + +#ifdef _WIN32 + if (pDSBuf) + DSOUND_Restore (); +#endif + + S_PaintChannels (endtime); + + SNDDMA_Submit (); +} + +/* + console functions +*/ + +void +S_Play (void) +{ + static int hash = 345; + int i; + char name[256]; + sfx_t *sfx; + + i = 1; + while (i < Cmd_Argc ()) { + if (!strrchr (Cmd_Argv (i), '.')) { + strcpy (name, Cmd_Argv (i)); + strncat (name, ".wav", sizeof (name) - strlen (name)); + } else + strcpy (name, Cmd_Argv (i)); + sfx = S_PrecacheSound (name); + S_StartSound (hash++, 0, sfx, listener_origin, 1.0, 1.0); + i++; + } +} + +void +S_PlayVol (void) +{ + static int hash = 543; + int i; + float vol; + char name[256]; + sfx_t *sfx; + + i = 1; + while (i < Cmd_Argc ()) { + if (!strrchr (Cmd_Argv (i), '.')) { + strcpy (name, Cmd_Argv (i)); + strncat (name, ".wav", sizeof (name) - strlen (name)); + } else + strcpy (name, Cmd_Argv (i)); + sfx = S_PrecacheSound (name); + vol = atof (Cmd_Argv (i + 1)); + S_StartSound (hash++, 0, sfx, listener_origin, vol, 1.0); + i += 2; + } +} + +void +S_SoundList (void) +{ + int i; + sfx_t *sfx; + sfxcache_t *sc; + int size, total; + + total = 0; + for (sfx = known_sfx, i = 0; i < num_sfx; i++, sfx++) { + sc = Cache_Check (&sfx->cache); + if (!sc) + continue; + size = sc->length * sc->width * (sc->stereo + 1); + total += size; + if (sc->loopstart >= 0) + Con_Printf ("L"); + else + Con_Printf (" "); + Con_Printf ("(%2db) %6i : %s\n", sc->width * 8, size, sfx->name); + } + Con_Printf ("Total resident: %i\n", total); +} + + +void +S_LocalSound (char *sound) +{ + sfx_t *sfx; + + if (nosound->int_val) + return; + if (!sound_started) + return; + + sfx = S_PrecacheSound (sound); + if (!sfx) { + Con_Printf ("S_LocalSound: can't cache %s\n", sound); + return; + } + S_StartSound (cl.viewentity, -1, sfx, vec3_origin, 1, 1); +} + + +void +S_ClearPrecache (void) +{ +} + + +void +S_BeginPrecaching (void) +{ +} + + +void +S_EndPrecaching (void) +{ +} diff --git a/nq/source/snd_null.c b/nq/source/snd_null.c new file mode 100644 index 000000000..5a251d117 --- /dev/null +++ b/nq/source/snd_null.c @@ -0,0 +1,147 @@ +/* + snd_null.c + + include this instead of all the other snd_* files to have no sound + code whatsoever + + Copyright (C) 1996-1997 Id Software, Inc. + Copyright (C) 1999,2000 contributors of the QuakeForge project + Please see the file "AUTHORS" for a list of contributors + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + + $Id$ +*/ + +#include "QF/qtypes.h" +#include "sound.h" + +// ======================================================================= +// Various variables also defined in snd_dma.c +// FIXME - should be put in one place +// ======================================================================= +channel_t channels[MAX_CHANNELS]; +int total_channels; +volatile dma_t *shm = 0; +cvar_t *loadas8bit; +int paintedtime; // sample PAIRS + + +cvar_t *bgmvolume; +cvar_t *volume; + + +void +S_Init (void) +{ + S_Init_Cvars (); +} + +void +S_Init_Cvars (void) +{ + volume = Cvar_Get ("volume", "0.7", CVAR_ARCHIVE, NULL, + "Volume level of sounds"); + loadas8bit = + Cvar_Get ("loadas8bit", "0", CVAR_NONE, NULL, "Load samples as 8-bit"); + bgmvolume = Cvar_Get ("bgmvolume", "1", CVAR_ARCHIVE, NULL, + "CD music volume"); +} + +void +S_AmbientOff (void) +{ +} + +void +S_AmbientOn (void) +{ +} + +void +S_Shutdown (void) +{ +} + +void +S_TouchSound (char *sample) +{ +} + +void +S_ClearBuffer (void) +{ +} + +void +S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation) +{ +} + +void +S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, + float attenuation) +{ +} + +void +S_StopSound (int entnum, int entchannel) +{ +} + +sfx_t * +S_PrecacheSound (char *sample) +{ + return NULL; +} + +void +S_ClearPrecache (void) +{ +} + +void +S_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_up) +{ +} + +void +S_StopAllSounds (qboolean clear) +{ +} + +void +S_BeginPrecaching (void) +{ +} + +void +S_EndPrecaching (void) +{ +} + +void +S_ExtraUpdate (void) +{ +} + +void +S_LocalSound (char *s) +{ +} diff --git a/nq/source/sv_main.c b/nq/source/sv_main.c index 4f64422f7..5e6038568 100644 --- a/nq/source/sv_main.c +++ b/nq/source/sv_main.c @@ -1,4 +1,3 @@ - /* sv_main.c @@ -60,17 +59,21 @@ SV_Init (void) { int i; - sv_maxvelocity = Cvar_Get ("sv_maxvelocity", "2000", CVAR_NONE, 0, "None"); - sv_gravity = Cvar_Get ("sv_gravity", "800", CVAR_SERVERINFO, Cvar_Info, "None"); - sv_friction = Cvar_Get ("sv_friction", "4", CVAR_SERVERINFO, Cvar_Info, "None"); - sv_edgefriction = Cvar_Get ("edgefriction", "2", CVAR_NONE, 0, "None"); - sv_stopspeed = Cvar_Get ("sv_stopspeed", "100", CVAR_NONE, 0, "None"); - sv_maxspeed = Cvar_Get ("sv_maxspeed", "320", CVAR_SERVERINFO, Cvar_Info, "None"); - sv_accelerate = Cvar_Get ("sv_accelerate", "10", CVAR_NONE, 0, "None"); + sv_maxvelocity = Cvar_Get ("sv_maxvelocity", "2000", CVAR_NONE, NULL, + "None"); + sv_gravity = Cvar_Get ("sv_gravity", "800", CVAR_SERVERINFO, Cvar_Info, + "None"); + sv_friction = Cvar_Get ("sv_friction", "4", CVAR_SERVERINFO, Cvar_Info, + "None"); + sv_edgefriction = Cvar_Get ("edgefriction", "2", CVAR_NONE, NULL, "None"); + sv_stopspeed = Cvar_Get ("sv_stopspeed", "100", CVAR_NONE, NULL, "None"); + sv_maxspeed = Cvar_Get ("sv_maxspeed", "320", CVAR_SERVERINFO, Cvar_Info, + "None"); + sv_accelerate = Cvar_Get ("sv_accelerate", "10", CVAR_NONE, NULL, "None"); sv_idealpitchscale = - Cvar_Get ("sv_idealpitchscale", "0.8", CVAR_NONE, 0, "None"); - sv_aim = Cvar_Get ("sv_aim", "0.93", CVAR_NONE, 0, "None"); - sv_nostep = Cvar_Get ("sv_nostep", "0", CVAR_NONE, 0, "None"); + Cvar_Get ("sv_idealpitchscale", "0.8", CVAR_NONE, NULL, "None"); + sv_aim = Cvar_Get ("sv_aim", "0.93", CVAR_NONE, NULL, "None"); + sv_nostep = Cvar_Get ("sv_nostep", "0", CVAR_NONE, NULL, "None"); for (i = 0; i < MAX_MODELS; i++) snprintf (localmodels[i], sizeof (localmodels[i]), "*%i", i); diff --git a/nq/source/sv_progs.c b/nq/source/sv_progs.c index 8491e8180..fe9fc4bb6 100644 --- a/nq/source/sv_progs.c +++ b/nq/source/sv_progs.c @@ -305,23 +305,27 @@ SV_Progs_Init (void) void SV_Progs_Init_Cvars (void) { - r_skyname = Cvar_Get ("r_skyname", "", CVAR_SERVERINFO, Cvar_Info, "name of skybox"); - sv_progs = Cvar_Get ("sv_progs", "progs.dat", CVAR_ROM, 0, + r_skyname = Cvar_Get ("r_skyname", "", CVAR_SERVERINFO, Cvar_Info, + "name of skybox"); + sv_progs = Cvar_Get ("sv_progs", "progs.dat", CVAR_ROM, NULL, "Allows selectable game progs if you have several " "of them in the gamedir"); - pr_checkextentions = Cvar_Get ("sv_progs", "1", CVAR_ROM, 0, + pr_checkextentions = Cvar_Get ("sv_progs", "1", CVAR_ROM, NULL, "indicate the presence of the " "checkextentions qc function"); - nomonsters = Cvar_Get ("nomonsters", "0", CVAR_NONE, 0, "No Description"); - gamecfg = Cvar_Get ("gamecfg", "0", CVAR_NONE, 0, "No Description"); - scratch1 = Cvar_Get ("scratch1", "0", CVAR_NONE, 0, "No Description"); - scratch2 = Cvar_Get ("scratch2", "0", CVAR_NONE, 0, "No Description"); - scratch3 = Cvar_Get ("scratch3", "0", CVAR_NONE, 0, "No Description"); - scratch4 = Cvar_Get ("scratch4", "0", CVAR_NONE, 0, "No Description"); - savedgamecfg = Cvar_Get ("savedgamecfg", "0", CVAR_ARCHIVE, 0, "No Description"); - saved1 = Cvar_Get ("saved1", "0", CVAR_ARCHIVE, 0, "No Description"); - saved2 = Cvar_Get ("saved2", "0", CVAR_ARCHIVE, 0, "No Description"); - saved3 = Cvar_Get ("saved3", "0", CVAR_ARCHIVE, 0, "No Description"); - saved4 = Cvar_Get ("saved4", "0", CVAR_ARCHIVE, 0, "No Description"); + nomonsters = Cvar_Get ("nomonsters", "0", CVAR_NONE, NULL, + "No Description"); + gamecfg = Cvar_Get ("gamecfg", "0", CVAR_NONE, NULL, "No Description"); + scratch1 = Cvar_Get ("scratch1", "0", CVAR_NONE, NULL, "No Description"); + scratch2 = Cvar_Get ("scratch2", "0", CVAR_NONE, NULL, "No Description"); + scratch3 = Cvar_Get ("scratch3", "0", CVAR_NONE, NULL, "No Description"); + scratch4 = Cvar_Get ("scratch4", "0", CVAR_NONE, NULL, "No Description"); + savedgamecfg = Cvar_Get ("savedgamecfg", "0", CVAR_ARCHIVE, NULL, + "No Description"); + saved1 = Cvar_Get ("saved1", "0", CVAR_ARCHIVE, NULL, "No Description"); + saved2 = Cvar_Get ("saved2", "0", CVAR_ARCHIVE, NULL, "No Description"); + saved3 = Cvar_Get ("saved3", "0", CVAR_ARCHIVE, NULL, "No Description"); + saved4 = Cvar_Get ("saved4", "0", CVAR_ARCHIVE, NULL, "No Description"); } + diff --git a/nq/source/sw_rmain.c b/nq/source/sw_rmain.c index acec5e458..0f9ee8435 100644 --- a/nq/source/sw_rmain.c +++ b/nq/source/sw_rmain.c @@ -215,30 +215,35 @@ R_Init (void) Cmd_AddCommand ("timerefresh", R_TimeRefresh_f, "No Description"); Cmd_AddCommand ("pointfile", R_ReadPointFile_f, "No Description"); - gl_particles = Cvar_Get ("gl_particles", "1", CVAR_ARCHIVE | CVAR_ROM, 0, - "whether or not to draw particles"); + gl_particles = Cvar_Get ("gl_particles", "1", CVAR_ARCHIVE | CVAR_ROM, + NULL, "whether or not to draw particles"); - r_draworder = Cvar_Get ("r_draworder", "0", CVAR_NONE, 0, "None"); - r_speeds = Cvar_Get ("r_speeds", "0", CVAR_NONE, 0, "None"); - r_timegraph = Cvar_Get ("r_timegraph", "0", CVAR_NONE, 0, "None"); - r_graphheight = Cvar_Get ("r_graphheight", "10", CVAR_NONE, 0, "None"); - r_drawflat = Cvar_Get ("r_drawflat", "0", CVAR_NONE, 0, "None"); - r_ambient = Cvar_Get ("r_ambient", "0", CVAR_NONE, 0, "None"); - r_clearcolor = Cvar_Get ("r_clearcolor", "2", CVAR_NONE, 0, "None"); - r_waterwarp = Cvar_Get ("r_waterwarp", "1", CVAR_NONE, 0, "None"); - r_fullbright = Cvar_Get ("r_fullbright", "0", CVAR_NONE, 0, "None"); - r_drawentities = Cvar_Get ("r_drawentities", "1", CVAR_NONE, 0, "None"); - r_drawviewmodel = Cvar_Get ("r_drawviewmodel", "1", CVAR_NONE, 0, "None"); - r_aliasstats = Cvar_Get ("r_polymodelstats", "0", CVAR_NONE, 0, "None"); - r_dspeeds = Cvar_Get ("r_dspeeds", "0", CVAR_NONE, 0, "None"); - r_reportsurfout = Cvar_Get ("r_reportsurfout", "0", CVAR_NONE, 0, "None"); - r_maxsurfs = Cvar_Get ("r_maxsurfs", "0", CVAR_NONE, 0, "None"); - r_numsurfs = Cvar_Get ("r_numsurfs", "0", CVAR_NONE, 0, "None"); - r_reportedgeout = Cvar_Get ("r_reportedgeout", "0", CVAR_NONE, 0, "None"); - r_maxedges = Cvar_Get ("r_maxedges", "0", CVAR_NONE, 0, "None"); - r_numedges = Cvar_Get ("r_numedges", "0", CVAR_NONE, 0, "None"); - r_aliastransbase = Cvar_Get ("r_aliastransbase", "200", CVAR_NONE, 0, "None"); - r_aliastransadj = Cvar_Get ("r_aliastransadj", "100", CVAR_NONE, 0, "None"); + r_draworder = Cvar_Get ("r_draworder", "0", CVAR_NONE, NULL, "None"); + r_speeds = Cvar_Get ("r_speeds", "0", CVAR_NONE, NULL, "None"); + r_timegraph = Cvar_Get ("r_timegraph", "0", CVAR_NONE, NULL, "None"); + r_graphheight = Cvar_Get ("r_graphheight", "10", CVAR_NONE, NULL, "None"); + r_drawflat = Cvar_Get ("r_drawflat", "0", CVAR_NONE, NULL, "None"); + r_ambient = Cvar_Get ("r_ambient", "0", CVAR_NONE, NULL, "None"); + r_clearcolor = Cvar_Get ("r_clearcolor", "2", CVAR_NONE, NULL, "None"); + r_waterwarp = Cvar_Get ("r_waterwarp", "1", CVAR_NONE, NULL, "None"); + r_fullbright = Cvar_Get ("r_fullbright", "0", CVAR_NONE, NULL, "None"); + r_drawentities = Cvar_Get ("r_drawentities", "1", CVAR_NONE, NULL, "None"); + r_drawviewmodel = Cvar_Get ("r_drawviewmodel", "1", CVAR_NONE, NULL, + "None"); + r_aliasstats = Cvar_Get ("r_polymodelstats", "0", CVAR_NONE, NULL, "None"); + r_dspeeds = Cvar_Get ("r_dspeeds", "0", CVAR_NONE, NULL, "None"); + r_reportsurfout = Cvar_Get ("r_reportsurfout", "0", CVAR_NONE, NULL, + "None"); + r_maxsurfs = Cvar_Get ("r_maxsurfs", "0", CVAR_NONE, NULL, "None"); + r_numsurfs = Cvar_Get ("r_numsurfs", "0", CVAR_NONE, NULL, "None"); + r_reportedgeout = Cvar_Get ("r_reportedgeout", "0", CVAR_NONE, NULL, + "None"); + r_maxedges = Cvar_Get ("r_maxedges", "0", CVAR_NONE, NULL, "None"); + r_numedges = Cvar_Get ("r_numedges", "0", CVAR_NONE, NULL, "None"); + r_aliastransbase = Cvar_Get ("r_aliastransbase", "200", CVAR_NONE, NULL, + "None"); + r_aliastransadj = Cvar_Get ("r_aliastransadj", "100", CVAR_NONE, NULL, + "None"); Cvar_SetValue (r_maxedges, (float) NUMSTACKEDGES); Cvar_SetValue (r_maxsurfs, (float) NUMSTACKSURFACES); diff --git a/nq/source/sys_unix.c b/nq/source/sys_unix.c index fdf7d5828..7bceb0521 100644 --- a/nq/source/sys_unix.c +++ b/nq/source/sys_unix.c @@ -274,7 +274,8 @@ main (int c, char **v) Sys_Init (); - sys_nostdout = Cvar_Get ("sys_nostdout", "0", CVAR_NONE, 0, "set to disable std out"); + sys_nostdout = Cvar_Get ("sys_nostdout", "0", CVAR_NONE, NULL, + "set to disable std out"); if (COM_CheckParm ("-nostdout")) Cvar_Set (sys_nostdout, "1"); else { diff --git a/nq/source/vid.c b/nq/source/vid.c index f4f4d493c..2b00697ea 100644 --- a/nq/source/vid.c +++ b/nq/source/vid.c @@ -48,9 +48,11 @@ VID_GetWindowSize (int def_w, int def_h) int pnum; vid_width = - Cvar_Get ("vid_width", va ("%d", def_w), CVAR_ROM, 0, "screen width"); + Cvar_Get ("vid_width", va ("%d", def_w), CVAR_ROM, NULL, + "screen width"); vid_height = - Cvar_Get ("vid_height", va ("%d", def_h), CVAR_ROM, 0, "screen height"); + Cvar_Get ("vid_height", va ("%d", def_h), CVAR_ROM, NULL, + "screen height"); if ((pnum = COM_CheckParm ("-width"))) { if (pnum >= com_argc - 1) diff --git a/nq/source/vid_common_gl.c b/nq/source/vid_common_gl.c index 37fc4e86e..3b4c3ad5e 100644 --- a/nq/source/vid_common_gl.c +++ b/nq/source/vid_common_gl.c @@ -286,8 +286,8 @@ VID_Is8bit (void) } #ifdef HAVE_TDFXGL -void 3 -dfx_Init8bitPalette () +void +Tdfx_Init8bitPalette () { // Check for 8bit Extensions and initialize them. int i; @@ -378,11 +378,11 @@ VID_Init8bitPalette (void) Con_Printf ("disabled.\n"); return; } - vid_use8bit = Cvar_Get ("vid_use8bit", "0", CVAR_ROM, 0, + vid_use8bit = Cvar_Get ("vid_use8bit", "0", CVAR_ROM, NULL, "Whether to use Shared Palettes."); if (vid_use8bit->value) { #ifdef HAVE_TDFXGL - 3 dfx_Init8bitPalette (); + Tdfx_Init8bitPalette (); #else #ifdef GL_SHARED_TEXTURE_PALETTE_EXT Shared_Init8bitPalette (); diff --git a/nq/source/vid_dos.c b/nq/source/vid_dos.c index 1a2e93c68..eeb8d0a05 100644 --- a/nq/source/vid_dos.c +++ b/nq/source/vid_dos.c @@ -1,4 +1,3 @@ - /* vid_dos.c @@ -104,24 +103,27 @@ VID_Init void VID_Init (unsigned char *palette) { - vid_mode = Cvar_Get ("vid_mode", "0", CVAR_NONE, 0, "None"); - vid_wait = Cvar_Get ("vid_wait", "0", CVAR_NONE, 0, "None"); - vid_nopageflip = Cvar_Get ("vid_nopageflip", "0", CVAR_ARCHIVE, 0, "None"); + vid_mode = Cvar_Get ("vid_mode", "0", CVAR_NONE, NULL, "None"); + vid_wait = Cvar_Get ("vid_wait", "0", CVAR_NONE, NULL, "None"); + vid_nopageflip = Cvar_Get ("vid_nopageflip", "0", CVAR_ARCHIVE, NULL, + "None"); _vid_wait_override = - Cvar_Get ("_vid_wait_override", "0", CVAR_ARCHIVE, 0, "None"); + Cvar_Get ("_vid_wait_override", "0", CVAR_ARCHIVE, NULL, "None"); _vid_default_mode = - Cvar_Get ("_vid_default_mode", "0", CVAR_ARCHIVE, 0, "None"); + Cvar_Get ("_vid_default_mode", "0", CVAR_ARCHIVE, NULL, "None"); _vid_default_mode_win = - Cvar_Get ("_vid_default_mode_win", "3", CVAR_ARCHIVE, 0, "None"); - vid_config_x = Cvar_Get ("vid_config_x", "800", CVAR_ARCHIVE, 0, "None"); - vid_config_y = Cvar_Get ("vid_config_y", "600", CVAR_ARCHIVE, 0, "None"); - vid_stretch_by_2 = Cvar_Get ("vid_stretch_by_2", "1", CVAR_ARCHIVE, 0, "None"); - _windowed_mouse = Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, 0, "None"); + Cvar_Get ("_vid_default_mode_win", "3", CVAR_ARCHIVE, NULL, "None"); + vid_config_x = Cvar_Get ("vid_config_x", "800", CVAR_ARCHIVE, NULL, "None"); + vid_config_y = Cvar_Get ("vid_config_y", "600", CVAR_ARCHIVE, NULL, "None"); + vid_stretch_by_2 = Cvar_Get ("vid_stretch_by_2", "1", CVAR_ARCHIVE, NULL, + "None"); + _windowed_mouse = Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, NULL, + "None"); vid_fullscreen_mode = - Cvar_Get ("vid_fullscreen_mode", "3", CVAR_ARCHIVE, 0, "None"); + Cvar_Get ("vid_fullscreen_mode", "3", CVAR_ARCHIVE, NULL, "None"); vid_windowed_mode = - Cvar_Get ("vid_windowed_mode", "0", CVAR_ARCHIVE, 0, "None"); - block_switch = Cvar_Get ("block_switch", "0", CVAR_ARCHIVE, 0, "None"); + Cvar_Get ("vid_windowed_mode", "0", CVAR_ARCHIVE, NULL, "None"); + block_switch = Cvar_Get ("block_switch", "0", CVAR_ARCHIVE, NULL, "None"); Cmd_AddCommand ("vid_testmode", VID_TestMode_f, "No Description"); Cmd_AddCommand ("vid_nummodes", VID_NumModes_f, "No Description"); diff --git a/nq/source/vid_fbdev.c b/nq/source/vid_fbdev.c index 225696cd4..00d5d0706 100644 --- a/nq/source/vid_fbdev.c +++ b/nq/source/vid_fbdev.c @@ -6,7 +6,6 @@ based on vid_svgalib.c Copyright (C) 1996-1997 Id Software, Inc. - Copyright (C) 1999-2000 Nelson Rush. Copyright (C) 1999-2000 Marcus Sundberg [mackan@stacken.kth.se] Copyright (C) 1999-2000 David Symonds [xoxus@usa.net] Copyright (C) 1999,2000 contributors of the QuakeForge project @@ -625,11 +624,12 @@ VID_Init (unsigned char *palette) void VID_Init_Cvars () { - vid_mode = Cvar_Get ("vid_mode", "0", CVAR_NONE, 0, "Sets the video mode"); - vid_redrawfull = Cvar_Get ("vid_redrawfull", "0", CVAR_NONE, 0, + vid_mode = Cvar_Get ("vid_mode", "0", CVAR_NONE, NULL, + "Sets the video mode"); + vid_redrawfull = Cvar_Get ("vid_redrawfull", "0", CVAR_NONE, NULL, "Redraw entire screen each frame instead of just dirty areas"); - vid_waitforrefresh = Cvar_Get ("vid_waitforrefresh", "0", CVAR_ARCHIVE, 0, - "Wait for vertical retrace before drawing next frame"); + vid_waitforrefresh = Cvar_Get ("vid_waitforrefresh", "0", CVAR_ARCHIVE, + NULL, "Wait for vertical retrace before drawing next frame"); } diff --git a/nq/source/vid_mgl.c b/nq/source/vid_mgl.c index f349647ea..70924976d 100644 --- a/nq/source/vid_mgl.c +++ b/nq/source/vid_mgl.c @@ -1,4 +1,3 @@ - /* vid_mgl.c @@ -2114,21 +2113,24 @@ VID_Init (unsigned char *palette) void VID_Init_Cvars () { - vid_mode = Cvar_Get ("vid_mode", "0", CVAR_NONE, 0, "None"); - vid_nopageflip = Cvar_Get ("vid_nopageflip", "0", CVAR_ARCHIVE, 0, "None"); + vid_mode = Cvar_Get ("vid_mode", "0", CVAR_NONE, NULL, "None"); + vid_nopageflip = Cvar_Get ("vid_nopageflip", "0", CVAR_ARCHIVE, NULL, + "None"); _vid_default_mode_win = - Cvar_Get ("_vid_default_mode_win", "3", CVAR_ARCHIVE, 0, "None"); - vid_config_x = Cvar_Get ("vid_config_x", "800", CVAR_ARCHIVE, 0, "None"); - vid_config_y = Cvar_Get ("vid_config_y", "600", CVAR_ARCHIVE, 0, "None"); - vid_stretch_by_2 = Cvar_Get ("vid_stretch_by_2", "1", CVAR_ARCHIVE, 0, "None"); - _windowed_mouse = Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, 0, "None"); + Cvar_Get ("_vid_default_mode_win", "3", CVAR_ARCHIVE, NULL, "None"); + vid_config_x = Cvar_Get ("vid_config_x", "800", CVAR_ARCHIVE, NULL, "None"); + vid_config_y = Cvar_Get ("vid_config_y", "600", CVAR_ARCHIVE, NULL, "None"); + vid_stretch_by_2 = Cvar_Get ("vid_stretch_by_2", "1", CVAR_ARCHIVE, NULL, + "None"); + _windowed_mouse = Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, NULL, + "None"); vid_fullscreen_mode = - Cvar_Get ("vid_fullscreen_mode", "3", CVAR_ARCHIVE, 0, "None"); + Cvar_Get ("vid_fullscreen_mode", "3", CVAR_ARCHIVE, NULL, "None"); vid_windowed_mode = - Cvar_Get ("vid_windowed_mode", "0", CVAR_ARCHIVE, 0, "None"); - block_switch = Cvar_Get ("block_switch", "0", CVAR_ARCHIVE, 0, "None"); - vid_window_x = Cvar_Get ("vid_window_x", "0", CVAR_ARCHIVE, 0, "None"); - vid_window_y = Cvar_Get ("vid_window_y", "0", CVAR_ARCHIVE, 0, "None"); + Cvar_Get ("vid_windowed_mode", "0", CVAR_ARCHIVE, NULL, "None"); + block_switch = Cvar_Get ("block_switch", "0", CVAR_ARCHIVE, NULL, "None"); + vid_window_x = Cvar_Get ("vid_window_x", "0", CVAR_ARCHIVE, NULL, "None"); + vid_window_y = Cvar_Get ("vid_window_y", "0", CVAR_ARCHIVE, NULL, "None"); } diff --git a/nq/source/vid_sdl.c b/nq/source/vid_sdl.c index a84a4afd6..6daa8554c 100644 --- a/nq/source/vid_sdl.c +++ b/nq/source/vid_sdl.c @@ -1,4 +1,3 @@ - /* vid_sdl.c @@ -187,7 +186,7 @@ void VID_Init_Cvars () { vid_fullscreen = - Cvar_Get ("vid_fullscreen", "0", CVAR_ROM, 0, + Cvar_Get ("vid_fullscreen", "0", CVAR_ROM, NULL, "Toggles fullscreen game mode"); } diff --git a/nq/source/vid_sgl.c b/nq/source/vid_sgl.c index ea3b78d2f..edc5f33d9 100644 --- a/nq/source/vid_sgl.c +++ b/nq/source/vid_sgl.c @@ -1,4 +1,3 @@ - /* vid_sgl.c @@ -222,7 +221,7 @@ VID_Init (unsigned char *palette) void VID_Init_Cvars () { - vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_NONE, 0, "None"); + vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_NONE, NULL, "None"); } void diff --git a/nq/source/vid_sunx.c b/nq/source/vid_sunx.c index b60c1ecba..3fa6feb18 100644 --- a/nq/source/vid_sunx.c +++ b/nq/source/vid_sunx.c @@ -1,4 +1,3 @@ - /* vid_sunx.c @@ -1312,7 +1311,7 @@ Sys_ConsoleInput (void) void IN_Init (void) { - m_filter = Cvar_Get ("m_filter", "0", CVAR_ARCHIVE, 0, "None"); + m_filter = Cvar_Get ("m_filter", "0", CVAR_ARCHIVE, NULL, "None"); if (COM_CheckParm ("-nomouse")) return; mouse_x = mouse_y = 0.0; diff --git a/nq/source/vid_sunxil.c b/nq/source/vid_sunxil.c index 152671874..09257a0e6 100644 --- a/nq/source/vid_sunxil.c +++ b/nq/source/vid_sunxil.c @@ -1,4 +1,3 @@ - /* vid_sunxil.c @@ -419,7 +418,8 @@ VID_Init (unsigned char *palette) Cmd_AddCommand ("gamma", VID_Gamma_f, "No Description"); - pixel_multiply = Cvar_Get ("pixel_multiply", "2", CVAR_ARCHIVE, 0, "None"); + pixel_multiply = Cvar_Get ("pixel_multiply", "2", CVAR_ARCHIVE, NULL, + "None"); if (pipe (render_pipeline) < 0) Sys_Error ("VID_Init: pipe"); @@ -1339,8 +1339,9 @@ IN_SendKeyEvents (void) void IN_Init (void) { - _windowed_mouse = Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, 0, "None"); - m_filter = Cvar_Get ("m_filter", "0", CVAR_ARCHIVE, 0, "None"); + _windowed_mouse = Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, NULL, + "None"); + m_filter = Cvar_Get ("m_filter", "0", CVAR_ARCHIVE, NULL, "None"); if (COM_CheckParm ("-nomouse")) return; mouse_x = mouse_y = 0.0; diff --git a/nq/source/vid_svgalib.c b/nq/source/vid_svgalib.c index 5e0e43987..5bdeaa8c2 100644 --- a/nq/source/vid_svgalib.c +++ b/nq/source/vid_svgalib.c @@ -5,7 +5,6 @@ Linux SVGALib video routines Copyright (C) 1996-1997 Id Software, Inc. - Copyright (C) 1999-2000 Nelson Rush. Copyright (C) 1999-2000 Marcus Sundberg [mackan@stacken.kth.se] Copyright (C) 1999-2000 David Symonds [xoxus@usa.net] Copyright (C) 1999,2000 contributors of the QuakeForge project @@ -598,10 +597,10 @@ VID_Init (unsigned char *palette) void VID_Init_Cvars () { - vid_mode = Cvar_Get ("vid_mode", "5", CVAR_NONE, 0, "None"); - vid_redrawfull = Cvar_Get ("vid_redrawfull", "0", CVAR_NONE, 0, "None"); - vid_waitforrefresh = Cvar_Get ("vid_waitforrefresh", "0", - CVAR_ARCHIVE, 0, "None"); + vid_mode = Cvar_Get ("vid_mode", "5", CVAR_NONE, NULL, "None"); + vid_redrawfull = Cvar_Get ("vid_redrawfull", "0", CVAR_NONE, NULL, "None"); + vid_waitforrefresh = Cvar_Get ("vid_waitforrefresh", "0", CVAR_ARCHIVE, + NULL, "None"); } diff --git a/nq/source/vid_wgl.c b/nq/source/vid_wgl.c index bb4a7c9e7..55d311d57 100644 --- a/nq/source/vid_wgl.c +++ b/nq/source/vid_wgl.c @@ -1765,7 +1765,8 @@ VID_Init (unsigned char *palette) void VID_Init_Cvars () { - _windowed_mouse = Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, 0, "None"); + _windowed_mouse = Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, NULL, + "None"); } diff --git a/nq/source/vid_win.c b/nq/source/vid_win.c index a03615f75..c42bce1f0 100644 --- a/nq/source/vid_win.c +++ b/nq/source/vid_win.c @@ -1986,26 +1986,29 @@ VID_Init (unsigned char *palette) int basenummodes; byte *ptmp; - vid_mode = Cvar_Get ("vid_mode", "0", CVAR_NONE, 0, "None"); - vid_wait = Cvar_Get ("vid_wait", "0", CVAR_NONE, 0, "None"); - vid_nopageflip = Cvar_Get ("vid_nopageflip", "0", CVAR_ARCHIVE, 0, "None"); + vid_mode = Cvar_Get ("vid_mode", "0", CVAR_NONE, NULL, "None"); + vid_wait = Cvar_Get ("vid_wait", "0", CVAR_NONE, NULL, "None"); + vid_nopageflip = Cvar_Get ("vid_nopageflip", "0", CVAR_ARCHIVE, NULL, + "None"); _vid_wait_override = - Cvar_Get ("_vid_wait_override", "0", CVAR_ARCHIVE, 0, "None"); + Cvar_Get ("_vid_wait_override", "0", CVAR_ARCHIVE, NULL, "None"); _vid_default_mode = - Cvar_Get ("_vid_default_mode", "0", CVAR_ARCHIVE, 0, "None"); + Cvar_Get ("_vid_default_mode", "0", CVAR_ARCHIVE, NULL, "None"); _vid_default_mode_win = - Cvar_Get ("_vid_default_mode_win", "3", CVAR_ARCHIVE, 0, "None"); - vid_config_x = Cvar_Get ("vid_config_x", "800", CVAR_ARCHIVE, 0, "None"); - vid_config_y = Cvar_Get ("vid_config_y", "600", CVAR_ARCHIVE, 0, "None"); - vid_stretch_by_2 = Cvar_Get ("vid_stretch_by_2", "1", CVAR_ARCHIVE, 0, "None"); - _windowed_mouse = Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, 0, "None"); + Cvar_Get ("_vid_default_mode_win", "3", CVAR_ARCHIVE, NULL, "None"); + vid_config_x = Cvar_Get ("vid_config_x", "800", CVAR_ARCHIVE, NULL, "None"); + vid_config_y = Cvar_Get ("vid_config_y", "600", CVAR_ARCHIVE, NULL, "None"); + vid_stretch_by_2 = Cvar_Get ("vid_stretch_by_2", "1", CVAR_ARCHIVE, NULL, + "None"); + _windowed_mouse = Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, NULL, + "None"); vid_fullscreen_mode = - Cvar_Get ("vid_fullscreen_mode", "3", CVAR_ARCHIVE, 0, "None"); + Cvar_Get ("vid_fullscreen_mode", "3", CVAR_ARCHIVE, NULL, "None"); vid_windowed_mode = - Cvar_Get ("vid_windowed_mode", "0", CVAR_ARCHIVE, 0, "None"); - block_switch = Cvar_Get ("block_switch", "0", CVAR_ARCHIVE, 0, "None"); - vid_window_x = Cvar_Get ("vid_window_x", "0", CVAR_ARCHIVE, 0, "None"); - vid_window_y = Cvar_Get ("vid_window_y", "0", CVAR_ARCHIVE, 0, "None"); + Cvar_Get ("vid_windowed_mode", "0", CVAR_ARCHIVE, NULL, "None"); + block_switch = Cvar_Get ("block_switch", "0", CVAR_ARCHIVE, NULL, "None"); + vid_window_x = Cvar_Get ("vid_window_x", "0", CVAR_ARCHIVE, NULL, "None"); + vid_window_y = Cvar_Get ("vid_window_y", "0", CVAR_ARCHIVE, NULL, "None"); Cmd_AddCommand ("vid_testmode", VID_TestMode_f, "No Description"); Cmd_AddCommand ("vid_nummodes", VID_NumModes_f, "No Description"); diff --git a/qw/source/cl_cam.c b/qw/source/cl_cam.c index 4e10bbd4d..8fb69ae3e 100644 --- a/qw/source/cl_cam.c +++ b/qw/source/cl_cam.c @@ -603,9 +603,10 @@ Cam_Reset (void) void CL_Cam_Init_Cvars (void) { - cl_hightrack = Cvar_Get ("cl_hightrack", "0", CVAR_NONE, 0, "view the player with the highest frags while in spectator mode."); - cl_chasecam = Cvar_Get ("cl_chasecam", "0", CVAR_NONE, 0, "get first person view of the person you are tracking in spectator mode"); + cl_hightrack = Cvar_Get ("cl_hightrack", "0", CVAR_NONE, NULL, "view the player with the highest frags while in spectator mode."); + cl_chasecam = Cvar_Get ("cl_chasecam", "0", CVAR_NONE, NULL, "get first person view of the person you are tracking in spectator mode"); cl_camera_maxpitch = - Cvar_Get ("cl_camera_maxpitch", "10", CVAR_NONE, 0, "highest camera pitch in spectator mode"); - cl_camera_maxyaw = Cvar_Get ("cl_camera_maxyaw", "30", CVAR_NONE, 0, "highest camera yaw in spectator mode"); + Cvar_Get ("cl_camera_maxpitch", "10", CVAR_NONE, NULL, "highest camera pitch in spectator mode"); + cl_camera_maxyaw = Cvar_Get ("cl_camera_maxyaw", "30", CVAR_NONE, NULL, "highest camera yaw in spectator mode"); } + diff --git a/qw/source/cl_ents.c b/qw/source/cl_ents.c index bde360eb8..b387c43d6 100644 --- a/qw/source/cl_ents.c +++ b/qw/source/cl_ents.c @@ -1108,6 +1108,6 @@ CL_EmitEntities (void) void CL_Ents_Init (void) { - r_firecolor = Cvar_Get ("r_firecolor", "0.9 0.4 0", CVAR_ARCHIVE, 0, + r_firecolor = Cvar_Get ("r_firecolor", "0.9 0.4 0", CVAR_ARCHIVE, NULL, "color of rocket and lava ball fires"); } diff --git a/qw/source/cl_input.c b/qw/source/cl_input.c index 0869f4527..f57b30344 100644 --- a/qw/source/cl_input.c +++ b/qw/source/cl_input.c @@ -732,8 +732,9 @@ CL_Input_Init (void) void CL_Input_Init_Cvars (void) { - cl_nodelta = Cvar_Get ("cl_nodelta", "0", CVAR_NONE, 0, "disable player delta compression." - "set to 1 if you have a poor ISP and get a lot of U_REMOVE warnings."); + cl_nodelta = Cvar_Get ("cl_nodelta", "0", CVAR_NONE, NULL, + "disable player delta compression. " + "set to 1 if you have a poor ISP and get a lot of U_REMOVE warnings."); } diff --git a/qw/source/cl_main.c b/qw/source/cl_main.c index 68ac3c68e..f94d19c38 100644 --- a/qw/source/cl_main.c +++ b/qw/source/cl_main.c @@ -1206,87 +1206,92 @@ CL_Init_Cvars (void) { // LordHavoc: some people like it asking on quit, others don't... confirm_quit = - Cvar_Get ("confirm_quit", "1", CVAR_ARCHIVE, 0, "confirm quit command"); - cl_allow_cmd_pkt = Cvar_Get ("cl_allow_cmd_pkt", "1", CVAR_NONE, 0, + Cvar_Get ("confirm_quit", "1", CVAR_ARCHIVE, NULL, + "confirm quit command"); + cl_allow_cmd_pkt = Cvar_Get ("cl_allow_cmd_pkt", "1", CVAR_NONE, NULL, "enables packets from the likes of gamespy"); - show_fps = Cvar_Get ("show_fps", "0", CVAR_NONE, 0, + show_fps = Cvar_Get ("show_fps", "0", CVAR_NONE, NULL, "display realtime frames per second"); // Misty: I like to be able to see the time when I play - show_time = Cvar_Get ("show_time", "0", CVAR_ARCHIVE, 0, + show_time = Cvar_Get ("show_time", "0", CVAR_ARCHIVE, NULL, "display the current time"); - host_speeds = Cvar_Get ("host_speeds", "0", CVAR_NONE, 0, + host_speeds = Cvar_Get ("host_speeds", "0", CVAR_NONE, NULL, "display host processing times"); - cl_demospeed = Cvar_Get ("cl_demospeed", "1.0", CVAR_NONE, 0, + cl_demospeed = Cvar_Get ("cl_demospeed", "1.0", CVAR_NONE, NULL, "adjust demo playback speed. 1.0 = normal, < 1 slow-mo, > 1 timelaps"); // Misty: Turn on or off screen filling colors for powerups among other things. - cl_cshift_bonus = Cvar_Get ("cl_cshift_bonus", "1", CVAR_ARCHIVE, 0, + cl_cshift_bonus = Cvar_Get ("cl_cshift_bonus", "1", CVAR_ARCHIVE, NULL, "Show bonus flash on item pickup"); - cl_cshift_contents = Cvar_Get ("cl_cshift_content", "1", CVAR_ARCHIVE, 0, + cl_cshift_contents = Cvar_Get ("cl_cshift_content", "1", CVAR_ARCHIVE, NULL, "Shift view colors for contents (water, slime, etc)"); - cl_cshift_damage = Cvar_Get ("cl_cshift_damage", "1", CVAR_ARCHIVE, 0, + cl_cshift_damage = Cvar_Get ("cl_cshift_damage", "1", CVAR_ARCHIVE, NULL, "Shift view colors on damage"); - cl_cshift_powerup = Cvar_Get ("cl_cshift_powerup", "1", CVAR_ARCHIVE, 0, + cl_cshift_powerup = Cvar_Get ("cl_cshift_powerup", "1", CVAR_ARCHIVE, NULL, "Shift view colors for powerups"); - cl_autoexec = Cvar_Get ("cl_autoexec", "0", CVAR_ROM, 0, + cl_autoexec = Cvar_Get ("cl_autoexec", "0", CVAR_ROM, NULL, "exec autoexec.cfg on gamedir change"); - cl_warncmd = Cvar_Get ("cl_warncmd", "0", CVAR_NONE, 0, + cl_warncmd = Cvar_Get ("cl_warncmd", "0", CVAR_NONE, NULL, "inform when execing a command"); - cl_upspeed = Cvar_Get ("cl_upspeed", "200", CVAR_NONE, 0, + cl_upspeed = Cvar_Get ("cl_upspeed", "200", CVAR_NONE, NULL, "swim/fly up/down speed"); - cl_forwardspeed = Cvar_Get ("cl_forwardspeed", "200", CVAR_ARCHIVE, 0, + cl_forwardspeed = Cvar_Get ("cl_forwardspeed", "200", CVAR_ARCHIVE, NULL, "forward speed"); - cl_backspeed = Cvar_Get ("cl_backspeed", "200", CVAR_ARCHIVE, 0, + cl_backspeed = Cvar_Get ("cl_backspeed", "200", CVAR_ARCHIVE, NULL, "backward speed"); - cl_sidespeed = Cvar_Get ("cl_sidespeed", "350", CVAR_NONE, 0, "strafe speed"); - cl_movespeedkey = Cvar_Get ("cl_movespeedkey", "2.0", CVAR_NONE, 0, + cl_sidespeed = Cvar_Get ("cl_sidespeed", "350", CVAR_NONE, NULL, + "strafe speed"); + cl_movespeedkey = Cvar_Get ("cl_movespeedkey", "2.0", CVAR_NONE, NULL, "move `run' speed multiplier"); - cl_yawspeed = Cvar_Get ("cl_yawspeed", "140", CVAR_NONE, 0, "turning speed"); - cl_pitchspeed = Cvar_Get ("cl_pitchspeed", "150", CVAR_NONE, 0, + cl_yawspeed = Cvar_Get ("cl_yawspeed", "140", CVAR_NONE, NULL, + "turning speed"); + cl_pitchspeed = Cvar_Get ("cl_pitchspeed", "150", CVAR_NONE, NULL, "look up/down speed"); - cl_anglespeedkey = Cvar_Get ("cl_anglespeedkey", "1.5", CVAR_NONE, 0, + cl_anglespeedkey = Cvar_Get ("cl_anglespeedkey", "1.5", CVAR_NONE, NULL, "turn `run' speed multiplier"); - cl_shownet = Cvar_Get ("cl_shownet", "0", CVAR_NONE, 0, + cl_shownet = Cvar_Get ("cl_shownet", "0", CVAR_NONE, NULL, "show network packets. 0=off, 1=basic, 2=verbose"); - cl_sbar = Cvar_Get ("cl_sbar", "0", CVAR_ARCHIVE, 0, "status bar mode"); - cl_sbar_separator = Cvar_Get ("cl_sbar_separator", "0", CVAR_ARCHIVE, 0, + cl_sbar = Cvar_Get ("cl_sbar", "0", CVAR_ARCHIVE, NULL, "status bar mode"); + cl_sbar_separator = Cvar_Get ("cl_sbar_separator", "0", CVAR_ARCHIVE, NULL, "turns on status bar separator"); - cl_hudswap = Cvar_Get ("cl_hudswap", "0", CVAR_ARCHIVE, 0, + cl_hudswap = Cvar_Get ("cl_hudswap", "0", CVAR_ARCHIVE, NULL, "new HUD on left side?"); - cl_maxfps = Cvar_Get ("cl_maxfps", "0", CVAR_ARCHIVE, 0, + cl_maxfps = Cvar_Get ("cl_maxfps", "0", CVAR_ARCHIVE, NULL, "maximum frames rendered in one second. 0 == 32"); - cl_timeout = Cvar_Get ("cl_timeout", "60", CVAR_ARCHIVE, 0, + cl_timeout = Cvar_Get ("cl_timeout", "60", CVAR_ARCHIVE, NULL, "server connection timeout (since last packet received)"); - lookspring = Cvar_Get ("lookspring", "0", CVAR_ARCHIVE, 0, + lookspring = Cvar_Get ("lookspring", "0", CVAR_ARCHIVE, NULL, "Snap view to center when moving and no mlook/klook"); - lookstrafe = Cvar_Get ("lookstrafe", "0", CVAR_ARCHIVE, 0, + lookstrafe = Cvar_Get ("lookstrafe", "0", CVAR_ARCHIVE, NULL, "when mlook/klook on player will strafe"); - sensitivity = Cvar_Get ("sensitivity", "3", CVAR_ARCHIVE, 0, + sensitivity = Cvar_Get ("sensitivity", "3", CVAR_ARCHIVE, NULL, "mouse sensitivity multiplier"); - cl_freelook = Cvar_Get ("freelook", "0", CVAR_ARCHIVE, 0, "force +mlook"); + cl_freelook = Cvar_Get ("freelook", "0", CVAR_ARCHIVE, NULL, + "force +mlook"); - m_pitch = Cvar_Get ("m_pitch", "0.022", CVAR_ARCHIVE, 0, + m_pitch = Cvar_Get ("m_pitch", "0.022", CVAR_ARCHIVE, NULL, "mouse pitch (up/down) multipier"); - m_yaw = Cvar_Get ("m_yaw", "0.022", CVAR_NONE, 0, + m_yaw = Cvar_Get ("m_yaw", "0.022", CVAR_NONE, NULL, "mouse yaw (left/right) multiplier"); - m_forward = Cvar_Get ("m_forward", "1", CVAR_NONE, 0, + m_forward = Cvar_Get ("m_forward", "1", CVAR_NONE, NULL, "mouse forward/back speed"); - m_side = Cvar_Get ("m_side", "0.8", CVAR_NONE, 0, "mouse strafe speed"); + m_side = Cvar_Get ("m_side", "0.8", CVAR_NONE, NULL, "mouse strafe speed"); - rcon_password = Cvar_Get ("rcon_password", "", CVAR_NONE, 0, + rcon_password = Cvar_Get ("rcon_password", "", CVAR_NONE, NULL, "remote control password"); - rcon_address = Cvar_Get ("rcon_address", "", CVAR_NONE, 0, + rcon_address = Cvar_Get ("rcon_address", "", CVAR_NONE, NULL, "server IP address when client not connected - for sending rcon commands"); - cl_writecfg = Cvar_Get ("cl_writecfg", "1", CVAR_NONE, 0, "write config files?"); + cl_writecfg = Cvar_Get ("cl_writecfg", "1", CVAR_NONE, NULL, + "write config files?"); - cl_predict_players2 = Cvar_Get ("cl_predict_players2", "1", CVAR_NONE, 0, + cl_predict_players2 = Cvar_Get ("cl_predict_players2", "1", CVAR_NONE, NULL, "If this and cl_predict_players is 0, no player prediction is done"); - cl_predict_players = Cvar_Get ("cl_predict_players", "1", CVAR_NONE, 0, + cl_predict_players = Cvar_Get ("cl_predict_players", "1", CVAR_NONE, NULL, "If this and cl_predict_players2 is 0, no player prediction is done"); - cl_solid_players = Cvar_Get ("cl_solid_players", "1", CVAR_NONE, 0, + cl_solid_players = Cvar_Get ("cl_solid_players", "1", CVAR_NONE, NULL, "Are players solid? If off, you can walk through them with difficulty"); - localid = Cvar_Get ("localid", "", CVAR_NONE, 0, + localid = Cvar_Get ("localid", "", CVAR_NONE, NULL, "FIXME: This has something to do with client authentication. No Description"); // @@ -1294,14 +1299,16 @@ CL_Init_Cvars (void) // name = Cvar_Get ("name", "unnamed", CVAR_ARCHIVE | CVAR_USERINFO, Cvar_Info, "Player name"); - password = Cvar_Get ("password", "", CVAR_USERINFO, Cvar_Info, "Server password"); + password = Cvar_Get ("password", "", CVAR_USERINFO, Cvar_Info, + "Server password"); spectator = Cvar_Get ("spectator", "", CVAR_USERINFO, Cvar_Info, "Set to 1 before connecting to become a spectator"); team = Cvar_Get ("team", "", CVAR_ARCHIVE | CVAR_USERINFO, Cvar_Info, "Team player is on."); rate = Cvar_Get ("rate", "2500", CVAR_ARCHIVE | CVAR_USERINFO, Cvar_Info, "Amount of bytes per second server will send/download to you"); - msg = Cvar_Get ("msg", "1", CVAR_ARCHIVE | CVAR_USERINFO, Cvar_Info, "Determines the type of messages reported 0 is maximum, 4 is none"); + msg = Cvar_Get ("msg", "1", CVAR_ARCHIVE | CVAR_USERINFO, Cvar_Info, + "Determines the type of messages reported 0 is maximum, 4 is none"); noaim = Cvar_Get ("noaim", "0", CVAR_ARCHIVE | CVAR_USERINFO, Cvar_Info, "Auto aim off switch. Set to 1 to turn off."); // Misty-chan: Initialize particles cvars. Seemed like a good place to put to me. Move as you wish! @@ -1569,7 +1576,7 @@ Host_Init (void) // only reads from within the quake file system, and changing that is // probably Not A Good Thing (tm). fs_globalcfg = Cvar_Get ("fs_globalcfg", FS_GLOBALCFG, - CVAR_ROM, 0, "global configuration file"); + CVAR_ROM, NULL, "global configuration file"); Cmd_Exec_File (fs_globalcfg->string); Cbuf_Execute_Sets (); @@ -1578,7 +1585,7 @@ Host_Init (void) Cbuf_Execute_Sets (); fs_usercfg = Cvar_Get ("fs_usercfg", FS_USERCFG, - CVAR_ROM, 0, "user configuration file"); + CVAR_ROM, NULL, "user configuration file"); Cmd_Exec_File (fs_usercfg->string); Cbuf_Execute_Sets (); diff --git a/qw/source/cl_pred.c b/qw/source/cl_pred.c index 1254d9d74..747dee477 100644 --- a/qw/source/cl_pred.c +++ b/qw/source/cl_pred.c @@ -231,7 +231,11 @@ void CL_Prediction_Init_Cvars (void) { /* I'm not totally sure what cl_pushlatency is for. Or if it is SUPPOSED TO BE SETTABLE. */ - cl_pushlatency = Cvar_Get ("pushlatency", "-999", CVAR_NONE, 0, "How much prediction should the client make"); - cl_nopred = Cvar_Get ("cl_nopred", "0", CVAR_NONE, 0, "Set to turn off client prediction"); - cl_nostatpred = Cvar_Get ("cl_nostatpred", "0", CVAR_NONE, 0, "Set to turn off static player prediction"); + cl_pushlatency = Cvar_Get ("pushlatency", "-999", CVAR_NONE, NULL, + "How much prediction should the client make"); + cl_nopred = Cvar_Get ("cl_nopred", "0", CVAR_NONE, NULL, + "Set to turn off client prediction"); + cl_nostatpred = Cvar_Get ("cl_nostatpred", "0", CVAR_NONE, NULL, + "Set to turn off static player prediction"); } + diff --git a/qw/source/cl_sys_sdl.c b/qw/source/cl_sys_sdl.c index f4a50c01b..d9c1cdda7 100644 --- a/qw/source/cl_sys_sdl.c +++ b/qw/source/cl_sys_sdl.c @@ -207,7 +207,8 @@ Sys_Sleep (void) void Sys_Init_Cvars (void) { - sys_nostdout = Cvar_Get ("sys_nostdout", "0", CVAR_NONE, 0, "Set to disable std out"); + sys_nostdout = Cvar_Get ("sys_nostdout", "0", CVAR_NONE, NULL, + "Set to disable std out"); if (COM_CheckParm ("-nostdout")) Cvar_Set (sys_nostdout, "1"); } diff --git a/qw/source/cl_sys_unix.c b/qw/source/cl_sys_unix.c index 5a1998817..64531f4ab 100644 --- a/qw/source/cl_sys_unix.c +++ b/qw/source/cl_sys_unix.c @@ -77,7 +77,8 @@ Sys_Quit (void) void Sys_Init_Cvars (void) { - sys_nostdout = Cvar_Get ("sys_nostdout", "0", CVAR_NONE, 0, "set to disable std out"); + sys_nostdout = Cvar_Get ("sys_nostdout", "0", CVAR_NONE, NULL, + "set to disable std out"); if (COM_CheckParm ("-nostdout")) Cvar_Set (sys_nostdout, "1"); } diff --git a/qw/source/cl_sys_win.c b/qw/source/cl_sys_win.c index 44534f8eb..51505fd21 100644 --- a/qw/source/cl_sys_win.c +++ b/qw/source/cl_sys_win.c @@ -142,7 +142,8 @@ Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length) void Sys_Init_Cvars (void) { - sys_nostdout = Cvar_Get ("sys_nostdout", "1", CVAR_NONE, 0, "unset to enable std out - windows does NOT support this"); + sys_nostdout = Cvar_Get ("sys_nostdout", "1", CVAR_NONE, NULL, + "unset to enable std out - windows does NOT support this"); } void diff --git a/qw/source/com.c b/qw/source/com.c index e1c27b348..22d1dad87 100644 --- a/qw/source/com.c +++ b/qw/source/com.c @@ -93,5 +93,6 @@ COM_Init (void) void COM_Init_Cvars (void) { - registered = Cvar_Get ("registered", "0", CVAR_NONE, 0, "Is the game the registered version. 1 yes 0 no"); + registered = Cvar_Get ("registered", "0", CVAR_NONE, NULL, + "Is the game the registered version. 1 yes 0 no"); } diff --git a/qw/source/console.c b/qw/source/console.c index 92fd13eee..df9179903 100644 --- a/qw/source/console.c +++ b/qw/source/console.c @@ -271,7 +271,7 @@ void Con_Init_Cvars (void) { con_notifytime = - Cvar_Get ("con_notifytime", "3", CVAR_NONE, 0, + Cvar_Get ("con_notifytime", "3", CVAR_NONE, NULL, "How long in seconds messages are displayed on screen"); } diff --git a/qw/source/context_x11.c b/qw/source/context_x11.c index ccf2111ac..7edca2846 100644 --- a/qw/source/context_x11.c +++ b/qw/source/context_x11.c @@ -312,7 +312,7 @@ x11_set_vidmode (int width, int height) void x11_Init_Cvars (void) { - vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_ROM, 0, + vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_ROM, NULL, "Toggles fullscreen game mode"); } diff --git a/qw/source/d_init.c b/qw/source/d_init.c index 057b972d5..22b47b87e 100644 --- a/qw/source/d_init.c +++ b/qw/source/d_init.c @@ -70,9 +70,12 @@ D_Init (void) void D_Init_Cvars (void) { - d_subdiv16 = Cvar_Get ("d_subdiv16", "1", CVAR_NONE, 0, "Set to enable extreme perspective correction"); - d_mipcap = Cvar_Get ("d_mipcap", "0", CVAR_NONE, 0, "Detail level. 0 is highest, 3 is lowest."); - d_mipscale = Cvar_Get ("d_mipscale", "1", CVAR_NONE, 0, "Detail level of objects. 0 is highest, 3 is lowest."); + d_subdiv16 = Cvar_Get ("d_subdiv16", "1", CVAR_NONE, NULL, + "Set to enable extreme perspective correction"); + d_mipcap = Cvar_Get ("d_mipcap", "0", CVAR_NONE, NULL, + "Detail level. 0 is highest, 3 is lowest."); + d_mipscale = Cvar_Get ("d_mipscale", "1", CVAR_NONE, NULL, + "Detail level of objects. 0 is highest, 3 is lowest."); } /* diff --git a/qw/source/draw.c b/qw/source/draw.c index fd259eddf..77ce78b2f 100644 --- a/qw/source/draw.c +++ b/qw/source/draw.c @@ -198,7 +198,8 @@ Draw_Init (void) r_rectdesc.rowbytes = draw_backtile->width; cl_verstring = - Cvar_Get ("cl_verstring", PROGRAM " " VERSION, CVAR_NONE, 0, "Client version string"); + Cvar_Get ("cl_verstring", PROGRAM " " VERSION, CVAR_NONE, NULL, + "Client version string"); } void diff --git a/qw/source/game.c b/qw/source/game.c index 11a5b0539..b04f331aa 100644 --- a/qw/source/game.c +++ b/qw/source/game.c @@ -99,6 +99,6 @@ Game_Init (void) void Game_Init_Cvars (void) { - fs_skinbase = Cvar_Get ("fs_skinbase", "qw", CVAR_ROM, 0, + fs_skinbase = Cvar_Get ("fs_skinbase", "qw", CVAR_ROM, NULL, "location of skins dir for downloads"); } diff --git a/qw/source/gl_draw.c b/qw/source/gl_draw.c index 88c478aac..d8616a647 100644 --- a/qw/source/gl_draw.c +++ b/qw/source/gl_draw.c @@ -317,16 +317,16 @@ Draw_Init_Cvars (void) gl_lightmode = Cvar_Get ("gl_lightmode", "1", CVAR_ARCHIVE, gl_lightmode_callback, "Lighting mode (0 = GLQuake style, 1 = new style)"); - gl_max_size = Cvar_Get ("gl_max_size", "1024", CVAR_NONE, 0, "Texture dimension"); - gl_picmip = Cvar_Get ("gl_picmip", "0", CVAR_NONE, 0, "Dimensions of displayed textures. 0 is normal, 1 is half, 2 is 1/4"); - gl_constretch = Cvar_Get ("gl_constretch", "0", CVAR_ARCHIVE, 0, + gl_max_size = Cvar_Get ("gl_max_size", "1024", CVAR_NONE, NULL, "Texture dimension"); + gl_picmip = Cvar_Get ("gl_picmip", "0", CVAR_NONE, NULL, "Dimensions of displayed textures. 0 is normal, 1 is half, 2 is 1/4"); + gl_constretch = Cvar_Get ("gl_constretch", "0", CVAR_ARCHIVE, NULL, "whether slide the console or stretch it"); - gl_conalpha = Cvar_Get ("gl_conalpha", "0.6", CVAR_ARCHIVE, 0, + gl_conalpha = Cvar_Get ("gl_conalpha", "0.6", CVAR_ARCHIVE, NULL, "alpha value for the console background"); - gl_conspin = Cvar_Get ("gl_conspin", "0", CVAR_ARCHIVE, 0, + gl_conspin = Cvar_Get ("gl_conspin", "0", CVAR_ARCHIVE, NULL, "speed at which the console spins"); gl_lightmap_components = Cvar_Get ("gl_lightmap_components", "4", CVAR_ROM, 0, "Lightmap texture components. 1 is greyscale, 3 is RGB, 4 is RGBA."); - cl_verstring = Cvar_Get ("cl_verstring", PROGRAM " " VERSION, CVAR_NONE, 0, + cl_verstring = Cvar_Get ("cl_verstring", PROGRAM " " VERSION, CVAR_NONE, NULL, "Client version string"); } diff --git a/qw/source/gl_rmain.c b/qw/source/gl_rmain.c index ad6c3eb2e..4749bc712 100644 --- a/qw/source/gl_rmain.c +++ b/qw/source/gl_rmain.c @@ -155,7 +155,7 @@ GL_CheckBrightness (unsigned char *pal) int i, inf; float brightness; - brighten = Cvar_Get ("brighten", "1", CVAR_NONE, 0, + brighten = Cvar_Get ("brighten", "1", CVAR_NONE, NULL, "Palette hack equivalent to brightness"); if ((i = COM_CheckParm ("-brighten"))) { diff --git a/qw/source/gl_rmisc.c b/qw/source/gl_rmisc.c index 1e2e27c9b..ec7f23fa9 100644 --- a/qw/source/gl_rmisc.c +++ b/qw/source/gl_rmisc.c @@ -210,38 +210,38 @@ R_Init (void) void R_Init_Cvars (void) { - r_norefresh = Cvar_Get ("r_norefresh", "0", CVAR_NONE, 0, "Set to 1 to disable display refresh"); - r_drawentities = Cvar_Get ("r_drawentities", "1", CVAR_NONE, 0, "Toggles drawing of entities (almost everything but the world)"); - r_drawviewmodel = Cvar_Get ("r_drawviewmodel", "1", CVAR_ARCHIVE, 0, "Toggles drawing of view models (your weapons)"); - r_shadows = Cvar_Get ("r_shadows", "0", CVAR_ARCHIVE, 0, "Set to 1 to enable shadows for entities"); - r_wateralpha = Cvar_Get ("r_wateralpha", "1", CVAR_NONE, 0, "Determine opacity of liquids. 1 = solid, 0 = transparent, otherwise translucent."); + r_norefresh = Cvar_Get ("r_norefresh", "0", CVAR_NONE, NULL, "Set to 1 to disable display refresh"); + r_drawentities = Cvar_Get ("r_drawentities", "1", CVAR_NONE, NULL, "Toggles drawing of entities (almost everything but the world)"); + r_drawviewmodel = Cvar_Get ("r_drawviewmodel", "1", CVAR_ARCHIVE, NULL, "Toggles drawing of view models (your weapons)"); + r_shadows = Cvar_Get ("r_shadows", "0", CVAR_ARCHIVE, NULL, "Set to 1 to enable shadows for entities"); + r_wateralpha = Cvar_Get ("r_wateralpha", "1", CVAR_NONE, NULL, "Determine opacity of liquids. 1 = solid, 0 = transparent, otherwise translucent."); /* FIXME what does r_waterripple use for units? */ - r_waterripple = Cvar_Get ("r_waterripple", "0", CVAR_NONE, 0, "Set to make liquids ripple, a good setting is 5"); - r_dynamic = Cvar_Get ("r_dynamic", "1", CVAR_NONE, 0, "Set to 0 to disable lightmap changes"); - r_novis = Cvar_Get ("r_novis", "0", CVAR_NONE, 0, "Set to 1 to enable runtime visibility checking (SLOW)"); - r_speeds = Cvar_Get ("r_speeds", "0", CVAR_NONE, 0, "Display drawing time and statistics of what is being viewed"); - r_netgraph = Cvar_Get ("r_netgraph", "0", CVAR_ARCHIVE, 0, "Graph network stats"); - r_netgraph_alpha = Cvar_Get ("r_netgraph_alpha", "0.5", CVAR_ARCHIVE, 0, "Net graph translucency"); - r_netgraph_box = Cvar_Get ("r_netgraph_box", "1", CVAR_ARCHIVE, 0, "Draw box around net graph"); - r_particles = Cvar_Get ("r_particles", "1", CVAR_ARCHIVE, 0, "whether or not to draw particles"); - r_skyname = Cvar_Get ("r_skyname", "none", CVAR_NONE, 0, "name of the current skybox"); + r_waterripple = Cvar_Get ("r_waterripple", "0", CVAR_NONE, NULL, "Set to make liquids ripple, a good setting is 5"); + r_dynamic = Cvar_Get ("r_dynamic", "1", CVAR_NONE, NULL, "Set to 0 to disable lightmap changes"); + r_novis = Cvar_Get ("r_novis", "0", CVAR_NONE, NULL, "Set to 1 to enable runtime visibility checking (SLOW)"); + r_speeds = Cvar_Get ("r_speeds", "0", CVAR_NONE, NULL, "Display drawing time and statistics of what is being viewed"); + r_netgraph = Cvar_Get ("r_netgraph", "0", CVAR_ARCHIVE, NULL, "Graph network stats"); + r_netgraph_alpha = Cvar_Get ("r_netgraph_alpha", "0.5", CVAR_ARCHIVE, NULL, "Net graph translucency"); + r_netgraph_box = Cvar_Get ("r_netgraph_box", "1", CVAR_ARCHIVE, NULL, "Draw box around net graph"); + r_particles = Cvar_Get ("r_particles", "1", CVAR_ARCHIVE, NULL, "whether or not to draw particles"); + r_skyname = Cvar_Get ("r_skyname", "none", CVAR_NONE, NULL, "name of the current skybox"); - gl_affinemodels = Cvar_Get ("gl_affinemodels", "0", CVAR_ARCHIVE, 0, "Makes texture rendering quality better if set to 1"); - gl_clear = Cvar_Get ("gl_clear", "0", CVAR_NONE, 0, "Set to 1 to make background black. Useful for removing HOM effect"); - gl_dlight_lightmap = Cvar_Get ("gl_dlight_lightmap", "1", CVAR_ARCHIVE, 0, "Set to 1 for high quality dynamic lighting."); - gl_dlight_polyblend = Cvar_Get ("gl_dlight_polyblend", "0", CVAR_ARCHIVE, 0, "Set to 1 to use a dynamic light effect faster on GL"); - gl_dlight_smooth = Cvar_Get ("gl_dlight_smooth", "1", CVAR_ARCHIVE, 0, "Smooth dynamic vertex lighting"); - gl_fb_bmodels = Cvar_Get ("gl_fb_bmodels", "1", CVAR_ARCHIVE, 0, "Toggles fullbright color support for bmodels"); - gl_fb_models = Cvar_Get ("gl_fb_models", "1", CVAR_ARCHIVE, 0, "Toggles fullbright color support for models"); - gl_fires = Cvar_Get ("gl_fires", "0", CVAR_ARCHIVE, 0, "Toggles lavaball and rocket fireballs"); - gl_keeptjunctions = Cvar_Get ("gl_keeptjunctions", "1", CVAR_ARCHIVE, 0, "Set to 0 to turn off colinear vertexes upon level load"); - gl_lerp_anim = Cvar_Get ("gl_lerp_anim", "1", CVAR_ARCHIVE, 0, "Toggles model animation interpolation"); - gl_multitexture = Cvar_Get ("gl_multitexture", "0", CVAR_ARCHIVE, 0, "Use multitexture when available"); - gl_nocolors = Cvar_Get ("gl_nocolors", "0", CVAR_NONE, 0, "Set to 1, turns off all player colors"); - gl_playermip = Cvar_Get ("gl_playermip", "0", CVAR_NONE, 0, "Detail of player skins. 0 best, 4 worst."); - gl_sky_clip = Cvar_Get ("gl_sky_clip", "0", CVAR_ARCHIVE, 0, "controls whether sky is drawn first (0) or later (1)"); - gl_sky_divide = Cvar_Get ("gl_sky_divide", "1", CVAR_ARCHIVE, 0, "subdivide sky polys"); - gl_skymultipass = Cvar_Get ("gl_skymultipass", "1", CVAR_ARCHIVE, 0, "controls whether the skydome is single or double pass"); + gl_affinemodels = Cvar_Get ("gl_affinemodels", "0", CVAR_ARCHIVE, NULL, "Makes texture rendering quality better if set to 1"); + gl_clear = Cvar_Get ("gl_clear", "0", CVAR_NONE, NULL, "Set to 1 to make background black. Useful for removing HOM effect"); + gl_dlight_lightmap = Cvar_Get ("gl_dlight_lightmap", "1", CVAR_ARCHIVE, NULL, "Set to 1 for high quality dynamic lighting."); + gl_dlight_polyblend = Cvar_Get ("gl_dlight_polyblend", "0", CVAR_ARCHIVE, NULL, "Set to 1 to use a dynamic light effect faster on GL"); + gl_dlight_smooth = Cvar_Get ("gl_dlight_smooth", "1", CVAR_ARCHIVE, NULL, "Smooth dynamic vertex lighting"); + gl_fb_bmodels = Cvar_Get ("gl_fb_bmodels", "1", CVAR_ARCHIVE, NULL, "Toggles fullbright color support for bmodels"); + gl_fb_models = Cvar_Get ("gl_fb_models", "1", CVAR_ARCHIVE, NULL, "Toggles fullbright color support for models"); + gl_fires = Cvar_Get ("gl_fires", "0", CVAR_ARCHIVE, NULL, "Toggles lavaball and rocket fireballs"); + gl_keeptjunctions = Cvar_Get ("gl_keeptjunctions", "1", CVAR_ARCHIVE, NULL, "Set to 0 to turn off colinear vertexes upon level load"); + gl_lerp_anim = Cvar_Get ("gl_lerp_anim", "1", CVAR_ARCHIVE, NULL, "Toggles model animation interpolation"); + gl_multitexture = Cvar_Get ("gl_multitexture", "0", CVAR_ARCHIVE, NULL, "Use multitexture when available"); + gl_nocolors = Cvar_Get ("gl_nocolors", "0", CVAR_NONE, NULL, "Set to 1, turns off all player colors"); + gl_playermip = Cvar_Get ("gl_playermip", "0", CVAR_NONE, NULL, "Detail of player skins. 0 best, 4 worst."); + gl_sky_clip = Cvar_Get ("gl_sky_clip", "0", CVAR_ARCHIVE, NULL, "controls whether sky is drawn first (0) or later (1)"); + gl_sky_divide = Cvar_Get ("gl_sky_divide", "1", CVAR_ARCHIVE, NULL, "subdivide sky polys"); + gl_skymultipass = Cvar_Get ("gl_skymultipass", "1", CVAR_ARCHIVE, NULL, "controls whether the skydome is single or double pass"); } /* diff --git a/qw/source/gl_screen.c b/qw/source/gl_screen.c index abfea2ff6..cf241688d 100644 --- a/qw/source/gl_screen.c +++ b/qw/source/gl_screen.c @@ -384,21 +384,21 @@ SCR_SizeDown_f (void) void SCR_Init_Cvars (void) { - scr_fov = Cvar_Get ("fov", "90", CVAR_NONE, 0, "Your point of view in degrees. Smaller than 90 zooms in."); - scr_viewsize = Cvar_Get ("viewsize", "100", CVAR_ARCHIVE, 0, "Set the screen size 30 minimum, 120 maximum"); - scr_conspeed = Cvar_Get ("scr_conspeed", "300", CVAR_NONE, 0, "How quickly console scrolls up or down"); - scr_consize = Cvar_Get ("scr_consize", "0.5", CVAR_ARCHIVE, 0, "fraction of the screen the console covers when down"); - scr_showram = Cvar_Get ("showram", "1", CVAR_NONE, 0, "Show RAM icon if game is running low on memory"); - scr_showturtle = Cvar_Get ("showturtle", "0", CVAR_NONE, 0, "Show a turtle icon if your fps is slower than 10"); - scr_showpause = Cvar_Get ("showpause", "1", CVAR_NONE, 0, "Toggles display of pause graphic"); - scr_centertime = Cvar_Get ("scr_centertime", "2", CVAR_NONE, 0, "How long in seconds screen hints are displayed"); - scr_printspeed = Cvar_Get ("scr_printspeed", "8", CVAR_NONE, 0, "How fast the text is displayed at the end of the single player episodes"); - gl_triplebuffer = Cvar_Get ("gl_triplebuffer", "1", CVAR_ARCHIVE, 0, "Set to 1 by default. Fixes status bar flicker on some hardware"); + scr_fov = Cvar_Get ("fov", "90", CVAR_NONE, NULL, "Your point of view in degrees. Smaller than 90 zooms in."); + scr_viewsize = Cvar_Get ("viewsize", "100", CVAR_ARCHIVE, NULL, "Set the screen size 30 minimum, 120 maximum"); + scr_conspeed = Cvar_Get ("scr_conspeed", "300", CVAR_NONE, NULL, "How quickly console scrolls up or down"); + scr_consize = Cvar_Get ("scr_consize", "0.5", CVAR_ARCHIVE, NULL, "fraction of the screen the console covers when down"); + scr_showram = Cvar_Get ("showram", "1", CVAR_NONE, NULL, "Show RAM icon if game is running low on memory"); + scr_showturtle = Cvar_Get ("showturtle", "0", CVAR_NONE, NULL, "Show a turtle icon if your fps is slower than 10"); + scr_showpause = Cvar_Get ("showpause", "1", CVAR_NONE, NULL, "Toggles display of pause graphic"); + scr_centertime = Cvar_Get ("scr_centertime", "2", CVAR_NONE, NULL, "How long in seconds screen hints are displayed"); + scr_printspeed = Cvar_Get ("scr_printspeed", "8", CVAR_NONE, NULL, "How fast the text is displayed at the end of the single player episodes"); + gl_triplebuffer = Cvar_Get ("gl_triplebuffer", "1", CVAR_ARCHIVE, NULL, "Set to 1 by default. Fixes status bar flicker on some hardware"); - crosshaircolor = Cvar_Get ("crosshaircolor", "79", CVAR_ARCHIVE, 0, "Color of the new crosshair"); - crosshair = Cvar_Get ("crosshair", "0", CVAR_ARCHIVE, 0, "Crosshair type. 0 off, 1 old without color, 2 new with colors"); - cl_crossx = Cvar_Get ("cl_crossx", "0", CVAR_ARCHIVE, 0, "Sets the position of the crosshair on the X-axis."); - cl_crossy = Cvar_Get ("cl_crossy", "0", CVAR_ARCHIVE, 0, "Sets the position of the crosshair on the Y-axis."); + crosshaircolor = Cvar_Get ("crosshaircolor", "79", CVAR_ARCHIVE, NULL, "Color of the new crosshair"); + crosshair = Cvar_Get ("crosshair", "0", CVAR_ARCHIVE, NULL, "Crosshair type. 0 off, 1 old without color, 2 new with colors"); + cl_crossx = Cvar_Get ("cl_crossx", "0", CVAR_ARCHIVE, NULL, "Sets the position of the crosshair on the X-axis."); + cl_crossy = Cvar_Get ("cl_crossy", "0", CVAR_ARCHIVE, NULL, "Sets the position of the crosshair on the Y-axis."); } void diff --git a/qw/source/in_sdl.c b/qw/source/in_sdl.c index 4d533d39d..5964c38d7 100644 --- a/qw/source/in_sdl.c +++ b/qw/source/in_sdl.c @@ -362,8 +362,9 @@ IN_Init_Cvars (void) { JOY_Init_Cvars (); - _windowed_mouse = Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, 0, "If set to 1, quake will grab the mouse in X"); - // m_filter = Cvar_Get ("m_filter", "0", CVAR_ARCHIVE, 0, "Toggle mouse input filtering"); + _windowed_mouse = Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, NULL, + "If set to 1, quake will grab the mouse in X"); + // m_filter = Cvar_Get ("m_filter", "0", CVAR_ARCHIVE, NULL, "Toggle mouse input filtering"); } void diff --git a/qw/source/in_svgalib.c b/qw/source/in_svgalib.c index 34a6f33ae..f72ae0970 100644 --- a/qw/source/in_svgalib.c +++ b/qw/source/in_svgalib.c @@ -134,7 +134,8 @@ void IN_Init_Cvars (void) { JOY_Init_Cvars (); - m_filter = Cvar_Get ("m_filter", "0", CVAR_NONE, 0, "Toggle mouse input filtering."); + m_filter = Cvar_Get ("m_filter", "0", CVAR_NONE, NULL, + "Toggle mouse input filtering."); } static void diff --git a/qw/source/in_win.c b/qw/source/in_win.c index fda8fd7ca..1ad7ba22b 100644 --- a/qw/source/in_win.c +++ b/qw/source/in_win.c @@ -424,7 +424,8 @@ void IN_Init_Cvars (void) { // mouse variables - m_filter = Cvar_Get ("m_filter", "0", CVAR_NONE, 0, "Toggle mouse input filtering."); + m_filter = Cvar_Get ("m_filter", "0", CVAR_NONE, NULL, + "Toggle mouse input filtering."); JOY_Init_Cvars(); } diff --git a/qw/source/in_x11.c b/qw/source/in_x11.c index 5ddf89009..f5d8b84d6 100644 --- a/qw/source/in_x11.c +++ b/qw/source/in_x11.c @@ -550,9 +550,13 @@ void IN_Init_Cvars (void) { JOY_Init_Cvars (); - _windowed_mouse = Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, 0, "With this set to 1, quake will grab the mouse from X"); - m_filter = Cvar_Get ("m_filter", "0", CVAR_ARCHIVE, 0, "Toggle mouse input filtering."); - in_dga = Cvar_Get ("in_dga", "1", CVAR_ARCHIVE, 0, "DGA Input support"); - in_dga_mouseaccel = Cvar_Get ("in_dga_mouseaccel", "1", CVAR_ARCHIVE, 0, + _windowed_mouse = Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, NULL, + "With this set to 1, quake will grab the mouse from X"); + m_filter = Cvar_Get ("m_filter", "0", CVAR_ARCHIVE, NULL, + "Toggle mouse input filtering."); + in_dga = Cvar_Get ("in_dga", "1", CVAR_ARCHIVE, NULL, + "DGA Input support"); + in_dga_mouseaccel = Cvar_Get ("in_dga_mouseaccel", "1", CVAR_ARCHIVE, NULL, "DGA Mouse accelleration multiplier"); } + diff --git a/qw/source/joy_linux.c b/qw/source/joy_linux.c index c882de81d..33334377e 100644 --- a/qw/source/joy_linux.c +++ b/qw/source/joy_linux.c @@ -199,19 +199,19 @@ JOY_Init_Cvars (void) int i; joy_device = - Cvar_Get ("joy_device", "/dev/js0", CVAR_NONE | CVAR_ROM, 0, + Cvar_Get ("joy_device", "/dev/js0", CVAR_NONE | CVAR_ROM, NULL, "Joystick device"); joy_enable = - Cvar_Get ("joy_enable", "1", CVAR_NONE | CVAR_ARCHIVE, 0, + Cvar_Get ("joy_enable", "1", CVAR_NONE | CVAR_ARCHIVE, NULL, "Joystick enable flag"); joy_sensitivity = - Cvar_Get ("joy_sensitivity", "1", CVAR_NONE | CVAR_ARCHIVE, 0, + Cvar_Get ("joy_sensitivity", "1", CVAR_NONE | CVAR_ARCHIVE, NULL, "Joystick sensitivity"); for (i = 0; i < JOY_MAX_AXES; i++) { joy_axes[i].axis = Cvar_Get (joy_axes[i].var.name, joy_axes[i].var.string, - CVAR_ARCHIVE, 0, "Set joystick axes"); + CVAR_ARCHIVE, NULL, "Set joystick axes"); } } diff --git a/qw/source/joy_null.c b/qw/source/joy_null.c index ff018c003..2cd8bf92d 100644 --- a/qw/source/joy_null.c +++ b/qw/source/joy_null.c @@ -63,13 +63,13 @@ void JOY_Init_Cvars (void) { joy_device = - Cvar_Get ("joy_device", "none", CVAR_NONE | CVAR_ROM, 0, + Cvar_Get ("joy_device", "none", CVAR_NONE | CVAR_ROM, NULL, "Joystick device"); joy_enable = - Cvar_Get ("joy_enable", "1", CVAR_NONE | CVAR_ARCHIVE, 0, + Cvar_Get ("joy_enable", "1", CVAR_NONE | CVAR_ARCHIVE, NULL, "Joystick enable flag"); joy_sensitivity = - Cvar_Get ("joy_sensitivity", "1", CVAR_NONE | CVAR_ARCHIVE, 0, + Cvar_Get ("joy_sensitivity", "1", CVAR_NONE | CVAR_ARCHIVE, NULL, "Joystick sensitivity"); } diff --git a/qw/source/joy_win.c b/qw/source/joy_win.c index 58ca6f0d1..0839e143e 100644 --- a/qw/source/joy_win.c +++ b/qw/source/joy_win.c @@ -555,54 +555,66 @@ void JOY_Init_Cvars(void) { joy_device = - Cvar_Get ("joy_device", "none", CVAR_NONE | CVAR_ROM, 0, + Cvar_Get ("joy_device", "none", CVAR_NONE | CVAR_ROM, NULL, "Joystick device"); joy_enable = - Cvar_Get ("joy_enable", "1", CVAR_NONE | CVAR_ARCHIVE, 0, + Cvar_Get ("joy_enable", "1", CVAR_NONE | CVAR_ARCHIVE, NULL, "Joystick enable flag"); joy_sensitivity = - Cvar_Get ("joy_sensitivity", "1", CVAR_NONE | CVAR_ARCHIVE, 0, + Cvar_Get ("joy_sensitivity", "1", CVAR_NONE | CVAR_ARCHIVE, NULL, "Joystick sensitivity"); // joystick variables in_joystick = - Cvar_Get ("joystick", "0", CVAR_ARCHIVE, 0, "FIXME: No Description"); + Cvar_Get ("joystick", "0", CVAR_ARCHIVE, NULL, "FIXME: No Description"); joy_name = - Cvar_Get ("joyname", "joystick", CVAR_NONE, 0, "FIXME: No Description"); + Cvar_Get ("joyname", "joystick", CVAR_NONE, NULL, + "FIXME: No Description"); joy_advanced = - Cvar_Get ("joyadvanced", "0", CVAR_NONE, 0, "FIXME: No Description"); + Cvar_Get ("joyadvanced", "0", CVAR_NONE, NULL, "FIXME: No Description"); joy_advaxisx = - Cvar_Get ("joyadvaxisx", "0", CVAR_NONE, 0, "FIXME: No Description"); + Cvar_Get ("joyadvaxisx", "0", CVAR_NONE, NULL, "FIXME: No Description"); joy_advaxisy = - Cvar_Get ("joyadvaxisy", "0", CVAR_NONE, 0, "FIXME: No Description"); + Cvar_Get ("joyadvaxisy", "0", CVAR_NONE, NULL, "FIXME: No Description"); joy_advaxisz = - Cvar_Get ("joyadvaxisz", "0", CVAR_NONE, 0, "FIXME: No Description"); + Cvar_Get ("joyadvaxisz", "0", CVAR_NONE, NULL, "FIXME: No Description"); joy_advaxisr = - Cvar_Get ("joyadvaxisr", "0", CVAR_NONE, 0, "FIXME: No Description"); + Cvar_Get ("joyadvaxisr", "0", CVAR_NONE, NULL, "FIXME: No Description"); joy_advaxisu = - Cvar_Get ("joyadvaxisu", "0", CVAR_NONE, 0, "FIXME: No Description"); + Cvar_Get ("joyadvaxisu", "0", CVAR_NONE, NULL, "FIXME: No Description"); joy_advaxisv = - Cvar_Get ("joyadvaxisv", "0", CVAR_NONE, 0, "FIXME: No Description"); + Cvar_Get ("joyadvaxisv", "0", CVAR_NONE, NULL, "FIXME: No Description"); joy_forwardthreshold = - Cvar_Get ("joyforwardthreshold", "0.15", CVAR_NONE, 0, "FIXME: No Description"); + Cvar_Get ("joyforwardthreshold", "0.15", CVAR_NONE, NULL, + "FIXME: No Description"); joy_sidethreshold = - Cvar_Get ("joysidethreshold", "0.15", CVAR_NONE, 0, "FIXME: No Description"); + Cvar_Get ("joysidethreshold", "0.15", CVAR_NONE, NULL, + "FIXME: No Description"); joy_pitchthreshold = - Cvar_Get ("joypitchthreshold", "0.15", CVAR_NONE, 0, "FIXME: No Description"); - joy_yawthreshold = Cvar_Get ("joyyawthreshold", "0.15", CVAR_NONE, 0, "FIXME: No Description"); + Cvar_Get ("joypitchthreshold", "0.15", CVAR_NONE, NULL, + "FIXME: No Description"); + joy_yawthreshold = Cvar_Get ("joyyawthreshold", "0.15", CVAR_NONE, NULL, + "FIXME: No Description"); joy_forwardsensitivity = - Cvar_Get ("joyforwardsensitivity", "-1.0", CVAR_NONE, 0, "FIXME: No Description"); + Cvar_Get ("joyforwardsensitivity", "-1.0", CVAR_NONE, NULL, + "FIXME: No Description"); joy_sidesensitivity = - Cvar_Get ("joysidesensitivity", "-1.0", CVAR_NONE, 0, "FIXME: No Description"); + Cvar_Get ("joysidesensitivity", "-1.0", CVAR_NONE, NULL, + "FIXME: No Description"); joy_pitchsensitivity = - Cvar_Get ("joypitchsensitivity", "1.0", CVAR_NONE, 0, "FIXME: No Description"); + Cvar_Get ("joypitchsensitivity", "1.0", CVAR_NONE, NULL, + "FIXME: No Description"); joy_yawsensitivity = - Cvar_Get ("joyyawsensitivity", "-1.0", CVAR_NONE, 0, "FIXME: No Description"); - joy_wwhack1 = Cvar_Get ("joywwhack1", "0.0", CVAR_NONE, 0, "FIXME: No Description"); - joy_wwhack2 = Cvar_Get ("joywwhack2", "0.0", CVAR_NONE, 0, "FIXME: No Description"); + Cvar_Get ("joyyawsensitivity", "-1.0", CVAR_NONE, NULL, + "FIXME: No Description"); + joy_wwhack1 = Cvar_Get ("joywwhack1", "0.0", CVAR_NONE, NULL, + "FIXME: No Description"); + joy_wwhack2 = Cvar_Get ("joywwhack2", "0.0", CVAR_NONE, NULL, + "FIXME: No Description"); - joy_debug = Cvar_Get ("joy_debug", "0.0", CVAR_NONE, 0, "FIXME: No Description"); + joy_debug = Cvar_Get ("joy_debug", "0.0", CVAR_NONE, NULL, + "FIXME: No Description"); return; } diff --git a/qw/source/keys.c b/qw/source/keys.c index 8ca8c3247..55563df1e 100644 --- a/qw/source/keys.c +++ b/qw/source/keys.c @@ -748,7 +748,7 @@ Key_Init (void) void Key_Init_Cvars (void) { - cl_chatmode = Cvar_Get ("cl_chatmode", "2", CVAR_NONE, 0, + cl_chatmode = Cvar_Get ("cl_chatmode", "2", CVAR_NONE, NULL, "Controls when console text will be treated as a chat message: 0 - never, 1 - always, 2 - smart"); } diff --git a/qw/source/model.c b/qw/source/model.c index 563260fd7..2407462e8 100644 --- a/qw/source/model.c +++ b/qw/source/model.c @@ -75,7 +75,8 @@ void Mod_Init_Cvars (void) { gl_subdivide_size = - Cvar_Get ("gl_subdivide_size", "128", CVAR_ARCHIVE, 0, "Sets the division value for the sky brushes."); + Cvar_Get ("gl_subdivide_size", "128", CVAR_ARCHIVE, NULL, + "Sets the division value for the sky brushes."); } /* diff --git a/qw/source/net_chan.c b/qw/source/net_chan.c index d1f324b2b..48c85ea3a 100644 --- a/qw/source/net_chan.c +++ b/qw/source/net_chan.c @@ -129,10 +129,13 @@ Netchan_Init (void) void Netchan_Init_Cvars (void) { - showpackets = Cvar_Get ("showpackets", "0", CVAR_NONE, 0, "Show all network packets"); - showdrop = Cvar_Get ("showdrop", "0", CVAR_NONE, 0, "Toggle the display of how many packets you are dropping"); - qport = Cvar_Get ("qport", "0", CVAR_NONE, 0, "The internal port number for the game networking code." - "Useful for clients who use multiple connections through one IP address (NAT/IP-MASQ) because default port is random."); + showpackets = Cvar_Get ("showpackets", "0", CVAR_NONE, NULL, + "Show all network packets"); + showdrop = Cvar_Get ("showdrop", "0", CVAR_NONE, NULL, + "Toggle the display of how many packets you are dropping"); + qport = Cvar_Get ("qport", "0", CVAR_NONE, NULL, + "The internal port number for the game networking code." + "Useful for clients who use multiple connections through one IP address (NAT/IP-MASQ) because default port is random."); } /* diff --git a/qw/source/net_packetlog.c b/qw/source/net_packetlog.c index a3734bebc..8c4617062 100644 --- a/qw/source/net_packetlog.c +++ b/qw/source/net_packetlog.c @@ -961,7 +961,7 @@ int Net_Log_Init (void) { netlogger = - Cvar_Get ("net_logger", "1", CVAR_NONE, 0, "Packet logging/parsing"); + Cvar_Get ("net_logger", "1", CVAR_NONE, NULL, "Packet logging/parsing"); // 0 = no logging // 1 = hex dump only @@ -970,8 +970,10 @@ Net_Log_Init (void) // 4 = parse/hexdump, skip movement/empty messages netloglevel = - Cvar_Get ("net_loglevel", "2", CVAR_NONE, 0, "Packet logging/parsing"); + Cvar_Get ("net_loglevel", "2", CVAR_NONE, NULL, + "Packet logging/parsing"); Net_LogStart ("qfpacket.log"); return 0; } + diff --git a/qw/source/r_view.c b/qw/source/r_view.c index ef2ab927d..8d87f02e8 100644 --- a/qw/source/r_view.c +++ b/qw/source/r_view.c @@ -743,29 +743,48 @@ V_Init (void) void V_Init_Cvars (void) { - v_centermove = Cvar_Get ("v_centermove", "0.15", CVAR_NONE, 0, "How far the player must move forward before the view re-centers"); - v_centerspeed = Cvar_Get ("v_centerspeed", "500", CVAR_NONE, 0, "How quickly you return to a center view after a lookup or lookdown"); + v_centermove = Cvar_Get ("v_centermove", "0.15", CVAR_NONE, NULL, + "How far the player must move forward before the view re-centers"); + v_centerspeed = Cvar_Get ("v_centerspeed", "500", CVAR_NONE, NULL, + "How quickly you return to a center view after a lookup or lookdown"); - v_iyaw_cycle = Cvar_Get ("v_iyaw_cycle", "2", CVAR_NONE, 0, "How far you tilt right and left when v_idlescale is enabled"); - v_iroll_cycle = Cvar_Get ("v_iroll_cycle", "0.5", CVAR_NONE, 0, "How quickly you tilt right and left when v_idlescale is enabled"); - v_ipitch_cycle = Cvar_Get ("v_ipitch_cycle", "1", CVAR_NONE, 0, "How quickly you lean forwards and backwards when v_idlescale is enabled"); - v_iyaw_level = Cvar_Get ("v_iyaw_level", "0.3", CVAR_NONE, 0, "How far you tilt right and left when v_idlescale is enabled"); - v_iroll_level = Cvar_Get ("v_iroll_level", "0.1", CVAR_NONE, 0, "How far you tilt right and left when v_idlescale is enabled"); - v_ipitch_level = Cvar_Get ("v_ipitch_level", "0.3", CVAR_NONE, 0, "How far you lean forwards and backwards when v_idlescale is enabled"); + v_iyaw_cycle = Cvar_Get ("v_iyaw_cycle", "2", CVAR_NONE, NULL, + "How far you tilt right and left when v_idlescale is enabled"); + v_iroll_cycle = Cvar_Get ("v_iroll_cycle", "0.5", CVAR_NONE, NULL, + "How quickly you tilt right and left when v_idlescale is enabled"); + v_ipitch_cycle = Cvar_Get ("v_ipitch_cycle", "1", CVAR_NONE, NULL, + "How quickly you lean forwards and backwards when v_idlescale is enabled"); + v_iyaw_level = Cvar_Get ("v_iyaw_level", "0.3", CVAR_NONE, NULL, + "How far you tilt right and left when v_idlescale is enabled"); + v_iroll_level = Cvar_Get ("v_iroll_level", "0.1", CVAR_NONE, NULL, + "How far you tilt right and left when v_idlescale is enabled"); + v_ipitch_level = Cvar_Get ("v_ipitch_level", "0.3", CVAR_NONE, NULL, + "How far you lean forwards and backwards when v_idlescale is enabled"); - v_idlescale = Cvar_Get ("v_idlescale", "0", CVAR_NONE, 0, "Toggles whether the view remains idle"); + v_idlescale = Cvar_Get ("v_idlescale", "0", CVAR_NONE, NULL, + "Toggles whether the view remains idle"); - cl_rollspeed = Cvar_Get ("cl_rollspeed", "200", CVAR_NONE, 0, "How quickly you straighten out after strafing"); - cl_rollangle = Cvar_Get ("cl_rollangle", "2.0", CVAR_NONE, 0, "How much your screen tilts when strafing"); + cl_rollspeed = Cvar_Get ("cl_rollspeed", "200", CVAR_NONE, NULL, + "How quickly you straighten out after strafing"); + cl_rollangle = Cvar_Get ("cl_rollangle", "2.0", CVAR_NONE, NULL, + "How much your screen tilts when strafing"); - cl_bob = Cvar_Get ("cl_bob", "0.02", CVAR_NONE, 0, "How much your weapon moves up and down when walking"); - cl_bobcycle = Cvar_Get ("cl_bobcycle", "0.6", CVAR_NONE, 0, "How quickly your weapon moves up and down when walking"); - cl_bobup = Cvar_Get ("cl_bobup", "0.5", CVAR_NONE, 0, "How long your weapon stays up before cycling when walking"); + cl_bob = Cvar_Get ("cl_bob", "0.02", CVAR_NONE, NULL, + "How much your weapon moves up and down when walking"); + cl_bobcycle = Cvar_Get ("cl_bobcycle", "0.6", CVAR_NONE, NULL, + "How quickly your weapon moves up and down when walking"); + cl_bobup = Cvar_Get ("cl_bobup", "0.5", CVAR_NONE, NULL, + "How long your weapon stays up before cycling when walking"); - v_kicktime = Cvar_Get ("v_kicktime", "0.5", CVAR_NONE, 0, "How long the kick from an attack lasts"); - v_kickroll = Cvar_Get ("v_kickroll", "0.6", CVAR_NONE, 0, "How much you lean when hit"); - v_kickpitch = Cvar_Get ("v_kickpitch", "0.6", CVAR_NONE, 0, "How much you look up when hit"); + v_kicktime = Cvar_Get ("v_kicktime", "0.5", CVAR_NONE, NULL, + "How long the kick from an attack lasts"); + v_kickroll = Cvar_Get ("v_kickroll", "0.6", CVAR_NONE, NULL, + "How much you lean when hit"); + v_kickpitch = Cvar_Get ("v_kickpitch", "0.6", CVAR_NONE, NULL, + "How much you look up when hit"); - brightness = Cvar_Get ("brightness", "1", CVAR_ARCHIVE, 0, "Brightness level"); - contrast = Cvar_Get ("contrast", "1", CVAR_ARCHIVE, 0, "Contrast level"); + brightness = Cvar_Get ("brightness", "1", CVAR_ARCHIVE, NULL, + "Brightness level"); + contrast = Cvar_Get ("contrast", "1", CVAR_ARCHIVE, NULL, "Contrast level"); } + diff --git a/qw/source/screen.c b/qw/source/screen.c index ae868f892..0888d0e35 100644 --- a/qw/source/screen.c +++ b/qw/source/screen.c @@ -402,20 +402,20 @@ SCR_SizeDown_f (void) void SCR_Init_Cvars (void) { - scr_fov = Cvar_Get ("fov", "90", CVAR_NONE, 0, "field of view. 90 is normal, smaller numbers zoom"); - scr_viewsize = Cvar_Get ("viewsize", "100", CVAR_ARCHIVE, 0, "Set the screen size 30 minimum, 120 maximum"); - scr_consize = Cvar_Get ("scr_consize", "0.5", CVAR_ARCHIVE, 0, "fraction of the screen the console covers when down"); - scr_conspeed = Cvar_Get ("scr_conspeed", "300", CVAR_NONE, 0, "How quickly in the console screen scrolls up and down"); - scr_showram = Cvar_Get ("showram", "1", CVAR_NONE, 0, "Show ram icon when low on ram in game"); - scr_showturtle = Cvar_Get ("showturtle", "0", CVAR_NONE, 0, "Show turtle icon when fps is lower than 10"); - scr_showpause = Cvar_Get ("showpause", "1", CVAR_NONE, 0, "Show paused graphic when paused"); - scr_centertime = Cvar_Get ("scr_centertime", "2", CVAR_NONE, 0, "How long in seconds the screen hints are displayed on the screen"); - scr_printspeed = Cvar_Get ("scr_printspeed", "8", CVAR_NONE, 0, "How fast the text is displayed at the end of the single player episodes"); + scr_fov = Cvar_Get ("fov", "90", CVAR_NONE, NULL, "field of view. 90 is normal, smaller numbers zoom"); + scr_viewsize = Cvar_Get ("viewsize", "100", CVAR_ARCHIVE, NULL, "Set the screen size 30 minimum, 120 maximum"); + scr_consize = Cvar_Get ("scr_consize", "0.5", CVAR_ARCHIVE, NULL, "fraction of the screen the console covers when down"); + scr_conspeed = Cvar_Get ("scr_conspeed", "300", CVAR_NONE, NULL, "How quickly in the console screen scrolls up and down"); + scr_showram = Cvar_Get ("showram", "1", CVAR_NONE, NULL, "Show ram icon when low on ram in game"); + scr_showturtle = Cvar_Get ("showturtle", "0", CVAR_NONE, NULL, "Show turtle icon when fps is lower than 10"); + scr_showpause = Cvar_Get ("showpause", "1", CVAR_NONE, NULL, "Show paused graphic when paused"); + scr_centertime = Cvar_Get ("scr_centertime", "2", CVAR_NONE, NULL, "How long in seconds the screen hints are displayed on the screen"); + scr_printspeed = Cvar_Get ("scr_printspeed", "8", CVAR_NONE, NULL, "How fast the text is displayed at the end of the single player episodes"); - crosshaircolor = Cvar_Get ("crosshaircolor", "79", CVAR_ARCHIVE, 0, "Crosshair 2's color"); - crosshair = Cvar_Get ("crosshair", "0", CVAR_ARCHIVE, 0, "Crosshair type. 0 off, 1 old, 2 new with color"); - cl_crossx = Cvar_Get ("cl_crossx", "0", CVAR_ARCHIVE, 0, "Sets the position of the crosshair on the X-axis"); - cl_crossy = Cvar_Get ("cl_crossy", "0", CVAR_ARCHIVE, 0, "Sets the position of the crosshair on the Y-axis"); + crosshaircolor = Cvar_Get ("crosshaircolor", "79", CVAR_ARCHIVE, NULL, "Crosshair 2's color"); + crosshair = Cvar_Get ("crosshair", "0", CVAR_ARCHIVE, NULL, "Crosshair type. 0 off, 1 old, 2 new with color"); + cl_crossx = Cvar_Get ("cl_crossx", "0", CVAR_ARCHIVE, NULL, "Sets the position of the crosshair on the X-axis"); + cl_crossy = Cvar_Get ("cl_crossy", "0", CVAR_ARCHIVE, NULL, "Sets the position of the crosshair on the Y-axis"); } void diff --git a/qw/source/skin.c b/qw/source/skin.c index 3bcbca1cc..dd6725506 100644 --- a/qw/source/skin.c +++ b/qw/source/skin.c @@ -312,15 +312,16 @@ Skin_Init (void) void Skin_Init_Cvars (void) { - baseskin = Cvar_Get ("baseskin", "base", CVAR_NONE, 0, + baseskin = Cvar_Get ("baseskin", "base", CVAR_NONE, NULL, "default base skin name"); - noskins = Cvar_Get ("noskins", "0", CVAR_NONE, 0, + noskins = Cvar_Get ("noskins", "0", CVAR_NONE, NULL, "set to 1 to not download new skins"); - skin = Cvar_Get ("skin", "", CVAR_ARCHIVE | CVAR_USERINFO, Cvar_Info, "Players skin"); - topcolor = Cvar_Get ("topcolor", "0", CVAR_ARCHIVE | CVAR_USERINFO, Cvar_Info, - "Players color on top"); - bottomcolor = Cvar_Get ("bottomcolor", "0", CVAR_ARCHIVE | CVAR_USERINFO, Cvar_Info, - "Players color on bottom"); + skin = Cvar_Get ("skin", "", CVAR_ARCHIVE | CVAR_USERINFO, Cvar_Info, + "Players skin"); + topcolor = Cvar_Get ("topcolor", "0", CVAR_ARCHIVE | CVAR_USERINFO, + Cvar_Info, "Players color on top"); + bottomcolor = Cvar_Get ("bottomcolor", "0", CVAR_ARCHIVE | CVAR_USERINFO, + Cvar_Info, "Players color on bottom"); } /* diff --git a/qw/source/snd_dma.c b/qw/source/snd_dma.c new file mode 100644 index 000000000..ae9036544 --- /dev/null +++ b/qw/source/snd_dma.c @@ -0,0 +1,1020 @@ +/* + snd_dma.c + + main control for any streaming sound output device + + Copyright (C) 1996-1997 Id Software, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + + $Id$ +*/ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif +#ifdef HAVE_STRING_H +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif + +#include + +#include "client.h" +#include "QF/cmd.h" +#include "QF/console.h" +#include "host.h" +#include "QF/model.h" +#include "QF/qargs.h" +#include "QF/sys.h" +#include "sound.h" + +#ifdef _WIN32 +#include "winquake.h" +#include "in_win.h" +#endif + +void S_Play (void); +void S_PlayVol (void); +void S_SoundList (void); +void S_Update_ (void); +void S_StopAllSounds (qboolean clear); +void S_StopAllSoundsC (void); + +// QuakeWorld hack... +//#define viewentity playernum+1 + +// ======================================================================= +// Internal sound data & structures +// ======================================================================= + +channel_t channels[MAX_CHANNELS]; +int total_channels; + +int snd_blocked = 0; +static qboolean snd_ambient = 1; +qboolean snd_initialized = false; + +// pointer should go away +volatile dma_t *shm = 0; +volatile dma_t sn; + +vec3_t listener_origin; +vec3_t listener_forward; +vec3_t listener_right; +vec3_t listener_up; +vec_t sound_nominal_clip_dist = 1000.0; + +int soundtime; // sample PAIRS +int paintedtime; // sample PAIRS + + +#define MAX_SFX 512 +sfx_t *known_sfx; // hunk allocated [MAX_SFX] +int num_sfx; + +sfx_t *ambient_sfx[NUM_AMBIENTS]; + +int desired_speed = 11025; +int desired_bits = 16; + +int sound_started = 0; + +cvar_t *bgmvolume; +cvar_t *volume; + +cvar_t *snd_device; +cvar_t *snd_rate; +cvar_t *snd_bits; +cvar_t *snd_stereo; +cvar_t *nosound; +cvar_t *precache; +cvar_t *loadas8bit; +cvar_t *ambient_level; +cvar_t *ambient_fade; +cvar_t *snd_noextraupdate; +cvar_t *snd_show; +cvar_t *snd_interp; +cvar_t *snd_phasesep; +cvar_t *snd_volumesep; +cvar_t *_snd_mixahead; + + +// ==================================================================== +// User-setable variables +// ==================================================================== + + +// +// Fake dma is a synchronous faking of the DMA progress used for +// isolating performance in the renderer. The fakedma_updates is +// number of times S_Update() is called per second. +// + +qboolean fakedma = false; +int fakedma_updates = 15; + + +void +S_AmbientOff (void) +{ + snd_ambient = false; +} + + +void +S_AmbientOn (void) +{ + snd_ambient = true; +} + + +void +S_SoundInfo_f (void) +{ + if (!sound_started || !shm) { + Con_Printf ("sound system not started\n"); + return; + } + + Con_Printf ("%5d stereo\n", shm->channels - 1); + Con_Printf ("%5d samples\n", shm->samples); + Con_Printf ("%5d samplepos\n", shm->samplepos); + Con_Printf ("%5d samplebits\n", shm->samplebits); + Con_Printf ("%5d submission_chunk\n", shm->submission_chunk); + Con_Printf ("%5d speed\n", shm->speed); + Con_Printf ("0x%lx dma buffer\n", (unsigned long) shm->buffer); + Con_Printf ("%5d total_channels\n", total_channels); +} + + +/* + S_Startup +*/ + +void +S_Startup (void) +{ + int rc; + + if (!snd_initialized) + return; + + if (!fakedma) { + rc = SNDDMA_Init (); + + if (!rc) { +#ifndef _WIN32 + Con_Printf ("S_Startup: SNDDMA_Init failed.\n"); +#endif + sound_started = 0; + return; + } + } + + sound_started = 1; +} + + +/* + S_Init +*/ +void +S_Init (void) +{ + + Con_Printf ("\nSound Initialization\n"); + + Cmd_AddCommand ("play", S_Play, + "Play selected sound effect (play pathto/sound.wav)"); + Cmd_AddCommand ("playvol", S_PlayVol, + "Play selected sound effect at selected volume (playvol pathto/sound.wav num"); + Cmd_AddCommand ("stopsound", S_StopAllSoundsC, + "Stops all sounds currently being played"); + Cmd_AddCommand ("soundlist", S_SoundList, + "Reports a list of sounds in the cache"); + Cmd_AddCommand ("soundinfo", S_SoundInfo_f, + "Report information on the sound system"); + + if (COM_CheckParm ("-nosound")) + return; + + if (COM_CheckParm ("-simsound")) + fakedma = true; + + if (host_parms.memsize < 0x800000) { + Cvar_Set (loadas8bit, "1"); + Con_Printf ("loading all sounds as 8bit\n"); + } + + + snd_initialized = true; + + S_Startup (); + + if (sound_started == 0) // sound startup failed? Bail out. + return; + + SND_InitScaletable (); + + known_sfx = Hunk_AllocName (MAX_SFX * sizeof (sfx_t), "sfx_t"); + + num_sfx = 0; + +// create a piece of DMA memory + + if (fakedma) { + shm = (void *) Hunk_AllocName (sizeof (*shm), "shm"); + shm->splitbuffer = 0; + shm->samplebits = 16; + shm->speed = 22050; + shm->channels = 2; + shm->samples = 32768; + shm->samplepos = 0; + shm->soundalive = true; + shm->gamealive = true; + shm->submission_chunk = 1; + shm->buffer = Hunk_AllocName (1 << 16, "shmbuf"); + } +// Con_Printf ("Sound sampling rate: %i\n", shm->speed); + + // provides a tick sound until washed clean + +// if (shm->buffer) +// shm->buffer[4] = shm->buffer[5] = 0x7f; // force a pop for debugging + + ambient_sfx[AMBIENT_WATER] = S_PrecacheSound ("ambience/water1.wav"); + ambient_sfx[AMBIENT_SKY] = S_PrecacheSound ("ambience/wind2.wav"); + + S_StopAllSounds (true); +} + +void +S_Init_Cvars (void) +{ + snd_device = Cvar_Get ("snd_device", "", CVAR_ROM, NULL, + "sound device. \"\" is system default"); + snd_rate = Cvar_Get ("snd_rate", "0", CVAR_ROM, NULL, + "sound playback rate. 0 is system default"); + snd_bits = Cvar_Get ("snd_bits", "0", CVAR_ROM, NULL, + "sound sample depth. 0 is system default"); + snd_stereo = Cvar_Get ("snd_stereo", "1", CVAR_ROM, NULL, + "sound stereo output"); + nosound = Cvar_Get ("nosound", "0", CVAR_NONE, NULL, + "Set to turn sound off"); + volume = + Cvar_Get ("volume", "0.7", CVAR_ARCHIVE, NULL, + "Set the volume for sound playback"); + precache = + Cvar_Get ("precache", "1", CVAR_NONE, NULL, + "Toggle the use of a precache"); + loadas8bit = + Cvar_Get ("loadas8bit", "0", CVAR_NONE, NULL, + "Toggles if sounds are loaded as 8-bit samples"); + bgmvolume = Cvar_Get ("bgmvolume", "1", CVAR_ARCHIVE, NULL, + "Volume of CD music"); + ambient_level = + Cvar_Get ("ambient_level", "0.3", CVAR_NONE, NULL, + "Ambient sounds' volume"); + ambient_fade = + Cvar_Get ("ambient_fade", "100", CVAR_NONE, NULL, + "How quickly ambient sounds fade in or out"); + snd_noextraupdate = + Cvar_Get ("snd_noextraupdate", "0", CVAR_NONE, NULL, + "Toggles the correct value display in host_speeds. Usually messes up sound playback when in effect"); + snd_show = + Cvar_Get ("snd_show", "0", CVAR_NONE, NULL, + "Toggles the display of sounds currently being played"); + snd_interp = + Cvar_Get ("snd_interp", "1", CVAR_ARCHIVE, NULL, + "control sample interpolation"); + snd_phasesep = + Cvar_Get ("snd_phasesep", "0.0", CVAR_ARCHIVE, NULL, + "max stereo phase separation in ms. 0.6 is for 20cm head"); + snd_volumesep = + Cvar_Get ("snd_volumesep", "1.0", CVAR_ARCHIVE, NULL, + "max stereo volume separation in ms. 1.0 is max"); + _snd_mixahead = + Cvar_Get ("_snd_mixahead", "0.1", CVAR_ARCHIVE, NULL, + "Delay time for sounds"); +} + + +// ======================================================================= +// Shutdown sound engine +// ======================================================================= + +void +S_Shutdown (void) +{ + + if (!sound_started) + return; + + if (shm) + shm->gamealive = 0; + + shm = 0; + sound_started = 0; + + if (!fakedma) { + SNDDMA_Shutdown (); + } +} + + +// ======================================================================= +// Load a sound +// ======================================================================= + +/* + S_FindName +*/ +sfx_t * +S_FindName (char *name) +{ + int i; + sfx_t *sfx; + + if (!name) + Sys_Error ("S_FindName: NULL\n"); + + if (strlen (name) >= MAX_QPATH) + Sys_Error ("Sound name too long: %s", name); + +// see if already loaded + for (i = 0; i < num_sfx; i++) + if (!strcmp (known_sfx[i].name, name)) { + return &known_sfx[i]; + } + + if (num_sfx == MAX_SFX) + Sys_Error ("S_FindName: out of sfx_t"); + + sfx = &known_sfx[i]; + strcpy (sfx->name, name); + + num_sfx++; + + return sfx; +} + + +/* + S_TouchSound +*/ +void +S_TouchSound (char *name) +{ + sfx_t *sfx; + + if (!sound_started) + return; + + sfx = S_FindName (name); + Cache_Check (&sfx->cache); +} + +/* + S_PrecacheSound +*/ +sfx_t * +S_PrecacheSound (char *name) +{ + sfx_t *sfx; + + if (!sound_started || nosound->int_val) + return NULL; + + sfx = S_FindName (name); + +// cache it in + if (precache->int_val) + S_LoadSound (sfx); + + return sfx; +} + + +//============================================================================= + +/* + SND_PickChannel +*/ +channel_t * +SND_PickChannel (int entnum, int entchannel) +{ + int ch_idx; + int first_to_die; + int life_left; + +// Check for replacement sound, or find the best one to replace + first_to_die = -1; + life_left = 0x7fffffff; + for (ch_idx = NUM_AMBIENTS; ch_idx < NUM_AMBIENTS + MAX_DYNAMIC_CHANNELS; + ch_idx++) { + if (entchannel != 0 // channel 0 never overrides + && channels[ch_idx].entnum == entnum + && (channels[ch_idx].entchannel == entchannel || entchannel == -1)) { + // always override sound from same entity + first_to_die = ch_idx; + break; + } + // don't let monster sounds override player sounds + if (channels[ch_idx].entnum == cl.viewentity && entnum != cl.viewentity + && channels[ch_idx].sfx) + continue; + + if (channels[ch_idx].end - paintedtime < life_left) { + life_left = channels[ch_idx].end - paintedtime; + first_to_die = ch_idx; + } + } + + if (first_to_die == -1) + return NULL; + + if (channels[first_to_die].sfx) + channels[first_to_die].sfx = NULL; + + return &channels[first_to_die]; +} + +/* + SND_Spatialize +*/ +void +SND_Spatialize (channel_t *ch) +{ + vec_t dot; + vec_t dist; + int phase; // in samples + vec_t lscale, rscale, scale; + vec3_t source_vec; + sfx_t *snd; + +// anything coming from the view entity will always be full volume + if (ch->entnum == cl.viewentity) { + ch->leftvol = ch->master_vol; + ch->rightvol = ch->master_vol; + ch->phase = 0; + return; + } +// calculate stereo seperation and distance attenuation + + snd = ch->sfx; + VectorSubtract (ch->origin, listener_origin, source_vec); + + dist = VectorNormalize (source_vec) * ch->dist_mult; + + dot = DotProduct (listener_right, source_vec); + + if (shm->channels == 1) { + rscale = 1.0; + lscale = 1.0; + phase = 0; + } else { + rscale = 1.0 + dot * snd_volumesep->value; + lscale = 1.0 - dot * snd_volumesep->value; + phase = snd_phasesep->value * 0.001 * shm->speed * dot; + } + +// add in distance effect + scale = (1.0 - dist) * rscale; + ch->rightvol = (int) (ch->master_vol * scale); + if (ch->rightvol < 0) + ch->rightvol = 0; + + scale = (1.0 - dist) * lscale; + ch->leftvol = (int) (ch->master_vol * scale); + if (ch->leftvol < 0) + ch->leftvol = 0; + + ch->phase = phase; +} + + +// ======================================================================= +// Start a sound effect +// ======================================================================= + +void +S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, + float attenuation) +{ + channel_t *target_chan, *check; + sfxcache_t *sc; + int vol; + int ch_idx; + int skip; + + if (!sound_started) + return; + + if (!sfx) + return; + + if (nosound->int_val) + return; + + vol = fvol * 255; + +// pick a channel to play on + target_chan = SND_PickChannel (entnum, entchannel); + if (!target_chan) + return; + +// spatialize + memset (target_chan, 0, sizeof (*target_chan)); + VectorCopy (origin, target_chan->origin); + target_chan->dist_mult = attenuation / sound_nominal_clip_dist; + target_chan->master_vol = vol; + target_chan->entnum = entnum; + target_chan->entchannel = entchannel; + SND_Spatialize (target_chan); + + if (!target_chan->leftvol && !target_chan->rightvol) + return; // not audible at all + +// new channel + sc = S_LoadSound (sfx); + if (!sc) { + target_chan->sfx = NULL; + return; // couldn't load the sound's data + } + + target_chan->sfx = sfx; + target_chan->pos = 0.0; + target_chan->end = paintedtime + sc->length; + +// if an identical sound has also been started this frame, offset the pos +// a bit to keep it from just making the first one louder + check = &channels[NUM_AMBIENTS]; + for (ch_idx = NUM_AMBIENTS; ch_idx < NUM_AMBIENTS + MAX_DYNAMIC_CHANNELS; + ch_idx++, check++) { + if (check == target_chan) + continue; + if (check->sfx == sfx && !check->pos) { + skip = rand () % (int) (0.1 * shm->speed); + if (skip >= target_chan->end) + skip = target_chan->end - 1; + target_chan->pos += skip; + target_chan->end -= skip; + break; + } + + } +} + +void +S_StopSound (int entnum, int entchannel) +{ + int i; + + for (i = 0; i < MAX_DYNAMIC_CHANNELS; i++) { + if (channels[i].entnum == entnum + && channels[i].entchannel == entchannel) { + channels[i].end = 0; + channels[i].sfx = NULL; + return; + } + } +} + +void +S_StopAllSounds (qboolean clear) +{ + int i; + + if (!sound_started) + return; + + total_channels = MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS; // no statics + + for (i = 0; i < MAX_CHANNELS; i++) + if (channels[i].sfx) + channels[i].sfx = NULL; + + memset (channels, 0, MAX_CHANNELS * sizeof (channel_t)); + + if (clear) + S_ClearBuffer (); +} + +void +S_StopAllSoundsC (void) +{ + S_StopAllSounds (true); +} + +void +S_ClearBuffer (void) +{ + int clear; + +#ifdef _WIN32 + if (!sound_started || !shm || (!shm->buffer && !pDSBuf)) +#else + if (!sound_started || !shm || !shm->buffer) +#endif + return; + + if (shm->samplebits == 8) + clear = 0x80; + else + clear = 0; + +#ifdef _WIN32 + if (pDSBuf) + DSOUND_ClearBuffer (clear); + else +#endif + { + memset (shm->buffer, clear, shm->samples * shm->samplebits / 8); + } +} + + +/* + S_StaticSound +*/ +void +S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation) +{ + channel_t *ss; + sfxcache_t *sc; + + if (!sfx) + return; + + if (total_channels == MAX_CHANNELS) { + Con_Printf ("total_channels == MAX_CHANNELS\n"); + return; + } + + ss = &channels[total_channels]; + total_channels++; + + sc = S_LoadSound (sfx); + if (!sc) + return; + + if (sc->loopstart == -1) { + Con_Printf ("Sound %s not looped\n", sfx->name); + return; + } + + ss->sfx = sfx; + VectorCopy (origin, ss->origin); + ss->master_vol = vol; + ss->dist_mult = (attenuation / 64) / sound_nominal_clip_dist; + ss->end = paintedtime + sc->length; + + SND_Spatialize (ss); + ss->oldphase = ss->phase; +} + + +//============================================================================= + +/* + S_UpdateAmbientSounds +*/ +void +S_UpdateAmbientSounds (void) +{ + mleaf_t *l; + float vol; + int ambient_channel; + channel_t *chan; + + if (!snd_ambient) + return; + +// calc ambient sound levels + if (!cl.worldmodel) + return; + + l = Mod_PointInLeaf (listener_origin, cl.worldmodel); + if (!l || !ambient_level->value) { + for (ambient_channel = 0; ambient_channel < NUM_AMBIENTS; + ambient_channel++) + channels[ambient_channel].sfx = NULL; + return; + } + + for (ambient_channel = 0; ambient_channel < NUM_AMBIENTS; ambient_channel++) { + chan = &channels[ambient_channel]; + chan->sfx = ambient_sfx[ambient_channel]; + + vol = ambient_level->value * l->ambient_sound_level[ambient_channel]; + if (vol < 8) + vol = 0; + + // don't adjust volume too fast + if (chan->master_vol < vol) { + chan->master_vol += host_frametime * ambient_fade->value; + if (chan->master_vol > vol) + chan->master_vol = vol; + } else if (chan->master_vol > vol) { + chan->master_vol -= host_frametime * ambient_fade->value; + if (chan->master_vol < vol) + chan->master_vol = vol; + } + + chan->leftvol = chan->rightvol = chan->master_vol; + } +} + + +/* + S_Update + + Called once each time through the main loop +*/ +void +S_Update (vec3_t origin, vec3_t forward, vec3_t right, vec3_t up) +{ + int i, j; + int total; + channel_t *ch; + channel_t *combine; + + if (!sound_started || (snd_blocked > 0)) + return; + + VectorCopy (origin, listener_origin); + VectorCopy (forward, listener_forward); + VectorCopy (right, listener_right); + VectorCopy (up, listener_up); + +// update general area ambient sound sources + S_UpdateAmbientSounds (); + + combine = NULL; + +// update spatialization for static and dynamic sounds + ch = channels + NUM_AMBIENTS; + for (i = NUM_AMBIENTS; i < total_channels; i++, ch++) { + if (!ch->sfx) + continue; + ch->oldphase = ch->phase; // prepare to lerp from prev to next + // phase + SND_Spatialize (ch); // respatialize channel + if (!ch->leftvol && !ch->rightvol) + continue; + + // try to combine static sounds with a previous channel of the same + // sound effect so we don't mix five torches every frame + + if (i >= MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS) { + // see if it can just use the last one + if (combine && combine->sfx == ch->sfx) { + combine->leftvol += ch->leftvol; + combine->rightvol += ch->rightvol; + ch->leftvol = ch->rightvol = 0; + continue; + } + // search for one + combine = channels + MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS; + for (j = MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS; j < i; j++, combine++) + if (combine->sfx == ch->sfx) + break; + + if (j == total_channels) { + combine = NULL; + } else { + if (combine != ch) { + combine->leftvol += ch->leftvol; + combine->rightvol += ch->rightvol; + ch->leftvol = ch->rightvol = 0; + } + continue; + } + } + + + } + +// +// debugging output +// + if (snd_show->int_val) { + total = 0; + ch = channels; + for (i = 0; i < total_channels; i++, ch++) + if (ch->sfx && (ch->leftvol || ch->rightvol)) { + // Con_Printf ("%3i %3i %s\n", ch->leftvol, ch->rightvol, + // ch->sfx->name); + total++; + } + + Con_Printf ("----(%i)----\n", total); + } +// mix some sound + S_Update_ (); +} + +void +GetSoundtime (void) +{ + int samplepos; + static int buffers; + static int oldsamplepos; + int fullsamples; + + fullsamples = shm->samples / shm->channels; + +// it is possible to miscount buffers if it has wrapped twice between +// calls to S_Update. Oh well. + samplepos = SNDDMA_GetDMAPos (); + + if (samplepos < oldsamplepos) { + buffers++; // buffer wrapped + + if (paintedtime > 0x40000000) { // time to chop things off to avoid + // 32 bit limits + buffers = 0; + paintedtime = fullsamples; + S_StopAllSounds (true); + } + } + oldsamplepos = samplepos; + + soundtime = buffers * fullsamples + samplepos / shm->channels; +} + +void +S_ExtraUpdate (void) +{ + +#ifdef _WIN32 + IN_Accumulate (); +#endif + + if (snd_noextraupdate->int_val) + return; // don't pollute timings + S_Update_ (); +} + + + +void +S_Update_ (void) +{ + unsigned int endtime; + int samps; + + if (!sound_started || (snd_blocked > 0)) + return; + +// Updates DMA time + GetSoundtime (); + +// check to make sure that we haven't overshot + if (paintedtime < soundtime) { + // Con_Printf ("S_Update_ : overflow\n"); + paintedtime = soundtime; + } +// mix ahead of current position + endtime = soundtime + _snd_mixahead->value * shm->speed; + samps = shm->samples >> (shm->channels - 1); + if (endtime - soundtime > samps) + endtime = soundtime + samps; + +#ifdef _WIN32 + if (pDSBuf) + DSOUND_Restore (); +#endif + + S_PaintChannels (endtime); + + SNDDMA_Submit (); +} + +/* + console functions +*/ + +void +S_Play (void) +{ + static int hash = 345; + int i; + char name[256]; + sfx_t *sfx; + + i = 1; + while (i < Cmd_Argc ()) { + if (!strrchr (Cmd_Argv (i), '.')) { + strcpy (name, Cmd_Argv (i)); + strncat (name, ".wav", sizeof (name) - strlen (name)); + } else + strcpy (name, Cmd_Argv (i)); + sfx = S_PrecacheSound (name); + S_StartSound (hash++, 0, sfx, listener_origin, 1.0, 1.0); + i++; + } +} + +void +S_PlayVol (void) +{ + static int hash = 543; + int i; + float vol; + char name[256]; + sfx_t *sfx; + + i = 1; + while (i < Cmd_Argc ()) { + if (!strrchr (Cmd_Argv (i), '.')) { + strcpy (name, Cmd_Argv (i)); + strncat (name, ".wav", sizeof (name) - strlen (name)); + } else + strcpy (name, Cmd_Argv (i)); + sfx = S_PrecacheSound (name); + vol = atof (Cmd_Argv (i + 1)); + S_StartSound (hash++, 0, sfx, listener_origin, vol, 1.0); + i += 2; + } +} + +void +S_SoundList (void) +{ + int i; + sfx_t *sfx; + sfxcache_t *sc; + int size, total; + + total = 0; + for (sfx = known_sfx, i = 0; i < num_sfx; i++, sfx++) { + sc = Cache_Check (&sfx->cache); + if (!sc) + continue; + size = sc->length * sc->width * (sc->stereo + 1); + total += size; + if (sc->loopstart >= 0) + Con_Printf ("L"); + else + Con_Printf (" "); + Con_Printf ("(%2db) %6i : %s\n", sc->width * 8, size, sfx->name); + } + Con_Printf ("Total resident: %i\n", total); +} + + +void +S_LocalSound (char *sound) +{ + sfx_t *sfx; + + if (nosound->int_val) + return; + if (!sound_started) + return; + + sfx = S_PrecacheSound (sound); + if (!sfx) { + Con_Printf ("S_LocalSound: can't cache %s\n", sound); + return; + } + S_StartSound (cl.viewentity, -1, sfx, vec3_origin, 1, 1); +} + + +void +S_ClearPrecache (void) +{ +} + + +void +S_BeginPrecaching (void) +{ +} + + +void +S_EndPrecaching (void) +{ +} diff --git a/qw/source/snd_null.c b/qw/source/snd_null.c new file mode 100644 index 000000000..5a251d117 --- /dev/null +++ b/qw/source/snd_null.c @@ -0,0 +1,147 @@ +/* + snd_null.c + + include this instead of all the other snd_* files to have no sound + code whatsoever + + Copyright (C) 1996-1997 Id Software, Inc. + Copyright (C) 1999,2000 contributors of the QuakeForge project + Please see the file "AUTHORS" for a list of contributors + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + + $Id$ +*/ + +#include "QF/qtypes.h" +#include "sound.h" + +// ======================================================================= +// Various variables also defined in snd_dma.c +// FIXME - should be put in one place +// ======================================================================= +channel_t channels[MAX_CHANNELS]; +int total_channels; +volatile dma_t *shm = 0; +cvar_t *loadas8bit; +int paintedtime; // sample PAIRS + + +cvar_t *bgmvolume; +cvar_t *volume; + + +void +S_Init (void) +{ + S_Init_Cvars (); +} + +void +S_Init_Cvars (void) +{ + volume = Cvar_Get ("volume", "0.7", CVAR_ARCHIVE, NULL, + "Volume level of sounds"); + loadas8bit = + Cvar_Get ("loadas8bit", "0", CVAR_NONE, NULL, "Load samples as 8-bit"); + bgmvolume = Cvar_Get ("bgmvolume", "1", CVAR_ARCHIVE, NULL, + "CD music volume"); +} + +void +S_AmbientOff (void) +{ +} + +void +S_AmbientOn (void) +{ +} + +void +S_Shutdown (void) +{ +} + +void +S_TouchSound (char *sample) +{ +} + +void +S_ClearBuffer (void) +{ +} + +void +S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation) +{ +} + +void +S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, + float attenuation) +{ +} + +void +S_StopSound (int entnum, int entchannel) +{ +} + +sfx_t * +S_PrecacheSound (char *sample) +{ + return NULL; +} + +void +S_ClearPrecache (void) +{ +} + +void +S_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_up) +{ +} + +void +S_StopAllSounds (qboolean clear) +{ +} + +void +S_BeginPrecaching (void) +{ +} + +void +S_EndPrecaching (void) +{ +} + +void +S_ExtraUpdate (void) +{ +} + +void +S_LocalSound (char *s) +{ +} diff --git a/qw/source/sv_ccmds.c b/qw/source/sv_ccmds.c index c2fceb51d..1375b7475 100644 --- a/qw/source/sv_ccmds.c +++ b/qw/source/sv_ccmds.c @@ -877,7 +877,8 @@ SV_InitOperatorCommands (void) Cmd_AddCommand ("maplist", COM_Maplist_f, "List all maps on the server"); cl_warncmd = - Cvar_Get ("cl_warncmd", "1", CVAR_NONE, 0, "Toggles the display of error messages for unknown commands"); + Cvar_Get ("cl_warncmd", "1", CVAR_NONE, NULL, + "Toggles the display of error messages for unknown commands"); // poor // description } diff --git a/qw/source/sv_main.c b/qw/source/sv_main.c index d80a8b2f4..d37e424bd 100644 --- a/qw/source/sv_main.c +++ b/qw/source/sv_main.c @@ -1490,13 +1490,13 @@ SV_InitLocal (void) SV_UserInit (); - rcon_password = Cvar_Get ("rcon_password", "", CVAR_NONE, 0, "Set the password for rcon commands"); - password = Cvar_Get ("password", "", CVAR_NONE, 0, "Set the server password for players"); - spectator_password = Cvar_Get ("spectator_password", "", CVAR_NONE, 0, "Set the spectator password"); + rcon_password = Cvar_Get ("rcon_password", "", CVAR_NONE, NULL, "Set the password for rcon commands"); + password = Cvar_Get ("password", "", CVAR_NONE, NULL, "Set the server password for players"); + spectator_password = Cvar_Get ("spectator_password", "", CVAR_NONE, NULL, "Set the spectator password"); - sv_mintic = Cvar_Get ("sv_mintic", "0.03", CVAR_NONE, 0, + sv_mintic = Cvar_Get ("sv_mintic", "0.03", CVAR_NONE, NULL, "The minimum amount of time the server will wait before sending packets to a client. Set to .5 to make modem users happy"); - sv_maxtic = Cvar_Get ("sv_maxtic", "0.1", CVAR_NONE, 0, + sv_maxtic = Cvar_Get ("sv_maxtic", "0.1", CVAR_NONE, NULL, "The maximum amount of time in seconds before a client a receives an update from the server"); fraglimit = Cvar_Get ("fraglimit", "0", CVAR_SERVERINFO, Cvar_Info, "Amount of frags a player must attain in order to exit the level"); timelimit = Cvar_Get ("timelimit", "0", CVAR_SERVERINFO, Cvar_Info, @@ -1524,34 +1524,34 @@ SV_InitLocal (void) spawn = Cvar_Get ("spawn", "0", CVAR_SERVERINFO, Cvar_Info, "Spawn the player entity"); watervis = Cvar_Get ("watervis", "0", CVAR_SERVERINFO, Cvar_Info, "Toggle the use of r_watervis by OpenGL clients"); - timeout = Cvar_Get ("timeout", "65", CVAR_NONE, 0, + timeout = Cvar_Get ("timeout", "65", CVAR_NONE, NULL, "Sets the amount of time in seconds before a client is considered disconnected if the server does not receive a packet"); - zombietime = Cvar_Get ("zombietime", "2", CVAR_NONE, 0, + zombietime = Cvar_Get ("zombietime", "2", CVAR_NONE, NULL, "The number of seconds that the server will keep the character of a player on the map who seems to have disconnected"); - sv_maxvelocity = Cvar_Get ("sv_maxvelocity", "2000", CVAR_NONE, 0, "Sets the maximum velocity an object can travel"); - sv_gravity = Cvar_Get ("sv_gravity", "800", CVAR_NONE, 0, "Sets the global value for the amount of gravity"); - sv_stopspeed = Cvar_Get ("sv_stopspeed", "100", CVAR_NONE, 0, + sv_maxvelocity = Cvar_Get ("sv_maxvelocity", "2000", CVAR_NONE, NULL, "Sets the maximum velocity an object can travel"); + sv_gravity = Cvar_Get ("sv_gravity", "800", CVAR_NONE, NULL, "Sets the global value for the amount of gravity"); + sv_stopspeed = Cvar_Get ("sv_stopspeed", "100", CVAR_NONE, NULL, "Sets the value that determines how fast the player should come to a complete stop"); - sv_maxspeed = Cvar_Get ("sv_maxspeed", "320", CVAR_NONE, 0, "Sets the maximum speed a player can move"); + sv_maxspeed = Cvar_Get ("sv_maxspeed", "320", CVAR_NONE, NULL, "Sets the maximum speed a player can move"); sv_spectatormaxspeed = - Cvar_Get ("sv_spectatormaxspeed", "500", CVAR_NONE, 0, "Sets the maximum speed a spectator can move"); - sv_accelerate = Cvar_Get ("sv_accelerate", "10", CVAR_NONE, 0, "Sets the acceleration value for the players"); - sv_airaccelerate = Cvar_Get ("sv_airaccelerate", "0.7", CVAR_NONE, 0, "Sets how quickly the players accelerate in air"); + Cvar_Get ("sv_spectatormaxspeed", "500", CVAR_NONE, NULL, "Sets the maximum speed a spectator can move"); + sv_accelerate = Cvar_Get ("sv_accelerate", "10", CVAR_NONE, NULL, "Sets the acceleration value for the players"); + sv_airaccelerate = Cvar_Get ("sv_airaccelerate", "0.7", CVAR_NONE, NULL, "Sets how quickly the players accelerate in air"); sv_wateraccelerate = - Cvar_Get ("sv_wateraccelerate", "10", CVAR_NONE, 0, "Sets the water acceleration value"); - sv_friction = Cvar_Get ("sv_friction", "4", CVAR_NONE, 0, "Sets the friction value for the players"); - sv_waterfriction = Cvar_Get ("sv_waterfriction", "4", CVAR_NONE, 0, "Sets the water friction value"); + Cvar_Get ("sv_wateraccelerate", "10", CVAR_NONE, NULL, "Sets the water acceleration value"); + sv_friction = Cvar_Get ("sv_friction", "4", CVAR_NONE, NULL, "Sets the friction value for the players"); + sv_waterfriction = Cvar_Get ("sv_waterfriction", "4", CVAR_NONE, NULL, "Sets the water friction value"); - sv_aim = Cvar_Get ("sv_aim", "2", CVAR_NONE, 0, "Sets the value for auto-aiming leniency"); + sv_aim = Cvar_Get ("sv_aim", "2", CVAR_NONE, NULL, "Sets the value for auto-aiming leniency"); sv_timekick = Cvar_Get ("sv_timekick", "3", CVAR_SERVERINFO, Cvar_Info, "Time cheat protection"); sv_timekick_fuzz = - Cvar_Get ("sv_timekick_fuzz", "15", CVAR_NONE, 0, + Cvar_Get ("sv_timekick_fuzz", "15", CVAR_NONE, NULL, "Time cheat \"fuzz factor\""); sv_timekick_interval = - Cvar_Get ("sv_timekick_interval", "30", CVAR_NONE, 0, + Cvar_Get ("sv_timekick_interval", "30", CVAR_NONE, NULL, "Time cheat check interval"); sv_minqfversion = @@ -1562,45 +1562,45 @@ SV_InitLocal (void) Cvar_Get ("sv_maxrate", "0", CVAR_SERVERINFO, Cvar_Info, "Maximum allowable rate"); sv_allow_log = - Cvar_Get ("sv_allow_log", "1", CVAR_NONE, 0, "Allow remote logging"); + Cvar_Get ("sv_allow_log", "1", CVAR_NONE, NULL, "Allow remote logging"); sv_allow_status = - Cvar_Get ("sv_allow_status", "1", CVAR_NONE, 0, + Cvar_Get ("sv_allow_status", "1", CVAR_NONE, NULL, "Allow remote status queries (qstat etc)"); sv_allow_ping = - Cvar_Get ("sv_allow_pings", "1", CVAR_NONE, 0, + Cvar_Get ("sv_allow_pings", "1", CVAR_NONE, NULL, "Allow remote pings (qstat etc)"); sv_netdosprotect = - Cvar_Get ("sv_netdosprotect", "0", CVAR_NONE, 0, + Cvar_Get ("sv_netdosprotect", "0", CVAR_NONE, NULL, "DoS flood attack protection"); sv_timestamps = - Cvar_Get ("sv_timestamps", "0", CVAR_NONE, 0, + Cvar_Get ("sv_timestamps", "0", CVAR_NONE, NULL, "Time/date stamps in log entries"); sv_timefmt = - Cvar_Get ("sv_timefmt", "[%b %e %X] ", CVAR_NONE, 0, + Cvar_Get ("sv_timefmt", "[%b %e %X] ", CVAR_NONE, NULL, "Time/date format to use"); - filterban = Cvar_Get ("filterban", "1", CVAR_NONE, 0, + filterban = Cvar_Get ("filterban", "1", CVAR_NONE, NULL, "Determines the rules for the IP list " "0 Only IP addresses on the Ban list will be allowed onto the server, " "1 Only IP addresses NOT on the Ban list will be allowed onto the server"); - allow_download = Cvar_Get ("allow_download", "1", CVAR_NONE, 0, "Toggle if clients can download game data from the server"); + allow_download = Cvar_Get ("allow_download", "1", CVAR_NONE, NULL, "Toggle if clients can download game data from the server"); allow_download_skins = - Cvar_Get ("allow_download_skins", "1", CVAR_NONE, 0, "Toggle if clients can download skins from the server"); + Cvar_Get ("allow_download_skins", "1", CVAR_NONE, NULL, "Toggle if clients can download skins from the server"); allow_download_models = - Cvar_Get ("allow_download_models", "1", CVAR_NONE, 0, "Toggle if clients can download models from the server"); + Cvar_Get ("allow_download_models", "1", CVAR_NONE, NULL, "Toggle if clients can download models from the server"); allow_download_sounds = - Cvar_Get ("allow_download_sounds", "1", CVAR_NONE, 0, "Toggle if clients can download sounds from the server"); + Cvar_Get ("allow_download_sounds", "1", CVAR_NONE, NULL, "Toggle if clients can download sounds from the server"); allow_download_maps = - Cvar_Get ("allow_download_maps", "1", CVAR_NONE, 0, "Toggle if clients can download maps from the server"); + Cvar_Get ("allow_download_maps", "1", CVAR_NONE, NULL, "Toggle if clients can download maps from the server"); - sv_highchars = Cvar_Get ("sv_highchars", "1", CVAR_NONE, 0, "Toggle the use of high character color names for players"); + sv_highchars = Cvar_Get ("sv_highchars", "1", CVAR_NONE, NULL, "Toggle the use of high character color names for players"); - sv_phs = Cvar_Get ("sv_phs", "1", CVAR_NONE, 0, + sv_phs = Cvar_Get ("sv_phs", "1", CVAR_NONE, NULL, "Possibly Hearable Set. If set to zero, the server calculates sound hearability in realtime"); - pausable = Cvar_Get ("pausable", "1", CVAR_NONE, 0, "Toggle if server can be paused 1 is on, 0 is off"); + pausable = Cvar_Get ("pausable", "1", CVAR_NONE, NULL, "Toggle if server can be paused 1 is on, 0 is off"); // DoS protection Cmd_AddCommand ("netdosexpire", SV_netDoSexpire_f, "FIXME: part of DoS protection obviously, but I don't know what it does. No Description"); diff --git a/qw/source/sv_progs.c b/qw/source/sv_progs.c index e3efb46ca..a44307634 100644 --- a/qw/source/sv_progs.c +++ b/qw/source/sv_progs.c @@ -284,11 +284,12 @@ void SV_Progs_Init_Cvars (void) { r_skyname = - Cvar_Get ("r_skyname", "", CVAR_SERVERINFO, Cvar_Info, "name of skybox"); - sv_progs = Cvar_Get ("sv_progs", "qwprogs.dat", CVAR_ROM, 0, + Cvar_Get ("r_skyname", "", CVAR_SERVERINFO, Cvar_Info, + "name of skybox"); + sv_progs = Cvar_Get ("sv_progs", "qwprogs.dat", CVAR_ROM, NULL, "Allows selectable game progs if you have several " "of them in the gamedir"); - pr_checkextentions = Cvar_Get ("sv_progs", "1", CVAR_ROM, 0, + pr_checkextentions = Cvar_Get ("sv_progs", "1", CVAR_ROM, NULL, "indicate the presence of the " "checkextentions qc function"); } diff --git a/qw/source/sv_sys_unix.c b/qw/source/sv_sys_unix.c index 0fd15ca7b..380e7c302 100644 --- a/qw/source/sv_sys_unix.c +++ b/qw/source/sv_sys_unix.c @@ -139,10 +139,11 @@ Sys_ConsoleInput (void) void Sys_Init_Cvars (void) { - sys_nostdout = Cvar_Get ("sys_nostdout", "0", CVAR_NONE, 0, "Toggles console screen output"); - sys_extrasleep = Cvar_Get ("sys_extrasleep", "0", CVAR_NONE, 0, + sys_nostdout = Cvar_Get ("sys_nostdout", "0", CVAR_NONE, NULL, + "Toggles console screen output"); + sys_extrasleep = Cvar_Get ("sys_extrasleep", "0", CVAR_NONE, NULL, "Set to cause whatever amount delay in microseconds you want. Mostly useful to generate simulated bad connections."); - sys_dead_sleep = Cvar_Get ("sys_dead_sleep", "1", CVAR_NONE, 0, + sys_dead_sleep = Cvar_Get ("sys_dead_sleep", "1", CVAR_NONE, NULL, "When set, the server gets NO cpu if no clients are connected" "and there's no other activity. *MIGHT* cause problems with" "some mods."); diff --git a/qw/source/sv_sys_win.c b/qw/source/sv_sys_win.c index 63099d283..4ad4b1df3 100644 --- a/qw/source/sv_sys_win.c +++ b/qw/source/sv_sys_win.c @@ -132,8 +132,9 @@ Sys_Quit (void) void Sys_Init_Cvars (void) { - sys_nostdout = Cvar_Get ("sys_nostdout", "0", CVAR_NONE, 0, "Toggle console output"); - sys_sleep = Cvar_Get ("sys_sleep", "8", CVAR_NONE, 0, + sys_nostdout = Cvar_Get ("sys_nostdout", "0", CVAR_NONE, NULL, + "Toggle console output"); + sys_sleep = Cvar_Get ("sys_sleep", "8", CVAR_NONE, NULL, "Sleep how long in seconds between checking for connections. minimum is 0, maximum is 13"); } diff --git a/qw/source/sv_user.c b/qw/source/sv_user.c index 1767ccf17..82d21f6bc 100644 --- a/qw/source/sv_user.c +++ b/qw/source/sv_user.c @@ -1768,9 +1768,13 @@ SV_UserInit (void) { qsort (ucmds, sizeof (ucmds) / sizeof (ucmds[0]), sizeof (ucmds[0]), ucmds_compare); - cl_rollspeed = Cvar_Get ("cl_rollspeed", "200", CVAR_NONE, 0, "How quickly a player straightens out after strafing"); - cl_rollangle = Cvar_Get ("cl_rollangle", "2", CVAR_NONE, 0, "How much a player's screen tilts when strafing"); - sv_spectalk = Cvar_Get ("sv_spectalk", "1", CVAR_NONE, 0, "Toggles the ability of spectators to talk to players"); - sv_mapcheck = Cvar_Get ("sv_mapcheck", "1", CVAR_NONE, 0, + cl_rollspeed = Cvar_Get ("cl_rollspeed", "200", CVAR_NONE, NULL, + "How quickly a player straightens out after strafing"); + cl_rollangle = Cvar_Get ("cl_rollangle", "2", CVAR_NONE, NULL, + "How much a player's screen tilts when strafing"); + sv_spectalk = Cvar_Get ("sv_spectalk", "1", CVAR_NONE, NULL, + "Toggles the ability of spectators to talk to players"); + sv_mapcheck = Cvar_Get ("sv_mapcheck", "1", CVAR_NONE, NULL, "Toggle the use of map checksumming to check for players who edit maps to cheat"); } + diff --git a/qw/source/sw_rmain.c b/qw/source/sw_rmain.c index 82e3c8be6..672053148 100644 --- a/qw/source/sw_rmain.c +++ b/qw/source/sw_rmain.c @@ -261,31 +261,31 @@ R_Init_Cvars (void) { D_Init_Cvars (); - r_draworder = Cvar_Get ("r_draworder", "0", CVAR_NONE, 0, "Toggles drawing order"); - r_speeds = Cvar_Get ("r_speeds", "0", CVAR_NONE, 0, "Toggles the displaying of drawing time and" + r_draworder = Cvar_Get ("r_draworder", "0", CVAR_NONE, NULL, "Toggles drawing order"); + r_speeds = Cvar_Get ("r_speeds", "0", CVAR_NONE, NULL, "Toggles the displaying of drawing time and" "statistics of what is currently being viewed"); - r_timegraph = Cvar_Get ("r_timegraph", "0", CVAR_NONE, 0, "Toggle the display of a performance graph"); - r_netgraph = Cvar_Get ("r_netgraph", "0", CVAR_NONE, 0, "Toggle the display of a graph showing network performance"); - r_zgraph = Cvar_Get ("r_zgraph", "0", CVAR_NONE, 0, "Toggle the graph that reports the changes of z-axis position"); - r_graphheight = Cvar_Get ("r_graphheight", "32", CVAR_NONE, 0, "Set the number of lines displayed in the various graphs"); - r_drawflat = Cvar_Get ("r_drawflat", "0", CVAR_NONE, 0, "Toggles the drawing of textures"); - r_ambient = Cvar_Get ("r_ambient", "0", CVAR_NONE, 0, "Determines the ambient lighting for a level"); - r_clearcolor = Cvar_Get ("r_clearcolor", "2", CVAR_NONE, 0, "This sets the color for areas outside of the current map"); - r_waterwarp = Cvar_Get ("r_waterwarp", "1", CVAR_NONE, 0, "Toggles whether surfaces are warped in a liquid."); - r_drawentities = Cvar_Get ("r_drawentities", "1", CVAR_NONE, 0, "Toggles the drawing of entities."); - r_drawviewmodel = Cvar_Get ("r_drawviewmodel", "1", CVAR_ARCHIVE, 0, "Toggles the drawing of your weapon"); - r_particles = Cvar_Get ("r_particles", "1", CVAR_ARCHIVE, 0, "Toggles drawing of particles."); - r_aliasstats = Cvar_Get ("r_polymodelstats", "0", CVAR_NONE, 0, "Toggles the displays of number of polygon models current being viewed"); - r_dspeeds = Cvar_Get ("r_dspeeds", "0", CVAR_NONE, 0, "Toggles the display of drawing speed information"); - r_reportsurfout = Cvar_Get ("r_reportsurfout", "0", CVAR_NONE, 0, "Toggle the display of how many surfaces where not displayed"); - r_maxsurfs = Cvar_Get ("r_maxsurfs", "0", CVAR_NONE, 0, "Sets the maximum number of surfaces"); - r_numsurfs = Cvar_Get ("r_numsurfs", "0", CVAR_NONE, 0, "Toggles the displaying of number of surfaces currently being viewed"); - r_reportedgeout = Cvar_Get ("r_reportedgeout", "0", CVAR_NONE, 0, "Toggle the display of how many edges where not displayed"); - r_maxedges = Cvar_Get ("r_maxedges", "0", CVAR_NONE, 0, "Sets the maximum number of surfaces"); - r_numedges = Cvar_Get ("r_numedges", "0", CVAR_NONE, 0, "Toggles the displaying of number of edges currently being viewed"); - r_aliastransbase = Cvar_Get ("r_aliastransbase", "200", CVAR_NONE, 0, "Determines how much of an alias model is clipped away and how much is viewable"); - r_aliastransadj = Cvar_Get ("r_aliastransadj", "100", CVAR_NONE, 0, "Determines how much of an alias model is clipped away and how much is viewable."); - gl_sky_divide = Cvar_Get ("gl_sky_divide", "1", CVAR_ARCHIVE, 0, + r_timegraph = Cvar_Get ("r_timegraph", "0", CVAR_NONE, NULL, "Toggle the display of a performance graph"); + r_netgraph = Cvar_Get ("r_netgraph", "0", CVAR_NONE, NULL, "Toggle the display of a graph showing network performance"); + r_zgraph = Cvar_Get ("r_zgraph", "0", CVAR_NONE, NULL, "Toggle the graph that reports the changes of z-axis position"); + r_graphheight = Cvar_Get ("r_graphheight", "32", CVAR_NONE, NULL, "Set the number of lines displayed in the various graphs"); + r_drawflat = Cvar_Get ("r_drawflat", "0", CVAR_NONE, NULL, "Toggles the drawing of textures"); + r_ambient = Cvar_Get ("r_ambient", "0", CVAR_NONE, NULL, "Determines the ambient lighting for a level"); + r_clearcolor = Cvar_Get ("r_clearcolor", "2", CVAR_NONE, NULL, "This sets the color for areas outside of the current map"); + r_waterwarp = Cvar_Get ("r_waterwarp", "1", CVAR_NONE, NULL, "Toggles whether surfaces are warped in a liquid."); + r_drawentities = Cvar_Get ("r_drawentities", "1", CVAR_NONE, NULL, "Toggles the drawing of entities."); + r_drawviewmodel = Cvar_Get ("r_drawviewmodel", "1", CVAR_ARCHIVE, NULL, "Toggles the drawing of your weapon"); + r_particles = Cvar_Get ("r_particles", "1", CVAR_ARCHIVE, NULL, "Toggles drawing of particles."); + r_aliasstats = Cvar_Get ("r_polymodelstats", "0", CVAR_NONE, NULL, "Toggles the displays of number of polygon models current being viewed"); + r_dspeeds = Cvar_Get ("r_dspeeds", "0", CVAR_NONE, NULL, "Toggles the display of drawing speed information"); + r_reportsurfout = Cvar_Get ("r_reportsurfout", "0", CVAR_NONE, NULL, "Toggle the display of how many surfaces where not displayed"); + r_maxsurfs = Cvar_Get ("r_maxsurfs", "0", CVAR_NONE, NULL, "Sets the maximum number of surfaces"); + r_numsurfs = Cvar_Get ("r_numsurfs", "0", CVAR_NONE, NULL, "Toggles the displaying of number of surfaces currently being viewed"); + r_reportedgeout = Cvar_Get ("r_reportedgeout", "0", CVAR_NONE, NULL, "Toggle the display of how many edges where not displayed"); + r_maxedges = Cvar_Get ("r_maxedges", "0", CVAR_NONE, NULL, "Sets the maximum number of surfaces"); + r_numedges = Cvar_Get ("r_numedges", "0", CVAR_NONE, NULL, "Toggles the displaying of number of edges currently being viewed"); + r_aliastransbase = Cvar_Get ("r_aliastransbase", "200", CVAR_NONE, NULL, "Determines how much of an alias model is clipped away and how much is viewable"); + r_aliastransadj = Cvar_Get ("r_aliastransadj", "100", CVAR_NONE, NULL, "Determines how much of an alias model is clipped away and how much is viewable."); + gl_sky_divide = Cvar_Get ("gl_sky_divide", "1", CVAR_ARCHIVE, NULL, "subdivide sky polys"); } diff --git a/qw/source/teamplay.c b/qw/source/teamplay.c index 837b25993..efe295c24 100644 --- a/qw/source/teamplay.c +++ b/qw/source/teamplay.c @@ -333,11 +333,13 @@ void Team_Init_Cvars (void) { cl_deadbodyfilter = - Cvar_Get ("cl_deadbodyfilter", "0", CVAR_NONE, 0, + Cvar_Get ("cl_deadbodyfilter", "0", CVAR_NONE, NULL, "Hide dead player models"); - cl_gibfilter = Cvar_Get ("cl_gibfilter", "0", CVAR_NONE, 0, "Hide gibs"); - cl_parsesay = Cvar_Get ("cl_parsesay", "0", CVAR_NONE, 0, "Use .loc files to find your present location when you put %l in messages"); - cl_nofake = Cvar_Get ("cl_nofake", "0", CVAR_NONE, 0, "Unhide fake messages"); + cl_gibfilter = Cvar_Get ("cl_gibfilter", "0", CVAR_NONE, NULL, "Hide gibs"); + cl_parsesay = Cvar_Get ("cl_parsesay", "0", CVAR_NONE, NULL, + "Use .loc files to find your present location when you put %l in messages"); + cl_nofake = Cvar_Get ("cl_nofake", "0", CVAR_NONE, NULL, + "Unhide fake messages"); } /* diff --git a/qw/source/vid.c b/qw/source/vid.c index a127c86a9..beba4a5cd 100644 --- a/qw/source/vid.c +++ b/qw/source/vid.c @@ -47,8 +47,10 @@ VID_GetWindowSize (int def_w, int def_h) { int pnum; - vid_width = Cvar_Get ("vid_width", va ("%d", def_w), CVAR_NONE, 0, "screen width"); - vid_height = Cvar_Get ("vid_height", va ("%d", def_h), CVAR_NONE, 0, "screen height"); + vid_width = Cvar_Get ("vid_width", va ("%d", def_w), CVAR_NONE, NULL, + "screen width"); + vid_height = Cvar_Get ("vid_height", va ("%d", def_h), CVAR_NONE, NULL, + "screen height"); if ((pnum = COM_CheckParm ("-width"))) { if (pnum >= com_argc - 1) diff --git a/qw/source/vid_common_gl.c b/qw/source/vid_common_gl.c index 8c5528243..3352de831 100644 --- a/qw/source/vid_common_gl.c +++ b/qw/source/vid_common_gl.c @@ -345,7 +345,8 @@ void VID_Init8bitPalette (void) { vid_use8bit = - Cvar_Get ("vid_use8bit", "0", CVAR_ROM, 0, "Use 8-bit shared palettes."); + Cvar_Get ("vid_use8bit", "0", CVAR_ROM, NULL, + "Use 8-bit shared palettes."); Con_Printf ("Checking for 8-bit extension: "); if (vid_use8bit->int_val) { diff --git a/qw/source/vid_fbdev.c b/qw/source/vid_fbdev.c index 1bb07ec7e..b12275076 100644 --- a/qw/source/vid_fbdev.c +++ b/qw/source/vid_fbdev.c @@ -6,7 +6,6 @@ based on vid_svgalib.c Copyright (C) 1996-1997 Id Software, Inc. - Copyright (C) 1999-2000 Nelson Rush. Copyright (C) 1999-2000 Marcus Sundberg [mackan@stacken.kth.se] Copyright (C) 1999-2000 David Symonds [xoxus@usa.net] Copyright (C) 1999,2000 contributors of the QuakeForge project @@ -625,11 +624,12 @@ VID_Init (unsigned char *palette) void VID_Init_Cvars () { - vid_mode = Cvar_Get ("vid_mode", "0", CVAR_NONE, 0, "Sets the video mode"); - vid_redrawfull = Cvar_Get ("vid_redrawfull", "0", CVAR_NONE, 0, + vid_mode = Cvar_Get ("vid_mode", "0", CVAR_NONE, NULL, + "Sets the video mode"); + vid_redrawfull = Cvar_Get ("vid_redrawfull", "0", CVAR_NONE, NULL, "Redraw entire screen each frame instead of just dirty areas"); - vid_waitforrefresh = Cvar_Get ("vid_waitforrefresh", "0", CVAR_ARCHIVE, 0, - "Wait for vertical retrace before drawing next frame"); + vid_waitforrefresh = Cvar_Get ("vid_waitforrefresh", "0", CVAR_ARCHIVE, + NULL, "Wait for vertical retrace before drawing next frame"); } diff --git a/qw/source/vid_mgl.c b/qw/source/vid_mgl.c index fe3dc089e..524743a5c 100644 --- a/qw/source/vid_mgl.c +++ b/qw/source/vid_mgl.c @@ -2073,21 +2073,21 @@ VID_Init (unsigned char *palette) void VID_Init_Cvars () { - vid_mode = Cvar_Get ("vid_mode", "0", CVAR_NONE, 0, "Set the video mode"); - vid_nopageflip = Cvar_Get ("vid_nopageflip", "0", CVAR_ARCHIVE, 0, "Toggles the use of page flipping"); + vid_mode = Cvar_Get ("vid_mode", "0", CVAR_NONE, NULL, "Set the video mode"); + vid_nopageflip = Cvar_Get ("vid_nopageflip", "0", CVAR_ARCHIVE, NULL, "Toggles the use of page flipping"); _vid_default_mode_win = - Cvar_Get ("_vid_default_mode_win", "3", CVAR_ARCHIVE, 0, "Default windowed video mode"); - vid_config_x = Cvar_Get ("vid_config_x", "800", CVAR_ARCHIVE, 0, "Maximum x-axis screen size"); - vid_config_y = Cvar_Get ("vid_config_y", "600", CVAR_ARCHIVE, 0, "Maximum y-axis screen size"); - vid_stretch_by_2 = Cvar_Get ("vid_stretch_by_2", "1", CVAR_ARCHIVE, 0, "Stretch the pixles by a two fold to acheive proper view"); - _windowed_mouse = Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, 0, "Have quake grab the mouse from X when you play"); + Cvar_Get ("_vid_default_mode_win", "3", CVAR_ARCHIVE, NULL, "Default windowed video mode"); + vid_config_x = Cvar_Get ("vid_config_x", "800", CVAR_ARCHIVE, NULL, "Maximum x-axis screen size"); + vid_config_y = Cvar_Get ("vid_config_y", "600", CVAR_ARCHIVE, NULL, "Maximum y-axis screen size"); + vid_stretch_by_2 = Cvar_Get ("vid_stretch_by_2", "1", CVAR_ARCHIVE, NULL, "Stretch the pixles by a two fold to acheive proper view"); + _windowed_mouse = Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, NULL, "Have quake grab the mouse from X when you play"); vid_fullscreen_mode = - Cvar_Get ("vid_fullscreen_mode", "3", CVAR_ARCHIVE, 0, "Set the full screen video mode."); + Cvar_Get ("vid_fullscreen_mode", "3", CVAR_ARCHIVE, NULL, "Set the full screen video mode."); vid_windowed_mode = - Cvar_Get ("vid_windowed_mode", "0", CVAR_ARCHIVE, 0, "Set the windowed video mode"); - block_switch = Cvar_Get ("block_switch", "0", CVAR_ARCHIVE, 0, "If set, won't allow you to task switch while playing"); - vid_window_x = Cvar_Get ("vid_window_x", "0", CVAR_ARCHIVE, 0, "The x-axis location of the window, if windowed"); - vid_window_y = Cvar_Get ("vid_window_y", "0", CVAR_ARCHIVE, 0, "The y-axis location of the window, if windowed"); + Cvar_Get ("vid_windowed_mode", "0", CVAR_ARCHIVE, NULL, "Set the windowed video mode"); + block_switch = Cvar_Get ("block_switch", "0", CVAR_ARCHIVE, NULL, "If set, won't allow you to task switch while playing"); + vid_window_x = Cvar_Get ("vid_window_x", "0", CVAR_ARCHIVE, NULL, "The x-axis location of the window, if windowed"); + vid_window_y = Cvar_Get ("vid_window_y", "0", CVAR_ARCHIVE, NULL, "The y-axis location of the window, if windowed"); } diff --git a/qw/source/vid_sdl.c b/qw/source/vid_sdl.c index 6fe28d812..ba49f3fd7 100644 --- a/qw/source/vid_sdl.c +++ b/qw/source/vid_sdl.c @@ -195,7 +195,7 @@ void VID_Init_Cvars () { vid_fullscreen = - Cvar_Get ("vid_fullscreen", "0", CVAR_ROM, 0, + Cvar_Get ("vid_fullscreen", "0", CVAR_ROM, NULL, "Toggles fullscreen game mode"); } diff --git a/qw/source/vid_sgl.c b/qw/source/vid_sgl.c index 4e7fb00a8..93195860b 100644 --- a/qw/source/vid_sgl.c +++ b/qw/source/vid_sgl.c @@ -228,7 +228,8 @@ VID_Init (unsigned char *palette) void VID_Init_Cvars () { - vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_ROM, 0, "Toggles fullscreen mode"); + vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_ROM, NULL, + "Toggles fullscreen mode"); } void diff --git a/qw/source/vid_svgalib.c b/qw/source/vid_svgalib.c index 0029c3c90..f0ed310e6 100644 --- a/qw/source/vid_svgalib.c +++ b/qw/source/vid_svgalib.c @@ -4,7 +4,6 @@ Linux SVGALib video routines Copyright (C) 1996-1997 Id Software, Inc. - Copyright (C) 1999-2000 Nelson Rush. Copyright (C) 1999-2000 Marcus Sundberg [mackan@stacken.kth.se] Copyright (C) 1999-2000 David Symonds [xoxus@usa.net] Copyright (C) 1999,2000 contributors of the QuakeForge project @@ -610,10 +609,12 @@ VID_Init (unsigned char *palette) void VID_Init_Cvars () { - vid_mode = Cvar_Get ("vid_mode", "5", CVAR_NONE, 0, "Sets the video mode"); - vid_redrawfull = Cvar_Get ("vid_redrawfull", "0", CVAR_NONE, 0, "Redraw entire screen each frame instead of just dirty areas"); - vid_waitforrefresh = Cvar_Get ("vid_waitforrefresh", "0", - CVAR_ARCHIVE, 0, "Wait for vertical retrace before drawing next frame"); + vid_mode = Cvar_Get ("vid_mode", "5", CVAR_NONE, NULL, + "Sets the video mode"); + vid_redrawfull = Cvar_Get ("vid_redrawfull", "0", CVAR_NONE, NULL, + "Redraw entire screen each frame instead of just dirty areas"); + vid_waitforrefresh = Cvar_Get ("vid_waitforrefresh", "0", CVAR_ARCHIVE, + NULL, "Wait for vertical retrace before drawing next frame"); } diff --git a/qw/source/vid_wgl.c b/qw/source/vid_wgl.c index 0f719807e..c7252db86 100644 --- a/qw/source/vid_wgl.c +++ b/qw/source/vid_wgl.c @@ -1391,7 +1391,8 @@ VID_Init8bitPalette (void) GLubyte *oldPalette, *newPalette; vid_use8bit = - Cvar_Get ("vid_use8bit", "0", CVAR_ROM, 0, "Use 8-bit shared palettes."); + Cvar_Get ("vid_use8bit", "0", CVAR_ROM, NULL, + "Use 8-bit shared palettes."); if (!vid_use8bit->int_val) return; @@ -1662,7 +1663,8 @@ VID_Init (unsigned char *palette) void VID_Init_Cvars () { - _windowed_mouse = Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, 0, "Grab the mouse from X while playing quake"); + _windowed_mouse = Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, NULL, + "Grab the mouse from X while playing quake"); }