DEADSOFTWARE

c500a34f89b2eb6a2ff38a03335ed2734f29c95b
[d2df-sdl.git] / src / shared / a_modes.inc
1 // compiler options, common for all game modules
2 {$MODE OBJFPC}
4 {$MODESWITCH ADVANCEDRECORDS+}
5 {$MODESWITCH ALLOWINLINE+}
6 {$MODESWITCH ANSISTRINGS+} // Allow use of ansistrings.
7 {$MODESWITCH AUTODEREF+} // Automatic (silent) dereferencing of typed pointers.
8 {$MODESWITCH CLASS+}
9 {$MODESWITCH CLASSICPROCVARS+} // Use classical procedural variables.
10 {$MODESWITCH DEFAULTPARAMETERS+} // Allow use of default parameter values.
11 {$MODESWITCH DUPLICATELOCALS-} // Allow local variables in class methods to have the same names as properties of the class.
12 {$MODESWITCH EXCEPTIONS+}
13 {$MODESWITCH HINTDIRECTIVE+} // Support the hint directives (deprecated, platform etc.)
14 {$MODESWITCH INITFINAL+} // Allow use of Initialization and Finalization
15 {.$MODESWITCH ISOUNARYMINUS-} // Unary minus as required by ISO pascal.
16 {$MODESWITCH MACPROCVARS-} // Use mac-style procedural variables.
17 {$MODESWITCH NESTEDCOMMENTS-}
18 {$MODESWITCH NESTEDPROCVARS+}
19 {$MODESWITCH OBJPAS+}
20 {$MODESWITCH OUT+} // Allow use of the out parameter type.
21 {$MODESWITCH PCHARTOSTRING+}
22 {$MODESWITCH POINTERTOPROCVAR+} // Allow silent conversion of pointers to procedural variables.
23 {$MODESWITCH PROPERTIES+}
24 {$MODESWITCH REPEATFORWARD+} // Implementation and Forward declaration must match completely.
25 {$MODESWITCH RESULT+}
26 {$MODESWITCH TYPEHELPERS+} // Allow the use of type helpers.
27 {$MODESWITCH UNICODESTRINGS-}
29 {$IFDEF DARWIN}
30 {$MODESWITCH OBJECTIVEC1}
31 {$ENDIF}
33 {$ASSERTIONS ON}
34 {$BITPACKING OFF}
35 {$BOOLEVAL OFF}
36 {$COPERATORS ON}
37 {$EXTENDEDSYNTAX ON}
38 {$IFDEF CPU386}
39 {$FPUTYPE SSE}
40 {$ENDIF}
41 {$GOTO ON}
42 {$IEEEERRORS OFF}
43 {$INLINE ON}
44 {$LONGSTRINGS ON}
45 {$MACRO OFF}
46 {$OBJECTCHECKS OFF}
47 {$OVERFLOWCHECKS OFF}
48 {$POINTERMATH ON}
49 {$RANGECHECKS OFF}
50 {$SAFEFPUEXCEPTIONS OFF}
51 {$SCOPEDENUMS ON} // this may be changed later
52 {$SMARTLINK ON}
53 {$TYPEDADDRESS ON}
54 {$TYPEINFO ON}
55 {$VARSTRINGCHECKS OFF}
57 {$S-} // disable stack checking
58 {$MMX-} // get lost, mmx
60 {$IF DEFINED(D2F_DEBUG)}
61 {$STACKFRAMES ON}
62 {$HINTS OFF}
63 {$ELSE}
64 {$STACKFRAMES OFF}
65 {$HINTS OFF}
66 {$DEFINE D2F_MORE_OPTIM}
67 {$ENDIF}
68 {$WARNINGS ON}
69 {.$NOTES ON}
71 {$IF DEFINED(D2F_DEBUG_OPTIM) or DEFINED(D2F_MORE_OPTIM)}
72 {$OPTIMIZATION DEADVALUES}
73 {$OPTIMIZATION CONSTPROP}
74 {$OPTIMIZATION DEADSTORE}
75 {$ENDIF}
77 {$IFDEF WIN32}
78 {$IFNDEF MSWINDOWS}
79 {$DEFINE MSWINDOWS}
80 {$ENDIF}
81 {$ENDIF}
83 {$IFDEF MSWINDOWS}
84 {$IFNDEF WINDOWS}
85 {$DEFINE WINDOWS}
86 {$ENDIF WINDOWS}
87 {$ENDIF}
89 (* --------- Build options check --------- *)
91 {$IFDEF HEADLESS}
92 {$DEFINE USE_SYSSTUB}
93 {$IF DEFINED(USE_SDL) OR DEFINED(USE_SDL2)}
94 {$WARNING System drivers not supported in headless mode. Force stub driver...}
95 {$UNDEF USE_SDL}
96 {$UNDEF USE_SDL2}
97 {$ENDIF}
98 {$DEFINE USE_GLSTUB}
99 {$IF DEFINED(USE_GLES1) OR DEFINED(USE_OPENGL)}
100 {$WARNING Render drivers not needed in headless mode. Force stub driver...}
101 {$UNDEF USE_GLES1}
102 {$UNDEF USE_OPENGL}
103 {$ENDIF}
104 {$IFDEF ENABLE_HOLMES}
105 {$WARNING Holmes in headless mode has no sense. Disabled.}
106 {$UNDEF ENABLE_HOLMES}
107 {$ENDIF}
108 {$IFDEF ENABLE_MENU}
109 {$WARNING Menu in headless mode has no sense. Disabled.}
110 {$UNDEF ENABLE_MENU}
111 {$DEFINE DISABLE_MENU}
112 {$ENDIF}
113 {$IFDEF ENABLE_TOUCH}
114 {$WARNING Touch screen in headless mode has no sense. Disabled.}
115 {$UNDEF ENABLE_TOUCH}
116 {$DEFINE DISABLE_TOUCH}
117 {$ENDIF}
118 {$IFDEF ENABLE_GFX}
119 {$WARNING GFX in headless mode has no sense. Disabled.}
120 {$UNDEF ENABLE_GFX}
121 {$DEFINE DISABLE_GFX}
122 {$ENDIF}
123 {$IFDEF ENABLE_GIBS}
124 {$WARNING Gibs in headless mode has no sense. Disabled.}
125 {$UNDEF ENABLE_GIBS}
126 {$DEFINE DISABLE_GIBS}
127 {$ENDIF}
128 {$IFDEF ENABLE_SHELLS}
129 {$WARNING Shells in headless mode has no sense. Disabled.}
130 {$UNDEF ENABLE_SHELLS}
131 {$DEFINE DISABLE_SHELLS}
132 {$ENDIF}
133 {$IFDEF ENABLE_CORPSES}
134 {$WARNING Corpses in headless mode has no sense. Disabled.}
135 {$UNDEF ENABLE_CORPSES}
136 {$DEFINE DISABLE_CORPSES}
137 {$ENDIF}
138 {$IFDEF ENABLE_RENDER}
139 {$WARNING Render in headless mode has no sense. Disabled.}
140 {$UNDEF ENABLE_RENDER}
141 {$DEFINE DISABLE_RENDER}
142 {$ENDIF}
143 {$IFDEF ENABLE_SYSTEM}
144 {$WARNING System in headless mode has no sense. Disabled.}
145 {$UNDEF ENABLE_SYSTEM}
146 {$DEFINE DISABLE_SYSTEM}
147 {$ENDIF}
148 {$ENDIF}
150 {$IF DEFINED(ENABLE_MENU) AND DEFINED(DISABLE_MENU)}
151 {$ERROR Select ENABLE_MENU or DISABLE_MENU}
152 {$ELSEIF NOT DEFINED(ENABLE_MENU) AND NOT DEFINED(DISABLE_MENU)}
153 // defaut ENABLE/DISABLE menu
154 {$IFDEF HEADLESS}
155 {$DEFINE DISABLE_MENU}
156 {$ELSE}
157 {$DEFINE ENABLE_MENU}
158 {$ENDIF}
159 {$ENDIF}
161 {$IF DEFINED(ENABLE_TOUCH) AND DEFINED(DISABLE_TOUCH)}
162 {$ERROR Select ENABLE_TOUCH or DISABLE_TOUCH}
163 {$ELSEIF NOT DEFINED(ENABLE_TOUCH) AND NOT DEFINED(DISABLE_TOUCH)}
164 // defaut ENABLE/DISABLE touch
165 {$IFDEF HEADLESS}
166 {$DEFINE DISABLE_TOUCH}
167 {$ELSE}
168 {$DEFINE ENABLE_TOUCH}
169 {$ENDIF}
170 {$ENDIF}
172 {$IF DEFINED(ENABLE_GFX) AND DEFINED(DISABLE_GFX)}
173 {$ERROR Select ENABLE_GFX or DISABLE_GFX}
174 {$ELSEIF NOT DEFINED(ENABLE_GFX) AND NOT DEFINED(DISABLE_GFX)}
175 // default ENABLE/DISABLE gfx
176 {$IFDEF HEADLESS}
177 {$DEFINE DISABLE_GFX}
178 {$ELSE}
179 {$DEFINE ENABLE_GFX}
180 {$ENDIF}
181 {$ENDIF}
183 {$IF DEFINED(ENABLE_GIBS) AND DEFINED(DISABLE_GIBS)}
184 {$ERROR Select ENABLE_GIBS or DISABLE_GIBS}
185 {$ELSEIF NOT DEFINED(ENABLE_GIBS) AND NOT DEFINED(DISABLE_GIBS)}
186 // default ENABLE/DISABLE gibs
187 {$IFDEF HEADLESS}
188 {$DEFINE DISABLE_GIBS}
189 {$ELSE}
190 {$DEFINE ENABLE_GIBS}
191 {$ENDIF}
192 {$ENDIF}
194 {$IF DEFINED(ENABLE_SHELLS) AND DEFINED(DISABLE_SHELLS)}
195 {$ERROR Select ENABLE_SHELLS or DISABLE_SHELLS}
196 {$ELSEIF NOT DEFINED(ENABLE_SHELLS) AND NOT DEFINED(DISABLE_SHELLS)}
197 // default ENABLE/DISABLE gibs
198 {$IFDEF HEADLESS}
199 {$DEFINE DISABLE_SHELLS}
200 {$ELSE}
201 {$DEFINE ENABLE_SHELLS}
202 {$ENDIF}
203 {$ENDIF}
205 {$IF DEFINED(ENABLE_CORPSES) AND DEFINED(DISABLE_CORPSES)}
206 {$ERROR Select ENABLE_CORPSES or DISABLE_CORPSES}
207 {$ELSEIF NOT DEFINED(ENABLE_CORPSES) AND NOT DEFINED(DISABLE_CORPSES)}
208 // default ENABLE/DISABLE corpses
209 {$IFDEF HEADLESS}
210 {$DEFINE DISABLE_CORPSES}
211 {$ELSE}
212 {$DEFINE ENABLE_CORPSES}
213 {$ENDIF}
214 {$ENDIF}
216 {$IF DEFINED(ENABLE_RENDER) AND DEFINED(DISABLE_RENDER)}
217 {$ERROR Select ENABLE_RENDER or DISABLE_RENDER}
218 {$ELSEIF NOT DEFINED(ENABLE_RENDER) AND NOT DEFINED(DISABLE_RENDER)}
219 // default ENABLE/DISABLE render
220 {$IFDEF HEADLESS}
221 {$DEFINE DISABLE_RENDER}
222 {$ELSE}
223 {$DEFINE ENABLE_RENDER}
224 {$ENDIF}
225 {$ENDIF}
227 {$IF DEFINED(ENABLE_SYSTEM) AND DEFINED(DISABLE_SYSTEM)}
228 {$ERROR Select ENABLE_SYSTEM or DISABLE_SYSTEM}
229 {$ELSEIF NOT DEFINED(ENABLE_SYSTEM) AND NOT DEFINED(DISABLE_SYSTEM)}
230 // default ENABLE/DISABLE system driver
231 {$IFDEF HEADLESS}
232 {$DEFINE DISABLE_SYSTEM}
233 {$ELSE}
234 {$DEFINE ENABLE_SYSTEM}
235 {$ENDIF}
236 {$ENDIF}
238 {$IF DEFINED(USE_SYSSTUB)}
239 {$IF DEFINED(USE_SDL) OR DEFINED(USE_SDL2)}
240 {$ERROR Only one system driver must be selected!}
241 {$ENDIF}
242 {$ELSEIF DEFINED(USE_SDL)}
243 {$IF DEFINED(USE_SYSSTUB) OR DEFINED(USE_SDL2)}
244 {$ERROR Only one system driver must be selected!}
245 {$ENDIF}
246 {$ELSEIF DEFINED(USE_SDL2)}
247 {$IF DEFINED(USE_SYSSTUB) OR DEFINED(USE_SDL)}
248 {$ERROR Only one system driver must be selected!}
249 {$ENDIF}
250 {$ELSE}
251 {$DEFINE USE_SDL2}
252 {.$ERROR System driver not selected. Use -dUSE_SYSSTUB or -dUSE_SDL or -dUSE_SDL2}
253 {$ENDIF}
255 {$IF DEFINED(USE_SOUNDSTUB)}
256 {$IF DEFINED(USE_SDLMIXER) OR DEFINED(USE_FMOD) OR DEFINED(USE_OPENAL)}
257 {$ERROR Only one sound driver must be selected!}
258 {$ENDIF}
259 {$ELSEIF DEFINED(USE_SDLMIXER)}
260 {$IF DEFINED(USE_SOUNDSTUB) OR DEFINED(USE_FMOD) OR DEFINED(USE_OPENAL)}
261 {$ERROR Only one sound driver must be selected!}
262 {$ENDIF}
263 {$ELSEIF DEFINED(USE_FMOD)}
264 {$IF DEFINED(USE_SOUNDSTUB) OR DEFINED(USE_SDLMIXER) OR DEFINED(USE_OPENAL)}
265 {$ERROR Only one sound driver must be selected!}
266 {$ENDIF}
267 {$ELSEIF DEFINED(USE_OPENAL)}
268 {$IF DEFINED(USE_SOUNDSTUB) OR DEFINED(USE_SDLMIXER) OR DEFINED(USE_FMOD)}
269 {$ERROR Only one sound driver must be selected!}
270 {$ENDIF}
271 {$ELSE}
272 {$IFDEF IN_TOOLS}
273 {$DEFINE USE_SOUNDSTUB}
274 {$ELSE}
275 {$ERROR Sound driver not selected. Use -dUSE_SOUNDSTUB or -dUSE_SDLMIXER or -dUSE_FMOD or -dUSE_OPENAL}
276 {$ENDIF}
277 {$ENDIF}
279 {$IF DEFINED(USE_GLSTUB)}
280 {$IF DEFINED(USE_GLES1) OR DEFINED(USE_OPENGL)}
281 {$ERROR Only one render driver must be selected!}
282 {$ENDIF}
283 {$ELSEIF DEFINED(USE_GLES1)}
284 {$IF DEFINED(USE_GLSTUB) OR DEFINED(USE_OPENGL)}
285 {$ERROR Only one render driver must be selected!}
286 {$ENDIF}
287 {$ELSEIF DEFINED(USE_OPENGL)}
288 {$IF DEFINED(USE_GLSTUB) OR DEFINED(USE_GLES1)}
289 {$ERROR Only one render driver must be selected!}
290 {$ENDIF}
291 {$ELSE}
292 {$DEFINE USE_OPENGL}
293 {.$ERROR Render driver not selected. Use -dUSE_GLSTUB or -dUSE_GLES1 or -dUSE_OPENGL}
294 {$ENDIF}
296 {$IFDEF ENABLE_HOLMES}
297 {$IFNDEF USE_SDL2}
298 {$ERROR Holmes supported only with SDL2}
299 {$ENDIF}
300 {$IFNDEF USE_OPENGL}
301 {$ERROR Holmes supported only with desktop OpenGL}
302 {$ENDIF}
303 {$ENDIF}
305 {$IFDEF ENABLE_MENU}
306 {$IFDEF DISABLE_RENDER}
307 {$FATAL Render driver required for current menu implementation}
308 {$ENDIF}
309 {$ENDIF}
311 {$IFDEF ENABLE_TOUCH}
312 {$IFDEF DISABLE_SYSTEM}
313 {$FATAL System driver required for current touch implementation}
314 {$ENDIF}
315 {$ENDIF}