]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Merge branch 'master' into Cloudwalk/Host_Init-overhaul Cloudwalk/Host_Init-overhaul
authorCloudwalk <cloudwalk009@gmail.com>
Sun, 25 Oct 2020 16:58:12 +0000 (12:58 -0400)
committerCloudwalk <cloudwalk009@gmail.com>
Sun, 25 Oct 2020 16:58:12 +0000 (12:58 -0400)
57 files changed:
1  2 
cd_shared.c
cdaudio.h
cl_cmd.c
cl_demo.c
cl_main.c
cl_parse.c
cl_particles.c
cl_screen.c
cl_screen.h
cl_video.c
cl_video.h
client.h
collision.c
collision.h
common.c
console.c
fs.c
ft2.c
gl_backend.c
gl_backend.h
gl_draw.c
gl_rmain.c
gl_textures.c
host.c
keys.c
keys.h
model_alias.c
model_brush.c
model_shared.c
model_shared.h
model_sprite.c
netconn.c
netconn.h
palette.c
progsvm.h
prvm_edict.c
r_explosion.c
r_lightning.c
r_shadow.c
r_sky.c
render.h
sbar.c
server.h
snd_main.c
snd_null.c
sound.h
sv_main.c
taskqueue.c
taskqueue.h
utf8lib.c
utf8lib.h
vid.h
vid_null.c
vid_sdl.c
vid_shared.c
world.c
world.h

diff --cc cd_shared.c
index 69c80a12897d4dc9793c38ada1408164e5e82d88,0f2f6fd1bd513d70566d09f15f071ce4db11b7da..af200218c720a8ea9d9d87be9e5edd8a36d46ce9
@@@ -577,7 -570,9 +577,7 @@@ void CDAudio_Init_Commands(void
                Cvar_RegisterVariable(&music_playlist_sampleposition[i]);
        }
  
-       Cmd_AddCommand(CMD_CLIENT | CMD_CLIENT_FROM_SERVER, "cd", CD_f, "execute a CD drive command (cd on/off/reset/remap/close/play/loop/stop/pause/resume/eject/info) - use cd by itself for usage");
+       Cmd_AddCommand(CF_CLIENT | CF_CLIENT_FROM_SERVER, "cd", CD_f, "execute a CD drive command (cd on/off/reset/remap/close/play/loop/stop/pause/resume/eject/info) - use cd by itself for usage");
 -
 -      return 0;
  }
  
  int CDAudio_Startup (void)
diff --cc cdaudio.h
index 1369cd3d0a9adbb3ef1d48e0bd64e0ae0f5f503c,09099190e1fa2c4cd0a7b70de94fc8818fcd3595..93599734d2df8274a70da338529c9ad5cdc1d041
+++ b/cdaudio.h
@@@ -21,8 -24,7 +24,8 @@@ Foundation, Inc., 59 Temple Place - Sui
  extern cvar_t cdaudioinitialized;
  
  int CDAudio_Init(void);
- void CDAudio_Play(int track, qboolean looping);
 +void CDAudio_Init_Commands(void);
+ void CDAudio_Play(int track, qbool looping);
  void CDAudio_Stop(void);
  void CDAudio_Pause(void);
  void CDAudio_Resume(void);
