Merge branch 'master' into texture_rework

This commit is contained in:
Christoph Oelckers 2020-04-29 08:04:15 +02:00
commit 9be63a5093
14 changed files with 217 additions and 33 deletions

View file

@ -59,11 +59,11 @@ const char *KeyNames[NUM_KEYS] =
nullptr, "Escape", "1", "2", "3", "4", "5", "6", //00
"7", "8", "9", "0", "-", "=", "Backspace","Tab", //08
"Q", "W", "E", "R", "T", "Y", "U", "I", //10
"O", "P", "[", "]", "Enter", "LCtrl", "A", "S", //18
"O", "P", "[", "]", "Enter", "Ctrl", "A", "S", //18
"D", "F", "G", "H", "J", "K", "L", ";", //20
"'", "`", "LShift", "\\", "Z", "X", "C", "V", //28
"'", "`", "Shift", "\\", "Z", "X", "C", "V", //28
"B", "N", "M", ",", ".", "/", "RShift", "KP*", //30
"LAlt", "Space", "CapsLock", "F1", "F2", "F3", "F4", "F5", //38
"Alt", "Space", "CapsLock", "F1", "F2", "F3", "F4", "F5", //38
"F6", "F7", "F8", "F9", "F10", "NumLock", "Scroll", "KP7", //40
"KP8", "KP9", "KP-", "KP4", "KP5", "KP6", "KP+", "KP1", //48
"KP2", "KP3", "KP0", "KP.", nullptr, nullptr, "OEM102", "F11", //50
@ -717,13 +717,25 @@ void C_SetDefaultKeys(const char* baseconfig)
while ((lump = fileSystem.FindLumpFullName(baseconfig, &lastlump)) != -1)
{
if (fileSystem.GetFileContainer(lump) > 0) break;
ReadBindings(lump, true);
// [SW] - We need to check to see the origin of the DEFBINDS... if it
// Comes from an IWAD/IPK3/IPK7 allow it to override the users settings...
// If it comes from a user mod however, don't.
if (fileSystem.GetFileContainer(lump) > fileSystem.GetMaxIwadNum())
ReadBindings(lump, false);
else
ReadBindings(lump, true);
}
lastlump = 0;
while ((lump = fileSystem.FindLump("DEFBINDS", &lastlump)) != -1)
{
ReadBindings(lump, false);
// [SW] - We need to check to see the origin of the DEFBINDS... if it
// Comes from an IWAD/IPK3/IPK7 allow it to override the users settings...
// If it comes from a user mod however, don't.
if (fileSystem.GetFileContainer(lump) > fileSystem.GetMaxIwadNum())
ReadBindings(lump, false);
else
ReadBindings(lump, true);
}
}

View file

@ -462,6 +462,7 @@ xx(Friend)
xx(Strifeally)
xx(Standing)
xx(Countsecret)
xx(NoCount)
xx(Score)
xx(Roll)
xx(Scale)

View file

