]> icculus.org git repositories - btb/d2x.git/blob - include/pstypes.h
use the orientation parameter of g3_draw_bitmap
[btb/d2x.git] / include / pstypes.h
1 /*
2 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
3 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
4 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
5 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
6 IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
7 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
8 FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
9 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
10 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
11 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
12 */
13
14 /*
15  *
16  * Common types for use in Miner
17  *
18  */
19
20 #ifndef _TYPES_H
21 #define _TYPES_H
22
23
24 #include <stdint.h>
25
26
27 //define a signed byte
28 typedef signed char sbyte;
29
30 //define unsigned types;
31 typedef unsigned char ubyte;
32 #if defined(_WIN32) || defined(macintosh)
33 typedef unsigned short ushort;
34 typedef unsigned int uint;
35 #endif
36
37 #if defined(_WIN32) || defined(__sun__) // platforms missing (u)int??_t
38 # include <SDL_types.h>
39 #elif defined(macintosh) // misses (u)int??_t and does not like SDL_types.h
40 # include <MacTypes.h>
41  typedef SInt16 int16_t;
42  typedef SInt32 int32_t;
43  typedef SInt64 int64_t;
44  typedef UInt16 uint16_t;
45  typedef UInt32 uint32_t;
46  typedef UInt64 uint64_t;
47 #endif // macintosh
48 #if defined(_WIN32) // platforms missing int??_t
49  typedef Sint16 int16_t;
50  typedef Sint32 int32_t;
51  typedef Sint64 int64_t;
52 #endif // defined(_WIN32)
53 #if defined(_WIN32) || defined(__sun__) // platforms missing uint??_t
54  typedef Uint16 uint16_t;
55  typedef Uint32 uint32_t;
56  typedef Uint64 uint64_t;
57 #endif // defined(_WIN32) || defined(__sun__)
58
59 #ifdef _MSC_VER
60 # include <stdlib.h> // this is where min and max are defined
61 #endif
62 #ifndef min
63 #define min(a,b) (((a)>(b))?(b):(a))
64 #endif
65 #ifndef max
66 #define max(a,b) (((a)<(b))?(b):(a))
67 #endif
68
69 #ifdef _WIN32
70 # ifndef __MINGW32__
71 #  define PATH_MAX _MAX_PATH
72 # endif
73 # define FNAME_MAX 256
74 #elif defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
75 # include <sys/types.h>
76 # ifndef PATH_MAX
77 #  define PATH_MAX 1024
78 # endif
79 # define FNAME_MAX 256
80 #elif defined __DJGPP__
81 # include <sys/types.h>
82 # define FNAME_MAX 9    // excluding extension
83 #elif defined(macintosh)
84 # define PATH_MAX 256
85 # define FNAME_MAX 32
86 #endif
87
88 #ifndef __cplusplus
89 //define a boolean
90 typedef ubyte bool;
91 #endif
92
93 #ifndef NULL
94 #define NULL 0
95 #endif
96
97 // the following stuff has nothing to do with types but needed everywhere,
98 // and since this file is included everywhere, it's here.
99 #ifdef __GNUC__
100 # define __pack__ __attribute__((packed))
101 #elif defined(_MSC_VER)
102 # pragma pack(push, packing)
103 # pragma pack(1)
104 # define __pack__
105 #elif defined(macintosh)
106 # pragma options align=packed
107 # define __pack__
108 #else
109 # error d2x will not work without packed structures
110 #endif
111
112 #ifdef _MSC_VER
113 # define inline __inline
114 #endif
115
116 #ifndef PACKAGE_STRING
117 # define PACKAGE_STRING "d2x"
118 #endif
119
120 #endif //_TYPES_H
121