diff --git a/common/bsputils.cc b/common/bsputils.cc index 8c8b6631..01e315f0 100644 --- a/common/bsputils.cc +++ b/common/bsputils.cc @@ -40,7 +40,7 @@ int Face_VertexAtIndex(const bsp2_t *bsp, const bsp2_dface_t *f, int v) return bsp->dedges[edge].v[0]; } -void +static void Vertex_GetPos(const bsp2_t *bsp, int num, vec3_t out) { Q_assert(num >= 0 && num < bsp->numvertexes); @@ -50,12 +50,6 @@ Vertex_GetPos(const bsp2_t *bsp, int num, vec3_t out) out[i] = v->point[i]; } -void Face_PointAtIndex(const bsp2_t *bsp, const bsp2_dface_t *f, int v, vec3_t out) -{ - const int vertnum = Face_VertexAtIndex(bsp, f, v); - Vertex_GetPos(bsp, vertnum, out); -} - void Face_Normal(const bsp2_t *bsp, const bsp2_dface_t *f, vec3_t norm) { diff --git a/include/common/bsputils.hh b/include/common/bsputils.hh index a668ef58..b16d9dbd 100644 --- a/include/common/bsputils.hh +++ b/include/common/bsputils.hh @@ -28,8 +28,6 @@ int Face_GetNum(const bsp2_t *bsp, const bsp2_dface_t *f); int Face_VertexAtIndex(const bsp2_t *bsp, const bsp2_dface_t *f, int v); -void Vertex_GetPos(const bsp2_t *bsp, int num, vec3_t out); -void Face_PointAtIndex(const bsp2_t *bsp, const bsp2_dface_t *f, int v, vec3_t out); void Face_Normal(const bsp2_t *bsp, const bsp2_dface_t *f, vec3_t norm); plane_t Face_Plane(const bsp2_t *bsp, const bsp2_dface_t *f); const texinfo_t *Face_Texinfo(const bsp2_t *bsp, const bsp2_dface_t *face); diff --git a/light/ltface2.cc b/light/ltface2.cc index 1e6bed43..fd00c22d 100644 --- a/light/ltface2.cc +++ b/light/ltface2.cc @@ -119,8 +119,7 @@ public: if (m_texsize[i] >= MAXDIMENSION) { const plane_t plane = Face_Plane(bsp, face); - vec3_t point; - Face_PointAtIndex(bsp, face, 0, point); // grab first vert + const glm::vec3 point = Face_PointAtIndex_E(bsp, face, 0); // grab first vert const char *texname = Face_TextureName(bsp, face); Error("Bad surface extents:\n" @@ -128,7 +127,7 @@ public: " texture %s at (%s)\n" " surface normal (%s)\n", Face_GetNum(bsp, face), i ? "t" : "s", m_texsize[i], m_lightmapscale, - texname, VecStrf(point), + texname, glm::to_string(point).c_str(), VecStrf(plane.normal)); } } @@ -270,12 +269,11 @@ face_tris_t Face_MakeTris(const bsp2_t *bsp, const bsp2_dface_t *f) { v3 = Face_VertexAtIndex(bsp, f, j); - vec3_t p1, p2, p3; - Vertex_GetPos(bsp, v1, p1); - Vertex_GetPos(bsp, v2, p2); - Vertex_GetPos(bsp, v3, p3); + const glm::vec3 p1 = Vertex_GetPos_E(bsp, v1); + const glm::vec3 p2 = Vertex_GetPos_E(bsp, v2); + const glm::vec3 p3 = Vertex_GetPos_E(bsp, v3); - const float area = TriangleArea(p1, p2, p3); + const float area = GLM_TriangleArea(p1, p2, p3); Q_assert(!isnan(area)); res.areas.push_back(area);