From 756cfd4f74b866e3183caede69daa8c105b73bab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 13 Nov 2015 22:33:20 +0100 Subject: [PATCH 1/5] fix compilation on BigEndian cannot pass a function by reference where an lvalue is expected (only applies to bigendian, where a macro expands to a byteswap function) Closes https://github.com/assimp/assimp/issues/613 --- code/Bitmap.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/Bitmap.cpp b/code/Bitmap.cpp index 13ec37204..829fd027b 100644 --- a/code/Bitmap.cpp +++ b/code/Bitmap.cpp @@ -84,7 +84,12 @@ namespace Assimp { template inline std::size_t Copy(uint8_t* data, T& field) { +#ifdef AI_BUILD_BIG_ENDIAN + T field_swapped=AI_BE(field); + std::memcpy(data, &field_swapped, sizeof(field)); return sizeof(field); +#else std::memcpy(data, &AI_BE(field), sizeof(field)); return sizeof(field); +#endif } void Bitmap::WriteHeader(Header& header, IOStream* file) { From 989e8af3fb573d4373baf6685543bef50ad6b20e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 13 Nov 2015 22:33:53 +0100 Subject: [PATCH 2/5] fix argument check for assimp cmdline tool `assimp cmpdump` expects two files as arguments. so we need to check for at least 2 extra arguments (rather than only check for !<1 and access both) --- tools/assimp_cmd/CompareDump.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/assimp_cmd/CompareDump.cpp b/tools/assimp_cmd/CompareDump.cpp index 8739c9364..f33d8f91c 100644 --- a/tools/assimp_cmd/CompareDump.cpp +++ b/tools/assimp_cmd/CompareDump.cpp @@ -881,7 +881,7 @@ int Assimp_CompareDump (const char* const* params, unsigned int num) } // assimp cmpdump actual expected - if (num < 1) { + if (num < 2) { std::cout << "assimp cmpdump: Invalid number of arguments. " "See \'assimp cmpdump --help\'\r\n" << std::endl; return 1; From 7806e991d98a657cca980a5dba5baf38fea7138d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 13 Nov 2015 23:01:49 +0100 Subject: [PATCH 3/5] Convert Windows-1252 charset to UTF-8 Windows-1252, seriously? (this hard-to-detect weirdo charset really makes some problems with some cmdline text-tool) --- contrib/clipper/clipper.cpp | 2 +- contrib/clipper/clipper.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/clipper/clipper.cpp b/contrib/clipper/clipper.cpp index b2316ccd5..c8c62bc2a 100644 --- a/contrib/clipper/clipper.cpp +++ b/contrib/clipper/clipper.cpp @@ -26,7 +26,7 @@ * Paper no. DETC2005-85513 pp. 565-575 * * ASME 2005 International Design Engineering Technical Conferences * * and Computers and Information in Engineering Conference (IDETC/CIE2005) * -* September 24–28, 2005 , Long Beach, California, USA * +* September 24–28, 2005 , Long Beach, California, USA * * http://www.me.berkeley.edu/~mcmains/pubs/DAC05OffsetPolygon.pdf * * * *******************************************************************************/ diff --git a/contrib/clipper/clipper.hpp b/contrib/clipper/clipper.hpp index f6f196d0d..3d6510dff 100644 --- a/contrib/clipper/clipper.hpp +++ b/contrib/clipper/clipper.hpp @@ -26,7 +26,7 @@ * Paper no. DETC2005-85513 pp. 565-575 * * ASME 2005 International Design Engineering Technical Conferences * * and Computers and Information in Engineering Conference (IDETC/CIE2005) * -* September 24–28, 2005 , Long Beach, California, USA * +* September 24–28, 2005 , Long Beach, California, USA * * http://www.me.berkeley.edu/~mcmains/pubs/DAC05OffsetPolygon.pdf * * * *******************************************************************************/ From 40ee5753224f037710ad513f453abd7e11c60467 Mon Sep 17 00:00:00 2001 From: Danke Xie Date: Sun, 15 Nov 2015 13:45:54 -0800 Subject: [PATCH 4/5] Add new light type 'ambient' to match light.h --- port/jassimp/jassimp/src/jassimp/AiLightType.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/port/jassimp/jassimp/src/jassimp/AiLightType.java b/port/jassimp/jassimp/src/jassimp/AiLightType.java index 5df38763c..ec3c39b02 100644 --- a/port/jassimp/jassimp/src/jassimp/AiLightType.java +++ b/port/jassimp/jassimp/src/jassimp/AiLightType.java @@ -70,9 +70,20 @@ public enum AiLightType { * direction it is pointing to. A good example for a spot light is a light * spot in sport arenas. */ - SPOT(0x3); + SPOT(0x3), + + + /** + * The generic light level of the world, including the bounces of all other + * lightsources.

+ * + * Typically, there's at most one ambient light in a scene. + * This light type doesn't have a valid position, direction, or + * other properties, just a color. + */ + AMBIENT(0x4); + - /** * Utility method for converting from c/c++ based integer enums to java * enums.

From 57d7085fb8472a03048134eb56454a9c30943c34 Mon Sep 17 00:00:00 2001 From: Danke Xie Date: Sun, 15 Nov 2015 22:48:17 -0800 Subject: [PATCH 5/5] Fix AndroidJNI header path in CMakelists.txt --- code/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 3d19bf0ef..2b7bcec7b 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -769,7 +769,7 @@ INSTALL( TARGETS assimp INSTALL( FILES ${PUBLIC_HEADERS} DESTINATION ${ASSIMP_INCLUDE_INSTALL_DIR}/assimp COMPONENT assimp-dev) INSTALL( FILES ${COMPILER_HEADERS} DESTINATION ${ASSIMP_INCLUDE_INSTALL_DIR}/assimp/Compiler COMPONENT assimp-dev) if (ASSIMP_ANDROID_JNIIOSYSTEM) - INSTALL(FILES ${HEADER_PATH}/../${ASSIMP_ANDROID_JNIIOSYSTEM_PATH}/AndroidJNIIOSystem.h + INSTALL(FILES ${HEADER_PATH}/${ASSIMP_ANDROID_JNIIOSYSTEM_PATH}/AndroidJNIIOSystem.h DESTINATION ${ASSIMP_INCLUDE_INSTALL_DIR} COMPONENT assimp-dev) endif(ASSIMP_ANDROID_JNIIOSYSTEM)