From 5e6a96d021941d44e76f469f782f12f61f1a57cc Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 10 Feb 2019 14:08:27 +0100 Subject: [PATCH 1/5] - fixed path of texture directory. --- src/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8e6d07fb4..1184dd150 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1456,12 +1456,12 @@ source_group("External\\SFMT" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/s source_group("FraggleScript" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/fragglescript/.+") source_group("Game Data" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/gamedata/.+") source_group("Game Data\\Resource Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/gamedata/resourcefiles/.+") -source_group("Game Data\\Textures" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/textures/.+") -source_group("Game Data\\Textures\\Hires" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/textures/hires/.+") -source_group("Game Data\\Textures\\Hires\\HQ Resize" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/textures/hires/hqnx/.+") -source_group("Game Data\\Textures\\Hires\\HQ Resize MMX version" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/textures/hires/hqnx_asm/.+") -source_group("Game Data\\Textures\\Hires\\XBRZ" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/textures/hires/xbr/.+") -source_group("Game Data\\Textures\\Formats" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/textures/formats/.+") +source_group("Game Data\\Textures" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/gamedata/textures/.+") +source_group("Game Data\\Textures\\Hires" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/gamedata/textures/hires/.+") +source_group("Game Data\\Textures\\Hires\\HQ Resize" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/gamedata/textures/hires/hqnx/.+") +source_group("Game Data\\Textures\\Hires\\HQ Resize MMX version" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/gamedata/textures/hires/hqnx_asm/.+") +source_group("Game Data\\Textures\\Hires\\XBRZ" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/gamedata/textures/hires/xbr/.+") +source_group("Game Data\\Textures\\Formats" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/gamedata/textures/formats/.+") source_group("Intermission" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/intermission/.+") source_group("Map Loader" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/maploader/.+") source_group("Menu" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/menu/.+") From 072018bda2e10511e173ee4f41aae94ea819d8dc Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 10 Feb 2019 14:12:06 +0100 Subject: [PATCH 2/5] - cleaned up .gitignore. This still contained a lot of data from the pre-CMake build setup for Windows. None of these paths is relevant anymore. --- .gitignore | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/.gitignore b/.gitignore index c72578915..fb6bc8530 100644 --- a/.gitignore +++ b/.gitignore @@ -1,59 +1,26 @@ -/Debug *.ncb *.suo *.pdb *.ilk *.aps -/fmodapi*/ -/Release /wadsrc_wad *.user /build -/debug -/release -*/debug -*/release /release_gcc -/dumb/vc6/dumb_static/release -/dumb/vc6/dumb_static/debug -/dumb/vc6/dumb_static/x64 /DOOMSTATS.TXT /src/gitinfo.h -/src/sc_man_scanner.h -/src/xlat/xlat_parser.c -/src/xlat/xlat_parser.h -/src/xlat/xlat_parser.out -/src/zscript/zcc-parse.c -/src/zscript/zcc-parse.h -/src/zscript/zcc-parse.out -/tools/*/debug -/tools/*/release -/tools/*/*.exe -/tools/lemon/build -/tools/re2c/build -/tools/updaterevision/x64/ -/tools/zipdir/x64 /wadsrc/*.pk3 -/build_vc2013 -/bzip2/x64/ /disasm.txt -/game-music-emu/x64/ -/gdtoa/x64/ -/jpeg-6b/x64/ -/lzma/x64/ -/zlib/x64/ -/build_vc2013_64bit /build_vc2015 /build_vc2015-32 /build_vc2015-64 /build_vc2017-64 /build /llvm -/src/r_drawersasm.obj -/src/r_drawersasm.o .vs /src/gl/unused /mapfiles_release/*.map .DS_Store /build_vc2017-32 /build2 +/build_vc2019-64 From af5a2fe5225ca5b11c5fcdf9b488345a159f3871 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 10 Feb 2019 20:30:40 +0100 Subject: [PATCH 3/5] - removed the ActiveSequences counter. It was only used to avoid traversing the list if all sequences were paused which is an exceptional situation. On the other hand, the way it counted was not correct so rather than fixing it it seemed more appropriate to remove it entirely. --- src/g_levellocals.h | 1 - src/p_saveg.cpp | 1 - src/s_sndseq.cpp | 5 +---- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/g_levellocals.h b/src/g_levellocals.h index 57fa440b9..afa6dd454 100644 --- a/src/g_levellocals.h +++ b/src/g_levellocals.h @@ -600,7 +600,6 @@ public: int airsupply; int DefaultEnvironment; // Default sound environment. - int ActiveSequences; DSeqNode *SequenceListHead; // [RH] particle globals diff --git a/src/p_saveg.cpp b/src/p_saveg.cpp index 63b3fe9a6..55c04c944 100644 --- a/src/p_saveg.cpp +++ b/src/p_saveg.cpp @@ -932,7 +932,6 @@ void FLevelLocals::Serialize(FSerializer &arc, bool hubload) Thinkers.DestroyAllThinkers(); interpolator.ClearInterpolations(); arc.ReadObjects(hubload); - ActiveSequences = 0; } arc("multiplayer", multiplayer); diff --git a/src/s_sndseq.cpp b/src/s_sndseq.cpp index 3d5b347e1..a9bfda24e 100644 --- a/src/s_sndseq.cpp +++ b/src/s_sndseq.cpp @@ -406,7 +406,6 @@ void DSeqNode::OnDestroy() m_Next->m_Prev = m_Prev; GC::WriteBarrier(m_Next, m_Prev); } - Level->ActiveSequences--; Super::OnDestroy(); } @@ -827,7 +826,6 @@ void DSeqNode::ActivateSequence (int sequence) m_CurrentSoundID = 0; m_Volume = 1; // Start at max volume... m_Atten = ATTN_IDLE; // ...and idle attenuation - Level->ActiveSequences++; } DSeqActorNode::DSeqActorNode (AActor *actor, int sequence, int modenum) @@ -1323,7 +1321,6 @@ void DSeqNode::Tick () int seqnum = FindSequence (ENamedName(m_SequencePtr[i*2+1])); if (seqnum >= 0) { // Found a match, and it's a good one too. - Level->ActiveSequences--; ActivateSequence (seqnum); break; } @@ -1358,7 +1355,7 @@ void SN_UpdateActiveSequences (FLevelLocals *Level) { DSeqNode *node; - if (!Level->ActiveSequences || paused) + if (paused) { // No sequences currently playing/game is paused return; } From d4d010ac322626aa3373b3ea6d6071105ef1180e Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 11 Feb 2019 16:26:11 +0200 Subject: [PATCH 4/5] - added compatibility flag for buggy CheckSwitchRange behavior https://forum.zdoom.org/viewtopic.php?t=63008 https://forum.zdoom.org/viewtopic.php?t=63650 --- src/d_main.cpp | 3 ++- src/doomdef.h | 1 + src/g_shared/p_switch.cpp | 12 +++++++++--- src/gamedata/g_mapinfo.cpp | 1 + src/maploader/compatibility.cpp | 1 + wadsrc/static/language.enu | 1 + wadsrc/static/menudef.txt | 1 + wadsrc/static/zscript/constants.txt | 1 + 8 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index a2c758e0b..d2a43f969 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -600,7 +600,7 @@ CUSTOM_CVAR(Int, compatmode, 0, CVAR_ARCHIVE|CVAR_NOINITCALL) case 4: // Old ZDoom compat mode v = COMPATF_SOUNDTARGET | COMPATF_LIGHT; - w = COMPATF2_MULTIEXIT | COMPATF2_TELEPORT | COMPATF2_PUSHWINDOW; + w = COMPATF2_MULTIEXIT | COMPATF2_TELEPORT | COMPATF2_PUSHWINDOW | COMPATF2_CHECKSWITCHRANGE; break; case 5: // MBF compat mode @@ -658,6 +658,7 @@ CVAR (Flag, compat_pointonline, compatflags2, COMPATF2_POINTONLINE); 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(Bool, vid_activeinbackground, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) diff --git a/src/doomdef.h b/src/doomdef.h index a8f0250d5..14d029f8b 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -328,6 +328,7 @@ enum : unsigned int COMPATF2_MULTIEXIT = 1 << 4, // Level exit can be triggered multiple times (required by Daedalus's travel tubes, thanks to a faulty script) 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 }; // Emulate old bugs for select maps. These are not exposed by a cvar diff --git a/src/g_shared/p_switch.cpp b/src/g_shared/p_switch.cpp index 2e092b5c3..81ce5b58b 100644 --- a/src/g_shared/p_switch.cpp +++ b/src/g_shared/p_switch.cpp @@ -194,7 +194,9 @@ bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno, const DVector3 * } } - return (user->Top() > open.top); + return (user->Level->i_compatflags2 & COMPATF2_CHECKSWITCHRANGE) + ? (user->Top() >= open.top) + : (user->Top() > open.top); } else if ((TexMan.FindSwitch(side->GetTexture(side_t::bottom))) != NULL) { @@ -216,7 +218,9 @@ bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno, const DVector3 * } } - return (user->Z() < open.bottom); + return (user->Level->i_compatflags2 & COMPATF2_CHECKSWITCHRANGE) + ? (user->Z() <= open.bottom) + : (user->Z() < open.bottom); } else if ((flags & ML_3DMIDTEX) || (TexMan.FindSwitch(side->GetTexture(side_t::mid))) != NULL) { @@ -229,7 +233,9 @@ bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno, const DVector3 * else { // no switch found. Check whether the player can touch either top or bottom texture - return (user->Top() > open.top) || (user->isBelow(open.bottom)); + return (user->Level->i_compatflags2 & COMPATF2_CHECKSWITCHRANGE) + ? ( (user->Top() >= open.top) || (user->Z() <= open.bottom) ) + : ( (user->Top() > open.top) || user->isBelow(open.bottom) ); } } diff --git a/src/gamedata/g_mapinfo.cpp b/src/gamedata/g_mapinfo.cpp index f5f45fdca..e4dae12fe 100644 --- a/src/gamedata/g_mapinfo.cpp +++ b/src/gamedata/g_mapinfo.cpp @@ -1619,6 +1619,7 @@ MapFlagHandlers[] = { "compat_multiexit", MITYPE_COMPATFLAG, 0, COMPATF2_MULTIEXIT }, { "compat_teleport", MITYPE_COMPATFLAG, 0, COMPATF2_TELEPORT }, { "compat_pushwindow", MITYPE_COMPATFLAG, 0, COMPATF2_PUSHWINDOW }, + { "compat_checkswitchrange", MITYPE_COMPATFLAG, 0, COMPATF2_CHECKSWITCHRANGE }, { "cd_start_track", MITYPE_EATNEXT, 0, 0 }, { "cd_end1_track", MITYPE_EATNEXT, 0, 0 }, { "cd_end2_track", MITYPE_EATNEXT, 0, 0 }, diff --git a/src/maploader/compatibility.cpp b/src/maploader/compatibility.cpp index ad792dc5a..61c3106c4 100644 --- a/src/maploader/compatibility.cpp +++ b/src/maploader/compatibility.cpp @@ -164,6 +164,7 @@ static FCompatOption Options[] = { "multiexit", COMPATF2_MULTIEXIT, SLOT_COMPAT2 }, { "teleport", COMPATF2_TELEPORT, SLOT_COMPAT2 }, { "disablepushwindowcheck", COMPATF2_PUSHWINDOW, SLOT_COMPAT2 }, + { "checkswitchrange", COMPATF2_CHECKSWITCHRANGE, SLOT_COMPAT2 }, { NULL, 0, 0 } }; diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index 54cb51ef1..e49759b6a 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -2184,6 +2184,7 @@ CMPTMNU_SOUNDCUTOFF = "Sounds stop when actor vanishes"; CMPTMNU_SOUNDTARGET = "Use original sound target handling"; CMPTMNU_TELEPORT = "Scripted teleports don't trigger sector actions"; CMPTMNU_PUSHWINDOW = "Non-blocking lines can be pushed"; +CMPTMNU_CHECKSWITCHRANGE = "Enable buggy CheckSwitchRange behavior"; // Sound Options SNDMNU_TITLE = "SOUND OPTIONS"; diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 6633265f2..2a6fe6a65 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -1434,6 +1434,7 @@ OptionMenu "CompatibilityOptions" protected Option "$CMPTMNU_MULTIEXIT", "compat_multiexit", "YesNo" Option "$CMPTMNU_TELEPORT", "compat_teleport", "YesNo" Option "$CMPTMNU_PUSHWINDOW", "compat_pushwindow", "YesNo" + Option "$CMPTMNU_CHECKSWITCHRANGE", "compat_checkswitchrange", "YesNo" StaticText " " StaticText "$CMPTMNU_PHYSICSBEHAVIOR",1 diff --git a/wadsrc/static/zscript/constants.txt b/wadsrc/static/zscript/constants.txt index 0de7ec391..0df017485 100644 --- a/wadsrc/static/zscript/constants.txt +++ b/wadsrc/static/zscript/constants.txt @@ -1338,4 +1338,5 @@ enum ECompatFlags COMPATF2_MULTIEXIT = 1 << 4, // Level exit can be triggered multiple times (required by Daedalus's travel tubes, thanks to a faulty script) 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 }; From eaf0ac1f7b6a2daa22599b1ccddee95f58c18d1f Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 11 Feb 2019 18:05:31 +0200 Subject: [PATCH 5/5] - added compatibility entries for maps affected by buggy CheckSwitchRange behavior --- wadsrc/static/compatibility.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/wadsrc/static/compatibility.txt b/wadsrc/static/compatibility.txt index 2ab378ba3..a5fbe691a 100644 --- a/wadsrc/static/compatibility.txt +++ b/wadsrc/static/compatibility.txt @@ -261,8 +261,6 @@ FA23E72FA955E66EC68609F72C0BA71E // unloved.pk3:unlovedmaps.wad map02 41BEC1F643CFEEC997AF98276A05EC88 // unloved.pk3:unlovedmaps.wad map03 AF9A6370BE562584BC11165ECF364713 // unloved.pk3:unlovedmaps.wad map04 DC96228097DD004C40CCB1DB14A91EAA // unloved.pk3:unlovedmaps.wad map05 -261E64897A572C8DB8DC041E64BE27AD // unloved2beta1.pk3:u2_new2maps2.wad map06 -04800B1F35E8C036EBABC8C616402927 // unloved2beta1.pk3:u2_new2maps2.wad map07 9E54F70648A77BBD090FF78A3AA05367 // unloved2beta1.pk3:u2_new2maps2.wad map08 72E9E0F41F691B7F956E62F35B4A617F // unloved2beta1.pk3:u2_new2maps2.wad map09 3D3FE412E87AD8B2316DAEC9E25F2E5D // unloved2beta1.pk3:u2_new2maps2.wad map10 @@ -275,3 +273,15 @@ DC96228097DD004C40CCB1DB14A91EAA // unloved.pk3:unlovedmaps.wad map05 setslopeoverflow polyobj } + +1624AD80349566AA7F29D2CA0D51754B // The Gateway Experiments Episode 5: Prime Directive, ge5map02 +{ + checkswitchrange +} + +261E64897A572C8DB8DC041E64BE27AD // unloved2beta1.pk3:u2_new2maps2.wad map06 +04800B1F35E8C036EBABC8C616402927 // unloved2beta1.pk3:u2_new2maps2.wad map07 +{ + clipmidtex + checkswitchrange +}