Merge branch 'master' into master
commit
3f66b92797
|
@ -87,10 +87,6 @@ ASEImporter::ASEImporter() :
|
||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
// Destructor, private as well
|
|
||||||
ASEImporter::~ASEImporter() = default;
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Returns whether the class can handle the format of the given file.
|
// Returns whether the class can handle the format of the given file.
|
||||||
bool ASEImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool /*checkSig*/) const {
|
bool ASEImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool /*checkSig*/) const {
|
||||||
|
|
|
@ -62,7 +62,7 @@ namespace Assimp {
|
||||||
class ASEImporter : public BaseImporter {
|
class ASEImporter : public BaseImporter {
|
||||||
public:
|
public:
|
||||||
ASEImporter();
|
ASEImporter();
|
||||||
~ASEImporter() override;
|
~ASEImporter() override = default;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Returns whether the class can handle the format of the given file.
|
/** Returns whether the class can handle the format of the given file.
|
||||||
|
|
|
@ -1774,7 +1774,13 @@ void Parser::ParseLV4MeshFace(ASE::Face &out) {
|
||||||
// FIX: There needn't always be a value, sad but true
|
// FIX: There needn't always be a value, sad but true
|
||||||
while (true) {
|
while (true) {
|
||||||
if (*filePtr < '9' && *filePtr >= '0') {
|
if (*filePtr < '9' && *filePtr >= '0') {
|
||||||
|
uint32_t value = strtoul10(filePtr, &filePtr);
|
||||||
|
if (value < 32) {
|
||||||
out.iSmoothGroup |= (1 << strtoul10(filePtr, &filePtr));
|
out.iSmoothGroup |= (1 << strtoul10(filePtr, &filePtr));
|
||||||
|
} else {
|
||||||
|
const std::string message = std::string("Unable to set smooth group, value with ") + ai_to_string(value) + std::string(" out of range");
|
||||||
|
LogWarning(message.c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
SkipSpaces(&filePtr);
|
SkipSpaces(&filePtr);
|
||||||
if (',' != *filePtr) {
|
if (',' != *filePtr) {
|
||||||
|
|
|
@ -4,7 +4,6 @@ Open Asset Import Library (assimp)
|
||||||
|
|
||||||
Copyright (c) 2006-2022, assimp team
|
Copyright (c) 2006-2022, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use of this software in source and binary forms,
|
Redistribution and use of this software in source and binary forms,
|
||||||
|
@ -385,12 +384,10 @@ struct Dummy : public BaseNode {
|
||||||
/** \brief Class to parse ASE files
|
/** \brief Class to parse ASE files
|
||||||
*/
|
*/
|
||||||
class Parser {
|
class Parser {
|
||||||
private:
|
|
||||||
Parser() AI_NO_EXCEPT {
|
|
||||||
// empty
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
/// @brief No default constructor.
|
||||||
|
Parser() = delete;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Construct a parser from a given input file which is
|
//! Construct a parser from a given input file which is
|
||||||
//! guaranteed to be terminated with zero.
|
//! guaranteed to be terminated with zero.
|
||||||
|
|
|
@ -405,6 +405,7 @@ void MDLImporter::InternReadFile_Quake1() {
|
||||||
}
|
}
|
||||||
// go to the end of the skin section / the beginning of the next skin
|
// go to the end of the skin section / the beginning of the next skin
|
||||||
bool overflow = false;
|
bool overflow = false;
|
||||||
|
if (pcHeader->skinwidth != 0 || pcHeader->skinheight != 0) {
|
||||||
if ((pcHeader->skinheight > INT_MAX / pcHeader->skinwidth) || (pcHeader->skinwidth > INT_MAX / pcHeader->skinheight)){
|
if ((pcHeader->skinheight > INT_MAX / pcHeader->skinwidth) || (pcHeader->skinwidth > INT_MAX / pcHeader->skinheight)){
|
||||||
overflow = true;
|
overflow = true;
|
||||||
}
|
}
|
||||||
|
@ -412,6 +413,7 @@ void MDLImporter::InternReadFile_Quake1() {
|
||||||
szCurrent += pcHeader->skinheight * pcHeader->skinwidth +sizeof(float) * iNumImages;
|
szCurrent += pcHeader->skinheight * pcHeader->skinwidth +sizeof(float) * iNumImages;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
szCurrent += sizeof(uint32_t);
|
szCurrent += sizeof(uint32_t);
|
||||||
unsigned int iSkip = i ? UINT_MAX : 0;
|
unsigned int iSkip = i ? UINT_MAX : 0;
|
||||||
|
|
|
@ -120,7 +120,11 @@ TEST_F(AssimpAPITest_aiQuaternion, aiQuaternionMultiplyTest) {
|
||||||
result_c = result_cpp = random_quat();
|
result_c = result_cpp = random_quat();
|
||||||
result_cpp = result_cpp * temp;
|
result_cpp = result_cpp * temp;
|
||||||
aiQuaternionMultiply(&result_c, &temp);
|
aiQuaternionMultiply(&result_c, &temp);
|
||||||
EXPECT_EQ(result_cpp, result_c);
|
|
||||||
|
EXPECT_FLOAT_EQ(result_cpp.x, result_c.x);
|
||||||
|
EXPECT_FLOAT_EQ(result_cpp.y, result_c.y);
|
||||||
|
EXPECT_FLOAT_EQ(result_cpp.z, result_c.z);
|
||||||
|
EXPECT_FLOAT_EQ(result_cpp.w, result_c.w);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(AssimpAPITest_aiQuaternion, aiQuaternionInterpolateTest) {
|
TEST_F(AssimpAPITest_aiQuaternion, aiQuaternionInterpolateTest) {
|
||||||
|
@ -131,5 +135,9 @@ TEST_F(AssimpAPITest_aiQuaternion, aiQuaternionInterpolateTest) {
|
||||||
const auto q2 = aiQuaternion(aiVector3D(1,2,1).Normalize(), Math::aiPi<float>() / 2.0f);
|
const auto q2 = aiQuaternion(aiVector3D(1,2,1).Normalize(), Math::aiPi<float>() / 2.0f);
|
||||||
aiQuaternion::Interpolate(result_cpp, q1, q2, INTERPOLATION);
|
aiQuaternion::Interpolate(result_cpp, q1, q2, INTERPOLATION);
|
||||||
aiQuaternionInterpolate(&result_c, &q1, &q2, INTERPOLATION);
|
aiQuaternionInterpolate(&result_c, &q1, &q2, INTERPOLATION);
|
||||||
EXPECT_EQ(result_cpp, result_c);
|
|
||||||
|
EXPECT_FLOAT_EQ(result_cpp.x, result_c.x);
|
||||||
|
EXPECT_FLOAT_EQ(result_cpp.y, result_c.y);
|
||||||
|
EXPECT_FLOAT_EQ(result_cpp.z, result_c.z);
|
||||||
|
EXPECT_FLOAT_EQ(result_cpp.w, result_c.w);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue