From 029788976d368ef4773efbfd4657fffe5f789984 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Thu, 11 May 2017 12:38:47 -0400 Subject: [PATCH] - fully fix Strife1.wad's MAP10 shooting range. - added the following compatibility.txt properties: setsectortexture, setsectorlight --- src/compatibility.cpp | 58 +++++++++++++++++++++++++++++++++ wadsrc/static/compatibility.txt | 10 ++++++ 2 files changed, 68 insertions(+) diff --git a/src/compatibility.cpp b/src/compatibility.cpp index 9fd9f5746..080391af1 100644 --- a/src/compatibility.cpp +++ b/src/compatibility.cpp @@ -90,6 +90,8 @@ enum CP_SETTHINGFLAGS, CP_SETVERTEX, CP_SETTHINGSKILLS, + CP_SETSECTORTEXTURE, + CP_SETSECTORLIGHT, }; // EXTERNAL FUNCTION PROTOTYPES -------------------------------------------- @@ -398,6 +400,33 @@ void ParseCompatibility() sc.MustGetNumber(); CompatParams.Push(sc.Number); } + else if (sc.Compare("setsectortexture")) + { + if (flags.ExtCommandIndex == ~0u) flags.ExtCommandIndex = CompatParams.Size(); + CompatParams.Push(CP_SETSECTORTEXTURE); + sc.MustGetNumber(); + CompatParams.Push(sc.Number); + sc.MustGetString(); + CompatParams.Push(sc.MustMatchString(SectorPlanes)); + sc.MustGetString(); + const FString texName = sc.String; + const unsigned int texIndex = TexNames.Find(texName); + const unsigned int texCount = TexNames.Size(); + if (texIndex == texCount) + { + TexNames.Push(texName); + } + CompatParams.Push(texIndex); + } + else if (sc.Compare("setsectorlight")) + { + if (flags.ExtCommandIndex == ~0u) flags.ExtCommandIndex = CompatParams.Size(); + CompatParams.Push(CP_SETSECTORLIGHT); + sc.MustGetNumber(); + CompatParams.Push(sc.Number); + sc.MustGetNumber(); + CompatParams.Push(sc.Number); + } else { sc.UnGet(); @@ -690,6 +719,35 @@ void SetCompatibilityParams() i += 3; break; } + case CP_SETSECTORTEXTURE: + { + if ((unsigned)CompatParams[i + 1] < level.sectors.Size()) + { + sector_t *sec = &level.sectors[CompatParams[i+1]]; + assert (sec != nullptr); + secplane_t& plane = sector_t::floor == CompatParams[i + 2] + ? sec->floorplane + : sec->ceilingplane; + assert(TexNames.Size() > (unsigned int)CompatParams[i + 3]); + const FTextureID texID = TexMan.GetTexture(TexNames[CompatParams[i + 3]], FTexture::TEX_Any); + + sec->SetTexture(CompatParams[i + 2], texID); + } + i += 4; + break; + } + case CP_SETSECTORLIGHT: + { + if ((unsigned)CompatParams[i + 1] < level.sectors.Size()) + { + sector_t *sec = &level.sectors[CompatParams[i+1]]; + assert (sec != nullptr); + + sec->SetLightLevel((unsigned)CompatParams[i + 2]); + } + i += 3; + break; + } } } } diff --git a/wadsrc/static/compatibility.txt b/wadsrc/static/compatibility.txt index f7023d80b..4c9576e18 100644 --- a/wadsrc/static/compatibility.txt +++ b/wadsrc/static/compatibility.txt @@ -633,3 +633,13 @@ CA3773ED313E8899311F3DD0CA195A68 // e3m6 setwalltexture 1277 back top CSTLRCK setwalltexture 1278 front top CSTLRCK } + +39C594CAC07EE51C80F757DA465FCC94 // strife1.wad map10 +{ + // fix the shooting range by matching sector 138 and 145 properties together + setsectoroffset 145 floor -32 + setsectoroffset 145 ceil 40 + setsectortexture 145 floor F_CONCRP + setsectorlight 138 192 + setwalltexture 3431 back top BRKGRY01 +} \ No newline at end of file