From 4f7f5cf09a21906e1f2213ea9879ff0c0b453e43 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 6 Mar 2020 01:13:41 -0500 Subject: [PATCH] CBooRenderer: Make Buckets class mostly internal This is only ever functionally used within this translation unit, so we can hide the class internally. --- Runtime/Graphics/CBooRenderer.cpp | 28 +++++++++++++++++++++------- Runtime/Graphics/CBooRenderer.hpp | 22 +--------------------- 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/Runtime/Graphics/CBooRenderer.cpp b/Runtime/Graphics/CBooRenderer.cpp index 18b476213..f7955fff0 100644 --- a/Runtime/Graphics/CBooRenderer.cpp +++ b/Runtime/Graphics/CBooRenderer.cpp @@ -35,13 +35,27 @@ static rstl::reserved_vector, 50> sBucket static rstl::reserved_vector sPlaneObjectDataHolder; static rstl::reserved_vector sPlaneObjectBucketHolder; -rstl::reserved_vector Buckets::sBucketIndex; -rstl::reserved_vector* Buckets::sData = nullptr; -rstl::reserved_vector, 50>* Buckets::sBuckets = nullptr; -rstl::reserved_vector* Buckets::sPlaneObjectData = nullptr; -rstl::reserved_vector* Buckets::sPlaneObjectBucket = nullptr; -const float Buckets::skWorstMinMaxDistance[2] = {99999.f, -99999.f}; -float Buckets::sMinMaxDistance[2]; +class Buckets { + friend class CBooRenderer; + + static inline rstl::reserved_vector sBucketIndex; + static inline rstl::reserved_vector* sData = nullptr; + static inline rstl::reserved_vector, 50>* sBuckets = nullptr; + static inline rstl::reserved_vector* sPlaneObjectData = nullptr; + static inline rstl::reserved_vector* sPlaneObjectBucket = nullptr; + static constexpr float skWorstMinMaxDistance[2] = {99999.0f, -99999.0f}; + static inline float sMinMaxDistance[2] = {0.0f, 0.0f}; + +public: + static void Clear(); + static void Sort(); + static void InsertPlaneObject(float closeDist, float farDist, const zeus::CAABox& aabb, bool invertTest, + const zeus::CPlane& plane, bool zOnly, EDrawableType dtype, const void* data); + static void Insert(const zeus::CVector3f& pos, const zeus::CAABox& aabb, EDrawableType dtype, const void* data, + const zeus::CPlane& plane, u16 extraSort); + static void Shutdown(); + static void Init(); +}; void Buckets::Clear() { sData->clear(); diff --git a/Runtime/Graphics/CBooRenderer.hpp b/Runtime/Graphics/CBooRenderer.hpp index 757680262..435e39014 100644 --- a/Runtime/Graphics/CBooRenderer.hpp +++ b/Runtime/Graphics/CBooRenderer.hpp @@ -38,27 +38,7 @@ class CTexture; class IFactory; class IObjectStore; -class Buckets { - friend class CBooRenderer; - - static rstl::reserved_vector sBucketIndex; - static rstl::reserved_vector* sData; - static rstl::reserved_vector, 50>* sBuckets; - static rstl::reserved_vector* sPlaneObjectData; - static rstl::reserved_vector* sPlaneObjectBucket; - static const float skWorstMinMaxDistance[2]; - static float sMinMaxDistance[2]; - -public: - static void Clear(); - static void Sort(); - static void InsertPlaneObject(float closeDist, float farDist, const zeus::CAABox& aabb, bool invertTest, - const zeus::CPlane& plane, bool zOnly, EDrawableType dtype, const void* data); - static void Insert(const zeus::CVector3f& pos, const zeus::CAABox& aabb, EDrawableType dtype, const void* data, - const zeus::CPlane& plane, u16 extraSort); - static void Shutdown(); - static void Init(); -}; +class Buckets; enum class EWorldShadowMode { None,