pull/3708/head
Urs Hanselmann 2021-03-17 18:26:11 +01:00
commit d9cd07f0d9
6 changed files with 18 additions and 6 deletions

View File

@ -116,7 +116,7 @@ public:
Mask = 0xf, Mask = 0xf,
}; };
inline const uint8_t GetType() const { return (flags & Mask); } inline uint8_t GetType() const { return (flags & Mask); }
}; };
// Represents an AC3D object // Represents an AC3D object

View File

@ -122,7 +122,7 @@ void RemoveUVSeams (aiMesh* mesh, aiVector3D* out)
const aiFace& face = mesh->mFaces[fidx]; const aiFace& face = mesh->mFaces[fidx];
if (face.mNumIndices < 3) continue; // triangles and polygons only, please if (face.mNumIndices < 3) continue; // triangles and polygons only, please
unsigned int small = face.mNumIndices, large = small; unsigned int smallV = face.mNumIndices, large = smallV;
bool zero = false, one = false, round_to_zero = false; bool zero = false, one = false, round_to_zero = false;
// Check whether this face lies on a UV seam. We can just guess, // Check whether this face lies on a UV seam. We can just guess,
@ -133,7 +133,7 @@ void RemoveUVSeams (aiMesh* mesh, aiVector3D* out)
{ {
if (out[face.mIndices[n]].x < LOWER_LIMIT) if (out[face.mIndices[n]].x < LOWER_LIMIT)
{ {
small = n; smallV = n;
// If we have a U value very close to 0 we can't // If we have a U value very close to 0 we can't
// round the others to 0, too. // round the others to 0, too.
@ -151,7 +151,7 @@ void RemoveUVSeams (aiMesh* mesh, aiVector3D* out)
one = true; one = true;
} }
} }
if (small != face.mNumIndices && large != face.mNumIndices) if (smallV != face.mNumIndices && large != face.mNumIndices)
{ {
for (unsigned int n = 0; n < face.mNumIndices;++n) for (unsigned int n = 0; n < face.mNumIndices;++n)
{ {

View File

@ -1,4 +1,4 @@
// Copyright 2005, Google Inc. // Copyright 2005, Google Inc.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without

View File

@ -21,6 +21,10 @@
NOCRYPT and NOUNCRYPT. NOCRYPT and NOUNCRYPT.
*/ */
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
#define MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS 0
#endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h> #include <stdint.h>

View File

@ -75,6 +75,10 @@ public:
template<typename... T> template<typename... T>
explicit DeadlyImportError(T&&... args) : explicit DeadlyImportError(T&&... args) :
DeadlyErrorBase(Assimp::Formatter::format(), std::forward<T>(args)...) {} DeadlyErrorBase(Assimp::Formatter::format(), std::forward<T>(args)...) {}
#if defined(_MSC_VER) && defined(__clang__)
DeadlyImportError(DeadlyImportError& other) = delete;
#endif
}; };
class ASSIMP_API DeadlyExportError : public DeadlyErrorBase { class ASSIMP_API DeadlyExportError : public DeadlyErrorBase {
@ -83,6 +87,10 @@ public:
template<typename... T> template<typename... T>
explicit DeadlyExportError(T&&... args) : explicit DeadlyExportError(T&&... args) :
DeadlyErrorBase(Assimp::Formatter::format(), std::forward<T>(args)...) {} DeadlyErrorBase(Assimp::Formatter::format(), std::forward<T>(args)...) {}
#if defined(_MSC_VER) && defined(__clang__)
DeadlyExportError(DeadlyExportError& other) = delete;
#endif
}; };
#ifdef _MSC_VER #ifdef _MSC_VER

View File

@ -351,7 +351,7 @@ struct aiMetadata {
*static_cast<T *>(mValues[index].mData) = value; *static_cast<T *>(mValues[index].mData) = value;
} else { } else {
if (nullptr != mValues[index].mData) { if (nullptr != mValues[index].mData) {
delete mValues[index].mData; delete static_cast<T *>(mValues[index].mData);
mValues[index].mData = nullptr; mValues[index].mData = nullptr;
} }
mValues[index].mData = new T(value); mValues[index].mData = new T(value);