CAnimation: Make use of in-class initializers where applicable

Simplifies member initialization
This commit is contained in:
Lioncash 2020-06-09 04:16:10 -04:00
parent 0096b28294
commit d4d7cf66cd
2 changed files with 6 additions and 15 deletions

View File

@ -6,16 +6,7 @@
CAnimation::CAnimation(CResourceEntry *pEntry /*= 0*/)
: CResource(pEntry)
, mDuration(0.f)
, mTickInterval(0.0333333f)
, mNumKeys(0)
{
for (uint32 iBone = 0; iBone < 100; iBone++)
{
mBoneInfo[iBone].TranslationChannelIdx = 0xFF;
mBoneInfo[iBone].RotationChannelIdx = 0xFF;
mBoneInfo[iBone].ScaleChannelIdx = 0xFF;
}
}
CDependencyTree* CAnimation::BuildDependencyTree() const

View File

@ -17,9 +17,9 @@ class CAnimation : public CResource
typedef std::vector<CQuaternion> TRotationChannel;
typedef std::vector<CVector3f> TTranslationChannel;
float mDuration;
float mTickInterval;
uint32 mNumKeys;
float mDuration = 0.0f;
float mTickInterval = 0.0333333f;
uint32 mNumKeys = 0;
std::vector<TScaleChannel> mScaleChannels;
std::vector<TRotationChannel> mRotationChannels;
@ -27,9 +27,9 @@ class CAnimation : public CResource
struct SBoneChannelInfo
{
uint8 ScaleChannelIdx;
uint8 RotationChannelIdx;
uint8 TranslationChannelIdx;
uint8 ScaleChannelIdx = 0xFF;
uint8 RotationChannelIdx = 0xFF;
uint8 TranslationChannelIdx = 0xFF;
};
SBoneChannelInfo mBoneInfo[100];