raze/source/games/duke/src/game_main.cpp

72 lines
2.1 KiB
C++
Raw Normal View History

//-------------------------------------------------------------------------
/*
Copyright (C) 1996, 2003 - 3D Realms Entertainment
This file is part of Duke Nukem 3D version 1.5 - Atomic Edition
Duke Nukem 3D 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 the Free Software
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!
2020-06-21 20:18:12 +00:00
#include "duke3d.h"
#include "demo.h"
#include "screens.h"
#include "baselayer.h"
#include "m_argv.h"
BEGIN_DUKE_NS
//---------------------------------------------------------------------------
//
// game specific command line args go here.
//
//---------------------------------------------------------------------------
void checkcommandline()
{
auto val = Args->CheckValue("-skill");
if (!val) val = Args->CheckValue("-s");
if (val)
{
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;
}
val = Args->CheckValue("-respawn");
if (!val) val = Args->CheckValue("-t");
if (val)
{
if (*val == '1') ud.m_respawn_monsters = 1;
else if (*val == '2') ud.m_respawn_items = 1;
else if (*val == '3') ud.m_respawn_inventory = 1;
else
{
ud.m_respawn_monsters = 1;
ud.m_respawn_items = 1;
ud.m_respawn_inventory = 1;
}
Printf("Respawn on.\n");
}
}
END_DUKE_NS