mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 15:01:41 +00:00
Move the essential init code into Sys_Init().
This commit is contained in:
parent
f921005a5d
commit
a71acc9ae5
13 changed files with 14 additions and 65 deletions
|
@ -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");
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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, "");
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Reference in a new issue