Compare commits
22 Commits
master
...
kimkulling
Author | SHA1 | Date |
---|---|---|
Kim Kulling | 65672a02b8 | |
Kim Kulling | 3036de89d3 | |
Kim Kulling | 26df0b50e5 | |
Kim Kulling | 8bd943abc6 | |
Kim Kulling | 3a39648358 | |
Kim Kulling | 7c81fa89e7 | |
Kim Kulling | b65e84d759 | |
Kim Kulling | 709a8f2f79 | |
Kim Kulling | f499d947ff | |
Kim Kulling | 718c517dcd | |
Kim Kulling | 2beab55a4e | |
Kim Kulling | a53bca85cb | |
Kim Kulling | 200e34f0ca | |
Kim Kulling | f8b3023db3 | |
Kim Kulling | 0142bc35f7 | |
Kim Kulling | c740977594 | |
Kim Kulling | 1587c61ee7 | |
Kim Kulling | ecd144b63e | |
Kim Kulling | efc046752c | |
Kim Kulling | b2437e5b59 | |
Kim Kulling | af31856221 | |
Kim Kulling | a5d661e303 |
|
@ -16,9 +16,13 @@ jobs:
|
|||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
name: [ubuntu-latest-g++, macos-latest-clang++, windows-latest-cl.exe, ubuntu-latest-clang++]
|
||||
name: [ubuntu-latest-g++, macos-latest-clang++, windows-latest-cl.exe, windows-latest-clang.exe, ubuntu-latest-clang++]
|
||||
# For Windows msvc, for Linux and macOS let's use the clang compiler, use gcc for Linux.
|
||||
include:
|
||||
- name: windows-latest-clang.exe
|
||||
os: windows-latest
|
||||
cxx: clang++.exe
|
||||
cc: clang.exe
|
||||
- name: windows-latest-cl.exe
|
||||
os: windows-latest
|
||||
cxx: cl.exe
|
||||
|
@ -65,13 +69,13 @@ jobs:
|
|||
${{ runner.os }}-DX_SDK
|
||||
|
||||
- name: Download DXSetup
|
||||
if: contains(matrix.name, 'windows') && steps.dxcache.outputs.cache-hit != 'true'
|
||||
if: contains(matrix.name, 'windows-latest-cl.exe') && steps.dxcache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
curl -s -o DXSDK_Jun10.exe --location https://download.microsoft.com/download/A/E/7/AE743F1F-632B-4809-87A9-AA1BB3458E31/DXSDK_Jun10.exe
|
||||
cmd.exe /c start /wait .\DXSDK_Jun10.exe /U /O /F /S /P "${{ github.workspace }}\DX_SDK"
|
||||
|
||||
- name: Set Windows specific CMake arguments
|
||||
if: contains(matrix.name, 'windows')
|
||||
if: contains(matrix.name, 'windows-latest-cl.exe')
|
||||
id: windows_extra_cmake_args
|
||||
run: echo ":set-output name=args::=-DASSIMP_BUILD_ASSIMP_TOOLS=1 -DASSIMP_BUILD_ASSIMP_VIEW=1" >> $GITHUB_OUTPUT
|
||||
|
||||
|
|
|
@ -312,8 +312,6 @@ void FBXConverter::ConvertNodes(uint64_t id, aiNode *parent, aiNode *root_node)
|
|||
|
||||
child->mParent = last_parent;
|
||||
last_parent = child.mNode;
|
||||
|
||||
new_abs_transform *= child->mTransformation;
|
||||
}
|
||||
|
||||
// attach geometry
|
||||
|
@ -336,8 +334,6 @@ void FBXConverter::ConvertNodes(uint64_t id, aiNode *parent, aiNode *root_node)
|
|||
|
||||
postnode->mParent = last_parent;
|
||||
last_parent = postnode.mNode;
|
||||
|
||||
new_abs_transform *= postnode->mTransformation;
|
||||
}
|
||||
} else {
|
||||
// free the nodes we allocated as we don't need them
|
||||
|
|
|
@ -78,15 +78,7 @@ static constexpr aiImporterDesc desc = {
|
|||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Recursive parsing of LWS files
|
||||
namespace {
|
||||
constexpr int MAX_DEPTH = 1000; // Define the maximum depth allowed
|
||||
}
|
||||
|
||||
void LWS::Element::Parse(const char *&buffer, const char *end, int depth) {
|
||||
if (depth > MAX_DEPTH) {
|
||||
throw std::runtime_error("Maximum recursion depth exceeded in LWS::Element::Parse");
|
||||
}
|
||||
|
||||
void LWS::Element::Parse(const char *&buffer, const char *end) {
|
||||
for (; SkipSpacesAndLineEnd(&buffer, end); SkipLine(&buffer, end)) {
|
||||
|
||||
// begin of a new element with children
|
||||
|
@ -129,7 +121,7 @@ void LWS::Element::Parse(const char *&buffer, const char *end, int depth) {
|
|||
|
||||
// parse more elements recursively
|
||||
if (sub) {
|
||||
children.back().Parse(buffer, end, depth + 1);
|
||||
children.back().Parse(buffer, end);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ public:
|
|||
std::list<Element> children;
|
||||
|
||||
//! Recursive parsing function
|
||||
void Parse(const char *&buffer, const char *end, int depth = 0);
|
||||
void Parse(const char *&buffer, const char *end);
|
||||
};
|
||||
|
||||
#define AI_LWS_MASK (0xffffffff >> 4u)
|
||||
|
|
|
@ -724,7 +724,6 @@ void MD3Importer::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
|
|||
std::vector<unsigned char> mBuffer2(fileSize);
|
||||
file->Read(&mBuffer2[0], 1, fileSize);
|
||||
mBuffer = &mBuffer2[0];
|
||||
const unsigned char* bufferEnd = mBuffer + fileSize;
|
||||
|
||||
pcHeader = (BE_NCONST MD3::Header *)mBuffer;
|
||||
|
||||
|
@ -750,15 +749,9 @@ void MD3Importer::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
|
|||
|
||||
// Navigate to the list of surfaces
|
||||
BE_NCONST MD3::Surface *pcSurfaces = (BE_NCONST MD3::Surface *)(mBuffer + pcHeader->OFS_SURFACES);
|
||||
if ((const unsigned char*)pcSurfaces + sizeof(MD3::Surface) * pcHeader->NUM_SURFACES > bufferEnd) {
|
||||
throw DeadlyImportError("MD3 surface headers are outside the file");
|
||||
}
|
||||
|
||||
// Navigate to the list of tags
|
||||
BE_NCONST MD3::Tag *pcTags = (BE_NCONST MD3::Tag *)(mBuffer + pcHeader->OFS_TAGS);
|
||||
if ((const unsigned char*)pcTags + sizeof(MD3::Tag) * pcHeader->NUM_TAGS > bufferEnd) {
|
||||
throw DeadlyImportError("MD3 tags are outside the file");
|
||||
}
|
||||
|
||||
// Allocate output storage
|
||||
pScene->mNumMeshes = pcHeader->NUM_SURFACES;
|
||||
|
@ -1033,10 +1026,6 @@ void MD3Importer::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
|
|||
|
||||
for (unsigned int i = 0; i < pcHeader->NUM_TAGS; ++i, ++pcTags) {
|
||||
aiNode *nd = pScene->mRootNode->mChildren[i] = new aiNode();
|
||||
if ((const unsigned char*)pcTags + sizeof(MD3::Tag) > bufferEnd) {
|
||||
throw DeadlyImportError("MD3 tag is outside the file");
|
||||
}
|
||||
|
||||
nd->mName.Set((const char *)pcTags->NAME);
|
||||
nd->mParent = pScene->mRootNode;
|
||||
|
||||
|
|
|
@ -1346,7 +1346,6 @@ add_compile_options(
|
|||
IF (ASSIMP_WARNINGS_AS_ERRORS)
|
||||
MESSAGE(STATUS "Treating all warnings as errors (for assimp library only)")
|
||||
IF (MSVC)
|
||||
|
||||
IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) # clang-cl
|
||||
TARGET_COMPILE_OPTIONS(assimp PRIVATE -Wall -Werror
|
||||
-Wno-microsoft-enum-value
|
||||
|
@ -1397,6 +1396,7 @@ IF (ASSIMP_WARNINGS_AS_ERRORS)
|
|||
-Wno-undefined-func-template
|
||||
-Wno-declaration-after-statement
|
||||
-Wno-deprecated-declarations
|
||||
-Wno-deprecated-non-prototype
|
||||
)
|
||||
ELSE()
|
||||
TARGET_COMPILE_OPTIONS(assimp PRIVATE /W4 /WX)
|
||||
|
|
|
@ -848,7 +848,11 @@ const aiScene* Importer::ApplyPostProcessing(unsigned int pFlags) {
|
|||
break;
|
||||
}
|
||||
#ifdef ASSIMP_BUILD_DEBUG
|
||||
#ifndef ASSIMP_BUILD_NO_VALIDATEDS_PROCESS
|
||||
|
||||
#ifdef ASSIMP_BUILD_NO_VALIDATEDS_PROCESS
|
||||
continue;
|
||||
#endif // no validation
|
||||
|
||||
// If the extra verbose mode is active, execute the ValidateDataStructureStep again - after each step
|
||||
if (pimpl->bExtraVerbose) {
|
||||
ASSIMP_LOG_DEBUG("Verbose Import: re-validating data structures");
|
||||
|
@ -860,7 +864,6 @@ const aiScene* Importer::ApplyPostProcessing(unsigned int pFlags) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
#endif // no validation
|
||||
#endif // ! DEBUG
|
||||
}
|
||||
pimpl->mProgressHandler->UpdatePostProcess( static_cast<int>(pimpl->mPostProcessingSteps.size()),
|
||||
|
@ -936,7 +939,6 @@ const aiScene* Importer::ApplyCustomizedPostProcessing( BaseProcess *rootProcess
|
|||
profiler->EndRegion( "postprocess" );
|
||||
}
|
||||
|
||||
#ifndef ASSIMP_BUILD_NO_VALIDATEDS_PROCESS
|
||||
// If the extra verbose mode is active, execute the ValidateDataStructureStep again - after each step
|
||||
if ( pimpl->bExtraVerbose || requestValidation ) {
|
||||
ASSIMP_LOG_DEBUG( "Verbose Import: revalidating data structures" );
|
||||
|
@ -947,7 +949,6 @@ const aiScene* Importer::ApplyCustomizedPostProcessing( BaseProcess *rootProcess
|
|||
ASSIMP_LOG_ERROR( "Verbose Import: failed to revalidate data structures" );
|
||||
}
|
||||
}
|
||||
#endif // no validation
|
||||
|
||||
// clear any data allocated by post-process steps
|
||||
pimpl->mPPShared->Clean();
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(_WIN32)
|
||||
# pragma warning( disable: 4273)
|
||||
# define P2T_COMPILER_DLLEXPORT __declspec(dllexport)
|
||||
# define P2T_COMPILER_DLLIMPORT __declspec(dllimport)
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
|
||||
#include "gzguts.h"
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-non-prototype"
|
||||
|
||||
/* gzclose() is in a separate file so that it is linked in only if it is used.
|
||||
That way the other gzclose functions can be used instead to avoid linking in
|
||||
unneeded compression or decompression routines. */
|
||||
|
@ -23,3 +26,6 @@ int ZEXPORT gzclose(file)
|
|||
return gzclose_r(file);
|
||||
#endif
|
||||
}
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
|
|
|
@ -23,6 +23,8 @@ z_const char * const z_errmsg[10] = {
|
|||
(z_const char *)""
|
||||
};
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-non-prototype"
|
||||
|
||||
const char * ZEXPORT zlibVersion()
|
||||
{
|
||||
|
@ -321,6 +323,7 @@ void ZLIB_INTERNAL zcfree(opaque, ptr)
|
|||
(void)opaque;
|
||||
free(ptr);
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
#endif /* MY_ZCALLOC */
|
||||
|
||||
|
|
|
@ -701,7 +701,7 @@ struct aiMaterialProperty {
|
|||
* Material data is stored using a key-value structure. A single key-value
|
||||
* pair is called a 'material property'. C++ users should use the provided
|
||||
* member functions of aiMaterial to process material properties, C users
|
||||
* have to stick with the aiGetMaterialXXX family of unbound functions.
|
||||
* have to stick with the aiMaterialGetXXX family of unbound functions.
|
||||
* The library defines a set of standard keys (AI_MATKEY_XXX).
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2020, assimp team
|
||||
Copyright (c) 2006-2024, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
@ -45,32 +45,34 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include <gtest/gtest.h>
|
||||
|
||||
#if defined(_MSC_VER) || defined(__MINGW64__) || defined(__MINGW32__)
|
||||
#define TMP_PATH "./"
|
||||
# define TMP_PATH "./"
|
||||
#elif defined(__GNUC__) || defined(__clang__)
|
||||
#define TMP_PATH "/tmp/"
|
||||
# define TMP_PATH "/tmp/"
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# ifndef _CRT_SECURE_NO_WARNINGS
|
||||
# define _CRT_SECURE_NO_WARNINGS
|
||||
# endif
|
||||
#include <io.h>
|
||||
inline FILE* MakeTmpFile(char* tmplate)
|
||||
{
|
||||
auto pathtemplate = _mktemp(tmplate);
|
||||
inline FILE* MakeTmpFile(char* tmplate) {
|
||||
char *pathtemplate = tmplate;
|
||||
int err = _mktemp_s(pathtemplate, std::strlen(pathtemplate));
|
||||
EXPECT_EQ(err, 0);
|
||||
EXPECT_NE(pathtemplate, nullptr);
|
||||
if(pathtemplate == nullptr)
|
||||
{
|
||||
if(pathtemplate == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
auto* fs = std::fopen(pathtemplate, "w+");
|
||||
EXPECT_NE(fs, nullptr);
|
||||
EXPECT_NE(fs, nullptr); return fs;
|
||||
|
||||
return fs;
|
||||
}
|
||||
#elif defined(__GNUC__) || defined(__clang__)
|
||||
inline FILE* MakeTmpFile(char* tmplate)
|
||||
{
|
||||
inline FILE* MakeTmpFile(char* tmplate) {
|
||||
auto fd = mkstemp(tmplate);
|
||||
EXPECT_NE(-1, fd);
|
||||
if(fd == -1)
|
||||
{
|
||||
if(fd == -1) {
|
||||
return nullptr;
|
||||
}
|
||||
auto fs = fdopen(fd, "w+");
|
||||
|
|
|
@ -5,8 +5,6 @@ Open Asset Import Library (assimp)
|
|||
|
||||
Copyright (c) 2006-2024, assimp team
|
||||
|
||||
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
|
@ -89,7 +87,7 @@ TEST_F( IOStreamBufferTest, open_close_Test ) {
|
|||
auto* fs = MakeTmpFile(fname);
|
||||
ASSERT_NE(nullptr, fs);
|
||||
|
||||
auto written = std::fwrite( data, sizeof(*data), dataCount, fs );
|
||||
auto written = std::fwrite(data, sizeof(*data), dataCount, fs);
|
||||
EXPECT_NE( 0U, written );
|
||||
auto flushResult = std::fflush( fs );
|
||||
ASSERT_EQ(0, flushResult);
|
||||
|
|
Loading…
Reference in New Issue