/****************************************************************************** libx42 - skinned vertex animation library Copyright (C) 2007 HermitWorks Entertainment Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA. ******************************************************************************/ #ifndef INC_LIBX42_SETUP_H #define INC_LIBX42_SETUP_H /* Removes any utility functions that use the CRT from the build. This includes all calls to malloc/free. Define this and all memory management is in the hands of the caller. Also note, that if you define this before including x42.h and then statically link to a libx42 that was compiled with the extra functions your linker should be smart enough to exclude them as any functions that are behind LIBX42_MINIMIZE_CRT are never called by any other x42 functions. */ //#define LIBX42_MINIMIZE_CRT /* This isn't covered under LIBX42_MINIMIZE_CRT since _alloca is going to be a compiler intrinsic most of the time. Uncomment this line to strip out all uses of _alloca and use fixed-size stack buffers instead. */ //#define LIBX42_NO_ALLOCA /* On some OS's doesn't define the *f versions of the common math routines. This will cause libx42 to #define its own copy of these functions as a call to the double-precision funciton and a cast to float. */ //#define LIBX42_NO_MATH_F #if !defined( LIBX42_NO_ALLOCA ) && defined( __cplusplus_cli ) #define LIBX42_NO_ALLOCA #endif /* This macro is called whenever there's an error inside the library. Note that defining this to nothing does *not* suppress paramater validation, it simply causes functions to return null/false/early (or whatever their error behavior is). You can set it to something interesting if you want to trap errors where they occur to aid debugging. */ #ifndef LIBX42_ERROR_EVENT #ifdef DEBUG #ifdef _MSC_VER #define LIBX42_ERROR_EVENT( code, msg ) __debugbreak() #else #define LIBX42_ERROR_EVENT( code, msg ) #endif #else //DEBUG #define LIBX42_ERROR_EVENT( code, msg ) #endif //DEBUG #endif //!LIBX42_ERROR_EVENT /* Strips out almost all parameter validation code. Make sure you don't pass in bad data. Note that this only applies to parameter validation code, internal error checks are still performed and errors can still be raised if this is defined. The only paramater checks that remain are the odd default: handler in a switch-case block. */ //#define LIBX42_NO_PARAM_VALIDATION /* Defining this strips out the inverse-transpose computation when skinning normals. This makes the math work wrong, but it's visually OK for a large class of input models. */ //#define LIBX42_NO_INVERSE_TRANSPOSE #endif