Merge branch 'master' of https://github.com/coelckers/gzdoom into vulkan2

# Conflicts:
#	wadsrc/static/menudef.txt
This commit is contained in:
Rachael Alexanderson 2019-03-24 09:08:55 -04:00
commit 91dfebd211
18 changed files with 279 additions and 197 deletions

View file

@ -534,28 +534,11 @@ CVAR (Flag, sv_respawnsuper, dmflags2, DF2_RESPAWN_SUPER);
EXTERN_CVAR(Int, compatmode)
static int GetCompatibility(FLevelLocals *Level, int mask)
{
if (Level->info == nullptr) return mask;
else return (mask & ~Level->info->compatmask) | (Level->info->compatflags & Level->info->compatmask);
}
static int GetCompatibility2(FLevelLocals *Level, int mask)
{
return (Level->info == nullptr) ? mask
: (mask & ~Level->info->compatmask2) | (Level->info->compatflags2 & Level->info->compatmask2);
}
CUSTOM_CVAR (Int, compatflags, 0, CVAR_ARCHIVE|CVAR_SERVERINFO | CVAR_NOINITCALL)
{
for (auto Level : AllLevels())
{
int old = Level->i_compatflags;
Level->i_compatflags = GetCompatibility(Level, self) | Level->ii_compatflags;
if ((old ^ Level->i_compatflags) & COMPATF_POLYOBJ)
{
Level->ClearAllSubsectorLinks();
}
Level->ApplyCompatibility();
}
}
@ -563,7 +546,7 @@ CUSTOM_CVAR (Int, compatflags2, 0, CVAR_ARCHIVE|CVAR_SERVERINFO | CVAR_NOINITCAL
{
for (auto Level : AllLevels())
{
Level->i_compatflags2 = GetCompatibility2(Level, self) | Level->ii_compatflags2;
Level->ApplyCompatibility2();
Level->SetCompatLineOnSide(true);
}
}
@ -580,22 +563,23 @@ CUSTOM_CVAR(Int, compatmode, 0, CVAR_ARCHIVE|CVAR_NOINITCALL)
break;
case 1: // Doom2.exe compatible with a few relaxed settings
v = COMPATF_SHORTTEX|COMPATF_STAIRINDEX|COMPATF_USEBLOCKING|COMPATF_NODOORLIGHT|COMPATF_SPRITESORT|
COMPATF_TRACE|COMPATF_MISSILECLIP|COMPATF_SOUNDTARGET|COMPATF_DEHHEALTH|COMPATF_CROSSDROPOFF|
COMPATF_LIGHT|COMPATF_MASKEDMIDTEX;
w= COMPATF2_FLOORMOVE;
v = COMPATF_SHORTTEX | COMPATF_STAIRINDEX | COMPATF_USEBLOCKING | COMPATF_NODOORLIGHT | COMPATF_SPRITESORT |
COMPATF_TRACE | COMPATF_MISSILECLIP | COMPATF_SOUNDTARGET | COMPATF_DEHHEALTH | COMPATF_CROSSDROPOFF |
COMPATF_LIGHT | COMPATF_MASKEDMIDTEX;
w = COMPATF2_FLOORMOVE | COMPATF2_EXPLODE1;
break;
case 2: // same as 1 but stricter (NO_PASSMOBJ and INVISIBILITY are also set)
v = COMPATF_SHORTTEX|COMPATF_STAIRINDEX|COMPATF_USEBLOCKING|COMPATF_NODOORLIGHT|COMPATF_SPRITESORT|
COMPATF_TRACE|COMPATF_MISSILECLIP|COMPATF_SOUNDTARGET|COMPATF_NO_PASSMOBJ|COMPATF_LIMITPAIN|
COMPATF_DEHHEALTH|COMPATF_INVISIBILITY|COMPATF_CROSSDROPOFF|COMPATF_CORPSEGIBS|COMPATF_HITSCAN|
COMPATF_WALLRUN|COMPATF_NOTOSSDROPS|COMPATF_LIGHT|COMPATF_MASKEDMIDTEX;
w = COMPATF2_BADANGLES|COMPATF2_FLOORMOVE|COMPATF2_POINTONLINE;
v = COMPATF_SHORTTEX | COMPATF_STAIRINDEX | COMPATF_USEBLOCKING | COMPATF_NODOORLIGHT | COMPATF_SPRITESORT |
COMPATF_TRACE | COMPATF_MISSILECLIP | COMPATF_SOUNDTARGET | COMPATF_NO_PASSMOBJ | COMPATF_LIMITPAIN |
COMPATF_DEHHEALTH | COMPATF_INVISIBILITY | COMPATF_CROSSDROPOFF | COMPATF_CORPSEGIBS | COMPATF_HITSCAN |
COMPATF_WALLRUN | COMPATF_NOTOSSDROPS | COMPATF_LIGHT | COMPATF_MASKEDMIDTEX;
w = COMPATF2_BADANGLES | COMPATF2_FLOORMOVE | COMPATF2_POINTONLINE | COMPATF2_EXPLODE2;
break;
case 3: // Boom compat mode
v = COMPATF_TRACE|COMPATF_SOUNDTARGET|COMPATF_BOOMSCROLL|COMPATF_MISSILECLIP|COMPATF_MASKEDMIDTEX;
w = COMPATF2_EXPLODE1;
break;
case 4: // Old ZDoom compat mode
@ -604,14 +588,15 @@ CUSTOM_CVAR(Int, compatmode, 0, CVAR_ARCHIVE|CVAR_NOINITCALL)
break;
case 5: // MBF compat mode
v = COMPATF_TRACE|COMPATF_SOUNDTARGET|COMPATF_BOOMSCROLL|COMPATF_MISSILECLIP|COMPATF_MUSHROOM|
COMPATF_MBFMONSTERMOVE|COMPATF_NOBLOCKFRIENDS|COMPATF_MASKEDMIDTEX;
v = COMPATF_TRACE | COMPATF_SOUNDTARGET | COMPATF_BOOMSCROLL | COMPATF_MISSILECLIP | COMPATF_MUSHROOM |
COMPATF_MBFMONSTERMOVE | COMPATF_NOBLOCKFRIENDS | COMPATF_MASKEDMIDTEX;
w = COMPATF2_EXPLODE1;
break;
case 6: // Boom with some added settings to reenable some 'broken' behavior
v = COMPATF_TRACE|COMPATF_SOUNDTARGET|COMPATF_BOOMSCROLL|COMPATF_MISSILECLIP|COMPATF_NO_PASSMOBJ|
COMPATF_INVISIBILITY|COMPATF_CORPSEGIBS|COMPATF_HITSCAN|COMPATF_WALLRUN|COMPATF_NOTOSSDROPS|COMPATF_MASKEDMIDTEX;
w = COMPATF2_POINTONLINE;
v = COMPATF_TRACE | COMPATF_SOUNDTARGET | COMPATF_BOOMSCROLL | COMPATF_MISSILECLIP | COMPATF_NO_PASSMOBJ |
COMPATF_INVISIBILITY | COMPATF_CORPSEGIBS | COMPATF_HITSCAN | COMPATF_WALLRUN | COMPATF_NOTOSSDROPS | COMPATF_MASKEDMIDTEX;
w = COMPATF2_POINTONLINE | COMPATF2_EXPLODE2;
break;
}
@ -659,6 +644,8 @@ CVAR (Flag, compat_multiexit, compatflags2, COMPATF2_MULTIEXIT);
CVAR (Flag, compat_teleport, compatflags2, COMPATF2_TELEPORT);
CVAR (Flag, compat_pushwindow, compatflags2, COMPATF2_PUSHWINDOW);
CVAR (Flag, compat_checkswitchrange, compatflags2, COMPATF2_CHECKSWITCHRANGE);
CVAR (Flag, compat_explode1, compatflags2, COMPATF2_EXPLODE1);
CVAR (Flag, compat_explode2, compatflags2, COMPATF2_EXPLODE2);
CVAR(Bool, vid_activeinbackground, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)

