1 /* Emacs style mode select   -*- C++ -*-
2  *-----------------------------------------------------------------------------
3  *
4  *
5  *  PrBoom: a Doom port merged with LxDoom and LSDLDoom
6  *  based on BOOM, a modified and improved DOOM engine
7  *  Copyright (C) 1999 by
8  *  id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman
9  *  Copyright (C) 1999-2006 by
10  *  Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze
11  *  Copyright 2005, 2006 by
12  *  Florian Schulze, Colin Phipps, Neil Stevens, Andrey Budko
13  *
14  *  This program is free software; you can redistribute it and/or
15  *  modify it under the terms of the GNU General Public License
16  *  as published by the Free Software Foundation; either version 2
17  *  of the License, or (at your option) any later version.
18  *
19  *  This program is distributed in the hope that it will be useful,
20  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  *  GNU General Public License for more details.
23  *
24  *  You should have received a copy of the GNU General Public License
25  *  along with this program; if not, write to the Free Software
26  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
27  *  02111-1307, USA.
28  *
29  * DESCRIPTION:
30  *      Simple basic typedefs, isolated here to make it easier
31  *       separating modules.
32  *
33  *-----------------------------------------------------------------------------*/
34 
35 #ifndef __DOOMTYPE__
36 #define __DOOMTYPE__
37 
38 #include "config.h"
39 
40 #ifndef __BYTEBOOL__
41 #define __BYTEBOOL__
42 #include "custombool.h"
43 #endif
44 
45 #include <stdint.h>
46 
47 #ifndef PRIu64
48 #define PRIu64 "I64u"
49 #define PRIX64 "I64X"
50 #define PRIx64 "I64x"
51 #endif
52 
53 //e6y
54 #ifndef MAX
55 #define MAX(a,b) ((a)>(b)?(a):(b))
56 #endif
57 #ifndef MIN
58 #define MIN(a,b) ((a)<(b)?(a):(b))
59 #endif
60 
61 /* cph - Wrapper for the long long type, as Win32 used a different name.
62  * Except I don't know what to test as it's compiler specific
63  * Proff - I fixed it */
64 #ifndef _MSC_VER
65 // define compiled-specific long-long contstant notation here
66 #define LONGLONG(num)   (uint64_t)num ## ll
67 // for strcasecmp in POSIX/BSD systems
68 #include <strings.h>
69 #else
70 // define compiled-specific long-long contstant notation here
71 #define LONGLONG(num) (uint64_t)num
72 #undef PATH_MAX
73 #define PATH_MAX 1024
74 #define S_ISDIR(x) (((sbuf.st_mode & S_IFDIR)==S_IFDIR)?1:0)
75 #endif
76 
77 /* CPhipps - use limits.h instead of depreciated values.h */
78 #include <limits.h>
79 
80 // In case limits.h does not define PATH_MAX
81 #ifndef PATH_MAX
82 #define PATH_MAX 4096
83 #endif
84 
85 typedef unsigned char byte;
86 
87 /* cph - move compatibility levels here so we can use them in d_server.c */
88 typedef enum {
89   doom_12_compatibility,   /* Doom v1.2 */
90   doom_1666_compatibility, /* Doom v1.666 */
91   doom2_19_compatibility,  /* Doom & Doom 2 v1.9 */
92   ultdoom_compatibility,   /* Doom 2 v1.9 */
93   finaldoom_compatibility,     /* Final & Ultimate Doom v1.9, and Doom95 */
94   dosdoom_compatibility,     /* Early dosdoom & tasdoom */
95   tasdoom_compatibility,     /* Early dosdoom & tasdoom */
96   boom_compatibility_compatibility,      /* Boom's compatibility mode */
97   boom_201_compatibility,                /* Compatible with Boom v2.01 */
98   boom_202_compatibility,                /* Compatible with Boom v2.01 */
99   lxdoom_1_compatibility,                /* LxDoom v1.3.2+ */
100   mbf_compatibility,                     /* MBF */
101   prboom_1_compatibility,                /* PrBoom 2.03beta? */
102   prboom_2_compatibility,                /* PrBoom 2.1.0-2.1.1 */
103   prboom_3_compatibility,                /* PrBoom 2.2.x */
104   prboom_4_compatibility,                /* PrBoom 2.3.x */
105   prboom_5_compatibility,                /* PrBoom 2.4.0 */
106   prboom_6_compatibility,                /* Latest PrBoom */
107   MAX_COMPATIBILITY_LEVEL,               /* Must be last entry */
108   /* Aliases follow */
109   boom_compatibility = boom_201_compatibility, /* Alias used by G_Compatibility */
110   best_compatibility = prboom_6_compatibility,
111 } complevel_t;
112 
113 /* cph - from v_video.h, needed by gl_struct.h */
114 enum patch_translation_e {
115   VPT_NONE    = 0, // Normal
116   VPT_FLIP    = 1, // Flip image horizontally
117   VPT_TRANS   = 2, // Translate image via a translation table
118   VPT_STRETCH = 4, // Stretch to compensate for high-res
119 };
120 
121 #endif
122