@ -87,7 +87,7 @@ struct FStateVec4
struct FMaterialState
{
FMaterial *mMaterial;
FMaterial *mMaterial = nullptr;
int mClampMode;
int mTranslation;
int mOverrideShader;

View file

@ -6362,7 +6362,7 @@ FxExpression *FxMemberIdentifier::Resolve(FCompileContext& ctx)
if (Object->ValueType->isRealPointer())
{
auto ptype = Object->ValueType->toPointer()->PointedType;
if (ptype->isContainer())
if (ptype && ptype->isContainer())
{
auto ret = ResolveMember(ctx, ctx.Class, Object, static_cast<PContainerType *>(ptype));
delete this;

View file

@ -418,6 +418,7 @@ enum EMapThingFlags
MTF_SECRET = 0x080000, // Secret pickup
MTF_NOINFIGHTING = 0x100000,
MTF_NOCOUNT = 0x200000, // Removes COUNTKILL/COUNTITEM
// BOOM and DOOM compatible versions of some of the above

View file

@ -634,8 +634,7 @@ void FLevelLocals::ChangeLevel(const char *levelname, int position, int inflags,
nextlevel = levelname;
}
if (nextSkill != -1)
NextSkill = nextSkill;
NextSkill = (unsigned)nextSkill < AllSkills.Size() ? nextSkill : -1;
if (inflags & CHANGELEVEL_NOINTERMISSION)
{

View file

@ -848,20 +848,20 @@ bool DIntermissionController::Responder (event_t *ev)
{
const char *cmd = Bindings.GetBind (ev->data1);
if (cmd != NULL &&
(!stricmp(cmd, "toggleconsole") ||
!stricmp(cmd, "screenshot")))
if (cmd != nullptr)
{
return false;
}
// The following is needed to be able to enter main menu with a controller,
// by pressing buttons that are usually assigned to this action, Start and Back by default
if (!stricmp(cmd, "menu_main") || !stricmp(cmd, "pause"))
{
M_StartControlPanel(true);
M_SetMenu(NAME_Mainmenu, -1);
return true;
if (!stricmp(cmd, "toggleconsole") || !stricmp(cmd, "screenshot"))
{
return false;
}
// The following is needed to be able to enter main menu with a controller,
// by pressing buttons that are usually assigned to this action, Start and Back by default
else if (!stricmp(cmd, "menu_main") || !stricmp(cmd, "pause"))
{
M_StartControlPanel(true);
M_SetMenu(NAME_Mainmenu, -1);
return true;
}
}
}

View file

@ -637,6 +637,11 @@ public:
Flag(th->flags, MTF_SECRET, key);
break;
case NAME_NoCount:
CHECK_N(Zd | Zdt)
Flag(th->flags, MTF_NOCOUNT, key);
break;
case NAME_Floatbobphase:
CHECK_N(Zd | Zdt)
th->FloatbobPhase = CheckInt(key);

View file

@ -4664,6 +4664,19 @@ void AActor::HandleSpawnFlags ()
Level->total_secrets++;
}
}
if (SpawnFlags & MTF_NOCOUNT)
{
if (flags & MF_COUNTKILL)
{
flags &= ~MF_COUNTKILL;
Level->total_monsters--;
}
if (flags & MF_COUNTITEM)
{
flags &= ~MF_COUNTITEM;
Level->total_items--;
}
}
}
DEFINE_ACTION_FUNCTION(AActor, HandleSpawnFlags)

View file

@ -3006,7 +3006,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_AltHUD, GetLatency, Net_GetLatency)
//
//==========================================================================
DEFINE_ACTION_FUNCTION(_Wads, GetNumEntries)
DEFINE_ACTION_FUNCTION(_Wads, GetNumLumps)
{
PARAM_PROLOGUE;
ACTION_RETURN_INT(fileSystem.GetNumEntries());

View file

@ -119,15 +119,6 @@ public:
static FString LookupMusic(const char* musicname, int& order)
{
if (strnicmp(musicname, ",CD,", 4) == 0)
{
static bool warned = false;
if (!warned)
Printf(TEXTCOLOR_RED "CD Audio no longer supported\n");
warned = true;
return "";
}
// allow specifying "*" as a placeholder to play the level's default music.
if (musicname != nullptr && !strcmp(musicname, "*"))
{
@ -147,6 +138,16 @@ static FString LookupMusic(const char* musicname, int& order)
// got nothing, return nothing.
return "";
}
if (strnicmp(musicname, ",CD,", 4) == 0)
{
static bool warned = false;
if (!warned)
Printf(TEXTCOLOR_RED "CD Audio no longer supported\n");
warned = true;
return "";
}
if (*musicname == '/') musicname++;
FString DEH_Music;

View file

@ -879,7 +879,7 @@ struct Wads
native static int FindLump(string name, int startlump = 0, FindLumpNamespace ns = GlobalNamespace);
native static string ReadLump(int lump);
native static int GetNumEntries();
native static int GetNumLumps();
native static string GetLumpName(int lump);
native static string GetLumpFullName(int lump);
native static int GetLumpNamespace(int lump);

View file

@ -997,6 +997,7 @@ enum EMapThingFlags
MTF_SECRET = 0x080000, // Secret pickup
MTF_NOINFIGHTING = 0x100000,
MTF_NOCOUNT = 0x200000, // Removes COUNTKILL/COUNTITEM
};
enum ESkillProperty

View file

@ -1040,6 +1040,20 @@ class LevelCompatibility : LevelPostProcessor
ClearSectorTags(214);
break;
}
case '9A4615498C3451413F1CD3D15099ACC7': // Eternal Doom map05
{
// an imp and two cyberdemons are located at the softlock area
SetThingFlags(272, GetThingFlags (272) | MTF_NOCOUNT);
SetThingFlags(273, GetThingFlags (273) | MTF_NOCOUNT);
SetThingFlags(274, GetThingFlags (274) | MTF_NOCOUNT);
break;
}
case '8B55842D5A509902738040AF10B4E787': // Eternal Doom map10
{
// soulsphere at the end of the level is there merely to replicate the start of the next map
SetThingFlags(548, GetThingFlags (548) | MTF_NOCOUNT);
break;
}
case 'DCE862393CAAA6FF1294FB7056B53057': // UAC Ultra map07
{
@ -1488,6 +1502,16 @@ class LevelCompatibility : LevelPostProcessor
SetLineFlags(2040, Line.ML_REPEAT_SPECIAL);
break;
}
case '145C4DFCF843F2B92C73036BA0E1D98A': // Hell Revealed MAP26
{
// The 4 archviles that produce the ghost monsters cannot be killed
// Make them not count so they still produce ghosts while allowing 100% kills.
SetThingFlags(320, GetThingFlags (320) | MTF_NOCOUNT);
SetThingFlags(347, GetThingFlags (347) | MTF_NOCOUNT);
SetThingFlags(495, GetThingFlags (495) | MTF_NOCOUNT);
SetThingFlags(496, GetThingFlags (496) | MTF_NOCOUNT);
break;
}
case '0E379EEBEB189F294ED122BC60D10A68': // Hellbound MAP29
{
@ -1948,6 +1972,133 @@ class LevelCompatibility : LevelPostProcessor
SetSectorSpecial(240, 0);
break;
}
case '1497894956B3C8EBE8A240B7FDD99C6A': // Memento Mori 2 MAP25
{
// an imp is used for the lift activation and cannot be killed
SetThingFlags(51, GetThingFlags (51) | MTF_NOCOUNT);
break;
}
case '51960F3E9D46449E98DBC7D97F49DB23': // Shotgun Symphony E1M1
{
// harmless cyberdemon included for the 'story' sake
SetThingFlags(158, GetThingFlags (158) | MTF_NOCOUNT);
break;
}
case '60D362BAE16B4C10A1DCEE442C878CAE': // 50 Shades of Graytall MAP06
{
// there are four invisibility spheres used for decoration
SetThingFlags(144, GetThingFlags (144) | MTF_NOCOUNT);
SetThingFlags(145, GetThingFlags (145) | MTF_NOCOUNT);
SetThingFlags(194, GetThingFlags (194) | MTF_NOCOUNT);
SetThingFlags(195, GetThingFlags (195) | MTF_NOCOUNT);
break;
}
case 'C104E740CC3F70BCFD5D2EA8E833318D': // 50 Monsters MAP29
{
// there are two invisibility spheres used for decoration
SetThingFlags(111, GetThingFlags (111) | MTF_NOCOUNT);
SetThingFlags(112, GetThingFlags (112) | MTF_NOCOUNT);
break;
}
case '76393C84102480A4C75A4674C9C3217A': // Deadly Standards 2 E2M8
{
// 923 lost souls are used as environmental hazard
for (int i = 267; i < 275; i++)
SetThingFlags (i, GetThingFlags (i) | MTF_NOCOUNT);
for (int i = 482; i < 491; i++)
SetThingFlags (i, GetThingFlags (i) | MTF_NOCOUNT);
for (int i = 510; i < 522; i++)
SetThingFlags (i, GetThingFlags (i) | MTF_NOCOUNT);
for (int i = 880; i < 1510; i++)
SetThingFlags (i, GetThingFlags (i) | MTF_NOCOUNT);
for (int i = 1622; i < 1660; i++)
SetThingFlags (i, GetThingFlags (i) | MTF_NOCOUNT);
for (int i = 1682; i < 1820; i++)
SetThingFlags (i, GetThingFlags (i) | MTF_NOCOUNT);
for (int i = 1847; i < 1875; i++)
SetThingFlags (i, GetThingFlags (i) | MTF_NOCOUNT);
for (int i = 2110; i < 2114; i++)
SetThingFlags (i, GetThingFlags (i) | MTF_NOCOUNT);
for (int i = 2243; i < 2293; i++)
SetThingFlags (i, GetThingFlags (i) | MTF_NOCOUNT);
SetThingFlags(493, GetThingFlags (493) | MTF_NOCOUNT);
SetThingFlags(573, GetThingFlags (573) | MTF_NOCOUNT);
SetThingFlags(613, GetThingFlags (613) | MTF_NOCOUNT);
SetThingFlags(614, GetThingFlags (614) | MTF_NOCOUNT);
SetThingFlags(1679, GetThingFlags (1679) | MTF_NOCOUNT);
SetThingFlags(1680, GetThingFlags (1680) | MTF_NOCOUNT);
break;
}
case '42B4D294A60BE4E3500AF150291CF6D4': // Hell Ground MAP05
{
// 5 cyberdemons are located at the 'pain end' sector
for (int i = 523; i < 528; i++)
SetThingFlags (i, GetThingFlags (i) | MTF_NOCOUNT);
break;
}
case '0C0513A9821F26F3D7997E3B0359A318': // Mayhem 1500 MAP06
{
// there's an archvile behind the bossbrain at the very end that can't be killed
SetThingFlags(61, GetThingFlags (61) | MTF_NOCOUNT);
break;
}
case '00641DA23DDE998F6725BC5896A0DBC2': // 20 Years of Doom E1M8
{
// 32 lost souls are located at the 'pain end' sector
for (int i = 1965; i < 1975; i++)
SetThingFlags (i, GetThingFlags (i) | MTF_NOCOUNT);
for (int i = 2189; i < 2202; i++)
SetThingFlags (i, GetThingFlags (i) | MTF_NOCOUNT);
for (int i = 2311; i < 2320; i++)
SetThingFlags (i, GetThingFlags (i) | MTF_NOCOUNT);
break;
}
case 'EEBDD9CA280F6FF06C30AF2BEE85BF5F': // 2002ad10.wad E3M3
{
// swarm of cacodemons at the end meant to be pseudo-endless and not killed
for (int i = 467; i < 547; i++)
SetThingFlags (i, GetThingFlags (i) | MTF_NOCOUNT);
break;
}
case '988DFF5BB7073B857DEE3957A91C8518': // Speed of Doom MAP14
{
// you can get only one of the soulspheres, the other, depending on your choice, becomes unavailable
SetThingFlags(1044, GetThingFlags (1044) | MTF_NOCOUNT);
SetThingFlags(1045, GetThingFlags (1045) | MTF_NOCOUNT);
break;
}
case '361734AC5D78E872A05335C83E4F6DB8': // inf-lutz.wad E3M8
{
// there is a trap with 10 cyberdemons at the end of the map, you are not meant to kill them
for (int i = 541; i < 546; i++)
SetThingFlags (i, GetThingFlags (i) | MTF_NOCOUNT);
for (int i = 638; i < 643; i++)
SetThingFlags (i, GetThingFlags (i) | MTF_NOCOUNT);
break;
}
case '8F844B272E7235E82EA78AD2A2EB2D4A': // Serenity E3M7
{
// two spheres can't be obtained and thus should not count towards 100% items
SetThingFlags(443, GetThingFlags (443) | MTF_NOCOUNT);
SetThingFlags(444, GetThingFlags (444) | MTF_NOCOUNT);
// one secret is unobtainable
SetSectorSpecial (97, 0);
break;
}
}
}
}