Merge branch 'master' of github.com:fabiangreffrath/woof

This commit is contained in:
Fabian Greffrath 2024-05-07 09:55:18 +02:00
commit badfd4ee9d
6 changed files with 87 additions and 25 deletions

View File

@ -36,7 +36,7 @@ import glob
import getopt import getopt
TEXT_WRAP_WIDTH = 78 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) # Find the maximum width of a list of parameters (for plain text output)
@ -233,7 +233,7 @@ class Parameter:
if len(text) <= 0: if len(text) <= 0:
pass pass
elif text[0] == "@": elif text[0] == "@":
match = re.match('@(\S+)\s*(.*)', text) match = re.match(r'@(\S+)\s*(.*)', text)
if not match: if not match:
raise "Malformed option line: %s" % text raise "Malformed option line: %s" % text
@ -341,7 +341,7 @@ class Parameter:
# Build the complete text for the argument # Build the complete text for the argument
# Split the description into words and add a word at a time # Split the description into words and add a word at a time
result = "" 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 maxlen = TEXT_WRAP_WIDTH - indent
outlines = [[]] outlines = [[]]
for word in words: for word in words:
@ -379,7 +379,7 @@ def read_wikipages():
for line in f: for line in f:
line = line.rstrip() line = line.rstrip()
line = re.sub('\#.*$', '', line) line = re.sub(r'\#.*$', '', line)
if not re.match(r'^\s*$', line): if not re.match(r'^\s*$', line):
wikipages.append(line) wikipages.append(line)
@ -412,7 +412,7 @@ def add_parameter(param, line, config_file):
# Is this documenting a command line parameter? # 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) line)
if match: if match:
@ -423,7 +423,7 @@ def add_parameter(param, line, config_file):
# Documenting a configuration file variable? # 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: if match:
param.name = match.group(1) param.name = match.group(1)
@ -447,7 +447,7 @@ def process_file(filename):
# Ignore empty lines # Ignore empty lines
if re.match('\s*$', line): if re.match(r'\s*$', line):
continue continue
# Currently reading a doc comment? # Currently reading a doc comment?
@ -455,7 +455,7 @@ def process_file(filename):
if param: if param:
# End of doc comment # End of doc comment
if not re.match('\s*//', line): if not re.match(r'\s*//', line):
waiting_for_checkparm = True waiting_for_checkparm = True
# The first non-empty line after the documentation comment # The first non-empty line after the documentation comment
@ -467,14 +467,14 @@ def process_file(filename):
else: else:
# More documentation text # More documentation text
munged_line = re.sub('\s*\/\/\s*', '', line, 1) munged_line = re.sub(r'\s*\/\/\s*', '', line, 1)
munged_line = re.sub('\s*$', '', munged_line) munged_line = re.sub(r'\s*$', '', munged_line)
param.add_text(munged_line) param.add_text(munged_line)
# Check for start of a doc comment # Check for start of a doc comment
if re.search("//!", line): if re.search(r'//!', line):
match = re.search("@begin_config_file\s*(\S+)", line) match = re.search(r'@begin_config_file\s*(\S+)', line)
if match: if match:
# Beginning a configuration file # Beginning a configuration file

View File

@ -115,7 +115,7 @@ static char *D_dehout(void)
// @category mod // @category mod
// @arg <filename> // @arg <filename>
// //
// Alias for -dehout. // Alias to -dehout.
// //
p = M_CheckParm("-bexout"); p = M_CheckParm("-bexout");
@ -1651,7 +1651,7 @@ static void D_ProcessDehCommandLine(void)
// @arg <files> // @arg <files>
// @category mod // @category mod
// //
// Alias for -deh. // Alias to -deh.
// //
if (p || (p = M_CheckParm("-bex"))) if (p || (p = M_CheckParm("-bex")))
@ -2114,11 +2114,25 @@ void D_DoomMain(void)
//! //!
// @category game // @category game
// @vanilla // @vanilla
// @help
// //
// Disable monsters. // 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 // @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 // @category game
// @arg <n> // @arg <n>

View File

