added rudimentary support for DSDA's COMPLVL lumo.

This cannot of course set real complevels, so what it does is set all appropriate compatibility flags from the respective preset.
It does leave out a few flags that are preferably left to the user, like infinitely tall actors or wall running.
This commit is contained in:
Christoph Oelckers 2023-11-04 12:35:58 +01:00
parent 06af5f2164
commit fb6e4becaa
3 changed files with 57 additions and 3 deletions

View file

@ -1920,7 +1920,7 @@ void GetReserved(LumpFilterInfo& lfi)
{ {
lfi.reservedFolders = { "flats/", "textures/", "hires/", "sprites/", "voxels/", "colormaps/", "acs/", "maps/", "voices/", "patches/", "graphics/", "sounds/", "music/", lfi.reservedFolders = { "flats/", "textures/", "hires/", "sprites/", "voxels/", "colormaps/", "acs/", "maps/", "voices/", "patches/", "graphics/", "sounds/", "music/",
"materials/", "models/", "fonts/", "brightmaps/" }; "materials/", "models/", "fonts/", "brightmaps/" };
lfi.requiredPrefixes = { "mapinfo", "zmapinfo", "umapinfo", "gameinfo", "sndinfo", "sndseq", "sbarinfo", "menudef", "gldefs", "animdefs", "decorate", "zscript", "iwadinfo", "maps/" }; lfi.requiredPrefixes = { "mapinfo", "zmapinfo", "umapinfo", "gameinfo", "sndinfo", "sndseq", "sbarinfo", "menudef", "gldefs", "animdefs", "decorate", "zscript", "iwadinfo", "complvl", "terrain", "maps/" };
} }
static FString CheckGameInfo(std::vector<std::string> & pwads) static FString CheckGameInfo(std::vector<std::string> & pwads)

View file

@ -213,7 +213,7 @@ enum : unsigned int
COMPATF_VILEGHOSTS = 1 << 25, // Crushed monsters are resurrected as ghosts. COMPATF_VILEGHOSTS = 1 << 25, // Crushed monsters are resurrected as ghosts.
COMPATF_NOBLOCKFRIENDS = 1 << 26, // Friendly monsters aren't blocked by monster-blocking lines. COMPATF_NOBLOCKFRIENDS = 1 << 26, // Friendly monsters aren't blocked by monster-blocking lines.
COMPATF_SPRITESORT = 1 << 27, // Invert sprite sorting order for sprites of equal distance COMPATF_SPRITESORT = 1 << 27, // Invert sprite sorting order for sprites of equal distance
COMPATF_HITSCAN = 1 << 28, // Hitscans use original blockmap anf hit check code. COMPATF_HITSCAN = 1 << 28, // Hitscans use original blockmap and hit check code.
COMPATF_LIGHT = 1 << 29, // Find neighboring light level like Doom COMPATF_LIGHT = 1 << 29, // Find neighboring light level like Doom
COMPATF_POLYOBJ = 1 << 30, // Draw polyobjects the old fashioned way COMPATF_POLYOBJ = 1 << 30, // Draw polyobjects the old fashioned way
COMPATF_MASKEDMIDTEX = 1u << 31, // Ignore compositing when drawing masked midtextures COMPATF_MASKEDMIDTEX = 1u << 31, // Ignore compositing when drawing masked midtextures

View file

@ -2587,6 +2587,56 @@ void G_ParseMapInfo (FString basemapinfo)
int lump, lastlump = 0; int lump, lastlump = 0;
level_info_t gamedefaults; level_info_t gamedefaults;
int flags1 = 0, flags2 = 0;
if (gameinfo.gametype == GAME_Doom)
{
int comp = fileSystem.CheckNumForName("COMPLVL");
if (comp >= 0)
{
auto complvl = fileSystem.ReadFile(comp);
auto data = complvl.GetString();
int length = fileSystem.FileLength(comp);
if (length == 7 && !strnicmp("vanilla", data, 7))
{
flags1 =
COMPATF_SHORTTEX | COMPATF_STAIRINDEX | COMPATF_USEBLOCKING | COMPATF_NODOORLIGHT | COMPATF_SPRITESORT |
COMPATF_TRACE | COMPATF_MISSILECLIP | COMPATF_SOUNDTARGET | COMPATF_DEHHEALTH | COMPATF_CROSSDROPOFF |
COMPATF_LIGHT | COMPATF_MASKEDMIDTEX |
COMPATF_LIMITPAIN | COMPATF_INVISIBILITY | COMPATF_VILEGHOSTS;
flags2 =
COMPATF2_FLOORMOVE | COMPATF2_EXPLODE1 | COMPATF2_NOMBF21 | COMPATF2_POINTONLINE;
}
else if (length == 4 && !strnicmp("boom", data, 4))
{
flags1 =
COMPATF_TRACE | COMPATF_SOUNDTARGET | COMPATF_BOOMSCROLL | COMPATF_MISSILECLIP | COMPATF_MASKEDMIDTEX |
COMPATF_INVISIBILITY;
flags2 =
COMPATF2_EXPLODE1 | COMPATF2_NOMBF21 | COMPATF2_POINTONLINE;
}
else if (length == 3 && !strnicmp("mbf", data, 3))
{
flags1 =
COMPATF_TRACE | COMPATF_SOUNDTARGET | COMPATF_BOOMSCROLL | COMPATF_MISSILECLIP | COMPATF_MUSHROOM |
COMPATF_MBFMONSTERMOVE | COMPATF_NOBLOCKFRIENDS | COMPATF_MASKEDMIDTEX | COMPATF_INVISIBILITY;
flags2 =
COMPATF2_EXPLODE1 | COMPATF2_AVOID_HAZARDS | COMPATF2_STAYONLIFT | COMPATF2_NOMBF21 | COMPATF2_POINTONLINE;
}
else if (length == 5 && !strnicmp("mbf21", data, 5))
{
flags1 =
COMPATF_TRACE | COMPATF_SOUNDTARGET | COMPATF_BOOMSCROLL | COMPATF_MISSILECLIP | COMPATF_MUSHROOM |
COMPATF_MASKEDMIDTEX | COMPATF_INVISIBILITY;
flags2 =
COMPATF2_EXPLODE1 | COMPATF2_AVOID_HAZARDS | COMPATF2_STAYONLIFT | COMPATF2_POINTONLINE;
}
}
}
// Parse the default MAPINFO for the current game. This lump *MUST* come from zdoom.pk3. // Parse the default MAPINFO for the current game. This lump *MUST* come from zdoom.pk3.
if (basemapinfo.IsNotEmpty()) if (basemapinfo.IsNotEmpty())
{ {
@ -2600,7 +2650,11 @@ void G_ParseMapInfo (FString basemapinfo)
} }
parse.ParseMapInfo(baselump, gamedefaults, defaultinfo); parse.ParseMapInfo(baselump, gamedefaults, defaultinfo);
} }
gamedefaults.compatflags |= flags1;
gamedefaults.compatmask |= flags1;
gamedefaults.compatflags2 |= flags2;
gamedefaults.compatmask2 |= flags2;
static const char *mapinfonames[] = { "MAPINFO", "ZMAPINFO", "UMAPINFO", NULL }; static const char *mapinfonames[] = { "MAPINFO", "ZMAPINFO", "UMAPINFO", NULL };
int nindex; int nindex;