From 9e2a8bd693a6b7616ac3cabe27bd936dd2b071d2 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 12 Jun 2020 12:43:07 -0400 Subject: [PATCH] CAnimationLoader: Make use of std::array Prevents implicit array to pointer decay. --- src/Core/Resource/Factory/CAnimationLoader.h | 25 ++++++++++---------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/Core/Resource/Factory/CAnimationLoader.h b/src/Core/Resource/Factory/CAnimationLoader.h index 3a5502ba..736d4162 100644 --- a/src/Core/Resource/Factory/CAnimationLoader.h +++ b/src/Core/Resource/Factory/CAnimationLoader.h @@ -4,36 +4,37 @@ #include "Core/Resource/TResPtr.h" #include "Core/Resource/Animation/CAnimation.h" #include +#include #include class CAnimationLoader { TResPtr mpAnim; - IInputStream *mpInput; - EGame mGame; + IInputStream *mpInput = nullptr; + EGame mGame{}; // Compression data std::vector mKeyFlags; - float mTranslationMultiplier; - uint32 mRotationDivisor; - float mScaleMultiplier; + float mTranslationMultiplier = 0.0f; + uint32 mRotationDivisor = 0; + float mScaleMultiplier = 0.0f; struct SCompressedChannel { uint32 BoneID; uint16 NumRotationKeys; - int16 Rotation[3]; - uint8 RotationBits[3]; + std::array Rotation; + std::array RotationBits; uint16 NumTranslationKeys; - int16 Translation[3]; - uint8 TranslationBits[3]; + std::array Translation; + std::array TranslationBits; uint16 NumScaleKeys; - int16 Scale[3]; - uint8 ScaleBits[3]; + std::array Scale; + std::array ScaleBits; }; std::vector mCompressedChannels; - CAnimationLoader() {} + CAnimationLoader() = default; bool UncompressedCheckEchoes(); EGame UncompressedCheckVersion(); void ReadUncompressedANIM();