From 41c2ede0922e5638f8ff3d8bd1f9c92afc22b867 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 6 Apr 2020 05:42:13 -0400 Subject: [PATCH] CScriptWater: Make private const data internally linked Same behavior, but allows completely hiding it from external view and also allows making the data constexpr. --- Runtime/World/CScriptWater.cpp | 7 +++++-- Runtime/World/CScriptWater.hpp | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Runtime/World/CScriptWater.cpp b/Runtime/World/CScriptWater.cpp index a76e87b9c..14a7e74a3 100644 --- a/Runtime/World/CScriptWater.cpp +++ b/Runtime/World/CScriptWater.cpp @@ -1,5 +1,7 @@ #include "Runtime/World/CScriptWater.hpp" +#include + #include "Runtime/CSimplePool.hpp" #include "Runtime/CStateManager.hpp" #include "Runtime/GameGlobalObjects.hpp" @@ -11,8 +13,9 @@ #include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { - -const float CScriptWater::kSplashScales[6] = {1.0f, 3.0f, 0.709f, 1.19f, 0.709f, 1.f}; +constexpr std::array kSplashScales{ + 1.0f, 3.0f, 0.709f, 1.19f, 0.709f, 1.f, +}; CScriptWater::CScriptWater( CStateManager& mgr, TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CVector3f& pos, diff --git a/Runtime/World/CScriptWater.hpp b/Runtime/World/CScriptWater.hpp index 938c2be12..d13e2f12a 100644 --- a/Runtime/World/CScriptWater.hpp +++ b/Runtime/World/CScriptWater.hpp @@ -20,7 +20,6 @@ class CDamageInfo; class CFluidUVMotion; class CScriptWater : public CScriptTrigger { - static const float kSplashScales[6]; zeus::CFrustum x150_frustum; std::unique_ptr x1b4_fluidPlane; zeus::CVector3f x1b8_positionMorphed;