CLightParameters: Make EWorldLightingOptions an enum class
Avoids polluting the global namespace.
This commit is contained in:
parent
cec88d182b
commit
2c274897c9
|
@ -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;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue