diff options
author | Andrey Nazarov <skuller@skuller.net> | 2008-03-26 20:17:21 +0000 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2008-03-26 20:17:21 +0000 |
commit | 2e5bdb7d4141cd6eb690ceca234fd2cf62410cff (patch) | |
tree | 7d5a1500d396ad593036fa260e57c67438844ab4 /source/r_shared.h | |
parent | a2b6e72158970ffbe789776649c07107b9cfb553 (diff) |
CM loading code no longer calls Com_Error.
Made endianness conversion macros return unsigned integers.
Diffstat (limited to 'source/r_shared.h')
-rw-r--r-- | source/r_shared.h | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/source/r_shared.h b/source/r_shared.h index 8167c71..2ec2e2d 100644 --- a/source/r_shared.h +++ b/source/r_shared.h @@ -358,19 +358,7 @@ void GL_BeginPostProcessing( void ); void GL_EndPostProcessing( void ); #endif -#ifdef BIGENDIAN_TARGET -#define LL(x) ( dst->x = LongSwap( src->x ) ) -#define LF(x) ( dst->x = FloatSwap( src->x ) ) -#define LV(x) ( dst->x[0] = FloatSwap( src->x[0] ), \ - dst->x[1] = FloatSwap( src->x[1] ), \ - dst->x[2] = FloatSwap( src->x[2] ) ) -#define LLV(x) ( dst->x[0] = LongSwap( src->x[0] ), \ - dst->x[1] = LongSwap( src->x[1] ), \ - dst->x[2] = LongSwap( src->x[2] ) ) -#define LSV(x) ( dst->x[0] = ShortSwap( src->x[0] ), \ - dst->x[1] = ShortSwap( src->x[1] ), \ - dst->x[2] = ShortSwap( src->x[2] ) ) -#else +#if __BYTE_ORDER == __LITTLE_ENDIAN #define LL(x) ( dst->x = src->x ) #define LF(x) ( dst->x = src->x ) #define LV(x) ( dst->x[0] = src->x[0], \ @@ -382,6 +370,20 @@ void GL_EndPostProcessing( void ); #define LSV(x) ( dst->x[0] = src->x[0], \ dst->x[1] = src->x[1], \ dst->x[2] = src->x[2] ) +#elif __BYTE_ORDER == __BIG_ENDIAN +#define LL(x) ( dst->x = LongSwap( src->x ) ) +#define LF(x) ( dst->x = FloatSwap( src->x ) ) +#define LV(x) ( dst->x[0] = FloatSwap( src->x[0] ), \ + dst->x[1] = FloatSwap( src->x[1] ), \ + dst->x[2] = FloatSwap( src->x[2] ) ) +#define LLV(x) ( dst->x[0] = LongSwap( src->x[0] ), \ + dst->x[1] = LongSwap( src->x[1] ), \ + dst->x[2] = LongSwap( src->x[2] ) ) +#define LSV(x) ( dst->x[0] = ( signed short )ShortSwap( src->x[0] ), \ + dst->x[1] = ( signed short )ShortSwap( src->x[1] ), \ + dst->x[2] = ( signed short )ShortSwap( src->x[2] ) ) +#else +#error Unknown byte order #endif |