2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on
10 * $Logfile: /Freespace2/code/GlobalIncs/SystemVars.h $
15 * Variables and constants common to FreeSpace and Fred.
18 * Revision 1.3 2003/05/25 02:30:42 taylor
21 * Revision 1.2 2002/06/09 04:41:15 relnev
22 * added copyright header
24 * Revision 1.1.1.1 2002/05/03 03:28:12 root
28 * 11 6/22/99 7:03p Dave
29 * New detail options screen.
31 * 10 6/16/99 4:06p Dave
32 * New pilot info popup. Added new draw-bitmap-as-poly function.
34 * 9 6/14/99 10:45a Dave
35 * Made beam weapons specify accuracy by skill level in the weapons.tbl
37 * 8 5/24/99 5:45p Dave
38 * Added detail levels to the nebula, with a decent speedup. Split nebula
39 * lightning into its own section.
41 * 7 3/29/99 6:17p Dave
42 * More work on demo system. Got just about everything in except for
43 * blowing ships up, secondary weapons and player death/warpout.
45 * 6 3/28/99 5:58p Dave
46 * Added early demo code. Make objects move. Nice and framerate
47 * independant, but not much else. Don't use yet unless you're me :)
49 * 5 3/28/99 12:37p Dave
50 * Tentative beginnings to warpin effect.
52 * 4 11/30/98 1:07p Dave
53 * 16 bit conversion, first run.
55 * 3 10/07/98 6:27p Dave
56 * Globalized mission and campaign file extensions. Removed Silent Threat
57 * special code. Moved \cache \players and \multidata into the \data
60 * 2 10/07/98 10:52a Dave
63 * 1 10/07/98 10:48a Dave
65 * 37 9/21/98 8:46p Dave
66 * Put in special check in fred for identifying unknown ships.
68 * 36 8/17/98 5:07p Dave
69 * First rev of corkscrewing missiles.
71 * 35 5/13/98 11:34p Mike
72 * Model caching system.
74 * 34 5/09/98 4:52p Lawrance
75 * Implement padlock view (up/rear/left/right)
77 * 33 4/01/98 5:34p John
78 * Made only the used POFs page in for a level. Reduced some interp
79 * arrays. Made custom detail level work differently.
81 * 32 3/31/98 5:18p John
82 * Removed demo/save/restore. Made NDEBUG defined compile. Removed a
83 * bunch of debug stuff out of player file. Made model code be able to
84 * unload models and malloc out only however many models are needed.
87 * 31 3/30/98 2:38p Mike
88 * Add asteroid_density to detail level support.
89 * No force explosion damage in training missions.
90 * Make cargo deathrolls shorter.
92 * 30 3/23/98 5:19p John
93 * Upped number of default detail levels to 4
95 * 29 3/22/98 2:41p John
96 * Added lighting into the detail structure.
98 * 28 3/22/98 11:06a John
99 * Changed default detail levels
101 * 27 3/22/98 11:02a John
102 * Made a bunch of the detail levels actually do something
104 * 26 3/22/98 9:53a John
105 * Added in first stage of new detail level stuff
107 * 25 3/17/98 3:53p Lawrance
108 * Fix warpout in chase view
110 * 24 2/28/98 7:03p Lawrance
111 * get slew working in any view
113 * 23 2/26/98 12:33a Lawrance
114 * Added back slew mode, lots of changes to external and chase views.
116 * 22 2/10/98 9:06a John
117 * Added variables for restoring
119 * 21 2/03/98 9:25p John
120 * Upgraded Direct3D code to new version 5.0 code. Separated the D3D code
121 * more. Added a global variable D3D_enabled flag.
123 * 20 1/13/98 2:20p John
124 * Added code to load palette based on hud color. Added code to turn off
125 * nebulas using detail. Added code in WinMain to time out after waiting
126 * too long for window creation.
128 * 19 12/19/97 12:03p Allender
129 * Added GM_CAMPAIGN_MODE to indicate when player is in a campaign or not.
130 * Started adding FreeSpace support for carrying of ship/weapon types
131 * across missions in a campaign.
133 * 18 12/16/97 6:20p Hoffoss
134 * Added more debugging code for demos, and fixed a bug in demo
135 * recording/playback.
137 * 17 12/05/97 3:46p John
138 * made ship thruster glow scale instead of being an animation.
140 * 16 9/22/97 5:12p Dave
141 * Added stats transfer game _mode_. Started work on multiplayer chat
142 * screens for weapon and ship select
144 * 15 8/04/97 5:28p Dave
145 * Moved Game bit GM_GAME_HOST to a netinfo flag NETINFO_FLAG_GAME_HOST
147 * 14 8/04/97 4:37p Dave
148 * Added GM_STANDALONE_SERVER and GM_GAME_HOST game mode bits
150 * 13 8/04/97 10:21a Dave
151 * Added Is_standalone global var
153 * 12 7/29/97 10:59a Dave
154 * Added demo recording and demo playback bit flags
156 * 11 6/24/97 6:21p John
157 * added detail flags.
158 * sped up motion debris system a bit.
160 * 10 6/09/97 10:38a Allender
161 * added GAME_MODE_IN_GAME flag. Probably to be used only for multiplayer
163 * 9 5/07/97 1:44p Mike
164 * Add viewing from other ships.
166 * 8 4/16/97 3:24p Mike
169 * 7 4/15/97 11:28p Mike
170 * External view system
172 * 6 4/15/97 4:00p Mike
173 * Intermediate checkin caused by getting other files. Working on camera
176 * 5 4/11/97 5:02p Mike
177 * Improve death sequence, clean up sequencing.
179 * 4 4/08/97 8:47a John
180 * Added a global varible for detail level
182 * 3 4/02/97 6:03p Mike
183 * Make dying work through event driven code.
185 * 2 4/01/97 11:07p Mike
186 * Clean up game sequencing functions. Get rid of Multiplayer and add
187 * Game_mode. Add SystemVars.cpp
189 * 1 4/01/97 10:59p Mike
194 #ifndef _SYSTEMVARS_H
195 #define _SYSTEMVARS_H
200 #define GM_MULTIPLAYER (1 << 0)
201 #define GM_NORMAL (1 << 1)
202 #define GM_DEAD_DIED (1 << 2) // Died, waiting to blow up.
203 #define GM_DEAD_BLEW_UP (1 << 3) // Blew up.
204 #define GM_DEAD_ABORTED (1 << 4) // Player pressed a key, aborting death sequence.
205 #define GM_IN_MISSION (1 << 5) // Player is actually in the mission -- not at a pre-mission menu
207 #define GM_DEAD (GM_DEAD_DIED | GM_DEAD_BLEW_UP | GM_DEAD_ABORTED)
209 #define GM_STANDALONE_SERVER (1 << 8)
210 #define GM_STATS_TRANSFER (1 << 9) // in the process of stats transfer
211 #define GM_CAMPAIGN_MODE (1 << 10) // are we currently in a campaign.
213 #define GM_DEMO_RECORD (1 << 11) // recording a demo
214 #define GM_DEMO_PLAYBACK (1 << 12) // playing a demo back
215 #define GM_DEMO (GM_DEMO_RECORD | GM_DEMO_PLAYBACK) // true whenever a demo is being recorded or played back
217 #define VM_EXTERNAL (1 << 0) // Set if not viewing from player position.
218 #define VM_SLEWED (1 << 1) // Set if viewer orientation is slewed.
219 #define VM_DEAD_VIEW (1 << 2) // Set if viewer is watching from dead view.
220 #define VM_CHASE (1 << 3) // Chase view.
221 #define VM_OTHER_SHIP (1 << 4) // View from another ship.
222 #define VM_EXTERNAL_CAMERA_LOCKED (1 << 5) // External camera is locked in place (ie controls move ship not camera)
223 #define VM_WARP_CHASE (1 << 6) // View while warping out (form normal view mode)
224 #define VM_PADLOCK_UP (1 << 7)
225 #define VM_PADLOCK_REAR (1 << 8)
226 #define VM_PADLOCK_LEFT (1 << 9)
227 #define VM_PADLOCK_RIGHT (1 << 10)
228 #define VM_WARPIN_ANCHOR (1 << 11) // special warpin camera mode
230 #define VM_PADLOCK_ANY (VM_PADLOCK_UP|VM_PADLOCK_REAR|VM_PADLOCK_LEFT|VM_PADLOCK_RIGHT)
234 angles_t angles; // Angles defining viewer location.
235 float distance; // Distance from which to view, plus 2x radius.
240 float distance; // Distance from which to view, plus 3x radius
243 extern fix Missiontime;
244 extern fix Frametime;
245 extern int Framecount;
247 extern int Game_mode;
249 extern int Viewer_mode;
250 extern int Rand_count;
252 extern int Game_restoring; // If set, this means we are restoring data from disk
254 // The detail level. Anything below zero draws simple models earlier than it
255 // should. Anything above zero draws higher detail models longer than it should.
261 extern int Game_detail_level;
263 #define DETAIL_DEFAULT (0xFFFFFFFF)
265 #define DETAIL_FLAG_STARS (1<<0) // draw the stars
266 #define DETAIL_FLAG_NEBULAS (1<<1) // draw the motion debris
267 #define DETAIL_FLAG_MOTION (1<<2) // draw the motion debris
268 #define DETAIL_FLAG_PLANETS (1<<3) // draw planets
269 #define DETAIL_FLAG_MODELS (1<<4) // draw models not as blobs
270 #define DETAIL_FLAG_LASERS (1<<5) // draw lasers not as pixels
271 #define DETAIL_FLAG_CLEAR (1<<6) // clear screen background after each frame
272 #define DETAIL_FLAG_HUD (1<<7) // draw hud stuff
273 #define DETAIL_FLAG_FIREBALLS (1<<8) // draw fireballs
274 #define DETAIL_FLAG_COLLISION (1<<9) // use good collision detection
276 #define DETAIL_FLAG_ENGINE_GLOWS (1<<10) // engine glows
280 extern uint Game_detail_flags;
282 extern angles_t Viewer_slew_angles;
283 extern vei Viewer_external_info;
284 extern vci Viewer_chase_info;
286 extern int Is_standalone;
287 extern int Interface_framerate; // show interface framerate during flips
288 extern int Interface_last_tick; // last timer tick on flip
290 // for notifying players of unknown ship types
291 extern int Fred_found_unknown_ship_during_parsing;
293 #define NOISE_NUM_FRAMES 15
295 // Noise numbers go from 0 to 1.0
296 extern float Noise[NOISE_NUM_FRAMES];
299 // If true, then we are using Direct3D hardware. This is used for game type stuff
300 // that changes when you're using hardware.
301 extern int D3D_enabled;
304 #define NUM_SKILL_LEVELS 5
306 //====================================================================================
307 // DETAIL LEVEL STUFF
308 // If you change any of this, be sure to increment the player file version
309 // in Freespace\ManagePilot.cpp and change Detail_defaults in SystemVars.cpp
310 // or bad things will happen, I promise.
311 //====================================================================================
313 #define MAX_DETAIL_LEVEL 4 // The highest valid value for the "analog" detail level settings
315 // If you change this, update player file in ManagePilot.cpp
316 typedef struct detail_levels {
318 int setting; // Which default setting this was created from. 0=lowest... NUM_DEFAULT_DETAIL_LEVELS-1, -1=Custom
321 int nebula_detail; // 0=lowest detail, MAX_DETAIL_LEVEL=highest detail
322 int detail_distance; // 0=lowest MAX_DETAIL_LEVEL=highest
323 int hardware_textures; // 0=max culling, MAX_DETAIL_LEVEL=no culling
324 int num_small_debris; // 0=min number, MAX_DETAIL_LEVEL=max number
325 int num_particles; // 0=min number, MAX_DETAIL_LEVEL=max number
326 int num_stars; // 0=min number, MAX_DETAIL_LEVEL=max number
327 int shield_effects; // 0=min, MAX_DETAIL_LEVEL=max
328 int lighting; // 0=min, MAX_DETAIL_LEVEL=max
331 int targetview_model; // 0=off, 1=on
332 int planets_suns; // 0=off, 1=on
333 int weapon_extras; // extra weapon details. trails, glows
335 int engine_glows; // 0=off, 1=on
339 // Global values used to access detail levels in game and libs
340 extern detail_levels Detail;
342 #define NUM_DEFAULT_DETAIL_LEVELS 4 // How many "predefined" detail levels there are
346 // NUM_DEFAULT_DETAIL_LEVELS - highest
347 // To set the parameters in Detail to some set of defaults
348 void detail_level_set(int level);
350 // Returns the current detail level or -1 if custom.
351 int current_detail_level();
353 //====================================================================================
354 // Memory stuff from WinDebug.cpp
356 void windebug_memwatch_init();