From d73a64228a6502ce68e1c9fd1cc5197863a50c7e Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 16 Mar 2014 02:23:14 -0400 Subject: doom: Add -dehlump parameter to load DEHACKED lumps. Lots of otherwise Vanilla-compatible WADs contain DEHACKED lumps. Allow these to be loaded by adding a -dehlump command line parameter. Thanks to Fabian Greffrath for the suggestion (fixes #349). --- src/doom/d_main.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'src/doom/d_main.c') diff --git a/src/doom/d_main.c b/src/doom/d_main.c index 3badb4ad..4068f677 100644 --- a/src/doom/d_main.c +++ b/src/doom/d_main.c @@ -1050,7 +1050,7 @@ static void LoadHacxDeh(void) if (gameversion == exe_hacx) { - if (!DEH_LoadLumpByName("DEHACKED")) + if (!DEH_LoadLumpByName("DEHACKED", true)) { I_Error("DEHACKED lump not found. Please check that this is the " "Hacx v1.2 IWAD."); @@ -1425,6 +1425,31 @@ void D_DoomMain (void) I_PrintDivider(); } + // Load DEHACKED lumps from WAD files - but only if we give the right + // command line parameter. + + //! + // @category mod + // + // Load Dehacked patches from DEHACKED lumps contained in one of the + // loaded PWAD files. + // + if (M_ParmExists("-dehlump")) + { + int i, loaded = 0; + + for (i = 0; i < numlumps; ++i) + { + if (!strncmp(lumpinfo[i].name, "DEHACKED", 8)) + { + DEH_LoadLump(i, false); + loaded++; + } + } + + printf("Loaded %i DEHACKED lumps from WAD files.\n", loaded); + } + DEH_printf("I_Init: Setting up machine state.\n"); I_CheckIsScreensaver(); I_InitTimer(); -- cgit v1.2.3