- command line stuff can be traced back to JFDuke.

This commit is contained in:
Christoph Oelckers 2020-06-23 21:56:42 +02:00
parent 99067f3bd6
commit 18b272412a
7 changed files with 29 additions and 52 deletions

View file

@ -1,5 +1,6 @@
set( PCH_SOURCES set( PCH_SOURCES
src/game_main.cpp
src/actors.cpp src/actors.cpp
src/actors_r.cpp src/actors_r.cpp
src/actors_d.cpp src/actors_d.cpp
@ -33,7 +34,6 @@ set( PCH_SOURCES
src/zz_actors.cpp src/zz_actors.cpp
src/zz_anim.cpp src/zz_anim.cpp
src/zz_cheats.cpp src/zz_cheats.cpp
src/zz_cmdline.cpp
src/zz_common.cpp src/zz_common.cpp
src/zz_d_menu.cpp src/zz_d_menu.cpp
src/zz_demo.cpp src/zz_demo.cpp

View file

@ -1,38 +0,0 @@
//-------------------------------------------------------------------------
/*
Copyright (C) 2016 EDuke32 developers and contributors
This file is part of EDuke32.
EDuke32 is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
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 the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
//-------------------------------------------------------------------------
#ifndef cmdline_h__
#define cmdline_h__
#include "compat.h"
BEGIN_DUKE_NS
extern void G_CheckCommandLine();
extern void G_ShowParameterHelp(void);
extern void G_ShowDebugHelp(void);
extern int32_t g_fakeMultiMode;
END_DUKE_NS
#endif // cmdline_h__

View file

@ -37,6 +37,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_DUKE_NS BEGIN_DUKE_NS
extern int32_t g_fakeMultiMode;
#define VOLUMEALL (g_Shareware == 0) #define VOLUMEALL (g_Shareware == 0)
#define PLUTOPAK (true)//g_scriptVersion >= 14) #define PLUTOPAK (true)//g_scriptVersion >= 14)
#define VOLUMEONE (g_Shareware == 1) #define VOLUMEONE (g_Shareware == 1)

View file

@ -1,12 +1,13 @@
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
/* /*
Copyright (C) 2016 EDuke32 developers and contributors Copyright (C) 1996, 2003 - 3D Realms Entertainment
This file is part of EDuke32. This file is part of Duke Nukem 3D version 1.5 - Atomic Edition
EDuke32 is free software; you can redistribute it and/or Duke Nukem 3D is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 2 modify it under the terms of the GNU General Public License
as published by the Free Software Foundation. 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, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
@ -16,9 +17,13 @@ See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Original Source: 1996 - Todd Replogle
Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au)
*/ */
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
#include "ns.h" // Must come before everything else! #include "ns.h" // Must come before everything else!
@ -31,17 +36,23 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_DUKE_NS BEGIN_DUKE_NS
int32_t g_fakeMultiMode = 0; //---------------------------------------------------------------------------
//
// game specific command line args go here.
//
//---------------------------------------------------------------------------
void G_CheckCommandLine() void checkcommandline()
{ {
auto val = Args->CheckValue("-skill"); auto val = Args->CheckValue("-skill");
if (!val) val = Args->CheckValue("-s");
if (val) if (val)
{ {
ud.m_player_skill = ud.player_skill = clamp((int)strtol(val, nullptr, 0), 0, 5); ud.m_player_skill = ud.player_skill = clamp((int)strtol(val, nullptr, 0), 0, 5);
if (ud.m_player_skill == 4) ud.m_respawn_monsters = ud.respawn_monsters = 1; if (ud.m_player_skill == 4) ud.m_respawn_monsters = ud.respawn_monsters = 1;
} }
val = Args->CheckValue("-respawn"); val = Args->CheckValue("-respawn");
if (!val) val = Args->CheckValue("-t");
if (val) if (val)
{ {
if (*val == '1') ud.m_respawn_monsters = 1; if (*val == '1') ud.m_respawn_monsters = 1;
@ -56,4 +67,6 @@ void G_CheckCommandLine()
Printf("Respawn on.\n"); Printf("Respawn on.\n");
} }
} }
END_DUKE_NS END_DUKE_NS

View file

@ -37,7 +37,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "cheats.h" #include "cheats.h"
#include "sbar.h" #include "sbar.h"
#include "screens.h" #include "screens.h"
#include "cmdline.h"
#include "palette.h" #include "palette.h"
#include "gamecvars.h" #include "gamecvars.h"
#include "gameconfigfile.h" #include "gameconfigfile.h"
@ -60,7 +59,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_DUKE_NS BEGIN_DUKE_NS
void SetDispatcher(); void SetDispatcher();
void checkcommandline();
int32_t g_fakeMultiMode = 0;
int32_t g_quitDeadline = 0; int32_t g_quitDeadline = 0;
int32_t g_cameraDistance = 0, g_cameraClock = 0; int32_t g_cameraDistance = 0, g_cameraClock = 0;
@ -2375,7 +2376,7 @@ int GameInterface::app_main()
// accesses g_player[0]. // accesses g_player[0].
G_MaybeAllocPlayer(0); G_MaybeAllocPlayer(0);
G_CheckCommandLine(); checkcommandline();
SetDefaults(); SetDefaults();

View file

@ -20,10 +20,10 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
#include "ns.h" // Must come before everything else! #include "ns.h" // Must come before everything else!
#include "cheats.h" #include "cheats.h"
#include "cmdline.h"
#include "demo.h" // g_firstDemoFile[] #include "demo.h" // g_firstDemoFile[]
#include "duke3d.h" #include "duke3d.h"
#include "menus.h" #include "menus.h"

View file

@ -26,7 +26,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "menus.h" #include "menus.h"
#include "demo.h" #include "demo.h"
#include "savegame.h" #include "savegame.h"
#include "cmdline.h"
#include "statistics.h" #include "statistics.h"
#include "menu/menu.h" #include "menu/menu.h"
#include "mapinfo.h" #include "mapinfo.h"