61 static int Current_brief_stage;
62 static int Last_brief_stage;
63 static int Num_brief_stages;
64 static int Brief_multiplayer =
FALSE;
66 static int Brief_last_auto_advance = 0;
69 static int Quick_transition_stage;
70 static int Start_fade_up_anim, Start_fade_down_anim;
71 static int Brief_playing_fade_sound;
84 static int Num_briefing_regions;
87 #define ONE_REV_TIME 6 // time (sec) for one revolution
88 #define MAX_ANG_CHG 0.15f
151 #define BRIEF_X_COORD 0
152 #define BRIEF_Y_COORD 1
153 #define BRIEF_W_COORD 2
154 #define BRIEF_H_COORD 3
201 static int Brief_ui_mask_w = -1;
202 static int Brief_ui_mask_h = -1;
212 #define BRIEF_LAST_STAGE_MASK 7
213 #define BRIEF_NEXT_STAGE_MASK 8
214 #define BRIEF_PREV_STAGE_MASK 9
215 #define BRIEF_FIRST_STAGE_MASK 10
216 #define BRIEF_TEXT_SCROLL_UP_MASK 11
217 #define BRIEF_TEXT_SCROLL_DOWN_MASK 12
218 #define BRIEF_SKIP_TRAINING_MASK 15
219 #define BRIEF_PAUSE_MASK 16
229 brief_buttons(
char *
name,
int x1,
int y1,
int xt1,
int yt1,
int h,
int r = 0) : filename(name), x(x1), y(y1), xt(xt1), yt(yt1), hotspot(h), repeat(
r) {}
241 #define NUM_BRIEF_BUTTONS 10
271 #define BRIEF_SELECT_NUM_TEXT 3
319 return XSTR(
"Close", 428);
372 if ( (now - Brief_last_auto_advance) < 500 ) {
376 Current_brief_stage++;
377 if ( Current_brief_stage >= Num_brief_stages ) {
378 Current_brief_stage = Num_brief_stages - 1;
380 if ( Quick_transition_stage != -1 )
388 Assert(Current_brief_stage >= 0);
397 Current_brief_stage--;
398 if ( Current_brief_stage < 0 ) {
399 Current_brief_stage = 0;
405 if ( Quick_transition_stage != -1 )
411 Assert(Current_brief_stage >= 0);
423 Current_brief_stage = 0;
425 else if ( Current_brief_stage != 0 ) {
427 Current_brief_stage = 0;
428 if ( Quick_transition_stage != -1 )
433 Assert(Current_brief_stage >= 0);
442 if ( Current_brief_stage != Num_brief_stages - 1 ) {
444 Current_brief_stage = Num_brief_stages - 1;
445 if ( Quick_transition_stage != -1 )
451 Assert(Current_brief_stage >= 0);
571 if (Closeup_close_button.
pressed()) {
678 Closeup_close_button.
disable();
679 Closeup_close_button.
hide();
682 if(Num_brief_stages <= 0){
714 if ( Closeup_icon != NULL ) {
717 Closeup_close_button.
disable();
718 Closeup_close_button.
hide();
744 if ( Num_brief_stages <= 0 ){
865 Brief_last_auto_advance = 0;
884 nprintf((
"Alan",
"brief_init() returning without doing anything\n"));
893 Current_brief_stage = 0;
894 Last_brief_stage = 0;
902 nprintf((
"Alan",
"Entering brief_init()\n"));
907 Num_briefing_regions = 0;
970 Brief_playing_fade_sound = 0;
981 #define CLOSEUP_TEXT_OFFSET 10
1037 Closeup_angles.
h += ang;
1038 if ( Closeup_angles.
h >
PI2 )
1039 Closeup_angles.
h -=
PI2;
1041 Closeup_orient = temp_matrix;
1061 light_dir.
xyz.y = 1.0f;
1108 Closeup_close_button.
enable();
1109 Closeup_close_button.
unhide();
1122 if ( Num_brief_stages <= 0 ) {
1171 #if !defined(NDEBUG)
1200 #define CLOSEUP_OFFSET 20
1246 switch(Closeup_icon->
type) {
1248 Closeup_icon = NULL;
1296 if ( Closeup_icon->
modelnum == -1 ) {
1297 if ( sip == NULL ) {
1307 Closeup_orient.
vec.fvec = tvec;
1309 Closeup_angles.
p = 0.0f;
1310 Closeup_angles.
b = 0.0f;
1311 Closeup_angles.
h =
PI;
1333 int i, closeup_index;
1338 if ( Closeup_icon != NULL ) {
1344 if ( Closeup_icon == NULL )
1359 if ( closeup_index != -1 ) {
1360 bi = &bs->
icons[closeup_index];
1364 Closeup_icon = NULL;
1375 int mx, my,
i, iw, ih,
x,
y;
1393 if (mx >= x && mx <= (x+iw) && my >= y && my <= (y+ih)) {
1407 if ( mx < bi->x )
continue;
1408 if ( mx > (bi->
x + iw) )
continue;
1409 if ( my < bi->y )
continue;
1410 if ( my > (bi->
y + ih) )
continue;
1432 if ( Num_brief_stages <= 0 )
1435 if ( Closeup_icon != NULL ) {
1441 if ( Current_brief_stage == (Num_brief_stages-1) ) {
1467 int k, brief_choice;
1488 int snazzy_action = -1;
1493 if ( Closeup_icon ) {
1516 if ( Closeup_icon && Closeup_icon->
ship_class ) {
1532 if ( Closeup_icon && (Closeup_icon->
ship_class < static_cast<int>(
Ship_info.size()) - 1) ) {
1548 Closeup_cam_pos.
xyz.z += 1;
1553 Closeup_cam_pos.
xyz.z += 10;
1558 Closeup_cam_pos.
xyz.z -= 1;
1563 Closeup_cam_pos.
xyz.z -= 10;
1568 Closeup_cam_pos.
xyz.y += 1;
1573 Closeup_cam_pos.
xyz.y += 10;
1578 Closeup_cam_pos.
xyz.y -= 1;
1583 Closeup_cam_pos.
xyz.y -= 10;
1621 nprintf((
"General",
"Camera pos: %.2f, %.2f %.2f // ", Closeup_cam_pos.
xyz.x, Closeup_cam_pos.
xyz.y, Closeup_cam_pos.
xyz.z));
1626 if ( brief_choice > -1 && snazzy_action ==
SNAZZY_OVER ) {
1636 if ( brief_choice != -1 ) {
1644 if ( Current_brief_stage < (Num_brief_stages-1) ) {
1654 int check_jump_flag = 1;
1655 if ( Current_brief_stage != Last_brief_stage ) {
1658 if ( Quick_transition_stage != -1 ) {
1659 Quick_transition_stage = -1;
1662 check_jump_flag = 0;
1665 if ( check_jump_flag ) {
1666 if ( abs(Current_brief_stage - Last_brief_stage) > 1 ) {
1667 Quick_transition_stage = Current_brief_stage;
1668 Current_brief_stage = Last_brief_stage;
1669 Assert(Current_brief_stage >= 0);
1670 Start_fade_up_anim = 1;
1671 goto Transition_done;
1676 if ( Current_brief_stage > Last_brief_stage ) {
1678 Quick_transition_stage = Current_brief_stage;
1679 Current_brief_stage = Last_brief_stage;
1680 Assert(Current_brief_stage >= 0);
1681 Start_fade_up_anim = 1;
1682 goto Transition_done;
1689 Quick_transition_stage = Current_brief_stage;
1690 Current_brief_stage = Last_brief_stage;
1691 Assert(Current_brief_stage >= 0);
1692 Start_fade_up_anim = 1;
1693 goto Transition_done;
1703 if ( Current_brief_stage < 0 ) {
1705 Current_brief_stage=0;
1711 time, Current_brief_stage);
1713 Brief_playing_fade_sound = 0;
1714 Last_brief_stage = Current_brief_stage;
1734 Brief_ui_window.
draw();
1823 nprintf((
"Warning",
"brief_close() returning without doing anything\n"));
1827 nprintf((
"Alan",
"Entering brief_close()\n"));
1877 nprintf((
"Warning",
"No music file exists to play music at this briefing!\n"));
1916 if ( Start_fade_up_anim ) {
1921 if ( !Brief_playing_fade_sound ) {
1923 Brief_playing_fade_sound = 1;
1928 Start_fade_up_anim = 0;
1929 Start_fade_down_anim = 1;
1930 Current_brief_stage = Quick_transition_stage;
1932 if ( Current_brief_stage < 0 ) {
1934 Current_brief_stage = Last_brief_stage;
1937 Assert(Current_brief_stage >= 0);
1938 goto Fade_down_anim_start;
1954 Fade_down_anim_start:
1955 if ( Start_fade_down_anim ) {
1962 Start_fade_up_anim = 0;
1963 Start_fade_down_anim = 0;
1982 Quick_transition_stage = -1;
1983 Start_fade_up_anim = 0;
1984 Start_fade_down_anim = 0;
void light_add_directional(const vec3d *dir, float intensity, float r, float g, float b, float spec_r, float spec_g, float spec_b, bool specular)
void gr_rect(int x, int y, int w, int h, int resize_mode)
brief_buttons Brief_buttons[GR_NUM_RESOLUTIONS][NUM_BRIEF_BUTTONS]
void set_highlight_action(void(*_user_function)(void))
void multi_ts_lock_pressed()
#define BRIEF_BUTTON_FIRST_STAGE
void fsspeech_pause(bool playing)
int chatbox_create(int mode_flags)
void add_XSTR(char *string, int _xstr_id, int _x, int _y, UI_GADGET *_assoc, int _color_type, int _font_id=-1)
int Closeup_button_hotspot
#define MR_SHOW_OUTLINE_HTL
void mission_campaign_exit_loop()
#define BRIEF_BUTTON_EXIT_LOOP
void briefing_load_music(char *fname)
int Num_brief_text_lines[MAX_TEXT_STREAMS]
void brief_do_end_pressed()
#define ICON_UNKNOWN_WING
int Cmdline_freespace_no_music
void brief_maybe_flash_button()
void brief_button_do(int i)
void brief_do_prev_pressed()
int ML_objectives_init(int x, int y, int w, int h)
void brief_render_closeup(int ship_class, float frametime)
GLfloat GLfloat GLfloat GLfloat h
#define MISSION_FLAG_FULLNEB
bool Cmdline_brief_lighting
brief_common_buttons Common_buttons[3][GR_NUM_RESOLUTIONS][NUM_COMMON_BUTTONS]
char Game_current_mission_filename[MAX_FILENAME_LEN]
UI_XSTR Brief_select_text[GR_NUM_RESOLUTIONS][BRIEF_SELECT_NUM_TEXT]
char * Brief_static_name[GR_NUM_RESOLUTIONS]
#define MISSION_FLAG_SCRAMBLE
#define gr_end_view_matrix
color Color_more_indicator
int Closeup_one_revolution_time
matrix * vm_angles_2_matrix(matrix *m, const angles *a)
void brief_voice_unpause(int stage_num)
int snazzy_menu_do(ubyte *data, int mask_w, int mask_h, int num_regions, MENU_REGION *regions, int *action, int poll_key, int *key)
brief_stage stages[MAX_BRIEF_STAGES]
#define GR_NUM_RESOLUTIONS
__inline void gr_string(int x, int y, const char *string, int resize_mode=GR_RESIZE_FULL)
void brief_render(float frametime)
int Closeup_region[GR_NUM_RESOLUTIONS][4]
general failure sound for any event
void brief_common_close()
void set_flags(uint flags)
struct vec3d::@225::@227 xyz
void model_render_immediate(model_render_params *render_info, int model_num, matrix *orient, vec3d *pos, int render, bool sort)
int Closeup_button_coords[GR_NUM_RESOLUTIONS][2]
#define BRIEF_SELECT_NUM_TEXT
char background[GR_NUM_RESOLUTIONS][MAX_FILENAME_LEN]
int brief_only_allow_briefing()
void common_check_buttons()
#define END_OF_LIST(head)
void brief_unload_bitmaps()
model_subsystem * subsystems
void set_detail_level_lock(int detail_level_lock)
int Brief_max_line_width[GR_NUM_RESOLUTIONS]
void help_overlay_set_state(int overlay_id, int resolution_index, int state)
void gr_set_color_fast(color *dst)
void mission_campaign_mission_over(bool do_next_mission)
void common_buttons_maybe_reload(UI_WINDOW *ui_window)
#define BRIEF_TEXT_SCROLL_UP_MASK
void set_active_ui(UI_WINDOW *ui_window)
int red_alert_mission(void)
int Brief_text_coords[GR_NUM_RESOLUTIONS][4]
void gr_set_bitmap(int bitmap_num, int alphablend_mode, int bitblt_mode, float alpha)
briefing Briefings[MAX_TVT_TEAMS]
#define COMMON_WEAPON_REGION
void brief_get_closeup_ship_modelnum(brief_icon *ci)
GLenum GLuint GLenum GLsizei const GLchar * buf
void brief_check_buttons()
const char *(* tooltip_handler)(const char *text)
#define BRIEF_BUTTON_SKIP_TRAINING
int bm_release(int handle, int clear_render_targets)
Frees both a bitmap's data and it's associated slot.
char Asteroid_icon_closeup_model[NAME_LENGTH]
void snazzy_menu_add_region(MENU_REGION *region, const char *text, int mask, int key, int click_sound)
#define gr_end_proj_matrix
int mouse_get_pos_unscaled(int *xpos, int *ypos)
#define ON_BRIEFING_SELECT
int audiostream_is_playing(int i)
void common_reset_buttons()
void common_set_interface_palette(char *filename)
void common_flash_button_init()
#define STI_HUD_NO_CLASS_DISPLAY
__inline void gr_set_clip(int x, int y, int w, int h, int resize_mode=GR_RESIZE_FULL)
void draw_forced(int frame_num)
ubyte * Brief_ui_mask_data
#define MAX_BRIEF_LINE_W_640
UI_BUTTON Closeup_close_button
#define gr_set_view_matrix
void brief_restart_text_wipe()
void set_mask_bmap(char *fname)
#define MISSION_FLAG_NO_BRIEFING
int set_bmaps(char *ani_filename, int nframes=3, int start_frame=1)
void brief_do_frame(float frametime)
char pof_file[MAX_FILENAME_LEN]
#define gr_set_proj_matrix
#define BRIEF_PREV_STAGE_MASK
GLdouble GLdouble GLdouble r
#define NUM_BRIEFING_REGIONS
void mission_goal_mark_objectives_complete()
void common_redraw_pressed_buttons()
int common_select_do(float frametime)
void brief_exit_loop_pressed()
struct matrix::@228::@230 vec
void common_maybe_play_cutscene(int movie_type, bool restart_music, int music)
void get_dimensions(int *_x, int *_y, int *_w, int *_h)
#define MISSION_FLAG_ALWAYS_SHOW_GOALS
int Briefing_music_handle
int brief_time_to_advance(int stage_num)
void ML_objectives_close()
void brief_maybe_blit_scene_cut(float frametime)
void brief_scroll_down_text()
int Brief_static_coords[GR_NUM_RESOLUTIONS][2]
void brief_init_screen(int multiplayer_flag)
int Brief_bmap_coords[GR_NUM_RESOLUTIONS][2]
void g3_set_view_matrix(const vec3d *view_pos, const matrix *view_matrix, float zoom)
#define MISSION_FLAG_RED_ALERT
void brief_voice_play(int stage_num)
void model_clear_instance(int model_num)
void brief_compact_stages()
void brief_reset_icons(int stage_num)
void multi_ts_commit_pressed()
void chatbox_force_small()
void brief_do_next_pressed(int play_sound)
#define MISSION_FLAG_END_TO_MAINHALL
void vm_set_identity(matrix *m)
int Brief_multitext_bitmap
void brief_camera_move(float frametime, int stage_num)
#define BRIEF_BUTTON_PAUSE
void brief_transition_reset()
void brief_render_closeup_text()
UI_WINDOW Brief_ui_window
void message_mission_shutdown()
#define NETINFO_FLAG_TEAM_CAPTAIN
void common_select_init()
#define NETINFO_FLAG_GAME_HOST
#define BRIEF_BUTTON_SCROLL_UP
void brief_do_start_pressed()
int model_load(char *filename, int n_subsystems, model_subsystem *subsystems, int ferror=1, int duplicate=0)
char Mission_filename[80]
void brief_set_closeup_pos(brief_icon *bi)
void set_color(color &clr)
void brief_set_default_closeup()
int Briefing_music_begin_timestamp
void brief_set_new_stage(vec3d *pos, matrix *orient, int time, int stage_num)
int common_num_cutscenes_valid(int movie_type)
#define BRIEF_BUTTON_NEXT_STAGE
void audiostream_unpause(int i, bool via_sexp_or_script)
void common_check_keys(int k)
void common_render_selected_screen_button()
void brief_voice_pause(int stage_num)
GLint GLint GLint GLint GLint x
bool Glowpoint_use_depth_buffer
brief_icon * Closeup_icon
const char * XSTR(const char *str, int index)
user_click (mouse selects a control)
#define vm_vec_make(v, _x, _y, _z)
char modified[DATE_TIME_LENGTH]
void brief_blit_stage_num(int stage_num, int stage_max)
#define BRIEF_BUTTON_LAST_STAGE
void briefing_stop_music(bool fade)
bool end_string_at_first_hash_symbol(char *src)
void briefing_start_music()
void brief_reset_last_new_stage()
void brief_common_get_icon_dimensions(int *w, int *h, brief_icon *bi)
void set_hotkey(int keycode)
void hud_anim_init(hud_anim *ha, int sx, int sy, const char *filename)
Initialise the members of the hud_anim struct to default values.
GLuint const GLchar * name
void mission_goal_fail_incomplete()
void common_buttons_init(UI_WINDOW *ui_window)
#define BRIEF_LAST_STAGE_MASK
#define COMMON_HELP_REGION
#define MISSION_TYPE_TRAINING
bool sexp_replace_variable_names_with_values(char *text, int max_len)
int bm_load(const char *real_filename)
Loads a bitmap so we can draw with it later.
GLboolean GLboolean GLboolean b
void audiostream_close_file(int i, int fade)
static in a briefing stage cut
#define ICON_ASTEROID_FIELD
char alt_name[NAME_LENGTH]
void brief_skip_training_pressed()
void mission_campaign_eval_next_mission()
brief_icon * brief_get_closeup_icon()
scroll pressed (and scroll)
void mission_campaign_store_goals_and_events_and_variables()
void link_hotspot(int num)
ubyte * get_mask_data(int *w_md, int *h_md)
void create(UI_WINDOW *wnd, char *_text, int _x, int _y, int _w, int _h, int do_repeat=0, int ignore_focus=0)
#define COMMON_COMMIT_REGION
void create(int _x, int _y, int _w, int _h, int _flags, int _f_id=-1)
#define BRIEF_BUTTON_SCROLL_DOWN
int eval_sexp(int cur_node, int referenced_node)
int gr_force_fit_string(char *str, int max_str, int max_width)
#define BRIEF_NEXT_STAGE_MASK
void gr_get_string_size(int *w, int *h, const char *text, int len=9999)
float Asteroid_icon_closeup_zoom
#define MAX_BRIEF_LINE_W_1024
float model_get_radius(int modelnum)
#define COMMON_OPTIONS_REGION
SCP_vector< ship_info > Ship_info
void common_play_highlight_sound()
float Master_event_music_volume
void brief_check_for_anim()
#define BRIEF_FIRST_STAGE_MASK
int hud_anim_load(hud_anim *ha)
Load a hud_anim.
void multi_common_voice_display_status()
void audiostream_play(int i, float volume, int looping)
int Brief_background_bitmap
void ML_objectives_do_frame(int scroll_offset)
char * Closeup_button_filename[GR_NUM_RESOLUTIONS]
int brief_render_text(int line_offset, int x, int y, int h, float frametime, int instance, int line_spacing)
void gr_bitmap(int _x, int _y, int resize_mode)
#define UI_XSTR_COLOR_GREEN
#define NETPLAYER_STATE_BRIEFING
void brief_turn_off_closeup_icon()
#define BRIEF_BUTTON_MULTI_LOCK
char * Closeup_background_filename[GR_NUM_RESOLUTIONS]
void brief_voice_load_all()
int mission_ui_background_load(const char *custom_background, const char *single_background, const char *multi_background)
int audiostream_open(const char *filename, int type)
#define BRIEF_TEXT_SCROLL_DOWN_MASK
void brief_render_map(int stage_num, float frametime)
int bm_unload(int handle, int clear_render_targets, bool nodebug)
Unloads a bitmap's data, but not the bitmap info.
void audiostream_pause(int i, bool via_sexp_or_script)
void brief_redraw_pressed_buttons()
void gamesnd_play_iface(int n)
void brief_voice_unload_all()
#define COMMON_BRIEFING_REGION
void common_render(float frametime)
char closeup_label[MAX_LABEL_LEN]
int common_flash_bright()
int help_overlay_get_index(const char *overlay_name)
#define NUM_BRIEF_BUTTONS
void _cdecl gr_printf_menu(int x, int y, const char *format,...)
int timer_get_milliseconds()
void gameseq_post_event(int event)
void help_overlay_maybe_blit(int overlay_id, int resolution_index)
int help_overlay_active(int overlay_id)
void brief_load_bitmaps()
vec3d Asteroid_icon_closeup_position
void brief_scroll_up_text()
SCP_vector< ship_type_info > Ship_types
void common_music_init(int score_index)
void brief_update_closeup_icon(int mode)
void brief_voice_stop(int stage_num)
#define g3_start_frame(zbuffer_flag)
const char * brief_tooltip_handler(const char *str)
void brief_buttons_init()
#define BRIEF_BUTTON_PREV_STAGE
int brief_setup_closeup(brief_icon *bi)