diff --cc cl_cmd.c
Simple merge
diff --cc cl_demo.c
Simple merge
diff --cc cl_main.c
index 8eeb0114cd7f81724e1d5fba6249ea7caf1916af,2a2b9976d204dd82cc6e41bf67c9c3e1b1e6cf50..d5551891b9e7454a37924646ffe32965f1377715
+++ b/cl_main.c
@@@ -2920,8 -2950,13 +2948,10 @@@ void CL_Init (void
        {
                Con_Printf("Initializing client\n");
  
 -              R_Modules_Init();
+               Cvar_SetValueQuick(&host_isclient, 1);
                Palette_Init();
 -#ifdef CONFIG_MENU
 -              MR_Init_Commands();
 -#endif
 +
                VID_Shared_Init();
                VID_Init();
                Render_Init();
                r_refdef.scene.maxtempentities = MAX_TEMPENTITIES;
                r_refdef.scene.tempentities = (entity_render_t *)Mem_Alloc(cls.permanentmempool, sizeof(entity_render_t) * r_refdef.scene.maxtempentities);
  
 -              CL_InitInput ();
 +              Cvar_SetValueQuick(&qport, (rand() * RAND_MAX + rand()) & 0xffff);
 +
 +              CL_Screen_Init();
 +              CL_MeshEntities_Init();
 +
 +              CL_Video_Init();
 +
 +              host.hook.ConnectLocal = CL_EstablishConnection_Local;
-               #ifdef CONFIG_MENU
-               Cbuf_InsertText(&cmd_client,"menu_start\n");
-               #endif
++              host.hook.ConnectLocal = CL_EstablishConnection_Local;
++              host.hook.Disconnect = CL_Disconnect;
++              host.hook.CL_Intermission = CL_Intermission;
++              host.hook.ToggleMenu = CL_ToggleMenu_Hook;
 +      }
 +}
 +
 +void CL_Init_Commands(void)
 +{
 +      if (cls.state == ca_dedicated)
 +      {
-               Cmd_AddCommand(CMD_SERVER, "disconnect", CL_Disconnect_f, "disconnect from server (or disconnect all clients if running a server)");
++              Cmd_AddCommand(CF_SERVER, "disconnect", CL_Disconnect_f, "disconnect from server (or disconnect all clients if running a server)");
 +      }
 +      else
 +      {
 +              //
 +              // register our commands
 +              //
 +              R_Modules_Init();
 +              Palette_Init_Commands();
 +#ifdef CONFIG_MENU
 +              MR_Init_Commands();
 +#endif
 +              VID_Shared_Init_Commands();
 +              VID_Init_Commands();
 +              Render_Init_Commands();
 +              S_Init_Commands();
 +              CDAudio_Init_Commands();
 +              Key_Init_Commands();
 +              V_Init();
 +
 +              CL_InitInput();
 +              CL_Demo_Init();
 +              CL_Parse_Init();
 +              CL_Particles_Init();
 +              CL_Screen_Init_Commands();
 +              CL_Video_Init_Commands();
  
 -      //
 -      // register our commands
 -      //
 -              CL_InitCommands();
 +              CL_InitServer_Commands();
  
                Cvar_RegisterVariable (&cl_upspeed);
                Cvar_RegisterVariable (&cl_forwardspeed);
  
                Cvar_RegisterVariable (&cl_itembobspeed);
                Cvar_RegisterVariable (&cl_itembobheight);
-               Cmd_AddCommand(CMD_CLIENT, "entities", CL_PrintEntities_f, "print information on network entities known to client");
-               Cmd_AddCommand(CMD_CLIENT, "disconnect", CL_Disconnect_f, "disconnect from server (or disconnect all clients if running a server)");
-               Cmd_AddCommand(CMD_CLIENT, "connect", CL_Connect_f, "connect to a server by IP address or hostname");
-               Cmd_AddCommand(CMD_CLIENT | CMD_CLIENT_FROM_SERVER, "reconnect", CL_Reconnect_f, "reconnect to the last server you were on, or resets a quakeworld connection (do not use if currently playing on a netquake server)");
 -
 -              CL_Demo_Init();
 -
+               Cmd_AddCommand(CF_CLIENT, "entities", CL_PrintEntities_f, "print information on network entities known to client");
+               Cmd_AddCommand(CF_CLIENT, "disconnect", CL_Disconnect_f, "disconnect from server (or disconnect all clients if running a server)");
+               Cmd_AddCommand(CF_CLIENT, "connect", CL_Connect_f, "connect to a server by IP address or hostname");
+               Cmd_AddCommand(CF_CLIENT | CF_CLIENT_FROM_SERVER, "reconnect", CL_Reconnect_f, "reconnect to the last server you were on, or resets a quakeworld connection (do not use if currently playing on a netquake server)");
  
                // Support Client-side Model Index List
-               Cmd_AddCommand(CMD_CLIENT, "cl_modelindexlist", CL_ModelIndexList_f, "list information on all models in the client modelindex");
+               Cmd_AddCommand(CF_CLIENT, "cl_modelindexlist", CL_ModelIndexList_f, "list information on all models in the client modelindex");
                // Support Client-side Sound Index List
-               Cmd_AddCommand(CMD_CLIENT, "cl_soundindexlist", CL_SoundIndexList_f, "list all sounds in the client soundindex");
+               Cmd_AddCommand(CF_CLIENT, "cl_soundindexlist", CL_SoundIndexList_f, "list all sounds in the client soundindex");
  
-               Cmd_AddCommand(CMD_CLIENT, "fog", CL_Fog_f, "set global fog parameters (density red green blue [alpha [mindist [maxdist [top [fadedepth]]]]])");
-               Cmd_AddCommand(CMD_CLIENT, "fog_heighttexture", CL_Fog_HeightTexture_f, "set global fog parameters (density red green blue alpha mindist maxdist top depth textures/mapname/fogheight.tga)");
+               Cmd_AddCommand(CF_CLIENT, "fog", CL_Fog_f, "set global fog parameters (density red green blue [alpha [mindist [maxdist [top [fadedepth]]]]])");
+               Cmd_AddCommand(CF_CLIENT, "fog_heighttexture", CL_Fog_HeightTexture_f, "set global fog parameters (density red green blue alpha mindist maxdist top depth textures/mapname/fogheight.tga)");
  
-               Cmd_AddCommand(CMD_CLIENT, "cl_areastats", CL_AreaStats_f, "prints statistics on entity culling during collision traces");
+               Cmd_AddCommand(CF_CLIENT, "cl_areastats", CL_AreaStats_f, "prints statistics on entity culling during collision traces");
  
                Cvar_RegisterVariable(&r_draweffects);
                Cvar_RegisterVariable(&cl_explosions_alpha_start);
  
                // for QW connections
                Cvar_RegisterVariable(&qport);
 -              Cvar_SetValueQuick(&qport, (rand() * RAND_MAX + rand()) & 0xffff);
  
-               Cmd_AddCommand(CMD_CLIENT, "timerefresh", CL_TimeRefresh_f, "turn quickly and print rendering statistcs");
+               Cmd_AddCommand(CF_CLIENT, "timerefresh", CL_TimeRefresh_f, "turn quickly and print rendering statistcs");
  
                Cvar_RegisterVariable(&cl_locs_enable);
                Cvar_RegisterVariable(&cl_locs_show);
diff --cc cl_parse.c
Simple merge
diff --cc cl_particles.c
Simple merge
diff --cc cl_screen.c
index c5adf1943c5c58f7d405028cb21edb92ad2e45cf,186342d1b34b18c9767a25637df17afc4f0d28b6..fcce2cf41db4ec2a6c26affffe195656ec5319be
@@@ -1278,19 -763,6 +763,19 @@@ void CL_Screen_Shutdown(void
  }
  
  void CL_Screen_Init(void)
-       if (COM_CheckParm ("-noconsole"))
 +{
 +      // if we want no console, turn it off here too
++      if (Sys_CheckParm ("-noconsole"))
 +              Cvar_SetQuick(&scr_conforcewhiledisconnected, "0");
 +
 +#ifdef CONFIG_VIDEO_CAPTURE
 +      SCR_CaptureVideo_Ogg_Init();
 +#endif
 +
 +      scr_initialized = true;
 +}
 +
 +void CL_Screen_Init_Commands(void)
  {
        int i;
        Cvar_RegisterVariable (&scr_fov);
        Cvar_RegisterVariable(&r_speeds_graph_height);
        Cvar_RegisterVariable(&r_speeds_graph_maxtimedelta);
        Cvar_RegisterVariable(&r_speeds_graph_maxdefault);
-       Cmd_AddCommand(CMD_CLIENT, "sizeup",SCR_SizeUp_f, "increase view size (increases viewsize cvar)");
-       Cmd_AddCommand(CMD_CLIENT, "sizedown",SCR_SizeDown_f, "decrease view size (decreases viewsize cvar)");
-       Cmd_AddCommand(CMD_CLIENT, "screenshot",SCR_ScreenShot_f, "takes a screenshot of the next rendered frame");
-       Cmd_AddCommand(CMD_CLIENT, "envmap", R_Envmap_f, "render a cubemap (skybox) of the current scene");
-       Cmd_AddCommand(CMD_CLIENT, "infobar", SCR_InfoBar_f, "display a text in the infobar (usage: infobar expiretime string)");
 -      // if we want no console, turn it off here too
 -      if (Sys_CheckParm ("-noconsole"))
 -              Cvar_SetQuick(&scr_conforcewhiledisconnected, "0");
 -
+       Cmd_AddCommand(CF_CLIENT, "sizeup",SCR_SizeUp_f, "increase view size (increases viewsize cvar)");
+       Cmd_AddCommand(CF_CLIENT, "sizedown",SCR_SizeDown_f, "decrease view size (decreases viewsize cvar)");
+       Cmd_AddCommand(CF_CLIENT, "screenshot",SCR_ScreenShot_f, "takes a screenshot of the next rendered frame");
+       Cmd_AddCommand(CF_CLIENT, "envmap", R_Envmap_f, "render a cubemap (skybox) of the current scene");
+       Cmd_AddCommand(CF_CLIENT, "infobar", SCR_InfoBar_f, "display a text in the infobar (usage: infobar expiretime string)");
 -
 -#ifdef CONFIG_VIDEO_CAPTURE
 -      SCR_CaptureVideo_Ogg_Init();
 -#endif
 -
 -      scr_initialized = true;
  }
  
  /*
diff --cc cl_screen.h
Simple merge
diff --cc cl_video.c
index 15be13e9d31f4b517a7f898ddb5ee63c4033a6f2,2804661b2b8c38c437ac6a51a779a27ee89b32e0..4a16b16b7079a696d5fc444131d9627fd61ac7ea
@@@ -689,15 -689,8 +689,15 @@@ void CL_Video_Init( void 
        bgra.i = 0;bgra.b[1] = 0xFF;cl_videogmask = bgra.i;
        bgra.i = 0;bgra.b[2] = 0xFF;cl_videormask = bgra.i;
  
-       Cmd_AddCommand(CMD_CLIENT, "playvideo", CL_PlayVideo_f, "play a .dpv video file" );
-       Cmd_AddCommand(CMD_CLIENT, "stopvideo", CL_StopVideo_f, "stop playing a .dpv video file" );
 +      R_RegisterModule( "CL_Video", cl_video_start, cl_video_shutdown, cl_video_newmap, NULL, NULL );
 +
 +      LibAvW_OpenLibrary();
 +}
 +
 +void CL_Video_Init_Commands(void)
 +{
+       Cmd_AddCommand(CF_CLIENT, "playvideo", CL_PlayVideo_f, "play a .dpv video file" );
+       Cmd_AddCommand(CF_CLIENT, "stopvideo", CL_StopVideo_f, "stop playing a .dpv video file" );
  
        Cvar_RegisterVariable(&cl_video_subtitles);
        Cvar_RegisterVariable(&cl_video_subtitles_lines);
diff --cc cl_video.h
Simple merge
diff --cc client.h
index 5824d83ad90cd4b7684aa70201835d6c6c3f6d10,b4e8eb7a3b7df2a167045cd0b21784d5770d89ce..2074d7bd29aea96988fa2d729b24c6059826da86
+++ b/client.h
@@@ -1537,8 -1213,9 +1213,10 @@@ double CL_Frame(double time)
  
  void CL_Shutdown (void);
  void CL_Init (void);
 +void CL_Init_Commands(void);
  
+ void CL_StartVideo(void);
  void CL_EstablishConnection(const char *host, int firstarg);
  
  void CL_Disconnect (void);
diff --cc collision.c
Simple merge
diff --cc collision.h
Simple merge
diff --cc common.c
Simple merge
diff --cc console.c
index ddab28ada19f40904a35abb48a3ffe8a3dbeefa5,ad20495cd9e47df86eb7f5e54fb0b386d42497e6..a84fa6ae52e5973c996b0348191ebe754f3d9f5b
+++ b/console.c
@@@ -873,20 -873,6 +873,20 @@@ void Con_Init (void
        logqueue = (unsigned char *)Mem_Alloc (tempmempool, logq_size);
        logq_ind = 0;
  
-       if (COM_CheckParm ("-condebug") != 0)
 +      // support for the classic Quake option
 +// COMMANDLINEOPTION: Console: -condebug logs console messages to qconsole.log, see also log_file
++      if (Sys_CheckParm ("-condebug") != 0)
 +              Cvar_SetQuick (&log_file, "qconsole.log");
 +
 +      con_initialized = true;
 +      // initialize console window (only used by sys_win.c)
 +      Sys_InitConsole();
 +      
 +      Con_Print("Console initialized.\n");
 +}
 +
 +void Con_Init_Commands(void)
 +{
        Cvar_RegisterVariable (&sys_colortranslation);
        Cvar_RegisterVariable (&sys_specialcharactertranslation);
  
        Cvar_RegisterVariable(&rcon_password);
  
        // register our commands
-       Cmd_AddCommand(CMD_CLIENT, "toggleconsole", Con_ToggleConsole_f, "opens or closes the console");
-       Cmd_AddCommand(CMD_CLIENT, "messagemode", Con_MessageMode_f, "input a chat message to say to everyone");
-       Cmd_AddCommand(CMD_CLIENT, "messagemode2", Con_MessageMode2_f, "input a chat message to say to only your team");
-       Cmd_AddCommand(CMD_CLIENT, "commandmode", Con_CommandMode_f, "input a console command");
-       Cmd_AddCommand(CMD_SHARED, "clear", Con_Clear_f, "clear console history");
-       Cmd_AddCommand(CMD_SHARED, "maps", Con_Maps_f, "list information about available maps");
-       Cmd_AddCommand(CMD_SHARED, "condump", Con_ConDump_f, "output console history to a file (see also log_file)");
+       Cmd_AddCommand(CF_CLIENT, "toggleconsole", Con_ToggleConsole_f, "opens or closes the console");
+       Cmd_AddCommand(CF_CLIENT, "messagemode", Con_MessageMode_f, "input a chat message to say to everyone");
+       Cmd_AddCommand(CF_CLIENT, "messagemode2", Con_MessageMode2_f, "input a chat message to say to only your team");
+       Cmd_AddCommand(CF_CLIENT, "commandmode", Con_CommandMode_f, "input a console command");
+       Cmd_AddCommand(CF_SHARED, "clear", Con_Clear_f, "clear console history");
+       Cmd_AddCommand(CF_SHARED, "maps", Con_Maps_f, "list information about available maps");
+       Cmd_AddCommand(CF_SHARED, "condump", Con_ConDump_f, "output console history to a file (see also log_file)");
 -
 -      con_initialized = true;
 -      // initialize console window (only used by sys_win.c)
 -      Sys_InitConsole();
 -      
 -      Con_Print("Console initialized.\n");
  }
  
  void Con_Shutdown (void)
diff --cc fs.c
Simple merge
diff --cc ft2.c
Simple merge
diff --cc gl_backend.c
index 8451c3ef16a230f5227e99158ed3fb6ba1a4c8d5,ad4a0cdc21ae05de04e3d487eacfa9f7f822887f..978c97de110240acb171d27c75f233af6898ad06
@@@ -379,10 -374,12 +379,10 @@@ void gl_backend_init_Commands(void
        Cvar_RegisterVariable(&gl_paranoid);
        Cvar_RegisterVariable(&gl_printcheckerror);
  
-       Cmd_AddCommand(CMD_CLIENT, "gl_vbostats", GL_VBOStats_f, "prints a list of all buffer objects (vertex data and triangle elements) and total video memory used by them");
+       Cmd_AddCommand(CF_CLIENT, "gl_vbostats", GL_VBOStats_f, "prints a list of all buffer objects (vertex data and triangle elements) and total video memory used by them");
 -
 -      R_RegisterModule("GL_Backend", gl_backend_start, gl_backend_shutdown, gl_backend_newmap, gl_backend_devicelost, gl_backend_devicerestored);
  }
  
- void GL_SetMirrorState(qboolean state);
+ void GL_SetMirrorState(qbool state);
  
  void R_Viewport_TransformToScreen(const r_viewport_t *v, const vec4_t in, vec4_t out)
  {
diff --cc gl_backend.h
Simple merge
diff --cc gl_draw.c
index 671ef1a3b5e44af58a22ddcf29f0577e8f10155a,2211f261cdd99eb5ddff18a567048d03ba57ae77..8153a0753011684088fb14c497b73550fa19fe34
+++ b/gl_draw.c
@@@ -758,23 -771,7 +758,23 @@@ void GL_Draw_Init (void
        R_RegisterModule("GL_Draw", gl_draw_start, gl_draw_shutdown, gl_draw_newmap, NULL, NULL);
  }
  
-       Cmd_AddCommand(CMD_CLIENT, "loadfont", LoadFont_f, "loadfont function tganame loads a font; example: loadfont console gfx/veramono; loadfont without arguments lists the available functions");
 +void GL_Draw_Init_Commands(void)
 +{
 +      Cvar_RegisterVariable(&r_font_postprocess_blur);
 +      Cvar_RegisterVariable(&r_font_postprocess_outline);
 +      Cvar_RegisterVariable(&r_font_postprocess_shadow_x);
 +      Cvar_RegisterVariable(&r_font_postprocess_shadow_y);
 +      Cvar_RegisterVariable(&r_font_postprocess_shadow_z);
 +      Cvar_RegisterVariable(&r_font_hinting);
 +      Cvar_RegisterVariable(&r_font_antialias);
 +      Cvar_RegisterVariable(&r_textshadow);
 +      Cvar_RegisterVariable(&r_textbrightness);
 +      Cvar_RegisterVariable(&r_textcontrast);
 +      Cvar_RegisterVariable(&r_nearest_2d);
 +      Cvar_RegisterVariable(&r_nearest_conchars);
++      Cmd_AddCommand(CF_CLIENT, "loadfont", LoadFont_f, "loadfont function tganame loads a font; example: loadfont console gfx/veramono; loadfont without arguments lists the available functions");
 +}
 +
  void DrawQ_Start(void)
  {
        r_refdef.draw2dstage = 1;
diff --cc gl_rmain.c
index 4a83380e928e891d4c88521baba70c6bcbbbb4ee,5fc7862b95e55fe7bca9c0bd1daa92e64e19c18d..ae3ee8a04a0def65f45ba62c64f650d59b1d89f9
@@@ -3227,16 -3227,9 +3227,16 @@@ void GL_Main_Init(void
        r_main_mempool = Mem_AllocPool("Renderer", 0, NULL);
        R_InitShaderModeInfo();
  
-       Cmd_AddCommand(CMD_CLIENT, "r_glsl_restart", R_GLSL_Restart_f, "unloads GLSL shaders, they will then be reloaded as needed");
-       Cmd_AddCommand(CMD_CLIENT, "r_glsl_dumpshader", R_GLSL_DumpShader_f, "dumps the engine internal default.glsl shader into glsl/default.glsl");
 +      if (gamemode == GAME_NEHAHRA || gamemode == GAME_TENEBRAE)
 +              Cvar_SetValue(&cvars_all, "r_fullbrights", 0);
 +
 +      R_RegisterModule("GL_Main", gl_main_start, gl_main_shutdown, gl_main_newmap, NULL, NULL);
 +}
 +
 +void GL_Main_Init_Commands(void)
 +{
+       Cmd_AddCommand(CF_CLIENT, "r_glsl_restart", R_GLSL_Restart_f, "unloads GLSL shaders, they will then be reloaded as needed");
+       Cmd_AddCommand(CF_CLIENT, "r_glsl_dumpshader", R_GLSL_DumpShader_f, "dumps the engine internal default.glsl shader into glsl/default.glsl");
        // FIXME: the client should set up r_refdef.fog stuff including the fogmasktable
        if (gamemode == GAME_NEHAHRA)
        {
diff --cc gl_textures.c
index eb8e863176373da8cedce243d3323c1530abe80b,834752273af75d4bd27edb03544893cb665aae3f..f091229f4c898ee7b859db1c180c0aa2a8d51ad7
@@@ -699,14 -699,9 +699,14 @@@ static void r_textures_devicerestored(v
  
  
  void R_Textures_Init (void)
 +{
 +      R_RegisterModule("R_Textures", r_textures_start, r_textures_shutdown, r_textures_newmap, r_textures_devicelost, r_textures_devicerestored);
 +}
 +
 +void R_Textures_Init_Commands(void)
  {
-       Cmd_AddCommand(CMD_CLIENT, "gl_texturemode", &GL_TextureMode_f, "set texture filtering mode (GL_NEAREST, GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, etc); an additional argument 'force' forces the texture mode even in cases where it may not be appropriate");
-       Cmd_AddCommand(CMD_CLIENT, "r_texturestats", R_TextureStats_f, "print information about all loaded textures and some statistics");
+       Cmd_AddCommand(CF_CLIENT, "gl_texturemode", &GL_TextureMode_f, "set texture filtering mode (GL_NEAREST, GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, etc); an additional argument 'force' forces the texture mode even in cases where it may not be appropriate");
+       Cmd_AddCommand(CF_CLIENT, "r_texturestats", R_TextureStats_f, "print information about all loaded textures and some statistics");
        Cvar_RegisterVariable (&gl_max_size);
        Cvar_RegisterVariable (&gl_picmip);
        Cvar_RegisterVariable (&gl_picmip_world);
diff --cc host.c
index 111d2b2b96550bb05e3aa5b1c3c9264f96cf6388,8cf8593d5836b0e6b9242dfe26417097cb0a3c0b..b1f6f1fe7aafc82520fa933f7bd4637dc7db7ab7
--- 1/host.c
--- 2/host.c
+++ b/host.c
@@@ -232,12 -176,12 +176,12 @@@ void Host_SaveConfig_f(cmd_state_t *cmd
  void Host_LoadConfig_f(cmd_state_t *cmd);
  extern cvar_t sv_writepicture_quality;
  extern cvar_t r_texture_jpeg_fastpicmip;
 -static void Host_InitLocal (void)
 +static void Host_InitLocal_Commands (void)
  {
-       Cmd_AddCommand(CMD_SHARED, "quit", Host_Quit_f, "quit the game");
-       Cmd_AddCommand(CMD_SHARED, "version", Host_Version_f, "print engine version");
-       Cmd_AddCommand(CMD_SHARED, "saveconfig", Host_SaveConfig_f, "save settings to config.cfg (or a specified filename) immediately (also automatic when quitting)");
-       Cmd_AddCommand(CMD_SHARED, "loadconfig", Host_LoadConfig_f, "reset everything and reload configs");
+       Cmd_AddCommand(CF_SHARED, "quit", Host_Quit_f, "quit the game");
+       Cmd_AddCommand(CF_SHARED, "version", Host_Version_f, "print engine version");
+       Cmd_AddCommand(CF_SHARED, "saveconfig", Host_SaveConfig_f, "save settings to config.cfg (or a specified filename) immediately (also automatic when quitting)");
+       Cmd_AddCommand(CF_SHARED, "loadconfig", Host_LoadConfig_f, "reset everything and reload configs");
        Cvar_RegisterVariable (&cl_maxphysicsframesperserverframe);
        Cvar_RegisterVariable (&host_framerate);
        Cvar_RegisterCallback (&host_framerate, Host_Framerate_c);
@@@ -656,15 -595,9 +595,15 @@@ static void Host_Init (void
        }
  
  // COMMANDLINEOPTION: Console: -nostdout disables text output to the terminal the game was launched from
-       if (COM_CheckParm("-nostdout"))
+       if (Sys_CheckParm("-nostdout"))
                sys_nostdout = 1;
  
 +      /* FIXME: We don't know if we're dedicated until after cvars are initialized
 +       * yet we use this to gate off some cvars. Setting this early.
 +       */
 +      if(!cl_available)
 +              cls.state = ca_dedicated;
 +
        // initialize console command/cvar/alias/command execution systems
        Cmd_Init();
  
        Mod_Init();
        World_Init();
        SV_Init();
-       Host_ServerOptions();
 -      Host_InitLocal();
  
        Thread_Init();
 -      TaskQueue_Init();
  
        CL_Init();
  
diff --cc keys.c
Simple merge
diff --cc keys.h
index 8f8a5f100e26ae70a92fb4cff9188b5775335376,f6b78cd0c841a385efea99dee7988d09c72530cd..143fc01593eb53800c6889bf48cd7c880feff95e
--- 1/keys.h
--- 2/keys.h
+++ b/keys.h
@@@ -371,12 -375,12 +375,12 @@@ extern int chat_mode; // 0 for say, 1 f
  extern char chat_buffer[MAX_INPUTLINE];
  extern int    chat_bufferpos;
  
- int Key_ClearEditLine(qboolean is_console);
+ int Key_ClearEditLine(qbool is_console);
  void Key_WriteBindings(qfile_t *f);
  void Key_Init(void);
 +void Key_Init_Commands(void);
  void Key_Shutdown(void);
- void Key_Event(int key, int ascii, qboolean down);
 -void Key_Init_Cvars(void);
+ void Key_Event(int key, int ascii, qbool down);
  void Key_ReleaseAll (void);
  void Key_ReleaseAll_f(cmd_state_t *cmd);
  void Key_EventQueue_Block(void);
diff --cc model_alias.c
Simple merge
diff --cc model_brush.c
index 0b0a3c376fbf6ccc90333d6d7c98d340b5d74a19,cc52e72e2111fd90a4a1c6e0183c201a7db2037f..56da707c97be46ef727e48340892315c152cf5b9
@@@ -73,42 -73,9 +73,42 @@@ static texture_t mod_q1bsp_texture_lava
  static texture_t mod_q1bsp_texture_slime;
  static texture_t mod_q1bsp_texture_water;
  
- static qboolean Mod_Q3BSP_TraceLineOfSight(struct model_s *model, const vec3_t start, const vec3_t end, const vec3_t acceptmins, const vec3_t acceptmaxs);
+ static qbool Mod_Q3BSP_TraceLineOfSight(struct model_s *model, const vec3_t start, const vec3_t end, const vec3_t acceptmins, const vec3_t acceptmaxs);
  
  void Mod_BrushInit(void)
 +{
 +      // these games were made for older DP engines and are no longer
 +      // maintained; use this hack to show their textures properly
 +      if(gamemode == GAME_NEXUIZ)
 +              Cvar_SetQuick(&mod_q3shader_force_addalpha, "1");
 +
 +      memset(&mod_q1bsp_texture_solid, 0, sizeof(mod_q1bsp_texture_solid));
 +      strlcpy(mod_q1bsp_texture_solid.name, "solid" , sizeof(mod_q1bsp_texture_solid.name));
 +      mod_q1bsp_texture_solid.surfaceflags = 0;
 +      mod_q1bsp_texture_solid.supercontents = SUPERCONTENTS_SOLID;
 +
 +      mod_q1bsp_texture_sky = mod_q1bsp_texture_solid;
 +      strlcpy(mod_q1bsp_texture_sky.name, "sky", sizeof(mod_q1bsp_texture_sky.name));
 +      mod_q1bsp_texture_sky.surfaceflags = Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NOIMPACT | Q3SURFACEFLAG_NOMARKS | Q3SURFACEFLAG_NODLIGHT | Q3SURFACEFLAG_NOLIGHTMAP;
 +      mod_q1bsp_texture_sky.supercontents = SUPERCONTENTS_SKY | SUPERCONTENTS_NODROP;
 +
 +      mod_q1bsp_texture_lava = mod_q1bsp_texture_solid;
 +      strlcpy(mod_q1bsp_texture_lava.name, "*lava", sizeof(mod_q1bsp_texture_lava.name));
 +      mod_q1bsp_texture_lava.surfaceflags = Q3SURFACEFLAG_NOMARKS;
 +      mod_q1bsp_texture_lava.supercontents = SUPERCONTENTS_LAVA | SUPERCONTENTS_NODROP;
 +
 +      mod_q1bsp_texture_slime = mod_q1bsp_texture_solid;
 +      strlcpy(mod_q1bsp_texture_slime.name, "*slime", sizeof(mod_q1bsp_texture_slime.name));
 +      mod_q1bsp_texture_slime.surfaceflags = Q3SURFACEFLAG_NOMARKS;
 +      mod_q1bsp_texture_slime.supercontents = SUPERCONTENTS_SLIME;
 +
 +      mod_q1bsp_texture_water = mod_q1bsp_texture_solid;
 +      strlcpy(mod_q1bsp_texture_water.name, "*water", sizeof(mod_q1bsp_texture_water.name));
 +      mod_q1bsp_texture_water.surfaceflags = Q3SURFACEFLAG_NOMARKS;
 +      mod_q1bsp_texture_water.supercontents = SUPERCONTENTS_WATER;
 +}
 +
 +void Mod_BrushInit_Commands(void)
  {
  //    Cvar_RegisterVariable(&r_subdivide_size);
        Cvar_RegisterVariable(&mod_bsp_portalize);
        Cvar_RegisterVariable(&mod_q3shader_force_terrain_alphaflag);
        Cvar_RegisterVariable(&mod_q1bsp_polygoncollisions);
        Cvar_RegisterVariable(&mod_recalculatenodeboxes);
 -
 -      // these games were made for older DP engines and are no longer
 -      // maintained; use this hack to show their textures properly
 -      if(gamemode == GAME_NEXUIZ)
 -              Cvar_SetQuick(&mod_q3shader_force_addalpha, "1");
 -
 -      memset(&mod_q1bsp_texture_solid, 0, sizeof(mod_q1bsp_texture_solid));
 -      strlcpy(mod_q1bsp_texture_solid.name, "solid" , sizeof(mod_q1bsp_texture_solid.name));
 -      mod_q1bsp_texture_solid.surfaceflags = 0;
 -      mod_q1bsp_texture_solid.supercontents = SUPERCONTENTS_SOLID;
 -
 -      mod_q1bsp_texture_sky = mod_q1bsp_texture_solid;
 -      strlcpy(mod_q1bsp_texture_sky.name, "sky", sizeof(mod_q1bsp_texture_sky.name));
 -      mod_q1bsp_texture_sky.surfaceflags = Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NOIMPACT | Q3SURFACEFLAG_NOMARKS | Q3SURFACEFLAG_NODLIGHT | Q3SURFACEFLAG_NOLIGHTMAP;
 -      mod_q1bsp_texture_sky.supercontents = SUPERCONTENTS_SKY | SUPERCONTENTS_NODROP;
 -
 -      mod_q1bsp_texture_lava = mod_q1bsp_texture_solid;
 -      strlcpy(mod_q1bsp_texture_lava.name, "*lava", sizeof(mod_q1bsp_texture_lava.name));
 -      mod_q1bsp_texture_lava.surfaceflags = Q3SURFACEFLAG_NOMARKS;
 -      mod_q1bsp_texture_lava.supercontents = SUPERCONTENTS_LAVA | SUPERCONTENTS_NODROP;
 -
 -      mod_q1bsp_texture_slime = mod_q1bsp_texture_solid;
 -      strlcpy(mod_q1bsp_texture_slime.name, "*slime", sizeof(mod_q1bsp_texture_slime.name));
 -      mod_q1bsp_texture_slime.surfaceflags = Q3SURFACEFLAG_NOMARKS;
 -      mod_q1bsp_texture_slime.supercontents = SUPERCONTENTS_SLIME;
 -
 -      mod_q1bsp_texture_water = mod_q1bsp_texture_solid;
 -      strlcpy(mod_q1bsp_texture_water.name, "*water", sizeof(mod_q1bsp_texture_water.name));
 -      mod_q1bsp_texture_water.surfaceflags = Q3SURFACEFLAG_NOMARKS;
 -      mod_q1bsp_texture_water.supercontents = SUPERCONTENTS_WATER;
  }
  
- static mleaf_t *Mod_BSP_PointInLeaf(dp_model_t *model, const vec3_t p)
+ static mleaf_t *Mod_BSP_PointInLeaf(model_t *model, const vec3_t p)
  {
        mnode_t *node;
  
diff --cc model_shared.c
Simple merge
diff --cc model_shared.h
index 13152c0dd822dcb9a62805f811376b08c1a85fe9,0e47778975f340f03aa463641469fdc893460e09..0afd1a39cac6f4f7d2f4078b9ef87b0042550cfe
@@@ -1081,30 -558,29 +558,30 @@@ typedef struct modloader_
  } modloader_t;
  
  // sky/water subdivision
- //extern cvar_t gl_subdivide_size;
+ //extern struct cvar_s gl_subdivide_size;
  // texture fullbrights
- extern cvar_t r_fullbrights;
- extern cvar_t mod_noshader_default_offsetmapping;
- extern cvar_t mod_q3shader_default_offsetmapping;
- extern cvar_t mod_q3shader_default_offsetmapping_scale;
- extern cvar_t mod_q3shader_default_offsetmapping_bias;
- extern cvar_t mod_q3shader_default_polygonoffset;
- extern cvar_t mod_q3shader_default_polygonfactor;
- extern cvar_t mod_q3shader_default_refractive_index;
- extern cvar_t mod_q3shader_force_addalpha;
- extern cvar_t mod_q3shader_force_terrain_alphaflag;
- extern cvar_t mod_q3bsp_lightgrid_texture;
- extern cvar_t mod_q3bsp_lightgrid_world_surfaces;
- extern cvar_t mod_q3bsp_lightgrid_bsp_surfaces;
+ extern struct cvar_s r_fullbrights;
+ extern struct cvar_s mod_noshader_default_offsetmapping;
+ extern struct cvar_s mod_q3shader_default_offsetmapping;
+ extern struct cvar_s mod_q3shader_default_offsetmapping_scale;
+ extern struct cvar_s mod_q3shader_default_offsetmapping_bias;
+ extern struct cvar_s mod_q3shader_default_polygonoffset;
+ extern struct cvar_s mod_q3shader_default_polygonfactor;
+ extern struct cvar_s mod_q3shader_default_refractive_index;
+ extern struct cvar_s mod_q3shader_force_addalpha;
+ extern struct cvar_s mod_q3shader_force_terrain_alphaflag;
+ extern struct cvar_s mod_q3bsp_lightgrid_texture;
+ extern struct cvar_s mod_q3bsp_lightgrid_world_surfaces;
+ extern struct cvar_s mod_q3bsp_lightgrid_bsp_surfaces;
  
  void Mod_Init (void);
 +void Mod_Init_Commands (void);
  void Mod_Reload (void);
dp_model_t *Mod_LoadModel(dp_model_t *mod, qboolean crash, qboolean checkdisk);
dp_model_t *Mod_FindName (const char *name, const char *parentname);
dp_model_t *Mod_ForName (const char *name, qboolean crash, qboolean checkdisk, const char *parentname);
- void Mod_UnloadModel (dp_model_t *mod);
model_t *Mod_LoadModel(model_t *mod, qbool crash, qbool checkdisk);
+ model_t *Mod_FindName (const char *name, const char *parentname);
model_t *Mod_ForName (const char *name, qbool crash, qbool checkdisk, const char *parentname);
+ void Mod_UnloadModel (model_t *mod);
  
  void Mod_ClearUsed(void);
  void Mod_PurgeUnused(void);
@@@ -1243,33 -718,32 +720,33 @@@ bih_t *Mod_MakeCollisionBIH(model_t *mo
  struct frameblend_s;
  struct skeleton_s;
  void Mod_AliasInit(void);
- int Mod_Alias_GetTagMatrix(const dp_model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, int tagindex, matrix4x4_t *outmatrix);
- int Mod_Alias_GetTagIndexForName(const dp_model_t *model, unsigned int skin, const char *tagname);
- int Mod_Alias_GetExtendedTagInfoForIndex(const dp_model_t *model, unsigned int skin, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, int tagindex, int *parentindex, const char **tagname, matrix4x4_t *tag_localmatrix);
 +void Mod_AliasInit_Commands(void);
+ int Mod_Alias_GetTagMatrix(const model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, int tagindex, matrix4x4_t *outmatrix);
+ int Mod_Alias_GetTagIndexForName(const model_t *model, unsigned int skin, const char *tagname);
+ int Mod_Alias_GetExtendedTagInfoForIndex(const model_t *model, unsigned int skin, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, int tagindex, int *parentindex, const char **tagname, matrix4x4_t *tag_localmatrix);
  
  void Mod_Skeletal_FreeBuffers(void);
  
  // sprite models
 -void Mod_SpriteInit(void);
 +void Mod_SpriteInit_Commands(void);
  
  // loaders
- void Mod_2PSB_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_BSP2_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_HLBSP_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_Q1BSP_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_IBSP_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_MAP_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_OBJ_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_IDP0_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_IDP2_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_IDP3_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_ZYMOTICMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_DARKPLACESMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_PSKMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_IDSP_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_IDS2_Load(dp_model_t *mod, void *buffer, void *bufferend);
- void Mod_INTERQUAKEMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend);
+ void Mod_2PSB_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_BSP2_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_HLBSP_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_Q1BSP_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_IBSP_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_MAP_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_OBJ_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_IDP0_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_IDP2_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_IDP3_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_ZYMOTICMODEL_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_DARKPLACESMODEL_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_PSKMODEL_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_IDSP_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_IDS2_Load(model_t *mod, void *buffer, void *bufferend);
+ void Mod_INTERQUAKEMODEL_Load(model_t *mod, void *buffer, void *bufferend);
  
  #endif        // MODEL_SHARED_H
  
diff --cc model_sprite.c
Simple merge
diff --cc netconn.c
index d77a30bad8893b45c7d0d87e8cf1aca87ed3951c,1b48ac691764de43cc3e0a79bc44bd9d50e281c9..9a4094592fd0fb5494cab2229a977f28c671ec50
+++ b/netconn.c
@@@ -3870,52 -3863,13 +3863,52 @@@ void NetConn_Init(void
        int i;
        lhnetaddress_t tempaddress;
        netconn_mempool = Mem_AllocPool("network connections", 0, NULL);
-       if ((i = COM_CheckParm("-ip")) && i + 1 < sys.argc)
 +
 +// COMMANDLINEOPTION: Server: -ip <ipaddress> sets the ip address of this machine for purposes of networking (default 0.0.0.0 also known as INADDR_ANY), use only if you have multiple network adapters and need to choose one specifically.
-       if (((i = COM_CheckParm("-port")) || (i = COM_CheckParm("-ipport")) || (i = COM_CheckParm("-udpport"))) && i + 1 < sys.argc)
++      if ((i = Sys_CheckParm("-ip")) && i + 1 < sys.argc)
 +      {
 +              if (LHNETADDRESS_FromString(&tempaddress, sys.argv[i + 1], 0) == 1)
 +              {
 +                      Con_Printf("-ip option used, setting net_address to \"%s\"\n", sys.argv[i + 1]);
 +                      Cvar_SetQuick(&net_address, sys.argv[i + 1]);
 +              }
 +              else
 +                      Con_Printf(CON_ERROR "-ip option used, but unable to parse the address \"%s\"\n", sys.argv[i + 1]);
 +      }
 +// COMMANDLINEOPTION: Server: -port <portnumber> sets the port to use for a server (default 26000, the same port as QUAKE itself), useful if you host multiple servers on your machine
-       Cmd_AddCommand(CMD_SHARED, "net_stats", Net_Stats_f, "print network statistics");
++      if (((i = Sys_CheckParm("-port")) || (i = Sys_CheckParm("-ipport")) || (i = Sys_CheckParm("-udpport"))) && i + 1 < sys.argc)
 +      {
 +              i = atoi(sys.argv[i + 1]);
 +              if (i >= 0 && i < 65536)
 +              {
 +                      Con_Printf("-port option used, setting port cvar to %i\n", i);
 +                      Cvar_SetValueQuick(&sv_netport, i);
 +              }
 +              else
 +                      Con_Printf(CON_ERROR "-port option used, but %i is not a valid port number\n", i);
 +      }
 +      cl_numsockets = 0;
 +      sv_numsockets = 0;
 +      cl_message.data = cl_message_buf;
 +      cl_message.maxsize = sizeof(cl_message_buf);
 +      cl_message.cursize = 0;
 +      sv_message.data = sv_message_buf;
 +      sv_message.maxsize = sizeof(sv_message_buf);
 +      sv_message.cursize = 0;
 +      LHNET_Init();
 +      if (Thread_HasThreads())
 +              netconn_mutex = Thread_CreateMutex();
 +}
 +
 +void NetConn_Init_Commands(void)
 +{
+       Cmd_AddCommand(CF_SHARED, "net_stats", Net_Stats_f, "print network statistics");
  #ifdef CONFIG_MENU
-       Cmd_AddCommand(CMD_CLIENT, "net_slist", Net_Slist_f, "query dp master servers and print all server information");
-       Cmd_AddCommand(CMD_CLIENT, "net_slistqw", Net_SlistQW_f, "query qw master servers and print all server information");
-       Cmd_AddCommand(CMD_CLIENT, "net_refresh", Net_Refresh_f, "query dp master servers and refresh all server information");
+       Cmd_AddCommand(CF_CLIENT, "net_slist", Net_Slist_f, "query dp master servers and print all server information");
+       Cmd_AddCommand(CF_CLIENT, "net_slistqw", Net_SlistQW_f, "query qw master servers and print all server information");
+       Cmd_AddCommand(CF_CLIENT, "net_refresh", Net_Refresh_f, "query dp master servers and refresh all server information");
  #endif
-       Cmd_AddCommand(CMD_SERVER, "heartbeat", Net_Heartbeat_f, "send a heartbeat to the master server (updates your server information)");
+       Cmd_AddCommand(CF_SERVER, "heartbeat", Net_Heartbeat_f, "send a heartbeat to the master server (updates your server information)");
        Cvar_RegisterVariable(&net_test);
        Cvar_RegisterVariable(&net_usesizelimit);
        Cvar_RegisterVariable(&net_burstreserve);
diff --cc netconn.h
Simple merge
diff --cc palette.c
Simple merge
diff --cc progsvm.h
Simple merge
diff --cc prvm_edict.c
index 1198df602a70be3dfd945b9d49902d35d59222e4,5efd5ed6eba0152ef48af9c7aa2a4083c4e92751..cc1fc8592985ab69124e999f6491e544126d54f0
@@@ -3137,35 -3137,27 +3137,35 @@@ PRVM_Ini
  ===============
  */
  void PRVM_Init (void)
-       prvm_runawaycheck = !COM_CheckParm("-norunaway");
 +{
 +      // COMMANDLINEOPTION: PRVM: -norunaway disables the runaway loop check (it might be impossible to exit DarkPlaces if used!)
++      prvm_runawaycheck = !Sys_CheckParm("-norunaway");
 +
 +      //VM_Cmd_Init();
 +}
 +
 +void PRVM_Init_Commands (void)
  {
-       Cmd_AddCommand(CMD_SHARED, "prvm_edict", PRVM_ED_PrintEdict_f, "print all data about an entity number in the selected VM (server, client, menu)");
-       Cmd_AddCommand(CMD_SHARED, "prvm_edicts", PRVM_ED_PrintEdicts_f, "prints all data about all entities in the selected VM (server, client, menu)");
-       Cmd_AddCommand(CMD_SHARED, "prvm_edictcount", PRVM_ED_Count_f, "prints number of active entities in the selected VM (server, client, menu)");
-       Cmd_AddCommand(CMD_SHARED, "prvm_profile", PRVM_Profile_f, "prints execution statistics about the most used QuakeC functions in the selected VM (server, client, menu)");
-       Cmd_AddCommand(CMD_SHARED, "prvm_childprofile", PRVM_ChildProfile_f, "prints execution statistics about the most used QuakeC functions in the selected VM (server, client, menu), sorted by time taken in function with child calls");
-       Cmd_AddCommand(CMD_SHARED, "prvm_callprofile", PRVM_CallProfile_f, "prints execution statistics about the most time consuming QuakeC calls from the engine in the selected VM (server, client, menu)");
-       Cmd_AddCommand(CMD_SHARED, "prvm_fields", PRVM_Fields_f, "prints usage statistics on properties (how many entities have non-zero values) in the selected VM (server, client, menu)");
-       Cmd_AddCommand(CMD_SHARED, "prvm_globals", PRVM_Globals_f, "prints all global variables in the selected VM (server, client, menu)");
-       Cmd_AddCommand(CMD_SHARED, "prvm_global", PRVM_Global_f, "prints value of a specified global variable in the selected VM (server, client, menu)");
-       Cmd_AddCommand(CMD_SHARED, "prvm_globalset", PRVM_GlobalSet_f, "sets value of a specified global variable in the selected VM (server, client, menu)");
-       Cmd_AddCommand(CMD_SHARED, "prvm_edictset", PRVM_ED_EdictSet_f, "changes value of a specified property of a specified entity in the selected VM (server, client, menu)");
-       Cmd_AddCommand(CMD_SHARED, "prvm_edictget", PRVM_ED_EdictGet_f, "retrieves the value of a specified property of a specified entity in the selected VM (server, client menu) into a cvar or to the console");
-       Cmd_AddCommand(CMD_SHARED, "prvm_globalget", PRVM_ED_GlobalGet_f, "retrieves the value of a specified global variable in the selected VM (server, client menu) into a cvar or to the console");
-       Cmd_AddCommand(CMD_SHARED, "prvm_printfunction", PRVM_PrintFunction_f, "prints a disassembly (QuakeC instructions) of the specified function in the selected VM (server, client, menu)");
-       Cmd_AddCommand(CMD_SHARED, "cl_cmd", PRVM_GameCommand_Client_f, "calls the client QC function GameCommand with the supplied string as argument");
-       Cmd_AddCommand(CMD_SHARED, "menu_cmd", PRVM_GameCommand_Menu_f, "calls the menu QC function GameCommand with the supplied string as argument");
-       Cmd_AddCommand(CMD_SHARED, "sv_cmd", PRVM_GameCommand_Server_f, "calls the server QC function GameCommand with the supplied string as argument");
-       Cmd_AddCommand(CMD_SHARED, "prvm_breakpoint", PRVM_Breakpoint_f, "marks a statement or function as breakpoint (when this is executed, a stack trace is printed); to actually halt and investigate state, combine this with a gdb breakpoint on PRVM_Breakpoint, or with prvm_breakpointdump; run with just progs name to clear breakpoint");
-       Cmd_AddCommand(CMD_SHARED, "prvm_globalwatchpoint", PRVM_GlobalWatchpoint_f, "marks a global as watchpoint (when this is executed, a stack trace is printed); to actually halt and investigate state, combine this with a gdb breakpoint on PRVM_Breakpoint, or with prvm_breakpointdump; run with just progs name to clear watchpoint");
-       Cmd_AddCommand(CMD_SHARED, "prvm_edictwatchpoint", PRVM_EdictWatchpoint_f, "marks an entity field as watchpoint (when this is executed, a stack trace is printed); to actually halt and investigate state, combine this with a gdb breakpoint on PRVM_Breakpoint, or with prvm_breakpointdump; run with just progs name to clear watchpoint");
+       Cmd_AddCommand(CF_SHARED, "prvm_edict", PRVM_ED_PrintEdict_f, "print all data about an entity number in the selected VM (server, client, menu)");
+       Cmd_AddCommand(CF_SHARED, "prvm_edicts", PRVM_ED_PrintEdicts_f, "prints all data about all entities in the selected VM (server, client, menu)");
+       Cmd_AddCommand(CF_SHARED, "prvm_edictcount", PRVM_ED_Count_f, "prints number of active entities in the selected VM (server, client, menu)");
+       Cmd_AddCommand(CF_SHARED, "prvm_profile", PRVM_Profile_f, "prints execution statistics about the most used QuakeC functions in the selected VM (server, client, menu)");
+       Cmd_AddCommand(CF_SHARED, "prvm_childprofile", PRVM_ChildProfile_f, "prints execution statistics about the most used QuakeC functions in the selected VM (server, client, menu), sorted by time taken in function with child calls");
+       Cmd_AddCommand(CF_SHARED, "prvm_callprofile", PRVM_CallProfile_f, "prints execution statistics about the most time consuming QuakeC calls from the engine in the selected VM (server, client, menu)");
+       Cmd_AddCommand(CF_SHARED, "prvm_fields", PRVM_Fields_f, "prints usage statistics on properties (how many entities have non-zero values) in the selected VM (server, client, menu)");
+       Cmd_AddCommand(CF_SHARED, "prvm_globals", PRVM_Globals_f, "prints all global variables in the selected VM (server, client, menu)");
+       Cmd_AddCommand(CF_SHARED, "prvm_global", PRVM_Global_f, "prints value of a specified global variable in the selected VM (server, client, menu)");
+       Cmd_AddCommand(CF_SHARED, "prvm_globalset", PRVM_GlobalSet_f, "sets value of a specified global variable in the selected VM (server, client, menu)");
+       Cmd_AddCommand(CF_SHARED, "prvm_edictset", PRVM_ED_EdictSet_f, "changes value of a specified property of a specified entity in the selected VM (server, client, menu)");
+       Cmd_AddCommand(CF_SHARED, "prvm_edictget", PRVM_ED_EdictGet_f, "retrieves the value of a specified property of a specified entity in the selected VM (server, client menu) into a cvar or to the console");
+       Cmd_AddCommand(CF_SHARED, "prvm_globalget", PRVM_ED_GlobalGet_f, "retrieves the value of a specified global variable in the selected VM (server, client menu) into a cvar or to the console");
+       Cmd_AddCommand(CF_SHARED, "prvm_printfunction", PRVM_PrintFunction_f, "prints a disassembly (QuakeC instructions) of the specified function in the selected VM (server, client, menu)");
+       Cmd_AddCommand(CF_SHARED, "cl_cmd", PRVM_GameCommand_Client_f, "calls the client QC function GameCommand with the supplied string as argument");
+       Cmd_AddCommand(CF_SHARED, "menu_cmd", PRVM_GameCommand_Menu_f, "calls the menu QC function GameCommand with the supplied string as argument");
+       Cmd_AddCommand(CF_SHARED, "sv_cmd", PRVM_GameCommand_Server_f, "calls the server QC function GameCommand with the supplied string as argument");
+       Cmd_AddCommand(CF_SHARED, "prvm_breakpoint", PRVM_Breakpoint_f, "marks a statement or function as breakpoint (when this is executed, a stack trace is printed); to actually halt and investigate state, combine this with a gdb breakpoint on PRVM_Breakpoint, or with prvm_breakpointdump; run with just progs name to clear breakpoint");
+       Cmd_AddCommand(CF_SHARED, "prvm_globalwatchpoint", PRVM_GlobalWatchpoint_f, "marks a global as watchpoint (when this is executed, a stack trace is printed); to actually halt and investigate state, combine this with a gdb breakpoint on PRVM_Breakpoint, or with prvm_breakpointdump; run with just progs name to clear watchpoint");
+       Cmd_AddCommand(CF_SHARED, "prvm_edictwatchpoint", PRVM_EdictWatchpoint_f, "marks an entity field as watchpoint (when this is executed, a stack trace is printed); to actually halt and investigate state, combine this with a gdb breakpoint on PRVM_Breakpoint, or with prvm_breakpointdump; run with just progs name to clear watchpoint");
  
        Cvar_RegisterVariable (&prvm_language);
        Cvar_RegisterVariable (&prvm_traceqc);
diff --cc r_explosion.c
Simple merge
diff --cc r_lightning.c
index fcfe30bfc087f8f7af496ab348ab56bb26642a91,9a73a50f1b6bbd1be825301182c08296e033189d..0901974e7f6c2c5eb7da97275314b927b8cc4677
@@@ -107,9 -102,10 +107,9 @@@ void R_LightningBeams_Init_Commands(voi
        Cvar_RegisterVariable(&r_lightningbeam_color_green);
        Cvar_RegisterVariable(&r_lightningbeam_color_blue);
        Cvar_RegisterVariable(&r_lightningbeam_qmbtexture);
 -      R_RegisterModule("R_LightningBeams", r_lightningbeams_start, r_lightningbeams_shutdown, r_lightningbeams_newmap, NULL, NULL);
  }
  
- static void CL_Beam_AddQuad(dp_model_t *mod, msurface_t *surf, const vec3_t start, const vec3_t end, const vec3_t offset, float t1, float t2)
+ static void CL_Beam_AddQuad(model_t *mod, msurface_t *surf, const vec3_t start, const vec3_t end, const vec3_t offset, float t1, float t2)
  {
        int e0, e1, e2, e3;
        vec3_t n;
diff --cc r_shadow.c
Simple merge
diff --cc r_sky.c
index dfe74937da2398680079685a63dedbd90b985ec7,7fd1463dbc7239c60c998ea3124db9ca861234a5..5f60f0388f34c40f3487ed16edbe7a812ca5adeb
+++ b/r_sky.c
@@@ -462,15 -462,8 +462,15 @@@ static void r_sky_newmap(void
  
  
  void R_Sky_Init(void)
 +{
 +      memset(&skyboxskinframe, 0, sizeof(skyboxskinframe));
 +      skyname[0] = 0;
 +      R_RegisterModule("R_Sky", r_sky_start, r_sky_shutdown, r_sky_newmap, NULL, NULL);
 +}
 +
 +void R_Sky_Init_Commands(void)
  {
-       Cmd_AddCommand(CMD_CLIENT, "loadsky", &LoadSky_f, "load a skybox by basename (for example loadsky mtnsun_ loads mtnsun_ft.tga and so on)");
+       Cmd_AddCommand(CF_CLIENT, "loadsky", &LoadSky_f, "load a skybox by basename (for example loadsky mtnsun_ loads mtnsun_ft.tga and so on)");
        Cvar_RegisterVariable (&r_sky);
        Cvar_RegisterVariable (&r_skyscroll1);
        Cvar_RegisterVariable (&r_skyscroll2);
diff --cc render.h
index b737e6da28eccd942948278bf3ff671bb93bcbb8,db5f9e85cc2a6de54f27decf11a51a244e30f5bd..0427e091405dbc650d2a5bc36c2e462757329e4b
+++ b/render.h
@@@ -725,11 -979,10 +979,11 @@@ void R_DrawPortals(void)
  void R_BuildLightMap(const entity_render_t *ent, msurface_t *surface);
  void R_Water_AddWaterPlane(msurface_t *surface, int entno);
  int R_Shadow_GetRTLightInfo(unsigned int lightindex, float *origin, float *radius, float *color);
- dp_font_t *FindFont(const char *title, qboolean allocate_new);
- void LoadFont(qboolean override, const char *name, dp_font_t *fnt, float scale, float voffset);
+ dp_font_t *FindFont(const char *title, qbool allocate_new);
+ void LoadFont(qbool override, const char *name, dp_font_t *fnt, float scale, float voffset);
  
  void Render_Init(void);
 +void Render_Init_Commands(void);
  
  // these are called by Render_Init
  void R_Textures_Init(void);
@@@ -746,19 -999,7 +1000,19 @@@ void R_LightningBeams_Init(void)
  void Mod_RenderInit(void);
  void Font_Init(void);
  
- qboolean R_CompileShader_CheckStaticParms(void);
 +void R_Textures_Init_Commands(void);
 +void GL_Draw_Init_Commands(void);
 +void GL_Main_Init_Commands(void);
 +void R_Shadow_Init_Commands(void);
 +void R_Sky_Init_Commands(void);
 +void R_Particles_Init_Commands(void);
 +void R_Explosion_Init_Commands(void);
 +void gl_backend_init_Commands(void);
 +void Sbar_Init_Commands(void);
 +void R_LightningBeams_Init_Commands(void);
 +void Font_Init_Commands(void);
 +
+ qbool R_CompileShader_CheckStaticParms(void);
  void R_GLSL_Restart_f(cmd_state_t *cmd);
  
  #endif
diff --cc sbar.c
index f7bedd5283fa1d3ba685950e36cd3389bacb28bc,6fc6c327cbd3855abedacd3debdbc97dc809091f..ade2ca18639eead2ea1c6c0eb28aab98eac183ba
--- 1/sbar.c
--- 2/sbar.c
+++ b/sbar.c
@@@ -359,18 -359,11 +359,18 @@@ static void sbar_newmap(void
  
  void Sbar_Init (void)
  {
 +      // FIXME: Don't know what game we're running until after cvars are initialized.
 +      // So we're not doing this in our Init_Commands function yet.
        if(gamemode == GAME_NORMAL) // Workaround so Quake doesn't trample on Xonotic.
        {
-               Cmd_AddCommand(CMD_CLIENT, "+showscores", Sbar_ShowScores_f, "show scoreboard");
-               Cmd_AddCommand(CMD_CLIENT, "-showscores", Sbar_DontShowScores_f, "hide scoreboard");
+               Cmd_AddCommand(CF_CLIENT, "+showscores", Sbar_ShowScores_f, "show scoreboard");
+               Cmd_AddCommand(CF_CLIENT, "-showscores", Sbar_DontShowScores_f, "hide scoreboard");
        }
 +      R_RegisterModule("sbar", sbar_start, sbar_shutdown, sbar_newmap, NULL, NULL);
 +}
 +
 +void Sbar_Init_Commands(void)
 +{
        Cvar_RegisterVariable(&cl_showfps);
        Cvar_RegisterVariable(&cl_showsound);
        Cvar_RegisterVariable(&cl_showblur);
diff --cc server.h
index 10c53417ba1dfa2b8554632d2ad46c33029178c8,9a9a6d9b4ffb9c4b80e4b5959d5878c00d623e0c..67db53524557ff3008c7f09a1944baf6f59f106a
+++ b/server.h
@@@ -512,7 -512,10 +512,11 @@@ extern client_t *host_client
  //===========================================================
  
  void SV_Init (void);
 +void SV_Init_Commands(void);
+ double SV_Frame(double time);
+ void SV_Shutdown(void);
+ int SV_IsLocalServer(void);
  
  void SV_StartParticle (vec3_t org, vec3_t dir, int color, int count);
  void SV_StartEffect (vec3_t org, int modelindex, int startframe, int framecount, int framerate);
diff --cc snd_main.c
index 0d96b2fa05bb6ebd5ff1c218a8d1baa24f260db3,3e8d52a86ccd8dcb3c44123b32cbc6b54a0918d6..d9a70325bf1e40bc0bd9117df73683eec3cb1d77
@@@ -702,31 -702,6 +702,31 @@@ S_Ini
  ================
  */
  void S_Init(void)
-       if (COM_CheckParm("-nosound"))
 +{
 +// COMMANDLINEOPTION: Sound: -nosound disables sound (including CD audio)
-       if (COM_CheckParm("-simsound"))
++      if (Sys_CheckParm("-nosound"))
 +              return;
 +
 +      snd_mempool = Mem_AllocPool("sound", 0, NULL);
 +
 +// COMMANDLINEOPTION: Sound: -simsound runs sound mixing but with no output
++      if (Sys_CheckParm("-simsound"))
 +              simsound = true;
 +
 +      Cvar_SetValueQuick(&snd_initialized, true);
 +
 +      known_sfx = NULL;
 +
 +      total_channels = MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS;   // no statics
 +      memset(channels, 0, MAX_CHANNELS * sizeof(channel_t));
 +
 +      OGG_OpenLibrary ();
 +#ifdef USEXMP
 +      XMP_OpenLibrary ();
 +#endif
 +}
 +
 +void S_Init_Commands(void)
  {
        Cvar_RegisterVariable(&volume);
        Cvar_RegisterVariable(&bgmvolume);
  
        Cvar_RegisterVariable(&snd_identicalsoundrandomization_time);
        Cvar_RegisterVariable(&snd_identicalsoundrandomization_tics);
-       if (COM_CheckParm("-nosound"))
 -
 -// COMMANDLINEOPTION: Sound: -nosound disables sound (including CD audio)
+       if (Sys_CheckParm("-nosound"))
        {
                // dummy out Play and Play2 because mods stuffcmd that
-               Cmd_AddCommand(CMD_CLIENT, "play", Host_NoOperation_f, "does nothing because -nosound was specified");
-               Cmd_AddCommand(CMD_CLIENT, "play2", Host_NoOperation_f, "does nothing because -nosound was specified");
+               Cmd_AddCommand(CF_CLIENT, "play", Host_NoOperation_f, "does nothing because -nosound was specified");
+               Cmd_AddCommand(CF_CLIENT, "play2", Host_NoOperation_f, "does nothing because -nosound was specified");
                return;
        }
  
-       Cmd_AddCommand(CMD_CLIENT, "play", S_Play_f, "play a sound at your current location (not heard by anyone else)");
-       Cmd_AddCommand(CMD_CLIENT, "play2", S_Play2_f, "play a sound globally throughout the level (not heard by anyone else)");
-       Cmd_AddCommand(CMD_CLIENT, "playvol", S_PlayVol_f, "play a sound at the specified volume level at your current location (not heard by anyone else)");
-       Cmd_AddCommand(CMD_CLIENT, "stopsound", S_StopAllSounds_f, "silence");
-       Cmd_AddCommand(CMD_CLIENT, "pausesound", S_PauseSound_f, "temporary silence");
-       Cmd_AddCommand(CMD_CLIENT, "soundlist", S_SoundList_f, "list loaded sounds");
-       Cmd_AddCommand(CMD_CLIENT, "soundinfo", S_SoundInfo_f, "print sound system information (such as channels and speed)");
-       Cmd_AddCommand(CMD_CLIENT, "snd_restart", S_Restart_f, "restart sound system");
-       Cmd_AddCommand(CMD_CLIENT, "snd_unloadallsounds", S_UnloadAllSounds_f, "unload all sound files");
 -      snd_mempool = Mem_AllocPool("sound", 0, NULL);
 -
 -// COMMANDLINEOPTION: Sound: -simsound runs sound mixing but with no output
 -      if (Sys_CheckParm("-simsound"))
 -              simsound = true;
 -
+       Cmd_AddCommand(CF_CLIENT, "play", S_Play_f, "play a sound at your current location (not heard by anyone else)");
+       Cmd_AddCommand(CF_CLIENT, "play2", S_Play2_f, "play a sound globally throughout the level (not heard by anyone else)");
+       Cmd_AddCommand(CF_CLIENT, "playvol", S_PlayVol_f, "play a sound at the specified volume level at your current location (not heard by anyone else)");
+       Cmd_AddCommand(CF_CLIENT, "stopsound", S_StopAllSounds_f, "silence");
+       Cmd_AddCommand(CF_CLIENT, "pausesound", S_PauseSound_f, "temporary silence");
+       Cmd_AddCommand(CF_CLIENT, "soundlist", S_SoundList_f, "list loaded sounds");
+       Cmd_AddCommand(CF_CLIENT, "soundinfo", S_SoundInfo_f, "print sound system information (such as channels and speed)");
+       Cmd_AddCommand(CF_CLIENT, "snd_restart", S_Restart_f, "restart sound system");
+       Cmd_AddCommand(CF_CLIENT, "snd_unloadallsounds", S_UnloadAllSounds_f, "unload all sound files");
  
        Cvar_RegisterVariable(&nosound);
        Cvar_RegisterVariable(&snd_precache);
diff --cc snd_null.c
index 65c083e151a9d7af1ddad59a1c994944a000ebbc,f487874a40c35b1505a016eb8038623f39b5443d..53dd11debc3cc6bbb056af2af1cd1aaf082b6ba4
@@@ -22,18 -22,14 +22,18 @@@ Foundation, Inc., 59 Temple Place - Sui
  
  #include "quakedef.h"
  
- cvar_t bgmvolume = {CVAR_SAVE, "bgmvolume", "1", "volume of background music (such as CD music or replacement files such as sound/cdtracks/track002.ogg)"};
- cvar_t mastervolume = {CVAR_SAVE, "mastervolume", "1", "master volume"};
- cvar_t volume = {CVAR_SAVE, "volume", "0.7", "volume of sound effects"};
- cvar_t snd_staticvolume = {CVAR_SAVE, "snd_staticvolume", "1", "volume of ambient sound effects (such as swampy sounds at the start of e1m2)"};
- cvar_t snd_initialized = { CVAR_READONLY, "snd_initialized", "0", "indicates the sound subsystem is active"};
- cvar_t snd_mutewhenidle = {CVAR_SAVE, "snd_mutewhenidle", "1", "whether to disable sound output when game window is inactive"};
+ cvar_t bgmvolume = {CF_ARCHIVE, "bgmvolume", "1", "volume of background music (such as CD music or replacement files such as sound/cdtracks/track002.ogg)"};
+ cvar_t mastervolume = {CF_ARCHIVE, "mastervolume", "1", "master volume"};
+ cvar_t volume = {CF_ARCHIVE, "volume", "0.7", "volume of sound effects"};
+ cvar_t snd_staticvolume = {CF_ARCHIVE, "snd_staticvolume", "1", "volume of ambient sound effects (such as swampy sounds at the start of e1m2)"};
+ cvar_t snd_initialized = { CF_READONLY, "snd_initialized", "0", "indicates the sound subsystem is active"};
+ cvar_t snd_mutewhenidle = {CF_ARCHIVE, "snd_mutewhenidle", "1", "whether to disable sound output when game window is inactive"};
  
  void S_Init (void)
 +{
 +}
 +
 +void S_Init_Commands (void)
  {
        Cvar_RegisterVariable(&bgmvolume);
        Cvar_RegisterVariable(&mastervolume);
diff --cc sound.h
Simple merge
diff --cc sv_main.c
index 36d4e2845907c5c3a99f43a1a9ec3e6cc461f86e,10b321e27fd2a7181424a5cbd6ea16f95d669e41..9497dfe2de136b164828f55b0b8369777a22cc5d
+++ b/sv_main.c
@@@ -438,11 -512,6 +512,15 @@@ SV_Ini
  ===============
  */
  void SV_Init (void)
 +{
 +      sv_mempool = Mem_AllocPool("server", 0, NULL);
++
++      host.hook.SV_CanSave = SV_CanSave;
++
++      SV_ServerOptions();
 +}
 +
 +void SV_Init_Commands(void)
  {
        // init the csqc progs cvars, since they are updated/used by the server code
        // TODO: fix this since this is a quick hack to make some of [515]'s broken code run ;) [9/13/2006 Black]
diff --cc taskqueue.c
Simple merge
diff --cc taskqueue.h
index 023df29e73603f205c828723d45d20eb110bf8ba,0f64cf6fc35035f6c28b660804855651f5ccb111..d88777543238cb6b5f1051cbdaeb39bbe60a7175
@@@ -43,8 -43,8 +43,8 @@@ void TaskQueue_Setup(taskqueue_task_t *
  // t->p[0] = array of taskqueue_task_t to check
  void TaskQueue_Task_CheckTasksDone(taskqueue_task_t *t);
  
 -void TaskQueue_Init(void);
 +void TaskQueue_Init_Commands(void);
  void TaskQueue_Shutdown(void);
- void TaskQueue_Frame(qboolean shutdown);
+ void TaskQueue_Frame(qbool shutdown);
  
  #endif
diff --cc utf8lib.c
index 4ec965e722c41efdd04be4ded83bcb46e96f8db5,155b4aea9a8f949ecf8e2a583487c4fa122896cc..de4b2df3c678b58461100045e70d57ecdf963602
+++ b/utf8lib.c
@@@ -7,9 -8,9 +8,9 @@@ Initialization of UTF-8 support and ne
  ================================================================================
  */
  // for compatibility this defaults to 0
- cvar_t utf8_enable = {CVAR_CLIENT | CVAR_SERVER | CVAR_SAVE, "utf8_enable", "0", "Enable UTF-8 support. For compatibility, this is disabled by default in most games."};
+ cvar_t utf8_enable = {CF_CLIENT | CF_SERVER | CF_ARCHIVE, "utf8_enable", "0", "Enable UTF-8 support. For compatibility, this is disabled by default in most games."};
  
 -void   u8_Init(void)
 +void   u8_Init_Commands(void)
  {
        Cvar_RegisterVariable(&utf8_enable);
  }
diff --cc utf8lib.h
index 1911c29b3f6ddf80c817aa0169992b7dea41c03e,f54547764981b299f3419b028540d16853461746..48fcae20ce8daa8d815a8438ce7904037dc7b668
+++ b/utf8lib.h
@@@ -19,8 -20,8 +20,8 @@@ typedef int32_t Uchar
  // a non-utf8 version to work: u8_strlen() will wrap to strlen()
  // u8_byteofs() and u8_charidx() will simply return whatever is passed as index parameter
  // u8_getchar() will will just return the next byte, u8_fromchar will write one byte, ...
- extern cvar_t    utf8_enable;
+ extern struct cvar_s utf8_enable;
 -void   u8_Init(void);
 +void   u8_Init_Commands(void);
  
  size_t u8_strlen(const char*);
  size_t u8_strnlen(const char*, size_t);
diff --cc vid.h
Simple merge
diff --cc vid_null.c
index a984a29ca22ee9c87d273ce90b93b0061547609e,cf2ba8649865ce1d182ae0256c0414335bf136ba..dfa39737af8dbd4f324e3f8b36bb38e1046ca6f2
@@@ -64,11 -64,7 +64,11 @@@ void VID_Init(void
        InitSig(); // trap evil signals
  }
  
- qboolean VID_InitMode(viddef_mode_t *mode)
 +void VID_Init_Commands(void)
 +{
 +}
 +
+ qbool VID_InitMode(viddef_mode_t *mode)
  {
        return false;
  }
diff --cc vid_sdl.c
index a5ce4dbd02e10481b86eab6ad97c0558119a1dd1,97e54735ed4c8a291af8ade55a46e3153741b650..0f395d6eb7186049e87517ec50c4038353bf1493
+++ b/vid_sdl.c
@@@ -1336,18 -1342,8 +1336,18 @@@ void VID_Init (void
        vid_isfullscreen = false;
  }
  
 +void VID_Init_Commands(void)
 +{
 +#ifndef __IPHONEOS__
 +#ifdef MACOSX
 +      Cvar_RegisterVariable(&apple_mouse_noaccel);
 +#endif
 +#endif
 +      Cvar_RegisterVariable(&joy_sdl2_trigger_deadzone);
 +}
 +
  static int vid_sdljoystickindex = -1;
- void VID_EnableJoystick(qboolean enable)
+ void VID_EnableJoystick(qbool enable)
  {
        int index = joy_enable.integer > 0 ? joy_index.integer : -1;
        int numsdljoysticks;
diff --cc vid_shared.c
index b469b7cbe4e4eb6bc77f2aebbde7749bee9d651f,df8662d5afdcbd969fe9d806d9b604c30e62108e..9c66c8f85500ab65c3f76d6ae37d974bdfefca5f
@@@ -1365,8 -1358,13 +1365,8 @@@ void VID_Shared_Init_Commands(void
        Cvar_RegisterVariable(&joy_x360_sensitivitypitch);
        Cvar_RegisterVariable(&joy_x360_sensitivityyaw);
        //Cvar_RegisterVariable(&joy_x360_sensitivityroll);
-       Cmd_AddCommand(CMD_CLIENT, "force_centerview", Force_CenterView_f, "recenters view (stops looking up/down)");
-       Cmd_AddCommand(CMD_CLIENT, "vid_restart", VID_Restart_f, "restarts video system (closes and reopens the window, restarts renderer)");
 -
 -#ifdef WIN32
 -      Sys_LoadLibrary(xinputdllnames, &xinputdll_dll, xinputdllfuncs);
 -#endif
 -
+       Cmd_AddCommand(CF_CLIENT, "force_centerview", Force_CenterView_f, "recenters view (stops looking up/down)");
+       Cmd_AddCommand(CF_CLIENT, "vid_restart", VID_Restart_f, "restarts video system (closes and reopens the window, restarts renderer)");
  }
  
  static int VID_Mode(int fullscreen, int width, int height, int bpp, float refreshrate, int stereobuffer)
diff --cc world.c
Simple merge
diff --cc world.h
Simple merge