View file

@ -329,6 +329,8 @@ enum : unsigned int
COMPATF2_TELEPORT = 1 << 5, // Don't let indirect teleports trigger sector actions
COMPATF2_PUSHWINDOW = 1 << 6, // Disable the window check in CheckForPushSpecial()
COMPATF2_CHECKSWITCHRANGE = 1 << 7, // Enable buggy CheckSwitchRange behavior
COMPATF2_EXPLODE1 = 1 << 8, // No vertical explosion thrust
COMPATF2_EXPLODE2 = 1 << 9 // Use original explosion code throughout.
};
// Emulate old bugs for select maps. These are not exposed by a cvar

View file

@ -2119,8 +2119,35 @@ int FLevelLocals::GetInfighting()
void FLevelLocals::SetCompatLineOnSide(bool state)
{
int on = (state && (i_compatflags2 & COMPATF2_POINTONLINE));
if (on) for (auto l : lines) l.flags |= ML_COMPATSIDE;
else for (auto l : lines) l.flags &= ML_COMPATSIDE;
if (on) for (auto &l : lines) l.flags |= ML_COMPATSIDE;
else for (auto &l : lines) l.flags &= ~ML_COMPATSIDE;
}
int FLevelLocals::GetCompatibility(int mask)
{
if (info == nullptr) return mask;
else return (mask & ~info->compatmask) | (info->compatflags & info->compatmask);
}
int FLevelLocals::GetCompatibility2(int mask)
{
return (info == nullptr) ? mask
: (mask & ~info->compatmask2) | (info->compatflags2 & info->compatmask2);
}
void FLevelLocals::ApplyCompatibility()
{
int old = i_compatflags;
i_compatflags = GetCompatibility(compatflags) | ii_compatflags;
if ((old ^ i_compatflags) & COMPATF_POLYOBJ)
{
ClearAllSubsectorLinks();
}
}
void FLevelLocals::ApplyCompatibility2()
{
i_compatflags2 = GetCompatibility2(compatflags2) | ii_compatflags2;
}
//==========================================================================

