From e31b3d0bb068b26c246a0f82fc2560866f5ba672 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Fri, 9 Sep 2022 07:39:49 +0200 Subject: [PATCH] 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 --- src/.gitignore | 1 - src/CMakeLists.txt | 6 +-- src/d_main.c | 3 -- src/m_argv.c | 2 - src/m_argv.h | 2 - src/params.h | 131 +++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 134 insertions(+), 11 deletions(-) delete mode 100644 src/.gitignore create mode 100644 src/params.h diff --git a/src/.gitignore b/src/.gitignore deleted file mode 100644 index 8e69d048..00000000 --- a/src/.gitignore +++ /dev/null @@ -1 +0,0 @@ -params.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b7a4245d..047ef545 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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) diff --git a/src/d_main.c b/src/d_main.c index e1940281..54233bcd 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -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 diff --git a/src/m_argv.c b/src/m_argv.c index 27dc1a7e..387ef977 100644 --- a/src/m_argv.c +++ b/src/m_argv.c @@ -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 //---------------------------------------------------------------------------- // diff --git a/src/m_argv.h b/src/m_argv.h index 3e336e9a..0549e554 100644 --- a/src/m_argv.h +++ b/src/m_argv.h @@ -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); diff --git a/src/params.h b/src/params.h new file mode 100644 index 00000000..29896e33 --- /dev/null +++ b/src/params.h @@ -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 Load the specified PWAD files.\n\ + -iwad Specify an IWAD file to use.\n\ +\n\ +Game start options: \n\ + -pistolstart Enables automatic pistol starts on each level.\n\ + -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 | 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
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 Load the given dehacked/bex patch(es).\n\ +\n\ +Demo options: \n\ + -levelstat Write level statistics upon exit to levelstat.txt\n\ + -playdemo Play back the demo named demo.lmp.\n\ + -record 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 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"