From bf9233779ae1eb0043b32e16a0114716315e2d45 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 12 Jun 2020 16:19:57 -0400 Subject: [PATCH] CGraphics: Make skDefaultAmbientColor constexpr Same behavior, no runtime initializer. --- src/Core/Render/CGraphics.cpp | 1 - src/Core/Render/CGraphics.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Core/Render/CGraphics.cpp b/src/Core/Render/CGraphics.cpp index cfb250ff..cccccdf8 100644 --- a/src/Core/Render/CGraphics.cpp +++ b/src/Core/Render/CGraphics.cpp @@ -22,7 +22,6 @@ CGraphics::SLightBlock CGraphics::sLightBlock; CGraphics::ELightingMode CGraphics::sLightMode; uint32 CGraphics::sNumLights; -const CColor CGraphics::skDefaultAmbientColor = CColor(0.5f, 0.5f, 0.5f, 0.0f); CColor CGraphics::sAreaAmbientColor = CColor::skTransparentBlack; float CGraphics::sWorldLightMultiplier; CLight CGraphics::sDefaultDirectionalLights[3] = { diff --git a/src/Core/Render/CGraphics.h b/src/Core/Render/CGraphics.h index b2f4ac52..53cf5506 100644 --- a/src/Core/Render/CGraphics.h +++ b/src/Core/Render/CGraphics.h @@ -87,7 +87,7 @@ public: enum class ELightingMode { None, Basic, World }; static ELightingMode sLightMode; static uint32 sNumLights; - static const CColor skDefaultAmbientColor; + static constexpr CColor skDefaultAmbientColor{0.5f, 0.5f, 0.5f, 0.0f}; static CColor sAreaAmbientColor; static float sWorldLightMultiplier; static CLight sDefaultDirectionalLights[3];