blob: ab7d6eb634dc39cbe909e23cf4e9edaf7a09c7d5 [file] [log] [blame]
Franklin Weia855d622017-01-21 15:18:31 -05001//
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 Weia855d622017-01-21 15:18:31 -050015
16void FixFilePath(char *filename);
17int FindDistance3D(int ix, int iy, int iz);
18void Shutdown(void);
19
20#ifndef LITTLE_ENDIAN
Vencislav Atanasov183e45e2019-07-28 23:31:50 +030021 #define LITTLE_ENDIAN 1234
Franklin Weia855d622017-01-21 15:18:31 -050022#endif
23
24#ifndef BIG_ENDIAN
Vencislav Atanasov183e45e2019-07-28 23:31:50 +030025 #define BIG_ENDIAN 4321
Franklin Weia855d622017-01-21 15:18:31 -050026#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 Weia855d622017-01-21 15:18:31 -050036#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
52int32_t MotoLong (int32_t l);
53int32_t IntelLong (int32_t l);
54
55void Error (int errorType, char *error, ...);
56
57#endif