diff --git a/code/AssetLib/3DS/3DSExporter.cpp b/code/AssetLib/3DS/3DSExporter.cpp index fed96a51f..ad8e10afe 100644 --- a/code/AssetLib/3DS/3DSExporter.cpp +++ b/code/AssetLib/3DS/3DSExporter.cpp @@ -290,12 +290,18 @@ void Discreet3DSExporter::WriteMaterials() { ChunkWriter curChunk(writer, Discreet3DS::CHUNK_MAT_SPECULAR); WriteColor(color); } - + if (mat.Get(AI_MATKEY_COLOR_AMBIENT, color) == AI_SUCCESS) { ChunkWriter curChunk(writer, Discreet3DS::CHUNK_MAT_AMBIENT); WriteColor(color); } + float f; + if (mat.Get(AI_MATKEY_OPACITY, f) == AI_SUCCESS) { + ChunkWriter chunk(writer, Discreet3DS::CHUNK_MAT_TRANSPARENCY); + WritePercentChunk(1.0f - f); + } + if (mat.Get(AI_MATKEY_COLOR_EMISSIVE, color) == AI_SUCCESS) { ChunkWriter curChunk(writer, Discreet3DS::CHUNK_MAT_SELF_ILLUM); WriteColor(color); @@ -333,7 +339,6 @@ void Discreet3DSExporter::WriteMaterials() { writer.PutU2(static_cast(shading_mode_out)); } - float f; if (mat.Get(AI_MATKEY_SHININESS, f) == AI_SUCCESS) { ChunkWriter chunk(writer, Discreet3DS::CHUNK_MAT_SHININESS); WritePercentChunk(f); diff --git a/code/Common/DefaultIOStream.cpp b/code/Common/DefaultIOStream.cpp index 32f47ab07..449b6c1e1 100644 --- a/code/Common/DefaultIOStream.cpp +++ b/code/Common/DefaultIOStream.cpp @@ -5,8 +5,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2020, assimp team - - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -52,27 +50,32 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using namespace Assimp; namespace { + template -size_t select_ftell(FILE *file) { +inline size_t select_ftell(FILE *file) { return ::ftell(file); } template -int select_fseek(FILE *file, int64_t offset, int origin) { +inline int select_fseek(FILE *file, int64_t offset, int origin) { return ::fseek(file, static_cast(offset), origin); } + + #if defined _WIN32 && (!defined __GNUC__ || __MSVCRT_VERSION__ >= 0x0601) template <> -size_t select_ftell<8>(FILE *file) { +inline size_t select_ftell<8>(FILE *file) { return (size_t)::_ftelli64(file); } template <> -int select_fseek<8>(FILE *file, int64_t offset, int origin) { +inline int select_fseek<8>(FILE *file, int64_t offset, int origin) { return ::_fseeki64(file, offset, origin); } -#endif + +#endif // #if defined _WIN32 && (!defined __GNUC__ || __MSVCRT_VERSION__ >= 0x0601) + } // namespace // ---------------------------------------------------------------------------------- diff --git a/code/PostProcessing/TriangulateProcess.cpp b/code/PostProcessing/TriangulateProcess.cpp index 8035b34f4..ebd35c997 100644 --- a/code/PostProcessing/TriangulateProcess.cpp +++ b/code/PostProcessing/TriangulateProcess.cpp @@ -64,6 +64,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "Common/PolyTools.h" #include +#include //#define AI_BUILD_TRIANGULATE_COLOR_FACE_WINDING //#define AI_BUILD_TRIANGULATE_DEBUG_POLYS @@ -141,7 +142,7 @@ bool TriangulateProcess::TriangulateMesh( aiMesh* pMesh) } // Find out how many output faces we'll get - unsigned int numOut = 0, max_out = 0; + uint32_t numOut = 0, max_out = 0; bool get_normals = true; for( unsigned int a = 0; a < pMesh->mNumFaces; a++) { aiFace& face = pMesh->mFaces[a];