Commit a5dee248 authored by Fabian Greffrath's avatar Fabian Greffrath

New upstream version 5.5.2+git114

parent c322164d
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
cmake_minimum_required(VERSION 3.7.2)
project("Crispy Doom" VERSION 5.5.0 LANGUAGES C)
project("Crispy Doom" VERSION 5.5.2 LANGUAGES C)
# Autotools variables
set(top_srcdir ${CMAKE_CURRENT_SOURCE_DIR})
......
......@@ -57,24 +57,24 @@ Many additional less user-visible features have been implemented, e.g. fixed eng
### New controls (with default bindings)
* Move Forward (alt.) "W"
* Move Backward (alt.) "S"
* Strafe Left (alt.) "A"
* Strafe Right (alt.) "D"
* Jump (bindable to joystick and mouse buttons as well) "/" (as in Hexen and Strife)
* Move Forward (alt.) <kbd>W</kbd>
* Move Backward (alt.) <kbd>S</kbd>
* Strafe Left (alt.) <kbd>A</kbd>
* Strafe Right (alt.) <kbd>D</kbd>
* Jump (bindable to joystick and mouse buttons as well) <kbd>/</kbd> (as in Hexen and Strife)
* Quick Reverse (bindable to mouse buttons as well)
* Mouse Look (bindable to mouse buttons or permanent)
* Look up (bindable to joystick axes as well) "PgDn" (as in Heretic)
* Look down (bindable to joystick axes as well) "DELETE" (as in Heretic)
* Center view "END" (as in Heretic)
* Toggle always run "CAPSLOCK"
* Look up (bindable to joystick axes as well) <kbd>PgDn</kbd> (as in Heretic)
* Look down (bindable to joystick axes as well) <kbd>Del</kbd> (as in Heretic)
* Center view <kbd>End</kbd> (as in Heretic)
* Toggle always run <kbd>&#8682;</kbd>
* Toggle vertical mouse movement (new in 5.4)
* Delete savegame "DELETE"
* Delete savegame <kbd>Del</kbd>
* Go to next level
* Reload current level
* Save a clean screenshot
* Toggle Automap overlay mode "O"
* Toggle Automap rotate mode "R"
* Toggle Automap overlay mode <kbd>O</kbd>
* Toggle Automap rotate mode <kbd>R</kbd>
* Resurrect from savegame (single player mode only) "Run" + "Use"
### New command line parameters
......@@ -104,11 +104,12 @@ Many additional less user-visible features have been implemented, e.g. fixed eng
* `IDCLEV00` restarts the current level (since 2.0).
* `IDMUS00` restarts the current music (new in 5.1).
* `VERSION` shows the engine version, build date and SDL version (new in 5.1).
* `SKILL` shows the current skill level (new in 5.5.2).
## Download
Binaries for Windows XP / Vista / 7 / 8.1 / 10 (both x86 and x64 editions) are available here:
https://github.com/fabiangreffrath/crispy-doom/releases/download/crispy-doom-5.5.1/crispy-doom-5.5.1-win32.zip
https://github.com/fabiangreffrath/crispy-doom/releases/download/crispy-doom-5.5.2/crispy-doom-5.5.2-win32.zip
Daily builds of Crispy Doom can be found here:
http://latest.chocolate-doom.org/
......@@ -146,6 +147,73 @@ After successful compilation the resulting binaries can be found in the `src/` d
## News
### Crispy Doom 5.6
Crispy Doom 5.6 has been released on July XX, 2019. This release features support for the new Ultimate Doom Episode 5: Sigil by John Romero (with its MP3 soundtrack by Buckethead) and Doom Metal Vol.5 metal soundtrack mod for all IWADs, also addressing more community feedback.
**Features**
* Support for alternative music tracks for Final Doom has been implemented as introduced in DoomMetalVol5.wad, music replacement tables provided by Zodomaniac.
* SIGIL.wad and SIGIL_SHREDS.wad are auto-loaded with Ultimate Doom IWAD when available, suggested by buvk. The Sigil art screen is only used when finishing episode 5. If you want to replace DMENUPIC and other art by Sigil's, load it manually.
**Improvements**
* Crispy's own WAD autoload mechanism has been replaced by Choco's one, autoloading files from `doom-all` subdirectory of config directory.
* Item position in Crispness menu is now remembered as well as in the rest of Doom menu, fixing the non-Doominess spotted by JNechaevsky.
* Drag-and-drop of .bex files is now allowed.
* Auto-naming savegames now excludes the .wad extension from the file name but writes the IWAD name on Windows for savegames in IWAD maps, where all saves from different IWADs are stored in one folder (inherited from Choco).
* Played music is now logged.
* Sound channels have no meaning and are therefore disabled with the PC speaker sound device
* Ambiguity in music backend name `Native MIDI` pointed out by pmjdebruijn has been eliminated, now it reads `MIDI/MP3/OGG/FLAC`.
* Automap colors for different things (visible with IDDT) have been figured out by Zodomaniac: orange for projectiles, including Lost Souls, and dark gold for shootable things like barrels.
* A warning for linedefs without tags is emitted.
* Extra Arch-Vile fire spawn sound is only played if available, which makes Capellan's SpecBoss.wad work with Doom 1 as IWAD.
* Optional secret counting in the "secret revealed" message has been introduced, suggested by Ledmeister.
* Green brightmap is applied to barrels according to JNechaevsky's idea.
* Colors for HUD digits have been improved on artistic advice by JNechaevsky.
* Zooming and moving Automap with the mouse wheel has been implemented, thanks to JNechaevsky for the suggestion and testing.
* Tally screen is displayed after ExM8, requested by Sector 147 and tested by JNechaevsky.
* Weapon pickup message is printed when using the `TNTWEAPx` cheat, requested by Zodomaniac.
**Bug Fixes**
* Support for SMMU swirling flats has been repaired.
* Playing with 32 sound channels is now actually enabled, thanks to seed and SiFi270 for pointing this out and providing examples.
* More crashes with maps without map title graphics lump are prevented.
* Level transitions back from MAP33 when playing Doom 2 extensions (e.g. NERVE) have been fixed, thanks to buvk for reporting.
* If still in doubt about the correct background to use for the intermission screen, INTERPIC is used on the intermission screen, preventing a crash.
* Playing up to three sounds from lines with more than one switch texture has been fixed, squashing the button spamming sound bug reported by Looper in the forums.
* A crash when a door that is actually a platform is closed manually has been fixed, spotted by glyphic from the forums.
* Off-by-one typo in the par time drawing decision has been fixed.
* SSG reloading sounds being breakable have been fixed, reported by JNechaevsky.
* If the lump name is unambiguous, the one found is used, as Brad Harding pointed out. This fixes WOS.wad.
* Flat lumps are prevented from being mistaken as patches, at least when composing textures, fixes a crash when loading any map with Sunder.wad (and who knows where else) spotted by JNechaevsky.
* Ammo type is reset in `P_CheckAmmo()` when weapon is removed (by `TNTWEAPx` cheat) after Zodomaniac's report, so that even the chainsaw which consumes no ammo is removed properly.
Crispy Doom 5.6 is based on Chocolate Doom 3.0.0 and has merged all changes to the Chocolate Doom master branch up to commit [`f1d557ff`](https://github.com/chocolate-doom/chocolate-doom/commit/f1d557ff6344e84595a5eb0b2ac2639224286d5b).
### Crispy Doom 5.5.2
Crispy Doom 5.5.2 has been released on April 1st, 2019. This is another hotfix release bringing the feature of taking over a demo any moment and some subtle improvements as well.
**Features**
* Hitting the 'quit recording demo' button when playing back a demo will 'take it over', i.e. hand the controls over to the player and record the forked timeline into a different file. Multiplayer demos are prevented from being taken over.
**Improvements**
* Crispy color scheme is now applied to the network GUI as Zodomaniac insisted.
* 100000 demos of the same name can now be recorded without overriding files, thanks to Looper for the suggestion.
* New `SKILL` cheat suggested by Zodomaniac has been introduced displaying current skill level: Baby, Easy, Normal, Hard or Nightmare.
* `IDCLEV` cheat now supports level number `IDCLEV1A` to warp to E1M10: Sewers even if No End In Sight `neis.wad` with its ExM0 levels is loaded with XBox Doom IWAD. This obscure case was pointed out by Zodomaniac. `IDCLEV10` still warps to E1M10: Sewers (along with `IDCLEV1A`) if XBox Doom IWAD is used without E1M0 map in PWADs.
**Bug Fixes**
* Desyncing of demos continued by using `-playdemo` and `-record` in case of demos recorded with `-fast`, `-respawn` or `-nomonsters` has been fixed, spotted by Zodomaniac.
* Game is now un-paused after loading a game while recording a demo, on Looper's report.
Crispy Doom 5.5.2 is based on Chocolate Doom 3.0.0 and has merged all changes to the Chocolate Doom master branch up to commit [`fd171dda`](https://github.com/chocolate-doom/chocolate-doom/commit/fd171dda546f38a9b7a6158ed2c3c8044e4ce72d).
### Crispy Doom 5.5.1
Crispy Doom 5.5.1 has been released on March 7, 2019. This is a hotfix release to fix a minor bug introduced in the previous version.
......
AC_INIT(Crispy Doom, 5.5.0,
AC_INIT(Crispy Doom, 5.5.2,
fabian@greffrath.com, crispy-doom)
PACKAGE_SHORTNAME=${PACKAGE_NAME% Doom}
......@@ -89,6 +89,13 @@ AS_IF([test "x$with_libpng" != xno], [
])
])
# [crispy] true-color rendering as a compile-time option
AC_ARG_ENABLE([truecolor],
AS_HELP_STRING([--enable-truecolor],
[true-color rendering (experimental) @<:@default=no@:>@]),
AC_DEFINE([CRISPY_TRUECOLOR], [1], [true-color rendering])
)
# TODO: We currently link everything against libraries that don't need it.
# Use the specific library CFLAGS/LIBS variables instead of setting them here.
CFLAGS="$CFLAGS $SDL_CFLAGS ${SAMPLERATE_CFLAGS:-} ${PNG_CFLAGS:-} ${LIBZ_CFLAGS:-}"
......
......@@ -83,18 +83,49 @@ If you have a commercial version on a CD-ROM, obtaining the IWAD
file is usually straightforward. Simply locate the IWAD file on the
disc and copy it off.
#if !STRIFE
#if !__MACOSX__
#if DOOM
The Doom games are available to purchase for download on Steam
(https://store.steampowered.com/), all releases containing the classic
games including Doom 3: BFG Edition are supported.
#endif
#if HERETIC
Heretic is available to purchase for download on Steam
(https://store.steampowered.com/).
#endif
#if HEXEN
Hexen and its expansion pack are available to purchase for download on
Steam (https://store.steampowered.com/).
#endif
#if STRIFE
Strife: Veteran Edition is available to purchase for download on Steam
(https://store.steampowered.com/).
#endif
#if !_WIN32
For Steam on Linux, you need to enable “Steam Play” for all titles in
order to install the games. You may do this from the Steam menu,
Setup, and the Steam Play tab.
#endif
LONG_GAME_NAME will autodetect IWADs installed by Steam and you do not
need to do anything.
#else
The Doom, Heretic, Hexen, and Strife games are available to purchase
for download on Steam (https://store.steampowered.com/), but are only
available for Windows. To find the IWAD files on a Windows or Wine
system, look in the Steam directory (usually within “Program Files”),
under the “steamapps/common” path.
#endif
#if DOOM || STRIFE
The Doom and Strife: Veteran Edition games are available for purchase
on GOG.com (https://www.gog.com/).
#if _WIN32
The Doom games, along with Heretic and Hexen, are also available to
purchase for download on Steam (http://www.steampowered.com/).
LONG_GAME_NAME will autodetect IWADs installed by Steam and you do
not need to do anything.
LONG_GAME_NAME will autodetect IWADs from the standalone or GOG Galaxy
installers and you do not need to do anything.
#else
The Doom games, along with Heretic and Hexen, are available to buy
for download on Steam (http://www.steampowered.com/), but are only
available for Windows. To find the IWAD files on a Windows system,
look in the Steam directory (usually within “Program Files”), under
the “steamapps/common” path.
The games are only available for Windows, but you may find the IWAD
files on a Windows or Wine system, typically within the “C:\GOG Games”
or “C:\Program Files\GOG Galaxy” directories.
#endif
#endif
......
......@@ -70,6 +70,10 @@
{
}
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)_ {
return YES;
}
- (BOOL) application:(NSApplication *) application
openFile:(NSString *) fileName
{
......
......@@ -36,8 +36,11 @@ m_misc.c m_misc.h
DEDSERV_FILES=\
d_dedicated.c \
d_iwad.c d_iwad.h \
d_mode.c d_mode.h \
deh_str.c deh_str.h \
i_timer.c i_timer.h \
m_config.c m_config.h \
net_common.c net_common.h \
net_dedicated.c net_dedicated.h \
net_io.c net_io.h \
......
......@@ -69,6 +69,9 @@ typedef struct
int soundfull;
int soundmono;
int translucency;
#if CRISPY_TRUECOLOR
int truecolor;
#endif
int uncapped;
int vsync;
int weaponsquat;
......@@ -83,6 +86,7 @@ typedef struct
boolean flashinghom;
boolean fliplevels;
boolean flipweapons;
boolean haved1e5;
boolean havee1m10;
boolean havemap33;
boolean havessg;
......@@ -195,6 +199,14 @@ enum
NUM_TRANSLUCENCY
};
enum
{
SECRETMESSAGE_OFF,
SECRETMESSAGE_ON,
SECRETMESSAGE_COUNT,
NUM_SECRETMESSAGE
};
enum
{
WIDGETS_OFF,
......
......@@ -50,6 +50,21 @@ static const iwad_t iwads[] =
{ "strife1.wad", strife, commercial, "Strife" },
};
boolean D_IsIWADName(const char *name)
{
int i;
for (i = 0; i < arrlen(iwads); i++)
{
if (!strcasecmp(name, iwads[i].name))
{
return true;
}
}
return false;
}
// Array of locations to search for IWAD files
//
// "128 IWAD search directories should be enough for anybody".
......
......@@ -39,6 +39,7 @@ typedef struct
const char *description;
} iwad_t;
boolean D_IsIWADName(const char *name);
char *D_FindWADByName(const char *filename);
char *D_TryFindWADByName(const char *filename);
char *D_FindIWAD(int mask, GameMission_t *mission);
......
......@@ -96,6 +96,13 @@ const char *DEH_String(const char *s)
}
}
// [crispy] returns true if a string has been substituted
boolean DEH_HasStringReplacement(const char *s)
{
return DEH_String(s) != s;
}
static void InitHashTable(void)
{
// init hash table
......
......@@ -29,6 +29,7 @@ void DEH_printf(const char *fmt, ...) PRINTF_ATTR(1, 2);
void DEH_fprintf(FILE *fstream, const char *fmt, ...) PRINTF_ATTR(2, 3);
void DEH_snprintf(char *buffer, size_t len, const char *fmt, ...) PRINTF_ATTR(3, 4);
void DEH_AddStringReplacement(const char *from_text, const char *to_text);
boolean DEH_HasStringReplacement(const char *s);
#if 0
......
......@@ -69,6 +69,7 @@ add_library(doom STATIC
r_segs.c r_segs.h
r_sky.c r_sky.h
r_state.h
r_swirl.c r_swirl.h
r_things.c r_things.h
s_musinfo.c s_musinfo.h
s_sound.c s_sound.h
......
......@@ -75,6 +75,7 @@ r_plane.c r_plane.h \
r_segs.c r_segs.h \
r_sky.c r_sky.h \
r_state.h \
r_swirl.c r_swirl.h \
r_things.c r_things.h \
s_musinfo.c s_musinfo.h \
s_sound.c s_sound.h \
......
......@@ -46,6 +46,7 @@
#include "dstrings.h"
#include "am_map.h"
extern boolean inhelpscreens; // [crispy]
// For use if I do walls with outsides/insides
......@@ -101,6 +102,9 @@
// how much zoom-out per tic
// pulls out to 0.5x in 1 second
#define M_ZOOMOUT ((int) (FRACUNIT/1.02))
// [crispy] zoom faster with the mouse wheel
#define M2_ZOOMIN ((int) (1.08*FRACUNIT))
#define M2_ZOOMOUT ((int) (FRACUNIT/1.08))
// translates between frame-buffer and map distances
// [crispy] fix int overflow that causes map and grid lines to disappear
......@@ -460,6 +464,13 @@ void AM_changeWindowLoc(void)
m_x2 = m_x + m_w;
m_y2 = m_y + m_h;
// [crispy] reset after moving with the mouse
if (f_oldloc.y == INT_MAX)
{
m_paninc.x = 0;
m_paninc.y = 0;
}
}
......@@ -694,6 +705,32 @@ AM_Responder
rc = true;
}
}
// [crispy] zoom and move Automap with the mouse (wheel)
else if (ev->type == ev_mouse && !crispy->automapoverlay && !menuactive && !inhelpscreens)
{
if (mousebprevweapon >= 0 && ev->data1 & (1 << mousebprevweapon))
{
mtof_zoommul = M2_ZOOMOUT;
ftom_zoommul = M2_ZOOMIN;
rc = true;
}
else
if (mousebnextweapon >= 0 && ev->data1 & (1 << mousebnextweapon))
{
mtof_zoommul = M2_ZOOMIN;
ftom_zoommul = M2_ZOOMOUT;
rc = true;
}
else
if (!followplayer && (ev->data2 || ev->data3))
{
// [crispy] mouse sensitivity for strafe
m_paninc.x = FTOM(ev->data2*(mouseSensitivity_x2+5)/80);
m_paninc.y = FTOM(ev->data3*(mouseSensitivity_x2+5)/80);
f_oldloc.y = INT_MAX;
rc = true;
}
}
else if (ev->type == ev_keydown)
{
rc = true;
......@@ -779,7 +816,6 @@ AM_Responder
else if (key == key_map_overlay)
{
// [crispy] force redraw status bar
extern boolean inhelpscreens;
inhelpscreens = true;
crispy->automapoverlay = !crispy->automapoverlay;
......@@ -851,6 +887,13 @@ void AM_changeWindowScale(void)
scale_mtof = FixedMul(scale_mtof, mtof_zoommul);
scale_ftom = FixedDiv(FRACUNIT, scale_mtof);
// [crispy] reset after zooming with the mouse wheel
if (ftom_zoommul == M2_ZOOMIN || ftom_zoommul == M2_ZOOMOUT)
{
mtof_zoommul = FRACUNIT;
ftom_zoommul = FRACUNIT;
}
if (scale_mtof < min_scale_mtof)
AM_minOutWindowScale();
else if (scale_mtof > max_scale_mtof)
......@@ -1122,7 +1165,11 @@ AM_drawFline
return;
}
#ifndef CRISPY_TRUECOLOR
#define PUTDOT(xx,yy,cc) fb[(yy)*f_w+(xx)]=(cc)
#else
#define PUTDOT(xx,yy,cc) fb[(yy)*f_w+(xx)]=(colormaps[(cc)])
#endif
dx = fl->b.x - fl->a.x;
ax = 2 * (dx<0 ? -dx : dx);
......@@ -1647,6 +1694,10 @@ AM_drawThings
t->radius, t->angle,
// [crispy] show countable kills in red ...
((t->flags & (MF_COUNTKILL | MF_CORPSE)) == MF_COUNTKILL) ? REDS :
// [crispy] ... show Lost Souls and missiles in orange ...
(t->flags & (MF_FLOAT | MF_MISSILE)) ? 216 :
// [crispy] ... show other shootable items in dark gold ...
(t->flags & MF_SHOOTABLE) ? 164 :
// [crispy] ... corpses in gray ...
(t->flags & MF_CORPSE) ? GRAYS :
// [crispy] ... and countable items in yellow
......@@ -1716,7 +1767,11 @@ void AM_drawCrosshair(int color)
// [crispy] do not draw the useless dot on the player arrow
/*
else
#ifndef CRISPY_TRUECOLOR
fb[(f_w*(f_h+1))/2] = color; // single point for now
#else
fb[(f_w*(f_h+1))/2] = colormaps[color]; // single point for now
#endif
*/
}
......
......@@ -184,6 +184,16 @@
#define HUSTR_E4M8 "E4M8: Unto The Cruel"
#define HUSTR_E4M9 "E4M9: Fear"
#define HUSTR_E5M1 "E5M1: Baphomet's Demesne"
#define HUSTR_E5M2 "E5M2: Sheol"
#define HUSTR_E5M3 "E5M3: Cages of the Damned"
#define HUSTR_E5M4 "E5M4: Paths of Wretchedness"
#define HUSTR_E5M5 "E5M5: Abaddon's Void"
#define HUSTR_E5M6 "E5M6: Unspeakable Persecution"
#define HUSTR_E5M7 "E5M7: Nightmare Underworld"
#define HUSTR_E5M8 "E5M8: Halls of Perdition"
#define HUSTR_E5M9 "E5M9: Realm of Iblis"
#define HUSTR_1 "level 1: entryway"
#define HUSTR_2 "level 2: underhalls"
#define HUSTR_3 "level 3: the gantlet"
......@@ -475,6 +485,18 @@
"\n"\
"next stop, hell on earth!"
#define E5TEXT \
"Baphomet was only doing Satan's bidding\n"\
"by bringing you back to Hell. Somehow they\n"\
"didn't understand that you're the reason\n"\
"they failed in the first place.\n"\
"\n"\
"After mopping up the place with your\n"\
"arsenal, you're ready to face the more\n"\
"advanced demons that were sent to Earth.\n"\
"\n"\
"\n"\
"Lock and load. Rip and tear."
// after level 6, put this:
......
......@@ -263,7 +263,11 @@ boolean D_Display (void)
// clean up border stuff
if (gamestate != oldgamestate && gamestate != GS_LEVEL)
#ifndef CRISPY_TRUECOLOR
I_SetPalette (W_CacheLumpName (DEH_String("PLAYPAL"),PU_CACHE));
#else
I_SetPalette (0);
#endif
// see if the border needs to be initially drawn
if (gamestate == GS_LEVEL && oldgamestate != GS_LEVEL)
......@@ -448,6 +452,9 @@ void D_BindVariables(void)
M_BindIntVariable("crispy_soundfull", &crispy->soundfull);
M_BindIntVariable("crispy_soundmono", &crispy->soundmono);
M_BindIntVariable("crispy_translucency", &crispy->translucency);
#ifdef CRISPY_TRUECOLOR
M_BindIntVariable("crispy_truecolor", &crispy->truecolor);
#endif
M_BindIntVariable("crispy_uncapped", &crispy->uncapped);
M_BindIntVariable("crispy_vsync", &crispy->vsync);
M_BindIntVariable("crispy_weaponsquat", &crispy->weaponsquat);
......@@ -1314,6 +1321,110 @@ static void LoadIwadDeh(void)
}
}
// [crispy] support loading SIGIL.WAD (and SIGIL_SHREDS.WAD) alongside DOOM.WAD
static void LoadSigilWad(void)
{
int i;
struct {
const char *name;
const char new_name[8];
} sigil_lumps [] = {
{"CREDIT", "SIGCREDI"},
{"HELP1", "SIGHELP1"},
{"TITLEPIC", "SIGTITLE"},
{"DEMO1", "SIGDEMO1"},
{"DEMO2", "SIGDEMO2"},
{"DEMO3", "SIGDEMO3"},
{"DEMO4", "SIGDEMO4"},
{"D_INTER", "D_SIGINT"},
{"D_INTRO", "D_SIGTIT"},
};
// [crispy] don't load SIGIL.wad if another PWAD already provides E5M1
i = W_CheckNumForName("E5M1");
if (i != -1)
{
return;
}
// [crispy] don't load SIGIL.wad if SIGIL_COMPAT.wad is already loaded
i = W_CheckNumForName("E3M1");
if (i != -1 && !strcasecmp(W_WadNameForLump(lumpinfo[i]), "SIGIL_COMPAT.wad"))
{
return;
}
if (gameversion == exe_ultimate)
{
char *sigil_wad = NULL, *sigil_shreds = NULL;
char *dirname;
dirname = M_DirName(iwadfile);
sigil_wad = M_StringJoin(dirname, DIR_SEPARATOR_S, "SIGIL.wad", NULL);
sigil_shreds = M_StringJoin(dirname, DIR_SEPARATOR_S, "SIGIL_SHREDS.wad", NULL);
free(dirname);
// [crispy] load SIGIL.WAD
if (!M_FileExists(sigil_wad))
{
free(sigil_wad);
sigil_wad = D_FindWADByName("SIGIL.wad");
}
if (sigil_wad == NULL)
{
free(sigil_shreds);
return;
}
D_AddFile(sigil_wad);
free(sigil_wad);
// [crispy] load SIGIL_SHREDS.WAD
if (!M_FileExists(sigil_shreds))
{
free(sigil_shreds);
sigil_shreds = D_FindWADByName("SIGIL_SHREDS.wad");
}
if (sigil_shreds != NULL)
{
D_AddFile(sigil_shreds);
free(sigil_shreds);
}
// [crispy] rename intrusive SIGIL_SHREDS.wad music lumps out of the way
for (i = 7; i < arrlen(sigil_lumps); i++)
{
int j;
j = W_CheckNumForName(sigil_lumps[i].name);
if (j != -1 && !strcasecmp(W_WadNameForLump(lumpinfo[j]), "SIGIL_SHREDS.wad"))
{
memcpy(lumpinfo[j]->name, sigil_lumps[i].new_name, 8);
}
}
// [crispy] rename intrusive SIGIL.wad graphics, demos and music lumps out of the way
for (i = 0; i < arrlen(sigil_lumps); i++)
{
int j;
j = W_CheckNumForName(sigil_lumps[i].name);
if (j != -1 && !strcasecmp(W_WadNameForLump(lumpinfo[j]), "SIGIL.wad"))
{
memcpy(lumpinfo[j]->name, sigil_lumps[i].new_name, 8);
}
}
// [crispy] regenerate the hashtable
W_GenerateHashTable();
}
}
// [crispy] support loading NERVE.WAD alongside DOOM2.WAD
static void LoadNerveWad(void)
{
......@@ -1375,6 +1486,9 @@ static void LoadNerveWad(void)
M_snprintf (lumpname, 9, "CWILV%2.2d", i);
lumpinfo[W_GetNumForName(lumpname)]->name[0] = 'N';
}
// [crispy] regenerate the hashtable
W_GenerateHashTable();
}
}
......@@ -1719,6 +1833,16 @@ void D_DoomMain (void)
if (!M_ParmExists("-noautoload") && gamemode != shareware)
{
char *autoload_dir;
// common auto-loaded files for all Doom flavors
autoload_dir = M_GetAutoloadDir("doom-all");
DEH_AutoLoadPatches(autoload_dir);
W_AutoLoadWADs(autoload_dir);
free(autoload_dir);
// auto-loaded files per IWAD
autoload_dir = M_GetAutoloadDir(D_SaveGameIWADName(gamemission));
DEH_AutoLoadPatches(autoload_dir);
W_AutoLoadWADs(autoload_dir);
......@@ -1729,63 +1853,12 @@ void D_DoomMain (void)
// Note that there's a very careful and deliberate ordering to how
// Dehacked patches are loaded. The order we use is:
// 1. IWAD dehacked patches.
// [crispy] 1.a. dehacked patches in the config directory following
// the preload?.deh/.bex naming scheme are preloaded at game startup
if (!M_ParmExists("-nodeh") && !M_ParmExists("-noload"))
{
int i;
for (i = 0; i < 10; i++)
{
char *path;
M_snprintf(file, sizeof(file), "preload%d.deh", i);
path = M_StringJoin(configdir, file, NULL);
if (M_FileExists(path))
DEH_LoadFile(path);
else
{
free(path);
M_snprintf(file, sizeof(file), "preload%d.bex", i);
path = M_StringJoin(configdir, file, NULL);
if (M_FileExists(path))
DEH_LoadFile(path);
}
free(path);
}
}
// 2. Command line dehacked patches specified with -deh.
// 3. PWAD dehacked patches in DEHACKED lumps.
DEH_ParseCommandLine();
// [crispy] PWAD files in the config directory following
// the preload?.wad naming scheme are preloaded at game startup
if (!M_ParmExists("-noload") && gamemode != shareware)
{
int i;
extern void W_MergeFile(char *filename);
for (i = 0; i < 10; i++)
{
char *path;
M_snprintf(file, sizeof(file), "preload%d.wad", i);
path = M_StringJoin(configdir, file, NULL);
if (M_FileExists(path))
{
modifiedgame = true;
printf(" auto-merging %s !\n", path);
W_MergeFile(path);
}
free(path);
}
}
// Load PWAD files.
modifiedgame |= W_ParseCommandLine(); // [crispy] OR'ed
modifiedgame = W_ParseCommandLine();
//!
// @arg <file>
......@@ -1895,6 +1968,7 @@ void D_DoomMain (void)
{
LoadMasterlevelsWad();
LoadNerveWad();
LoadSigilWad();
}
// Load DEHACKED lumps from WAD files - but only if we give the right
......@@ -2001,6 +2075,12 @@ void D_DoomMain (void)
)
);
// [crispy] check for presence of a 5th episode
crispy->haved1e5 = (gameversion == exe_ultimate) &&
(W_CheckNumForName("m_epi5") != -1) &&
(W_CheckNumForName("e5m1") != -1) &&
(W_CheckNumForName("wilv40") != -1);