keep a static copy of src/param.h instead of always regenerating it (#723)

* keep a static copy of src/param.h instead of always regenerating it

* add ENABLE_PARAMSGEN option
This commit is contained in:
Fabian Greffrath 2022-09-09 07:39:49 +02:00 committed by GitHub
parent ad74f830b9
commit e31b3d0bb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 134 additions and 11 deletions

1
src/.gitignore vendored
View File

@ -1 +0,0 @@
params.h

View File

@ -154,9 +154,9 @@ add_executable(woof WIN32 ${WOOF_SOURCES})
target_woof_settings(woof)
target_include_directories(woof PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/../")
if(Python3_EXECUTABLE)
add_dependencies(woof paramsgen)
target_compile_definitions(woof PRIVATE HAVE_PARAMS_GEN)
option(ENABLE_PARAMSGEN "Regenerate the src/params.h header file" OFF)
if(ENABLE_PARAMSGEN AND Python3_EXECUTABLE)
add_dependencies(woof paramsgen)
endif()
if (FluidSynth_FOUND)

View File

@ -1814,8 +1814,6 @@ void D_DoomMain(void)
M_AddLooseFiles();
#endif
#if defined(HAVE_PARAMS_GEN)
//!
//
// Print command line help.
@ -1832,7 +1830,6 @@ void D_DoomMain(void)
{
M_CheckCommandLine();
}
#endif
FindResponseFile(); // Append response file arguments to command-line

View File

@ -95,7 +95,6 @@ int M_ParmArg2ToInt(int p)
}
#if defined(HAVE_PARAMS_GEN)
#include "params.h"
static int CheckArgs(int p)
@ -237,7 +236,6 @@ void M_PrintHelpString(void)
{
printf(HELP_STRING);
}
#endif
//----------------------------------------------------------------------------
//

View File

@ -49,10 +49,8 @@ int M_CheckParmWithArgs(const char *check, int num_args);
// line arguments, false if not.
boolean M_ParmExists(const char *check);
#if defined(HAVE_PARAMS_GEN)
boolean M_CheckCommandLine(void);
void M_PrintHelpString(void);
#endif
int M_ParmArgToInt(int p);
int M_ParmArg2ToInt(int p);

131
src/params.h Normal file
View File

@ -0,0 +1,131 @@
static const char *params[] = {
"-devparm",
"-help",
"-nomusic",
"-nosfx",
"-nosound",
"-version",
"-beta",
"-coop_spawns",
"-dog",
"-fast",
"-nomonsters",
"-pistolstart",
"-respawn",
"-1",
"-2",
"-3",
"-fullscreen",
"-hires",
"-noblit",
"-nodraw",
"-nograbmouse",
"-nohires",
"-window",
"-altdeath",
"-autojoin",
"-avg",
"-deathmatch",
"-dm3",
"-left",
"-oldsync",
"-privateserver",
"-right",
"-server",
"-solo-net",
"-blockmap",
"-dumplumps",
"-noautoload",
"-nocheats",
"-nodehlump",
"-nomapinfo",
"-nooptions",
"-levelstat",
"-longtics",
"-shorttics",
"-strict",
"-cdrom",
"-nogui",
};
static const char *params_with_args[] = {
"-config",
"-file",
"-iwad",
"-save",
"-shotdir",
"-dogs",
"-episode",
"-loadgame",
"-skill",
"-speed",
"-turbo",
"-warp",
"-connect",
"-dup",
"-extratics",
"-frags",
"-nodes",
"-port",
"-servername",
"-timer",
"-bex",
"-bexout",
"-deh",
"-dehout",
"-fastdemo",
"-maxdemo",
"-playdemo",
"-record",
"-recordfrom",
"-recordfromto",
"-skipsec",
"-timedemo",
"-complevel",
"-gameversion",
"-setmem",
"-spechit",
"-statdump",
};
#define HELP_STRING "Usage: woof [options] \n\
\n\
General options: \n\
-file <files> Load the specified PWAD files.\n\
-iwad <file> Specify an IWAD file to use.\n\
\n\
Game start options: \n\
-pistolstart Enables automatic pistol starts on each level.\n\
-skill <skill> Set the game skill, 1-5 (1: easiest, 5: hardest). A\n\
skill of 0 disables all monsters only in -complevel\n\
vanilla.\n\
-warp <x> <y>|<xy> Start a game immediately, warping to ExMy (Doom 1) or\n\
MAPxy (Doom 2).\n\
\n\
Networking options: \n\
-autojoin Automatically search the local LAN for a multiplayer\n\
server and join it.\n\
-connect <address> Connect to a multiplayer server running on the given\n\
address.\n\
-privateserver When running a server, don't register with the global\n\
master server. Implies -server.\n\
-server Start a multiplayer server, listening for connections.\n\
\n\
Dehacked and WAD merging: \n\
-deh <files> Load the given dehacked/bex patch(es).\n\
\n\
Demo options: \n\
-levelstat Write level statistics upon exit to levelstat.txt\n\
-playdemo <demo> Play back the demo named demo.lmp.\n\
-record <demo> Record a demo named demo.lmp.\n\
-shorttics Play with low turning resolution to emulate demo\n\
recording.\n\
-strict Sets compatibility and cosmetic settings according to DSDA\n\
rules.\n\
\n\
Compatibility: \n\
-complevel <version> Emulate a specific version of Doom/Boom/MBF. Valid\n\
values are \"vanilla\", \"boom\", \"mbf\", \"mbf21\".\n\
\n\
See CMDLINE.txt for a complete list of supported command line options.\n"