]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Merge branch 'master' into Mario/wrath-darkplaces_extra
authorCloudwalk <cloudwalk009@gmail.com>
Fri, 18 Dec 2020 00:18:31 +0000 (19:18 -0500)
committerCloudwalk <cloudwalk009@gmail.com>
Fri, 18 Dec 2020 00:18:31 +0000 (19:18 -0500)
30 files changed:
1  2 
cl_input.c
cl_parse.c
cl_particles.c
cl_screen.c
client.h
clvm_cmds.c
cmd.c
com_game.c
common.h
draw.h
fs.c
fs.h
gl_draw.c
gl_rmain.c
keys.c
makefile.inc
menu.c
mvm_cmds.c
nodegraph.c
nodegraph.h
prvm_cmds.c
prvm_cmds.h
prvm_offsets.h
screen.h
sv_main.c
sv_move.c
sv_phys.c
svvm_cmds.c
vid_shared.c
view.c

diff --cc cl_input.c
index 7aabb7cf9e3d170ae83ba19628c37ae76d79dcd2,a75495cf46ab6f2f2d95cd586139b84b28ce89f4..6d864586d9d7ab7d2aa0ffab51f01e09a73e281f
@@@ -1312,21 -1326,8 +1326,9 @@@ static void CL_ClientMovement_Physics_W
        vec3_t wishdir;
        vec3_t yawangles;
        trace_t trace;
-       qboolean moving;
++      qbool moving;
  
-       // jump if on ground with jump button pressed but only if it has been
-       // released at least once since the last jump
-       if (s->cmd.jump)
-       {
-               if (s->onground && (s->cmd.canjump || !cl_movement_track_canjump.integer))
-               {
-                       s->velocity[2] += cl.movevars_jumpvelocity;
-                       s->onground = false;
-                       s->cmd.canjump = false;
-               }
-       }
-       else
-               s->cmd.canjump = true;
+       CL_ClientMovement_Physics_CheckJump(s);
  
        // calculate movement vector
        VectorSet(yawangles, 0, s->cmd.viewangles[1], 0);
diff --cc cl_parse.c
index 394c20f2d4e9dd6ccc13ec437f8cc34ef3e7108b,3d5274d232ae375e0b6b6b33ebef45efb2cd22ec..f6917207f2dce2fbad371451399234ba0d659fa3
@@@ -1659,19 -1657,8 +1659,19 @@@ static void CL_SignonReply (void
                S_PurgeUnused();
  
                Con_ClearNotify();
-               if (COM_CheckParm("-profilegameonly"))
+               if (Sys_CheckParm("-profilegameonly"))
                        Sys_AllowProfiling(true);
 +              
 +              if (gamemode == GAME_WRATH)
 +              {
 +                      // HACK: pause the game and display "loading ended, press any key" screen
 +                      SCR_ClearLoadingScreen(false);
 +                      if (cl.islocalgame)
 +                      {
 +                              SCR_PushLoadingScreen("$", 1);
 +                              sv.paused = true;
 +                      }
 +              }
                break;
        }
  }
diff --cc cl_particles.c
Simple merge
diff --cc cl_screen.c
index 2d4d0cd411c25a0a5ad4e48fce87b86960403013,5b97ccb6c1786cad9d98707ed371aa2ce3155e60..0b31a82a27ee645a66b148b252bb7d4339f11cd5
  // we have to include snd_main.h here only to get access to snd_renderbuffer->format.speed when writing the AVI headers
  #include "snd_main.h"
  
- cvar_t scr_viewsize = {CVAR_CLIENT | CVAR_SAVE, "viewsize","100", "how large the view should be, 110 disables inventory bar, 120 disables status bar"};
- cvar_t scr_fov = {CVAR_CLIENT | CVAR_SAVE, "fov","90", "field of vision, 1-170 degrees, default 90, some players use 110-130"};
- cvar_t scr_conalpha = {CVAR_CLIENT | CVAR_SAVE, "scr_conalpha", "1", "opacity of console background gfx/conback"};
- cvar_t scr_conalphafactor = {CVAR_CLIENT | CVAR_SAVE, "scr_conalphafactor", "1", "opacity of console background gfx/conback relative to scr_conalpha; when 0, gfx/conback is not drawn"};
- cvar_t scr_conalpha2factor = {CVAR_CLIENT | CVAR_SAVE, "scr_conalpha2factor", "0", "opacity of console background gfx/conback2 relative to scr_conalpha; when 0, gfx/conback2 is not drawn"};
- cvar_t scr_conalpha3factor = {CVAR_CLIENT | CVAR_SAVE, "scr_conalpha3factor", "0", "opacity of console background gfx/conback3 relative to scr_conalpha; when 0, gfx/conback3 is not drawn"};
- cvar_t scr_conbrightness = {CVAR_CLIENT | CVAR_SAVE, "scr_conbrightness", "1", "brightness of console background (0 = black, 1 = image)"};
- cvar_t scr_conforcewhiledisconnected = {CVAR_CLIENT, "scr_conforcewhiledisconnected", "1", "forces fullscreen console while disconnected"};
- cvar_t scr_conscroll_x = {CVAR_CLIENT | CVAR_SAVE, "scr_conscroll_x", "0", "scroll speed of gfx/conback in x direction"};
- cvar_t scr_conscroll_y = {CVAR_CLIENT | CVAR_SAVE, "scr_conscroll_y", "0", "scroll speed of gfx/conback in y direction"};
- cvar_t scr_conscroll2_x = {CVAR_CLIENT | CVAR_SAVE, "scr_conscroll2_x", "0", "scroll speed of gfx/conback2 in x direction"};
- cvar_t scr_conscroll2_y = {CVAR_CLIENT | CVAR_SAVE, "scr_conscroll2_y", "0", "scroll speed of gfx/conback2 in y direction"};
- cvar_t scr_conscroll3_x = {CVAR_CLIENT | CVAR_SAVE, "scr_conscroll3_x", "0", "scroll speed of gfx/conback3 in x direction"};
- cvar_t scr_conscroll3_y = {CVAR_CLIENT | CVAR_SAVE, "scr_conscroll3_y", "0", "scroll speed of gfx/conback3 in y direction"};
+ cvar_t scr_viewsize = {CF_CLIENT | CF_ARCHIVE, "viewsize","100", "how large the view should be, 110 disables inventory bar, 120 disables status bar"};
+ cvar_t scr_fov = {CF_CLIENT | CF_ARCHIVE, "fov","90", "field of vision, 1-170 degrees, default 90, some players use 110-130"};
+ cvar_t scr_conalpha = {CF_CLIENT | CF_ARCHIVE, "scr_conalpha", "1", "opacity of console background gfx/conback"};
+ cvar_t scr_conalphafactor = {CF_CLIENT | CF_ARCHIVE, "scr_conalphafactor", "1", "opacity of console background gfx/conback relative to scr_conalpha; when 0, gfx/conback is not drawn"};
+ cvar_t scr_conalpha2factor = {CF_CLIENT | CF_ARCHIVE, "scr_conalpha2factor", "0", "opacity of console background gfx/conback2 relative to scr_conalpha; when 0, gfx/conback2 is not drawn"};
+ cvar_t scr_conalpha3factor = {CF_CLIENT | CF_ARCHIVE, "scr_conalpha3factor", "0", "opacity of console background gfx/conback3 relative to scr_conalpha; when 0, gfx/conback3 is not drawn"};
+ cvar_t scr_conbrightness = {CF_CLIENT | CF_ARCHIVE, "scr_conbrightness", "1", "brightness of console background (0 = black, 1 = image)"};
+ cvar_t scr_conforcewhiledisconnected = {CF_CLIENT, "scr_conforcewhiledisconnected", "1", "forces fullscreen console while disconnected"};
+ cvar_t scr_conscroll_x = {CF_CLIENT | CF_ARCHIVE, "scr_conscroll_x", "0", "scroll speed of gfx/conback in x direction"};
+ cvar_t scr_conscroll_y = {CF_CLIENT | CF_ARCHIVE, "scr_conscroll_y", "0", "scroll speed of gfx/conback in y direction"};
+ cvar_t scr_conscroll2_x = {CF_CLIENT | CF_ARCHIVE, "scr_conscroll2_x", "0", "scroll speed of gfx/conback2 in x direction"};
+ cvar_t scr_conscroll2_y = {CF_CLIENT | CF_ARCHIVE, "scr_conscroll2_y", "0", "scroll speed of gfx/conback2 in y direction"};
+ cvar_t scr_conscroll3_x = {CF_CLIENT | CF_ARCHIVE, "scr_conscroll3_x", "0", "scroll speed of gfx/conback3 in x direction"};
+ cvar_t scr_conscroll3_y = {CF_CLIENT | CF_ARCHIVE, "scr_conscroll3_y", "0", "scroll speed of gfx/conback3 in y direction"};
  #ifdef CONFIG_MENU
- cvar_t scr_menuforcewhiledisconnected = {CVAR_CLIENT, "scr_menuforcewhiledisconnected", "0", "forces menu while disconnected"};
+ cvar_t scr_menuforcewhiledisconnected = {CF_CLIENT, "scr_menuforcewhiledisconnected", "0", "forces menu while disconnected"};
  #endif
- cvar_t scr_centertime = {CVAR_CLIENT, "scr_centertime","2", "how long centerprint messages show"};
- cvar_t scr_showram = {CVAR_CLIENT | CVAR_SAVE, "showram","1", "show ram icon if low on surface cache memory (not used)"};
- cvar_t scr_showturtle = {CVAR_CLIENT | CVAR_SAVE, "showturtle","0", "show turtle icon when framerate is too low"};
- cvar_t scr_showpause = {CVAR_CLIENT | CVAR_SAVE, "showpause","1", "show pause icon when game is paused"};
- cvar_t scr_showbrand = {CVAR_CLIENT, "showbrand","0", "shows gfx/brand.tga in a corner of the screen (different values select different positions, including centered)"};
- cvar_t scr_printspeed = {CVAR_CLIENT, "scr_printspeed","0", "speed of intermission printing (episode end texts), a value of 0 disables the slow printing"};
- cvar_t scr_loadingscreen_background = {CVAR_CLIENT, "scr_loadingscreen_background","0", "show the last visible background during loading screen (costs one screenful of video memory)"};
- cvar_t scr_loadingscreen_scale = {CVAR_CLIENT, "scr_loadingscreen_scale","1", "scale factor of the background"};
- cvar_t scr_loadingscreen_scale_base = {CVAR_CLIENT, "scr_loadingscreen_scale_base","0", "0 = console pixels, 1 = video pixels"};
- cvar_t scr_loadingscreen_scale_limit = {CVAR_CLIENT, "scr_loadingscreen_scale_limit","0", "0 = no limit, 1 = until first edge hits screen edge, 2 = until last edge hits screen edge, 3 = until width hits screen width, 4 = until height hits screen height"};
- cvar_t scr_loadingscreen_picture = {CVAR_CLIENT, "scr_loadingscreen_picture", "gfx/loading", "picture shown during loading"};
- cvar_t scr_loadingscreen_count = {CVAR_CLIENT, "scr_loadingscreen_count","1", "number of loading screen files to use randomly (named loading.tga, loading2.tga, loading3.tga, ...)"};
- cvar_t scr_loadingscreen_firstforstartup = {CVAR_CLIENT, "scr_loadingscreen_firstforstartup","0", "remove loading.tga from random scr_loadingscreen_count selection and only display it on client startup, 0 = normal, 1 = firstforstartup"};
- cvar_t scr_loadingscreen_barcolor = {CVAR_CLIENT, "scr_loadingscreen_barcolor", "0 0 1", "rgb color of loadingscreen progress bar"};
- cvar_t scr_loadingscreen_barheight = {CVAR_CLIENT, "scr_loadingscreen_barheight", "8", "the height of the loadingscreen progress bar"};
- cvar_t scr_loadingscreen_maxfps = {CVAR_CLIENT, "scr_loadingscreen_maxfps", "10", "restrict maximal FPS for loading screen so it will not update very often (this will make lesser loading times on a maps loading large number of models)"};
- cvar_t scr_infobar_height = {CVAR_CLIENT, "scr_infobar_height", "8", "the height of the infobar items"};
- cvar_t vid_conwidthauto = {CVAR_CLIENT | CVAR_SAVE, "vid_conwidthauto", "1", "automatically update vid_conwidth to match aspect ratio"};
- cvar_t vid_conwidth = {CVAR_CLIENT | CVAR_SAVE, "vid_conwidth", "640", "virtual width of 2D graphics system (note: changes may be overwritten, see vid_conwidthauto)"};
- cvar_t vid_conheight = {CVAR_CLIENT | CVAR_SAVE, "vid_conheight", "480", "virtual height of 2D graphics system"};
- cvar_t vid_pixelheight = {CVAR_CLIENT | CVAR_SAVE, "vid_pixelheight", "1", "adjusts vertical field of vision to account for non-square pixels (1280x1024 on a CRT monitor for example)"};
- cvar_t scr_aspectname = {CVAR_CLIENT, "scr_aspectname", "16-9", "string name for the current aspect ratio; use a dash instead of a colon, e. g. 16-9"};
- cvar_t scr_screenshot_jpeg = {CVAR_CLIENT | CVAR_SAVE, "scr_screenshot_jpeg","1", "save jpeg instead of targa"};
- cvar_t scr_screenshot_jpeg_quality = {CVAR_CLIENT | CVAR_SAVE, "scr_screenshot_jpeg_quality","0.9", "image quality of saved jpeg"};
- cvar_t scr_screenshot_png = {CVAR_CLIENT | CVAR_SAVE, "scr_screenshot_png","0", "save png instead of targa"};
- cvar_t scr_screenshot_gammaboost = {CVAR_CLIENT | CVAR_SAVE, "scr_screenshot_gammaboost","1", "gamma correction on saved screenshots and videos, 1.0 saves unmodified images"};
- cvar_t scr_screenshot_alpha = {CVAR_CLIENT, "scr_screenshot_alpha","0", "try to write an alpha channel to screenshots (debugging feature)"};
- cvar_t scr_screenshot_timestamp = {CVAR_CLIENT | CVAR_SAVE, "scr_screenshot_timestamp", "1", "use a timestamp based number of the type YYYYMMDDHHMMSSsss instead of sequential numbering"};
+ cvar_t scr_centertime = {CF_CLIENT, "scr_centertime","2", "how long centerprint messages show"};
+ cvar_t scr_showram = {CF_CLIENT | CF_ARCHIVE, "showram","1", "show ram icon if low on surface cache memory (not used)"};
+ cvar_t scr_showturtle = {CF_CLIENT | CF_ARCHIVE, "showturtle","0", "show turtle icon when framerate is too low"};
+ cvar_t scr_showpause = {CF_CLIENT | CF_ARCHIVE, "showpause","1", "show pause icon when game is paused"};
+ cvar_t scr_showbrand = {CF_CLIENT, "showbrand","0", "shows gfx/brand.tga in a corner of the screen (different values select different positions, including centered)"};
+ cvar_t scr_printspeed = {CF_CLIENT, "scr_printspeed","0", "speed of intermission printing (episode end texts), a value of 0 disables the slow printing"};
+ cvar_t scr_loadingscreen_background = {CF_CLIENT, "scr_loadingscreen_background","0", "show the last visible background during loading screen (costs one screenful of video memory)"};
+ cvar_t scr_loadingscreen_scale = {CF_CLIENT, "scr_loadingscreen_scale","1", "scale factor of the background"};
+ cvar_t scr_loadingscreen_scale_base = {CF_CLIENT, "scr_loadingscreen_scale_base","0", "0 = console pixels, 1 = video pixels"};
+ cvar_t scr_loadingscreen_scale_limit = {CF_CLIENT, "scr_loadingscreen_scale_limit","0", "0 = no limit, 1 = until first edge hits screen edge, 2 = until last edge hits screen edge, 3 = until width hits screen width, 4 = until height hits screen height"};
+ cvar_t scr_loadingscreen_picture = {CF_CLIENT, "scr_loadingscreen_picture", "gfx/loading", "picture shown during loading"};
+ cvar_t scr_loadingscreen_count = {CF_CLIENT, "scr_loadingscreen_count","1", "number of loading screen files to use randomly (named loading.tga, loading2.tga, loading3.tga, ...)"};
+ cvar_t scr_loadingscreen_firstforstartup = {CF_CLIENT, "scr_loadingscreen_firstforstartup","0", "remove loading.tga from random scr_loadingscreen_count selection and only display it on client startup, 0 = normal, 1 = firstforstartup"};
+ cvar_t scr_loadingscreen_barcolor = {CF_CLIENT, "scr_loadingscreen_barcolor", "0 0 1", "rgb color of loadingscreen progress bar"};
+ cvar_t scr_loadingscreen_barheight = {CF_CLIENT, "scr_loadingscreen_barheight", "8", "the height of the loadingscreen progress bar"};
+ cvar_t scr_loadingscreen_maxfps = {CF_CLIENT, "scr_loadingscreen_maxfps", "10", "restrict maximal FPS for loading screen so it will not update very often (this will make lesser loading times on a maps loading large number of models)"};
+ cvar_t scr_infobar_height = {CF_CLIENT, "scr_infobar_height", "8", "the height of the infobar items"};
+ cvar_t vid_conwidthauto = {CF_CLIENT | CF_ARCHIVE, "vid_conwidthauto", "1", "automatically update vid_conwidth to match aspect ratio"};
+ cvar_t vid_conwidth = {CF_CLIENT | CF_ARCHIVE, "vid_conwidth", "640", "virtual width of 2D graphics system (note: changes may be overwritten, see vid_conwidthauto)"};
+ cvar_t vid_conheight = {CF_CLIENT | CF_ARCHIVE, "vid_conheight", "480", "virtual height of 2D graphics system"};
+ cvar_t vid_pixelheight = {CF_CLIENT | CF_ARCHIVE, "vid_pixelheight", "1", "adjusts vertical field of vision to account for non-square pixels (1280x1024 on a CRT monitor for example)"};
++cvar_t scr_aspectname = {CF_CLIENT, "scr_aspectname", "16-9", "string name for the current aspect ratio; use a dash instead of a colon, e. g. 16-9"};
+ cvar_t scr_screenshot_jpeg = {CF_CLIENT | CF_ARCHIVE, "scr_screenshot_jpeg","1", "save jpeg instead of targa"};
+ cvar_t scr_screenshot_jpeg_quality = {CF_CLIENT | CF_ARCHIVE, "scr_screenshot_jpeg_quality","0.9", "image quality of saved jpeg"};
+ cvar_t scr_screenshot_png = {CF_CLIENT | CF_ARCHIVE, "scr_screenshot_png","0", "save png instead of targa"};
+ cvar_t scr_screenshot_gammaboost = {CF_CLIENT | CF_ARCHIVE, "scr_screenshot_gammaboost","1", "gamma correction on saved screenshots and videos, 1.0 saves unmodified images"};
+ cvar_t scr_screenshot_alpha = {CF_CLIENT, "scr_screenshot_alpha","0", "try to write an alpha channel to screenshots (debugging feature)"};
+ cvar_t scr_screenshot_timestamp = {CF_CLIENT | CF_ARCHIVE, "scr_screenshot_timestamp", "1", "use a timestamp based number of the type YYYYMMDDHHMMSSsss instead of sequential numbering"};
  // scr_screenshot_name is defined in fs.c
  #ifdef CONFIG_VIDEO_CAPTURE
- cvar_t cl_capturevideo = {CVAR_CLIENT, "cl_capturevideo", "0", "enables saving of video to a .avi file using uncompressed I420 colorspace and PCM audio, note that scr_screenshot_gammaboost affects the brightness of the output)"};
- cvar_t cl_capturevideo_demo_stop = {CVAR_CLIENT | CVAR_SAVE, "cl_capturevideo_demo_stop", "1", "automatically stops video recording when demo ends"};
- cvar_t cl_capturevideo_printfps = {CVAR_CLIENT | CVAR_SAVE, "cl_capturevideo_printfps", "1", "prints the frames per second captured in capturevideo (is only written to the log file, not to the console, as that would be visible on the video)"};
- cvar_t cl_capturevideo_width = {CVAR_CLIENT | CVAR_SAVE, "cl_capturevideo_width", "0", "scales all frames to this resolution before saving the video"};
- cvar_t cl_capturevideo_height = {CVAR_CLIENT | CVAR_SAVE, "cl_capturevideo_height", "0", "scales all frames to this resolution before saving the video"};
- cvar_t cl_capturevideo_realtime = {CVAR_CLIENT, "cl_capturevideo_realtime", "0", "causes video saving to operate in realtime (mostly useful while playing, not while capturing demos), this can produce a much lower quality video due to poor sound/video sync and will abort saving if your machine stalls for over a minute"};
- cvar_t cl_capturevideo_fps = {CVAR_CLIENT | CVAR_SAVE, "cl_capturevideo_fps", "30", "how many frames per second to save (29.97 for NTSC, 30 for typical PC video, 15 can be useful)"};
- cvar_t cl_capturevideo_nameformat = {CVAR_CLIENT | CVAR_SAVE, "cl_capturevideo_nameformat", "dpvideo", "prefix for saved videos (the date is encoded using strftime escapes)"};
- cvar_t cl_capturevideo_number = {CVAR_CLIENT | CVAR_SAVE, "cl_capturevideo_number", "1", "number to append to video filename, incremented each time a capture begins"};
- cvar_t cl_capturevideo_ogg = {CVAR_CLIENT | CVAR_SAVE, "cl_capturevideo_ogg", "1", "save captured video data as Ogg/Vorbis/Theora streams"};
- cvar_t cl_capturevideo_framestep = {CVAR_CLIENT | CVAR_SAVE, "cl_capturevideo_framestep", "1", "when set to n >= 1, render n frames to capture one (useful for motion blur like effects)"};
+ cvar_t cl_capturevideo = {CF_CLIENT, "cl_capturevideo", "0", "enables saving of video to a .avi file using uncompressed I420 colorspace and PCM audio, note that scr_screenshot_gammaboost affects the brightness of the output)"};
+ cvar_t cl_capturevideo_demo_stop = {CF_CLIENT | CF_ARCHIVE, "cl_capturevideo_demo_stop", "1", "automatically stops video recording when demo ends"};
+ cvar_t cl_capturevideo_printfps = {CF_CLIENT | CF_ARCHIVE, "cl_capturevideo_printfps", "1", "prints the frames per second captured in capturevideo (is only written to the log file, not to the console, as that would be visible on the video)"};
+ cvar_t cl_capturevideo_width = {CF_CLIENT | CF_ARCHIVE, "cl_capturevideo_width", "0", "scales all frames to this resolution before saving the video"};
+ cvar_t cl_capturevideo_height = {CF_CLIENT | CF_ARCHIVE, "cl_capturevideo_height", "0", "scales all frames to this resolution before saving the video"};
+ cvar_t cl_capturevideo_realtime = {CF_CLIENT, "cl_capturevideo_realtime", "0", "causes video saving to operate in realtime (mostly useful while playing, not while capturing demos), this can produce a much lower quality video due to poor sound/video sync and will abort saving if your machine stalls for over a minute"};
+ cvar_t cl_capturevideo_fps = {CF_CLIENT | CF_ARCHIVE, "cl_capturevideo_fps", "30", "how many frames per second to save (29.97 for NTSC, 30 for typical PC video, 15 can be useful)"};
+ cvar_t cl_capturevideo_nameformat = {CF_CLIENT | CF_ARCHIVE, "cl_capturevideo_nameformat", "dpvideo", "prefix for saved videos (the date is encoded using strftime escapes)"};
+ cvar_t cl_capturevideo_number = {CF_CLIENT | CF_ARCHIVE, "cl_capturevideo_number", "1", "number to append to video filename, incremented each time a capture begins"};
+ cvar_t cl_capturevideo_ogg = {CF_CLIENT | CF_ARCHIVE, "cl_capturevideo_ogg", "1", "save captured video data as Ogg/Vorbis/Theora streams"};
+ cvar_t cl_capturevideo_framestep = {CF_CLIENT | CF_ARCHIVE, "cl_capturevideo_framestep", "1", "when set to n >= 1, render n frames to capture one (useful for motion blur like effects)"};
  #endif
