diff --git a/hecl/include/hecl/Blender/Connection.hpp b/hecl/include/hecl/Blender/Connection.hpp index 43fa15741..3e86fe2eb 100644 --- a/hecl/include/hecl/Blender/Connection.hpp +++ b/hecl/include/hecl/Blender/Connection.hpp @@ -12,6 +12,7 @@ #include #endif +#include #include #include #include @@ -343,8 +344,8 @@ struct Mesh { struct Vert { uint32_t iPos = 0xffffffff; uint32_t iNorm = 0xffffffff; - uint32_t iColor[4] = {0xffffffff}; - uint32_t iUv[8] = {0xffffffff}; + std::array iColor = {0xffffffff}; + std::array iUv = {0xffffffff}; uint32_t iSkin = 0xffffffff; uint32_t iBankSkin = 0xffffffff; diff --git a/hecl/lib/Blender/Connection.cpp b/hecl/lib/Blender/Connection.cpp index c910746b6..e4dd8a55f 100644 --- a/hecl/lib/Blender/Connection.cpp +++ b/hecl/lib/Blender/Connection.cpp @@ -1,23 +1,25 @@ +#include #include +#include +#include +#include #include #include #include -#include -#include -#include -#include -#include -#include -#include #include +#include +#include +#include +#include #include #include -#include "logvisor/logvisor.hpp" #include "hecl/Blender/Connection.hpp" #include "hecl/SteamFinder.hpp" #include "MeshOptimizer.hpp" +#include + #if _WIN32 #include #include @@ -996,19 +998,8 @@ Material::Material(Connection& conn) { } bool Mesh::Surface::Vert::operator==(const Vert& other) const { - if (iPos != other.iPos) - return false; - if (iNorm != other.iNorm) - return false; - for (int i = 0; i < 4; ++i) - if (iColor[i] != other.iColor[i]) - return false; - for (int i = 0; i < 8; ++i) - if (iUv[i] != other.iUv[i]) - return false; - if (iSkin != other.iSkin) - return false; - return true; + return std::tie(iPos, iNorm, iColor, iUv, iSkin) == + std::tie(other.iPos, other.iNorm, other.iColor, other.iUv, other.iSkin); } static bool VertInBank(const std::vector& bank, uint32_t sIdx) {