From 96cd14eeac7775847e38e0cbf5de2c854f1b7f41 Mon Sep 17 00:00:00 2001 From: Nev3r Date: Mon, 16 Dec 2019 13:13:22 +0100 Subject: [PATCH] Convert culling planes and fake floors. --- src/hardware/hw_main.c | 2 +- src/p_spec.c | 11 +++++++++-- src/r_main.c | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 243a5efab..30bb18175 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -4038,7 +4038,7 @@ static boolean HWR_DoCulling(line_t *cullheight, line_t *viewcullheight, float v return false; cullplane = FIXED_TO_FLOAT(cullheight->frontsector->floorheight); - if (cullheight->flags & ML_NOCLIMB) // Group culling + if (cullheight->args[1]) // Group culling { if (!viewcullheight) return false; diff --git a/src/p_spec.c b/src/p_spec.c index 3d4b230d4..9de294549 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -6405,6 +6405,10 @@ void P_ConvertBinaryLinedefs(void) { switch (lines[i].special) { + case 10: //Culling plane + lines[i].args[0] = lines[i].tag; + lines[i].args[1] = (lines[i].flags & ML_NOCLIMB); + break; case 11: //Rope hang parameters lines[i].args[0] = lines[i].tag; lines[i].args[1] = abs(sides[lines[i].sidenum[0]].textureoffset) >> FRACBITS; @@ -6413,6 +6417,9 @@ void P_ConvertBinaryLinedefs(void) if (lines[i].flags & ML_NOCLIMB) //Static lines[i].args[1] = 0; break; + case 63: //Fake floor/ceiling planes + lines[i].args[0] = lines[i].tag; + break; case 700: //Slope front sector floor case 701: //Slope front sector ceiling case 702: //Slope front sector floor and ceiling @@ -6804,7 +6811,7 @@ void P_SpawnSpecials(INT32 fromnetsave) case 10: // Vertical culling plane for sprites and FOFs sec = sides[*lines[i].sidenum].sector - sectors; - for (s = -1; (s = P_FindSectorFromLineTag(lines + i, s)) >= 0 ;) + for (s = -1; (s = P_FindSectorFromTag(lines[i].args[0], s)) >= 0 ;) sectors[s].cullheight = &lines[i]; // This allows it to change in realtime! break; @@ -6865,7 +6872,7 @@ void P_SpawnSpecials(INT32 fromnetsave) case 63: // support for drawn heights coming from different sector sec = sides[*lines[i].sidenum].sector-sectors; - for (s = -1; (s = P_FindSectorFromLineTag(lines + i, s)) >= 0 ;) + for (s = -1; (s = P_FindSectorFromTag(lines[i].args[0], s)) >= 0 ;) sectors[s].heightsec = (INT32)sec; break; diff --git a/src/r_main.c b/src/r_main.c index 0ef0a3d88..937edc683 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -402,7 +402,7 @@ boolean R_DoCulling(line_t *cullheight, line_t *viewcullheight, fixed_t vz, fixe return false; cullplane = cullheight->frontsector->floorheight; - if (cullheight->flags & ML_NOCLIMB) // Group culling + if (cullheight->args[1]) // Group culling { if (!viewcullheight) return false;