- cvar_t r_letterbox = {CVAR_CLIENT, "r_letterbox", "0", "reduces vertical height of view to simulate a letterboxed movie effect (can be used by mods for cutscenes)"};
- cvar_t r_stereo_separation = {CVAR_CLIENT, "r_stereo_separation", "4", "separation distance of eyes in the world (negative values are only useful for cross-eyed viewing)"};
- cvar_t r_stereo_sidebyside = {CVAR_CLIENT, "r_stereo_sidebyside", "0", "side by side views for those who can't afford glasses but can afford eye strain (note: use a negative r_stereo_separation if you want cross-eyed viewing)"};
- cvar_t r_stereo_horizontal = {CVAR_CLIENT, "r_stereo_horizontal", "0", "aspect skewed side by side view for special decoder/display hardware"};
- cvar_t r_stereo_vertical = {CVAR_CLIENT, "r_stereo_vertical", "0", "aspect skewed top and bottom view for special decoder/display hardware"};
- cvar_t r_stereo_redblue = {CVAR_CLIENT, "r_stereo_redblue", "0", "red/blue anaglyph stereo glasses (note: most of these glasses are actually red/cyan, try that one too)"};
- cvar_t r_stereo_redcyan = {CVAR_CLIENT, "r_stereo_redcyan", "0", "red/cyan anaglyph stereo glasses, the kind given away at drive-in movies like Creature From The Black Lagoon In 3D"};
- cvar_t r_stereo_redgreen = {CVAR_CLIENT, "r_stereo_redgreen", "0", "red/green anaglyph stereo glasses (for those who don't mind yellow)"};
- cvar_t r_stereo_angle = {CVAR_CLIENT, "r_stereo_angle", "0", "separation angle of eyes (makes the views look different directions, as an example, 90 gives a 90 degree separation where the views are 45 degrees left and 45 degrees right)"};
- cvar_t scr_stipple = {CVAR_CLIENT, "scr_stipple", "0", "interlacing-like stippling of the display"};
- cvar_t scr_refresh = {CVAR_CLIENT, "scr_refresh", "1", "allows you to completely shut off rendering for benchmarking purposes"};
- cvar_t scr_screenshot_name_in_mapdir = {CVAR_CLIENT | CVAR_SAVE, "scr_screenshot_name_in_mapdir", "0", "if set to 1, screenshots are placed in a subdirectory named like the map they are from"};
- cvar_t net_graph = {CVAR_CLIENT | CVAR_SAVE, "net_graph", "0", "shows a graph of packet sizes and other information, 0 = off, 1 = show client netgraph, 2 = show client and server netgraphs (when hosting a server)"};
- cvar_t cl_demo_mousegrab = {CVAR_CLIENT, "cl_demo_mousegrab", "0", "Allows reading the mouse input while playing demos. Useful for camera mods developed in csqc. (0: never, 1: always)"};
- cvar_t timedemo_screenshotframelist = {CVAR_CLIENT, "timedemo_screenshotframelist", "", "when performing a timedemo, take screenshots of each frame in this space-separated list - example: 1 201 401"};
- cvar_t vid_touchscreen_outlinealpha = {CVAR_CLIENT, "vid_touchscreen_outlinealpha", "0", "opacity of touchscreen area outlines"};
- cvar_t vid_touchscreen_overlayalpha = {CVAR_CLIENT, "vid_touchscreen_overlayalpha", "0.25", "opacity of touchscreen area icons"};
- cvar_t r_speeds_graph = {CVAR_CLIENT | CVAR_SAVE, "r_speeds_graph", "0", "display a graph of renderer statistics "};
- cvar_t r_speeds_graph_filter[8] =
- {
-       {CVAR_CLIENT | CVAR_SAVE, "r_speeds_graph_filter_r", "timedelta", "Red - display the specified renderer statistic"},
-       {CVAR_CLIENT | CVAR_SAVE, "r_speeds_graph_filter_g", "batch_batches", "Green - display the specified renderer statistic"},
-       {CVAR_CLIENT | CVAR_SAVE, "r_speeds_graph_filter_b", "batch_triangles", "Blue - display the specified renderer statistic"},
-       {CVAR_CLIENT | CVAR_SAVE, "r_speeds_graph_filter_y", "fast_triangles", "Yellow - display the specified renderer statistic"},
-       {CVAR_CLIENT | CVAR_SAVE, "r_speeds_graph_filter_c", "copytriangles_triangles", "Cyan - display the specified renderer statistic"},
-       {CVAR_CLIENT | CVAR_SAVE, "r_speeds_graph_filter_m", "dynamic_triangles", "Magenta - display the specified renderer statistic"},
-       {CVAR_CLIENT | CVAR_SAVE, "r_speeds_graph_filter_w", "animcache_shade_vertices", "White - display the specified renderer statistic"},
-       {CVAR_CLIENT | CVAR_SAVE, "r_speeds_graph_filter_o", "animcache_shape_vertices", "Orange - display the specified renderer statistic"},
- };
- cvar_t r_speeds_graph_length = {CVAR_CLIENT | CVAR_SAVE, "r_speeds_graph_length", "1024", "number of frames in statistics graph, can be from 4 to 8192"};
- cvar_t r_speeds_graph_seconds = {CVAR_CLIENT | CVAR_SAVE, "r_speeds_graph_seconds", "2", "number of seconds in graph, can be from 0.1 to 120"};
- cvar_t r_speeds_graph_x = {CVAR_CLIENT | CVAR_SAVE, "r_speeds_graph_x", "0", "position of graph"};
- cvar_t r_speeds_graph_y = {CVAR_CLIENT | CVAR_SAVE, "r_speeds_graph_y", "0", "position of graph"};
- cvar_t r_speeds_graph_width = {CVAR_CLIENT | CVAR_SAVE, "r_speeds_graph_width", "256", "size of graph"};
- cvar_t r_speeds_graph_height = {CVAR_CLIENT | CVAR_SAVE, "r_speeds_graph_height", "128", "size of graph"};
- cvar_t r_speeds_graph_maxtimedelta = {CVAR_CLIENT | CVAR_SAVE, "r_speeds_graph_maxtimedelta", "16667", "maximum timedelta to display in the graph (this value will be the top line)"};
- cvar_t r_speeds_graph_maxdefault = {CVAR_CLIENT | CVAR_SAVE, "r_speeds_graph_maxdefault", "100", "if the minimum and maximum observed values are closer than this, use this value as the graph range (keeps small numbers from being big graphs)"};
+ cvar_t r_letterbox = {CF_CLIENT, "r_letterbox", "0", "reduces vertical height of view to simulate a letterboxed movie effect (can be used by mods for cutscenes)"};
+ cvar_t r_stereo_separation = {CF_CLIENT, "r_stereo_separation", "4", "separation distance of eyes in the world (negative values are only useful for cross-eyed viewing)"};
+ cvar_t r_stereo_sidebyside = {CF_CLIENT, "r_stereo_sidebyside", "0", "side by side views for those who can't afford glasses but can afford eye strain (note: use a negative r_stereo_separation if you want cross-eyed viewing)"};
+ cvar_t r_stereo_horizontal = {CF_CLIENT, "r_stereo_horizontal", "0", "aspect skewed side by side view for special decoder/display hardware"};
+ cvar_t r_stereo_vertical = {CF_CLIENT, "r_stereo_vertical", "0", "aspect skewed top and bottom view for special decoder/display hardware"};
+ cvar_t r_stereo_redblue = {CF_CLIENT, "r_stereo_redblue", "0", "red/blue anaglyph stereo glasses (note: most of these glasses are actually red/cyan, try that one too)"};
+ cvar_t r_stereo_redcyan = {CF_CLIENT, "r_stereo_redcyan", "0", "red/cyan anaglyph stereo glasses, the kind given away at drive-in movies like Creature From The Black Lagoon In 3D"};
+ cvar_t r_stereo_redgreen = {CF_CLIENT, "r_stereo_redgreen", "0", "red/green anaglyph stereo glasses (for those who don't mind yellow)"};
+ cvar_t r_stereo_angle = {CF_CLIENT, "r_stereo_angle", "0", "separation angle of eyes (makes the views look different directions, as an example, 90 gives a 90 degree separation where the views are 45 degrees left and 45 degrees right)"};
+ cvar_t scr_stipple = {CF_CLIENT, "scr_stipple", "0", "interlacing-like stippling of the display"};
+ cvar_t scr_refresh = {CF_CLIENT, "scr_refresh", "1", "allows you to completely shut off rendering for benchmarking purposes"};
+ cvar_t scr_screenshot_name_in_mapdir = {CF_CLIENT | CF_ARCHIVE, "scr_screenshot_name_in_mapdir", "0", "if set to 1, screenshots are placed in a subdirectory named like the map they are from"};
+ cvar_t net_graph = {CF_CLIENT | CF_ARCHIVE, "net_graph", "0", "shows a graph of packet sizes and other information, 0 = off, 1 = show client netgraph, 2 = show client and server netgraphs (when hosting a server)"};
+ cvar_t cl_demo_mousegrab = {CF_CLIENT, "cl_demo_mousegrab", "0", "Allows reading the mouse input while playing demos. Useful for camera mods developed in csqc. (0: never, 1: always)"};
+ cvar_t timedemo_screenshotframelist = {CF_CLIENT, "timedemo_screenshotframelist", "", "when performing a timedemo, take screenshots of each frame in this space-separated list - example: 1 201 401"};
+ cvar_t vid_touchscreen_outlinealpha = {CF_CLIENT, "vid_touchscreen_outlinealpha", "0", "opacity of touchscreen area outlines"};
+ cvar_t vid_touchscreen_overlayalpha = {CF_CLIENT, "vid_touchscreen_overlayalpha", "0.25", "opacity of touchscreen area icons"};
  
  extern cvar_t sbar_info_pos;
  extern cvar_t r_fog_clear;
@@@ -2478,49 -1959,10 +1963,49 @@@ static void SCR_DrawLoadingStack(void
  }
  
  static cachepic_t *loadingscreenpic;
 +static cachepic_t *loadingscreenind;
  static float loadingscreenpic_vertex3f[12];
  static float loadingscreenpic_texcoord2f[8];
- static qboolean loadingscreenind_show;
 +static float loadingscreenind_vertex3f[12];
 +static float loadingscreenind_texcoord2f[8];
 +static float loadingscreenind_angle;
 +static float loadingscreenind_pos[2];
++static qbool loadingscreenind_show;
 +
 +void SCR_SetLoadingSplash (const char *mapname)
 +{
 +      char vabuf[1024] = { 0 };
 +
 +      if (gamemode != GAME_WRATH)
 +              return; // let god sort em out
 +
 +      // if we're connecting somewhere, the mapname is unknown until the server sends it to us,
 +      // so the pic is set once we get the server info,
 +      // otherwise the appropriate function just calls this with a known mapname.
 +      // to reset to black screen, just call this with NULL mapname
 +
 +      if (mapname && mapname[0]) {
 +              // try the current aspect ratio
 +              dpsnprintf(vabuf, sizeof(vabuf), "gfx/splashes/%s_%s", mapname, scr_aspectname.string);
 +              if (!Draw_PicExists(vabuf)) {
 +                      // try the default aspect ratio (16:9)
 +                      dpsnprintf(vabuf, sizeof(vabuf), "gfx/splashes/%s_16-9", mapname);
 +                      if (!Draw_PicExists(vabuf)) {
 +                              // try without aspect ratio
 +                              dpsnprintf(vabuf, sizeof(vabuf), "gfx/splashes/%s", mapname);
 +                              if (!Draw_PicExists(vabuf))
 +                                      vabuf[0] = 0; // give up
 +                      }
 +              }
 +      }
 +
 +      if (!vabuf[0])
 +              strlcpy(vabuf, "gfx/splashes/_blank", sizeof(vabuf));
 +
 +      Cvar_SetQuick(&scr_loadingscreen_picture, vabuf);
 +}
  
