Franklin Wei | a855d62 | 2017-01-21 15:18:31 -0500 | [diff] [blame] | 1 | // |
| 2 | // global.h |
| 3 | // Duke3D |
| 4 | // |
| 5 | // Created by fabien sanglard on 12-12-17. |
| 6 | // Copyright (c) 2012 fabien sanglard. All rights reserved. |
| 7 | // |
| 8 | |
| 9 | #ifndef Duke3D_global_h |
| 10 | #define Duke3D_global_h |
| 11 | |
| 12 | #include "SDL.h" |
| 13 | |
| 14 | #define open rb->open |
Franklin Wei | a855d62 | 2017-01-21 15:18:31 -0500 | [diff] [blame] | 15 | |
| 16 | void FixFilePath(char *filename); |
| 17 | int FindDistance3D(int ix, int iy, int iz); |
| 18 | void Shutdown(void); |
| 19 | |
| 20 | #ifndef LITTLE_ENDIAN |
Vencislav Atanasov | 183e45e | 2019-07-28 23:31:50 +0300 | [diff] [blame^] | 21 | #define LITTLE_ENDIAN 1234 |
Franklin Wei | a855d62 | 2017-01-21 15:18:31 -0500 | [diff] [blame] | 22 | #endif |
| 23 | |
| 24 | #ifndef BIG_ENDIAN |
Vencislav Atanasov | 183e45e | 2019-07-28 23:31:50 +0300 | [diff] [blame^] | 25 | #define BIG_ENDIAN 4321 |
Franklin Wei | a855d62 | 2017-01-21 15:18:31 -0500 | [diff] [blame] | 26 | #endif |
| 27 | |
| 28 | #ifdef ROCKBOX |
| 29 | #ifdef ROCKBOX_LITTLE_ENDIAN |
| 30 | #define BYTE_ORDER LITTLE_ENDIAN |
| 31 | #else |
| 32 | #define BYTE_ORDER BIG_ENDIAN |
| 33 | #endif |
| 34 | #endif |
| 35 | |
Franklin Wei | a855d62 | 2017-01-21 15:18:31 -0500 | [diff] [blame] | 36 | #ifndef BYTE_ORDER |
| 37 | #error Please define your platform. |
| 38 | #endif |
| 39 | |
| 40 | #if (BYTE_ORDER == LITTLE_ENDIAN) |
| 41 | #define KeepShort IntelShort |
| 42 | #define SwapShort MotoShort |
| 43 | #define Keepint32_t IntelLong |
| 44 | #define Swapint32_t MotoLong |
| 45 | #else |
| 46 | #define KeepShort MotoShort |
| 47 | #define SwapShort IntelShort |
| 48 | #define Keepint32_t MotoLong |
| 49 | #define Swapint32_t IntelLong |
| 50 | #endif |
| 51 | |
| 52 | int32_t MotoLong (int32_t l); |
| 53 | int32_t IntelLong (int32_t l); |
| 54 | |
| 55 | void Error (int errorType, char *error, ...); |
| 56 | |
| 57 | #endif |