From 5874d01a7389192a0c29baf1fad425eac1e559ec Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Wed, 14 Jun 2017 15:24:11 +0300 Subject: [PATCH 1/4] All compatibility options are now applied for IWAD maps https://forum.zdoom.org/viewtopic.php?t=56867 --- src/compatibility.cpp | 39 +++++++++------------------------------ 1 file changed, 9 insertions(+), 30 deletions(-) diff --git a/src/compatibility.cpp b/src/compatibility.cpp index 080391af1..f281f0ef2 100644 --- a/src/compatibility.cpp +++ b/src/compatibility.cpp @@ -456,7 +456,11 @@ void CheckCompatibility(MapData *map) { FMD5Holder md5; FCompatValues *flags; - bool onlyparams = true; + + ii_compatflags = 0; + ii_compatflags2 = 0; + ib_compatflags = 0; + ii_compatparams = -1; // 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. @@ -465,27 +469,14 @@ void CheckCompatibility(MapData *map) { ii_compatflags = COMPATF_SHORTTEX|COMPATF_LIGHT; if (gameinfo.flags & GI_COMPATSTAIRS) ii_compatflags |= COMPATF_STAIRINDEX; - ii_compatflags2 = 0; - ib_compatflags = 0; - ii_compatparams = -1; } else if (Wads.GetLumpFile(map->lumpnum) == 1 && (gameinfo.flags & GI_COMPATPOLY1) && Wads.CheckLumpName(map->lumpnum, "MAP36")) { ii_compatflags = COMPATF_POLYOBJ; - ii_compatflags2 = 0; - ib_compatflags = 0; - ii_compatparams = -1; } else if (Wads.GetLumpFile(map->lumpnum) == 2 && (gameinfo.flags & GI_COMPATPOLY2) && Wads.CheckLumpName(map->lumpnum, "MAP47")) { ii_compatflags = COMPATF_POLYOBJ; - ii_compatflags2 = 0; - ib_compatflags = 0; - ii_compatparams = -1; - } - else - { - onlyparams = false; } map->GetChecksum(md5.Bytes); @@ -512,24 +503,12 @@ void CheckCompatibility(MapData *map) if (flags != NULL) { - if (!onlyparams) - { - ii_compatflags = flags->CompatFlags[SLOT_COMPAT]; - ii_compatflags2 = flags->CompatFlags[SLOT_COMPAT2]; - ib_compatflags = flags->CompatFlags[SLOT_BCOMPAT]; - } + ii_compatflags |= flags->CompatFlags[SLOT_COMPAT]; + ii_compatflags2 |= flags->CompatFlags[SLOT_COMPAT2]; + ib_compatflags |= flags->CompatFlags[SLOT_BCOMPAT]; ii_compatparams = flags->ExtCommandIndex; } - else - { - if (!onlyparams) - { - ii_compatflags = 0; - ii_compatflags2 = 0; - ib_compatflags = 0; - } - ii_compatparams = -1; - } + // Reset i_compatflags compatflags.Callback(); compatflags2.Callback(); From c22017f98139c3476cffa7376c153839bbc15dca Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Wed, 14 Jun 2017 16:09:46 +0300 Subject: [PATCH 2/4] Made two Hexen maps compatibility options data driven --- src/compatibility.cpp | 8 -------- wadsrc/static/compatibility.txt | 6 ++++++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/compatibility.cpp b/src/compatibility.cpp index f281f0ef2..947b7ffae 100644 --- a/src/compatibility.cpp +++ b/src/compatibility.cpp @@ -470,14 +470,6 @@ void CheckCompatibility(MapData *map) ii_compatflags = COMPATF_SHORTTEX|COMPATF_LIGHT; if (gameinfo.flags & GI_COMPATSTAIRS) ii_compatflags |= COMPATF_STAIRINDEX; } - else if (Wads.GetLumpFile(map->lumpnum) == 1 && (gameinfo.flags & GI_COMPATPOLY1) && Wads.CheckLumpName(map->lumpnum, "MAP36")) - { - ii_compatflags = COMPATF_POLYOBJ; - } - else if (Wads.GetLumpFile(map->lumpnum) == 2 && (gameinfo.flags & GI_COMPATPOLY2) && Wads.CheckLumpName(map->lumpnum, "MAP47")) - { - ii_compatflags = COMPATF_POLYOBJ; - } map->GetChecksum(md5.Bytes); diff --git a/wadsrc/static/compatibility.txt b/wadsrc/static/compatibility.txt index 173aa10d1..aafdd9a37 100644 --- a/wadsrc/static/compatibility.txt +++ b/wadsrc/static/compatibility.txt @@ -763,3 +763,9 @@ CA3773ED313E8899311F3DD0CA195A68 // e3m6 setsectorlight 138 192 setwalltexture 3431 back top BRKGRY01 } + +3FFAF2F624C1B4BB6F581DCF7B99CBA7 // hexen.wad MAP36 +7DC65D5029DD834481CD716B3D71388A // hexdd.wad MAP47 +{ + polyobj +} From 478d72b37b757c577e8a3b5473e51165650ccb81 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Wed, 14 Jun 2017 22:13:40 +0300 Subject: [PATCH 3/4] Fixed resetting of activation failed flag on pickup https://forum.zdoom.org/viewtopic.php?t=56896 --- wadsrc/static/zscript/inventory/inventory.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wadsrc/static/zscript/inventory/inventory.txt b/wadsrc/static/zscript/inventory/inventory.txt index 750296565..e7786059b 100644 --- a/wadsrc/static/zscript/inventory/inventory.txt +++ b/wadsrc/static/zscript/inventory/inventory.txt @@ -266,7 +266,7 @@ class Inventory : Actor native if (copy.bInitEffectFailed) { if (copy != self) copy.Destroy(); - else bInitEffectFailed; + else bInitEffectFailed = false; return false; } // Handle owner-changing powerups From eda55b25ee647c7fd9e4d9c0771c97366b1b5955 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 16 Jun 2017 11:58:24 +0300 Subject: [PATCH 4/4] Fixed code generation for vector parameters with default values https://forum.zdoom.org/viewtopic.php?t=56915 --- src/scripting/zscript/zcc_compile.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/scripting/zscript/zcc_compile.cpp b/src/scripting/zscript/zcc_compile.cpp index 9f6c1fdce..5d42d64ba 100644 --- a/src/scripting/zscript/zcc_compile.cpp +++ b/src/scripting/zscript/zcc_compile.cpp @@ -2555,7 +2555,6 @@ void ZCCCompiler::CompileFunction(ZCC_StructWork *c, ZCC_FuncDeclarator *f, bool else { auto cnst = static_cast(x); - hasdefault = true; switch (type->GetRegType()) { case REGT_INT: @@ -2583,6 +2582,8 @@ void ZCCCompiler::CompileFunction(ZCC_StructWork *c, ZCC_FuncDeclarator *f, bool break; } } + + hasdefault = true; } if (x != nullptr) delete x; }