add aliases from DSDA-Doom, fix docgen warnings (#1678)

This commit is contained in:
Roman Fomin 2024-05-07 07:05:43 +00:00 committed by GitHub
parent 2a04ddbca5
commit cb08a6f0d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 86 additions and 24 deletions

View File

@ -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

View File

@ -115,7 +115,7 @@ static char *D_dehout(void)
// @category mod
// @arg <filename>
//
// Alias for -dehout.
// Alias to -dehout.
//
p = M_CheckParm("-bexout");
@ -1651,7 +1651,7 @@ static void D_ProcessDehCommandLine(void)
// @arg <files>
// @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 <n>

View File

@ -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

View File

@ -3441,6 +3441,18 @@ void G_ReloadDefaults(boolean keep_demover)
int p = M_CheckParmWithArgs("-complevel", 1);
if (!p)
{
//!
// @arg <version>
// @category compat
// @help
//
// Alias to -complevel.
//
p = M_CheckParmWithArgs("-cl", 1);
}
if (p > 0)
{
demover = G_GetNamedComplevel(myargv[p + 1]);

View File

@ -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 <file> 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 <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 <x> <y>|<xy> 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 <version> Alias to -complevel.\n\
-complevel <version> Emulate a specific version of Doom/Boom/MBF. Valid\n\
values are \"vanilla\", \"boom\", \"mbf\", \"mbf21\".\n\
\n\