nuclear@0: /* nuclear@0: --------------------------------------------------------------------------- nuclear@0: Open Asset Import Library (assimp) nuclear@0: --------------------------------------------------------------------------- nuclear@0: nuclear@0: Copyright (c) 2006-2018, assimp team nuclear@0: nuclear@0: nuclear@0: nuclear@0: All rights reserved. nuclear@0: nuclear@0: Redistribution and use of this software in source and binary forms, nuclear@0: with or without modification, are permitted provided that the following nuclear@0: conditions are met: nuclear@0: nuclear@0: * Redistributions of source code must retain the above nuclear@0: copyright notice, this list of conditions and the nuclear@0: following disclaimer. nuclear@0: nuclear@0: * Redistributions in binary form must reproduce the above nuclear@0: copyright notice, this list of conditions and the nuclear@0: following disclaimer in the documentation and/or other nuclear@0: materials provided with the distribution. nuclear@0: nuclear@0: * Neither the name of the assimp team, nor the names of its nuclear@0: contributors may be used to endorse or promote products nuclear@0: derived from this software without specific prior nuclear@0: written permission of the assimp team. nuclear@0: nuclear@0: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS nuclear@0: "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT nuclear@0: LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR nuclear@0: A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT nuclear@0: OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, nuclear@0: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT nuclear@0: LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, nuclear@0: DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY nuclear@0: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT nuclear@0: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE nuclear@0: OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. nuclear@0: --------------------------------------------------------------------------- nuclear@0: */ nuclear@0: nuclear@0: /** @file defs.h nuclear@0: * @brief Assimp build configuration setup. See the notes in the comment nuclear@0: * blocks to find out how to customize _your_ Assimp build. nuclear@0: */ nuclear@0: nuclear@0: #pragma once nuclear@0: #ifndef AI_DEFINES_H_INC nuclear@0: #define AI_DEFINES_H_INC nuclear@0: nuclear@0: #include nuclear@0: nuclear@0: ////////////////////////////////////////////////////////////////////////// nuclear@0: /* Define ASSIMP_BUILD_NO_XX_IMPORTER to disable a specific nuclear@0: * file format loader. The loader is be excluded from the nuclear@0: * build in this case. 'XX' stands for the most common file nuclear@0: * extension of the file format. E.g.: nuclear@0: * ASSIMP_BUILD_NO_X_IMPORTER disables the X loader. nuclear@0: * nuclear@0: * If you're unsure about that, take a look at the implementation of the nuclear@0: * import plugin you wish to disable. You'll find the right define in the nuclear@0: * first lines of the corresponding unit. nuclear@0: * nuclear@0: * Other (mixed) configuration switches are listed here: nuclear@0: * ASSIMP_BUILD_NO_COMPRESSED_X nuclear@0: * - Disable support for compressed X files (zip) nuclear@0: * ASSIMP_BUILD_NO_COMPRESSED_BLEND nuclear@0: * - Disable support for compressed Blender files (zip) nuclear@0: * ASSIMP_BUILD_NO_COMPRESSED_IFC nuclear@0: * - Disable support for IFCZIP files (unzip) nuclear@0: */ nuclear@0: ////////////////////////////////////////////////////////////////////////// nuclear@0: nuclear@0: #ifndef ASSIMP_BUILD_NO_COMPRESSED_X nuclear@0: # define ASSIMP_BUILD_NEED_Z_INFLATE nuclear@0: #endif nuclear@0: nuclear@0: #ifndef ASSIMP_BUILD_NO_COMPRESSED_BLEND nuclear@0: # define ASSIMP_BUILD_NEED_Z_INFLATE nuclear@0: #endif nuclear@0: nuclear@0: #ifndef ASSIMP_BUILD_NO_COMPRESSED_IFC nuclear@0: # define ASSIMP_BUILD_NEED_Z_INFLATE nuclear@0: # define ASSIMP_BUILD_NEED_UNZIP nuclear@0: #endif nuclear@0: nuclear@0: #ifndef ASSIMP_BUILD_NO_Q3BSP_IMPORTER nuclear@0: # define ASSIMP_BUILD_NEED_Z_INFLATE nuclear@0: # define ASSIMP_BUILD_NEED_UNZIP nuclear@0: #endif nuclear@0: nuclear@0: ////////////////////////////////////////////////////////////////////////// nuclear@0: /* Define ASSIMP_BUILD_NO_XX_PROCESS to disable a specific nuclear@0: * post processing step. This is the current list of process names ('XX'): nuclear@0: * CALCTANGENTS nuclear@0: * JOINVERTICES nuclear@0: * TRIANGULATE nuclear@0: * DROPFACENORMALS nuclear@0: * GENFACENORMALS nuclear@0: * GENVERTEXNORMALS nuclear@0: * REMOVEVC nuclear@0: * SPLITLARGEMESHES nuclear@0: * PRETRANSFORMVERTICES nuclear@0: * LIMITBONEWEIGHTS nuclear@0: * VALIDATEDS nuclear@0: * IMPROVECACHELOCALITY nuclear@0: * FIXINFACINGNORMALS nuclear@0: * REMOVE_REDUNDANTMATERIALS nuclear@0: * OPTIMIZEGRAPH nuclear@0: * SORTBYPTYPE nuclear@0: * FINDINVALIDDATA nuclear@0: * TRANSFORMTEXCOORDS nuclear@0: * GENUVCOORDS nuclear@0: * ENTITYMESHBUILDER nuclear@0: * EMBEDTEXTURES nuclear@0: * MAKELEFTHANDED nuclear@0: * FLIPUVS nuclear@0: * FLIPWINDINGORDER nuclear@0: * OPTIMIZEMESHES nuclear@0: * OPTIMIZEANIMS nuclear@0: * OPTIMIZEGRAPH nuclear@0: * GENENTITYMESHES nuclear@0: * FIXTEXTUREPATHS */ nuclear@0: ////////////////////////////////////////////////////////////////////////// nuclear@0: nuclear@0: #ifdef _MSC_VER nuclear@0: # undef ASSIMP_API nuclear@0: nuclear@0: ////////////////////////////////////////////////////////////////////////// nuclear@0: /* Define 'ASSIMP_BUILD_DLL_EXPORT' to build a DLL of the library */ nuclear@0: ////////////////////////////////////////////////////////////////////////// nuclear@0: # ifdef ASSIMP_BUILD_DLL_EXPORT nuclear@0: # define ASSIMP_API __declspec(dllexport) nuclear@0: # define ASSIMP_API_WINONLY __declspec(dllexport) nuclear@0: # pragma warning (disable : 4251) nuclear@0: nuclear@0: ////////////////////////////////////////////////////////////////////////// nuclear@0: /* Define 'ASSIMP_DLL' before including Assimp to link to ASSIMP in nuclear@0: * an external DLL under Windows. Default is static linkage. */ nuclear@0: ////////////////////////////////////////////////////////////////////////// nuclear@0: # elif (defined ASSIMP_DLL) nuclear@0: # define ASSIMP_API __declspec(dllimport) nuclear@0: # define ASSIMP_API_WINONLY __declspec(dllimport) nuclear@0: # else nuclear@0: # define ASSIMP_API nuclear@0: # define ASSIMP_API_WINONLY nuclear@0: # endif nuclear@0: nuclear@0: /* Force the compiler to inline a function, if possible nuclear@0: */ nuclear@0: # define AI_FORCE_INLINE __forceinline nuclear@0: nuclear@0: /* Tells the compiler that a function never returns. Used in code analysis nuclear@0: * to skip dead paths (e.g. after an assertion evaluated to false). */ nuclear@0: # define AI_WONT_RETURN __declspec(noreturn) nuclear@0: nuclear@0: #elif defined(SWIG) nuclear@0: nuclear@0: /* Do nothing, the relevant defines are all in AssimpSwigPort.i */ nuclear@0: nuclear@0: #else nuclear@0: nuclear@0: # define AI_WONT_RETURN nuclear@0: nuclear@0: # define ASSIMP_API nuclear@0: # define ASSIMP_API_WINONLY nuclear@0: # define AI_FORCE_INLINE inline nuclear@0: #endif // (defined _MSC_VER) nuclear@0: nuclear@0: #ifdef __GNUC__ nuclear@0: # define AI_WONT_RETURN_SUFFIX __attribute__((noreturn)) nuclear@0: #else nuclear@0: # define AI_WONT_RETURN_SUFFIX nuclear@0: #endif // (defined __clang__) nuclear@0: nuclear@0: #ifdef __cplusplus nuclear@0: /* No explicit 'struct' and 'enum' tags for C++, this keeps showing up nuclear@0: * in doxydocs. nuclear@0: */ nuclear@0: # define C_STRUCT nuclear@0: # define C_ENUM nuclear@0: #else nuclear@0: ////////////////////////////////////////////////////////////////////////// nuclear@0: /* To build the documentation, make sure ASSIMP_DOXYGEN_BUILD nuclear@0: * is defined by Doxygen's preprocessor. The corresponding nuclear@0: * entries in the DOXYFILE are: */ nuclear@0: ////////////////////////////////////////////////////////////////////////// nuclear@0: #if 0 nuclear@0: ENABLE_PREPROCESSING = YES nuclear@0: MACRO_EXPANSION = YES nuclear@0: EXPAND_ONLY_PREDEF = YES nuclear@0: SEARCH_INCLUDES = YES nuclear@0: INCLUDE_PATH = nuclear@0: INCLUDE_FILE_PATTERNS = nuclear@0: PREDEFINED = ASSIMP_DOXYGEN_BUILD=1 nuclear@0: EXPAND_AS_DEFINED = C_STRUCT C_ENUM nuclear@0: SKIP_FUNCTION_MACROS = YES nuclear@0: #endif nuclear@0: ////////////////////////////////////////////////////////////////////////// nuclear@0: /* Doxygen gets confused if we use c-struct typedefs to avoid nuclear@0: * the explicit 'struct' notation. This trick here has the same nuclear@0: * effect as the TYPEDEF_HIDES_STRUCT option, but we don't need nuclear@0: * to typedef all structs/enums. */ nuclear@0: ////////////////////////////////////////////////////////////////////////// nuclear@0: # if (defined ASSIMP_DOXYGEN_BUILD) nuclear@0: # define C_STRUCT nuclear@0: # define C_ENUM nuclear@0: # else nuclear@0: # define C_STRUCT struct nuclear@0: # define C_ENUM enum nuclear@0: # endif nuclear@0: #endif nuclear@0: nuclear@0: #if (defined(__BORLANDC__) || defined (__BCPLUSPLUS__)) nuclear@0: #error Currently, Borland is unsupported. Feel free to port Assimp. nuclear@0: nuclear@0: // "W8059 Packgröße der Struktur geändert" nuclear@0: nuclear@0: #endif nuclear@0: nuclear@0: nuclear@0: ////////////////////////////////////////////////////////////////////////// nuclear@0: /* Define ASSIMP_BUILD_SINGLETHREADED to compile assimp nuclear@0: * without threading support. The library doesn't utilize nuclear@0: * threads then and is itself not threadsafe. */ nuclear@0: ////////////////////////////////////////////////////////////////////////// nuclear@0: #ifndef ASSIMP_BUILD_SINGLETHREADED nuclear@0: # define ASSIMP_BUILD_SINGLETHREADED nuclear@0: #endif nuclear@0: nuclear@0: #if defined(_DEBUG) || ! defined(NDEBUG) nuclear@0: # define ASSIMP_BUILD_DEBUG nuclear@0: #endif nuclear@0: nuclear@0: ////////////////////////////////////////////////////////////////////////// nuclear@0: /* Define ASSIMP_DOUBLE_PRECISION to compile assimp nuclear@0: * with double precision support (64-bit). */ nuclear@0: ////////////////////////////////////////////////////////////////////////// nuclear@0: nuclear@0: #ifdef ASSIMP_DOUBLE_PRECISION nuclear@0: typedef double ai_real; nuclear@0: typedef signed long long int ai_int; nuclear@0: typedef unsigned long long int ai_uint; nuclear@0: #else // ASSIMP_DOUBLE_PRECISION nuclear@0: typedef float ai_real; nuclear@0: typedef signed int ai_int; nuclear@0: typedef unsigned int ai_uint; nuclear@0: #endif // ASSIMP_DOUBLE_PRECISION nuclear@0: nuclear@0: ////////////////////////////////////////////////////////////////////////// nuclear@0: /* Useful constants */ nuclear@0: ////////////////////////////////////////////////////////////////////////// nuclear@0: nuclear@0: /* This is PI. Hi PI. */ nuclear@0: #define AI_MATH_PI (3.141592653589793238462643383279 ) nuclear@0: #define AI_MATH_TWO_PI (AI_MATH_PI * 2.0) nuclear@0: #define AI_MATH_HALF_PI (AI_MATH_PI * 0.5) nuclear@0: nuclear@0: /* And this is to avoid endless casts to float */ nuclear@0: #define AI_MATH_PI_F (3.1415926538f) nuclear@0: #define AI_MATH_TWO_PI_F (AI_MATH_PI_F * 2.0f) nuclear@0: #define AI_MATH_HALF_PI_F (AI_MATH_PI_F * 0.5f) nuclear@0: nuclear@0: /* Tiny macro to convert from radians to degrees and back */ nuclear@0: #define AI_DEG_TO_RAD(x) ((x)*(ai_real)0.0174532925) nuclear@0: #define AI_RAD_TO_DEG(x) ((x)*(ai_real)57.2957795) nuclear@0: nuclear@0: /* Support for big-endian builds */ nuclear@0: #if defined(__BYTE_ORDER__) nuclear@0: # if (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) nuclear@0: # if !defined(__BIG_ENDIAN__) nuclear@0: # define __BIG_ENDIAN__ nuclear@0: # endif nuclear@0: # else /* little endian */ nuclear@0: # if defined (__BIG_ENDIAN__) nuclear@0: # undef __BIG_ENDIAN__ nuclear@0: # endif nuclear@0: # endif nuclear@0: #endif nuclear@0: #if defined(__BIG_ENDIAN__) nuclear@0: # define AI_BUILD_BIG_ENDIAN nuclear@0: #endif nuclear@0: nuclear@0: nuclear@0: /* To avoid running out of memory nuclear@0: * This can be adjusted for specific use cases nuclear@0: * It's NOT a total limit, just a limit for individual allocations nuclear@0: */ nuclear@0: #define AI_MAX_ALLOC(type) ((256U * 1024 * 1024) / sizeof(type)) nuclear@0: nuclear@0: #define AI_NO_EXCEPT nuclear@0: nuclear@0: #endif // !! AI_DEFINES_H_INC