CLightParameters: Make EWorldLightingOptions an enum class

Avoids polluting the global namespace.
This commit is contained in:
Lioncash 2020-06-14 19:21:27 -04:00
parent cec88d182b
commit 2c274897c9
2 changed files with 8 additions and 8 deletions

View File

@ -4,12 +4,12 @@
#include "Core/Resource/Area/CGameArea.h" #include "Core/Resource/Area/CGameArea.h"
#include "Core/Resource/Script/Property/Properties.h" #include "Core/Resource/Script/Property/Properties.h"
enum EWorldLightingOptions enum class EWorldLightingOptions
{ {
eUnknown1 = 0, Unknown1,
eNormalLighting = 1, NormalLighting,
eUnknown2 = 2, Unknown2,
eDisableWorldLighting = 3 DisableWorldLighting,
}; };
class CLightParameters class CLightParameters
@ -42,7 +42,7 @@ public:
EWorldLightingOptions WorldLightingOptions() const EWorldLightingOptions WorldLightingOptions() const
{ {
return mWorldLightingOptions.IsValid() ? mWorldLightingOptions.Get() : eNormalLighting; return mWorldLightingOptions.IsValid() ? mWorldLightingOptions.Get() : EWorldLightingOptions::NormalLighting;
} }
}; };

View File

@ -171,9 +171,9 @@ void CScriptNode::Draw(FRenderOptions Options, int /*ComponentIndex*/, ERenderCo
// Draw model // Draw model
if (UsesModel()) if (UsesModel())
{ {
EWorldLightingOptions LightingOptions = (mpLightParameters ? mpLightParameters->WorldLightingOptions() : eNormalLighting); const auto LightingOptions = (mpLightParameters ? mpLightParameters->WorldLightingOptions() : EWorldLightingOptions::NormalLighting);
if (CGraphics::sLightMode == CGraphics::ELightingMode::World && LightingOptions == eDisableWorldLighting) if (CGraphics::sLightMode == CGraphics::ELightingMode::World && LightingOptions == EWorldLightingOptions::DisableWorldLighting)
{ {
CGraphics::sNumLights = 0; CGraphics::sNumLights = 0;
CGraphics::sVertexBlock.COLOR0_Amb = CColor::skTransparentBlack; CGraphics::sVertexBlock.COLOR0_Amb = CColor::skTransparentBlack;