diff --git a/nq/include/game.h b/nq/include/game.h index 186509fa8..fbab9929c 100644 --- a/nq/include/game.h +++ b/nq/include/game.h @@ -169,4 +169,6 @@ extern qboolean isDedicated; extern qboolean abyss, rogue, hipnotic, standard_quake; extern cvar_t *registered; +void Game_Init (void); + #endif // __game_h diff --git a/nq/source/Makefile.am b/nq/source/Makefile.am index 81313dff9..0db392758 100644 --- a/nq/source/Makefile.am +++ b/nq/source/Makefile.am @@ -49,7 +49,7 @@ sound_ASM= snd_mixa.S common_ASM= sys_ia32.S worlda.S $(math_ASM) #endif -common_SOURCES= mathlib.c wad.c world.c \ +common_SOURCES= game.c mathlib.c wad.c world.c \ model.c model_alias.c model_brush.c model_sprite.c \ quakefs.c \ quakeio.c com.c \ diff --git a/nq/source/game.c b/nq/source/game.c new file mode 100644 index 000000000..f760ce203 --- /dev/null +++ b/nq/source/game.c @@ -0,0 +1,57 @@ +/* + game.c + + game specific support (notably hipnotic, rogue and abyss) + + Copyright (C) 1996-1997 Id Software, Inc. + Copyright (C) 1999,2000 Nelson Rush. + Copyright (C) 1999,2000 contributors of the QuakeForge project + Please see the file "AUTHORS" for a list of contributors + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + + $Id$ +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif +#include "qargs.h" +#include "game.h" + +/* + Game_Init +*/ +void Game_Init (void) +{ + if (COM_CheckParm ("-abyss")) { + abyss = true; + standard_quake = false; + } + + if (COM_CheckParm ("-rogue")) { + rogue = true; + standard_quake = false; + } + + if (COM_CheckParm ("-hipnotic")) { + hipnotic = true; + standard_quake = false; + } +} diff --git a/nq/source/host.c b/nq/source/host.c index 6f076784d..3c9e680a6 100644 --- a/nq/source/host.c +++ b/nq/source/host.c @@ -893,6 +893,8 @@ void Host_Init (quakeparms_t *parms) Cmd_Init (); GIB_Init (); + + Game_Init (); // execute +set as early as possible Cmd_StuffCmds_f (); diff --git a/nq/source/qargs.c b/nq/source/qargs.c deleted file mode 100644 index 490a2eb1e..000000000 --- a/nq/source/qargs.c +++ /dev/null @@ -1,173 +0,0 @@ -/* - qargs.c - - command line argument processing routines - - Copyright (C) 1996-1997 Id Software, Inc. - Copyright (C) 1999,2000 Nelson Rush. - Copyright (C) 1999,2000 contributors of the QuakeForge project - Please see the file "AUTHORS" for a list of contributors - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to: - - Free Software Foundation, Inc. - 59 Temple Place - Suite 330 - Boston, MA 02111-1307, USA - - $Id$ -*/ - -#ifdef HAVE_CONFIG_H -# include -#endif -#include "string.h" -#include "ctype.h" -#include "stdlib.h" -#include "qtypes.h" -#include "crc.h" -#include "sys.h" -#include "cmd.h" -#include "console.h" -#include "client.h" -#include "assert.h" - -#include - -usercmd_t nullcmd; // guarenteed to be zero - -static char **largv; -static char *argvdummy = " "; - -static char *safeargvs[] = - {"-stdvid", "-nolan", "-nosound", "-nocdaudio", "-nojoy", "-nomouse", "-dibonly"}; - -#define NUM_SAFE_ARGVS (sizeof(safeargvs)/sizeof(safeargvs[0])) - -int com_argc; -char **com_argv; -char *com_cmdline; -cvar_t *cmdline; - -qboolean nouse = false; // 1999-10-29 +USE fix by Maddes - -/* -================ -COM_CheckParm - -Returns the position (1 to argc-1) in the program's argument list -where the given parameter apears, or 0 if not present -================ -*/ -int COM_CheckParm (char *parm) -{ - int i; - - for (i=1 ; i 0); - strcat (com_cmdline, " "); - } - com_cmdline[len - 1] = '\0'; - } - - if (safe) - { - // force all the safe-mode switches. Note that we reserved extra space in - // case we need to add these, so we don't need an overflow check - for (i=0 ; i