diff --git a/src/Core/Resource/Factory/CMaterialLoader.cpp b/src/Core/Resource/Factory/CMaterialLoader.cpp index c230ff22..f587afd7 100644 --- a/src/Core/Resource/Factory/CMaterialLoader.cpp +++ b/src/Core/Resource/Factory/CMaterialLoader.cpp @@ -5,14 +5,9 @@ #include #include -CMaterialLoader::CMaterialLoader() - : mCorruptionFlags(0) -{ -} +CMaterialLoader::CMaterialLoader() = default; -CMaterialLoader::~CMaterialLoader() -{ -} +CMaterialLoader::~CMaterialLoader() = default; FVertexDescription CMaterialLoader::ConvertToVertexDescription(uint32 VertexFlags) { diff --git a/src/Core/Resource/Factory/CMaterialLoader.h b/src/Core/Resource/Factory/CMaterialLoader.h index a51a104c..5fcf57a0 100644 --- a/src/Core/Resource/Factory/CMaterialLoader.h +++ b/src/Core/Resource/Factory/CMaterialLoader.h @@ -8,6 +8,7 @@ #include #include +#include #include enum class EMP3RenderConfig @@ -83,7 +84,7 @@ struct SMP3IntermediateMaterial EUVAnimMatrixConfig mMtxConfig = EUVAnimMatrixConfig::NoMtxNoPost; EUVAnimMode mAnimMode = EUVAnimMode::NoUVAnim; EUVConvolutedModeBType mAnimConvolutedModeBType; - float mAnimParams[8]; + std::array mAnimParams; char GetSwapAlphaComp() const { @@ -96,14 +97,14 @@ struct SMP3IntermediateMaterial } } }; - std::optional mPASSes[14]; - const std::optional& GetPASS(EPASS pass) const { return mPASSes[int(pass)]; } + std::array, 14> mPASSes; + const std::optional& GetPASS(EPASS pass) const { return mPASSes[static_cast(pass)]; } - uint8 mINTs[5] = {255, 255, 0, 32, 255}; - uint8 GetINT(EINT eint) const { return mINTs[int(eint)]; } + std::array mINTs{255, 255, 0, 32, 255}; + uint8 GetINT(EINT eint) const { return mINTs[static_cast(eint)]; } - CColor mCLRs[2] = {CColor::skWhite, CColor::skWhite}; - const CColor& GetCLR(ECLR clr) const { return mCLRs[int(clr)]; } + std::array mCLRs{CColor::skWhite, CColor::skWhite}; + const CColor& GetCLR(ECLR clr) const { return mCLRs[static_cast(clr)]; } }; struct STevTracker @@ -116,14 +117,14 @@ struct STevTracker class CMaterialLoader { // Material data - CMaterialSet *mpSet; - IInputStream *mpFile; - EGame mVersion; + CMaterialSet *mpSet = nullptr; + IInputStream *mpFile = nullptr; + EGame mVersion{}; std::vector> mTextures; - CColor mCorruptionColors[4]; - uint8 mCorruptionInts[5]; - uint32 mCorruptionFlags; + std::array mCorruptionColors; + std::array mCorruptionInts{}; + uint32 mCorruptionFlags = 0; CMaterialLoader(); ~CMaterialLoader();