X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=contrib%2Fbobtoolz%2Fbsploader.cpp;h=0c442e16ce0f2258abac3775b662a62e1c235027;hb=8705acc09238c97ba0e79094621f0d6c859a7eb1;hp=6c8b09e90f185431e78c748a932e51eaf6e23527;hpb=e4287c28bb2dafedc81c66e63951d947cfbeb225;p=xonotic%2Fnetradiant.git diff --git a/contrib/bobtoolz/bsploader.cpp b/contrib/bobtoolz/bsploader.cpp index 6c8b09e9..0c442e16 100644 --- a/contrib/bobtoolz/bsploader.cpp +++ b/contrib/bobtoolz/bsploader.cpp @@ -1,3 +1,4 @@ +#include #include "bsploader.h" #include "dialogs/dialogs-gtk.h" #include "cmdlib.h" @@ -24,9 +25,9 @@ dbrush_t *dbrushes = NULL; dbrushside_t *dbrushsides = NULL; int *dleafbrushes = NULL; -#define BSP_IDENT ( ( 'P' << 24 ) + ( 'S' << 16 ) + ( 'B' << 8 ) + 'I' ) -#define Q3_BSP_VERSION 46 -#define WOLF_BSP_VERSION 47 +const int BSP_IDENT = ( ( 'P' << 24 ) + ( 'S' << 16 ) + ( 'B' << 8 ) + 'I' ); +const int Q3_BSP_VERSION = 46; +const int WOLF_BSP_VERSION = 47; /* ================ @@ -71,16 +72,16 @@ bool LoadFile( const char *filename, byte **bufferptr ){ } int LittleLong( int l ){ -#if defined( __BIG_ENDIAN__ ) - std::reverse( reinterpret_cast( &l ), reinterpret_cast( &l ) + sizeof( int ) ); -#endif + if (GDEF_ARCH_ENDIAN_BIG) { + std::reverse(reinterpret_cast( &l ), reinterpret_cast( &l ) + sizeof(int)); + } return l; } float LittleFloat( float l ){ -#if defined( __BIG_ENDIAN__ ) - std::reverse( reinterpret_cast( &l ), reinterpret_cast( &l ) + sizeof( float ) ); -#endif + if (GDEF_ARCH_ENDIAN_BIG) { + std::reverse( reinterpret_cast( &l ), reinterpret_cast( &l ) + sizeof( float ) ); + } return l; }