From 0b21a34ddd41d648eafd562b78d36dbdbf32fe6a Mon Sep 17 00:00:00 2001
From: Nev3r <apophycens@gmail.com>
Date: Sat, 4 Jan 2020 10:24:42 +0100
Subject: [PATCH] Add vertex height vars into the vertex struct, and their
 textmap parsing.

---
 src/p_setup.c | 12 ++++++++++++
 src/r_defs.h  |  2 ++
 2 files changed, 14 insertions(+)

diff --git a/src/p_setup.c b/src/p_setup.c
index bd1c531045..0a802583a1 100644
--- a/src/p_setup.c
+++ b/src/p_setup.c
@@ -1368,6 +1368,16 @@ static void ParseTextmapVertexParameter(UINT32 i, char *param, char *val)
 		vertexes[i].x = FLOAT_TO_FIXED(atof(val));
 	else if (fastcmp(param, "y"))
 		vertexes[i].y = FLOAT_TO_FIXED(atof(val));
+	else if (fastcmp(param, "zfloor"))
+	{
+		vertexes[i].floorz = FLOAT_TO_FIXED(atof(val));
+		vertexes[i].floorzset = true;
+	}
+	else if (fastcmp(param, "zceiling"))
+	{
+		vertexes[i].ceilingz = FLOAT_TO_FIXED(atof(val));
+		vertexes[i].ceilingzset = true;
+	}
 }
 
 static void ParseTextmapSectorParameter(UINT32 i, char *param, char *val)
@@ -1576,6 +1586,8 @@ static void P_LoadTextmap(void)
 		// Defaults.
 		vt->x = vt->y = INT32_MAX;
 		vt->z = 0;
+		vt->floorzset = vt->ceilingzset = false;
+		vt->floorz = vt->ceilingz = 0;
 
 		TextmapParse(vertexesPos[i], i, ParseTextmapVertexParameter);
 
diff --git a/src/r_defs.h b/src/r_defs.h
index 96ef953ceb..5f96958c92 100644
--- a/src/r_defs.h
+++ b/src/r_defs.h
@@ -84,6 +84,8 @@ typedef struct extracolormap_s
 typedef struct
 {
 	fixed_t x, y, z;
+	boolean floorzset, ceilingzset;
+	fixed_t floorz, ceilingz;
 } vertex_t;
 
 // Forward of linedefs, for sectors.
-- 
GitLab