From 50b5e978cc8fcf2ce8f05a92bca14d48d006be02 Mon Sep 17 00:00:00 2001 From: RedEnchilada Date: Mon, 3 Aug 2015 23:09:50 -0500 Subject: [PATCH] Support ceiling/backsector vertex slopes --- src/p_slopes.c | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/src/p_slopes.c b/src/p_slopes.c index f14fc0f6..baec5e1e 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -953,20 +953,47 @@ void P_ResetDynamicSlopes(void) { break; case 704: + case 705: + case 714: + case 715: { + pslope_t **slopetoset; + size_t which = lines[i].special; + UINT8 flags = SL_VERTEXSLOPE; if (lines[i].flags & ML_NOSONIC) flags |= SL_NOPHYSICS; if (!(lines[i].flags & ML_NOTAILS)) flags |= SL_NODYNAMIC; - if (lines[i].flags & ML_NOKNUX) - lines[i].frontsector->f_slope = P_NewVertexSlope(lines[i].tag, sides[lines[i].sidenum[0]].textureoffset >> FRACBITS, - sides[lines[i].sidenum[0]].rowoffset >> FRACBITS, flags); - else - lines[i].frontsector->f_slope = P_NewVertexSlope(lines[i].tag, lines[i].tag, lines[i].tag, flags); + if (which == 704) + { + slopetoset = &lines[i].frontsector->f_slope; + which = 0; + } + else if (which == 705) + { + slopetoset = &lines[i].frontsector->c_slope; + which = 0; + } + else if (which == 714) + { + slopetoset = &lines[i].backsector->f_slope; + which = 1; + } + else // 715 + { + slopetoset = &lines[i].backsector->c_slope; + which = 1; + } - lines[i].frontsector->hasslope = true; + if (lines[i].flags & ML_NOKNUX) + *slopetoset = P_NewVertexSlope(lines[i].tag, sides[lines[i].sidenum[which]].textureoffset >> FRACBITS, + sides[lines[i].sidenum[which]].rowoffset >> FRACBITS, flags); + else + *slopetoset = P_NewVertexSlope(lines[i].tag, lines[i].tag, lines[i].tag, flags); + + sides[lines[i].sidenum[which]].sector->hasslope = true; } break;