From 4b5882e0301843436355ebffeb711dfe479e775e Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sat, 23 Dec 2023 02:03:38 +0100 Subject: [PATCH] Remove unused code and make functions private --- src/rendering/hwrenderer/doom_levelsubmesh.h | 34 ++------------------ 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/src/rendering/hwrenderer/doom_levelsubmesh.h b/src/rendering/hwrenderer/doom_levelsubmesh.h index bebf1d388..df5386cb2 100644 --- a/src/rendering/hwrenderer/doom_levelsubmesh.h +++ b/src/rendering/hwrenderer/doom_levelsubmesh.h @@ -42,14 +42,8 @@ public: unsigned int GetSurfaceIndex(const LevelMeshSurface* surface) const override { return (unsigned int)(ptrdiff_t)(static_cast(surface) - Surfaces.Data()); } int GetSurfaceCount() override { return Surfaces.Size(); } - // Used by Maploader - void LinkSurfaces(FLevelLocals& doomMap); - void PackLightmapAtlas(FLevelLocals& doomMap, int lightmapStartIndex); - TArray Surfaces; - TArray> PolyLMSurfaces; - TArray Portals; private: @@ -66,28 +60,8 @@ private: void CreateWallSurface(side_t* side, HWWallDispatcher& disp, MeshBuilder& state, std::map& bindings, TArray& list, bool isSky, bool translucent); void CreateFlatSurface(HWFlatDispatcher& disp, MeshBuilder& state, std::map& bindings, TArray& list, bool isSky = false); - static FVector4 ToPlane(const FVector3& pt1, const FVector3& pt2, const FVector3& pt3) - { - FVector3 n = ((pt2 - pt1) ^ (pt3 - pt2)).Unit(); - float d = pt1 | n; - return FVector4(n.X, n.Y, n.Z, d); - } - - static FVector4 ToPlane(const FVector3& pt1, const FVector3& pt2, const FVector3& pt3, const FVector3& pt4) - { - if (pt1.ApproximatelyEquals(pt3)) - { - return ToPlane(pt1, pt2, pt4); - } - else if (pt1.ApproximatelyEquals(pt2) || pt2.ApproximatelyEquals(pt3)) - { - return ToPlane(pt1, pt3, pt4); - } - - return ToPlane(pt1, pt2, pt3); - } - - // Lightmapper + void LinkSurfaces(FLevelLocals& doomMap); + void PackLightmapAtlas(FLevelLocals& doomMap, int lightmapStartIndex); enum PlaneAxis { @@ -103,10 +77,6 @@ private: int AddSurfaceToTile(const DoomLevelMeshSurface& surf, std::map& bindings); int GetSampleDimension(const DoomLevelMeshSurface& surf); - static FVector2 ToFVector2(const DVector2& v) { return FVector2((float)v.X, (float)v.Y); } - static FVector3 ToFVector3(const DVector3& v) { return FVector3((float)v.X, (float)v.Y, (float)v.Z); } - static FVector4 ToFVector4(const DVector4& v) { return FVector4((float)v.X, (float)v.Y, (float)v.Z, (float)v.W); } - DoomLevelMesh* LevelMesh = nullptr; bool StaticMesh = true; };