Open source remastering of the Freespace 2 engine
freespace.h File Reference
#include "camera/camera.h"
#include "globalincs/pstypes.h"
#include "globalincs/systemvars.h"
#include "graphics/2d.h"

Go to the source code of this file.


struct  fs_builtin_mission


#define FS_CAMPAIGN_FILE_EXT   NOX(".fc2")
#define FSB_FROM_VOLITION   (1<<0)
#define FSB_MULTI   (1<<1)
#define FSB_TRAINING   (1<<2)
#define FSB_CAMPAIGN   (1<<3)
#define FSB_CAMPAIGN_FILE   (1<<4)


typedef struct fs_builtin_mission fs_builtin_mission


int game_start_mission ()
void game_level_close ()
void game_stop_time ()
void game_start_time ()
int game_check_key ()
int game_poll ()
void game_process_keys ()
void lock_time_compression (bool is_locked)
void set_time_compression (float multiplier, float change_time=0)
void change_time_compression (float multiplier)
void game_set_frametime (int state)
fix game_get_overall_frametime ()
void game_stop_looped_sounds ()
void game_do_state_common (int state, int no_networking=0)
void game_increase_skill_level ()
int game_get_default_skill_level ()
void game_flush ()
bool game_using_low_mem ()
fs_builtin_missiongame_find_builtin_mission (char *filename)
void game_flash_reset ()
void game_flash (float r, float g, float b)
void big_explosion_flash (float flash)
void game_flash_diminish ()
void game_whack_reset ()
void game_whack_apply (float x, float y)
void game_shudder_apply (int time, float intensity)
int game_do_cd_check (char *volume_name=NULL)
int game_do_cd_check_specific (char *volume_name, int cdnum)
int find_freespace_cd (char *volume_name=NULL)
int set_cdrom_path (int drive_num)
void game_feature_disabled_popup ()
void get_version_string (char *str, int max_size)
void game_format_time (fix m_time, char *time_str)
int game_hacked_data ()
void oem_upsell_show_screens ()
void game_pause ()
void game_unpause ()
void game_level_init ()
void game_post_level_init ()
camid game_render_frame_setup ()
void game_render_frame (camid cid)
void game_simulation_frame ()
void game_update_missiontime ()
void game_render_post_frame ()


fix Frametime
float flRealframetime
float flFrametime
fix Missiontime
int Last_frame_timestamp
fix Skybox_timestamp
int Game_skill_level
int Game_mode
int Game_do_state_should_skip
bool Time_compression_locked
fix Game_time_compression
int Game_subspace_effect
char Game_current_mission_filename [MAX_FILENAME_LEN]
char Game_CDROM_dir [MAX_PATH_LEN]
int Game_ships_tbl_valid
int Game_weapons_tbl_valid
int Networking_disabled
camid Main_camera

Macro Definition Documentation

#define FS_CAMPAIGN_FILE_EXT   NOX(".fc2")

Definition at line 26 of file freespace.h.


Definition at line 29 of file freespace.h.


Definition at line 30 of file freespace.h.


Definition at line 31 of file freespace.h.

#define FSB_CAMPAIGN   (1<<3)

Definition at line 79 of file freespace.h.

#define FSB_CAMPAIGN_FILE   (1<<4)

Definition at line 80 of file freespace.h.

#define FSB_FROM_VOLITION   (1<<0)

Definition at line 76 of file freespace.h.

#define FSB_MULTI   (1<<1)

Definition at line 77 of file freespace.h.

#define FSB_TRAINING   (1<<2)

Definition at line 78 of file freespace.h.


Definition at line 75 of file freespace.h.

Typedef Documentation

Function Documentation

void big_explosion_flash ( float  flash)

Adds a flash for Big Ship explosions

flashflash intensity. Range capped from 0 to 1.

Definition at line 164 of file fredstubs.cpp.

void change_time_compression ( float  multiplier)

Definition at line 228 of file fredstubs.cpp.

int find_freespace_cd ( char *  volume_name = NULL)

Definition at line 193 of file fredstubs.cpp.

int game_check_key ( )

Definition at line 65 of file fredstubs.cpp.

int game_do_cd_check ( char *  volume_name = NULL)

Definition at line 166 of file fredstubs.cpp.

