2 * $Logfile: /Freespace2/code/FREESPACE2/FreeSpace.h $
7 * FreeSpace, the game, not the project, header information.
10 * Revision 1.1 2002/05/03 03:28:12 root
14 * 24 10/06/99 10:32a Jefff
17 * 23 9/30/99 6:04p Jefff
20 * 22 9/08/99 3:22p Dave
21 * Updated builtin mission list.
23 * 21 9/06/99 6:38p Dave
24 * Improved CD detection code.
26 * 20 9/06/99 1:30a Dave
27 * Intermediate checkin. Started on enforcing CD-in-drive to play the
30 * 19 9/06/99 1:16a Dave
31 * Make sure the user sees the intro movie.
33 * 18 9/05/99 11:19p Dave
34 * Made d3d texture cache much more safe. Fixed training scoring bug where
35 * it would backout scores without ever having applied them in the first
38 * 17 9/03/99 1:32a Dave
39 * CD checking by act. Added support to play 2 cutscenes in a row
40 * seamlessly. Fixed super low level cfile bug related to files in the
41 * root directory of a CD. Added cheat code to set campaign mission # in
44 * 16 8/19/99 10:12a Alanl
45 * preload mission-specific messages on machines greater than 48MB
47 * 15 5/19/99 4:07p Dave
48 * Moved versioning code into a nice isolated common place. Fixed up
49 * updating code on the pxo screen. Fixed several stub problems.
51 * 14 5/09/99 8:57p Dave
52 * Final E3 build preparations.
54 * 13 5/05/99 10:06a Dave
55 * Upped beta version to 0.04
57 * 12 4/29/99 3:02p Dave
60 * 11 4/25/99 3:02p Dave
61 * Build defines for the E3 build.
63 * 10 4/09/99 2:27p Dave
66 * 9 4/09/99 2:21p Dave
67 * Multiplayer beta stuff. CD checking.
69 * 8 4/08/99 2:10a Dave
70 * Numerous bug fixes for the beta. Added builtin mission info for the
73 * 7 3/19/99 9:52a Dave
74 * Checkin to repair massive source safe crash. Also added support for
75 * pof-style nebulae, and some new weapons code.
77 * 6 12/03/98 5:22p Dave
78 * Ported over Freespace 1 multiplayer ships.tbl and weapons.tbl
81 * 5 10/13/98 9:26a Dave
82 * Began neatening up freespace.h.
84 * 4 10/09/98 1:35p Dave
85 * Split off registry stuff into seperate file.
87 * 3 10/07/98 6:27p Dave
88 * Globalized mission and campaign file extensions. Removed Silent Threat
89 * special code. Moved \cache \players and \multidata into the \data
92 * 2 10/07/98 10:54a Dave
95 * 79 9/13/98 10:51p Dave
96 * Put in newfangled icons for mission simulator room. New mdisk.vp
97 * checksum and file length.
99 * 78 9/11/98 6:59p Dave
100 * First beta/rev thingie to interplay.
102 * 77 9/11/98 4:14p Dave
103 * Fixed file checksumming of < file_size. Put in more verbose kicking and
104 * PXO stats store reporting.
106 * 76 9/04/98 3:51p Dave
107 * Put in validated mission updating and application during stats
110 * 75 5/23/98 2:41p Mike
111 * Make Easy the default skill level and prevent old pilot's skill level
112 * from carrying into new pilot.
114 * 74 5/19/98 1:19p Allender
115 * new low level reliable socket reading code. Make all missions/campaign
116 * load/save to data missions folder (i.e. we are rid of the player
119 * 73 5/13/98 11:34p Mike
120 * Model caching system.
122 * 72 5/10/98 10:05p Allender
123 * only show cutscenes which have been seen before. Made Fred able to
124 * write missions anywhere, defaulting to player misison folder, not data
125 * mission folder. Fix FreeSpace code to properly read missions from
128 * 71 5/08/98 7:08p Dave
129 * Lots of UI tweaking.
131 * 70 5/08/98 5:31p Lawrance
132 * extern cd checking routines
139 #ifndef STAMPER_PROGRAM // because of all the dependancies, I have to do this...yuck!!! MWA 7/21/97
142 #include "systemvars.h"
145 // --------------------------------------------------------------------------------------------------------
146 // FREESPACE DEFINES/VARS
149 // filename extensions
150 #define FS_MISSION_FILE_EXT NOX(".fs2")
151 #define FS_CAMPAIGN_FILE_EXT NOX(".fc2")
153 // CDROM volume names
154 #ifdef MULTIPLAYER_BETA_BUILD
155 #define FS_CDROM_VOLUME_1 NOX("FS2_BETA")
156 #define FS_CDROM_VOLUME_2 NOX("FS2_BETA")
157 #elif defined(E3_BUILD)
158 #define FS_CDROM_VOLUME_1 NOX("FS2_E3DEMO")
159 #define FS_CDROM_VOLUME_2 NOX("FS2_E3DEMO")
160 #elif defined(OEM_BUILD)
161 #define FS_CDROM_VOLUME_1 NOX("FS2_OEM")
162 #define FS_CDROM_VOLUME_2 NOX("FS2_OEM")
163 #define FS_CDROM_VOLUME_3 NOX("FS2_OEM")
165 #define FS_CDROM_VOLUME_1 NOX("FREESPACE2_1")
166 #define FS_CDROM_VOLUME_2 NOX("FREESPACE2_2")
167 #define FS_CDROM_VOLUME_3 NOX("FREESPACE2_3")
170 // #define FS_CDROM_VOLUME_1 NOX("FREESPACE_1")
171 // #define FS_CDROM_VOLUME_2 NOX("FREESPACE_2")
172 // #define FS_CDROM_VOLUME_3 NOX("FREESPACE_3")
175 // frametime/missiontime variables
176 extern fix Frametime;
177 extern float flFrametime;
178 extern fix Missiontime;
181 extern int Game_skill_level;
183 // see GM_* defines in systemvars.h
184 extern int Game_mode;
186 // if this value is set anywhere within the game_do_state_common() function, the normal do_state() will not be called
187 // for this frame. Useful for getting out of sticky sequencing situations.
188 extern int Game_do_state_should_skip;
191 extern fix Game_time_compression;
193 // Set if subspace is active this level
194 extern int Game_subspace_effect;
196 // The current mission being played.
197 extern char Game_current_mission_filename[MAX_FILENAME_LEN];
199 // game's CDROM directory
200 extern char Game_CDROM_dir[MAX_PATH_LEN];
202 // if the ships.tbl the player has is valid
203 extern int Game_ships_tbl_valid;
205 // if the weapons.tbl the player has is valid
206 extern int Game_weapons_tbl_valid;
209 // this is a mission actually designed at Volition
210 #define MAX_BUILTIN_MISSIONS 100
211 #define FSB_FROM_VOLITION (1<<0) // we made it in-house
212 #define FSB_MULTI (1<<1) // is a multiplayer mission
213 #define FSB_TRAINING (1<<2) // is a training mission
214 #define FSB_CAMPAIGN (1<<3) // is a campaign mission
215 #define FSB_CAMPAIGN_FILE (1<<4) // is actually a campaign file
217 typedef struct fs_builtin_mission {
218 char filename[MAX_FILENAME_LEN];
219 int flags; // see FSB_* defines above
220 char cd_volume[MAX_FILENAME_LEN]; // cd volume which this needs
221 } fs_builtin_mission;
224 // --------------------------------------------------------------------------------------------------------
225 // FREESPACE FUNCTIONS
228 // mission management -------------------------------------------------
230 // loads in the currently selected mission
231 int game_start_mission();
233 // shutdown a mission
234 void game_level_close();
237 // gameplay stuff -----------------------------------------------------
239 // stop the game (mission) timer
240 void game_stop_time();
242 // start the game (mission) timer
243 void game_start_time();
245 // call whenever in a loop or if you need to get a keypress
246 int game_check_key();
248 // poll for keypresses
251 // function to read keyboard stuff
252 void game_process_keys();
254 // call this to set frametime properly (once per frame)
255 void game_set_frametime(int state);
257 // Used to halt all looping game sounds
258 void game_stop_looped_sounds();
260 // do stuff that may need to be done regardless of state
261 void game_do_state_common(int state,int no_networking = 0);
264 // skill level --------------------------------------------------------
266 // increase the skill level (will wrap around to min skill level)
267 void game_increase_skill_level();
269 // get the default game skill level
270 int game_get_default_skill_level();
272 // a keypress. See CPP file for more info.
275 // running with low-memory (less than 48MB)
276 bool game_using_low_mem();
278 // misc ---------------------------------------------------------------
280 // lookup the specified filename. return an fs_builtin_mission* if found, NULL otherwise
281 fs_builtin_mission *game_find_builtin_mission(char *filename);
285 //================================================================
286 // GAME FLASH STUFF - code in FreeSpace.cpp
289 void game_flash_reset();
291 // Adds a flash effect. These can be positive or negative.
292 // The range will get capped at around -1 to 1, so stick
293 // with a range like that.
294 void game_flash( float r, float g, float b );
296 // Adds a flash for Big Ship explosions
297 // cap range from 0 to 1
298 void big_explosion_flash(float flash);
300 // Call once a frame to diminish the
301 // flash effect to 0.
302 void game_flash_diminish();
304 // Loads the best palette for this level, based
305 // on nebula color and hud color. You could just call palette_load_table with
306 // the appropriate filename, but who wants to do that.
307 void game_load_palette();
309 //================================================================
311 // Call at the beginning of each frame
312 void game_whack_reset();
314 // Call to apply a whack to a the ship. Used for force feedback
315 void game_whack_apply( float x, float y );
317 // call to apply a "shudder"
318 void game_shudder_apply(int time, float intensity);
320 //===================================================================
322 // make sure a CD is in the drive before continuing (returns 1 to continue, otherwise 0).
323 int game_do_cd_check(char *volume_name=NULL);
324 int game_do_cd_check_specific(char *volume_name, int cdnum);
325 int find_freespace_cd(char *volume_name=NULL);
326 int set_cdrom_path(int drive_num);
327 int game_do_cd_mission_check(char *filename);
329 // Used to tell the player that a feature isn't available in the demo version of FreeSpace
330 void game_feature_not_in_demo_popup();
332 // Return version string for demo or full version, depending on build.
333 void get_version_string(char *str);
335 // format the specified time (fixed point) into a nice string
336 void game_format_time(fix m_time,char *time_str);
338 // if the game is running using hacked data
339 int game_hacked_data();
341 // show the oem upsell screens (end of campaign, or close of game
342 void oem_upsell_show_screens();
344 #endif // endif of #ifndef STAMPER_PROGRAM