CAnimationLoader: Make use of std::array

Prevents implicit array to pointer decay.
This commit is contained in:
Lioncash 2020-06-12 12:43:07 -04:00
parent 12ccb2fbd4
commit 9e2a8bd693
1 changed files with 13 additions and 12 deletions

View File

@ -4,36 +4,37 @@
#include "Core/Resource/TResPtr.h"
#include "Core/Resource/Animation/CAnimation.h"
#include <Common/EGame.h>
#include <array>
#include <memory>
class CAnimationLoader
{
TResPtr<CAnimation> mpAnim;
IInputStream *mpInput;
EGame mGame;
IInputStream *mpInput = nullptr;
EGame mGame{};
// Compression data
std::vector<bool> 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<int16, 3> Rotation;
std::array<uint8, 3> RotationBits;
uint16 NumTranslationKeys;
int16 Translation[3];
uint8 TranslationBits[3];
std::array<int16, 3> Translation;
std::array<uint8, 3> TranslationBits;
uint16 NumScaleKeys;
int16 Scale[3];
uint8 ScaleBits[3];
std::array<int16, 3> Scale;
std::array<uint8, 3> ScaleBits;
};
std::vector<SCompressedChannel> mCompressedChannels;
CAnimationLoader() {}
CAnimationLoader() = default;
bool UncompressedCheckEchoes();
EGame UncompressedCheckVersion();
void ReadUncompressedANIM();