From 2a04ddbca5117c0391c373874e95976110ad6ee0 Mon Sep 17 00:00:00 2001 From: Alaux <73968015+MrAlaux@users.noreply.github.com> Date: Wed, 1 May 2024 04:47:30 -0300 Subject: [PATCH 1/2] Use `DV_MBF` instead of literal in `A_RandomJump()` (#1674) --- src/p_enemy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 8b7dbfb4..06d46a65 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -2784,7 +2784,7 @@ void A_PlaySound(mobj_t *mo) void A_RandomJump(mobj_t *mo) { - if (demo_version < 203) + if (demo_version < DV_MBF) return; if (P_Random(pr_randomjump) < mo->state->misc2) P_SetMobjState(mo, mo->state->misc1); From cb08a6f0d259fc4d6a693e200a31f94d46195f8b Mon Sep 17 00:00:00 2001 From: Roman Fomin Date: Tue, 7 May 2024 07:05:43 +0000 Subject: [PATCH 2/2] add aliases from DSDA-Doom, fix docgen warnings (#1678) --- man/docgen | 26 +++++++++++++------------- src/d_main.c | 46 +++++++++++++++++++++++++++++++++++++++++++--- src/d_net.c | 17 +++++++++-------- src/g_game.c | 12 ++++++++++++ src/params.h | 9 +++++++++ 5 files changed, 86 insertions(+), 24 deletions(-) diff --git a/man/docgen b/man/docgen index 239f1720..0b6426d8 100755 --- a/man/docgen +++ b/man/docgen @@ -36,7 +36,7 @@ import glob import getopt TEXT_WRAP_WIDTH = 78 -INCLUDE_STATEMENT_RE = re.compile("@include\s+(\S+)") +INCLUDE_STATEMENT_RE = re.compile(r'@include\s+(\S+)') # Find the maximum width of a list of parameters (for plain text output) @@ -233,14 +233,14 @@ class Parameter: if len(text) <= 0: pass elif text[0] == "@": - match = re.match('@(\S+)\s*(.*)', text) + match = re.match(r'@(\S+)\s*(.*)', text) if not match: raise "Malformed option line: %s" % text option_type = match.group(1) data = match.group(2) - + if option_type == "arg": self.args = data elif option_type == "platform": @@ -341,7 +341,7 @@ class Parameter: # Build the complete text for the argument # Split the description into words and add a word at a time result = "" - words = [word for word in re.split('\s+', description) if word] + words = [word for word in re.split(r'\s+', description) if word] maxlen = TEXT_WRAP_WIDTH - indent outlines = [[]] for word in words: @@ -379,7 +379,7 @@ def read_wikipages(): for line in f: line = line.rstrip() - line = re.sub('\#.*$', '', line) + line = re.sub(r'\#.*$', '', line) if not re.match(r'^\s*$', line): wikipages.append(line) @@ -412,7 +412,7 @@ def add_parameter(param, line, config_file): # Is this documenting a command line parameter? - match = re.search('(M_CheckParm(WithArgs)|M_ParmExists)?\s*\(\s*"(.*?)"', + match = re.search(r'(M_CheckParm(WithArgs)|M_ParmExists)?\s*\(\s*"(.*?)"', line) if match: @@ -423,7 +423,7 @@ def add_parameter(param, line, config_file): # Documenting a configuration file variable? - match = re.search('CONFIG_VARIABLE_\S+\s*\(\s*(\S+?)\),', line) + match = re.search(r'CONFIG_VARIABLE_\S+\s*\(\s*(\S+?)\),', line) if match: param.name = match.group(1) @@ -447,7 +447,7 @@ def process_file(filename): # Ignore empty lines - if re.match('\s*$', line): + if re.match(r'\s*$', line): continue # Currently reading a doc comment? @@ -455,7 +455,7 @@ def process_file(filename): if param: # End of doc comment - if not re.match('\s*//', line): + if not re.match(r'\s*//', line): waiting_for_checkparm = True # The first non-empty line after the documentation comment @@ -467,14 +467,14 @@ def process_file(filename): else: # More documentation text - munged_line = re.sub('\s*\/\/\s*', '', line, 1) - munged_line = re.sub('\s*$', '', munged_line) + munged_line = re.sub(r'\s*\/\/\s*', '', line, 1) + munged_line = re.sub(r'\s*$', '', munged_line) param.add_text(munged_line) # Check for start of a doc comment - if re.search("//!", line): - match = re.search("@begin_config_file\s*(\S+)", line) + if re.search(r'//!', line): + match = re.search(r'@begin_config_file\s*(\S+)', line) if match: # Beginning a configuration file diff --git a/src/d_main.c b/src/d_main.c index 3d27f3c9..fbc94fd5 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -115,7 +115,7 @@ static char *D_dehout(void) // @category mod // @arg // - // Alias for -dehout. + // Alias to -dehout. // p = M_CheckParm("-bexout"); @@ -1651,7 +1651,7 @@ static void D_ProcessDehCommandLine(void) // @arg // @category mod // - // Alias for -deh. + // Alias to -deh. // if (p || (p = M_CheckParm("-bex"))) @@ -2114,11 +2114,25 @@ void D_DoomMain(void) //! // @category game // @vanilla + // @help // // Disable monsters. // - nomonsters = clnomonsters = M_CheckParm ("-nomonsters"); + p = M_CheckParm("-nomonsters"); + + if (!p) + { + //! + // @category game + // @help + // + // Alias to -nomonsters. + // + p = M_CheckParm("-nomo"); + } + + nomonsters = clnomonsters = p; //! // @category game @@ -2346,6 +2360,32 @@ void D_DoomMain(void) } } + //! + // @category game + // @help + // + // Alias to -skill 4. + // + + if (M_ParmExists("-uv")) + { + startskill = sk_hard; + autostart = true; + } + + //! + // @category game + // @help + // + // Alias to -skill 5. + // + + if (M_ParmExists("-nm")) + { + startskill = sk_nightmare; + autostart = true; + } + //! // @category game // @arg diff --git a/src/d_net.c b/src/d_net.c index 607a7151..bcd55b62 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -171,7 +171,15 @@ static void SaveGameSettings(net_gamesettings_t *settings) longtics = (demo_compatibility && M_ParmExists("-longtics")) || mbf21; settings->lowres_turn = ((M_ParmExists("-record") && !longtics) || - M_ParmExists("-shorttics") || shorttics); + + //! + // @category demo + // @help + // + // Play with low turning resolution to emulate demo recording. + // + + M_ParmExists("-shorttics") || shorttics); settings->demo_version = demo_version; G_WriteOptions(settings->options); @@ -215,13 +223,6 @@ static void InitConnectData(net_connect_data_t *connect_data) connect_data->gamemode = gamemode; connect_data->gamemission = gamemission; - //! - // @category demo - // @help - // - // Play with low turning resolution to emulate demo recording. - // - longtics = (demo_compatibility && M_ParmExists("-longtics")) || mbf21; // Are we recording a demo? Possibly set lowres turn mode diff --git a/src/g_game.c b/src/g_game.c index e5c97716..8c3cc00d 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3441,6 +3441,18 @@ void G_ReloadDefaults(boolean keep_demover) int p = M_CheckParmWithArgs("-complevel", 1); + if (!p) + { + //! + // @arg + // @category compat + // @help + // + // Alias to -complevel. + // + p = M_CheckParmWithArgs("-cl", 1); + } + if (p > 0) { demover = G_GetNamedComplevel(myargv[p + 1]); diff --git a/src/params.h b/src/params.h index def0d0df..b0bc946e 100644 --- a/src/params.h +++ b/src/params.h @@ -12,9 +12,12 @@ static const char *params[] = { "-coop_spawns", "-dog", "-fast", +"-nm", +"-nomo", "-nomonsters", "-pistolstart", "-respawn", +"-uv", "-1", "-2", "-3", @@ -88,6 +91,7 @@ static const char *params_with_args[] = { "-recordfromto", "-skipsec", "-timedemo", +"-cl", "-complevel", "-gameversion", "-setmem", @@ -102,10 +106,14 @@ General options: \n\ -iwad Specify an IWAD file to use.\n\ \n\ Game start options: \n\ + -nm Alias for -skill 5.\n\ + -nomo Alias to -nomonsters.\n\ + -nomonsters Disable monsters.\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\ + -uv Alias for -skill 4.\n\ -warp | Start a game immediately, warping to ExMy (Doom 1) or\n\ MAPxy (Doom 2).\n\ \n\ @@ -131,6 +139,7 @@ Demo options: \n\ rules.\n\ \n\ Compatibility: \n\ + -cl Alias to -complevel.\n\ -complevel Emulate a specific version of Doom/Boom/MBF. Valid\n\ values are \"vanilla\", \"boom\", \"mbf\", \"mbf21\".\n\ \n\