]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Clean up Host_Init a bit by moving other client init routines to CL_Init
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 30 May 2020 19:59:12 +0000 (19:59 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 30 May 2020 19:59:12 +0000 (19:59 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12612 d7cf8633-e32d-0410-b094-e92efae38249

cl_main.c
host.c

index 5d22ba7b6b3a3b1d45be8e9172aaf5cff4ed82c2..83f7d97cd90b400d518ba437c7f875b1a2e37e5a 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -27,6 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "r_shadow.h"
 #include "libcurl.h"
 #include "snd_main.h"
+#include "cdaudio.h"
 
 // we need to declare some mouse variables here, because the menu system
 // references them even when on a unix system.
@@ -2644,6 +2645,26 @@ CL_Init
 */
 void CL_Init (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)");
+       }
+       else
+       {
+               Con_DPrintf("Initializing client\n");
+
+               R_Modules_Init();
+               Palette_Init();
+#ifdef CONFIG_MENU
+               MR_Init_Commands();
+#endif
+               VID_Shared_Init();
+               VID_Init();
+               Render_Init();
+               S_Init();
+               CDAudio_Init();
+               Key_Init();
+       }
 
        cls.levelmempool = Mem_AllocPool("client (per-level memory)", 0, NULL);
        cls.permanentmempool = Mem_AllocPool("client (long term memory)", 0, NULL);
diff --git a/host.c b/host.c
index 313745a977e9d72b45d93f01a71bebf3e449362e..e659909fc8042d03a1a56eb6cdfc20cc1b84d720 100644 (file)
--- a/host.c
+++ b/host.c
@@ -1289,28 +1289,7 @@ static void Host_Init (void)
        Thread_Init();
        TaskQueue_Init();
 
-       if (cls.state == ca_dedicated)
-       {
-               cmd = &cmd_server;
-               Cmd_AddCommand(&cmd_server, "disconnect", CL_Disconnect_f, "disconnect from server (or disconnect all clients if running a server)");
-       }
-       else
-       {
-               Con_DPrintf("Initializing client\n");
-
-               R_Modules_Init();
-               Palette_Init();
-#ifdef CONFIG_MENU
-               MR_Init_Commands();
-#endif
-               VID_Shared_Init();
-               VID_Init();
-               Render_Init();
-               S_Init();
-               CDAudio_Init();
-               Key_Init();
-               CL_Init();
-       }
+       CL_Init();
 
        // save off current state of aliases, commands and cvars for later restore if FS_GameDir_f is called
        // NOTE: menu commands are freed by Cmd_RestoreInitState