From 5a1c7ecd2b3cf9e477cecc69c1c826b659136d28 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 17 Jan 2002 04:11:36 +0000 Subject: [PATCH] init order cleanup --- nq/source/com.c | 2 -- nq/source/host.c | 31 ++++++++++++++++--------------- nq/source/sys_sdl.c | 3 --- nq/source/sys_unix.c | 3 --- nq/source/sys_unixd.c | 3 --- nq/source/sys_win.c | 5 ----- nq/source/sys_wind.c | 3 --- qw/source/cl_main.c | 41 ++++++++++++++--------------------------- 8 files changed, 30 insertions(+), 61 deletions(-) diff --git a/nq/source/com.c b/nq/source/com.c index 5e21646e2..3e9251117 100644 --- a/nq/source/com.c +++ b/nq/source/com.c @@ -83,7 +83,5 @@ COM_Init (void) cmdline = Cvar_Get ("cmdline", "0", CVAR_SERVERINFO, Cvar_Info, "None"); Cmd_AddCommand ("path", COM_Path_f, "Show what paths Quake is using"); - COM_Filesystem_Init_Cvars (); - COM_Filesystem_Init (); COM_CheckRegistered (); } diff --git a/nq/source/host.c b/nq/source/host.c index 528a95efa..b129d748b 100644 --- a/nq/source/host.c +++ b/nq/source/host.c @@ -880,6 +880,8 @@ Host_Init (quakeparms_t *parms) Cmd_Init_Hash (); Memory_Init (parms->membase, parms->memsize); Cvar_Init (); + Sys_Init_Cvars (); + Sys_Init (); Cbuf_Init (); Cmd_Init (); @@ -910,8 +912,11 @@ Host_Init (quakeparms_t *parms) Cmd_StuffCmds_f (); Cbuf_Execute_Sets (); + PI_Init (); + Chase_Init_Cvars (); CL_InitCvars (); + COM_Filesystem_Init_Cvars (); IN_Init_Cvars (); VID_Init_Cvars (); S_Init_Cvars (); @@ -928,10 +933,12 @@ Host_Init (quakeparms_t *parms) Cmd_StuffCmds_f (); Cbuf_Execute_Sets (); - PI_Init (); + V_Init (); + COM_Filesystem_Init (); + Game_Init (); + COM_Init (); PI_RegisterPlugins (client_plugin_list); - if (isDedicated) Con_Init ("server"); else @@ -940,42 +947,34 @@ Host_Init (quakeparms_t *parms) con_module->data->console->realtime = &realtime; } - V_Init (); - COM_Init (); - GIB_Init (); - Game_Init (); + NET_Init (); Host_InitVCR (parms); Host_InitLocal (); + W_LoadWadFile ("gfx.wad"); Key_Init (); + Mod_Init (); // FIXME: MENUCODE // M_Init (); PR_Init (); SV_Progs_Init (); - Mod_Init (); - NET_Init (); SV_Init (); - Con_Printf ("Exe: " __TIME__ " " __DATE__ "\n"); +// Con_Printf ("Exe: " __TIME__ " " __DATE__ "\n"); Con_Printf ("%4.1f megabyte heap\n", parms->memsize / (1024 * 1024.0)); if (cls.state != ca_dedicated) { vid_basepal = (byte *) COM_LoadHunkFile ("gfx/palette.lmp"); if (!vid_basepal) Sys_Error ("Couldn't load gfx/palette.lmp"); - // LordHavoc: force the transparent color to black - vid_basepal[765] = vid_basepal[766] = vid_basepal[767] = 0; vid_colormap = (byte *) COM_LoadHunkFile ("gfx/colormap.lmp"); if (!vid_colormap) Sys_Error ("Couldn't load gfx/colormap.lmp"); VID_Init (vid_basepal); - IN_Init (); - - Draw_Init (); SCR_Init (); R_Init (); @@ -985,6 +984,8 @@ Host_Init (quakeparms_t *parms) CDAudio_Init (); Sbar_Init (); CL_Init (); + IN_Init (); + CL_SetState (ca_disconnected); } Host_Skin_Init (); @@ -1002,7 +1003,7 @@ Host_Init (quakeparms_t *parms) host_initialized = true; - Con_Printf ("========Quake Initialized=========\n"); + Con_Printf ("\x80\x81\x81\x81\x81\x81\x81\x81%s Initialized\x81\x81\x81\x81\x81\x81\x81\x81\x82\n", PROGRAM); CL_UpdateScreen (cl.time); } diff --git a/nq/source/sys_sdl.c b/nq/source/sys_sdl.c index bf8f9efa3..eeca46c55 100644 --- a/nq/source/sys_sdl.c +++ b/nq/source/sys_sdl.c @@ -200,9 +200,6 @@ SDL_main (int c, char **v) Host_Init (&host_parms); - Sys_Init_Cvars (); - Sys_Init (); - oldtime = Sys_DoubleTime (); while (1) { // find time spent rendering last frame diff --git a/nq/source/sys_unix.c b/nq/source/sys_unix.c index 050c2c14b..1c5dc23f3 100644 --- a/nq/source/sys_unix.c +++ b/nq/source/sys_unix.c @@ -179,9 +179,6 @@ main (int c, const char *v[]) Con_Printf ("Host_Init\n"); Host_Init (&parms); - Sys_Init_Cvars (); - Sys_Init (); - if (!sys_nostdout->int_val) { fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) | FNDELAY); Con_Printf ("Quake -- Version %s\n", NQ_VERSION); diff --git a/nq/source/sys_unixd.c b/nq/source/sys_unixd.c index 3079787c7..99a61ad88 100644 --- a/nq/source/sys_unixd.c +++ b/nq/source/sys_unixd.c @@ -181,9 +181,6 @@ main (int argc, const char **argv) Sys_Printf ("Host_Init\n"); Host_Init (&parms); - Sys_Init_Cvars (); - Sys_Init (); - oldtime = Sys_DoubleTime () - 0.1; while (1) { // Main message loop // find time spent rendering last frame diff --git a/nq/source/sys_win.c b/nq/source/sys_win.c index 02d7a702d..c85b1e78f 100644 --- a/nq/source/sys_win.c +++ b/nq/source/sys_win.c @@ -425,8 +425,6 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, InitConProc (hFile, heventParent, heventChild); } - Sys_Init (); - // because sound is off until we become active //XXX S_BlockSound (); @@ -436,9 +434,6 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, Con_Printf ("Host_Init\n"); Host_Init (&parms); - Sys_Init_Cvars (); - Sys_Init (); - oldtime = Sys_DoubleTime (); /* main window message loop */ diff --git a/nq/source/sys_wind.c b/nq/source/sys_wind.c index c5e3b86df..021d00638 100644 --- a/nq/source/sys_wind.c +++ b/nq/source/sys_wind.c @@ -159,9 +159,6 @@ main (int argc, const char **argv) Con_Printf ("Host_Init\n"); Host_Init (&parms); - Sys_Init_Cvars (); - Sys_Init (); - oldtime = Sys_DoubleTime (); /* main window message loop */ diff --git a/qw/source/cl_main.c b/qw/source/cl_main.c index fdac94f37..d1db1d555 100644 --- a/qw/source/cl_main.c +++ b/qw/source/cl_main.c @@ -1642,8 +1642,6 @@ Host_Init (void) cls.userinfo = Info_ParseString ("", MAX_INFO_STRING); cl.serverinfo = Info_ParseString ("", MAX_INFO_STRING); - Locs_Init (); - PI_Init (); CL_Cam_Init_Cvars (); @@ -1673,6 +1671,14 @@ Host_Init (void) Game_Init (); COM_Init (); + PI_RegisterPlugins (client_plugin_list); + Con_Init ("client"); + if (con_module) { + con_module->data->console->dl_name = cls.downloadname; + con_module->data->console->dl_percent = &cls.downloadpercent; + con_module->data->console->realtime = &realtime; + } + NET_Init (cl_port->int_val); Netchan_Init (); { @@ -1686,19 +1692,12 @@ Host_Init (void) W_LoadWadFile ("gfx.wad"); Key_Init (); - PI_RegisterPlugins (client_plugin_list); - Con_Init ("client"); - if (con_module) { - con_module->data->console->dl_name = cls.downloadname; - con_module->data->console->dl_percent = &cls.downloadpercent; - con_module->data->console->realtime = &realtime; - } Mod_Init (); CL_TimeFrames_Init(); // Con_Printf ("Exe: "__TIME__" "__DATE__"\n"); - Con_Printf ("%4.1f megs RAM used.\n", cl_mem_size->value); + Con_Printf ("%4.1f megabyte heap.\n", cl_mem_size->value); vid_basepal = (byte *) COM_LoadHunkFile ("gfx/palette.lmp"); if (!vid_basepal) @@ -1706,20 +1705,7 @@ Host_Init (void) vid_colormap = (byte *) COM_LoadHunkFile ("gfx/colormap.lmp"); if (!vid_colormap) Sys_Error ("Couldn't load gfx/colormap.lmp"); -#ifdef __linux__ - CDAudio_Init (); - VID_Init (vid_basepal); - IN_Init (); - Draw_Init (); - SCR_Init (); - R_Init (); - S_Init (&cl.worldmodel, &viewentity, &host_frametime); - - Sbar_Init (); - CL_Skin_Init (); - CL_Init (); -#else VID_Init (vid_basepal); Draw_Init (); SCR_Init (); @@ -1729,10 +1715,12 @@ Host_Init (void) CDAudio_Init (); Sbar_Init (); - CL_Skin_Init (); CL_Init (); IN_Init (); -#endif + + CL_SetState (ca_disconnected); + CL_Skin_Init (); + Locs_Init (); if (cl_quakerc->int_val) Cbuf_InsertText ("exec quake.rc\n"); @@ -1751,12 +1739,11 @@ Host_Init (void) host_initialized = true; - CL_SetState (ca_disconnected); Con_Printf ("\nClient version %s (build %04d)\n\n", VERSION, build_number ()); - Con_Printf (" %s initialized \n", PROGRAM); + Con_Printf ("\x80\x81\x81\x82 %s initialized \x80\x81\x81\x82\n", PROGRAM); CL_UpdateScreen (realtime); }