- moved the combined compatibility flags into FLevelLocals.

This commit is contained in:
Christoph Oelckers 2019-01-29 19:28:22 +01:00
commit 6451b7d592
35 changed files with 162 additions and 97 deletions

View file

@ -279,17 +279,17 @@ FName MapLoader::CheckCompatibility(MapData *map)
if (BCompatMap.CountUsed() == 0) ParseCompatibility();
ii_compatflags = 0;
ii_compatflags2 = 0;
ib_compatflags = 0;
Level->ii_compatflags = 0;
Level->ii_compatflags2 = 0;
Level->ib_compatflags = 0;
// When playing Doom IWAD levels force COMPAT_SHORTTEX and COMPATF_LIGHT.
// I'm not sure if the IWAD maps actually need COMPATF_LIGHT but it certainly does not hurt.
// TNT's MAP31 also needs COMPATF_STAIRINDEX but that only gets activated for TNT.WAD.
if (Wads.GetLumpFile(map->lumpnum) == Wads.GetIwadNum() && (gameinfo.flags & GI_COMPATSHORTTEX) && Level->maptype == MAPTYPE_DOOM)
{
ii_compatflags = COMPATF_SHORTTEX|COMPATF_LIGHT;
if (gameinfo.flags & GI_COMPATSTAIRS) ii_compatflags |= COMPATF_STAIRINDEX;
Level->ii_compatflags = COMPATF_SHORTTEX|COMPATF_LIGHT;
if (gameinfo.flags & GI_COMPATSTAIRS) Level->ii_compatflags |= COMPATF_STAIRINDEX;
}
map->GetChecksum(md5.Bytes);
@ -319,9 +319,9 @@ FName MapLoader::CheckCompatibility(MapData *map)
if (flags != NULL)
{
ii_compatflags |= flags->CompatFlags[SLOT_COMPAT];
ii_compatflags2 |= flags->CompatFlags[SLOT_COMPAT2];
ib_compatflags |= flags->CompatFlags[SLOT_BCOMPAT];
Level->ii_compatflags |= flags->CompatFlags[SLOT_COMPAT];
Level->ii_compatflags2 |= flags->CompatFlags[SLOT_COMPAT2];
Level->ib_compatflags |= flags->CompatFlags[SLOT_BCOMPAT];
}
// Reset i_compatflags
@ -330,7 +330,7 @@ FName MapLoader::CheckCompatibility(MapData *map)
// Set floatbob compatibility for all maps with an original Hexen MAPINFO.
if (Level->flags2 & LEVEL2_HEXENHACK)
{
ib_compatflags |= BCOMPATF_FLOATBOB;
Level->ib_compatflags |= BCOMPATF_FLOATBOB;
}
return FName(hash, true); // if this returns NAME_None it means there is no scripted compatibility handler.
}
@ -574,6 +574,9 @@ CCMD (mapchecksum)
CCMD (hiddencompatflags)
{
Printf("%08x %08x %08x\n", ii_compatflags, ii_compatflags2, ib_compatflags);
for(auto Level : AllLevels())
{
Printf("%s: %08x %08x %08x\n", Level->MapName.GetChars(), Level->ii_compatflags, Level->ii_compatflags2, Level->ib_compatflags);
}
}