Use correct XmlParser-methods and add some missing casts

pull/4253/head
Kim Kulling 2021-12-13 18:06:23 +01:00
parent 052594568a
commit cb657e4c13
5 changed files with 7 additions and 4 deletions

View File

@ -879,7 +879,7 @@ void X3DImporter::readSphere(XmlNode &node) {
X3DNodeElementBase *ne(nullptr);
MACRO_ATTRREAD_CHECKUSEDEF_RET(node, def, use);
XmlParser::getFloatAttribute(node, "radius", radius);
XmlParser::getRealAttribute(node, "radius", radius);
XmlParser::getBoolAttribute(node, "solid", solid);
// if "USE" defined then find already defined element.

View File

@ -1410,7 +1410,7 @@ void glTF2Exporter::ExportMetadata() {
}
}
inline Ref<Accessor> GetSamplerInputRef(Asset &asset, std::string &animId, Ref<Buffer> &buffer, std::vector<float> &times) {
inline Ref<Accessor> GetSamplerInputRef(Asset &asset, std::string &animId, Ref<Buffer> &buffer, std::vector<ai_real> &times) {
return ExportData(asset, animId, buffer, (unsigned int)times.size(), &times[0], AttribType::SCALAR, AttribType::SCALAR, ComponentType_FLOAT);
}

View File

@ -66,7 +66,9 @@ class Ref;
}
namespace glTF2 {
class Asset;
struct TexProperty;
struct TextureInfo;
struct NormalTextureInfo;
@ -84,6 +86,7 @@ struct MaterialIOR;
typedef float(vec2)[2];
typedef float(vec3)[3];
typedef float(vec4)[4];
} // namespace glTF2
namespace Assimp {

View File

@ -105,7 +105,7 @@ aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
return AI_FAILURE;
}
iNum = std::min((size_t)iNum,prop->mDataLength / sizeof(Type));
iNum = (unsigned int)std::min((size_t)iNum,prop->mDataLength / sizeof(Type));
::memcpy(pOut,prop->mData,iNum * sizeof(Type));
if (pMax) {
*pMax = iNum;

View File

@ -73,7 +73,7 @@ TEST_F(MaterialSystemTest, testFloatArrayProperty) {
pf[0] = pf[1] = pf[2] = pf[3] = 12.0f;
EXPECT_EQ(AI_SUCCESS, pcMat->Get("testKey2", 0, 0, pf, &pMax));
EXPECT_EQ(sizeof(pf) / sizeof(float), pMax);
EXPECT_EQ(sizeof(pf) / sizeof(float), static_cast<size_t>(pMax));
EXPECT_TRUE(!pf[0] && 1.0f == pf[1] && 2.0f == pf[2] && 3.0f == pf[3]);
}