Move the essential init code into Sys_Init().

This commit is contained in:
Bill Currie 2011-09-11 14:56:47 +09:00
parent f921005a5d
commit a71acc9ae5
13 changed files with 14 additions and 65 deletions

View file

@ -525,12 +525,7 @@ main (int argc, const char **argv)
Sys_RegisterShutdown (SV_Shutdown);
Cvar_Init_Hash ();
Cmd_Init_Hash ();
Cvar_Init ();
Sys_Init_Cvars ();
Sys_Init ();
Cmd_Init ();
Cmd_AddCommand ("quit", MST_Quit_f, "Shut down the master server");
Cmd_AddCommand ("clear", SVL_Clear, "Clear the server list");

View file

@ -69,13 +69,8 @@ init (void)
testsound_cbuf = Cbuf_New (&id_interp);
testsound_args = Cbuf_ArgsNew ();
Cvar_Init_Hash ();
Cmd_Init_Hash ();
Cvar_Init ();
Sys_Init_Cvars ();
Sys_Init ();
Cvar_Get ("cmd_warncmd", "1", CVAR_NONE, NULL, NULL);
Cmd_Init ();
Cmd_StuffCmds (testsound_cbuf);
Cbuf_Execute_Sets (testsound_cbuf);

View file

@ -75,6 +75,7 @@ static __attribute__ ((used)) const char rcsid[] =
#include <direct.h>
#endif
#include "QF/cmd.h"
#include "QF/cvar.h"
#include "QF/dstring.h"
#include "QF/sys.h"
@ -773,6 +774,13 @@ Sys_Init (void)
signal (SIGSEGV, signal_handler);
signal (SIGTERM, signal_handler);
signal (SIGFPE, signal_handler);
Cvar_Init_Hash ();
Cmd_Init_Hash ();
Cvar_Init ();
Sys_Init_Cvars ();
Cmd_Init ();
}
VISIBLE int

View file

@ -898,14 +898,7 @@ Host_Init (void)
host_cbuf = Cbuf_New (&id_interp);
cmd_source = src_command;
Cvar_Init_Hash ();
Cmd_Init_Hash ();
Cvar_Init ();
Sys_Init_Cvars ();
Sys_Init ();
Cmd_Init ();
GIB_Init (true);
// execute +set as early as possible

View file

@ -259,13 +259,8 @@ qtv_init (void)
Sys_RegisterShutdown (qtv_shutdown);
Cvar_Init_Hash ();
Cmd_Init_Hash ();
Cvar_Init ();
Sys_Init_Cvars ();
Sys_Init ();
Cvar_Get ("cmd_warncmd", "1", CVAR_NONE, NULL, NULL);
Cmd_Init ();
Cmd_StuffCmds (qtv_cbuf);
Cbuf_Execute_Sets (qtv_cbuf);

View file

@ -1713,14 +1713,7 @@ Host_Init (void)
cl_cbuf = Cbuf_New (&id_interp);
cl_stbuf = Cbuf_New (&id_interp);
Cvar_Init_Hash ();
Cmd_Init_Hash ();
Cvar_Init ();
Sys_Init_Cvars ();
Sys_Init ();
Cmd_Init ();
GIB_Init (true);
// execute +set as early as possible

View file

@ -2492,16 +2492,9 @@ SV_Init (void)
Sys_RegisterShutdown (SV_Shutdown);
Cvar_Init_Hash ();
Cmd_Init_Hash ();
Cvar_Init ();
Sys_Init_Cvars ();
Sys_Init ();
Cvar_Get ("cmd_warncmd", "1", CVAR_NONE, NULL, NULL);
Cmd_Init ();
GIB_Init (true);
// execute +set as early as possible

View file

@ -922,11 +922,7 @@ write_pcx (image_t *image)
palette[i * 3 + 2] = i;
}
Cvar_Init_Hash ();
Cmd_Init_Hash ();
Cvar_Init ();
Sys_Init_Cvars ();
Cmd_Init ();
Sys_Init ();
Memory_Init (malloc (MEMSIZE), MEMSIZE);
pcx = EncodePCX (image->image, image->width, image->height,

View file

@ -111,10 +111,7 @@ main (int argc, char **argv)
int result, i;
// Initialize required QF subsystems
Cvar_Init_Hash ();
Cmd_Init_Hash ();
Cmd_Init ();
Cvar_Init ();
Sys_Init ();
GIB_Init (false); // No sandbox
GIB_Builtin_Add ("exit", Carne_GIB_Exit_f);

View file

@ -230,11 +230,7 @@ func_find (int st_ofs)
static void
init_qf (void)
{
Cvar_Init_Hash ();
Cmd_Init_Hash ();
Cvar_Init ();
Sys_Init_Cvars ();
Cmd_Init ();
Sys_Init ();
Cvar_Get ("pr_debug", va ("%d", verbosity), 0, 0, "");
Cvar_Get ("pr_source_path", source_path, 0, 0, "");

View file

@ -330,11 +330,7 @@ main (int argc, char **argv)
this_program = argv[0];
Cvar_Init_Hash ();
Cmd_Init_Hash ();
Cvar_Init ();
Sys_Init_Cvars ();
Cmd_Init ();
Sys_Init ();
Memory_Init (malloc (MEMSIZE), MEMSIZE);
decode_args (argc, argv);

View file

@ -102,12 +102,8 @@ free_progs_mem (progs_t *pr, void *mem)
static void
init_qf (void)
{
Cvar_Init_Hash ();
Cmd_Init_Hash ();
Sys_Init ();
//Cvar_Get ("developer", "128", 0, 0, 0);
Cvar_Init ();
Sys_Init_Cvars ();
Cmd_Init ();
Memory_Init (malloc (1024 * 1024), 1024 * 1024);

View file

@ -388,11 +388,7 @@ main (int argc, char **argv)
int i;//, j, rehash = 0;
lumpinfo_t *pf;
Cvar_Init_Hash ();
Cmd_Init_Hash ();
Cvar_Init ();
Sys_Init_Cvars ();
Cmd_Init ();
Sys_Init ();
Memory_Init (malloc (MEMSIZE), MEMSIZE);
this_program = argv[0];