@ -171,7 +171,15 @@ static void SaveGameSettings(net_gamesettings_t *settings)
longtics = (demo_compatibility && M_ParmExists("-longtics")) || mbf21; longtics = (demo_compatibility && M_ParmExists("-longtics")) || mbf21;
settings->lowres_turn = ((M_ParmExists("-record") && !longtics) || 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; settings->demo_version = demo_version;
G_WriteOptions(settings->options); G_WriteOptions(settings->options);
@ -215,13 +223,6 @@ static void InitConnectData(net_connect_data_t *connect_data)
connect_data->gamemode = gamemode; connect_data->gamemode = gamemode;
connect_data->gamemission = gamemission; connect_data->gamemission = gamemission;
//!
// @category demo
// @help
//
// Play with low turning resolution to emulate demo recording.
//
longtics = (demo_compatibility && M_ParmExists("-longtics")) || mbf21; longtics = (demo_compatibility && M_ParmExists("-longtics")) || mbf21;
// Are we recording a demo? Possibly set lowres turn mode // 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); int p = M_CheckParmWithArgs("-complevel", 1);
if (!p)
{
//!
// @arg <version>
// @category compat
// @help
//
// Alias to -complevel.
//
p = M_CheckParmWithArgs("-cl", 1);
}
if (p > 0) if (p > 0)
{ {
demover = G_GetNamedComplevel(myargv[p + 1]); demover = G_GetNamedComplevel(myargv[p + 1]);

View File

@ -2784,7 +2784,7 @@ void A_PlaySound(mobj_t *mo)
void A_RandomJump(mobj_t *mo) void A_RandomJump(mobj_t *mo)
{ {
if (demo_version < 203) if (demo_version < DV_MBF)
return; return;
if (P_Random(pr_randomjump) < mo->state->misc2) if (P_Random(pr_randomjump) < mo->state->misc2)
P_SetMobjState(mo, mo->state->misc1); P_SetMobjState(mo, mo->state->misc1);

View File

@ -12,9 +12,12 @@ static const char *params[] = {
"-coop_spawns", "-coop_spawns",
"-dog", "-dog",
"-fast", "-fast",
"-nm",
"-nomo",
"-nomonsters", "-nomonsters",
"-pistolstart", "-pistolstart",
"-respawn", "-respawn",
"-uv",
"-1", "-1",
"-2", "-2",
"-3", "-3",
@ -88,6 +91,7 @@ static const char *params_with_args[] = {
"-recordfromto", "-recordfromto",
"-skipsec", "-skipsec",
"-timedemo", "-timedemo",
"-cl",
"-complevel", "-complevel",
"-gameversion", "-gameversion",
"-setmem", "-setmem",
@ -102,10 +106,14 @@ General options: \n\
-iwad <file> Specify an IWAD file to use.\n\ -iwad <file> Specify an IWAD file to use.\n\
\n\ \n\
Game start options: \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\ -pistolstart Enables automatic pistol starts on each level.\n\
-skill <skill> Set the game skill, 1-5 (1: easiest, 5: hardest). A\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\ skill of 0 disables all monsters only in -complevel\n\
vanilla.\n\ vanilla.\n\
-uv Alias for -skill 4.\n\
-warp <x> <y>|<xy> Start a game immediately, warping to ExMy (Doom 1) or\n\ -warp <x> <y>|<xy> Start a game immediately, warping to ExMy (Doom 1) or\n\
MAPxy (Doom 2).\n\ MAPxy (Doom 2).\n\
\n\ \n\
@ -131,6 +139,7 @@ Demo options: \n\
rules.\n\ rules.\n\
\n\ \n\
Compatibility: \n\ Compatibility: \n\
-cl <version> Alias to -complevel.\n\
-complevel <version> Emulate a specific version of Doom/Boom/MBF. Valid\n\ -complevel <version> Emulate a specific version of Doom/Boom/MBF. Valid\n\
values are \"vanilla\", \"boom\", \"mbf\", \"mbf21\".\n\ values are \"vanilla\", \"boom\", \"mbf\", \"mbf21\".\n\
\n\ \n\