170 __declspec(dllexport)
DWORD NvOptimusEnablement = 0x00000001;
171 __declspec(dllexport)
int AmdPowerXpressRequestHighPerformance = 1;
177 #error macro FRED is defined when trying to build release FreeSpace. Please undefine FRED macro in build settings
220 #define FRAME_FILTER 16
222 #define DEFAULT_SKILL_LEVEL 1
225 #define EXE_FNAME ("fs2.exe")
227 #define LAUNCHER_FNAME ("Launcher.exe")
255 int Show_framerate = 0;
272 static int Show_player_pos = 0;
312 static int Game_paused;
314 #define EXPIRE_BAD_CHECKSUM 1
315 #define EXPIRE_BAD_TIME 2
332 #define DUMP_BUFFER_NUM_FRAMES 1 // store every 15 frames
336 #define PLAYER_DIED_POPUP_WAIT 2500
500 static int Game_title_bitmap = -1;
501 static int Game_title_logo = -1;
534 if(!
stricmp(Game_builtin_mission_list[idx].filename, filename)){
535 return &Game_builtin_mission_list[
idx];
551 Game_flash_red = 0.0f;
552 Game_flash_green = 0.0f;
553 Game_flash_blue = 0.0f;
566 Gf_critical_time = 0.0f;
582 if(Framerate >= Gf_critical){
586 if (!Show_framerate) {
591 if(Framerate < Gf_critical){
628 Game_flash_green +=
g;
629 Game_flash_blue +=
b;
631 if ( Game_flash_red < -1.0
f ) {
632 Game_flash_red = -1.0f;
633 }
else if ( Game_flash_red > 1.0
f ) {
634 Game_flash_red = 1.0f;
637 if ( Game_flash_green < -1.0
f ) {
638 Game_flash_green = -1.0f;
639 }
else if ( Game_flash_green > 1.0
f ) {
640 Game_flash_green = 1.0f;
643 if ( Game_flash_blue < -1.0
f ) {
644 Game_flash_blue = -1.0f;
645 }
else if ( Game_flash_blue > 1.0
f ) {
646 Game_flash_blue = 1.0f;
665 #define DIMINISH_RATE 0.75f
666 #define SUN_DIMINISH_RATE 6.00f
671 DCF(sn_glare,
"Sets the sun glare scale (Default is 1.7)")
684 float Sun_spot_goal = 0.0f;
703 dot = dot * (0.5f + (pct * 0.5f));
715 Supernova_last_glare = Sun_spot_goal;
721 Sun_spot_goal = 0.9f;
724 if(Sun_spot_goal > 1.0
f){
725 Sun_spot_goal = 1.0f;
729 Supernova_last_glare = Sun_spot_goal;
736 if(Supernova_last_glare > 2.0
f){
737 Supernova_last_glare = 2.0f;
746 Sun_spot_goal = 0.0f;
752 for(idx=0; idx<n_lights; idx++) {
755 if ( (ls_on && !ls_force_off) || !in_shadow ) {
762 Sun_spot_goal += (
float)pow(dot,85.0
f);
777 if ( Sun_spot < Sun_spot_goal ) {
778 Sun_spot += dec_amount;
779 if ( Sun_spot > Sun_spot_goal ) {
780 Sun_spot = Sun_spot_goal;
782 }
else if ( Sun_spot > Sun_spot_goal ) {
783 Sun_spot -= dec_amount;
784 if ( Sun_spot < Sun_spot_goal ) {
785 Sun_spot = Sun_spot_goal;
799 if ( Game_flash_red > 0.0
f ) {
800 Game_flash_red -= dec_amount;
801 if ( Game_flash_red < 0.0
f )
802 Game_flash_red = 0.0f;
804 Game_flash_red += dec_amount;
805 if ( Game_flash_red > 0.0
f )
806 Game_flash_red = 0.0f;
809 if ( Game_flash_green > 0.0
f ) {
810 Game_flash_green -= dec_amount;
811 if ( Game_flash_green < 0.0
f )
812 Game_flash_green = 0.0f;
814 Game_flash_green += dec_amount;
815 if ( Game_flash_green > 0.0
f )
816 Game_flash_green = 0.0f;
819 if ( Game_flash_blue > 0.0
f ) {
820 Game_flash_blue -= dec_amount;
821 if ( Game_flash_blue < 0.0
f )
822 Game_flash_blue = 0.0f;
824 Game_flash_blue += dec_amount;
825 if ( Game_flash_blue > 0.0
f )
826 Game_flash_blue = 0.0f;
831 #define TIME_DOWN 2500
834 if (time > -duration) {
844 if ( Use_palette_flash ) {
848 r =
fl2i( Game_flash_red*128.0
f );
849 g =
fl2i( Game_flash_green*128.0f );
850 b =
fl2i( Game_flash_blue*128.0f );
852 if ( Sun_spot > 0.0f && (!ls_on || ls_force_off)) {
853 r +=
fl2i(Sun_spot*128.0f);
854 g +=
fl2i(Sun_spot*128.0f);
855 b +=
fl2i(Sun_spot*128.0f);
864 if ( r < 0 ) r = 0;
else if ( r > 255 ) r = 255;
865 if ( g < 0 ) g = 0;
else if ( g > 255 ) g = 255;
866 if ( b < 0 ) b = 0;
else if ( b > 255 ) b = 255;
868 if ( (r!=0) || (g!=0) || (b!=0) ) {
935 Error(
LOCATION,
"Scripting Mission End override is not fully supported yet.");
953 load_gl_init = (
uint) time(NULL);
972 Game_shudder_time = -1;
982 Multi_ping_timestamp = -1;
988 mprintf((
"Beginning level bitmap paging...\n" ));
1023 Pre_player_entry = 1;
1045 Last_view_target = NULL;
1053 Env_cubemap_drawn =
false;
1105 #define COUNT_ESTIMATE 425
1122 static int busy_shader_created = 0;
1125 static int framenum;
1136 Assert( Game_loading_callback_inited==1 );
1137 Assertion( Game_loading_ani.
num_frames > 0,
"Load Screen animation %s not found, or corrupted. Needs to be an animation with at least 1 frame.", Game_loading_ani.
filename );
1142 if ( new_framenum > Game_loading_ani.
num_frames-1 ) {
1143 new_framenum = Game_loading_ani.
num_frames-1;
1144 }
else if ( new_framenum < 0 ) {
1148 if(new_framenum > framenum)
1149 framenum = new_framenum;
1153 if ( Game_loading_background > -1 ) {
1169 if (!busy_shader_created) {
1171 busy_shader_created = 1;
1174 if (Processing_filename[0] !=
'\0') {
1190 void memblockinfo_sort();
1191 void memblockinfo_sort_get_entry(
int index,
char *filename,
int *
size);
1193 char mem_buffer[1000];
1199 memblockinfo_sort();
1200 for(i = 0; i < 30; i++)
1202 memblockinfo_sort_get_entry(i, filename, &size);
1209 char *short_name = strrchr(filename,
'\\');
1210 if(short_name == NULL)
1215 sprintf(mem_buffer,
"%s:\t%d K", short_name, size);
1230 Assert( Game_loading_callback_inited==0 );
1234 if (Game_loading_background < 0)
1239 Assertion( Game_loading_ani.
num_frames > 0,
"Load Screen animation %s not found, or corrupted. Needs to be an animation with at least 1 frame.", Game_loading_ani.
filename );
1241 Game_loading_callback_inited = 1;
1251 Assert( Game_loading_callback_inited==1 );
1259 Game_loading_callback_inited = 0;
1262 mprintf((
"=================== ENDING LOAD ================\n" ));
1264 mprintf((
"================================================\n" ));
1274 Game_loading_background = -1;
1300 Game_sound_env_update_timestamp =
timestamp(1);
1312 mprintf((
"=================== STARTING LEVEL DATA LOAD ==================\n" ));
1320 game_busy(
NOX(
"** preloading common game sounds **") );
1328 game_busy(
NOX(
"** assigning sound environment for mission **") );
1343 game_busy(
NOX(
"** finished with level_page_in() **") );
1345 if(Game_loading_callback_inited) {
1418 mprintf((
"=================== STARTING LEVEL LOAD ==================\n" ));
1440 load_mission_load = (
uint) time(NULL);
1449 if ( !(
Game_mode & GM_STANDALONE_SERVER) ) {
1463 game_busy(
NOX(
"** starting game_post_level_init() **") );
1464 load_post_level_init = (
uint) time(NULL);
1479 mprintf((
"Level load took %f seconds.\n", (e1 - s1) / 1000.0
f ));
1488 DCF_BOOL( show_framerate, Show_framerate )
1489 DCF_BOOL( show_target_debug_info, Show_target_debug_info )
1490 DCF_BOOL( show_target_weapons, Show_target_weapons )
1495 DCF_BOOL( player_attacking, Player_attacking_enabled )
1497 DCF_BOOL( show_area_effect, Show_area_effect )
1498 DCF_BOOL( show_net_stats, Show_net_stats )
1501 DCF_BOOL( training_msg_method, Training_message_method )
1502 DCF_BOOL( show_player_pos, Show_player_pos )
1503 DCF_BOOL(i_framerate, Interface_framerate )
1505 DCF(warp, "Tests warpin effect")
1508 dc_printf(
"Params: bool warpin, string Target = ""\n Warps in if true, out if false. Player is target unless specific ship is specified\n" );
1543 DCF(show_mem,
"Toggles showing mem usage")
1545 bool process =
true;
1548 dc_printf(
"Usage: (optional) bool Show_mem\n If true, Show_mem is set and Show_cpu is cleared. If false, then Show_mem is cleared. If nothing passed, then toggle.\n" );
1553 dc_printf(
"Show_mem is %s\n", (Show_mem ?
"TRUE" :
"FALSE"));
1554 dc_printf(
"Show_cpu is %s\n", (Show_cpu ?
"TRUE" :
"FALSE"));
1574 DCF(show_cpu,
"Toggles showing cpu usage")
1576 bool process =
true;
1579 dc_printf(
"Usage: (optional) bool Show_cpu\n If true, Show_cpu is set and Show_mem is cleared. If false, then Show_cpu is cleared. If nothing passed, then toggle.\n" );
1584 dc_printf(
"Show_cpu is %s\n", (Show_cpu ?
"TRUE" :
"FALSE"));
1585 dc_printf(
"Show_mem is %s\n", (Show_mem ?
"TRUE" :
"FALSE"));
1607 DCF(use_joy_mouse,
"Makes joystick move mouse cursor")
1609 bool process =
true;
1612 dc_printf(
"Usage: use_joy_mouse [bool]\nSets use_joy_mouse to true or false. If nothing passed, then toggles it.\n");
1617 dc_printf(
"use_joy_mouse is %s\n", (Use_joy_mouse ?
"TRUE" :
"FALSE"));
1633 DCF_BOOL(palette_flash, Use_palette_flash);
1637 DCF(low_mem,
"Uses low memory settings regardless of RAM")
1639 bool process =
true;
1642 dc_printf(
"Usage: low_mem [bool]\nSets low_mem to true or false. If nothing passed, then toggles it.\n");
1647 dc_printf(
"low_mem is %s\n", (Use_low_mem ?
"TRUE" :
"FALSE"));
1666 DCF(force_fullscreen,
"Forces game to startup in fullscreen mode")
1668 bool process =
true;
1670 dc_printf(
"Usage: low_mem [bool]\nSets low_mem to true or false. If nothing passed, then toggles it.\n");
1675 dc_printf(
"low_mem is %s\n", (Use_fullscreen_at_startup ?
"TRUE" :
"FALSE"));
1696 DCF(gamma,
"Sets and saves Gamma Factor")
1700 dc_printf(
"Sets gamma in range 1-3, no argument resets to default 1.2\n" );
1705 dc_printf(
"Gamma = %.2f\n", FreeSpace_gamma );
1711 FreeSpace_gamma = 1.0f;
1713 if ( FreeSpace_gamma < 0.1
f ) {
1714 FreeSpace_gamma = 0.1f;
1715 }
else if ( FreeSpace_gamma > 5.0
f ) {
1716 FreeSpace_gamma = 5.0f;
1720 char tmp_gamma_string[32];
1721 sprintf( tmp_gamma_string,
NOX(
"%.2f"), FreeSpace_gamma );
1726 char full_path[1024];
1738 Game_current_mission_filename[0] = 0;
1741 Assert(RAND_MAX == 0x7fff || RAND_MAX >= 0x7ffffffd);
1743 int game_init_seed = (
int) time(NULL);
1744 srand( game_init_seed );
1746 Framerate_delay = 0;
1771 #if FS_VERSION_REVIS == 0
1781 memset(whee, 0,
sizeof(whee));
1792 if (
cfile_init(whee, strlen(Game_CDROM_dir) ? Game_CDROM_dir : NULL) ) {
1833 if ( (max_fps > 15) && (max_fps < 120) ) {
1834 Framerate_cap = (
int)max_fps;
1849 mprintf((
"Failed to init speech\n"));
1874 #elif defined(SCP_UNIX)
1875 fprintf(stderr,
"Error initializing graphics!");
1882 fprintf(stderr,
"The default video entry is now in place. Please try running the game again...\n");
1883 fprintf(stderr,
"(edit ~/.fs2_open/fs2_open.ini to change from default resolution)\n");
1895 if(voiceRectOn ==
false)
1905 FreeSpace_gamma = (
float)atof(ptr);
1927 nprintf((
"Network",
"Error reading in PXO login data\n"));
1934 nprintf((
"Network",
"Error reading PXO password\n"));
1943 nprintf((
"Network",
"Error reading in PXO squad name\n"));
1952 (FreeSpace_total_ram < 48*1024*1024) ||
1955 mprintf((
"Using normal memory settings...\n" ));
1958 mprintf((
"Using high memory settings...\n" ));
2070 nprintf((
"General",
"Ships.tbl is : %s\n", Game_ships_tbl_valid ?
"VALID" :
"INVALID!!!!"));
2071 nprintf((
"General",
"Weapons.tbl is : %s\n", Game_weapons_tbl_valid ?
"VALID" :
"INVALID!!!!"));
2073 mprintf((
"cfile_init() took %d\n", e1 - s1));
2081 float Framerate = 0.0f;
2104 if (frame_int == -1) {
2106 frametimes[
i] = 0.0
f;
2117 if (frametotal != 0.0
f) {
2136 if (cur_time - Start_time > 30.0
f) {
2137 mprintf((
"%i frames executed in %7.3f seconds, %7.3f frames per second.\n",
Framecount, cur_time - Start_time,
Framecount/(cur_time - Start_time)));
2138 Start_time += 1000.0f;
2174 if (Show_framerate) {
2175 if (frametotal != 0.0
f)
2183 if ( Debug_dump_frames )
2196 char mem_buffer[50];
2198 MEMORYSTATUS mem_stats;
2199 GlobalMemoryStatus(&mem_stats);
2203 sprintf(mem_buffer,
"Using Physical: *** (>4G)");
2214 sy += line_height * 2;
2216 if ( ((
int)mem_stats.dwAvailPhys == -1) || ((
int)mem_stats.dwTotalPhys == -1) )
2217 sprintf(mem_buffer,
"Physical Free: *** / *** (>4G)");
2219 sprintf(mem_buffer,
"Physical Free: %d / %d Meg",mem_stats.dwAvailPhys/1024/1024, mem_stats.dwTotalPhys/1024/1024);
2223 sprintf(mem_buffer,
"Pagefile Free: %d / %d Meg",mem_stats.dwAvailPageFile/1024/1024, mem_stats.dwTotalPageFile/1024/1024);
2226 sprintf(mem_buffer,
"Virtual Free: %d / %d Meg",mem_stats.dwAvailVirtual/1024/1024, mem_stats.dwTotalVirtual/1024/1024);
2232 if ( Show_cpu == 1 ) {
2258 Num_pairs_checked = 0;
2265 if ( Timing_total > 0.01
f ) {
2274 gr_printf_no_resize( sx, sy,
NOX(
"GAME: %.0f%%"), (Timing_total-(Timing_render2+Timing_render3+Timing_flip+Timing_clear))*100.0
f/Timing_total );
2314 if ( Show_player_pos ) {
2323 void memblockinfo_sort();
2324 void memblockinfo_sort_get_entry(
int index,
char *filename,
int *
size);
2326 char mem_buffer[1000];
2330 memblockinfo_sort();
2333 for( ; mi < 30; mi++) {
2334 memblockinfo_sort_get_entry(mi, filename, &size);
2341 char *short_name = strrchr(filename,
'\\');
2343 if (short_name == NULL)
2348 sprintf(mem_buffer,
"%s:\t%d K", short_name, size);
2379 cam->
get_info(&cam_pos, &cam_orient);
2389 font_height -= font_height/2;
2393 rot_angles.
p *= (180/
PI);
2394 rot_angles.
b *= (180/
PI);
2395 rot_angles.
h *= (180/
PI);
2401 float frame_rate=30.0f;
2402 if ( frame_int == -1 ) {
2405 frametimes[
i] = 0.0f;
2415 if ( frametotal != 0.0 ) {
2457 bool process =
true;
2460 dc_printf(
"Usage: ai_paused [bool]\nSets ai_paused to true or false. If nothing passed, then toggles it.\n" );
2482 DCF(single_step,
"Enables single step mode.")
2484 bool process =
true;
2487 dc_printf(
"Usage: game_single_step [bool]\nEnables or disables single-step mode. If nothing passed, then toggles it.\nSingle-step mode will freeze the game, and will advance frame by frame with each key press\n");
2492 dc_printf(
"ai_paused is %s\n", (game_single_step ?
"TRUE" :
"FALSE") );
2504 last_single_step = 0;
2540 Game_skill_level = 0;
2549 DCF(view,
"Sets the percent of the 3d view to render.")
2551 bool process =
true;
2555 dc_printf(
"Usage: view [n]\nwhere n is percent of view to show (5-100).\n");
2560 dc_printf(
"View is set to %d%%\n", View_percent );
2569 if ( (value >= 5 ) && (value <= 100) ) {
2570 View_percent =
value;
2572 dc_printf(
"Error: Outside legal range [5 - 100]");
2608 if ( View_percent >= 100 ) {
2611 int xborder, yborder;
2613 if ( View_percent < 5 ) {
2617 float fp =
i2fl(View_percent)/100.0f;
2619 if ( fi > 100 ) fi=100;
2633 int laser_count = 0, missile_count = 0;
2645 nprintf((
"Mike",
"Frame: %i Lasers: %4i, Missiles: %4i\n",
Framecount, laser_count, missile_count));
2705 tst_time = (
int) time(NULL);
2710 tst_bitmap =
bm_load(
"ig_jim");
2716 tst_bitmap =
bm_load(
"ig_kan");
2722 tst_bitmap =
bm_load(
"ig_jim");
2728 tst_bitmap =
bm_load(
"ig_kan");
2752 tst_offset_total = (
float)w;
2753 tst_offset = (
float)w;
2756 tst_offset_total = (
float)-
w;
2757 tst_offset = (
float)w;
2765 float diff = (tst_offset_total / 0.5f) * flFrametime;
2771 tst_offset -=
fl_abs(diff);
2772 }
else if(tst_mode == 2){
2775 tst_offset -=
fl_abs(diff);
2788 if(tst_offset <= 0.0f){
2794 tst_offset =
fl_abs(tst_offset_total);
2824 tst_pos = objp->
pos;
2857 #define NUM_FRAMES_TEST 300
2858 #define NUM_MIXED_SOUNDS 16
2861 static int framecount = 0;
2862 static int test_running = 0;
2863 static float test_time = 0.0f;
2868 if ( test_running ) {
2879 if ( Test_begin == 1 ) {
2896 DCF(dcf_fov,
"Change the field of view of the main camera")
2899 bool process =
true;
2903 dc_printf(
"Usage: fov [factor]\nFactor is the zoom factor btwn .25 and 1.25\nNo parameter resets it to default.\n" );
2911 dc_printf(
"Zoom factor set to %6.3f (original = 0.5, John = 0.75)\n", cam->
get_fov());
2917 if ((cam == NULL) || (!process)) {
2926 if (value < 0.25f) {
2928 dc_printf(
"Zoom factor clamped to 0.25\n");
2929 }
else if (value > 1.25f) {
2931 dc_printf(
"Zoom factor clamped to 1.25\n");
2933 dc_printf(
"Zoom factor set to %6.3f\n", value);
2941 DCF(framerate_cap,
"Sets the framerate cap")
2943 bool process =
true;
2946 dc_printf(
"Usage: framerate_cap [n]\nwhere n is the frames per second to cap framerate at.\n");
2947 dc_printf(
"If n is 0 or omitted, then the framerate cap is removed\n");
2948 dc_printf(
"[n] must be from 1 to 120.\n");
2953 if ( Framerate_cap ) {
2954 dc_printf(
"Framerate cap is set to %d fps\n", Framerate_cap );
2956 dc_printf(
"There is no framerate cap currently active.\n");
2970 if ((Framerate_cap < 0) || (Framerate_cap > 120)) {
2971 dc_printf(
"Illegal value for framerate cap. (Must be from 1-120) \n");
2975 if (Framerate_cap == 0) {
2978 dc_printf(
"Framerate cap is set to %d fps\n", Framerate_cap );
2982 #define MIN_DIST_TO_DEAD_CAMERA 50.0f
2987 object *view_target;
3002 char view_target_name[128] =
"";
3006 strcpy_s(view_target_name,
"targeted ship");
3021 strcpy_s(view_target_name,
"Debris");
3032 if ( strlen(view_target_name) ) {
3035 Show_viewing_from_self = 1;
3042 Show_viewing_from_self = 1;
3044 if (Show_viewing_from_self)
3050 Last_view_target = view_target;
3081 Game_shudder_total = time;
3082 Game_shudder_intensity = intensity;
3085 float get_shake(
float intensity,
int decay_time,
int max_decay_time)
3091 if (decay_time >= 0) {
3092 Assert(max_decay_time > 0);
3093 shake *= (0.5f -
fl_abs(0.5f - (
float) decay_time / (
float) max_decay_time));
3099 #define FF_SCALE 10000
3123 tangles.
p +=
get_shake(0.07f * wash_intensity, -1, 0);
3124 tangles.
h +=
get_shake(0.07f * wash_intensity, -1, 0);
3133 if (Game_shudder_time != -1) {
3135 Game_shudder_time = -1;
3147 tangles.
p +=
get_shake(0.07f * cut_pct * sn_shudder, -1, 0);
3148 tangles.
h +=
get_shake(0.07f * cut_pct * sn_shudder, -1, 0);
3153 if (tangles.
p == 0.0f && tangles.
h == 0.0f && tangles.
b == 0.0f)
3193 float old_zoom =
View_zoom, new_zoom = 1.0f;
3249 memset( &new_orient, 0,
sizeof(
matrix) );
3250 new_orient.
vec.fvec.xyz.x = 1.0f;
3251 new_orient.
vec.uvec.xyz.y = 1.0f;
3252 new_orient.
vec.rvec.xyz.z = -1.0f;
3257 memset( &new_orient, 0,
sizeof(
matrix) );
3258 new_orient.
vec.fvec.xyz.x = -1.0f;
3259 new_orient.
vec.uvec.xyz.y = 1.0f;
3260 new_orient.
vec.rvec.xyz.z = 1.0f;
3265 memset( &new_orient, 0,
sizeof(
matrix) );
3268 new_orient.
vec.rvec.xyz.x = 1.0f;
3273 memset( &new_orient, 0,
sizeof(
matrix) );
3276 new_orient.
vec.rvec.xyz.x = 1.0f;
3281 memset( &new_orient, 0,
sizeof(
matrix) );
3282 new_orient.
vec.fvec.xyz.z = 1.0f;
3283 new_orient.
vec.uvec.xyz.y = 1.0f;
3284 new_orient.
vec.rvec.xyz.x = 1.0f;
3289 memset( &new_orient, 0,
sizeof(
matrix) );
3290 new_orient.
vec.fvec.xyz.z = -1.0f;
3291 new_orient.
vec.uvec.xyz.y = 1.0f;
3292 new_orient.
vec.rvec.xyz.x = -1.0f;
3304 const int size = 512;
3313 Warning(
LOCATION,
"Unable to release environment map render target.");
3336 static camid chase_camera;
3342 return chase_camera;
3357 if(main_cam == NULL)
3367 static int last_Viewer_mode = 0;
3368 static int last_Game_mode = 0;
3369 static int last_Viewer_objnum = -1;
3415 last_FOV = main_cam->
get_fov();
3434 int view_from_player = 1;
3444 view_from_player = 0;
3447 last_Viewer_objnum = -1;
3455 if ( view_from_player ) {
3467 dist += flFrametime * 16.0f;
3523 last_Viewer_objnum = -1;
3526 last_Viewer_objnum = -1;
3591 tmp_up = eyemat.
vec.uvec;
3612 bool position_override =
false;
3619 position_override =
true;
3622 if(!position_override) {
3641 mprintf((
"Invalid Value for Viewer_obj->type. Expected values are OBJ_SHIP (1) and OBJ_OBSERVER (12), we encountered %d. Please tell a coder.\n",
Viewer_obj->
type));
3645 #ifdef JOHNS_DEBUG_CODE
3646 john_debug_stuff(&eye_pos, &eye_orient);
3666 DCF_BOOL( subspace, Game_subspace_effect )
3678 camera *cam = cid.getCamera();
3686 cam->
get_info(&eye_pos, &eye_orient);
3724 Env_cubemap_drawn =
true;
3733 #ifndef DYN_CLIP_DIST
3740 if ( Game_subspace_effect ) {
3754 #ifdef DYN_CLIP_DIST
3776 for(;obji != effect_ships.end();++obji)
3780 effect_ships.clear();
3832 if(Multi_display_netinfo){
3855 #ifdef JOHNS_DEBUG_CODE
3909 if(!Time_compression_locked)
4038 if ( !Pre_player_entry ){
4076 if ( Game_subspace_effect ) {
4149 if ( leave_popup ) {
4222 alpha =
fl2i( (
float)startAlpha + (((
float)endAlpha - (
float)startAlpha) / (
float)duration) * (
float)elapsed );
4239 const static int CUTSCENE_BAR_DIVISOR = 8;
4291 if(!Time_compression_locked) {
4311 if(Time_compression_locked)
4322 #define DEBUG_GET_TIME(x) { x = timer_get_fixed_seconds(); }
4324 #define DEBUG_GET_TIME(x)
4330 fix total_time1, total_time2;
4331 fix render2_time1=0, render2_time2=0;
4332 fix render3_time1=0, render3_time2=0;
4333 fix flip_time1=0, flip_time2=0;
4334 fix clear_time1=0, clear_time2=0;
4336 int actually_playing;
4339 if (Framerate_delay) {
4367 Pre_player_entry = 0;
4379 if ( !Pre_player_entry && actually_playing ) {
4380 if (! (
Game_mode & GM_STANDALONE_SERVER) ) {
4409 if (!actually_playing ) {
4416 if (!Pre_player_entry) {
4445 Scripting_didnt_draw_hud = 1;
4448 Scripting_didnt_draw_hud = 0;
4451 if(Scripting_didnt_draw_hud) {
4475 }
else if((Player_died_popup_wait != -1) && (
timestamp_elapsed(Player_died_popup_wait))){
4476 Player_died_popup_wait = -1;
4480 if((Player_died_popup_wait != -1) && (
timestamp_elapsed(Player_died_popup_wait))){
4481 Player_died_popup_wait = -1;
4536 Timing_total =
f2fl( total_time2 - total_time1 ) * 1000.0f;
4537 Timing_clear =
f2fl( clear_time2 - clear_time1 ) * 1000.0f;
4538 Timing_render2 =
f2fl( render2_time2- render2_time1 ) * 1000.0f;
4539 Timing_render3 =
f2fl( render3_time2- render3_time1 ) * 1000.0f;
4540 Timing_flip =
f2fl( flip_time2 - flip_time1 ) * 1000.0f;
4545 #define MAX_FRAMETIME (F1_0/4) // Frametime gets saturated at this. Changed by MK on 11/1/97.
4551 static int timer_paused=0;
4552 #if defined(TIMER_TEST) && !defined(NDEBUG)
4553 static int stop_count,start_count;
4554 static int time_stopped,time_started;
4572 if (timer_paused==0) {
4580 if (Last_delta_time < 0) {
4581 #if defined(TIMER_TEST) && !defined(NDEBUG)
4584 Last_delta_time = 0;
4586 #if defined(TIMER_TEST) && !defined(NDEBUG)
4587 time_stopped = time;
4596 #if defined(TIMER_TEST) && !defined(NDEBUG)
4604 Assert(timer_paused >= 0);
4605 if (timer_paused==0) {
4608 #if defined(TIMER_TEST) && !defined(NDEBUG)
4618 #if defined(TIMER_TEST) && !defined(NDEBUG)
4619 time_started = time;
4624 Assert( saved_timestamp_ticker > -1 );
4626 saved_timestamp_ticker = -1;
4629 #if defined(TIMER_TEST) && !defined(NDEBUG)
4636 Time_compression_locked = is_locked;
4641 fix modified =
fl2f(
f2fl(Game_time_compression) * multiplier );
4643 Desired_time_compression = Game_time_compression = modified;
4644 Time_compression_change_rate = 0;
4649 if(change_time <= 0.0f)
4651 Game_time_compression = Desired_time_compression =
fl2f(multiplier);
4652 Time_compression_change_rate = 0;
4656 Desired_time_compression =
fl2f(multiplier);
4657 Time_compression_change_rate =
fl2f(
f2fl(Desired_time_compression - Game_time_compression) / change_time );
4663 float frame_cap_diff;
4698 Assertion( Framerate_cap > 0,
"Framerate cap %d is too low. Needs to be a positive, non-zero number", Framerate_cap );
4721 thistime +=
fl2f((frame_cap_diff));
4737 if(Game_time_compression != Desired_time_compression)
4740 if(Time_compression_change_rate)
4741 Game_time_compression +=
fixmul(Time_compression_change_rate,
Frametime);
4742 if((ascending && Game_time_compression > Desired_time_compression)
4743 || (!ascending && Game_time_compression < Desired_time_compression))
4756 Last_time = thistime;
4766 if ( FrametimeOverall > (INT_MAX -
F1_0) )
4767 FrametimeOverall = 0;
4803 if ( game_single_step && (last_single_step == game_single_step) ) {
4804 os_set_title(
NOX(
"SINGLE STEP MODE (Pause exits, any other key steps)") );
4839 Joymouse_button_status = 0;
4901 dx =
fl2i(
f2fl(jx)*flFrametime*500.0f);
4902 dy =
fl2i(
f2fl(jy)*flFrametime*500.0f);
4913 if ( j != Joymouse_button_status ) {
4915 Joymouse_button_status = j;
4918 }
else if ( (!j) && (m) ) {
5029 sprintf( tmp_name,
NOX(
"screen%.4i"), counter );
5037 Warning(
LOCATION,
"Screenshot count has reached max of 9999. Resetting to 0.");
5041 mprintf((
"Dumping screen to '%s'\n", tmp_name ));
5053 #if !defined(NDEBUG)
5173 memset(&Multi_ship_status_bi, 0,
sizeof(
button_info));
5186 mprintf((
"Entering game at time = %7.3f\n", Start_time));
5250 mprintf((
"Ignoring GS_EVENT_DEATH_BLEW_UP because we're in state %d\n", current_state ));
5340 Warpout_time = 0.0f;
5345 mprintf((
"Player isn't in normal mode; cannot warp out.\n" ));
5350 Warpout_time = 0.0f;
5357 if ( !Warpout_forced ) {
5361 mprintf((
"Player put back to normal mode.\n" ));
5362 if ( Warpout_sound > -1 ) {
5373 mprintf((
"Player put back to normal mode, because of invalid sequence in stage1.\n" ));
5375 mprintf((
"Hit target speed. Starting warp effect and moving to stage 2!\n" ));
5390 mprintf((
"Player put back to normal mode, because of invalid sequence in stage2.\n" ));
5392 mprintf((
"Hit warp effect. Moving to stage 3!\n" ));
5398 mprintf((
"Player warped out. Going to debriefing!\n" ));
5475 int end_mission = 1;
5477 switch (new_state) {
5510 switch (old_state) {
5673 if ( end_mission ) {
5904 switch (new_state) {
5940 Main_hall_netgame_started = 1;
5946 mprintf((
"Straight to mission '%s'\n", Game_current_mission_filename ));
6196 Game_subspace_effect = 0;
6198 Game_subspace_effect = 1;
6199 if( !(
Game_mode & GM_STANDALONE_SERVER) ){
6209 memset(&Multi_ship_status_bi, 0,
sizeof(
button_info));
6287 Show_viewing_from_self = 0;
6417 if (no_networking) {
6449 Game_do_state_should_skip = 0;
6454 if(Game_do_state_should_skip){
6743 int game_do_ram_check(
uint ram_in_bytes)
6745 if ( ram_in_bytes < 30*1024*1024 ) {
6746 int allowed_to_run = 1;
6747 if ( ram_in_bytes < 25*1024*1024 ) {
6752 uint FreeSpace_total_ram_MB;
6753 FreeSpace_total_ram_MB = (
uint)(ram_in_bytes/(1024*1024));
6755 if ( allowed_to_run ) {
6757 sprintf( tmp,
XSTR(
"FreeSpace has detected that you only have %dMB of free memory.\n\nFreeSpace requires at least 32MB of memory to run. If you think you have more than %dMB of physical memory, ensure that you aren't running SmartDrive (SMARTDRV.EXE). Any memory allocated to SmartDrive is not usable by applications\n\nPress 'OK' to continue running with less than the minimum required memory\n", 193), FreeSpace_total_ram_MB, FreeSpace_total_ram_MB);
6761 if ( msgbox_rval == IDCANCEL ) {
6766 sprintf( tmp,
XSTR(
"FreeSpace has detected that you only have %dMB of free memory.\n\nFreeSpace requires at least 32MB of memory to run. If you think you have more than %dMB of physical memory, ensure that you aren't running SmartDrive (SMARTDRV.EXE). Any memory allocated to SmartDrive is not usable by applications\n", 195), FreeSpace_total_ram_MB, FreeSpace_total_ram_MB);
6776 #if 0 // no updater for fs2
6779 void game_maybe_update_launcher(
char *exe_dir)
6785 strcat_s(src_filename,
NOX(
"\\update\\freespace.exe"));
6792 fp = fopen(src_filename,
"rb");
6798 SetFileAttributes(dest_filename, FILE_ATTRIBUTE_NORMAL);
6801 if ( CopyFile(src_filename, dest_filename, 0) == 0 ) {
6802 MessageBox( NULL,
XSTR(
"Unable to copy freespace.exe from update directory to installed directory. You should copy freespace.exe from the update directory (located in your FreeSpace install directory) to your install directory", 988), NULL,
MB_OK|
MB_TASKMODAL|
MB_SETFOREGROUND );
6807 DeleteFile(src_filename);
6813 RemoveDirectory(update_dir);
6815 #endif // no launcher
6817 #endif // ifdef WIN32
6823 int sub_total_destroyed = 0;
6835 sub_total_destroyed = total;
6842 *out_total += total + sub_total;
6843 *out_destroyed_total += sub_total_destroyed;
6846 #define BAIL() do { int _idx; for(_idx=0; _idx<num_files; _idx++){ if(pof_list[_idx] != NULL){vm_free(pof_list[_idx]); pof_list[_idx] = NULL;}} return;} while(0);
6849 char *pof_list[1000];
6854 int total, root_total, model_total, destroyed_total, counted;
6871 for(idx=0; idx<num_files; idx++, counted++){
6872 sprintf(str,
"%s.pof", pof_list[idx]);
6889 model_total += total;
6893 sprintf(str,
"Model total %d\n", model_total);
6897 cfputs(
"BY LOD\n\n", out);
6905 destroyed_total = 0;
6913 sprintf(str,
"TOTAL: %d\n", total + root_total);
6915 sprintf(str,
"TOTAL not counting destroyed faces %d\n", (total + root_total) - destroyed_total);
6917 sprintf(str,
"TOTAL destroyed faces %d\n\n", destroyed_total);
6920 cfputs(
"------------------------------------------------------------------------\n\n", out);
6935 DCF(pofspew,
"Spews POF info without shutting down the game")
6950 Networking_disabled = 1;
6961 ms.dwLength =
sizeof(MEMORYSTATUS);
6962 GlobalMemoryStatus(&ms);
6963 FreeSpace_total_ram = ms.dwTotalPhys;
6969 if ( game_do_ram_check(FreeSpace_total_ram) == -1 ) {
6973 if ( ms.dwTotalVirtual < 1024 ) {
6974 MessageBox( NULL,
XSTR(
"FreeSpace requires virtual memory to run.\r\n", 196),
XSTR(
"No Virtual Memory", 197),
MB_OK );
6979 MessageBox( NULL,
XSTR(
"Not enough memory to run FreeSpace.\r\nTry closing down some other applications.\r\n", 198),
XSTR(
"Not Enough Memory", 199),
MB_OK );
6983 char *tmp_mem = (
char *)
vm_malloc(16 * 1024 * 1024);
6985 MessageBox(NULL,
XSTR(
"Not enough memory to run FreeSpace.\r\nTry closing down some other applications.\r\n", 198),
XSTR(
"Not Enough Memory", 199),
MB_OK);
7005 nprintf((
"Network",
"Standalone running\n"));
7011 disableWindowsKey( );
7022 mprintf( (
"TrackIR Init Failed - %d\n", trackIrInitResult) );
7084 enableWindowsKey( );
7104 HWND hwnd = FindWindow(
NOX(
"FreeSpaceClass" ), NULL );
7106 SetForegroundWindow(hwnd);
7110 ::CoInitialize(NULL);
7113 void memblockinfo_output_memleak();
7114 atexit(memblockinfo_output_memleak);
7121 if ( GetModuleFileName( hInst, exe_dir, 1023 ) > 0 ) {
7122 char *p = exe_dir + strlen(exe_dir);
7125 while( (p>exe_dir) && (*p!=
'\\') && (*p!=
'/') && (*p!=
':') ) {
7131 if ( strlen(exe_dir) > 0 ) {
7138 #ifdef GAME_ERRORLOG_TXT
7144 #ifdef GAME_ERRORLOG_TXT
7146 } __except( RecordExceptionInfo(GetExceptionInformation(),
"FreeSpace 2 Main Thread") ) {
7160 _CrtDumpMemoryLeaks();
7171 int result = EXIT_FAILURE;
7172 char *argptr = NULL;
7179 strncpy(full_path, *argv, 1024);
7183 memset(userdir, 0,
sizeof(userdir));
7189 for (i = 1; i < argc; i++) {
7190 len += strlen(argv[i]) + 1;
7193 argptr = (
char*) calloc(len + 1,
sizeof(
char));
7195 if (argptr == NULL) {
7196 fprintf(stderr,
"ERROR: Out of memory in main()!\n");
7200 memset( argptr, 0, len+1 );
7202 for (i = 1; i < argc; i++) {
7203 strcat(argptr, argv[i]);
7204 strcat(argptr,
" ");
7211 if (argptr != NULL) {
7215 }
catch (std::exception &ex) {
7216 fprintf(stderr,
"Caught std::exception in main(): '%s'!\n", ex.what());
7217 result = EXIT_FAILURE;
7219 fprintf(stderr,
"Caught exception in main()!\n");
7220 result = EXIT_FAILURE;
7233 #if 0 // don't have an updater for fs2_open
7235 void game_launch_launcher_on_exit()
7238 PROCESS_INFORMATION pi;
7239 char cmd_line[2048];
7240 char original_path[1024] =
"";
7242 memset( &si, 0,
sizeof(STARTUPINFO) );
7252 strcat_s(cmd_line,
" -straight_to_update");
7254 BOOL ret = CreateProcess( NULL,
7259 CREATE_DEFAULT_ERROR_MODE,
7317 #ifdef MULTI_USE_LAG
7358 #if 0 // don't have an updater for fs2_open
7362 if(Multi_update_fireup_launcher_on_exit){
7363 game_launch_launcher_on_exit();
7419 Animating_mouse.
time = 0.0f;
7437 mprintf((
"loading animated cursor \"%s\"\n", filename));
7439 am = &Animating_mouse;
7442 Error(
LOCATION,
"Could not load animation %s for the mouse pointer\n", filename);
7457 am = &Animating_mouse;
7481 am = &Animating_mouse;
7510 switch ( game_state ) {
7594 #define EVENT_DEBUG_MAX 5000
7595 #define EVENT_DEBUG_EVENT 0x8000
7603 Event_debug_index[ED_count++] = n | (indent << 16);
7639 int font_height, font_width;
7641 static int scroll_offset = 0;
7649 if (scroll_offset < 0)
7659 scroll_offset -= 20;
7660 if (scroll_offset < 0)
7665 scroll_offset += 20;
7686 while (k < ED_count) {
7687 if (y_index > y_max)
7690 z = Event_debug_index[k];
7734 y_index += font_height;
7762 if ( (l ==
'/') || (l==
'\\') || (l==
':')) {
7770 int model_needs_splitting = 0;
7775 char filename[1024];
7782 if ( bmp_num > -1 ) {
7788 if ( (w > 512) || (h > 512) ) {
7789 fprintf( Texture_fp,
"%s\t%s\t%d\t%d\n", pof_file, filename, w, h );
7791 model_needs_splitting++;
7799 if ( model_needs_splitting ) {
7800 Num_models_needing_splitting++;
7805 eye_pos.
xyz.z = -pm->
rad*2.0f;
7809 vm_vec_sub( &eye_to_model, &model_pos, &eye_pos );
7815 ta.
p = ta.
b = ta.
h = 0.0f;
7820 int bitmaps_used_this_frame, bitmaps_new_this_frame;
7826 while( ta.
h <
PI2 ) {
7867 Tmap_npixels /=framecount;
7870 mprintf((
"'%s' is %.2f FPS\n", pof_file,
i2fl(framecount)/
f2fl(t2-t1) ));
7875 DCF_BOOL( time_models, Time_models )
7881 if ( !Time_models )
return;
7883 mprintf((
"Timing models!\n" ));
7895 sip->model_num =
model_load(sip->pof_file, 0, NULL);
7901 Texture_fp = fopen(
NOX(
"ShipTextures.txt"),
"wt" );
7902 if ( !Texture_fp )
return;
7904 Time_fp = fopen(
NOX(
"ShipTimings.txt"),
"wt" );
7905 if ( !Time_fp )
return;
7907 fprintf( Time_fp,
"Name\tFPS\tTRAM\tPolys\tVerts\tPixels\n" );
7911 if ( model_used[i] ) {
7916 fprintf( Texture_fp,
"Number too big: %d\n", Tmap_num_too_big );
7917 fprintf( Texture_fp,
"Number of models needing splitting: %d\n", Num_models_needing_splitting );
7936 int hours,minutes,seconds;
7939 mtime =
f2fl(m_time);
7942 hours = (
int)(mtime / 3600.0f);
7944 mtime -= (3600.0f * (
float)hours);
7946 seconds = (
int)mtime%60;
7947 minutes = (
int)mtime/60;
7955 strcat(time_str,tmp);
7962 strcat(time_str,tmp);
7970 strcat(time_str,tmp);
7973 strcat(time_str,tmp);
7982 #if FS_VERSION_REVIS == 0
7989 strcat_s( str, max_size,
" Debug" );
7996 strcat_s( str, max_size,
" OpenGL" );
8001 strcat_s( str, max_size,
" non-HT&L" );
8004 #ifdef FS_VERSION_IDENT
8006 strcat_s( str, max_size, FS_VERSION_IDENT );
8022 static int Subspace_ambient_left_channel = -1;
8023 static int Subspace_ambient_right_channel = -1;
8028 if ( Subspace_ambient_left_channel < 0 ) {
8032 if ( Subspace_ambient_right_channel < 0 ) {
8039 if ( Subspace_ambient_left_channel >= 0 ) {
8040 snd_stop(Subspace_ambient_left_channel);
8041 Subspace_ambient_left_channel = -1;
8044 if ( Subspace_ambient_right_channel >= 0 ) {
8045 snd_stop(Subspace_ambient_right_channel);
8046 Subspace_ambient_right_channel = -1;
8063 #define CD_SIZE_72_MINUTE_MAX (697000000)
8069 char use_path[512] =
"";
8070 char sub_path[512] =
"";
8071 WIN32_FIND_DATA find;
8077 find_handle = FindFirstFile(use_path, &find);
8080 if(find_handle == INVALID_HANDLE_VALUE){
8087 if((find.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) &&
stricmp(find.cFileName,
".") &&
stricmp(find.cFileName,
"..")){
8090 strcat_s(sub_path, find.cFileName);
8094 total += (
uint)find.nFileSizeLow;
8096 }
while(FindNextFile(find_handle, &find));
8099 FindClose(find_handle);
8106 mprintf((
"NULL path passed to game_get_cd_used_space.\n"));
8125 int volume_match = 0;
8131 for (i = 0; i < 26; i++)
8137 path[0] = (char)(
'A'+i);
8138 if (GetDriveType(path) == DRIVE_CDROM) {
8140 if ( GetVolumeInformation(path, volume, 256, NULL, NULL, NULL, NULL, 0) ==
TRUE ) {
8141 nprintf((
"CD",
"CD volume: %s\n", volume));
8144 int volume1_present = 0;
8145 int volume2_present = 0;
8146 int volume3_present = 0;
8148 char full_check[512] =
"";
8153 find_handle = _findfirst(full_check, &find);
8154 if(find_handle != -1){
8155 volume1_present = 1;
8156 _findclose(find_handle);
8162 find_handle = _findfirst(full_check, &find);
8163 if(find_handle != -1){
8164 volume2_present = 1;
8165 _findclose(find_handle);
8170 strcat_s(full_check,
"endpart1.mve");
8171 find_handle = _findfirst(full_check, &find);
8172 if(find_handle != -1){
8173 volume3_present = 1;
8174 _findclose(find_handle);
8178 if ( volume_name ) {
8192 if ( volume1_present || volume2_present || volume3_present ) {
8198 if ( volume_match ){
8200 if(volume2_present || volume3_present) {
8202 if(GetDriveType(path) != DRIVE_CDROM){
8225 if (volume_name != NULL) {
8238 if (drive_num < 0) {
8243 memset(Game_CDROM_dir, 0,
sizeof(Game_CDROM_dir));
8247 sprintf(Game_CDROM_dir,
NOX(
"%c:\\"),
'a' + drive_num );
8276 if ( strlen(Game_CDROM_dir) == 0 ) {
8280 if ( strlen(Game_CDROM_dir) == 0 ) {
8284 found = GetVolumeInformation(Game_CDROM_dir, label, 256, NULL, NULL, NULL, NULL, 0);
8286 if ( found != Last_cd_label_found ) {
8287 Last_cd_label_found = found;
8289 mprintf((
"CD '%s' was inserted\n", label ));
8291 mprintf((
"CD '%s' was removed\n", Last_cd_label ));
8295 if ( Last_cd_label_found ) {
8296 if ( !
stricmp( Last_cd_label, label )) {
8299 mprintf((
"CD was changed from '%s' to '%s'\n", Last_cd_label, label ));
8308 Last_cd_label_found = found;
8328 #if !defined(GAME_CD_CHECK)
8334 int num_attempts = 0;
8335 int refresh_files = 0;
8337 int path_set_ok, popup_rval;
8341 if ( path_set_ok ) {
8343 if ( refresh_files ) {
8358 if ( popup_rval != 1 ) {
8363 if ( num_attempts++ > 5 ) {
8382 int num_attempts = 0;
8383 int refresh_files = 0;
8385 int path_set_ok, popup_rval;
8389 if ( path_set_ok ) {
8391 if ( refresh_files ) {
8405 if ( popup_rval != 1 ) {
8410 if ( num_attempts++ > 5 ) {
8454 cfseek(detect, 0, SEEK_SET);
8462 mprintf((
"AutoLang: Language auto-detection successful...\n" ));
8468 mprintf((
"ERROR: Unknown Language Checksum: %i\n", (
int)file_checksum ));
8469 mprintf((
"Using default language settings...\n" ));
8484 #define NUM_SHIPS_TBL_CHECKSUMS 1
8503 Game_ships_tbl_valid = 0;
8507 Game_ships_tbl_valid = 0;
8513 cfseek(detect, 0, SEEK_SET);
8520 if(Game_ships_tbl_checksums[idx] == (
int)file_checksum){
8521 Game_ships_tbl_valid = 1;
8528 DCF(shipspew,
"display the checksum for the current ships.tbl")
8534 cfseek(detect, 0, SEEK_SET);
8546 #define NUM_WEAPONS_TBL_CHECKSUMS 1
8565 Game_weapons_tbl_valid = 0;
8569 Game_weapons_tbl_valid = 0;
8575 cfseek(detect, 0, SEEK_SET);
8582 if(Game_weapons_tbl_checksums[idx] == (
int)file_checksum){
8583 Game_weapons_tbl_valid = 1;
8590 DCF(wepspew,
"display the checksum for the current weapons.tbl")
8596 cfseek(detect, 0, SEEK_SET);
8604 static bool Hacked_data_check_ready =
false;
8605 static bool Hacked_data =
false;
8619 Hacked_data = (rc != 0);
8620 Hacked_data_check_ready =
true;
8626 if ( !
Om_tracker_flag && !(Game_weapons_tbl_valid && Game_ships_tbl_valid) ) {
8631 return (
int)Hacked_data;
8693 mprintf((
"SCRIPTING: Splash screen overrides checked\n"));
8694 if(!globalhook_override && !condhook_override)
8699 if (Game_title_bitmap != -1)
8714 if (Game_title_logo != -1)
8726 if(!condhook_override)
8729 mprintf((
"SCRIPTING: Splash hook has been run\n"));
8731 if(!globalhook_override || condhook_override)
8734 mprintf((
"SCRIPTING: Splash screen conditional hook has been run\n"));
8742 if (Game_title_bitmap != -1) {
8744 Game_title_bitmap = -1;
8747 if (Game_title_logo != -1) {
8749 Game_title_bitmap = -1;
8756 if (Use_low_mem == 0) {
int fs2netd_update_valid_tables()
void player_maybe_play_all_alone_msg()
#define NETINFO_FLAG_WARPING_OUT
int game_actually_playing()
#define BMP_FLAG_RENDER_TARGET_DYNAMIC
Texture is a dynamic type (animation)
void gr_rect(int x, int y, int w, int h, int resize_mode)
void shockwave_level_close()
void red_alert_voice_pause()
char * Cmdline_connect_addr
void obj_snd_level_close()
void game_do_state(int state)
void unload_animating_pointer()
#define gr_scene_texture_end
float frametimes[FRAME_FILTER]
void observer_get_eye(vec3d *eye_pos, matrix *eye_orient, object *obj)
#define MAX_POLYGON_MODELS
void red_alert_do_frame(float frametime)
int timestamp(int delta_ms)
void game_format_time(fix m_time, char *time_str)
void radar_mission_init()
struct screen3d::@234::@236 xyw
#define MULTIPLAYER_CLIENT
script_hook Script_hudhook
bool GameState_Stack_Valid()
int Game_ships_tbl_checksums[NUM_SHIPS_TBL_CHECKSUMS]
void game_flash_diminish(float frametime)
void mouse_set_pos(int xpos, int ypos)
camid cam_create(char *n_name, vec3d *n_pos, vec3d *n_norm, object *n_object, int n_object_host_submodel)
void message_mission_close()
uint os_config_read_uint(const char *section, const char *name, uint default_value)
void game_get_framerate()
void player_display_padlock_view()
void mission_parse_close()
subspace ambient sound (right channel) (looped)
model_subsystem * system_info
void snd_update_listener(vec3d *pos, vec3d *vel, matrix *orient)
weapon Weapons[MAX_WEAPONS]
char Multi_tracker_squad_name[MULTI_TRACKER_STRING_LEN+1]
#define timestamp_elapsed_safe(_a, _b)
char Processing_filename[MAX_PATH_LEN]
float Training_context_distance
#define NETPLAYER_STATE_IN_MISSION
bool gr_init(int d_mode, int d_width, int d_height, int d_depth)
#define SIF2_SHOW_SHIP_MODEL
void multi_standalone_wait_init()
void campaign_room_init()
void bm_print_bitmaps()
(DEBUG) Prints all loaded bitmaps to an outwindow
void game_loading_callback_close()
void hud_stop_looped_engine_sounds()
Called when the game decides to stop all looping sounds.
void cfile_spew_pack_file_crcs()
void mission_eval_goals()
void fiction_viewer_init()
void init_semirand()
Initialize Semirand array. Doesn't have to be called.
int gameseq_process_events()
void mflash_level_close()
int Cmdline_old_collision_sys
float cur_flash_intensity
void ship_assign_sound_all()
void model_find_world_point(vec3d *outpnt, vec3d *mpnt, int model_num, int submodel_num, const matrix *objorient, const vec3d *objpos)
void verify_weapons_tbl()
#define SUPERNOVA_CUT_TIME
float max_flash_intensity
int Players_target_timestamp
#define SEXP_ATOM_OPERATOR
#define CAMPAIGN_MOVIE_PRE_MISSION
float vm_vec_mag_quick(const vec3d *v)
matrix * vm_matrix_x_matrix(matrix *dest, const matrix *src0, const matrix *src1)
#define PCM_WARPOUT_STAGE1
void joy_ff_stop_effects()
float Cutscene_bars_progress
int Log_debug_output_to_file
int Show_viewing_from_self
#define PHYSICS_VIEWER_RIGHT
SCP_string profile_output
GLfloat GLfloat GLfloat GLfloat h
void ship_model_stop(object *objp)
#define LOGFILE_EVENT_LOG
void vm_vec_scale_add(vec3d *dest, const vec3d *src1, const vec3d *src2, float k)
void multi_join_game_do_frame()
#define MISSION_FLAG_FULLNEB
#define PLAYER_DIED_POPUP_WAIT
void scoring_level_init(scoring_struct *scp)
void game_whack_apply(float x, float y)
void shipfx_flash_do_frame(float frametime)
void multi_join_game_init()
int find_freespace_cd(char *volume_name)
float frand_range(float min, float max)
Return a floating point number in the range min..max.
void multi_ingame_select_do()
void outwnd_init(int display_under_freespace_window)
void gamesnd_parse_soundstbl()
polymodel * model_get(int model_num)
weapon_info Weapon_info[MAX_WEAPON_TYPES]
void ship_render_show_ship_cockpit(object *objp)
int Scripting_didnt_draw_hud
void obj_render(object *obj)
int sound_env_set(sound_env *se)
void RemHookVar(char *name)
#define MOUSE_LEFT_BUTTON
bool Cmdline_no_unfocus_pause
SCP_vector< game_snd > Snds
void campaign_room_do_frame(float frametime)
void game_show_standalone_framerate()
void afterburner_stop_sounds()
void message_maybe_distort()
float vm_vec_mag(const vec3d *v)
#define gr_end_view_matrix
#define TIMESTAMP_FREQUENCY
void gamesnd_unload_gameplay_sounds()
float get_shake(float intensity, int decay_time, int max_decay_time)
void lock_time_compression(bool is_locked)
void batch_render_close()
void mission_campaign_clear()
void game_reset_view_clip()
uint Mem_starttime_pagefile
GLsizei const GLfloat * value
void lab_do_frame(float frametime)
#define NETINFO_FLAG_DO_NETWORKING
void standalone_main_init()
CFILE * Multi_chat_stream
int multi_ignore_controls(int key)
void physics_set_viewer(physics_info *p, int dir)
void multi_pxo_help_init()
matrix * vm_angles_2_matrix(matrix *m, const angles *a)
void game_show_framerate()
void gr_unset_cursor_bitmap(int n)
void hud_stop_looped_locking_sounds()
void player_stop_looped_sounds()
void multi_standalone_postgame_do()
#define TRAINING_CONTEXT_FLY_PATH
void multi_reset_timestamps()
void fiction_viewer_unpause()
void hud_subspace_notify_abort()
script_hook Script_simulationhook
void game_flash(float r, float g, float b)
void obj_init_all_ships_physics()
void joy_ff_mission_init(vec3d v)
#define NETGAME_STATE_SERVER_TRANSFER
#define NG_FLAG_INGAME_JOINING_CRITICAL
void fiction_viewer_pause()
void send_netplayer_update_packet(net_player *pl)
script_hook Script_gameinithook
void g3_set_view(camera *cam)
object * Last_view_target
int mission_load(char *filename_ext)
void anim_level_close()
Called after the end of a mission to clean up any mission dependent anim data.
void load_animating_pointer(char *filename)
#define MULTI_SYNC_PRE_BRIEFING
int gameseq_get_state(void)
void _cdecl void void _cdecl void _cdecl Warning(char *filename, int line, SCP_FORMAT_STRING const char *format,...) SCP_FORMAT_STRING_ARGS(3
int generic_anim_load(generic_anim *ga)
int detail[MAX_MODEL_DETAIL_LEVELS]
bool dc_maybe_stuff_int(int *i)
Tries to stuff an int from the Command_string.
char filename[MAX_FILENAME_LEN]
#define GR_NUM_RESOLUTIONS
void standalone_main_close()
#define NETINFO_FLAG_OBSERVER
void set_position(vec3d *in_position=NULL, float in_translation_time=0.0f, float in_translation_acceleration_time=0.0f, float in_translation_deceleration_time=0.0f, float in_end_velocity=0.0f)
void scripting_state_close()
__inline void gr_string(int x, int y, const char *string, int resize_mode=GR_RESIZE_FULL)
void obj_reset_colliders()
void game_spew_pof_info()
fix game_get_overall_frametime()
void multi_unload_common_icons()
void model_find_world_dir(vec3d *out_dir, vec3d *in_dir, int model_num, int submodel_num, const matrix *objorient)
void multi_ingame_select_close()
void neb2_render_player()
void multi_create_game_init()
void Time_model(int modelnum)
int Cmdline_start_netgame
void game_frame(bool paused=false)
void stars_pre_level_init(bool clear_backgrounds)
int Multi_display_netinfo
int bm_get_info(int handle, int *w, int *h, ubyte *flags, int *nframes, int *fps)
Gets info on the bitmap indexed by handle.
void multi_respawn_normal()
void obj_render_queue_all()
int bm_texture_ram
how many bytes of textures are used.
struct animating_obj animating_obj
int joy_get_pos(int *x, int *y, int *z, int *rx)
#define FSB_CAMPAIGN_FILE
int light_get_global_dir(vec3d *pos, int n)
void main_hall_start_ambient()
struct vec3d::@225::@227 xyz
ship_subsys * Players_targeted_subsys
void model_render_immediate(model_render_params *render_info, int model_num, matrix *orient, vec3d *pos, int render, bool sort)
debug_command dc_r("r","shortcut for ai_rendering", dcf_ai_rendering)
void mission_hotkey_do_frame(float frametime)
const char * Osreg_user_dir
void game_reset_shade_frame()
void change_time_compression(float multiplier)
void shockwave_level_init()
sound_env Game_default_sound_env
void mission_parse_eval_stuff()
void control_check_indicate()
ai_info Ai_info[MAX_AI_INFO]
void lcl_init(int lang_init)
void multi_spew_pxo_checksums(int max_files, const char *outfile)
void mission_load_menu_close()
#define Assertion(expr, msg,...)
void ai_do_repair_frame(object *objp, ai_info *aip, float frametime)
#define END_OF_LIST(head)
void bm_page_in_start()
Tells bmpman to start keeping track of what bitmaps are used where.
void weapon_select_do(float frametime)
#define GR_MAYBE_CLEAR_RES(bmap)
void set_detail_level_lock(int detail_level_lock)
int Player_attacking_enabled
ship_subsys * targeted_subsys
int Multi_update_fireup_launcher_on_exit
char Game_current_mission_filename[MAX_FILENAME_LEN]
angles Viewer_slew_angles
void shipfx_engine_wash_level_init()
void supernova_level_init()
int Sexp_hud_display_warpout
void control_config_common_init()
initialize common control config stuff - call at game startup after localization has been initialized...
void gr_set_screen_scale(int w, int h, int zoom_w, int zoom_h, int max_w, int max_h, int center_w, int center_h, bool force_stretch)
void game_process_event(int current_state, int event)
void vm_vec_scale_add2(vec3d *dest, const vec3d *src, float k)
#define PLAYER_FLAGS_AUTO_TARGETING
void mission_campaign_end_do()
void cam_do_frame(float frametime)
void multi_pxo_init(int use_last_channel)
void control_config_common_close()
close common control config stuff - call at game shutdown
int mouse_get_pos(int *xpos, int *ypos)
const char * os_config_read_string(const char *section, const char *name, const char *default_value)
void model_page_in_start()
void gr_set_color_fast(color *dst)
void training_check_objectives()
debug_command dc_s("s","shortcut for single_step", dcf_single_step)
void game_increase_skill_level()
void game_simulation_frame()
void event_music_do_frame()
int Training_context_at_waypoint
void obj_merge_created_list(void)
void set_fov(float in_fov, float in_fov_time=0.0f, float in_fov_acceleration_time=0.0f, float in_deceleration_time=0.0f)
void hud_scrollback_close()
void game_leave_state(int old_state, int new_state)
void multi_start_game_init()
int red_alert_mission(void)
#define gr_scene_texture_begin
void profile_begin(const char *name)
const char * detect_home(void)
void gr_set_bitmap(int bitmap_num, int alphablend_mode, int bitblt_mode, float alpha)
void game_add_event_debug_sexp(int n, int indent)
void multi_handle_sudden_mission_end()
DCF(warp,"Tests warpin effect")
void multi_game_client_setup_do_frame()
uint load_post_level_init
void hud_close()
Delete all HUD gauge objects, for all ships.
bool Cmdline_frame_profile
char * Cmdline_spew_mission_crcs
int set_cdrom_path(int drive_num)
#define NETPLAYER_STATE_DATA_LOAD
fs_builtin_mission Game_builtin_mission_list[MAX_BUILTIN_MISSIONS]
void SCP_mspdbcs_Initialise()
void os_config_write_uint(const char *section, const char *name, uint value)
GLenum GLuint GLenum GLsizei const GLchar * buf
void standalone_main_do()
void get_info(vec3d *position, matrix *orientation)
void hud_set_default_color()
Set the current color to the default HUD color (with default alpha)
int bm_release(int handle, int clear_render_targets)
Frees both a bitmap's data and it's associated slot.
int Training_context_speed_min
vec3d turret_firing_point[MAX_TFP]
void debug_console(void(*_func)(void))
Opens and processes the debug console. (Blocking call)
#define BMP_FLAG_RENDER_TARGET_STATIC
Texture is a static type.
void game_title_screen_display()
void multi_do_client_warp(float frame_time)
void mission_init_goals()
script_state Script_system("FS2_Open Scripting")
#define gr_end_proj_matrix
#define AIPF2_NO_WARP_CAMERA
#define PROFILE(name, function)
void ship_get_eye(vec3d *eye_pos, matrix *eye_orient, object *obj, bool do_slew, bool from_origin)
uint game_get_cd_used_space(char *path)
int Game_loading_background
int Training_context_speed_timestamp
void hud_config_do_frame(float frametime)
void multi_pxo_help_close()
void mission_event_shutdown()
void get_info(vec3d *position, matrix *orientation)
void weapon_select_init()
void generic_anim_unload(generic_anim *ga)
#define gr_set_ambient_light
void profile_init()
Called once at engine initialization to set the timer.
fix timer_get_approx_seconds()
void supernova_get_eye(vec3d *eye_pos, matrix *eye_orient)
const char * Osreg_app_name
void log_string(int logfile_type, const char *string, int add_time)
#define NUM_BUILTIN_LANGUAGES
void os_set_title(const char *title)
int Joymouse_button_status
int game_busy_callback(void(*callback)(int count), int delta_step=-1)
int bm_load_animation(const char *real_filename, int *nframes, int *fps, int *keyframe, int can_drop_frames, int dir_type)
Loads a bitmap sequance so we can draw with it.
void shipfx_stop_engine_wash_sound()
#define CLAMP(x, min, max)
debug_command dc_f("f","shortcut for ai_firing", dcf_ai_firing)
#define MAX_BUILTIN_MISSIONS
void asteroid_level_init()
int Cmdline_show_mem_usage
void game_busy(const char *filename=NULL)
script_hook Script_splashhook
void gr_set_color(int r, int g, int b)
SCP_vector< waypoint > & get_waypoints()
#define MIN_DIST_TO_DEAD_CAMERA
void obj_observer_move(float frame_time)
int _getcwd(char *buffer, unsigned int len)
void ship_render_cockpit(object *objp)
__inline void gr_set_clip(int x, int y, int w, int h, int resize_mode=GR_RESIZE_FULL)
int multi_endgame_ending()
void SCP_mspdbcs_Cleanup()
void big_explosion_flash(float flash)
void game_maybe_update_sound_environment()
player Players[MAX_PLAYERS]
sound_env sound_environment
int Training_context_goal_waypoint
void os_config_write_string(const char *section, const char *name, const char *value)
#define gr_set_view_matrix
#define EVENT_DEBUG_EVENT
void read_player_controls(object *obj, float frametime)
void red_alert_voice_unpause()
float Game_shudder_intensity
vec3d Dead_player_last_vel
void multi_ping_reset_players()
int mission_campaign_previous_mission()
typedef int(SCP_EXT_CALLCONV *SCPDLL_PFVERSION)(SCPDLL_Version *)
float supernova_time_left()
void model_instance_free_all()
void asteroid_level_close()
int parse_cmdline(char *cmdline)
int Game_weapons_tbl_valid
void std_init_standalone()
void brief_do_frame(float frametime)
void game_stop_looped_sounds()
void hud_positions_init()
matrix * vm_vector_2_matrix(matrix *m, const vec3d *fvec, const vec3d *uvec, const vec3d *rvec)
void vm_vec_add2(vec3d *dest, const vec3d *src)
int supernova_camera_cut()
void scripting_state_init()
void multi_pause_close(int end_mission)
WarpEffect * warpout_effect
void mission_campaign_maybe_play_movie(int type)
void medal_main_init(player *pl, int mode)
void gamesnd_unload_interface_sounds()
#define gr_set_proj_matrix
void common_free_interface_palette()
#define PHYSICS_VIEWER_LEFT
void mission_parse_fixup_players()
GLdouble GLdouble GLdouble r
void shockwave_move_all(float frametime)
char Multi_tracker_passwd[MULTI_TRACKER_STRING_LEN+1]
void campaign_room_close()
void hud_level_close()
Do post mission cleanup of HUD.
void multi_maybe_do_frame()
struct matrix::@228::@230 vec
int game_do_cd_check(char *volume_name)
void main_hall_table_init()
void common_maybe_play_cutscene(int movie_type, bool restart_music, int music)
void send_debrief_event()
virtual int getWarpPosition(vec3d *output)
void multi_start_game_do()
void mouse_force_pos(int x, int y)
void vm_vec_scale(vec3d *dest, float s)
int timestamp_until(int stamp)
void game_spew_pof_info_sub(int model_num, polymodel *pm, int sm, CFILE *out, int *out_total, int *out_destroyed_total)
void do_timing_test(float frame_time)
void game_render_frame(camid cid)
int mission_has_cmd_brief()
void joy_ff_play_dir_effect(float x, float y)
int _mkdir(const char *path)
void stars_post_level_init()
#define BMP_FLAG_CUBEMAP
Texture is a cubemap.
int Cmdline_spew_pof_info
void mission_campaign_end_close()
GLboolean GLboolean GLboolean GLboolean a
int vm_init(int min_heap_size)
#define DIR_SEPARATOR_STR
void g3_set_view_matrix(const vec3d *view_pos, const matrix *view_matrix, float zoom)
ai_profile_t * ai_profile
#define MISSION_FLAG_RED_ALERT
void model_clear_instance(int model_num)
void multi_maybe_send_ship_status()
void mission_campaign_end_init()
void game_framerate_check_init()
mission_event Mission_events[MAX_MISSION_EVENTS]
texture_map maps[MAX_MODEL_TEXTURES]
void main_hall_do_multi_ready()
#define SF2_HIDE_SHIP_NAME
void cmdline_debug_print_cmdline()
void stars_draw_sun_glow(int sun_n)
int Game_loading_callback_inited
bool stars_sun_has_glare(int index)
void game_show_time_left()
int cfwrite_string(const char *buf, CFILE *file)
void game_set_frametime(int state)
void anim_level_init()
Called at the beginning of a mission to initialize any mission dependent anim data.
#define SCP_INITRESULT_SUCCESS
sprintf(buf,"(%f,%f,%f)", v3->xyz.x, v3->xyz.y, v3->xyz.z)
void control_config_init()
void credits_do_frame(float frametime)
struct big_expl_flash big_expl_flash
int Cmdline_cache_bitmaps
bool fsspeech_was_compiled()
#define CHA_GAMEPLAYSTART
void gr_shade(int x, int y, int w, int h, int resize_mode)
void game_environment_map_gen()
void game_do_state_common(int state, int no_networking)
void game_start_subspace_ambient_sound()
void shadows_render_all(float fov, matrix *eye_orient, vec3d *eye_pos)
void game_tst_frame_pre()
void cutscenes_screen_close()
void afterburner_level_init()
void main_hall_stop_ambient()
int Player_died_popup_wait
ubyte g3_rotate_vertex(vertex *dest, const vec3d *src)
void game_update_missiontime()
void player_show_death_message()
int snd_play(game_snd *gs, float pan, float vol_scale, int priority, bool is_voice_msg)
void message_mission_shutdown()
void sim_room_do_frame(float frametime)
float Supernova_last_glare
fs_builtin_mission * game_find_builtin_mission(char *filename)
int event_music_player_death()
void logfile_close(int logfile_type)
net_player_server_info s_info
bool dc_maybe_stuff_boolean(bool *b)
Tries to stuff a bool from the Command_string.
int Training_context_speed_max
float vm_vec_normalized_dir(vec3d *dest, const vec3d *end, const vec3d *start)
float vm_vec_dist(const vec3d *v0, const vec3d *v1)
void multi_standalone_wait_close()
#define PCM_WARPOUT_STAGE2
void game_do_networking()
bool dc_optional_string_either(const char *str1, const char *str2)
Searches for an optional string and it's alias.
#define MONITOR(function_name)
char Fred_callsigns[MAX_SHIPS][NAME_LENGTH+1]
void set_time_compression(float multiplier, float change_time)
angles * vm_extract_angles_matrix(angles *a, const matrix *m)
fix Game_time_compression
int Num_models_needing_splitting
void debrief_do_frame(float frametime)
#define NUM_WEAPONS_TBL_CHECKSUMS
int model_load(char *filename, int n_subsystems, model_subsystem *subsystems, int ferror=1, int duplicate=0)
#define gr_post_process_set_defaults
void bm_get_frame_usage(int *ntotal, int *nnew)
(DEBUG) Gets memory size, in bytes, of the locked bitmaps
#define DETAIL_FLAG_CLEAR
void multi_create_game_close()
void SetHookObject(char *name, object *objp)
Class to aggregate a debug command with its name (as shown in the console) and short help...
void red_alert_maybe_move_to_next_mission()
bool bm_set_render_target(int handle, int face)
(GR function) Calls gr_bm_set_render target for the given bitmap indexed by handle ...
void multi_pause_do_frame()
void fsspeech_play(int type, const char *text)
#define NETPLAYER_IS_DEAD(player)
#define MULTI_END_ERROR_LOAD_FAIL
void anim_init()
Initialise animation.
bool save_player(player *_p=NULL)
void anim_render_all(int screen_id, float frametime)
Display the frames for the currently playing anims.
void multi_standalone_postgame_init()
int g3_project_vertex(vertex *point)
debug_command dc_p("p","shortcut for physics_pause", dcf_physics_pause)
void gamesnd_load_gameplay_sounds()
fix Time_compression_change_rate
void multi_host_options_do()
void os_init(const char *wclass, const char *title, const char *app_name, const char *version_string)
void hud_render_all()
Undertakes main HUD render.
void init_animating_pointer()
void multi_game_client_setup_init()
void bm_get_palette(int handle, ubyte *pal, char *name)
Gets the palette for a given bitmap indexed by handle, and optionally the filename.
void multi_join_clear_game_list()
char loading_screen[GR_NUM_RESOLUTIONS][MAX_FILENAME_LEN]
generic_anim Game_loading_ani
fix fixmuldiv(fix a, fix b, fix c)
void game_render_mouse(float frametime)
void gr_stuff_first_font(char *first_font, size_t first_font_size)
void mission_hotkey_init()
void Do_model_timings_test()
button_info Multi_ship_status_bi
int event_music_player_respawn_as_observer()
void scripting_state_do_frame(float frametime)
DCF_BOOL(palette_flash, Use_palette_flash)
GLint GLint GLint GLint GLint x
object Objects[MAX_OBJECTS]
for(int idx=0;idx< i;idx++)
void ship_select_do(float frametime)
void shipfx_warpin_start(object *objp)
void game_do_training_checks()
void profile_dump_output()
#define MONITOR_INC(function_name, inc)
int get_mission_info(const char *filename, mission *mission_p, bool basic)
void bm_set_low_mem(int mode)
Sets BMPMAN's memory mode.
uint Mem_starttime_virtual
void hud_free_scrollback_list()
int Training_message_method
const char * XSTR(const char *str, int index)
int game_do_cd_check_specific(char *volume_name, int cdnum)
void mission_show_goals_do_frame(float frametime)
void control_config_do_frame(float frametime)
int mission_load_up_campaign(player *pl)
bool mission_has_fiction()
void game_assign_sound_environment()
bool shipfx_eye_in_shadow(vec3d *eye_pos, object *src_obj, int sun_n)
void multi_df_debrief_do()
void game_framerate_check()
#define PHYSICS_VIEWER_UP
waypoint_list * Training_context_path
void mission_brief_common_init()
vec3d Original_vec_to_deader
float Cutscene_delta_time
void hud_init_comm_orders()
void hud_update_frame(float frametime)
Updates HUD systems each frame.
fix Desired_time_compression
void get_version_string(char *str, int max_size)
void game_event_debug_init()
bool end_string_at_first_hash_symbol(char *src)
bool VOICEREC_init(HWND hWnd, int event_id, int grammar_id, int command_resource)
void vm_vec_copy_scale(vec3d *dest, const vec3d *src, float s)
void game_enter_state(int old_state, int new_state)
void game_title_screen_close()
#define PHYSICS_VIEWER_FRONT
void _cdecl void void _cdecl Error(const char *filename, int line, SCP_FORMAT_STRING const char *format,...) SCP_FORMAT_STRING_ARGS(3
void bars_do_frame(float frametime)
#define GM_STANDALONE_SERVER
void loop_brief_do(float frametime)
int Cmdline_voice_recognition
int cf_chksum_long(const char *filename, uint *chksum, int max_size, int cf_type)
void gamesnd_preload_common_sounds()
void shield_point_multi_setup()
#define MULTI_END_NOTIFY_NONE
int Game_weapons_tbl_checksums[NUM_WEAPONS_TBL_CHECKSUMS]
void game_render_post_frame()
void dc_stuff_float(float *f)
Stuffs a float to the given variable.
void vm_vec_rand_vec_quick(vec3d *rvec)
void jumpnode_level_close()
void neb2_render_setup(camid cid)
void set_rotation(matrix *in_orientation=NULL, float in_rotation_time=0.0f, float in_rotation_acceleration_time=0.0f, float in_rotation_deceleration_time=0.0f)
int sound_env_get(sound_env *se, int preset)
void psnet_init(int protocol, int port_num)
typedef void(APIENTRY *PFNGLARRAYELEMENTEXTPROC)(GLint i)
unsigned int SND_ENV_DEFAULT
int readyroom_continue_campaign()
void multi_host_options_init()
void dc_stuff_int(int *i)
Stuffs an int to the given variable. Supports binary (0b), hexadecimal (0x), and octal (0o) formats...
GLuint const GLchar * name
int saved_timestamp_ticker
int light_get_global_count()
int RunCondition(int condition, char format='\0', void *data=NULL, class object *objp=NULL, int more_data=0)
void cmd_brief_init(int team)
void mission_goal_fail_incomplete()
int Training_context_speed_set
void ai_debug_render_stuff()
int RunBytecode(script_hook &hd, char format='\0', void *data=NULL)
void vm_vec_sub(vec3d *dest, const vec3d *src0, const vec3d *src1)
void game_tst_mark(object *objp, ship *shipp)
int Players_mlocked_timestamp
void collide_ship_ship_sounds_init()
void game_process_pause_key()
void particle_move_all(float frametime)
void hud_scrollback_init()
TrackIRDLL gTirDll_TrackIR
void game_loading_callback(int count)
#define TRAINING_CONTEXT_SPEED
void multi_ingame_select_init()
SCP_vector< object * > effect_ships
subspace ambient sound (left channel) (looped)
int event_music_player_respawn()
int bm_load(const char *real_filename)
Loads a bitmap so we can draw with it later.
int multi_quit_game(int prompt, int notify_code, int err_code, int wsa_error)
GLboolean GLboolean GLboolean b
void std_multi_set_standalone_missiontime(float mission_time)
void dc_stuff_boolean(bool *b)
stuffs a boolean evaluated integer or string into the given variable.
#define NETPLAYER_STATE_WAITING
void wss_direct_restore_loadout()
int submodel_get_num_polys(int model_num, int submodel_num)
void game_sunspot_process(float frametime)
void game_feature_disabled_popup()
#define FS_CDROM_VOLUME_2
void trail_move_all(float frametime)
void profile_end(const char *name)
int player_process_pending_praise()
See if there is a praise message to deliver to the player. We want to delay the praise messages a bit...
#define GetCurrentDirectory(i, s)
int modelstats_num_polys_drawn
void gr_set_cursor_bitmap(int n, int lock)
void palman_load_pixels()
typedef float(SCP_EXT_CALLCONV *SCPTRACKIR_PFFLOATVOID)()
void asteroid_create_all()
void pilot_load_squad_pic_list()
void cmd_brief_do_frame(float frametime)
void main_hall_do(float frametime)
const char * Osreg_class_name
void game_maybe_do_dead_popup(float frametime)
void ship_model_start(object *objp)
int cfputs(const char *str, CFILE *cfile)
GLint GLsizei GLsizei height
float vm_vec_dist_quick(const vec3d *v0, const vec3d *v1)
void common_select_close()
int Show_target_debug_info
void player_restore_target_and_weapon_link_prefs()
void neb2_post_level_init()
void particle_render_all()
void fiction_viewer_do_frame(float frametime)
void gameplay_help_init()
void game_shade_frame(float frametime)
bool Time_compression_locked
void HUD_init()
Called each level to initialize HUD systems.
void ship_init_cockpit_displays(ship *shipp)
#define NUM_SHIPS_TBL_CHECKSUMS
void waypoint_level_close()
void fiction_viewer_close()
char * Cmdline_start_mission
#define MULTI_CONNECTED(np)
void game_maybe_draw_mouse(float frametime)
camid game_render_frame_setup()
loadout_data Player_loadout
fix timer_get_fixed_seconds()
void audiostream_unpause_all(bool via_sexp_or_script=false)
void hud_scrollback_do_frame(float frametime)
void subtitles_do_frame(float frametime)
#define MULTI_SYNC_INGAME
int Campaign_ending_via_supernova
void cutscenes_screen_do_frame()
class camera * getCamera()
#define MULTI_SYNC_POST_BRIEFING
char Game_CDROM_dir[MAX_PATH_LEN]
void gr_get_string_size(int *w, int *h, const char *text, int len=9999)
void generic_anim_init(generic_anim *ga)
int snd_play_looping(game_snd *gs, float pan, int start_loop, int stop_loop, float vol_scale, int scriptingUpdateVolume)
void game_add_event_debug_index(int n, int indent)
void multi_join_game_close()
void mission_hotkey_close()
void game_post_level_init()
#define FSB_FROM_VOLITION
#define MOVIE_PRE_FICTION
void event_music_level_init(int force_soundtrack)
void hud_setup_escort_list(int level)
void game_shudder_apply(int time, float intensity)
void get_version_string_short(char *str)
GLsizei const GLchar ** path
void game_flip_page_and_time_it()
void mission_load_menu_init()
bool logfile_init(int logfile_type)
void game_render_hud(camid cid)
void timestamp_inc(int frametime_ms)
void stars_draw(int show_stars, int show_suns, int show_nebulas, int show_subspace, int env)
#define NG_FLAG_SERVER_LOST
void mission_campaign_init()
#define DEFAULT_SKILL_LEVEL
#define MULTIPLAYER_MASTER
void HUD_reset_clip()
Like gr_reset_clip() only it accounts for HUD jittering.
An overhauled/updated debug console to allow monitoring, testing, and general debugging of new featur...
texture_info textures[TM_NUM_TYPES]
SCP_vector< ship_info > Ship_info
void ship_clear_cockpit_displays()
void gameseq_push_state(int new_state)
bool game_using_low_mem()
void gr_reset_screen_scale()
int MessageBox(HWND h, const char *s1, const char *s2, int i)
void main_hall_start_music()
const char * Skill_level_names(int skill_level, int translate=1)
#define timestamp_elapsed(stamp)
void barracks_do_frame(float frametime)
char * Cmdline_spew_table_crcs
int Target_static_looping
#define gr_post_process_save_zbuffer
#define FS_CDROM_VOLUME_3
lang_info Lcl_builtin_languages[NUM_BUILTIN_LANGUAGES]
void convert_pilot_files()
void control_config_close()
void shipfx_warpout_start(object *objp)
#define gr_copy_effect_texture
#define MISSION_FLAG_2D_MISSION
#define MOVIE_PRE_DEBRIEF
void gameplay_help_do_frame(float frametime)
int game_main(char *cmdline)
bool movie_play(char *name)
void mission_campaign_save_player_persistent_variables()
void freespace_mission_load_stuff()
int ENVMAP
References a map that is for environment mapping -Bobboau.
void player_controls_init()
void ship_process_targeting_lasers()
void multi_df_debrief_init()
#define PHYSICS_VIEWER_REAR
float vm_vec_dot(const vec3d *v0, const vec3d *v1)
void multi_respawn_observer()
void event_music_level_close()
void multi_oo_gameplay_init()
void fs2netd_spew_table_checksums(char *outfile)
void cutscenes_screen_init()
void gr_bitmap(int _x, int _y, int resize_mode)
void game_stop_subspace_ambient_sound()
void multi_standalone_postgame_close()
void HUD_fixed_printf(float duration, color col, const char *format,...)
void multi_standalone_wait_do()
int game_get_default_skill_level()
void ship_self_destruct(object *objp)
void message_queue_process()
void player_save_target_and_weapon_link_prefs()
void mouse_get_real_pos(int *mx, int *my)
void dc_printf(const char *format,...)
Prints the given char string to the debug console.
void freespace_stop_mission()
void game_do_dc_networking()
#define PCM_WARPOUT_STAGE3
void gr_create_shader(shader *shade, ubyte r, ubyte g, ubyte b, ubyte c)
void windebug_memwatch_init()
void multi_oo_rate_init_all()
void HUD_printf(const char *format,...)
SCP_vector< object * > transparent_objects
void game_loading_callback_init()
big_expl_flash Big_expl_flash
#define PLAYER_FLAGS_IS_MULTI
void subtitles_do_frame_post_shaded(float frametime)
char filename[MAX_FILENAME_LEN]
void batch_render_distortion_map_bitmaps(int buffer_handle)
int ship_name_lookup(const char *name, int inc_players)
waypoint * find_waypoint_at_index(waypoint_list *list, int index)
char envmap_name[MAX_FILENAME_LEN]
void ParseClassInfo(char *section)
void snd_spew_debug_info()
void mission_load_menu_do()
void pilot_load_pic_list()
void brief_parse_icon_tbl()
void launch_context_help()
void _cdecl gr_printf_no_resize(int x, int y, const char *format,...)
void audiostream_pause_all(bool via_sexp_or_script=false)
int cfclose(CFILE *cfile)
void game_training_pause_do()
void multi_df_debrief_close()
void do_frame(float in_frametime)
void gr_set_font(int fontnum)
GLclampf GLclampf GLclampf alpha
void game_show_eye_pos(camid cid)
int bm_make_render_target(int width, int height, int flags)
Creates a render target as close to the desired resolution as possible.
void bm_unload_all()
Unloads all used bitmaps, should only ever be called by game_shutdown()
void obj_snd_level_init()
void hud_render_preprocess(float frametime)
Render gauges that need to be between a g3_start_frame() and a g3_end_frame()
void compute_slew_matrix(matrix *orient, angles *a)
void multi_game_client_setup_close()
void red_alert_bash_wingman_status()
void main_hall_stop_music(bool fade)
void apply_view_shake(matrix *eye_orient)
#define MOVIE_PRE_CMD_BRIEF
#define FS_CDROM_VOLUME_1
void gr_set_shader(shader *shade)
void multi_create_game_do()
int Game_builtin_mission_count
void mission_brief_common_reset()
int multi_find_player_by_object(object *objp)
char filename[FILESPEC_LENGTH]
int cf_get_file_list(SCP_vector< SCP_string > &list, int pathtype, const char *filter, int sort=CF_SORT_NONE, SCP_vector< file_list_info > *info=NULL)
void control_config_clear_used_status()
void multi_rate_display(int np_index, int x, int y)
char Fred_alt_names[MAX_SHIPS][NAME_LENGTH+1]
bool dc_maybe_stuff_float(float *f)
Tries to stuff a float from the Command_string.
void game_show_event_debug(float frametime)
bool IsConditionOverride(int action, object *objp=NULL)
net_player Net_players[MAX_PLAYERS]
void game_set_view_clip(float frametime)
int Cmdline_reparse_mainhall
#define SetCurrentDirectory(s)
debug_command dc_a("a","shortcut for ai_pause", dcf_ai_pause)
int timer_get_milliseconds()
int Use_fullscreen_at_startup
void gameseq_post_event(int event)
void main_hall_init(const SCP_string &main_hall_name)
int Cmdline_multi_stream_chat_to_file
void hud_set_iff_color(object *objp, int is_bright)
Will set the color to the IFF color based on the team.
void training_mission_init()
#define SUN_DIMINISH_RATE
void vm_vec_add(vec3d *dest, const vec3d *src0, const vec3d *src1)
void gr_init_color(color *c, int r, int g, int b)
void obj_move_all(float frametime)
char Multi_tracker_login[MULTI_TRACKER_STRING_LEN+1]
ship is warping out in 3rd person
matrix vmd_identity_matrix
multi_global_options Multi_options_g
#define CD_SIZE_72_MINUTE_MAX
void mouse_mark_button(uint flags, int set)
char ship_name[NAME_LENGTH]
void multi_display_netinfo()
int modelstats_num_sortnorms
#define DEBUG_GET_TIME(x)
float VIEWER_ZOOM_DEFAULT
#define MAX_SHIP_CLASSES_MULTI
void model_set_detail_level(int n)
void event_music_first_pattern()
cmission missions[MAX_CAMPAIGN_MISSIONS]
void mission_hotkey_set_defaults()
void load_filter_info(void)
#define MISSION_FLAG_SUBSPACE
int Debug_dump_frame_count
int Main_hall_netgame_started
void std_set_standalone_fps(float fps)
void mission_show_goals_init()
void gameseq_set_state(int new_state, int override)
int Game_do_state_should_skip
int cfile_init(const char *exe_dir, const char *cdrom_dir)
Initialize the cfile system. Called once at application start.
int current_target_is_locked
bool Cmdline_benchmark_mode
void multi_start_game_close()
#define g3_start_frame(zbuffer_flag)
int Event_debug_index[EVENT_DEBUG_MAX]
void setup_environment_mapping(camid cid)
bool dc_maybe_stuff_string_white(char *str, size_t len)
Tries to stuff a whitespace delimited string to out_str from the command line, stopping at the end of...
bool IsOverride(script_hook &hd)
float vm_vec_normalize(vec3d *v)
void init_multiplayer_stats()
void player_repair_frame(float frametime)
int main(int argc, char *argv[])
int Game_sound_env_update_timestamp
void multi_host_options_close()
void render_environment(int i, vec3d *eye_pos, matrix *new_orient, float new_zoom)
void HUD_set_offsets(object *viewer_obj, int wiggedy_wack, matrix *eye_orient)
Set the offset values for this render frame.
int cfseek(CFILE *fp, int offset, int where)
void mission_show_goals_close()