- use in-class initialization for FLightDefaults to avoid uninitialized variables in the future.

This commit is contained in:
Christoph Oelckers 2017-04-13 12:50:43 +02:00
parent cced9e014b
commit 522ce59be2

View file

@ -140,12 +140,16 @@ public:
protected:
FName m_Name;
int m_Args[5];
double m_Param;
DVector3 m_Pos;
int m_Args[5] = { 0,0,0,0,0 };
double m_Param = 0;
DVector3 m_Pos = { 0,0,0 };
ELightType m_type;
int8_t m_attenuate;
bool m_subtractive, m_additive, m_halo, m_dontlightself, m_dontlightactors;
int8_t m_attenuate = -1;
bool m_subtractive = false;
bool m_additive = false;
bool m_halo = false;
bool m_dontlightself = false;
bool m_dontlightactors = false;
bool m_swapped = false;
};
@ -161,17 +165,6 @@ FLightDefaults::FLightDefaults(FName name, ELightType type)
{
m_Name = name;
m_type = type;
m_Pos.Zero();
memset(m_Args, 0, sizeof(m_Args));
m_Param = 0;
m_subtractive = false;
m_additive = false;
m_halo = false;
m_dontlightself = false;
m_dontlightactors = false;
m_attenuate = -1;
}
void FLightDefaults::ApplyProperties(ADynamicLight * light) const