- static void SCR_DrawLoadingScreen_SharedSetup (qboolean clear)
+ static void SCR_DrawLoadingScreen_SharedSetup (qbool clear)
  {
        r_viewport_t viewport;
        float x, y, w, h, sw, sh, f;
@@@ -2750,12 -2148,7 +2235,12 @@@ void SCR_UpdateLoadingScreen (qbool cle
        key_consoleactive = old_key_consoleactive;
  }
  
- qboolean SCR_LoadingScreenWaiting(void)
++qbool SCR_LoadingScreenWaiting(void)
 +{
 +      return cl.islocalgame && (loadingscreenstack && loadingscreenstack->msg[0] == '$' && loadingscreenstack->msg[1] == '\0');
 +}
 +
- qboolean R_Stereo_ColorMasking(void)
+ qbool R_Stereo_ColorMasking(void)
  {
        return r_stereo_redblue.integer || r_stereo_redgreen.integer || r_stereo_redcyan.integer;
  }
diff --cc client.h
index 8fb805a4c10f98890ba2430f34c7a7e38476d3aa,b4e8eb7a3b7df2a167045cd0b21784d5770d89ce..2ac05194a1f698139c94365db2f70bda11f7491a
+++ b/client.h
@@@ -1164,15 -840,14 +840,15 @@@ typedef struct client_state_
        //float crouch;
  
        // sent by server
-       qboolean paused;
-       qboolean onground;
-       qboolean inwater;
+       qbool paused;
+       qbool onground;
+       qbool inwater;
  
        // used by bob
-       qboolean oldonground;
+       qbool oldonground;
        double lastongroundtime;
        double hitgroundtime;
 +      double bobongroundtime;
        float bob2_smooth;
        float bobfall_speed;
        float bobfall_swing;
diff --cc clvm_cmds.c
index 4a2e60cbd6506b440a8a2adc1bedf7a56057e220,c3e9130db6390f588f39efc210036819f2462bac..f1a58dcd19cc178f368d5da8f52ec44fc9d28eed
@@@ -3500,10 -4273,10 +4275,10 @@@ The move will be adjusted for slopes an
  possible, no move is done and false is returned
  =============
  */
- static qboolean CL_movestep (prvm_edict_t *ent, vec3_t move, qboolean relink, qboolean noenemy, qboolean settrace)
+ static qbool CL_movestep (prvm_edict_t *ent, vec3_t move, qbool relink, qbool noenemy, qbool settrace)
  {
        prvm_prog_t *prog = CLVM_prog;
 -      float           dz;
 +      float           dz, stepheight;
        vec3_t          oldorg, neworg, end, traceendpos;
        vec3_t          mins, maxs, start;
        trace_t         trace;
diff --cc cmd.c
Simple merge
diff --cc com_game.c
Simple merge
diff --cc common.h
Simple merge
diff --cc draw.h
index bbb5009c5b28ecc7bd1e19c5c2923e6e9e5b8c7d,e06f19aab7ed03b6a0d7c536fa89526405dfcc39..6f69478e420d5085755c05959b37b8e4fb83aa57
--- 1/draw.h
--- 2/draw.h
+++ b/draw.h
@@@ -47,7 -51,6 +51,7 @@@ cachepic_t *Draw_CachePic (const char *
  cachepic_t *Draw_NewPic(const char *picname, int width, int height, unsigned char *pixels, textype_t textype, int texflags);
  // free the texture memory used by a pic (the cachepic_t itself is eternal)
  void Draw_FreePic(const char *picname);
- qboolean Draw_PicExists(const char *picname);
++qbool Draw_PicExists(const char *picname);
  
  // a triangle mesh..
  // each vertex is 3 floats
diff --cc fs.c
Simple merge
diff --cc fs.h
index 8ddaa76f412f2589438205842b8ce244f6d6fbaf,5977f8c6087a2e968bf6c5db4ef9c2f8db01079e..4bcca8a27277fa18a965997122bdfe35ca792c73
--- 1/fs.h
--- 2/fs.h
+++ b/fs.h
@@@ -79,8 -84,7 +84,8 @@@ fs_offset_t FS_FileSize (qfile_t* file)
  void FS_Purge (qfile_t* file);
  const char *FS_FileWithoutPath (const char *in);
  const char *FS_FileExtension (const char *in);
- int FS_CheckNastyPath (const char *path, qboolean isgamedir);
+ int FS_CheckNastyPath (const char *path, qbool isgamedir);
 +int FS_rmtree(const char *dir);
  
  extern const char *const fs_checkgamedir_missing; // "(missing)"
  const char *FS_CheckGameDir(const char *gamedir); // returns NULL if nasty, fs_checkgamedir_missing (exact pointer) if missing
diff --cc gl_draw.c
index 3a1008859e6656b9cf0f74f5a5fd4d5d143f271e,d625740e48c6996a1fc27ded907866c924fdeb2e..ef7dfa14810a827b9b5b7f49b2c5e23a7a2751e4
+++ b/gl_draw.c
@@@ -323,20 -323,9 +323,20 @@@ void Draw_FreePic(const char *picname
        }
  }
  
- qboolean Draw_PicExists(const char *name) {
++qbool Draw_PicExists(const char *name) {
 +      char vabuf[1024] = { 0 };
 +      const char *checkfmt[] = { "%s.tga", "%s.png", "%s.jpg", "%s.pcx" };
 +      long unsigned int i;
 +      // TODO: actually use the gfx format list for this
 +      for (i = 0; i < sizeof(checkfmt) / sizeof(checkfmt[0]); ++i)
 +              if (FS_FileExists(va(vabuf, sizeof(vabuf), checkfmt[i], name)))
 +                      return true;
 +      return false;
 +}
 +
  static float snap_to_pixel_x(float x, float roundUpAt);
  extern int con_linewidth; // to force rewrapping
- void LoadFont(qboolean override, const char *name, dp_font_t *fnt, float scale, float voffset)
+ void LoadFont(qbool override, const char *name, dp_font_t *fnt, float scale, float voffset)
  {
        int i, ch;
        float maxwidth;
diff --cc gl_rmain.c
index c393f69bf3f9c217396dab32bd80ce29ddc62606,e348e3e9427b4229ed84b7b51bf90f563cec5a16..ac5a8c6b408f3f4cf52d849d9967ebe12b5e0cfc
@@@ -56,210 -56,213 +56,214 @@@ static qbool r_gpuskeletal
  //
  r_refdef_t r_refdef;
  
- cvar_t r_motionblur = {CVAR_CLIENT | CVAR_SAVE, "r_motionblur", "0", "screen motionblur - value represents intensity, somewhere around 0.5 recommended - NOTE: bad performance on multi-gpu!"};
- cvar_t r_damageblur = {CVAR_CLIENT | CVAR_SAVE, "r_damageblur", "0", "screen motionblur based on damage - value represents intensity, somewhere around 0.5 recommended - NOTE: bad performance on multi-gpu!"};
- cvar_t r_motionblur_averaging = {CVAR_CLIENT | CVAR_SAVE, "r_motionblur_averaging", "0.1", "sliding average reaction time for velocity (higher = slower adaption to change)"};
- cvar_t r_motionblur_randomize = {CVAR_CLIENT | CVAR_SAVE, "r_motionblur_randomize", "0.1", "randomizing coefficient to workaround ghosting"};
- cvar_t r_motionblur_minblur = {CVAR_CLIENT | CVAR_SAVE, "r_motionblur_minblur", "0.5", "factor of blur to apply at all times (always have this amount of blur no matter what the other factors are)"};
- cvar_t r_motionblur_maxblur = {CVAR_CLIENT | CVAR_SAVE, "r_motionblur_maxblur", "0.9", "maxmimum amount of blur"};
- cvar_t r_motionblur_velocityfactor = {CVAR_CLIENT | CVAR_SAVE, "r_motionblur_velocityfactor", "1", "factoring in of player velocity to the blur equation - the faster the player moves around the map, the more blur they get"};
- cvar_t r_motionblur_velocityfactor_minspeed = {CVAR_CLIENT | CVAR_SAVE, "r_motionblur_velocityfactor_minspeed", "400", "lower value of velocity when it starts to factor into blur equation"};
- cvar_t r_motionblur_velocityfactor_maxspeed = {CVAR_CLIENT | CVAR_SAVE, "r_motionblur_velocityfactor_maxspeed", "800", "upper value of velocity when it reaches the peak factor into blur equation"};
- cvar_t r_motionblur_mousefactor = {CVAR_CLIENT | CVAR_SAVE, "r_motionblur_mousefactor", "2", "factoring in of mouse acceleration to the blur equation - the faster the player turns their mouse, the more blur they get"};
- cvar_t r_motionblur_mousefactor_minspeed = {CVAR_CLIENT | CVAR_SAVE, "r_motionblur_mousefactor_minspeed", "0", "lower value of mouse acceleration when it starts to factor into blur equation"};
- cvar_t r_motionblur_mousefactor_maxspeed = {CVAR_CLIENT | CVAR_SAVE, "r_motionblur_mousefactor_maxspeed", "50", "upper value of mouse acceleration when it reaches the peak factor into blur equation"};
- cvar_t r_depthfirst = {CVAR_CLIENT | CVAR_SAVE, "r_depthfirst", "0", "renders a depth-only version of the scene before normal rendering begins to eliminate overdraw, values: 0 = off, 1 = world depth, 2 = world and model depth"};
- cvar_t r_useinfinitefarclip = {CVAR_CLIENT | CVAR_SAVE, "r_useinfinitefarclip", "1", "enables use of a special kind of projection matrix that has an extremely large farclip"};
- cvar_t r_farclip_base = {CVAR_CLIENT, "r_farclip_base", "65536", "farclip (furthest visible distance) for rendering when r_useinfinitefarclip is 0"};
- cvar_t r_farclip_world = {CVAR_CLIENT, "r_farclip_world", "2", "adds map size to farclip multiplied by this value"};
- cvar_t r_nearclip = {CVAR_CLIENT, "r_nearclip", "1", "distance from camera of nearclip plane" };
- cvar_t r_deformvertexes = {CVAR_CLIENT, "r_deformvertexes", "1", "allows use of deformvertexes in shader files (can be turned off to check performance impact)"};
- cvar_t r_transparent = {CVAR_CLIENT, "r_transparent", "1", "allows use of transparent surfaces (can be turned off to check performance impact)"};
- cvar_t r_transparent_alphatocoverage = {CVAR_CLIENT, "r_transparent_alphatocoverage", "1", "enables GL_ALPHA_TO_COVERAGE antialiasing technique on alphablend and alphatest surfaces when using vid_samples 2 or higher"};
- cvar_t r_transparent_sortsurfacesbynearest = {CVAR_CLIENT, "r_transparent_sortsurfacesbynearest", "1", "sort entity and world surfaces by nearest point on bounding box instead of using the center of the bounding box, usually reduces sorting artifacts"};
- cvar_t r_transparent_useplanardistance = {CVAR_CLIENT, "r_transparent_useplanardistance", "0", "sort transparent meshes by distance from view plane rather than spherical distance to the chosen point"};
- cvar_t r_showoverdraw = {CVAR_CLIENT, "r_showoverdraw", "0", "shows overlapping geometry"};
- cvar_t r_showbboxes = {CVAR_CLIENT, "r_showbboxes", "0", "shows bounding boxes of server entities, value controls opacity scaling (1 = 10%,  10 = 100%)"};
- cvar_t r_showbboxes_client = {CVAR_CLIENT, "r_showbboxes_client", "0", "shows bounding boxes of clientside qc entities, value controls opacity scaling (1 = 10%,  10 = 100%)"};
- cvar_t r_showsurfaces = {CVAR_CLIENT, "r_showsurfaces", "0", "1 shows surfaces as different colors, or a value of 2 shows triangle draw order (for analyzing whether meshes are optimized for vertex cache)"};
- cvar_t r_showtris = {CVAR_CLIENT, "r_showtris", "0", "shows triangle outlines, value controls brightness (can be above 1)"};
- cvar_t r_shownormals = {CVAR_CLIENT, "r_shownormals", "0", "shows per-vertex surface normals and tangent vectors for bumpmapped lighting"};
- cvar_t r_showlighting = {CVAR_CLIENT, "r_showlighting", "0", "shows areas lit by lights, useful for finding out why some areas of a map render slowly (bright orange = lots of passes = slow), a value of 2 disables depth testing which can be interesting but not very useful"};
- cvar_t r_showcollisionbrushes = {CVAR_CLIENT, "r_showcollisionbrushes", "0", "draws collision brushes in quake3 maps (mode 1), mode 2 disables rendering of world (trippy!)"};
- cvar_t r_showcollisionbrushes_polygonfactor = {CVAR_CLIENT, "r_showcollisionbrushes_polygonfactor", "-1", "expands outward the brush polygons a little bit, used to make collision brushes appear infront of walls"};
- cvar_t r_showcollisionbrushes_polygonoffset = {CVAR_CLIENT, "r_showcollisionbrushes_polygonoffset", "0", "nudges brush polygon depth in hardware depth units, used to make collision brushes appear infront of walls"};
- cvar_t r_showdisabledepthtest = {CVAR_CLIENT, "r_showdisabledepthtest", "0", "disables depth testing on r_show* cvars, allowing you to see what hidden geometry the graphics card is processing"};
- cvar_t r_showspriteedges = {CVAR_CLIENT, "r_showspriteedges", "0", "renders a debug outline to show the polygon shape of each sprite frame rendered (may be 2 or more in case of interpolated animations), for debugging rendering bugs with specific view types"};
- cvar_t r_showparticleedges = {CVAR_CLIENT, "r_showparticleedges", "0", "renders a debug outline to show the polygon shape of each particle, for debugging rendering bugs with specific view types"};
- cvar_t r_drawportals = {CVAR_CLIENT, "r_drawportals", "0", "shows portals (separating polygons) in world interior in quake1 maps"};
- cvar_t r_drawentities = {CVAR_CLIENT, "r_drawentities","1", "draw entities (doors, players, projectiles, etc)"};
- cvar_t r_draw2d = {CVAR_CLIENT, "r_draw2d","1", "draw 2D stuff (dangerous to turn off)"};
- cvar_t r_drawworld = {CVAR_CLIENT, "r_drawworld","1", "draw world (most static stuff)"};
- cvar_t r_drawviewmodel = {CVAR_CLIENT, "r_drawviewmodel","1", "draw your weapon model"};
- cvar_t r_drawexteriormodel = {CVAR_CLIENT, "r_drawexteriormodel","1", "draw your player model (e.g. in chase cam, reflections)"};
- cvar_t r_cullentities_trace = {CVAR_CLIENT, "r_cullentities_trace", "1", "probabistically cull invisible entities"};
- cvar_t r_cullentities_trace_entityocclusion = {CVAR_CLIENT, "r_cullentities_trace_entityocclusion", "1", "check for occluding entities such as doors, not just world hull"};
- cvar_t r_cullentities_trace_samples = {CVAR_CLIENT, "r_cullentities_trace_samples", "2", "number of samples to test for entity culling (in addition to center sample)"};
- cvar_t r_cullentities_trace_tempentitysamples = {CVAR_CLIENT, "r_cullentities_trace_tempentitysamples", "-1", "number of samples to test for entity culling of temp entities (including all CSQC entities), -1 disables trace culling on these entities to prevent flicker (pvs still applies)"};
- cvar_t r_cullentities_trace_enlarge = {CVAR_CLIENT, "r_cullentities_trace_enlarge", "0", "box enlargement for entity culling"};
- cvar_t r_cullentities_trace_expand = {CVAR_CLIENT, "r_cullentities_trace_expand", "0", "box expanded by this many units for entity culling"};
- cvar_t r_cullentities_trace_pad = {CVAR_CLIENT, "r_cullentities_trace_pad", "8", "accept traces that hit within this many units of the box"};
- cvar_t r_cullentities_trace_delay = {CVAR_CLIENT, "r_cullentities_trace_delay", "1", "number of seconds until the entity gets actually culled"};
- cvar_t r_cullentities_trace_eyejitter = {CVAR_CLIENT, "r_cullentities_trace_eyejitter", "16", "randomly offset rays from the eye by this much to reduce the odds of flickering"};
- cvar_t r_sortentities = {CVAR_CLIENT, "r_sortentities", "0", "sort entities before drawing (might be faster)"};
- cvar_t r_speeds = {CVAR_CLIENT, "r_speeds","0", "displays rendering statistics and per-subsystem timings"};
- cvar_t r_fullbright = {CVAR_CLIENT, "r_fullbright","0", "makes map very bright and renders faster"};
- cvar_t r_fullbright_directed = {CVAR_CLIENT, "r_fullbright_directed", "0", "render fullbright things (unlit worldmodel and EF_FULLBRIGHT entities, but not fullbright shaders) using a constant light direction instead to add more depth while keeping uniform brightness"};
- cvar_t r_fullbright_directed_ambient = {CVAR_CLIENT, "r_fullbright_directed_ambient", "0.5", "ambient light multiplier for directed fullbright"};
- cvar_t r_fullbright_directed_diffuse = {CVAR_CLIENT, "r_fullbright_directed_diffuse", "0.75", "diffuse light multiplier for directed fullbright"};
- cvar_t r_fullbright_directed_pitch = {CVAR_CLIENT, "r_fullbright_directed_pitch", "20", "constant pitch direction ('height') of the fake light source to use for fullbright"};
- cvar_t r_fullbright_directed_pitch_relative = {CVAR_CLIENT, "r_fullbright_directed_pitch_relative", "0", "whether r_fullbright_directed_pitch is interpreted as absolute (0) or relative (1) pitch"};
- cvar_t r_wateralpha = {CVAR_CLIENT | CVAR_SAVE, "r_wateralpha","1", "opacity of water polygons"};
- cvar_t r_dynamic = {CVAR_CLIENT | CVAR_SAVE, "r_dynamic","1", "enables dynamic lights (rocket glow and such)"};
- cvar_t r_fullbrights = {CVAR_CLIENT | CVAR_SAVE, "r_fullbrights", "1", "enables glowing pixels in quake textures (changes need r_restart to take effect)"};
- cvar_t r_shadows = {CVAR_CLIENT | CVAR_SAVE, "r_shadows", "0", "casts fake stencil shadows from models onto the world (rtlights are unaffected by this); when set to 2, always cast the shadows in the direction set by r_shadows_throwdirection, otherwise use the model lighting."};
- cvar_t r_shadows_darken = {CVAR_CLIENT | CVAR_SAVE, "r_shadows_darken", "0.5", "how much shadowed areas will be darkened"};
- cvar_t r_shadows_throwdistance = {CVAR_CLIENT | CVAR_SAVE, "r_shadows_throwdistance", "500", "how far to cast shadows from models"};
- cvar_t r_shadows_throwdirection = {CVAR_CLIENT | CVAR_SAVE, "r_shadows_throwdirection", "0 0 -1", "override throwing direction for r_shadows 2"};
- cvar_t r_shadows_drawafterrtlighting = {CVAR_CLIENT | CVAR_SAVE, "r_shadows_drawafterrtlighting", "0", "draw fake shadows AFTER realtime lightning is drawn. May be useful for simulating fast sunlight on large outdoor maps with only one noshadow rtlight. The price is less realistic appearance of dynamic light shadows."};
- cvar_t r_shadows_castfrombmodels = {CVAR_CLIENT | CVAR_SAVE, "r_shadows_castfrombmodels", "0", "do cast shadows from bmodels"};
- cvar_t r_shadows_focus = {CVAR_CLIENT | CVAR_SAVE, "r_shadows_focus", "0 0 0", "offset the shadowed area focus"};
- cvar_t r_shadows_shadowmapscale = {CVAR_CLIENT | CVAR_SAVE, "r_shadows_shadowmapscale", "0.25", "higher values increase shadowmap quality at a cost of area covered (multiply global shadowmap precision) for fake shadows. Needs shadowmapping ON."};
- cvar_t r_shadows_shadowmapbias = {CVAR_CLIENT | CVAR_SAVE, "r_shadows_shadowmapbias", "-1", "sets shadowmap bias for fake shadows. -1 sets the value of r_shadow_shadowmapping_bias. Needs shadowmapping ON."};
- cvar_t r_q1bsp_skymasking = {CVAR_CLIENT, "r_q1bsp_skymasking", "1", "allows sky polygons in quake1 maps to obscure other geometry"};
- cvar_t r_polygonoffset_submodel_factor = {CVAR_CLIENT, "r_polygonoffset_submodel_factor", "0", "biases depth values of world submodels such as doors, to prevent z-fighting artifacts in Quake maps"};
- cvar_t r_polygonoffset_submodel_offset = {CVAR_CLIENT, "r_polygonoffset_submodel_offset", "14", "biases depth values of world submodels such as doors, to prevent z-fighting artifacts in Quake maps"};
- cvar_t r_polygonoffset_decals_factor = {CVAR_CLIENT, "r_polygonoffset_decals_factor", "0", "biases depth values of decals to prevent z-fighting artifacts"};
- cvar_t r_polygonoffset_decals_offset = {CVAR_CLIENT, "r_polygonoffset_decals_offset", "-14", "biases depth values of decals to prevent z-fighting artifacts"};
- cvar_t r_fog_exp2 = {CVAR_CLIENT, "r_fog_exp2", "0", "uses GL_EXP2 fog (as in Nehahra) rather than realistic GL_EXP fog"};
- cvar_t r_fog_clear = {CVAR_CLIENT, "r_fog_clear", "1", "clears renderbuffer with fog color before render starts"};
- cvar_t r_drawfog = {CVAR_CLIENT | CVAR_SAVE, "r_drawfog", "1", "allows one to disable fog rendering"};
- cvar_t r_transparentdepthmasking = {CVAR_CLIENT | CVAR_SAVE, "r_transparentdepthmasking", "0", "enables depth writes on transparent meshes whose materially is normally opaque, this prevents seeing the inside of a transparent mesh"};
- cvar_t r_transparent_sortmindist = {CVAR_CLIENT | CVAR_SAVE, "r_transparent_sortmindist", "0", "lower distance limit for transparent sorting"};
- cvar_t r_transparent_sortmaxdist = {CVAR_CLIENT | CVAR_SAVE, "r_transparent_sortmaxdist", "32768", "upper distance limit for transparent sorting"};
- cvar_t r_transparent_sortarraysize = {CVAR_CLIENT | CVAR_SAVE, "r_transparent_sortarraysize", "4096", "number of distance-sorting layers"};
- cvar_t r_celshading = {CVAR_CLIENT | CVAR_SAVE, "r_celshading", "0", "cartoon-style light shading (OpenGL 2.x only)"}; // FIXME remove OpenGL 2.x only once implemented for DX9
- cvar_t r_celoutlines = {CVAR_CLIENT | CVAR_SAVE, "r_celoutlines", "0", "cartoon-style outlines (requires r_shadow_deferred)"};
- cvar_t gl_fogenable = {CVAR_CLIENT, "gl_fogenable", "0", "nehahra fog enable (for Nehahra compatibility only)"};
- cvar_t gl_fogdensity = {CVAR_CLIENT, "gl_fogdensity", "0.25", "nehahra fog density (recommend values below 0.1) (for Nehahra compatibility only)"};
- cvar_t gl_fogred = {CVAR_CLIENT, "gl_fogred","0.3", "nehahra fog color red value (for Nehahra compatibility only)"};
- cvar_t gl_foggreen = {CVAR_CLIENT, "gl_foggreen","0.3", "nehahra fog color green value (for Nehahra compatibility only)"};
- cvar_t gl_fogblue = {CVAR_CLIENT, "gl_fogblue","0.3", "nehahra fog color blue value (for Nehahra compatibility only)"};
- cvar_t gl_fogstart = {CVAR_CLIENT, "gl_fogstart", "0", "nehahra fog start distance (for Nehahra compatibility only)"};
- cvar_t gl_fogend = {CVAR_CLIENT, "gl_fogend","0", "nehahra fog end distance (for Nehahra compatibility only)"};
- cvar_t gl_skyclip = {CVAR_CLIENT, "gl_skyclip", "4608", "nehahra farclip distance - the real fog end (for Nehahra compatibility only)"};
- cvar_t r_texture_dds_load = {CVAR_CLIENT | CVAR_SAVE, "r_texture_dds_load", "0", "load compressed dds/filename.dds texture instead of filename.tga, if the file exists (requires driver support)"};
- cvar_t r_texture_dds_save = {CVAR_CLIENT | CVAR_SAVE, "r_texture_dds_save", "0", "save compressed dds/filename.dds texture when filename.tga is loaded, so that it can be loaded instead next time"};
- cvar_t r_textureunits = {CVAR_CLIENT, "r_textureunits", "32", "number of texture units to use in GL 1.1 and GL 1.3 rendering paths"};
- static cvar_t gl_combine = {CVAR_CLIENT | CVAR_READONLY, "gl_combine", "1", "indicates whether the OpenGL 1.3 rendering path is active"};
- static cvar_t r_glsl = {CVAR_CLIENT | CVAR_READONLY, "r_glsl", "1", "indicates whether the OpenGL 2.0 rendering path is active"};
- cvar_t r_usedepthtextures = {CVAR_CLIENT | CVAR_SAVE, "r_usedepthtextures", "1", "use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardware"};
- cvar_t r_viewfbo = {CVAR_CLIENT | CVAR_SAVE, "r_viewfbo", "0", "enables use of an 8bit (1) or 16bit (2) or 32bit (3) per component float framebuffer render, which may be at a different resolution than the video mode"};
- cvar_t r_rendertarget_debug = {CVAR_CLIENT, "r_rendertarget_debug", "-1", "replaces the view with the contents of the specified render target (by number - note that these can fluctuate depending on scene)"};
- cvar_t r_viewscale = {CVAR_CLIENT | CVAR_SAVE, "r_viewscale", "1", "scaling factor for resolution of the fbo rendering method, must be > 0, can be above 1 for a costly antialiasing behavior, typical values are 0.5 for 1/4th as many pixels rendered, or 1 for normal rendering"};
- cvar_t r_viewscale_fpsscaling = {CVAR_CLIENT | CVAR_SAVE, "r_viewscale_fpsscaling", "0", "change resolution based on framerate"};
- cvar_t r_viewscale_fpsscaling_min = {CVAR_CLIENT | CVAR_SAVE, "r_viewscale_fpsscaling_min", "0.0625", "worst acceptable quality"};
- cvar_t r_viewscale_fpsscaling_multiply = {CVAR_CLIENT | CVAR_SAVE, "r_viewscale_fpsscaling_multiply", "5", "adjust quality up or down by the frametime difference from 1.0/target, multiplied by this factor"};
- cvar_t r_viewscale_fpsscaling_stepsize = {CVAR_CLIENT | CVAR_SAVE, "r_viewscale_fpsscaling_stepsize", "0.01", "smallest adjustment to hit the target framerate (this value prevents minute oscillations)"};
- cvar_t r_viewscale_fpsscaling_stepmax = {CVAR_CLIENT | CVAR_SAVE, "r_viewscale_fpsscaling_stepmax", "1.00", "largest adjustment to hit the target framerate (this value prevents wild overshooting of the estimate)"};
- cvar_t r_viewscale_fpsscaling_target = {CVAR_CLIENT | CVAR_SAVE, "r_viewscale_fpsscaling_target", "70", "desired framerate"};
- cvar_t r_glsl_skeletal = {CVAR_CLIENT | CVAR_SAVE, "r_glsl_skeletal", "1", "render skeletal models faster using a gpu-skinning technique"};
- cvar_t r_glsl_deluxemapping = {CVAR_CLIENT | CVAR_SAVE, "r_glsl_deluxemapping", "1", "use per pixel lighting on deluxemap-compiled q3bsp maps (or a value of 2 forces deluxemap shading even without deluxemaps)"};
- cvar_t r_glsl_offsetmapping = {CVAR_CLIENT | CVAR_SAVE, "r_glsl_offsetmapping", "0", "offset mapping effect (also known as parallax mapping or virtual displacement mapping)"};
- cvar_t r_glsl_offsetmapping_steps = {CVAR_CLIENT | CVAR_SAVE, "r_glsl_offsetmapping_steps", "2", "offset mapping steps (note: too high values may be not supported by your GPU)"};
- cvar_t r_glsl_offsetmapping_reliefmapping = {CVAR_CLIENT | CVAR_SAVE, "r_glsl_offsetmapping_reliefmapping", "0", "relief mapping effect (higher quality)"};
- cvar_t r_glsl_offsetmapping_reliefmapping_steps = {CVAR_CLIENT | CVAR_SAVE, "r_glsl_offsetmapping_reliefmapping_steps", "10", "relief mapping steps (note: too high values may be not supported by your GPU)"};
- cvar_t r_glsl_offsetmapping_reliefmapping_refinesteps = {CVAR_CLIENT | CVAR_SAVE, "r_glsl_offsetmapping_reliefmapping_refinesteps", "5", "relief mapping refine steps (these are a binary search executed as the last step as given by r_glsl_offsetmapping_reliefmapping_steps)"};
- cvar_t r_glsl_offsetmapping_scale = {CVAR_CLIENT | CVAR_SAVE, "r_glsl_offsetmapping_scale", "0.04", "how deep the offset mapping effect is"};
- cvar_t r_glsl_offsetmapping_lod = {CVAR_CLIENT | CVAR_SAVE, "r_glsl_offsetmapping_lod", "0", "apply distance-based level-of-detail correction to number of offsetmappig steps, effectively making it render faster on large open-area maps"};
- cvar_t r_glsl_offsetmapping_lod_distance = {CVAR_CLIENT | CVAR_SAVE, "r_glsl_offsetmapping_lod_distance", "32", "first LOD level distance, second level (-50% steps) is 2x of this, third (33%) - 3x etc."};
- cvar_t r_glsl_postprocess = {CVAR_CLIENT | CVAR_SAVE, "r_glsl_postprocess", "0", "use a GLSL postprocessing shader"};
- cvar_t r_glsl_postprocess_color_lut = {CVAR_CLIENT | CVAR_SAVE, "r_glsl_postprocess_color_lut", "", "color lookup table for post, empty string for default"};
- cvar_t r_glsl_postprocess_uservec1 = {CVAR_CLIENT | CVAR_SAVE, "r_glsl_postprocess_uservec1", "0 0 0 0", "a 4-component vector to pass as uservec1 to the postprocessing shader (only useful if default.glsl has been customized)"};
- cvar_t r_glsl_postprocess_uservec2 = {CVAR_CLIENT | CVAR_SAVE, "r_glsl_postprocess_uservec2", "0 0 0 0", "a 4-component vector to pass as uservec2 to the postprocessing shader (only useful if default.glsl has been customized)"};
- cvar_t r_glsl_postprocess_uservec3 = {CVAR_CLIENT | CVAR_SAVE, "r_glsl_postprocess_uservec3", "0 0 0 0", "a 4-component vector to pass as uservec3 to the postprocessing shader (only useful if default.glsl has been customized)"};
- cvar_t r_glsl_postprocess_uservec4 = {CVAR_CLIENT | CVAR_SAVE, "r_glsl_postprocess_uservec4", "0 0 0 0", "a 4-component vector to pass as uservec4 to the postprocessing shader (only useful if default.glsl has been customized)"};
- cvar_t r_glsl_postprocess_uservec1_enable = {CVAR_CLIENT | CVAR_SAVE, "r_glsl_postprocess_uservec1_enable", "1", "enables postprocessing uservec1 usage, creates USERVEC1 define (only useful if default.glsl has been customized)"};
- cvar_t r_glsl_postprocess_uservec2_enable = {CVAR_CLIENT | CVAR_SAVE, "r_glsl_postprocess_uservec2_enable", "1", "enables postprocessing uservec2 usage, creates USERVEC1 define (only useful if default.glsl has been customized)"};
- cvar_t r_glsl_postprocess_uservec3_enable = {CVAR_CLIENT | CVAR_SAVE, "r_glsl_postprocess_uservec3_enable", "1", "enables postprocessing uservec3 usage, creates USERVEC1 define (only useful if default.glsl has been customized)"};
- cvar_t r_glsl_postprocess_uservec4_enable = {CVAR_CLIENT | CVAR_SAVE, "r_glsl_postprocess_uservec4_enable", "1", "enables postprocessing uservec4 usage, creates USERVEC1 define (only useful if default.glsl has been customized)"};
- cvar_t r_colorfringe = {CVAR_CLIENT | CVAR_SAVE, "r_colorfringe", "0", "Chromatic aberration. Values higher than 0.025 will noticeably distort the image"};
- cvar_t r_water = {CVAR_CLIENT | CVAR_SAVE, "r_water", "0", "whether to use reflections and refraction on water surfaces (note: r_wateralpha must be set below 1)"};
- cvar_t r_water_cameraentitiesonly = {CVAR_CLIENT | CVAR_SAVE, "r_water_cameraentitiesonly", "0", "whether to only show QC-defined reflections/refractions (typically used for camera- or portal-like effects)"};
- cvar_t r_water_clippingplanebias = {CVAR_CLIENT | CVAR_SAVE, "r_water_clippingplanebias", "1", "a rather technical setting which avoids black pixels around water edges"};
- cvar_t r_water_resolutionmultiplier = {CVAR_CLIENT | CVAR_SAVE, "r_water_resolutionmultiplier", "0.5", "multiplier for screen resolution when rendering refracted/reflected scenes, 1 is full quality, lower values are faster"};
- cvar_t r_water_refractdistort = {CVAR_CLIENT | CVAR_SAVE, "r_water_refractdistort", "0.01", "how much water refractions shimmer"};
- cvar_t r_water_reflectdistort = {CVAR_CLIENT | CVAR_SAVE, "r_water_reflectdistort", "0.01", "how much water reflections shimmer"};
- cvar_t r_water_scissormode = {CVAR_CLIENT, "r_water_scissormode", "3", "scissor (1) or cull (2) or both (3) water renders"};
- cvar_t r_water_lowquality = {CVAR_CLIENT, "r_water_lowquality", "0", "special option to accelerate water rendering: 1 disables all dynamic lights, 2 disables particles too"};
- cvar_t r_water_hideplayer = {CVAR_CLIENT | CVAR_SAVE, "r_water_hideplayer", "0", "if set to 1 then player will be hidden in refraction views, if set to 2 then player will also be hidden in reflection views, player is always visible in camera views"};
- cvar_t r_lerpsprites = {CVAR_CLIENT | CVAR_SAVE, "r_lerpsprites", "0", "enables animation smoothing on sprites"};
- cvar_t r_lerpmodels = {CVAR_CLIENT | CVAR_SAVE, "r_lerpmodels", "1", "enables animation smoothing on models"};
- cvar_t r_nolerp_list = {CVAR_CLIENT | CVAR_SAVE, "r_nolerp_list", "progs/v_nail.mdl,progs/v_nail2.mdl,progs/flame.mdl,progs/flame2.mdl,progs/braztall.mdl,progs/brazshrt.mdl,progs/longtrch.mdl,progs/flame_pyre.mdl,progs/v_saw.mdl,progs/v_xfist.mdl,progs/h2stuff/newfire.mdl", "comma separated list of models that will not have their animations smoothed"};
- cvar_t r_lerplightstyles = {CVAR_CLIENT | CVAR_SAVE, "r_lerplightstyles", "0", "enable animation smoothing on flickering lights"};
- cvar_t r_waterscroll = {CVAR_CLIENT | CVAR_SAVE, "r_waterscroll", "1", "makes water scroll around, value controls how much"};
- cvar_t r_bloom = {CVAR_CLIENT | CVAR_SAVE, "r_bloom", "0", "enables bloom effect (makes bright pixels affect neighboring pixels)"};
- cvar_t r_bloom_colorscale = {CVAR_CLIENT | CVAR_SAVE, "r_bloom_colorscale", "1", "how bright the glow is"};
- cvar_t r_bloom_brighten = {CVAR_CLIENT | CVAR_SAVE, "r_bloom_brighten", "1", "how bright the glow is, after subtract/power"};
- cvar_t r_bloom_blur = {CVAR_CLIENT | CVAR_SAVE, "r_bloom_blur", "4", "how large the glow is"};
- cvar_t r_bloom_resolution = {CVAR_CLIENT | CVAR_SAVE, "r_bloom_resolution", "320", "what resolution to perform the bloom effect at (independent of screen resolution)"};
- cvar_t r_bloom_colorexponent = {CVAR_CLIENT | CVAR_SAVE, "r_bloom_colorexponent", "1", "how exaggerated the glow is"};
- cvar_t r_bloom_colorsubtract = {CVAR_CLIENT | CVAR_SAVE, "r_bloom_colorsubtract", "0.1", "reduces bloom colors by a certain amount"};
- cvar_t r_bloom_scenebrightness = {CVAR_CLIENT | CVAR_SAVE, "r_bloom_scenebrightness", "1", "global rendering brightness when bloom is enabled"};
- cvar_t r_hdr_scenebrightness = {CVAR_CLIENT | CVAR_SAVE, "r_hdr_scenebrightness", "1", "global rendering brightness"};
- cvar_t r_hdr_glowintensity = {CVAR_CLIENT | CVAR_SAVE, "r_hdr_glowintensity", "1", "how bright light emitting textures should appear"};
- cvar_t r_hdr_irisadaptation = {CVAR_CLIENT | CVAR_SAVE, "r_hdr_irisadaptation", "0", "adjust scene brightness according to light intensity at player location"};
- cvar_t r_hdr_irisadaptation_multiplier = {CVAR_CLIENT | CVAR_SAVE, "r_hdr_irisadaptation_multiplier", "2", "brightness at which value will be 1.0"};
- cvar_t r_hdr_irisadaptation_minvalue = {CVAR_CLIENT | CVAR_SAVE, "r_hdr_irisadaptation_minvalue", "0.5", "minimum value that can result from multiplier / brightness"};
- cvar_t r_hdr_irisadaptation_maxvalue = {CVAR_CLIENT | CVAR_SAVE, "r_hdr_irisadaptation_maxvalue", "4", "maximum value that can result from multiplier / brightness"};
- cvar_t r_hdr_irisadaptation_value = {CVAR_CLIENT, "r_hdr_irisadaptation_value", "1", "current value as scenebrightness multiplier, changes continuously when irisadaptation is active"};
- cvar_t r_hdr_irisadaptation_fade_up = {CVAR_CLIENT | CVAR_SAVE, "r_hdr_irisadaptation_fade_up", "0.1", "fade rate at which value adjusts to darkness"};
- cvar_t r_hdr_irisadaptation_fade_down = {CVAR_CLIENT | CVAR_SAVE, "r_hdr_irisadaptation_fade_down", "0.5", "fade rate at which value adjusts to brightness"};
- cvar_t r_hdr_irisadaptation_radius = {CVAR_CLIENT | CVAR_SAVE, "r_hdr_irisadaptation_radius", "15", "lighting within this many units of the eye is averaged"};
- cvar_t r_smoothnormals_areaweighting = {CVAR_CLIENT, "r_smoothnormals_areaweighting", "1", "uses significantly faster (and supposedly higher quality) area-weighted vertex normals and tangent vectors rather than summing normalized triangle normals and tangents"};
- cvar_t developer_texturelogging = {CVAR_CLIENT, "developer_texturelogging", "0", "produces a textures.log file containing names of skins and map textures the engine tried to load"};
- cvar_t gl_lightmaps = {CVAR_CLIENT, "gl_lightmaps", "0", "draws only lightmaps, no texture (for level designers), a value of 2 keeps normalmap shading"};
- cvar_t r_test = {CVAR_CLIENT, "r_test", "0", "internal development use only, leave it alone (usually does nothing anyway)"};
- cvar_t r_batch_multidraw = {CVAR_CLIENT | CVAR_SAVE, "r_batch_multidraw", "1", "issue multiple glDrawElements calls when rendering a batch of surfaces with the same texture (otherwise the index data is copied to make it one draw)"};
- cvar_t r_batch_multidraw_mintriangles = {CVAR_CLIENT | CVAR_SAVE, "r_batch_multidraw_mintriangles", "0", "minimum number of triangles to activate multidraw path (copying small groups of triangles may be faster)"};
- cvar_t r_batch_debugdynamicvertexpath = {CVAR_CLIENT | CVAR_SAVE, "r_batch_debugdynamicvertexpath", "0", "force the dynamic batching code path for debugging purposes"};
- cvar_t r_batch_dynamicbuffer = {CVAR_CLIENT | CVAR_SAVE, "r_batch_dynamicbuffer", "0", "use vertex/index buffers for drawing dynamic and copytriangles batches"};
- cvar_t r_glsl_saturation = {CVAR_CLIENT | CVAR_SAVE, "r_glsl_saturation", "1", "saturation multiplier (only working in glsl!)"};
- cvar_t r_glsl_saturation_redcompensate = {CVAR_CLIENT | CVAR_SAVE, "r_glsl_saturation_redcompensate", "0", "a 'vampire sight' addition to desaturation effect, does compensation for red color, r_glsl_restart is required"};
- cvar_t r_glsl_vertextextureblend_usebothalphas = {CVAR_CLIENT | CVAR_SAVE, "r_glsl_vertextextureblend_usebothalphas", "0", "use both alpha layers on vertex blended surfaces, each alpha layer sets amount of 'blend leak' on another layer, requires mod_q3shader_force_terrain_alphaflag on."};
- cvar_t r_framedatasize = {CVAR_CLIENT | CVAR_SAVE, "r_framedatasize", "0.5", "size of renderer data cache used during one frame (for skeletal animation caching, light processing, etc)"};
+ cvar_t r_motionblur = {CF_CLIENT | CF_ARCHIVE, "r_motionblur", "0", "screen motionblur - value represents intensity, somewhere around 0.5 recommended - NOTE: bad performance on multi-gpu!"};
+ cvar_t r_damageblur = {CF_CLIENT | CF_ARCHIVE, "r_damageblur", "0", "screen motionblur based on damage - value represents intensity, somewhere around 0.5 recommended - NOTE: bad performance on multi-gpu!"};
+ cvar_t r_motionblur_averaging = {CF_CLIENT | CF_ARCHIVE, "r_motionblur_averaging", "0.1", "sliding average reaction time for velocity (higher = slower adaption to change)"};
+ cvar_t r_motionblur_randomize = {CF_CLIENT | CF_ARCHIVE, "r_motionblur_randomize", "0.1", "randomizing coefficient to workaround ghosting"};
+ cvar_t r_motionblur_minblur = {CF_CLIENT | CF_ARCHIVE, "r_motionblur_minblur", "0.5", "factor of blur to apply at all times (always have this amount of blur no matter what the other factors are)"};
+ cvar_t r_motionblur_maxblur = {CF_CLIENT | CF_ARCHIVE, "r_motionblur_maxblur", "0.9", "maxmimum amount of blur"};
+ cvar_t r_motionblur_velocityfactor = {CF_CLIENT | CF_ARCHIVE, "r_motionblur_velocityfactor", "1", "factoring in of player velocity to the blur equation - the faster the player moves around the map, the more blur they get"};
+ cvar_t r_motionblur_velocityfactor_minspeed = {CF_CLIENT | CF_ARCHIVE, "r_motionblur_velocityfactor_minspeed", "400", "lower value of velocity when it starts to factor into blur equation"};
+ cvar_t r_motionblur_velocityfactor_maxspeed = {CF_CLIENT | CF_ARCHIVE, "r_motionblur_velocityfactor_maxspeed", "800", "upper value of velocity when it reaches the peak factor into blur equation"};
+ cvar_t r_motionblur_mousefactor = {CF_CLIENT | CF_ARCHIVE, "r_motionblur_mousefactor", "2", "factoring in of mouse acceleration to the blur equation - the faster the player turns their mouse, the more blur they get"};
+ cvar_t r_motionblur_mousefactor_minspeed = {CF_CLIENT | CF_ARCHIVE, "r_motionblur_mousefactor_minspeed", "0", "lower value of mouse acceleration when it starts to factor into blur equation"};
+ cvar_t r_motionblur_mousefactor_maxspeed = {CF_CLIENT | CF_ARCHIVE, "r_motionblur_mousefactor_maxspeed", "50", "upper value of mouse acceleration when it reaches the peak factor into blur equation"};
+ cvar_t r_depthfirst = {CF_CLIENT | CF_ARCHIVE, "r_depthfirst", "0", "renders a depth-only version of the scene before normal rendering begins to eliminate overdraw, values: 0 = off, 1 = world depth, 2 = world and model depth"};
+ cvar_t r_useinfinitefarclip = {CF_CLIENT | CF_ARCHIVE, "r_useinfinitefarclip", "1", "enables use of a special kind of projection matrix that has an extremely large farclip"};
+ cvar_t r_farclip_base = {CF_CLIENT, "r_farclip_base", "65536", "farclip (furthest visible distance) for rendering when r_useinfinitefarclip is 0"};
+ cvar_t r_farclip_world = {CF_CLIENT, "r_farclip_world", "2", "adds map size to farclip multiplied by this value"};
+ cvar_t r_nearclip = {CF_CLIENT, "r_nearclip", "1", "distance from camera of nearclip plane" };
+ cvar_t r_deformvertexes = {CF_CLIENT, "r_deformvertexes", "1", "allows use of deformvertexes in shader files (can be turned off to check performance impact)"};
+ cvar_t r_transparent = {CF_CLIENT, "r_transparent", "1", "allows use of transparent surfaces (can be turned off to check performance impact)"};
+ cvar_t r_transparent_alphatocoverage = {CF_CLIENT, "r_transparent_alphatocoverage", "1", "enables GL_ALPHA_TO_COVERAGE antialiasing technique on alphablend and alphatest surfaces when using vid_samples 2 or higher"};
+ cvar_t r_transparent_sortsurfacesbynearest = {CF_CLIENT, "r_transparent_sortsurfacesbynearest", "1", "sort entity and world surfaces by nearest point on bounding box instead of using the center of the bounding box, usually reduces sorting artifacts"};
+ cvar_t r_transparent_useplanardistance = {CF_CLIENT, "r_transparent_useplanardistance", "0", "sort transparent meshes by distance from view plane rather than spherical distance to the chosen point"};
+ cvar_t r_showoverdraw = {CF_CLIENT, "r_showoverdraw", "0", "shows overlapping geometry"};
+ cvar_t r_showbboxes = {CF_CLIENT, "r_showbboxes", "0", "shows bounding boxes of server entities, value controls opacity scaling (1 = 10%,  10 = 100%)"};
+ cvar_t r_showbboxes_client = {CF_CLIENT, "r_showbboxes_client", "0", "shows bounding boxes of clientside qc entities, value controls opacity scaling (1 = 10%,  10 = 100%)"};
+ cvar_t r_showsurfaces = {CF_CLIENT, "r_showsurfaces", "0", "1 shows surfaces as different colors, or a value of 2 shows triangle draw order (for analyzing whether meshes are optimized for vertex cache)"};
+ cvar_t r_showtris = {CF_CLIENT, "r_showtris", "0", "shows triangle outlines, value controls brightness (can be above 1)"};
+ cvar_t r_shownormals = {CF_CLIENT, "r_shownormals", "0", "shows per-vertex surface normals and tangent vectors for bumpmapped lighting"};
+ cvar_t r_showlighting = {CF_CLIENT, "r_showlighting", "0", "shows areas lit by lights, useful for finding out why some areas of a map render slowly (bright orange = lots of passes = slow), a value of 2 disables depth testing which can be interesting but not very useful"};
+ cvar_t r_showcollisionbrushes = {CF_CLIENT, "r_showcollisionbrushes", "0", "draws collision brushes in quake3 maps (mode 1), mode 2 disables rendering of world (trippy!)"};
+ cvar_t r_showcollisionbrushes_polygonfactor = {CF_CLIENT, "r_showcollisionbrushes_polygonfactor", "-1", "expands outward the brush polygons a little bit, used to make collision brushes appear infront of walls"};
+ cvar_t r_showcollisionbrushes_polygonoffset = {CF_CLIENT, "r_showcollisionbrushes_polygonoffset", "0", "nudges brush polygon depth in hardware depth units, used to make collision brushes appear infront of walls"};
+ cvar_t r_showdisabledepthtest = {CF_CLIENT, "r_showdisabledepthtest", "0", "disables depth testing on r_show* cvars, allowing you to see what hidden geometry the graphics card is processing"};
+ cvar_t r_showspriteedges = {CF_CLIENT, "r_showspriteedges", "0", "renders a debug outline to show the polygon shape of each sprite frame rendered (may be 2 or more in case of interpolated animations), for debugging rendering bugs with specific view types"};
+ cvar_t r_showparticleedges = {CF_CLIENT, "r_showparticleedges", "0", "renders a debug outline to show the polygon shape of each particle, for debugging rendering bugs with specific view types"};
+ cvar_t r_drawportals = {CF_CLIENT, "r_drawportals", "0", "shows portals (separating polygons) in world interior in quake1 maps"};
+ cvar_t r_drawentities = {CF_CLIENT, "r_drawentities","1", "draw entities (doors, players, projectiles, etc)"};
+ cvar_t r_draw2d = {CF_CLIENT, "r_draw2d","1", "draw 2D stuff (dangerous to turn off)"};
+ cvar_t r_drawworld = {CF_CLIENT, "r_drawworld","1", "draw world (most static stuff)"};
+ cvar_t r_drawviewmodel = {CF_CLIENT, "r_drawviewmodel","1", "draw your weapon model"};
+ cvar_t r_drawexteriormodel = {CF_CLIENT, "r_drawexteriormodel","1", "draw your player model (e.g. in chase cam, reflections)"};
+ cvar_t r_cullentities_trace = {CF_CLIENT, "r_cullentities_trace", "1", "probabistically cull invisible entities"};
+ cvar_t r_cullentities_trace_entityocclusion = {CF_CLIENT, "r_cullentities_trace_entityocclusion", "1", "check for occluding entities such as doors, not just world hull"};
+ cvar_t r_cullentities_trace_samples = {CF_CLIENT, "r_cullentities_trace_samples", "2", "number of samples to test for entity culling (in addition to center sample)"};
+ cvar_t r_cullentities_trace_tempentitysamples = {CF_CLIENT, "r_cullentities_trace_tempentitysamples", "-1", "number of samples to test for entity culling of temp entities (including all CSQC entities), -1 disables trace culling on these entities to prevent flicker (pvs still applies)"};
+ cvar_t r_cullentities_trace_enlarge = {CF_CLIENT, "r_cullentities_trace_enlarge", "0", "box enlargement for entity culling"};
+ cvar_t r_cullentities_trace_expand = {CF_CLIENT, "r_cullentities_trace_expand", "0", "box expanded by this many units for entity culling"};
+ cvar_t r_cullentities_trace_pad = {CF_CLIENT, "r_cullentities_trace_pad", "8", "accept traces that hit within this many units of the box"};
+ cvar_t r_cullentities_trace_delay = {CF_CLIENT, "r_cullentities_trace_delay", "1", "number of seconds until the entity gets actually culled"};
+ cvar_t r_cullentities_trace_eyejitter = {CF_CLIENT, "r_cullentities_trace_eyejitter", "16", "randomly offset rays from the eye by this much to reduce the odds of flickering"};
+ cvar_t r_sortentities = {CF_CLIENT, "r_sortentities", "0", "sort entities before drawing (might be faster)"};
+ cvar_t r_speeds = {CF_CLIENT, "r_speeds","0", "displays rendering statistics and per-subsystem timings"};
+ cvar_t r_fullbright = {CF_CLIENT, "r_fullbright","0", "makes map very bright and renders faster"};
+ cvar_t r_fullbright_directed = {CF_CLIENT, "r_fullbright_directed", "0", "render fullbright things (unlit worldmodel and EF_FULLBRIGHT entities, but not fullbright shaders) using a constant light direction instead to add more depth while keeping uniform brightness"};
+ cvar_t r_fullbright_directed_ambient = {CF_CLIENT, "r_fullbright_directed_ambient", "0.5", "ambient light multiplier for directed fullbright"};
+ cvar_t r_fullbright_directed_diffuse = {CF_CLIENT, "r_fullbright_directed_diffuse", "0.75", "diffuse light multiplier for directed fullbright"};
+ cvar_t r_fullbright_directed_pitch = {CF_CLIENT, "r_fullbright_directed_pitch", "20", "constant pitch direction ('height') of the fake light source to use for fullbright"};
+ cvar_t r_fullbright_directed_pitch_relative = {CF_CLIENT, "r_fullbright_directed_pitch_relative", "0", "whether r_fullbright_directed_pitch is interpreted as absolute (0) or relative (1) pitch"};
+ cvar_t r_wateralpha = {CF_CLIENT | CF_ARCHIVE, "r_wateralpha","1", "opacity of water polygons"};
+ cvar_t r_dynamic = {CF_CLIENT | CF_ARCHIVE, "r_dynamic","1", "enables dynamic lights (rocket glow and such)"};
+ cvar_t r_fullbrights = {CF_CLIENT | CF_ARCHIVE, "r_fullbrights", "1", "enables glowing pixels in quake textures (changes need r_restart to take effect)"};
+ cvar_t r_shadows = {CF_CLIENT | CF_ARCHIVE, "r_shadows", "0", "casts fake stencil shadows from models onto the world (rtlights are unaffected by this); when set to 2, always cast the shadows in the direction set by r_shadows_throwdirection, otherwise use the model lighting."};
+ cvar_t r_shadows_darken = {CF_CLIENT | CF_ARCHIVE, "r_shadows_darken", "0.5", "how much shadowed areas will be darkened"};
+ cvar_t r_shadows_throwdistance = {CF_CLIENT | CF_ARCHIVE, "r_shadows_throwdistance", "500", "how far to cast shadows from models"};
+ cvar_t r_shadows_throwdirection = {CF_CLIENT | CF_ARCHIVE, "r_shadows_throwdirection", "0 0 -1", "override throwing direction for r_shadows 2"};
+ cvar_t r_shadows_drawafterrtlighting = {CF_CLIENT | CF_ARCHIVE, "r_shadows_drawafterrtlighting", "0", "draw fake shadows AFTER realtime lightning is drawn. May be useful for simulating fast sunlight on large outdoor maps with only one noshadow rtlight. The price is less realistic appearance of dynamic light shadows."};
+ cvar_t r_shadows_castfrombmodels = {CF_CLIENT | CF_ARCHIVE, "r_shadows_castfrombmodels", "0", "do cast shadows from bmodels"};
+ cvar_t r_shadows_focus = {CF_CLIENT | CF_ARCHIVE, "r_shadows_focus", "0 0 0", "offset the shadowed area focus"};
+ cvar_t r_shadows_shadowmapscale = {CF_CLIENT | CF_ARCHIVE, "r_shadows_shadowmapscale", "0.25", "higher values increase shadowmap quality at a cost of area covered (multiply global shadowmap precision) for fake shadows. Needs shadowmapping ON."};
+ cvar_t r_shadows_shadowmapbias = {CF_CLIENT | CF_ARCHIVE, "r_shadows_shadowmapbias", "-1", "sets shadowmap bias for fake shadows. -1 sets the value of r_shadow_shadowmapping_bias. Needs shadowmapping ON."};
+ cvar_t r_q1bsp_skymasking = {CF_CLIENT, "r_q1bsp_skymasking", "1", "allows sky polygons in quake1 maps to obscure other geometry"};
+ cvar_t r_polygonoffset_submodel_factor = {CF_CLIENT, "r_polygonoffset_submodel_factor", "0", "biases depth values of world submodels such as doors, to prevent z-fighting artifacts in Quake maps"};
+ cvar_t r_polygonoffset_submodel_offset = {CF_CLIENT, "r_polygonoffset_submodel_offset", "14", "biases depth values of world submodels such as doors, to prevent z-fighting artifacts in Quake maps"};
+ cvar_t r_polygonoffset_decals_factor = {CF_CLIENT, "r_polygonoffset_decals_factor", "0", "biases depth values of decals to prevent z-fighting artifacts"};
+ cvar_t r_polygonoffset_decals_offset = {CF_CLIENT, "r_polygonoffset_decals_offset", "-14", "biases depth values of decals to prevent z-fighting artifacts"};
+ cvar_t r_fog_exp2 = {CF_CLIENT, "r_fog_exp2", "0", "uses GL_EXP2 fog (as in Nehahra) rather than realistic GL_EXP fog"};
+ cvar_t r_fog_clear = {CF_CLIENT, "r_fog_clear", "1", "clears renderbuffer with fog color before render starts"};
+ cvar_t r_drawfog = {CF_CLIENT | CF_ARCHIVE, "r_drawfog", "1", "allows one to disable fog rendering"};
+ cvar_t r_transparentdepthmasking = {CF_CLIENT | CF_ARCHIVE, "r_transparentdepthmasking", "0", "enables depth writes on transparent meshes whose materially is normally opaque, this prevents seeing the inside of a transparent mesh"};
+ cvar_t r_transparent_sortmindist = {CF_CLIENT | CF_ARCHIVE, "r_transparent_sortmindist", "0", "lower distance limit for transparent sorting"};
+ cvar_t r_transparent_sortmaxdist = {CF_CLIENT | CF_ARCHIVE, "r_transparent_sortmaxdist", "32768", "upper distance limit for transparent sorting"};
+ cvar_t r_transparent_sortarraysize = {CF_CLIENT | CF_ARCHIVE, "r_transparent_sortarraysize", "4096", "number of distance-sorting layers"};
+ cvar_t r_celshading = {CF_CLIENT | CF_ARCHIVE, "r_celshading", "0", "cartoon-style light shading (OpenGL 2.x only)"}; // FIXME remove OpenGL 2.x only once implemented for DX9
+ cvar_t r_celoutlines = {CF_CLIENT | CF_ARCHIVE, "r_celoutlines", "0", "cartoon-style outlines (requires r_shadow_deferred)"};
+ cvar_t gl_fogenable = {CF_CLIENT, "gl_fogenable", "0", "nehahra fog enable (for Nehahra compatibility only)"};
+ cvar_t gl_fogdensity = {CF_CLIENT, "gl_fogdensity", "0.25", "nehahra fog density (recommend values below 0.1) (for Nehahra compatibility only)"};
+ cvar_t gl_fogred = {CF_CLIENT, "gl_fogred","0.3", "nehahra fog color red value (for Nehahra compatibility only)"};
+ cvar_t gl_foggreen = {CF_CLIENT, "gl_foggreen","0.3", "nehahra fog color green value (for Nehahra compatibility only)"};
+ cvar_t gl_fogblue = {CF_CLIENT, "gl_fogblue","0.3", "nehahra fog color blue value (for Nehahra compatibility only)"};
+ cvar_t gl_fogstart = {CF_CLIENT, "gl_fogstart", "0", "nehahra fog start distance (for Nehahra compatibility only)"};
+ cvar_t gl_fogend = {CF_CLIENT, "gl_fogend","0", "nehahra fog end distance (for Nehahra compatibility only)"};
+ cvar_t gl_skyclip = {CF_CLIENT, "gl_skyclip", "4608", "nehahra farclip distance - the real fog end (for Nehahra compatibility only)"};
+ cvar_t r_texture_dds_load = {CF_CLIENT | CF_ARCHIVE, "r_texture_dds_load", "0", "load compressed dds/filename.dds texture instead of filename.tga, if the file exists (requires driver support)"};
+ cvar_t r_texture_dds_save = {CF_CLIENT | CF_ARCHIVE, "r_texture_dds_save", "0", "save compressed dds/filename.dds texture when filename.tga is loaded, so that it can be loaded instead next time"};
+ cvar_t r_textureunits = {CF_CLIENT, "r_textureunits", "32", "number of texture units to use in GL 1.1 and GL 1.3 rendering paths"};
+ static cvar_t gl_combine = {CF_CLIENT | CF_READONLY, "gl_combine", "1", "indicates whether the OpenGL 1.3 rendering path is active"};
+ static cvar_t r_glsl = {CF_CLIENT | CF_READONLY, "r_glsl", "1", "indicates whether the OpenGL 2.0 rendering path is active"};
+ cvar_t r_usedepthtextures = {CF_CLIENT | CF_ARCHIVE, "r_usedepthtextures", "1", "use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardware"};
+ cvar_t r_viewfbo = {CF_CLIENT | CF_ARCHIVE, "r_viewfbo", "0", "enables use of an 8bit (1) or 16bit (2) or 32bit (3) per component float framebuffer render, which may be at a different resolution than the video mode"};
+ cvar_t r_rendertarget_debug = {CF_CLIENT, "r_rendertarget_debug", "-1", "replaces the view with the contents of the specified render target (by number - note that these can fluctuate depending on scene)"};
+ cvar_t r_viewscale = {CF_CLIENT | CF_ARCHIVE, "r_viewscale", "1", "scaling factor for resolution of the fbo rendering method, must be > 0, can be above 1 for a costly antialiasing behavior, typical values are 0.5 for 1/4th as many pixels rendered, or 1 for normal rendering"};
+ cvar_t r_viewscale_fpsscaling = {CF_CLIENT | CF_ARCHIVE, "r_viewscale_fpsscaling", "0", "change resolution based on framerate"};
+ cvar_t r_viewscale_fpsscaling_min = {CF_CLIENT | CF_ARCHIVE, "r_viewscale_fpsscaling_min", "0.0625", "worst acceptable quality"};
+ cvar_t r_viewscale_fpsscaling_multiply = {CF_CLIENT | CF_ARCHIVE, "r_viewscale_fpsscaling_multiply", "5", "adjust quality up or down by the frametime difference from 1.0/target, multiplied by this factor"};
+ cvar_t r_viewscale_fpsscaling_stepsize = {CF_CLIENT | CF_ARCHIVE, "r_viewscale_fpsscaling_stepsize", "0.01", "smallest adjustment to hit the target framerate (this value prevents minute oscillations)"};
+ cvar_t r_viewscale_fpsscaling_stepmax = {CF_CLIENT | CF_ARCHIVE, "r_viewscale_fpsscaling_stepmax", "1.00", "largest adjustment to hit the target framerate (this value prevents wild overshooting of the estimate)"};
+ cvar_t r_viewscale_fpsscaling_target = {CF_CLIENT | CF_ARCHIVE, "r_viewscale_fpsscaling_target", "70", "desired framerate"};
+ cvar_t r_glsl_skeletal = {CF_CLIENT | CF_ARCHIVE, "r_glsl_skeletal", "1", "render skeletal models faster using a gpu-skinning technique"};
+ cvar_t r_glsl_deluxemapping = {CF_CLIENT | CF_ARCHIVE, "r_glsl_deluxemapping", "1", "use per pixel lighting on deluxemap-compiled q3bsp maps (or a value of 2 forces deluxemap shading even without deluxemaps)"};
+ cvar_t r_glsl_offsetmapping = {CF_CLIENT | CF_ARCHIVE, "r_glsl_offsetmapping", "0", "offset mapping effect (also known as parallax mapping or virtual displacement mapping)"};
+ cvar_t r_glsl_offsetmapping_steps = {CF_CLIENT | CF_ARCHIVE, "r_glsl_offsetmapping_steps", "2", "offset mapping steps (note: too high values may be not supported by your GPU)"};
+ cvar_t r_glsl_offsetmapping_reliefmapping = {CF_CLIENT | CF_ARCHIVE, "r_glsl_offsetmapping_reliefmapping", "0", "relief mapping effect (higher quality)"};
+ cvar_t r_glsl_offsetmapping_reliefmapping_steps = {CF_CLIENT | CF_ARCHIVE, "r_glsl_offsetmapping_reliefmapping_steps", "10", "relief mapping steps (note: too high values may be not supported by your GPU)"};
+ cvar_t r_glsl_offsetmapping_reliefmapping_refinesteps = {CF_CLIENT | CF_ARCHIVE, "r_glsl_offsetmapping_reliefmapping_refinesteps", "5", "relief mapping refine steps (these are a binary search executed as the last step as given by r_glsl_offsetmapping_reliefmapping_steps)"};
+ cvar_t r_glsl_offsetmapping_scale = {CF_CLIENT | CF_ARCHIVE, "r_glsl_offsetmapping_scale", "0.04", "how deep the offset mapping effect is"};
+ cvar_t r_glsl_offsetmapping_lod = {CF_CLIENT | CF_ARCHIVE, "r_glsl_offsetmapping_lod", "0", "apply distance-based level-of-detail correction to number of offsetmappig steps, effectively making it render faster on large open-area maps"};
+ cvar_t r_glsl_offsetmapping_lod_distance = {CF_CLIENT | CF_ARCHIVE, "r_glsl_offsetmapping_lod_distance", "32", "first LOD level distance, second level (-50% steps) is 2x of this, third (33%) - 3x etc."};
+ cvar_t r_glsl_postprocess = {CF_CLIENT | CF_ARCHIVE, "r_glsl_postprocess", "0", "use a GLSL postprocessing shader"};
++cvar_t r_glsl_postprocess_color_lut = {CF_CLIENT | CF_ARCHIVE, "r_glsl_postprocess_color_lut", "", "color lookup table for post, empty string for default"};
+ cvar_t r_glsl_postprocess_uservec1 = {CF_CLIENT | CF_ARCHIVE, "r_glsl_postprocess_uservec1", "0 0 0 0", "a 4-component vector to pass as uservec1 to the postprocessing shader (only useful if default.glsl has been customized)"};
+ cvar_t r_glsl_postprocess_uservec2 = {CF_CLIENT | CF_ARCHIVE, "r_glsl_postprocess_uservec2", "0 0 0 0", "a 4-component vector to pass as uservec2 to the postprocessing shader (only useful if default.glsl has been customized)"};
+ cvar_t r_glsl_postprocess_uservec3 = {CF_CLIENT | CF_ARCHIVE, "r_glsl_postprocess_uservec3", "0 0 0 0", "a 4-component vector to pass as uservec3 to the postprocessing shader (only useful if default.glsl has been customized)"};
+ cvar_t r_glsl_postprocess_uservec4 = {CF_CLIENT | CF_ARCHIVE, "r_glsl_postprocess_uservec4", "0 0 0 0", "a 4-component vector to pass as uservec4 to the postprocessing shader (only useful if default.glsl has been customized)"};
+ cvar_t r_glsl_postprocess_uservec1_enable = {CF_CLIENT | CF_ARCHIVE, "r_glsl_postprocess_uservec1_enable", "1", "enables postprocessing uservec1 usage, creates USERVEC1 define (only useful if default.glsl has been customized)"};
+ cvar_t r_glsl_postprocess_uservec2_enable = {CF_CLIENT | CF_ARCHIVE, "r_glsl_postprocess_uservec2_enable", "1", "enables postprocessing uservec2 usage, creates USERVEC1 define (only useful if default.glsl has been customized)"};
+ cvar_t r_glsl_postprocess_uservec3_enable = {CF_CLIENT | CF_ARCHIVE, "r_glsl_postprocess_uservec3_enable", "1", "enables postprocessing uservec3 usage, creates USERVEC1 define (only useful if default.glsl has been customized)"};
+ cvar_t r_glsl_postprocess_uservec4_enable = {CF_CLIENT | CF_ARCHIVE, "r_glsl_postprocess_uservec4_enable", "1", "enables postprocessing uservec4 usage, creates USERVEC1 define (only useful if default.glsl has been customized)"};
+ cvar_t r_colorfringe = {CF_CLIENT | CF_ARCHIVE, "r_colorfringe", "0", "Chromatic aberration. Values higher than 0.025 will noticeably distort the image"};
+ cvar_t r_water = {CF_CLIENT | CF_ARCHIVE, "r_water", "0", "whether to use reflections and refraction on water surfaces (note: r_wateralpha must be set below 1)"};
+ cvar_t r_water_cameraentitiesonly = {CF_CLIENT | CF_ARCHIVE, "r_water_cameraentitiesonly", "0", "whether to only show QC-defined reflections/refractions (typically used for camera- or portal-like effects)"};
+ cvar_t r_water_clippingplanebias = {CF_CLIENT | CF_ARCHIVE, "r_water_clippingplanebias", "1", "a rather technical setting which avoids black pixels around water edges"};
+ cvar_t r_water_resolutionmultiplier = {CF_CLIENT | CF_ARCHIVE, "r_water_resolutionmultiplier", "0.5", "multiplier for screen resolution when rendering refracted/reflected scenes, 1 is full quality, lower values are faster"};
+ cvar_t r_water_refractdistort = {CF_CLIENT | CF_ARCHIVE, "r_water_refractdistort", "0.01", "how much water refractions shimmer"};
+ cvar_t r_water_reflectdistort = {CF_CLIENT | CF_ARCHIVE, "r_water_reflectdistort", "0.01", "how much water reflections shimmer"};
+ cvar_t r_water_scissormode = {CF_CLIENT, "r_water_scissormode", "3", "scissor (1) or cull (2) or both (3) water renders"};
+ cvar_t r_water_lowquality = {CF_CLIENT, "r_water_lowquality", "0", "special option to accelerate water rendering: 1 disables all dynamic lights, 2 disables particles too"};
+ cvar_t r_water_hideplayer = {CF_CLIENT | CF_ARCHIVE, "r_water_hideplayer", "0", "if set to 1 then player will be hidden in refraction views, if set to 2 then player will also be hidden in reflection views, player is always visible in camera views"};
+ cvar_t r_lerpsprites = {CF_CLIENT | CF_ARCHIVE, "r_lerpsprites", "0", "enables animation smoothing on sprites"};
+ cvar_t r_lerpmodels = {CF_CLIENT | CF_ARCHIVE, "r_lerpmodels", "1", "enables animation smoothing on models"};
+ cvar_t r_nolerp_list = {CF_CLIENT | CF_ARCHIVE, "r_nolerp_list", "progs/v_nail.mdl,progs/v_nail2.mdl,progs/flame.mdl,progs/flame2.mdl,progs/braztall.mdl,progs/brazshrt.mdl,progs/longtrch.mdl,progs/flame_pyre.mdl,progs/v_saw.mdl,progs/v_xfist.mdl,progs/h2stuff/newfire.mdl", "comma separated list of models that will not have their animations smoothed"};
+ cvar_t r_lerplightstyles = {CF_CLIENT | CF_ARCHIVE, "r_lerplightstyles", "0", "enable animation smoothing on flickering lights"};
+ cvar_t r_waterscroll = {CF_CLIENT | CF_ARCHIVE, "r_waterscroll", "1", "makes water scroll around, value controls how much"};
+ cvar_t r_bloom = {CF_CLIENT | CF_ARCHIVE, "r_bloom", "0", "enables bloom effect (makes bright pixels affect neighboring pixels)"};
+ cvar_t r_bloom_colorscale = {CF_CLIENT | CF_ARCHIVE, "r_bloom_colorscale", "1", "how bright the glow is"};
+ cvar_t r_bloom_brighten = {CF_CLIENT | CF_ARCHIVE, "r_bloom_brighten", "1", "how bright the glow is, after subtract/power"};
+ cvar_t r_bloom_blur = {CF_CLIENT | CF_ARCHIVE, "r_bloom_blur", "4", "how large the glow is"};
+ cvar_t r_bloom_resolution = {CF_CLIENT | CF_ARCHIVE, "r_bloom_resolution", "320", "what resolution to perform the bloom effect at (independent of screen resolution)"};
+ cvar_t r_bloom_colorexponent = {CF_CLIENT | CF_ARCHIVE, "r_bloom_colorexponent", "1", "how exaggerated the glow is"};
+ cvar_t r_bloom_colorsubtract = {CF_CLIENT | CF_ARCHIVE, "r_bloom_colorsubtract", "0.1", "reduces bloom colors by a certain amount"};
+ cvar_t r_bloom_scenebrightness = {CF_CLIENT | CF_ARCHIVE, "r_bloom_scenebrightness", "1", "global rendering brightness when bloom is enabled"};
+ cvar_t r_hdr_scenebrightness = {CF_CLIENT | CF_ARCHIVE, "r_hdr_scenebrightness", "1", "global rendering brightness"};
+ cvar_t r_hdr_glowintensity = {CF_CLIENT | CF_ARCHIVE, "r_hdr_glowintensity", "1", "how bright light emitting textures should appear"};
+ cvar_t r_hdr_irisadaptation = {CF_CLIENT | CF_ARCHIVE, "r_hdr_irisadaptation", "0", "adjust scene brightness according to light intensity at player location"};
+ cvar_t r_hdr_irisadaptation_multiplier = {CF_CLIENT | CF_ARCHIVE, "r_hdr_irisadaptation_multiplier", "2", "brightness at which value will be 1.0"};
+ cvar_t r_hdr_irisadaptation_minvalue = {CF_CLIENT | CF_ARCHIVE, "r_hdr_irisadaptation_minvalue", "0.5", "minimum value that can result from multiplier / brightness"};
+ cvar_t r_hdr_irisadaptation_maxvalue = {CF_CLIENT | CF_ARCHIVE, "r_hdr_irisadaptation_maxvalue", "4", "maximum value that can result from multiplier / brightness"};
+ cvar_t r_hdr_irisadaptation_value = {CF_CLIENT, "r_hdr_irisadaptation_value", "1", "current value as scenebrightness multiplier, changes continuously when irisadaptation is active"};
+ cvar_t r_hdr_irisadaptation_fade_up = {CF_CLIENT | CF_ARCHIVE, "r_hdr_irisadaptation_fade_up", "0.1", "fade rate at which value adjusts to darkness"};
+ cvar_t r_hdr_irisadaptation_fade_down = {CF_CLIENT | CF_ARCHIVE, "r_hdr_irisadaptation_fade_down", "0.5", "fade rate at which value adjusts to brightness"};
+ cvar_t r_hdr_irisadaptation_radius = {CF_CLIENT | CF_ARCHIVE, "r_hdr_irisadaptation_radius", "15", "lighting within this many units of the eye is averaged"};
+ cvar_t r_smoothnormals_areaweighting = {CF_CLIENT, "r_smoothnormals_areaweighting", "1", "uses significantly faster (and supposedly higher quality) area-weighted vertex normals and tangent vectors rather than summing normalized triangle normals and tangents"};
+ cvar_t developer_texturelogging = {CF_CLIENT, "developer_texturelogging", "0", "produces a textures.log file containing names of skins and map textures the engine tried to load"};
+ cvar_t gl_lightmaps = {CF_CLIENT, "gl_lightmaps", "0", "draws only lightmaps, no texture (for level designers), a value of 2 keeps normalmap shading"};
+ cvar_t r_test = {CF_CLIENT, "r_test", "0", "internal development use only, leave it alone (usually does nothing anyway)"};
+ cvar_t r_batch_multidraw = {CF_CLIENT | CF_ARCHIVE, "r_batch_multidraw", "1", "issue multiple glDrawElements calls when rendering a batch of surfaces with the same texture (otherwise the index data is copied to make it one draw)"};
+ cvar_t r_batch_multidraw_mintriangles = {CF_CLIENT | CF_ARCHIVE, "r_batch_multidraw_mintriangles", "0", "minimum number of triangles to activate multidraw path (copying small groups of triangles may be faster)"};
+ cvar_t r_batch_debugdynamicvertexpath = {CF_CLIENT | CF_ARCHIVE, "r_batch_debugdynamicvertexpath", "0", "force the dynamic batching code path for debugging purposes"};
+ cvar_t r_batch_dynamicbuffer = {CF_CLIENT | CF_ARCHIVE, "r_batch_dynamicbuffer", "0", "use vertex/index buffers for drawing dynamic and copytriangles batches"};
+ cvar_t r_glsl_saturation = {CF_CLIENT | CF_ARCHIVE, "r_glsl_saturation", "1", "saturation multiplier (only working in glsl!)"};
+ cvar_t r_glsl_saturation_redcompensate = {CF_CLIENT | CF_ARCHIVE, "r_glsl_saturation_redcompensate", "0", "a 'vampire sight' addition to desaturation effect, does compensation for red color, r_glsl_restart is required"};
+ cvar_t r_glsl_vertextextureblend_usebothalphas = {CF_CLIENT | CF_ARCHIVE, "r_glsl_vertextextureblend_usebothalphas", "0", "use both alpha layers on vertex blended surfaces, each alpha layer sets amount of 'blend leak' on another layer, requires mod_q3shader_force_terrain_alphaflag on."};
+ cvar_t r_framedatasize = {CF_CLIENT | CF_ARCHIVE, "r_framedatasize", "0.5", "size of renderer data cache used during one frame (for skeletal animation caching, light processing, etc)"};
  cvar_t r_buffermegs[R_BUFFERDATA_COUNT] =
  {
-       {CVAR_CLIENT | CVAR_SAVE, "r_buffermegs_vertex", "4", "vertex buffer size for one frame"},
-       {CVAR_CLIENT | CVAR_SAVE, "r_buffermegs_index16", "1", "index buffer size for one frame (16bit indices)"},
-       {CVAR_CLIENT | CVAR_SAVE, "r_buffermegs_index32", "1", "index buffer size for one frame (32bit indices)"},
-       {CVAR_CLIENT | CVAR_SAVE, "r_buffermegs_uniform", "0.25", "uniform buffer size for one frame"},
+       {CF_CLIENT | CF_ARCHIVE, "r_buffermegs_vertex", "4", "vertex buffer size for one frame"},
+       {CF_CLIENT | CF_ARCHIVE, "r_buffermegs_index16", "1", "index buffer size for one frame (16bit indices)"},
+       {CF_CLIENT | CF_ARCHIVE, "r_buffermegs_index32", "1", "index buffer size for one frame (32bit indices)"},
+       {CF_CLIENT | CF_ARCHIVE, "r_buffermegs_uniform", "0.25", "uniform buffer size for one frame"},
  };
  
+ cvar_t r_q1bsp_lightmap_updates_enabled = {CF_CLIENT | CF_ARCHIVE, "r_q1bsp_lightmap_updates_enabled", "1", "allow lightmaps to be updated on Q1BSP maps (don't turn this off except for debugging)"};
+ cvar_t r_q1bsp_lightmap_updates_combine = {CF_CLIENT | CF_ARCHIVE, "r_q1bsp_lightmap_updates_combine", "2", "combine lightmap texture updates to make fewer glTexSubImage2D calls, modes: 0 = immediately upload lightmaps (may be thousands of small 3x3 updates), 1 = combine to one call, 2 = combine to one full texture update (glTexImage2D) which tells the driver it does not need to lock the resource (faster on most drivers)"};
+ cvar_t r_q1bsp_lightmap_updates_hidden_surfaces = {CF_CLIENT | CF_ARCHIVE, "r_q1bsp_lightmap_updates_hidden_surfaces", "0", "update lightmaps on surfaces that are not visible, so that updates only occur on frames where lightstyles changed value (animation or light switches), only makes sense with combine = 2"};
  extern cvar_t v_glslgamma_2d;
  
- extern qboolean v_flipped_state;
+ extern qbool v_flipped_state;
  
  r_framebufferstate_t r_fb;
  
diff --cc keys.c
index 056a8b6a8842fc08b61e5280ddfac4cac2f06394,3038eba6498bfa4c963b1018baa96bc28038939c..9333a1aefa7301a880b53a4ca71c18985228ce35
--- 1/keys.c
--- 2/keys.c
+++ b/keys.c
@@@ -1833,11 -1833,9 +1833,11 @@@ Key_Event (int key, int ascii, qbool do
  {
        cmd_state_t *cmd = &cmd_client;
        const char *bind;
-       qboolean q;
+       qbool q;
        keydest_t keydest = key_dest;
        char vabuf[1024];
 +      long curtime;
 +      static long pausetime = 0; // HACK: prevent double unpause      
  
        if (key < 0 || key >= MAX_KEYS)
                return;
diff --cc makefile.inc
Simple merge
diff --cc menu.c
Simple merge
diff --cc mvm_cmds.c
Simple merge
diff --cc nodegraph.c
index ee8372aaa0de0b23761d5d767a9b44f8cac8e4ee,0000000000000000000000000000000000000000..7133d40db5cb9a2fc46b7c06d2025998a0cea995
mode 100644,000000..100644
--- /dev/null
@@@ -1,1238 -1,0 +1,1238 @@@
- static qboolean nodegraph_graph_queries_clear(short graphid)
 +#include "quakedef.h"
 +#include "nodegraph.h"
 +
 +// ============================================================================
 +#define NODEGRAPH_NODES_COUNT_LIMIT 4096
 +#define NODEGRAPH_QUERY_ENTRIES_LIMIT NODEGRAPH_NODES_COUNT_LIMIT
 +#define NODEGRAPH_QUERIES_COUNT_LIMIT 128
 +
 +// ============================================================================
 +#define NODEGRAPH_NODES_DATA_LENGTH (NODEGRAPH_NODES_COUNT_LIMIT * 3)
 +#define NODEGRAPH_LINKS_DATA_LENGTH (NODEGRAPH_NODES_COUNT_LIMIT * NODEGRAPH_NODES_COUNT_LIMIT / 8)
 +
 +// ============================================================================
 +#define GRAPH_MATRIX_ELEMENT_INDEX(i, j) GRAPH_MATRIX_ELEMENT_INDEX_SIZED(i, j, NODEGRAPH_NODES_COUNT_LIMIT)
 +#define GRAPH_MATRIX_ELEMENT_INDEX_SIZED(i, j, size) (i * size + j)
 +
 +// ============================================================================
 +typedef struct nodegraph_s
 +{
 +      vec_t nodes[NODEGRAPH_NODES_DATA_LENGTH];
 +      char links[NODEGRAPH_LINKS_DATA_LENGTH];
 +      int nodes_count;
 +}
 +nodegraph_t;
 +
 +typedef struct nodegraph_query_s
 +{
 +      short entries[NODEGRAPH_QUERY_ENTRIES_LIMIT];
 +      short graphid;
 +      short entries_count;
 +}
 +nodegraph_query_t;
 +
 +typedef struct nodegraph_floyd_warshall_matrix_s
 +{
 +      short indexes[NODEGRAPH_NODES_COUNT_LIMIT * NODEGRAPH_NODES_COUNT_LIMIT];
 +}
 +nodegraph_floyd_warshall_matrix_t;
 +
 +// ============================================================================
 +typedef struct nodegraph_query_sort_data_s
 +{
 +      short queryid;
 +      vec3_t point;
 +}
 +nodegraph_query_sort_data_t;
 +
 +// ============================================================================
 +static nodegraph_t g_nodegraph_set[NODEGRAPH_GRAPHSET_SIZE_LIMIT];
 +static nodegraph_query_t g_nodegraph_queries[NODEGRAPH_QUERIES_COUNT_LIMIT];
 +static nodegraph_floyd_warshall_matrix_t g_nodegraph_floyd_warshall_matrices[NODEGRAPH_GRAPHSET_SIZE_LIMIT];
 +
 +// ============================================================================
 +static nodegraph_query_sort_data_t g_nodegraph_query_sort_data;
 +
 +// ============================================================================
 +static int nodegraph_query_sort_function(const void *left, const void *right)
 +{
 +      const short queryid = g_nodegraph_query_sort_data.queryid;
 +
 +      const short leftid = *(const short *)left;
 +      const short rightid = *(const short *)right;
 +
 +      vec3_t pointleft;
 +      vec3_t pointright;
 +
 +      float distanceleft;
 +      float distanceright;
 +
 +      nodegraph_query_t *query;
 +      nodegraph_t *nodegraph;
 +
 +      if (queryid < 0 || queryid >= NODEGRAPH_QUERIES_COUNT_LIMIT)
 +      {
 +              Con_DPrintf("%s, queryid is out of bounds: %d\n", __FUNCTION__, queryid);
 +              return 0;
 +      }
 +
 +      query = &g_nodegraph_queries[queryid];
 +      nodegraph = &g_nodegraph_set[query->graphid];
 +
 +      if (leftid < 0 || leftid >= nodegraph->nodes_count)
 +      {
 +              Con_DPrintf("%s, leftid is out of bounds: %d\n", __FUNCTION__, leftid);
 +              return 0;
 +      }
 +
 +      if (rightid < 0 || rightid >= nodegraph->nodes_count)
 +      {
 +              Con_DPrintf("%s, rightid is out of bounds: %d\n", __FUNCTION__, rightid);
 +              return 0;
 +      }
 +
 +      nodegraph_graph_get_node(query->graphid, leftid, pointleft);
 +      nodegraph_graph_get_node(query->graphid, rightid, pointright);
 +
 +      distanceleft = VectorDistance(pointleft, g_nodegraph_query_sort_data.point);
 +      distanceright = VectorDistance(pointright, g_nodegraph_query_sort_data.point);
 +
 +      return distanceleft - distanceright;
 +}
 +
 +// ============================================================================
- static qboolean nodegraph_graph_rebuild_floyd_warshall_matrices(void)
++static qbool nodegraph_graph_queries_clear(short graphid)
 +{
 +      short i;
 +
 +      if (graphid < 0 || graphid >= NODEGRAPH_GRAPHSET_SIZE_LIMIT)
 +      {
 +              Con_DPrintf("%s, graphid is out of bounds: %d\n", __FUNCTION__, graphid);
 +              return false;
 +      }
 +
 +      for (i = 0; i < NODEGRAPH_QUERIES_COUNT_LIMIT; i++)
 +      {
 +              nodegraph_query_t *query = &g_nodegraph_queries[i];
 +
 +              if (query->graphid == graphid)
 +              {
 +                      nodegraph_query_release(i);
 +              }
 +      }
 +
 +      return true;
 +}
 +
 +// ============================================================================
- qboolean nodegraph_graphset_clear(void)
++static qbool nodegraph_graph_rebuild_floyd_warshall_matrices(void)
 +{
 +      short graphid, i, j, k;
 +
 +      float *floyd_matrix_measures = (float *)Mem_Alloc(tempmempool, NODEGRAPH_NODES_COUNT_LIMIT * NODEGRAPH_NODES_COUNT_LIMIT * sizeof(float));
 +
 +      if (!floyd_matrix_measures)
 +      {
 +              return false;
 +      }
 +
 +      for (graphid = 0; graphid < NODEGRAPH_GRAPHSET_SIZE_LIMIT; graphid++)
 +      {
 +              nodegraph_t *nodegraph = &g_nodegraph_set[graphid];
 +              nodegraph_floyd_warshall_matrix_t *floyd_matrix = &g_nodegraph_floyd_warshall_matrices[graphid];
 +
 +              for (i = 0; i < nodegraph->nodes_count; i++)
 +              {
 +                      for (j = 0; j < nodegraph->nodes_count; j++)
 +                      {
 +                              floyd_matrix_measures[GRAPH_MATRIX_ELEMENT_INDEX(i, j)] = 16777216.0f;
 +                              floyd_matrix->indexes[GRAPH_MATRIX_ELEMENT_INDEX(i, j)] = -1;
 +
 +                              if (nodegraph_graph_does_link_exist(graphid, i, j))
 +                              {
 +                                      vec3_t nodefrom;
 +                                      vec3_t nodeto;
 +
 +                                      float distance;
 +
 +                                      nodegraph_graph_get_node(graphid, i, nodefrom);
 +                                      nodegraph_graph_get_node(graphid, j, nodeto);
 +
 +                                      distance = VectorDistance(nodefrom, nodeto);
 +
 +                                      floyd_matrix_measures[GRAPH_MATRIX_ELEMENT_INDEX(i, j)] = distance;
 +                                      floyd_matrix->indexes[GRAPH_MATRIX_ELEMENT_INDEX(i, j)] = j;
 +                              }
 +                      }
 +              }
 +
 +              for (i = 0; i < nodegraph->nodes_count; i++)
 +              {
 +                      floyd_matrix_measures[GRAPH_MATRIX_ELEMENT_INDEX(i, i)] = 0.0f;
 +                      floyd_matrix->indexes[GRAPH_MATRIX_ELEMENT_INDEX(i, i)] = i;
 +              }
 +
 +              for (k = 0; k < nodegraph->nodes_count; k++)
 +              {
 +                      for (i = 0; i < nodegraph->nodes_count; i++)
 +                      {
 +                              for (j = 0; j < nodegraph->nodes_count; j++)
 +                              {
 +                                      float distance = floyd_matrix_measures[GRAPH_MATRIX_ELEMENT_INDEX(i, k)] + floyd_matrix_measures[GRAPH_MATRIX_ELEMENT_INDEX(k, j)];
 +
 +                                      if (floyd_matrix_measures[GRAPH_MATRIX_ELEMENT_INDEX(i, j)] > distance)
 +                                      {
 +                                              floyd_matrix_measures[GRAPH_MATRIX_ELEMENT_INDEX(i, j)] = distance;
 +                                              floyd_matrix->indexes[GRAPH_MATRIX_ELEMENT_INDEX(i, j)] = floyd_matrix->indexes[GRAPH_MATRIX_ELEMENT_INDEX(i, k)];
 +                                      }
 +                              }
 +                      }
 +              }
 +      }
 +
 +      Mem_Free(floyd_matrix_measures);
 +
 +      return true;
 +}
 +
 +// ============================================================================
- qboolean nodegraph_graphset_load(void)
++qbool nodegraph_graphset_clear(void)
 +{
 +      short i;
 +
 +      for (i = 0; i < NODEGRAPH_GRAPHSET_SIZE_LIMIT; i++)
 +      {
 +              nodegraph_graph_clear(i);
 +      }
 +
 +      return true;
 +}
 +
 +// ============================================================================
-       qboolean nodegraph_graphset_has_been_loaded;
++qbool nodegraph_graphset_load(void)
 +{
 +      char vabuf[1024];
 +      char *graphset_data;
 +
-                                               qboolean does_link_exist = ((nodegraph_links_sub_matrix[entryindex / 8] & (1 << (entryindex % 8))) != 0);
++      qbool nodegraph_graphset_has_been_loaded;
 +
 +      nodegraph_graphset_has_been_loaded = (graphset_data = (char *)FS_LoadFile(va(vabuf, sizeof(vabuf), "%s.qng", sv.worldnamenoextension), tempmempool, true, NULL)) != NULL;
 +
 +      if (nodegraph_graphset_has_been_loaded)
 +      {
 +              short graphid;
 +              short graphset_nodes_count[NODEGRAPH_GRAPHSET_SIZE_LIMIT];
 +
 +              size_t offset, length;
 +
 +              Con_Printf("Loaded %s.qng\n", sv.worldnamenoextension);
 +
 +              nodegraph_graphset_clear();
 +
 +              offset = 0;
 +
 +              length = sizeof(short) * NODEGRAPH_GRAPHSET_SIZE_LIMIT;
 +              memcpy((void *)graphset_nodes_count, (const void *)(graphset_data + offset), length);
 +
 +              offset += length;
 +
 +              for (graphid = 0; graphid < NODEGRAPH_GRAPHSET_SIZE_LIMIT; graphid++)
 +              {
 +                      nodegraph_t *nodegraph = &g_nodegraph_set[graphid];
 +                      nodegraph->nodes_count = graphset_nodes_count[graphid];
 +
 +                      if (nodegraph->nodes_count > 0)
 +                      {
 +                              short i, j;
 +                              char *nodegraph_links_sub_matrix;
 +
 +                              length = sizeof(float) * 3 * nodegraph->nodes_count;
 +                              memcpy((void *)nodegraph->nodes, (const void *)(graphset_data + offset), length);
 +
 +                              offset += length;
 +
 +                              nodegraph_links_sub_matrix = graphset_data + offset;
 +
 +                              for (i = 0; i < nodegraph->nodes_count; i++)
 +                              {
 +                                      for (j = 0; j < nodegraph->nodes_count; j++)
 +                                      {
 +                                              int entryindex = GRAPH_MATRIX_ELEMENT_INDEX_SIZED(i, j, nodegraph->nodes_count);
- qboolean nodegraph_graphset_save(void)
++                                              qbool does_link_exist = ((nodegraph_links_sub_matrix[entryindex / 8] & (1 << (entryindex % 8))) != 0);
 +
 +                                              if (does_link_exist)
 +                                              {
 +                                                      nodegraph_graph_add_link(graphid, i, j);
 +                                              }
 +                                      }
 +                              }
 +                              
 +                              length = (nodegraph->nodes_count * nodegraph->nodes_count - 1) / 8 + 1;
 +                              offset += length;
 +                      }
 +              }
 +
 +              for (graphid = 0; graphid < NODEGRAPH_GRAPHSET_SIZE_LIMIT; graphid++)
 +              {
 +                      nodegraph_t *nodegraph = &g_nodegraph_set[graphid];
 +                      nodegraph_floyd_warshall_matrix_t *floyd_matrix = &g_nodegraph_floyd_warshall_matrices[graphid];
 +
 +                      short i, j;
 +                      short *floyd_sub_matrix_indexes = (short *)(graphset_data + offset);
 +
 +                      for (i = 0; i < nodegraph->nodes_count; i++)
 +                      {
 +                              for (j = 0; j < nodegraph->nodes_count; j++)
 +                              {
 +                                      floyd_matrix->indexes[GRAPH_MATRIX_ELEMENT_INDEX(i, j)] = floyd_sub_matrix_indexes[GRAPH_MATRIX_ELEMENT_INDEX_SIZED(i, j, nodegraph->nodes_count)];
 +                              }
 +                      }
 +
 +                      offset += sizeof(short) * nodegraph->nodes_count * nodegraph->nodes_count;
 +              }
 +
 +              Mem_Free(graphset_data);
 +
 +              return true;
 +      }
 +
 +      return false;
 +}
 +
 +// ============================================================================
-       qboolean nodegraph_graphset_has_been_saved;
++qbool nodegraph_graphset_save(void)
 +{   
 +      char vabuf[1024];
 +
 +      char *graphset_data;
 +      size_t graphset_data_size;
 +
- qboolean nodegraph_graph_clear(short graphid)
++      qbool nodegraph_graphset_has_been_saved;
 +
 +      short graphid;
 +      short graphset_nodes_count[NODEGRAPH_GRAPHSET_SIZE_LIMIT];
 +
 +      size_t offset, length;
 +
 +      nodegraph_graph_rebuild_floyd_warshall_matrices();
 +
 +      graphset_data_size = sizeof(short) * NODEGRAPH_GRAPHSET_SIZE_LIMIT + sizeof(g_nodegraph_set) + sizeof(g_nodegraph_floyd_warshall_matrices);
 +      graphset_data = (char *)Mem_Alloc(tempmempool, graphset_data_size);
 +
 +      if (!graphset_data)
 +      {
 +              return false;
 +      }
 +
 +      memset((void *)graphset_data, 0, graphset_data_size);
 +
 +      for (graphid = 0; graphid < NODEGRAPH_GRAPHSET_SIZE_LIMIT; graphid++)
 +      {
 +              nodegraph_t *nodegraph = &g_nodegraph_set[graphid];
 +              graphset_nodes_count[graphid] = nodegraph->nodes_count;
 +      }
 +
 +      offset = 0;
 +
 +      length = sizeof(short) * NODEGRAPH_GRAPHSET_SIZE_LIMIT;
 +      memcpy((void *)(graphset_data + offset), (const void *)graphset_nodes_count, length);
 +
 +      offset += length;
 +
 +      for (graphid = 0; graphid < NODEGRAPH_GRAPHSET_SIZE_LIMIT; graphid++)
 +      {
 +              nodegraph_t *nodegraph = &g_nodegraph_set[graphid];
 +
 +              if (nodegraph->nodes_count > 0)
 +              {
 +                      short i, j;
 +                      char *nodegraph_links_sub_matrix;
 +
 +                      length = sizeof(float) * 3 * nodegraph->nodes_count;
 +                      memcpy((void *)(graphset_data + offset), (const void *)nodegraph->nodes, length);
 +
 +                      offset += length;
 +                      
 +                      nodegraph_links_sub_matrix = graphset_data + offset;
 +
 +                      for (i = 0; i < nodegraph->nodes_count; i++)
 +                      {
 +                              for (j = 0; j < nodegraph->nodes_count; j++)
 +                              {                                 
 +                                      if (nodegraph_graph_does_link_exist(graphid, i, j))
 +                                      {
 +                                              int entryindex = GRAPH_MATRIX_ELEMENT_INDEX_SIZED(i, j, nodegraph->nodes_count);
 +                                              nodegraph_links_sub_matrix[entryindex / 8] |= 1 << (entryindex % 8);
 +                                      }
 +                              }
 +                      }
 +                      
 +                      length = (nodegraph->nodes_count * nodegraph->nodes_count - 1) / 8 + 1;
 +                      offset += length;
 +              }
 +      }
 +
 +      for (graphid = 0; graphid < NODEGRAPH_GRAPHSET_SIZE_LIMIT; graphid++)
 +      {
 +              nodegraph_t *nodegraph = &g_nodegraph_set[graphid];
 +              nodegraph_floyd_warshall_matrix_t *floyd_matrix = &g_nodegraph_floyd_warshall_matrices[graphid];
 +
 +              short i, j;
 +              short *floyd_sub_matrix_indexes = (short *)(graphset_data + offset);
 +
 +              for (i = 0; i < nodegraph->nodes_count; i++)
 +              {
 +                      for (j = 0; j < nodegraph->nodes_count; j++)
 +                      {
 +                              floyd_sub_matrix_indexes[GRAPH_MATRIX_ELEMENT_INDEX_SIZED(i, j, nodegraph->nodes_count)] = floyd_matrix->indexes[GRAPH_MATRIX_ELEMENT_INDEX(i, j)];
 +                      }
 +              }
 +
 +              offset += sizeof(short) * nodegraph->nodes_count * nodegraph->nodes_count;
 +      }
 +
 +      graphset_data_size = offset;
 +
 +      nodegraph_graphset_has_been_saved = FS_WriteFile(va(vabuf, sizeof(vabuf), "%s.qng", sv.worldnamenoextension), (const void *)graphset_data, (fs_offset_t)graphset_data_size);
 +
 +      Mem_Free(graphset_data);
 +
 +      if (nodegraph_graphset_has_been_saved)
 +      {
 +              Con_Printf("Saved %s.qng\n", sv.worldnamenoextension);
 +      }
 +
 +      return nodegraph_graphset_has_been_saved;
 +}
 +
 +// ============================================================================
- qboolean nodegraph_graph_add_node(short graphid, const vec3_t node)
++qbool nodegraph_graph_clear(short graphid)
 +{
 +      nodegraph_t *nodegraph;
 +      nodegraph_floyd_warshall_matrix_t *floyd_matrix;
 +
 +      if (graphid < 0 || graphid >= NODEGRAPH_GRAPHSET_SIZE_LIMIT)
 +      {
 +              Con_DPrintf("%s, graphid is out of bounds: %d\n", __FUNCTION__, graphid);
 +              return false;
 +      }
 +
 +      nodegraph = &g_nodegraph_set[graphid];
 +      memset((void *)nodegraph, 0, sizeof(nodegraph_t));
 +
 +      nodegraph_graph_queries_clear(graphid);
 +
 +      floyd_matrix = &g_nodegraph_floyd_warshall_matrices[graphid];
 +      memset((void *)floyd_matrix, 0, sizeof(nodegraph_floyd_warshall_matrix_t));
 +
 +      return true;
 +}
 +
 +// ============================================================================
 +short nodegraph_graph_nodes_count(short graphid)
 +{
 +      nodegraph_t *nodegraph;
 +
 +      if (graphid < 0 || graphid >= NODEGRAPH_GRAPHSET_SIZE_LIMIT)
 +      {
 +              Con_DPrintf("%s, graphid is out of bounds: %d\n", __FUNCTION__, graphid);
 +              return -1;
 +      }
 +
 +      nodegraph = &g_nodegraph_set[graphid];
 +
 +      return nodegraph->nodes_count;
 +}
 +
 +// ============================================================================
- qboolean nodegraph_graph_remove_node(short graphid, short nodeid)
++qbool nodegraph_graph_add_node(short graphid, const vec3_t node)
 +{
 +      nodegraph_t *nodegraph;
 +
 +      if (graphid < 0 || graphid >= NODEGRAPH_GRAPHSET_SIZE_LIMIT)
 +      {
 +              Con_DPrintf("%s, graphid is out of bounds: %d\n", __FUNCTION__, graphid);
 +              return false;
 +      }
 +
 +      nodegraph = &g_nodegraph_set[graphid];
 +
 +      if (nodegraph->nodes_count >= NODEGRAPH_NODES_COUNT_LIMIT)
 +      {
 +              Con_DPrintf("%s, the number of nodes exceeds the limit: %d\n", __FUNCTION__, NODEGRAPH_NODES_COUNT_LIMIT);
 +              return false;
 +      }
 +
 +      VectorCopy(node, &nodegraph->nodes[nodegraph->nodes_count * 3]);
 +      nodegraph->nodes_count++;
 +
 +      nodegraph_graph_queries_clear(graphid);
 +
 +      return true;
 +}
 +
 +// ============================================================================
- qboolean nodegraph_graph_is_node_valid(short graphid, short nodeid)
++qbool nodegraph_graph_remove_node(short graphid, short nodeid)
 +{
 +      nodegraph_t *nodegraph;
 +
 +      short i, j;
 +
 +      if (graphid < 0 || graphid >= NODEGRAPH_GRAPHSET_SIZE_LIMIT)
 +      {
 +              Con_DPrintf("%s, graphid is out of bounds: %d\n", __FUNCTION__, graphid);
 +              return false;
 +      }
 +
 +      nodegraph = &g_nodegraph_set[graphid];
 +
 +      if (nodeid < 0 || nodeid >= nodegraph->nodes_count)
 +      {
 +              Con_DPrintf("%s, nodeid is out of bounds: %d\n", __FUNCTION__, nodeid);
 +              return false;
 +      }
 +
 +      for (i = nodeid; i < nodegraph->nodes_count - 1; i++)
 +      {
 +              VectorCopy(&nodegraph->nodes[(i + 1) * 3], &nodegraph->nodes[i * 3]);
 +
 +              for (j = 0; j < nodegraph->nodes_count; j++)
 +              {
 +                      nodegraph_graph_does_link_exist(graphid, i + 1, j) ? nodegraph_graph_add_link(graphid, i, j) : nodegraph_graph_remove_link(graphid, i, j);
 +                      nodegraph_graph_does_link_exist(graphid, j, i + 1) ? nodegraph_graph_add_link(graphid, j, i) : nodegraph_graph_remove_link(graphid, j, i);
 +              }
 +      }
 +
 +      VectorSet(&nodegraph->nodes[(nodegraph->nodes_count - 1) * 3], 0.0f, 0.0f, 0.0f);
 +      nodegraph->nodes_count--;
 +
 +      nodegraph_graph_queries_clear(graphid);
 +
 +      return true;
 +}
 +
 +// ============================================================================
- qboolean nodegraph_graph_get_node(short graphid, short nodeid, vec3_t outnode)
++qbool nodegraph_graph_is_node_valid(short graphid, short nodeid)
 +{
 +      nodegraph_t *nodegraph;
 +
 +      if (graphid < 0 || graphid >= NODEGRAPH_GRAPHSET_SIZE_LIMIT)
 +      {
 +              Con_DPrintf("%s, graphid is out of bounds: %d\n", __FUNCTION__, graphid);
 +              return false;
 +      }
 +
 +      nodegraph = &g_nodegraph_set[graphid];
 +
 +      if (nodeid < 0 || nodeid >= nodegraph->nodes_count)
 +      {
 +              return false;
 +      }
 +
 +      return true;
 +}
 +
 +// ============================================================================
- qboolean nodegraph_graph_add_link(short graphid, short nodeidfrom, short nodeidto)
++qbool nodegraph_graph_get_node(short graphid, short nodeid, vec3_t outnode)
 +{
 +      nodegraph_t *nodegraph;
 +
 +      VectorSet(outnode, NAN, NAN, NAN);
 +
 +      if (graphid < 0 || graphid >= NODEGRAPH_GRAPHSET_SIZE_LIMIT)
 +      {
 +              Con_DPrintf("%s, graphid is out of bounds: %d\n", __FUNCTION__, graphid);
 +              return false;
 +      }
 +
 +      nodegraph = &g_nodegraph_set[graphid];
 +
 +      if (nodeid < 0 || nodeid >= nodegraph->nodes_count)
 +      {
 +              Con_DPrintf("%s, nodeid is out of bounds: %d\n", __FUNCTION__, nodeid);
 +              return false;
 +      }
 +
 +      VectorCopy(&nodegraph->nodes[nodeid * 3], outnode);
 +
 +      return true;
 +}
 +
 +// ============================================================================
- qboolean nodegraph_graph_remove_link(short graphid, short nodeidfrom, short nodeidto)
++qbool nodegraph_graph_add_link(short graphid, short nodeidfrom, short nodeidto)
 +{
 +      nodegraph_t *nodegraph;
 +
 +      int entryindex;
 +
 +      if (graphid < 0 || graphid >= NODEGRAPH_GRAPHSET_SIZE_LIMIT)
 +      {
 +              Con_DPrintf("%s, graphid is out of bounds: %d\n", __FUNCTION__, graphid);
 +              return false;
 +      }
 +
 +      nodegraph = &g_nodegraph_set[graphid];
 +
 +      if (nodeidfrom < 0 || nodeidfrom >= nodegraph->nodes_count)
 +      {
 +              Con_DPrintf("%s, nodeidfrom is out of bounds: %d\n", __FUNCTION__, nodeidfrom);
 +              return false;
 +      }
 +
 +      if (nodeidto < 0 || nodeidto >= nodegraph->nodes_count)
 +      {
 +              Con_DPrintf("%s, nodeidto is out of bounds: %d\n", __FUNCTION__, nodeidto);
 +              return false;
 +      }
 +
 +      entryindex = GRAPH_MATRIX_ELEMENT_INDEX(nodeidfrom, nodeidto);
 +      nodegraph->links[entryindex / 8] |= 1 << (entryindex % 8);
 +
 +      return true;
 +}
 +
 +// ============================================================================
- qboolean nodegraph_graph_does_link_exist(short graphid, short nodeidfrom, short nodeidto)
++qbool nodegraph_graph_remove_link(short graphid, short nodeidfrom, short nodeidto)
 +{
 +      nodegraph_t *nodegraph;
 +
 +      int entryindex;
 +
 +      if (graphid < 0 || graphid >= NODEGRAPH_GRAPHSET_SIZE_LIMIT)
 +      {
 +              Con_DPrintf("%s, graphid is out of bounds: %d\n", __FUNCTION__, graphid);
 +              return false;
 +      }
 +
 +      nodegraph = &g_nodegraph_set[graphid];
 +
 +      if (nodeidfrom < 0 || nodeidfrom >= nodegraph->nodes_count)
 +      {
 +              Con_DPrintf("%s, nodeidfrom is out of bounds: %d\n", __FUNCTION__, nodeidfrom);
 +              return false;
 +      }
 +
 +      if (nodeidto < 0 || nodeidto >= nodegraph->nodes_count)
 +      {
 +              Con_DPrintf("%s, nodeidto is out of bounds: %d\n", __FUNCTION__, nodeidto);
 +              return false;
 +      }
 +
 +      entryindex = GRAPH_MATRIX_ELEMENT_INDEX(nodeidfrom, nodeidto);
 +      nodegraph->links[entryindex / 8] &= ~(1 << (entryindex % 8));
 +
 +      return true;
 +}
 +
 +// ============================================================================
- qboolean nodegraph_query_release(short queryid)
++qbool nodegraph_graph_does_link_exist(short graphid, short nodeidfrom, short nodeidto)
 +{
 +      nodegraph_t *nodegraph;
 +
 +      int entryindex;
 +
 +      if (graphid < 0 || graphid >= NODEGRAPH_GRAPHSET_SIZE_LIMIT)
 +      {
 +              Con_DPrintf("%s, graphid is out of bounds: %d\n", __FUNCTION__, graphid);
 +              return false;
 +      }
 +
 +      nodegraph = &g_nodegraph_set[graphid];
 +
 +      if (nodeidfrom < 0 || nodeidfrom >= nodegraph->nodes_count)
 +      {
 +              Con_DPrintf("%s, nodeidfrom is out of bounds: %d\n", __FUNCTION__, nodeidfrom);
 +              return false;
 +      }
 +
 +      if (nodeidto < 0 || nodeidto >= nodegraph->nodes_count)
 +      {
 +              Con_DPrintf("%s, nodeidto is out of bounds: %d\n", __FUNCTION__, nodeidto);
 +              return false;
 +      }
 +
 +      entryindex = GRAPH_MATRIX_ELEMENT_INDEX(nodeidfrom, nodeidto);
 +
 +      return ((nodegraph->links[entryindex / 8] & (1 << (entryindex % 8))) != 0);
 +}
 +
 +// ============================================================================
 +short nodegraph_graph_find_nearest_nodeid(short graphid, const vec3_t position)
 +{
 +      nodegraph_t *nodegraph;
 +
 +      short i, nodeid;
 +      float distance, shortestdistance;
 +
 +      if (graphid < 0 || graphid >= NODEGRAPH_GRAPHSET_SIZE_LIMIT)
 +      {
 +              Con_DPrintf("%s, graphid is out of bounds: %d\n", __FUNCTION__, graphid);
 +              return -1;
 +      }
 +
 +      nodegraph = &g_nodegraph_set[graphid];
 +
 +      nodeid = -1;
 +      shortestdistance = 16777216.0f;
 +
 +      for (i = 0; i < nodegraph->nodes_count; i++)
 +      {
 +              distance = VectorDistance(&nodegraph->nodes[i * 3], position);
 +              
 +              if (shortestdistance > distance)
 +              {
 +                      nodeid = i;
 +                      shortestdistance = distance;
 +              }
 +      }
 +
 +      return nodeid;
 +}
 +
 +// ============================================================================
 +short nodegraph_graph_query_path(short graphid, short nodeidfrom, short nodeidto)
 +{
 +      nodegraph_t *nodegraph;
 +      nodegraph_floyd_warshall_matrix_t *floyd_matrix;
 +
 +      short i, queryid;
 +      nodegraph_query_t *query;
 +
 +      if (graphid < 0 || graphid >= NODEGRAPH_GRAPHSET_SIZE_LIMIT)
 +      {
 +              Con_DPrintf("%s, graphid is out of bounds: %d\n", __FUNCTION__, graphid);
 +              return -1;
 +      }
 +
 +      nodegraph = &g_nodegraph_set[graphid];
 +      floyd_matrix = &g_nodegraph_floyd_warshall_matrices[graphid];
 +
 +      if (nodeidfrom < 0 || nodeidfrom >= nodegraph->nodes_count)
 +      {
 +              Con_DPrintf("%s, nodeidfrom is out of bounds: %d\n", __FUNCTION__, nodeidfrom);
 +              return -1;
 +      }
 +
 +      if (nodeidto < 0 || nodeidto >= nodegraph->nodes_count)
 +      {
 +              Con_DPrintf("%s, nodeidto is out of bounds: %d\n", __FUNCTION__, nodeidto);
 +              return -1;
 +      }
 +
 +      queryid = -1;
 +
 +      for (i = 0; i < NODEGRAPH_QUERIES_COUNT_LIMIT; i++)
 +      {
 +              if (!nodegraph_query_is_valid(i))
 +              {
 +                      queryid = i;
 +                      break;
 +              }
 +      }
 +
 +      if (queryid != -1)
 +      {
 +              query = &g_nodegraph_queries[queryid];
 +
 +              query->graphid = graphid;
 +
 +              if (floyd_matrix->indexes[GRAPH_MATRIX_ELEMENT_INDEX(nodeidfrom, nodeidto)] != -1)
 +              {
 +                      query->entries[query->entries_count] = nodeidfrom;
 +                      query->entries_count++;
 +
 +                      while (nodeidfrom != nodeidto)
 +                      {
 +                              nodeidfrom = floyd_matrix->indexes[GRAPH_MATRIX_ELEMENT_INDEX(nodeidfrom, nodeidto)];
 +
 +                              query->entries[query->entries_count] = nodeidfrom;
 +                              query->entries_count++;
 +
 +                              if (query->entries_count >= NODEGRAPH_QUERY_ENTRIES_LIMIT)
 +                              {
 +                                      break;
 +                              }
 +                      }
 +              }
 +
 +              if (query->entries_count == 0)
 +              {
 +                      nodegraph_query_release(queryid);
 +                      queryid = -1;
 +              }
 +      }
 +
 +      return queryid;
 +}
 +
 +// ============================================================================
 +short nodegraph_graph_query_nodes_linked(short graphid, short nodeid)
 +{
 +      nodegraph_t *nodegraph;
 +
 +      short i, queryid;
 +      nodegraph_query_t *query;
 +
 +      if (graphid < 0 || graphid >= NODEGRAPH_GRAPHSET_SIZE_LIMIT)
 +      {
 +              Con_DPrintf("%s, graphid is out of bounds: %d\n", __FUNCTION__, graphid);
 +              return -1;
 +      }
 +
 +      nodegraph = &g_nodegraph_set[graphid];
 +
 +      if (nodeid < 0 || nodeid >= nodegraph->nodes_count)
 +      {
 +              Con_DPrintf("%s, nodeid is out of bounds: %d\n", __FUNCTION__, nodeid);
 +              return -1;
 +      }
 +
 +      queryid = -1;
 +
 +      for (i = 0; i < NODEGRAPH_QUERIES_COUNT_LIMIT; i++)
 +      {
 +              if (!nodegraph_query_is_valid(i))
 +              {
 +                      queryid = i;
 +                      break;
 +              }
 +      }
 +
 +      if (queryid != -1)
 +      {
 +              query = &g_nodegraph_queries[queryid];
 +
 +              query->graphid = graphid;
 +
 +              for (i = 0; i < nodegraph->nodes_count; i++)
 +              {
 +                      if (nodegraph_graph_does_link_exist(graphid, nodeid, i))
 +                      {
 +                              query->entries[query->entries_count] = i;
 +                              query->entries_count++;
 +                      }
 +
 +                      if (query->entries_count >= NODEGRAPH_QUERY_ENTRIES_LIMIT)
 +                      {
 +                              break;
 +                      }
 +              }
 +
 +              if (query->entries_count == 0)
 +              {
 +                      nodegraph_query_release(queryid);
 +                      queryid = -1;
 +              }
 +              else
 +              {
 +                      g_nodegraph_query_sort_data.queryid = queryid;
 +                      nodegraph_graph_get_node(graphid, nodeid, g_nodegraph_query_sort_data.point);
 +
 +                      qsort(query->entries, query->entries_count, sizeof(short), nodegraph_query_sort_function);
 +              }
 +              
 +      }
 +
 +      return queryid;
 +}
 +
 +// ============================================================================
 +short nodegraph_graph_query_nodes_in_radius(short graphid, const vec3_t position, float radius)
 +{
 +      nodegraph_t *nodegraph;
 +
 +      vec3_t node;
 +      short i, queryid;
 +      nodegraph_query_t *query;
 +
 +      if (graphid < 0 || graphid >= NODEGRAPH_GRAPHSET_SIZE_LIMIT)
 +      {
 +              Con_DPrintf("%s, graphid is out of bounds: %d\n", __FUNCTION__, graphid);
 +              return -1;
 +      }
 +
 +      nodegraph = &g_nodegraph_set[graphid];
 +
 +      queryid = -1;
 +
 +      for (i = 0; i < NODEGRAPH_QUERIES_COUNT_LIMIT; i++)
 +      {
 +              if (!nodegraph_query_is_valid(i))
 +              {
 +                      queryid = i;
 +                      break;
 +              }
 +      }
 +
 +      if (queryid != -1)
 +      {
 +              query = &g_nodegraph_queries[queryid];
 +
 +              query->graphid = graphid;
 +
 +              for (i = 0; i < nodegraph->nodes_count; i++)
 +              {
 +                      nodegraph_graph_get_node(graphid, i, node);
 +                      
 +                      if (VectorDistance(position, node) <= radius)
 +                      {
 +                              query->entries[query->entries_count] = i;
 +                              query->entries_count++;
 +                      }
 +
 +                      if (query->entries_count >= NODEGRAPH_QUERY_ENTRIES_LIMIT)
 +                      {
 +                              break;
 +                      }
 +              }
 +
 +              if (query->entries_count == 0)
 +              {
 +                      nodegraph_query_release(queryid);
 +                      queryid = -1;
 +              }
 +              else
 +              {
 +                      g_nodegraph_query_sort_data.queryid = queryid;
 +                      VectorCopy(position, g_nodegraph_query_sort_data.point);
 +
 +                      qsort(query->entries, query->entries_count, sizeof(short), nodegraph_query_sort_function);
 +              }
 +      }
 +
 +      return queryid;
 +}
 +
 +// ============================================================================
- qboolean nodegraph_query_is_valid(short queryid)
++qbool nodegraph_query_release(short queryid)
 +{
 +      nodegraph_query_t *query;
 +
 +      if (queryid < 0 || queryid >= NODEGRAPH_QUERIES_COUNT_LIMIT)
 +      {
 +              Con_DPrintf("%s, queryid is out of bounds: %d\n", __FUNCTION__, queryid);
 +              return false;
 +      }
 +
 +      query = &g_nodegraph_queries[queryid];
 +      memset((void *)query, 0, sizeof(nodegraph_query_t));
 +      
 +      return true;
 +}
 +
 +// ============================================================================
 +short nodegraph_query_entries_count(short queryid)
 +{
 +      nodegraph_query_t *query;
 +
 +      if (queryid < 0 || queryid >= NODEGRAPH_QUERIES_COUNT_LIMIT)
 +      {
 +              Con_DPrintf("%s, queryid is out of bounds: %d\n", __FUNCTION__, queryid);
 +              return -1;
 +      }
 +
 +      query = &g_nodegraph_queries[queryid];
 +
 +      return query->entries_count;
 +}
 +
 +// ============================================================================
- qboolean nodegraph_moveprobe_fly(const vec3_t nodefrom, const vec3_t nodeto, const vec3_t mins, const vec3_t maxs, short type)
++qbool nodegraph_query_is_valid(short queryid)
 +{
 +      nodegraph_query_t *query;
 +
 +      if (queryid < 0 || queryid >= NODEGRAPH_QUERIES_COUNT_LIMIT)
 +      {
 +              return false;
 +      }
 +
 +      query = &g_nodegraph_queries[queryid];
 +
 +      return query->entries_count > 0;
 +}
 +
 +// ============================================================================
 +short nodegraph_query_get_graphid(short queryid)
 +{
 +      nodegraph_query_t *query;
 +
 +      if (queryid < 0 || queryid >= NODEGRAPH_QUERIES_COUNT_LIMIT)
 +      {
 +              Con_DPrintf("%s, queryid is out of bounds: %d\n", __FUNCTION__, queryid);
 +              return -1;
 +      }
 +
 +      query = &g_nodegraph_queries[queryid];
 +
 +      return query->graphid;
 +}
 +
 +// ============================================================================
 +short nodegraph_query_get_nodeid(short queryid, short entryid)
 +{
 +      nodegraph_query_t *query;
 +
 +      if (queryid < 0 || queryid >= NODEGRAPH_QUERIES_COUNT_LIMIT)
 +      {
 +              Con_DPrintf("%s, queryid is out of bounds: %d\n", __FUNCTION__, queryid);
 +              return -1;
 +      }
 +
 +      query = &g_nodegraph_queries[queryid];
 +
 +      if (entryid < 0 || entryid >= query->entries_count)
 +      {
 +              Con_DPrintf("%s, entryid is out of bounds: %d\n", __FUNCTION__, entryid);
 +              return -1;
 +      }
 +
 +      if (query->graphid < 0 || query->graphid >= NODEGRAPH_GRAPHSET_SIZE_LIMIT)
 +      {
 +              Con_DPrintf("%s, graphid is out of bounds: %d\n", __FUNCTION__, query->graphid);
 +              return -1;
 +      }
 +
 +      return query->entries[entryid];
 +}
 +
 +// ============================================================================
-       qboolean connected;
++qbool nodegraph_moveprobe_fly(const vec3_t nodefrom, const vec3_t nodeto, const vec3_t mins, const vec3_t maxs, short type)
 +{
 +      int contents = SUPERCONTENTS_SOLID | SUPERCONTENTS_MONSTERCLIP | SUPERCONTENTS_BOTCLIP;
 +
 +      vec3_t from, to;
 +      trace_t trace;
 +
- qboolean nodegraph_moveprobe_walk(const vec3_t nodefrom, const vec3_t nodeto, const vec3_t mins, const vec3_t maxs, float stepheight, float dropheight)
++      qbool connected;
 +
 +      if (type == NODEGRAPH_MOVEPROBE_TYPE_FLY_AIR || type == NODEGRAPH_MOVEPROBE_TYPE_FLY_WATER)
 +      {
 +              contents |= SUPERCONTENTS_LIQUIDSMASK;
 +      }
 +
 +      VectorCopy(nodefrom, from);
 +      from[2] -= mins[2];
 +
 +      VectorCopy(nodeto, to);
 +      to[2] -= mins[2];
 +
 +      trace = SV_TraceBox(from, mins, maxs, to, MOVE_NOMONSTERS, NULL, contents, 0, 0, 0.0f);
 +
 +      connected = trace.fraction == 1.0;
 +
 +      if (type == NODEGRAPH_MOVEPROBE_TYPE_FLY_AIR)
 +      {
 +              connected = connected && (SV_PointSuperContents(from) & (SUPERCONTENTS_LIQUIDSMASK)) == 0;
 +              connected = connected && (SV_PointSuperContents(to) & (SUPERCONTENTS_LIQUIDSMASK)) == 0;
 +      }
 +
 +      if (type == NODEGRAPH_MOVEPROBE_TYPE_FLY_WATER)
 +      {
 +              connected = connected && (SV_PointSuperContents(from) & (SUPERCONTENTS_LIQUIDSMASK)) != 0;
 +              connected = connected && (SV_PointSuperContents(to) & (SUPERCONTENTS_LIQUIDSMASK)) != 0;
 +      }
 +
 +      return connected;
 +}
 +
 +// ============================================================================
-       qboolean connected = false;
++qbool nodegraph_moveprobe_walk(const vec3_t nodefrom, const vec3_t nodeto, const vec3_t mins, const vec3_t maxs, float stepheight, float dropheight)
 +{
 +      int contents = SUPERCONTENTS_SOLID | SUPERCONTENTS_MONSTERCLIP | SUPERCONTENTS_BOTCLIP;
 +
 +      float distance, walked;
 +      float tracestep = max(1.0f, min(maxs[0] - mins[0], maxs[1] - mins[1]) / 2.0f);
 +
 +      vec3_t from, to, direction, destination;
 +
++      qbool connected = false;
 +
 +      VectorSubtract(nodeto, nodefrom, direction);
 +      distance = VectorLength(direction);
 +
 +      if (distance <= 0.015625f)
 +      {
 +              return true;
 +      }
 +
 +      direction[2] = 0.0f;
 +      VectorNormalize(direction);
 +
 +      VectorCopy(nodefrom, from);
 +      from[2] -= mins[2];
 +
 +      VectorCopy(nodeto, destination);
 +      destination[2] -= mins[2];
 +
 +      walked = 0.0f;
 +
 +      while (walked <= distance)
 +      {
 +              trace_t trace;
 +
 +              VectorMA(from, tracestep, direction, from);
 +              from[2] += stepheight;
 +
 +              VectorCopy(from, to);
 +              to[2] -= stepheight + dropheight + 0.5f;
 +
 +              trace = SV_TraceBox(from, mins, maxs, to, MOVE_NOMONSTERS, NULL, contents, 0, 0, 0.0f);
 +
 +              if (trace.startsolid || trace.fraction == 1.0)
 +              {
 +                      break;
 +              }
 +
 +              if (VectorDistance(trace.endpos, destination) <= tracestep)
 +              {
 +                      connected = true;
 +                      break;
 +              }
 +
 +              VectorCopy(trace.endpos, from);
 +
 +              walked += tracestep;
 +      }
 +
 +      return connected;
 +}
 +
 +// ============================================================================
 +short nodegraph_graph_query_nodes_in_radius_fly_reachable(short graphid, const vec3_t position, float radius, const vec3_t mins, const vec3_t maxs, short type)
 +{
 +      nodegraph_t *nodegraph;
 +
 +      vec3_t node;
 +      short i, queryid;
 +      nodegraph_query_t *query;
 +
 +      if (graphid < 0 || graphid >= NODEGRAPH_GRAPHSET_SIZE_LIMIT)
 +      {
 +              Con_DPrintf("%s, graphid is out of bounds: %d\n", __FUNCTION__, graphid);
 +              return -1;
 +      }
 +
 +      nodegraph = &g_nodegraph_set[graphid];
 +
 +      queryid = -1;
 +
 +      for (i = 0; i < NODEGRAPH_QUERIES_COUNT_LIMIT; i++)
 +      {
 +              if (!nodegraph_query_is_valid(i))
 +              {
 +                      queryid = i;
 +                      break;
 +              }
 +      }
 +
 +      if (queryid != -1)
 +      {
 +              query = &g_nodegraph_queries[queryid];
 +
 +              query->graphid = graphid;
 +
 +              for (i = 0; i < nodegraph->nodes_count; i++)
 +              {
 +                      nodegraph_graph_get_node(graphid, i, node);
 +                      
 +                      if (VectorDistance(position, node) <= radius)
 +                      {
 +                              if (nodegraph_moveprobe_fly(position, node, mins, maxs, type))
 +                              {
 +                                      query->entries[query->entries_count] = i;
 +                                      query->entries_count++;
 +                              }
 +                      }
 +
 +                      if (query->entries_count >= NODEGRAPH_QUERY_ENTRIES_LIMIT)
 +                      {
 +                              break;
 +                      }
 +              }
 +
 +              if (query->entries_count == 0)
 +              {
 +                      nodegraph_query_release(queryid);
 +                      queryid = -1;
 +              }
 +              else
 +              {
 +                      g_nodegraph_query_sort_data.queryid = queryid;
 +                      VectorCopy(position, g_nodegraph_query_sort_data.point);
 +
 +                      qsort(query->entries, query->entries_count, sizeof(short), nodegraph_query_sort_function);
 +              }
 +      }
 +
 +      return queryid;
 +}
 +
 +// ============================================================================
 +short nodegraph_graph_query_nodes_in_radius_walk_reachable(short graphid, const vec3_t position, float radius, const vec3_t mins, const vec3_t maxs, float stepheight, float dropheight)
 +{
 +      nodegraph_t *nodegraph;
 +
 +      vec3_t node;
 +      short i, queryid;
 +      nodegraph_query_t *query;
 +
 +      if (graphid < 0 || graphid >= NODEGRAPH_GRAPHSET_SIZE_LIMIT)
 +      {
 +              Con_DPrintf("%s, graphid is out of bounds: %d\n", __FUNCTION__, graphid);
 +              return -1;
 +      }
 +
 +      nodegraph = &g_nodegraph_set[graphid];
 +
 +      queryid = -1;
 +
 +      for (i = 0; i < NODEGRAPH_QUERIES_COUNT_LIMIT; i++)
 +      {
 +              if (!nodegraph_query_is_valid(i))
 +              {
 +                      queryid = i;
 +                      break;
 +              }
 +      }
 +
 +      if (queryid != -1)
 +      {
 +              query = &g_nodegraph_queries[queryid];
 +
 +              query->graphid = graphid;
 +
 +              for (i = 0; i < nodegraph->nodes_count; i++)
 +              {
 +                      nodegraph_graph_get_node(graphid, i, node);
 +                      
 +                      if (VectorDistance(position, node) <= radius)
 +                      {
 +                              if (nodegraph_moveprobe_walk(position, node, mins, maxs, stepheight, dropheight))
 +                              {
 +                                      query->entries[query->entries_count] = i;
 +                                      query->entries_count++;
 +                              }
 +                      }
 +
 +                      if (query->entries_count >= NODEGRAPH_QUERY_ENTRIES_LIMIT)
 +                      {
 +                              break;
 +                      }
 +              }
 +
 +              if (query->entries_count == 0)
 +              {
 +                      nodegraph_query_release(queryid);
 +                      queryid = -1;
 +              }
 +              else
 +              {
 +                      g_nodegraph_query_sort_data.queryid = queryid;
 +                      VectorCopy(position, g_nodegraph_query_sort_data.point);
 +
 +                      qsort(query->entries, query->entries_count, sizeof(short), nodegraph_query_sort_function);
 +              }
 +      }
 +
 +      return queryid;
 +}
diff --cc nodegraph.h
index 818634a4e99b0dd14865640d95a8891143299c1d,0000000000000000000000000000000000000000..cd82c7cab132165555bc159f8a04359dc3224df9
mode 100644,000000..100644
--- /dev/null
@@@ -1,50 -1,0 +1,50 @@@
- qboolean nodegraph_graphset_clear(void);
 +#ifndef NODEGRAPH_H
 +#define NODEGRAPH_H
 +
 +// ============================================================================
 +#define NODEGRAPH_GRAPHSET_SIZE_LIMIT 8
 +
 +// ============================================================================
 +#define NODEGRAPH_MOVEPROBE_TYPE_FLY_WHATEVER 0
 +#define NODEGRAPH_MOVEPROBE_TYPE_FLY_AIR 1
 +#define NODEGRAPH_MOVEPROBE_TYPE_FLY_WATER 2
 +
 +// ============================================================================
- qboolean nodegraph_graphset_load(void);
- qboolean nodegraph_graphset_save(void);
++qbool nodegraph_graphset_clear(void);
 +
- qboolean nodegraph_graph_clear(short graphid);
++qbool nodegraph_graphset_load(void);
++qbool nodegraph_graphset_save(void);
 +
- qboolean nodegraph_graph_add_node(short graphid, const vec3_t node);
- qboolean nodegraph_graph_remove_node(short graphid, short nodeid);
- qboolean nodegraph_graph_is_node_valid(short graphid, short nodeid);
++qbool nodegraph_graph_clear(short graphid);
 +
 +short nodegraph_graph_nodes_count(short graphid);
 +
- qboolean nodegraph_graph_get_node(short graphid, short nodeid, vec3_t outnode);
++qbool nodegraph_graph_add_node(short graphid, const vec3_t node);
++qbool nodegraph_graph_remove_node(short graphid, short nodeid);
++qbool nodegraph_graph_is_node_valid(short graphid, short nodeid);
 +
- qboolean nodegraph_graph_add_link(short graphid, short nodeidfrom, short nodeidto);
- qboolean nodegraph_graph_remove_link(short graphid, short nodeidfrom, short nodeidto);
- qboolean nodegraph_graph_does_link_exist(short graphid, short nodeidfrom, short nodeidto);
++qbool nodegraph_graph_get_node(short graphid, short nodeid, vec3_t outnode);
 +
- qboolean nodegraph_query_release(short queryid);
++qbool nodegraph_graph_add_link(short graphid, short nodeidfrom, short nodeidto);
++qbool nodegraph_graph_remove_link(short graphid, short nodeidfrom, short nodeidto);
++qbool nodegraph_graph_does_link_exist(short graphid, short nodeidfrom, short nodeidto);
 +
 +short nodegraph_graph_find_nearest_nodeid(short graphid, const vec3_t position);
 +
 +short nodegraph_graph_query_path(short graphid, short nodeidfrom, short nodeidto);
 +short nodegraph_graph_query_nodes_linked(short graphid, short nodeid);
 +short nodegraph_graph_query_nodes_in_radius(short graphid, const vec3_t position, float radius);
 +
- qboolean nodegraph_query_is_valid(short queryid);
++qbool nodegraph_query_release(short queryid);
 +short nodegraph_query_entries_count(short queryid);
- qboolean nodegraph_moveprobe_fly(const vec3_t nodefrom, const vec3_t nodeto, const vec3_t mins, const vec3_t maxs, short type);
- qboolean nodegraph_moveprobe_walk(const vec3_t nodefrom, const vec3_t nodeto, const vec3_t mins, const vec3_t maxs, float stepheight, float dropheight);
++qbool nodegraph_query_is_valid(short queryid);
 +short nodegraph_query_get_graphid(short queryid);
 +short nodegraph_query_get_nodeid(short queryid, short entryid);
 +
++qbool nodegraph_moveprobe_fly(const vec3_t nodefrom, const vec3_t nodeto, const vec3_t mins, const vec3_t maxs, short type);
++qbool nodegraph_moveprobe_walk(const vec3_t nodefrom, const vec3_t nodeto, const vec3_t mins, const vec3_t maxs, float stepheight, float dropheight);
 +
 +short nodegraph_graph_query_nodes_in_radius_fly_reachable(short graphid, const vec3_t position, float radius, const vec3_t mins, const vec3_t maxs, short type);
 +short nodegraph_graph_query_nodes_in_radius_walk_reachable(short graphid, const vec3_t position, float radius, const vec3_t mins, const vec3_t maxs, float stepheight, float dropheight);
 +
 +#endif // NODEGRAPH_H
diff --cc prvm_cmds.c
index 8655a1c38d54ce4973966a1b285d2050e4624ba1,4990834d914fc12e66cea78203edbb1a0ec45976..6db3b6d756bbbe5452858a0d927b1a1dc3161eea
@@@ -7441,10 -6280,10 +6519,10 @@@ void VM_getsurfacenearpoint(prvm_prog_
        vec3_t clipped, p;
        vec_t dist, bestdist;
        prvm_edict_t *ed;
-       dp_model_t *model;
+       model_t *model;
        msurface_t *surface;
        vec3_t point;
 -      VM_SAFEPARMCOUNT(2, VM_getsurfacenearpoint);
 +      VM_SAFEPARMCOUNTRANGE(2, 3, VM_getsurfacenearpoint);
        PRVM_G_FLOAT(OFS_RETURN) = -1;
        ed = PRVM_G_EDICT(OFS_PARM0);
        VectorCopy(PRVM_G_VECTOR(OFS_PARM1), point);
diff --cc prvm_cmds.h
Simple merge
diff --cc prvm_offsets.h
Simple merge
diff --cc screen.h
index 268c55d64487d6cc15c961e3ee001ebb8181d528,01d264ca72a7540eb8ce826b844009ea075e8d04..7161ea7bc0126e9acea4d90cd21e29903b31e65e
+++ b/screen.h
@@@ -26,9 -30,7 +30,9 @@@ void CL_Screen_Init (void)
  void CL_UpdateScreen (void);
  void SCR_CenterPrint(const char *str);
  
- void SCR_BeginLoadingPlaque (qboolean startup);
 +void SCR_SetLoadingSplash (const char *mapname);
 +
+ void SCR_BeginLoadingPlaque (qbool startup);
  void SCR_EndLoadingPlaque (void);
  
  // invoke refresh of loading plaque (nothing else seen)
@@@ -37,46 -39,43 +41,48 @@@ void SCR_UpdateLoadingScreenIfShown(voi
  
  // pushes an item on the loading screen
  void SCR_PushLoadingScreen (const char *msg, float len_in_parent);
- void SCR_PopLoadingScreen (qboolean redraw);
- void SCR_ClearLoadingScreen (qboolean redraw);
+ void SCR_PopLoadingScreen (qbool redraw);
+ void SCR_ClearLoadingScreen (qbool redraw);
  
- qboolean SCR_LoadingScreenWaiting(void);
 +// returns true if the loading screen is waiting for a key press
++qbool SCR_LoadingScreenWaiting(void);
++
+ void SCR_CaptureVideo_SoundFrame(const struct portable_samplepair_s *paintbuffer, size_t length);
  
  extern float scr_con_current; // current height of displayed console
  
  extern int sb_lines;
  
- extern cvar_t scr_viewsize;
- extern cvar_t scr_fov;
- extern cvar_t cl_showfps;
- extern cvar_t cl_showtime;
- extern cvar_t cl_showdate;
- extern cvar_t crosshair;
- extern cvar_t crosshair_size;
- extern cvar_t scr_conalpha;
- extern cvar_t scr_conalphafactor;
- extern cvar_t scr_conalpha2factor;
- extern cvar_t scr_conalpha3factor;
- extern cvar_t scr_conscroll_x;
- extern cvar_t scr_conscroll_y;
- extern cvar_t scr_conscroll2_x;
- extern cvar_t scr_conscroll2_y;
- extern cvar_t scr_conscroll3_x;
- extern cvar_t scr_conscroll3_y;
- extern cvar_t scr_conbrightness;
- extern cvar_t r_letterbox;
- extern cvar_t scr_aspectname;
- extern cvar_t scr_refresh;
- extern cvar_t scr_stipple;
- extern cvar_t r_stereo_separation;
- extern cvar_t r_stereo_angle;
- qboolean R_Stereo_Active(void);
+ extern struct cvar_s scr_viewsize;
+ extern struct cvar_s scr_fov;
+ extern struct cvar_s cl_showfps;
+ extern struct cvar_s cl_showtime;
+ extern struct cvar_s cl_showdate;
+ extern struct cvar_s crosshair;
+ extern struct cvar_s crosshair_size;
+ extern struct cvar_s scr_conalpha;
+ extern struct cvar_s scr_conalphafactor;
+ extern struct cvar_s scr_conalpha2factor;
+ extern struct cvar_s scr_conalpha3factor;
+ extern struct cvar_s scr_conscroll_x;
+ extern struct cvar_s scr_conscroll_y;
+ extern struct cvar_s scr_conscroll2_x;
+ extern struct cvar_s scr_conscroll2_y;
+ extern struct cvar_s scr_conscroll3_x;
+ extern struct cvar_s scr_conscroll3_y;
+ extern struct cvar_s scr_conbrightness;
+ extern struct cvar_s r_letterbox;
++extern struct cvar_s scr_aspectname;
++
+ extern struct cvar_s scr_refresh;
+ extern struct cvar_s scr_stipple;
+ extern struct cvar_s r_stereo_separation;
+ extern struct cvar_s r_stereo_angle;
+ qbool R_Stereo_Active(void);
  extern int r_stereo_side;
  
  typedef struct scr_touchscreenarea_s
diff --cc sv_main.c
index 2eca3ffe71391dd7fc152f9b67dde051fbe91350,37d085088feb3e6e2e15a21da89d905970bc7728..3cd283117d08e870314b412fb9286ec05a3957df
+++ b/sv_main.c
@@@ -3426,12 -1786,10 +1786,11 @@@ void SV_SpawnServer (const char *map
  
  //    SV_LockThreadMutex();
  
-       if(cls.state == ca_dedicated)
+       if(!host_isclient.integer)
                Sys_MakeProcessNice();
-       if (cls.state != ca_dedicated)
+       else
        {
 +              SCR_SetLoadingSplash(NULL); // clear splash
                SCR_BeginLoadingPlaque(false);
                S_StopAllSounds();
        }
diff --cc sv_move.c
index 69a1f94e529d03199f085815923650770049c2e1,0699180d12f6e3bcdd1460723a6a157ff346d9e8..acadb1d8774081d870f560b83bff44916e392a1f
+++ b/sv_move.c
@@@ -107,10 -106,10 +107,10 @@@ The move will be adjusted for slopes an
  possible, no move is done and false is returned
  =============
  */
- qboolean SV_movestep (prvm_edict_t *ent, vec3_t move, qboolean relink, qboolean noenemy, qboolean settrace)
+ qbool SV_movestep (prvm_edict_t *ent, vec3_t move, qbool relink, qbool noenemy, qbool settrace)
  {
        prvm_prog_t *prog = SVVM_prog;
 -      float           dz;
 +      float           dz, stepheight;
        vec3_t          oldorg, neworg, end, traceendpos, entorigin, entmins, entmaxs;
        trace_t         trace;
        int                     i;
diff --cc sv_phys.c
index 2be3250886492e50b1613ed120ee771bab4db475,a72a7ca6acf5b8a0142c5df48bc506834fb4635c..6ade1c25c835ced41eb5c1045d8f9b2ccb6e35fb
+++ b/sv_phys.c
@@@ -1207,7 -1207,6 +1207,7 @@@ static int SV_FlyMove (prvm_edict_t *en
        vec3_t end;
  #endif
        trace_t trace;
-       qboolean moving;
++      qbool moving;
        if (time <= 0)
                return 0;
        gravity = 0;
@@@ -2311,8 -2308,7 +2311,8 @@@ static void SV_WalkMove (prvm_edict_t *
        int type;
        vec3_t upmove, downmove, start_origin, start_velocity, stepnormal, originalmove_origin, originalmove_velocity, entmins, entmaxs;
        trace_t downtrace, trace;
-       qboolean applygravity;
+       qbool applygravity;
 +      float stepheight;
  
        // if frametime is 0 (due to client sending the same timestamp twice),
        // don't move
diff --cc svvm_cmds.c
index 09369190cc058797b978e2a8304aceab0e708124,5147a324fcf9e5e1adf53d3342b8c1e8fe76fd25..fdf334237d1853bf9acee6d517682ad867180e61
@@@ -1126,71 -1126,6 +1129,71 @@@ static void VM_SV_walkmove(prvm_prog_t 
        PRVM_serverglobaledict(self) = oldself;
  }
  
-       qboolean        settrace;
 +/*
 +===============
 +VM_SV_walkmovedist
 +
 +float(float yaw, float dist[, settrace]) walkmovedist (EXT_WRATH)
 +===============
 +*/
 +static void VM_SV_walkmovedist(prvm_prog_t *prog)
 +{
 +      prvm_edict_t    *ent;
 +      float   yaw, dist;
 +      vec3_t  move, oldorg, neworg;
 +      mfunction_t     *oldf;
 +      int     oldself;
++      qbool   settrace;
 +
 +      VM_SAFEPARMCOUNTRANGE(2, 3, VM_SV_walkmovedist);
 +
 +      // assume failure if it returns early
 +      PRVM_G_FLOAT(OFS_RETURN) = 0;
 +
 +      ent = PRVM_PROG_TO_EDICT(PRVM_serverglobaledict(self));
 +      if (ent == prog->edicts)
 +      {
 +              VM_Warning(prog, "walkmove: can not modify world entity\n");
 +              return;
 +      }
 +      if (ent->priv.server->free)
 +      {
 +              VM_Warning(prog, "walkmove: can not modify free entity\n");
 +              return;
 +      }
 +      yaw = PRVM_G_FLOAT(OFS_PARM0);
 +      dist = PRVM_G_FLOAT(OFS_PARM1);
 +      settrace = prog->argc >= 3 && PRVM_G_FLOAT(OFS_PARM2);
 +
 +      if ( !( (int)PRVM_serveredictfloat(ent, flags) & (FL_ONGROUND|FL_FLY|FL_SWIM) ) )
 +              return;
 +
 +      yaw = yaw*M_PI*2 / 360;
 +
 +      move[0] = cos(yaw)*dist;
 +      move[1] = sin(yaw)*dist;
 +      move[2] = 0;
 +
 +// save origin before move
 +      VectorCopy (PRVM_serveredictvector(ent, origin), oldorg);
 +
 +// save program state, because SV_movestep may call other progs
 +      oldf = prog->xfunction;
 +      oldself = PRVM_serverglobaledict(self);
 +
 +      SV_movestep(ent, move, true, false, settrace);
 +
 +// restore program state
 +      prog->xfunction = oldf;
 +      PRVM_serverglobaledict(self) = oldself;
 +
 +// save origin after move
 +      VectorCopy (PRVM_serveredictvector(ent, origin), neworg);
 +
 +// return distance traveled
 +      PRVM_G_FLOAT(OFS_RETURN) = VectorDistance(oldorg, neworg);
 +}
 +
  /*
  ===============
  VM_SV_droptofloor
diff --cc vid_shared.c
Simple merge
diff --cc view.c
index 4b005aea380f6b0e5bc65b82b8d88d2c95076fb7,f3f59b428ce6e494e8b0313e09d8b03bd47aa9bb..8006b2d9ab04762d22bb54deac6cf1ea37071208
--- 1/view.c
--- 2/view.c
+++ b/view.c
@@@ -480,27 -514,10 +514,21 @@@ void V_CalcRefdefUsing (const matrix4x4
        float vieworg[3], viewangles[3], smoothtime;
        float gunorg[3], gunangles[3];
        matrix4x4_t tmpmatrix;
-       qboolean realonground;
++      qbool realonground;
 +      
        static float viewheightavg;
-       float viewheight;       
- #if 0
- // begin of chase camera bounding box size for proper collisions by Alexander Zubov
-       vec3_t camboxmins = {-3, -3, -3};
-       vec3_t camboxmaxs = {3, 3, 3};
- // end of chase camera bounding box size for proper collisions by Alexander Zubov
- #endif
+       float viewheight;
        trace_t trace;
  
 +      // save the "true" onground time
 +      if (clonground)
 +              cl.bobongroundtime = cl.movecmd[0].time;
 +      realonground = clonground;
 +
 +      // if nogravityonground is enabled, use a "delayed" onground flag
 +      if ((cl.moveflags & MOVEFLAG_NOGRAVITYONGROUND) && !clonground && (cl.time - cl.bobongroundtime < 0.2))
 +              clonground = true;
 +
        // react to clonground state changes (for gun bob)
        if (clonground)
        {