mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-22 12:11:34 +00:00
ok, server now runs without segging on a cvar (with simple testing, anyway.
needs fuller bashing).
This commit is contained in:
parent
54963bfcb4
commit
3a9eba4f03
7 changed files with 51 additions and 12 deletions
|
@ -82,6 +82,7 @@ void Sys_Printf (char *fmt, ...) __attribute__((format(printf,1,2)));
|
|||
// send text to the console
|
||||
|
||||
void Sys_Init (void);
|
||||
void Sys_Init_Cvars (void);
|
||||
|
||||
#endif // _SYS_H
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
cl_sys_sdl.c
|
||||
cl_sys_sdl.c
|
||||
|
||||
(description)
|
||||
|
||||
|
@ -243,6 +243,19 @@ void Sys_Sleep (void)
|
|||
{
|
||||
}
|
||||
|
||||
void
|
||||
Sys_Init (void)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
Sys_Init_Cvars (void)
|
||||
{
|
||||
sys_nostdout = Cvar_Get("sys_nostdout", "0", CVAR_NONE, "None");
|
||||
if (COM_CheckParm("-nostdout"))
|
||||
Cvar_Set(sys_nostdout, "1");
|
||||
}
|
||||
|
||||
C_LINKAGE int SDL_main(int c, char **v)
|
||||
{
|
||||
|
||||
|
@ -285,14 +298,12 @@ C_LINKAGE int SDL_main(int c, char **v)
|
|||
*/
|
||||
parms.basedir = BASEDIR;
|
||||
|
||||
sys_nostdout = Cvar_Get("sys_nostdout", "0", CVAR_NONE, "None");
|
||||
|
||||
#ifndef WIN32
|
||||
noconinput = COM_CheckParm("-noconinput");
|
||||
if (!noconinput)
|
||||
fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | O_NONBLOCK);
|
||||
#endif
|
||||
if (COM_CheckParm("-nostdout")) Cvar_Set(sys_nostdout, "1");
|
||||
|
||||
Host_Init(&parms);
|
||||
|
||||
|
|
|
@ -113,16 +113,23 @@ void Sys_Printf (char *fmt, ...)
|
|||
}
|
||||
*/
|
||||
|
||||
void Sys_Quit (void)
|
||||
void
|
||||
Sys_Quit (void)
|
||||
{
|
||||
Host_Shutdown();
|
||||
fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NONBLOCK);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
void Sys_Init(void)
|
||||
void
|
||||
Sys_Init_Cvars (void)
|
||||
{
|
||||
sys_nostdout = Cvar_Get("sys_nostdout", "0", CVAR_NONE, "None");
|
||||
if (COM_CheckParm("-nostdout")) Cvar_Set(sys_nostdout, "1");
|
||||
}
|
||||
|
||||
void Sys_Init(void)
|
||||
{
|
||||
#ifdef USE_INTEL_ASM
|
||||
Sys_SetFPCW();
|
||||
#endif
|
||||
|
@ -242,7 +249,6 @@ int main (int c, char **v)
|
|||
noconinput = COM_CheckParm("-noconinput");
|
||||
if (!noconinput)
|
||||
fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | O_NONBLOCK);
|
||||
if (COM_CheckParm("-nostdout")) Cvar_Set(sys_nostdout, "1");
|
||||
|
||||
Host_Init(&parms);
|
||||
|
||||
|
|
|
@ -166,6 +166,13 @@ void Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length)
|
|||
Sys_Init
|
||||
================
|
||||
*/
|
||||
|
||||
void
|
||||
Sys_Init_Cvars (void)
|
||||
{
|
||||
sys_nostdout = Cvar_Get("sys_nostdout", "1", CVAR_NONE, "None");
|
||||
}
|
||||
|
||||
void Sys_Init (void)
|
||||
{
|
||||
OSVERSIONINFO vinfo;
|
||||
|
@ -520,7 +527,6 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
|
|||
if (!tevent)
|
||||
Sys_Error ("Couldn't create event");
|
||||
|
||||
sys_nostdout = Cvar_Get("sys_nostdout", "1", CVAR_NONE, "None");
|
||||
// because sound is off until we become active
|
||||
S_BlockSound ();
|
||||
|
||||
|
|
|
@ -1888,6 +1888,12 @@ void SV_Init (quakeparms_t *parms)
|
|||
Cbuf_Execute_Sets ();
|
||||
|
||||
COM_Filesystem_Init_Cvars ();
|
||||
COM_Init_Cvars ();
|
||||
Mod_Init_Cvars ();
|
||||
Netchan_Init_Cvars ();
|
||||
Pmove_Init_Cvars ();
|
||||
PR_Init_Cvars ();
|
||||
Sys_Init_Cvars ();
|
||||
|
||||
// and now reprocess the cmdline's sets for overrides
|
||||
Cmd_StuffCmds_f ();
|
||||
|
@ -1895,7 +1901,6 @@ void SV_Init (quakeparms_t *parms)
|
|||
|
||||
COM_Init ();
|
||||
|
||||
PR_Init_Cvars ();
|
||||
PR_Init ();
|
||||
Mod_Init ();
|
||||
|
||||
|
|
|
@ -139,12 +139,17 @@ Quake calls this so the system can register variables before host_hunklevel
|
|||
is marked
|
||||
=============
|
||||
*/
|
||||
void Sys_Init (void)
|
||||
void Sys_Init_Cvars (void)
|
||||
{
|
||||
sys_nostdout = Cvar_Get("sys_nostdout", "0", CVAR_NONE, "None");
|
||||
sys_extrasleep = Cvar_Get("sys_extrasleep", "0", CVAR_NONE, "None");
|
||||
}
|
||||
|
||||
void
|
||||
Sys_Init (void)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
main
|
||||
|
|
|
@ -150,13 +150,18 @@ Quake calls this so the system can register variables before host_hunklevel
|
|||
is marked
|
||||
=============
|
||||
*/
|
||||
|
||||
void
|
||||
Sys_Init_Cvars (void)
|
||||
{
|
||||
sys_nostdout = Cvar_Get("sys_nostdout", "0", CVAR_NONE, "None");
|
||||
sys_sleep = Cvar_Get("sys_sleep", "8", CVAR_NONE, "None");
|
||||
}
|
||||
|
||||
void Sys_Init (void)
|
||||
{
|
||||
OSVERSIONINFO vinfo;
|
||||
|
||||
sys_nostdout = Cvar_Get("sys_nostdout", "0", CVAR_NONE, "None");
|
||||
sys_sleep = Cvar_Get("sys_sleep", "8", CVAR_NONE, "None");
|
||||
|
||||
// make sure the timer is high precision, otherwise
|
||||
// NT gets 18ms resolution
|
||||
timeBeginPeriod( 1 );
|
||||
|
|
Loading…
Reference in a new issue