int game_do_cd_check_specific ( char *  volume_name,
int  cdnum 

Definition at line 8377 of file freespace.cpp.

void game_do_state_common ( int  state,
int  no_networking = 0 

Definition at line 195 of file fredstubs.cpp.

void game_feature_disabled_popup ( )

Definition at line 219 of file fredstubs.cpp.

fs_builtin_mission* game_find_builtin_mission ( char *  filename)

Definition at line 203 of file fredstubs.cpp.

void game_flash ( float  r,
float  g,
float  b 

Adds a flash effect.

These can be positive or negative. The range will get capped at around -1 to 1, so stick with a range like that.

rred colour value
ggreen colour value
bblue colour value

Definition at line 40 of file fredstubs.cpp.

void game_flash_diminish ( )
void game_flash_reset ( )

Definition at line 549 of file freespace.cpp.

void game_flush ( )

Definition at line 83 of file fredstubs.cpp.

void game_format_time ( fix  m_time,
char *  time_str 

Definition at line 204 of file fredstubs.cpp.

int game_get_default_skill_level ( )

Definition at line 190 of file fredstubs.cpp.

fix game_get_overall_frametime ( )

Definition at line 230 of file fredstubs.cpp.

int game_hacked_data ( )

Definition at line 208 of file fredstubs.cpp.

void game_increase_skill_level ( )

Definition at line 197 of file fredstubs.cpp.

void game_level_close ( )

Definition at line 182 of file fredstubs.cpp.

void game_level_init ( )

Intializes game stuff.

0 on failure, 1 on success

Definition at line 233 of file fredstubs.cpp.

void game_pause ( )

Definition at line 221 of file fredstubs.cpp.

int game_poll ( )

Definition at line 70 of file fredstubs.cpp.

void game_post_level_init ( )

Called after mission is loaded.

Because player isn't created until after mission loads, some things must get initted after the level loads

Definition at line 234 of file fredstubs.cpp.

void game_process_keys ( )

Definition at line 1612 of file keycontrol.cpp.

void game_render_frame ( camid  cid)

Definition at line 236 of file fredstubs.cpp.

camid game_render_frame_setup ( )

Definition at line 235 of file fredstubs.cpp.

void game_render_post_frame ( )

Definition at line 239 of file fredstubs.cpp.

void game_set_frametime ( int  state)

Definition at line 196 of file fredstubs.cpp.

void game_shudder_apply ( int  time,
float  intensity 

Definition at line 207 of file fredstubs.cpp.

void game_simulation_frame ( )

Definition at line 237 of file fredstubs.cpp.

int game_start_mission ( )

Tells the server to load the mission and initialize structures

Definition at line 179 of file fredstubs.cpp.

void game_start_time ( )

Definition at line 188 of file fredstubs.cpp.

void game_stop_looped_sounds ( )

Definition at line 168 of file fredstubs.cpp.

void game_stop_time ( )

Definition at line 189 of file fredstubs.cpp.

void game_unpause ( )

Definition at line 222 of file fredstubs.cpp.

void game_update_missiontime ( )

Definition at line 238 of file fredstubs.cpp.

bool game_using_low_mem ( )

Definition at line 8754 of file freespace.cpp.

void game_whack_apply ( float  x,
float  y 

Definition at line 138 of file fredstubs.cpp.

void game_whack_reset ( )

Definition at line 3058 of file freespace.cpp.

void get_version_string ( char *  str,
int  max_size 

Definition at line 198 of file fredstubs.cpp.

void lock_time_compression ( bool  is_locked)

Definition at line 227 of file fredstubs.cpp.

void oem_upsell_show_screens ( )
int set_cdrom_path ( int  drive_num)

Definition at line 192 of file fredstubs.cpp.

void set_time_compression ( float  multiplier,
float  change_time = 0 

Definition at line 229 of file fredstubs.cpp.

Variable Documentation

float flFrametime

Definition at line 22 of file fredstubs.cpp.

float flRealframetime

Definition at line 226 of file fredstubs.cpp.

fix Frametime

Definition at line 21 of file systemvars.cpp.

char Game_CDROM_dir[MAX_PATH_LEN]

Definition at line 38 of file fredstubs.cpp.

char Game_current_mission_filename[MAX_FILENAME_LEN]

Definition at line 26 of file fredstubs.cpp.

int Game_do_state_should_skip

Definition at line 201 of file fredstubs.cpp.

int Game_mode

Definition at line 24 of file systemvars.cpp.

int Game_ships_tbl_valid

Definition at line 181 of file fredstubs.cpp.

int Game_skill_level

Definition at line 170 of file fredstubs.cpp.

int Game_subspace_effect

Definition at line 163 of file fredstubs.cpp.

fix Game_time_compression

Definition at line 202 of file fredstubs.cpp.

int Game_weapons_tbl_valid

Definition at line 180 of file fredstubs.cpp.

int Last_frame_timestamp

Definition at line 2351 of file controlsconfig.cpp.

camid Main_camera

Definition at line 25 of file camera.cpp.

fix Missiontime

Definition at line 19 of file systemvars.cpp.

int Networking_disabled

Definition at line 32 of file fredstubs.cpp.

fix Skybox_timestamp

Definition at line 20 of file systemvars.cpp.

bool Time_compression_locked

Definition at line 225 of file fredstubs.cpp.