View file

@ -141,6 +141,11 @@ struct FLevelLocals
int FindNode (const FStrifeDialogueNode *node);
int GetInfighting();
void SetCompatLineOnSide(bool state);
int GetCompatibility(int mask);
int GetCompatibility2(int mask);
void ApplyCompatibility();
void ApplyCompatibility2();
void Init();
private:

View file

@ -1642,6 +1642,8 @@ MapFlagHandlers[] =
{ "compat_teleport", MITYPE_COMPATFLAG, 0, COMPATF2_TELEPORT },
{ "compat_pushwindow", MITYPE_COMPATFLAG, 0, COMPATF2_PUSHWINDOW },
{ "compat_checkswitchrange", MITYPE_COMPATFLAG, 0, COMPATF2_CHECKSWITCHRANGE },
{ "compat_explode1", MITYPE_COMPATFLAG, 0, COMPATF2_EXPLODE1 },
{ "compat_explode2", MITYPE_COMPATFLAG, 0, COMPATF2_EXPLODE2 },
{ "cd_start_track", MITYPE_EATNEXT, 0, 0 },
{ "cd_end1_track", MITYPE_EATNEXT, 0, 0 },
{ "cd_end2_track", MITYPE_EATNEXT, 0, 0 },

View file

@ -226,7 +226,7 @@ FTexture *FTexture::GetRawTexture()
if (OffsetLess) return OffsetLess;
// Reject anything that cannot have been a single-patch multipatch texture in vanilla.
auto image = static_cast<FMultiPatchTexture *>(GetImage());
if (bMultiPatch != 1 || UseType != ETextureType::Wall || Scale.X != 1 || Scale.Y != 1 || bWorldPanning || image == nullptr || image->NumParts != 1)
if (bMultiPatch != 1 || UseType != ETextureType::Wall || Scale.X != 1 || Scale.Y != 1 || bWorldPanning || image == nullptr || image->NumParts != 1 || _TopOffset[0] == 0)
{
OffsetLess = this;
return this;
@ -234,6 +234,15 @@ FTexture *FTexture::GetRawTexture()
// Set up a new texture that directly references the underlying patch.
// From here we cannot retrieve the original texture made for it, so just create a new one.
FImageSource *source = image->Parts[0].Image;
// Size must match for this to work as intended
if (source->GetWidth() != Width || source->GetHeight() != Height)
{
OffsetLess = this;
return this;
}
OffsetLess = new FImageTexture(source, "");
TexMan.AddTexture(OffsetLess);
return OffsetLess;

View file

@ -165,6 +165,8 @@ static FCompatOption Options[] =
{ "teleport", COMPATF2_TELEPORT, SLOT_COMPAT2 },
{ "disablepushwindowcheck", COMPATF2_PUSHWINDOW, SLOT_COMPAT2 },
{ "checkswitchrange", COMPATF2_CHECKSWITCHRANGE, SLOT_COMPAT2 },
{ "explode1", COMPATF2_EXPLODE1, SLOT_COMPAT2 },
{ "explode2", COMPATF2_EXPLODE2, SLOT_COMPAT2 },
{ NULL, 0, 0 }
};
@ -326,8 +328,8 @@ FName MapLoader::CheckCompatibility(MapData *map)
}
// Reset i_compatflags
compatflags.Callback();
compatflags2.Callback();
Level->ApplyCompatibility();
Level->ApplyCompatibility2();
// Set floatbob compatibility for all maps with an original Hexen MAPINFO.
if (Level->flags2 & LEVEL2_HEXENHACK)
{

View file

@ -157,7 +157,6 @@ bool MapLoader::LoadScriptFile (const char *name, bool include, int type)
auto fn = Wads.GetLumpFile(lumpnum);
auto wadname = Wads.GetWadName(fn);
if (stricmp(wadname, "STRIFE0.WAD") && stricmp(wadname, "STRIFE1.WAD") && stricmp(wadname, "SVE.WAD")) name = nullptr; // Only localize IWAD content.
if (name && !stricmp(name, "SCRIPT00")) name = nullptr; // This only contains random string references which already use the string table.
bool res = LoadScriptFile(name, lumpnum, lump, Wads.LumpLength(lumpnum), include, type);
return res;
@ -285,7 +284,7 @@ FStrifeDialogueNode *MapLoader::ReadRetailNode (const char *name, FileReader &lu
// Convert the rest of the data to our own internal format.
if (name)
if (name && strncmp(speech.Dialogue, "RANDOM_", 7))
{
FStringf label("$TXT_DLG_%s_d%d_%s", name, int(pos), TokenFromString(speech.Dialogue).GetChars());
node->Dialogue = GStrings.exists(label.GetChars()+1)? label : FString(speech.Dialogue);
@ -381,7 +380,7 @@ FStrifeDialogueNode *MapLoader::ReadTeaserNode (const char *name, FileReader &lu
}
// Convert the rest of the data to our own internal format.
if (name)
if (name && strncmp(speech.Dialogue, "RANDOM_", 7))
{
FStringf label("$TXT_DLG_%s_d%d_%s", name, pos, TokenFromString(speech.Dialogue).GetChars());
node->Dialogue = GStrings.exists(label.GetChars() + 1)? label : FString(speech.Dialogue);
@ -407,7 +406,7 @@ FStrifeDialogueNode *MapLoader::ReadTeaserNode (const char *name, FileReader &lu
// The speaker's name, if any.
speech.Dialogue[0] = 0; //speech.Name[16] = 0;
if (name && speech.Name[0])
if ((name && speech.Name[0]))
{
FString label = speech.Name;
label.ReplaceChars(' ', '_');

View file

@ -5889,7 +5889,8 @@ int P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bom
// them far too "active." BossBrains also use the old code
// because some user levels require they have a height of 16,
// which can make them near impossible to hit with the new code.
if (((flags & RADF_NODAMAGE) || !((bombspot->flags5 | thing->flags5) & MF5_OLDRADIUSDMG)) && !(flags & RADF_OLDRADIUSDAMAGE))
if ((flags & RADF_NODAMAGE) || (!((bombspot->flags5 | thing->flags5) & MF5_OLDRADIUSDMG) &&
!(flags & RADF_OLDRADIUSDAMAGE) && !(thing->Level->i_compatflags2 & COMPATF2_EXPLODE2)))
{
double points = GetRadiusDamage(false, bombspot, thing, bombdamage, bombdistance, fulldamagedistance, bombsource == thing);
double check = int(points) * bombdamage;
@ -5939,7 +5940,10 @@ int P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bom
}
thing->Thrust(bombspot->AngleTo(thing), thrust);
if (!(flags & RADF_NODAMAGE) || (flags & RADF_THRUSTZ))
thing->Vel.Z += vz; // this really doesn't work well
{
if (!(thing->Level->i_compatflags2 & COMPATF2_EXPLODE1) || (flags & RADF_THRUSTZ))
thing->Vel.Z += vz; // this really doesn't work well
}
}
}
}