diff options
-rwxr-xr-x | man/docgen | 68 | ||||
-rw-r--r-- | src/d_main.c | 21 | ||||
-rw-r--r-- | src/g_game.c | 5 | ||||
-rw-r--r-- | src/m_misc.c | 2 | ||||
-rw-r--r-- | src/s_sound.c | 31 |
5 files changed, 110 insertions, 17 deletions
@@ -6,7 +6,7 @@ # //! # // @arg <extra arguments> # // @category Category -# // @platform <some platform that the parameter is specific to +# // @platform <some platform that the parameter is specific to> # // # // Long description of the parameter # // @@ -19,6 +19,7 @@ import sys import re import glob +import getopt class Category: def __init__(self, description): @@ -54,7 +55,8 @@ class Category: w = self.paramtext_width() for p in self.params: - result += p.plaintext_output(w) + if p.should_show(): + result += p.plaintext_output(w) result = result.rstrip() + "\n" @@ -66,8 +68,9 @@ class Category: self.params.sort() for p in self.params: - result += ".TP\n" - result += p.manpage_output() + if p.should_show(): + result += ".TP\n" + result += p.manpage_output() return result @@ -77,7 +80,14 @@ class Category: self.params.sort() for p in self.params: - result += "; " + p.wiki_output() + "\n" + if p.should_show(): + result += "; " + p.wiki_output() + "\n" + + # Escape special HTML characters + + result = result.replace("&", "&") + result = result.replace("<", "<") + result = result.replace(">", ">") return result @@ -90,6 +100,10 @@ categories = { "compat": Category("Compatibility"), } +# Show options that are in Vanilla Doom? Or only new options? + +show_vanilla_options = True + class Parameter: def __cmp__(self, other): if self.name < other.name: @@ -103,12 +117,16 @@ class Parameter: self.args = None self.platform = None self.category = None + self.vanilla_option = False + + def should_show(self): + return not self.vanilla_option or show_vanilla_options def add_text(self, text): if len(text) <= 0: pass elif text[0] == "@": - match = re.match('@(\S+)\s+(.*)', text) + match = re.match('@(\S+)\s*(.*)', text) if not match: raise "Malformed option line: %s" % text @@ -122,6 +140,8 @@ class Parameter: self.platform = data elif option_type == "category": self.category = data + elif option_type == "vanilla": + self.vanilla_option = True else: raise "Unknown option type '%s'" % option_type @@ -158,7 +178,7 @@ class Parameter: result += self.text if self.platform: - result += "'''(%s only)'''" + result += "'''(%s only)'''" % self.platform return result @@ -305,12 +325,32 @@ def plaintext_output(dir): if c != None: print categories[c].plaintext_output() -if len(sys.argv) > 2 and sys.argv[1] == "-m": - manpage_output(sys.argv[2]) -elif len(sys.argv) > 2 and sys.argv[1] == "-w": - wiki_output(sys.argv[2]) -elif len(sys.argv) > 2 and sys.argv[1] == "-p": - plaintext_output(sys.argv[2]) +def usage(): + print "Usage: %s [-V] ( -m | -w | -p ) <directory>" % sys.argv[0] + print " -m : Manpage output" + print " -w : Wikitext output" + print " -p : Plaintext output" + print " -V : Don't show Vanilla Doom options" + sys.exit(0) + +# Parse command line + +opts, args = getopt.getopt(sys.argv[1:], "mwpV") + +output_function = None + +for opt in opts: + if opt[0] == "-m": + output_function = manpage_output + elif opt[0] == "-w": + output_function = wiki_output + elif opt[0] == "-p": + output_function = plaintext_output + elif opt[0] == "-V": + show_vanilla_options = False + +if output_function == None or len(args) != 1: + usage() else: - print "%s [ -m | -w | -p ] <directory>" % sys.argv[0] + output_function(args[0]) diff --git a/src/d_main.c b/src/d_main.c index a511daf7..5b78df60 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -851,24 +851,32 @@ void D_DoomMain (void) modifiedgame = false; //! + // @vanilla + // // Disable monsters. // nomonsters = M_CheckParm ("-nomonsters"); //! + // @vanilla + // // Monsters respawn after being killed. // respawnparm = M_CheckParm ("-respawn"); //! + // @vanilla + // // Monsters move faster. // fastparm = M_CheckParm ("-fast"); //! + // @vanilla + // // Developer mode. F1 saves a screenshot in the current working // directory. // @@ -877,6 +885,7 @@ void D_DoomMain (void) //! // @category net + // @vanilla // // Start a deathmatch game. // @@ -886,6 +895,7 @@ void D_DoomMain (void) //! // @category net + // @vanilla // // Start a deathmatch 2.0 game. Weapons do not stay in place and // all items respawn after 30 seconds. @@ -903,6 +913,7 @@ void D_DoomMain (void) //! // @arg <x> + // @vanilla // // Turbo mode. The player's speed is multiplied by x%. If unspecified, // x defaults to 200. Values are rounded up to 10 and down to 400. @@ -1065,6 +1076,7 @@ void D_DoomMain (void) //! // @arg <files> + // @vanilla // // Load the specified PWAD files. // @@ -1125,6 +1137,7 @@ void D_DoomMain (void) //! // @arg <demo> // @category demo + // @vanilla // // Play back the demo named demo.lmp. // @@ -1136,6 +1149,7 @@ void D_DoomMain (void) //! // @arg <demo> // @category demo + // @vanilla // // Play back the demo named demo.lmp, determining the framerate // of the screen. @@ -1216,6 +1230,7 @@ void D_DoomMain (void) //! // @arg <skill> + // @vanilla // // Set the game skill, 1-5 (1: easiest, 5: hardest). A skill of // 0 disables all monsters. @@ -1231,6 +1246,7 @@ void D_DoomMain (void) //! // @arg <n> + // @vanilla // // Start playing on episode n (1-4) // @@ -1249,6 +1265,7 @@ void D_DoomMain (void) //! // @arg <n> // @category net + // @vanilla // // For multiplayer games: exit each level after n minutes. // @@ -1263,6 +1280,7 @@ void D_DoomMain (void) //! // @category net + // @vanilla // // Austin Virtual Gaming: end levels after 20 minutes. // @@ -1278,6 +1296,7 @@ void D_DoomMain (void) //! // @arg [<x> <y> | <xy>] + // @vanilla // // Start a game immediately, warping to ExMy (Doom 1) or MAPxy // (Doom 2) @@ -1324,6 +1343,7 @@ void D_DoomMain (void) //! // @arg <s> + // @vanilla // // Load the game in slot s. // @@ -1425,6 +1445,7 @@ void D_DoomMain (void) //! // @arg <x> // @category demo + // @vanilla // // Record a demo named x.lmp. // diff --git a/src/g_game.c b/src/g_game.c index 6a34135c..d2daebf6 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1842,6 +1842,7 @@ void G_RecordDemo (char* name) //! // @arg <size> // @category demo + // @vanilla // // Specify the demo buffer size (KiB) // @@ -1981,12 +1982,16 @@ void G_DoPlayDemo (void) void G_TimeDemo (char* name) { //! + // @vanilla + // // Disable rendering the screen entirely. // nodrawers = M_CheckParm ("-nodraw"); //! + // @vanilla + // // Disable blitting the screen. // diff --git a/src/m_misc.c b/src/m_misc.c index edf76a5f..36cc2fbc 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -682,6 +682,7 @@ void M_LoadDefaults (void) //! // @arg <file> + // @vanilla // // Load configuration from the specified file, instead of // default.cfg. @@ -764,6 +765,7 @@ void M_SetConfigDir(void) #ifdef _WIN32 //! // @platform windows + // @vanilla // // Save configuration data and savegames in c:\doomdata, // allowing play from CD. diff --git a/src/s_sound.c b/src/s_sound.c index 57066ad4..cc071bde 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -241,18 +241,43 @@ static void InitMusicModule(void) void S_Init(int sfxVolume, int musicVolume) { + boolean nosound, nosfx, nomusic; int i; + //! + // @vanilla + // + // Disable all sound output. + // + + nosound = M_CheckParm("-nosound") > 0; + + //! + // @vanilla + // + // Disable sound effects. + // + + nosfx = M_CheckParm("-nosfx") > 0; + + //! + // @vanilla + // + // Disable music. + // + + nomusic = M_CheckParm("-nomusic") > 0; + // Initialise the sound and music subsystems. - if (M_CheckParm("-nosound") <= 0 && !screensaver_mode) + if (!nosound && !screensaver_mode) { - if (M_CheckParm("-nosfx") <= 0) + if (!nosfx) { InitSfxModule(); } - if (M_CheckParm("-nomusic") <= 0) + if (!nomusic) { InitMusicModule(); } |