33 #define NUM_CMD_SETTINGS 2
110 #define MAX_CMD_BRIEF_BUTTONS 10
111 #define MIN_CMD_BRIEF_BUTTONS 8
112 #define NUM_CMD_BRIEF_BUTTONS (Uses_scroll_buttons ? MAX_CMD_BRIEF_BUTTONS : MIN_CMD_BRIEF_BUTTONS)
114 #define CMD_BRIEF_BUTTON_FIRST_STAGE 0
115 #define CMD_BRIEF_BUTTON_PREV_STAGE 1
116 #define CMD_BRIEF_BUTTON_PAUSE 2
117 #define CMD_BRIEF_BUTTON_NEXT_STAGE 3
118 #define CMD_BRIEF_BUTTON_LAST_STAGE 4
119 #define CMD_BRIEF_BUTTON_HELP 5
120 #define CMD_BRIEF_BUTTON_OPTIONS 6
121 #define CMD_BRIEF_BUTTON_ACCEPT 7
122 #define CMD_BRIEF_BUTTON_SCROLL_UP 8
123 #define CMD_BRIEF_BUTTON_SCROLL_DOWN 9
155 #define CMD_BRIEF_NUM_TEXT 3
171 static int Cmd_brief_background_bitmap;
172 static int Cur_stage;
173 static int Cmd_brief_inited = 0;
174 static int Voice_good_to_go = 0;
175 static int Voice_started_time = 0;
176 static int Voice_ended_time;
178 static char *Cur_anim_filename =
"~~~~";
180 static int Cmd_brief_last_voice;
181 static int Cmd_brief_last_stage;
182 static int Cmd_brief_paused = 0;
184 static int Uses_scroll_buttons = 0;
203 Cmd_brief_last_voice = -1;
204 Cmd_brief_last_stage = -1;
209 if (!Voice_good_to_go)
212 if (Cmd_brief_paused)
224 if (!Voice_ended_time) {
237 if (!Voice_ended_time) {
245 if (!Voice_ended_time)
260 if (!Voice_good_to_go) {
261 Voice_started_time = 0;
265 if (!Voice_started_time) {
267 Voice_ended_time = 0;
274 if (Cur_stage >= 0 && Cur_stage < Cur_cmd_brief->num_stages){
282 if (Cmd_brief_last_stage == stage) {
287 if (Cmd_brief_last_stage >= 0) {
289 Cmd_brief_last_stage = -1;
293 Cmd_brief_last_stage = stage;
299 if (Cmd_brief_last_voice == voice) {
304 if (Cmd_brief_last_voice >= 0) {
306 Cmd_brief_last_voice = -1;
310 Cmd_brief_last_voice = voice;
335 Voice_good_to_go = 0;
336 if (Cmd_brief_last_voice >= 0) {
338 Cmd_brief_last_voice = -1;
340 if (Cmd_brief_last_stage >= 0) {
342 Cmd_brief_last_stage = -1;
370 if (stream_result < 0) {
399 if (Cmd_brief_paused)
402 Cmd_brief_paused = 1;
404 if (Cmd_brief_last_voice >= 0) {
407 if (Cmd_brief_last_stage >= 0) {
418 if (!Cmd_brief_paused)
421 Cmd_brief_paused = 0;
423 if (Cmd_brief_last_voice >= 0) {
426 if (Cmd_brief_last_stage >= 0) {
454 else if (Cur_stage) {
470 else if (Cur_stage) {
480 if (Cur_stage < Cur_cmd_brief->num_stages - 1) {
490 if (Cur_stage < Cur_cmd_brief->num_stages - 1) {
538 name =
NOX(
"CB_default");
550 Cmd_brief_inited = 0;
567 Uses_scroll_buttons = 1;
569 if (Cmd_brief_background_bitmap < 0)
571 Uses_scroll_buttons = 0;
603 if (Uses_scroll_buttons)
618 Cmd_brief_paused = 0;
619 Cmd_brief_inited = 1;
626 if (Cmd_brief_inited) {
636 Cur_anim_filename =
"~~~~";
638 if (Cmd_brief_background_bitmap >= 0)
644 Cmd_brief_inited = 0;
654 int i, k,
w,
h,
x,
y;
657 if (!Cmd_brief_inited) {
704 if (Cmd_brief_background_bitmap >= 0) {
730 Voice_good_to_go = 1;
void gr_rect(int x, int y, int w, int h, int resize_mode)
ui_button_info Cmd_brief_buttons[GR_NUM_RESOLUTIONS][MAX_CMD_BRIEF_BUTTONS]
void set_highlight_action(void(*_user_function)(void))
void fsspeech_pause(bool playing)
int Briefing_voice_enabled
void add_XSTR(char *string, int _xstr_id, int _x, int _y, UI_GADGET *_assoc, int _color_type, int _font_id=-1)
#define CMD_BRIEF_BUTTON_HELP
int Num_brief_text_lines[MAX_TEXT_STREAMS]
GLfloat GLfloat GLfloat GLfloat h
color Color_more_indicator
int Cmd_text_wnd_coords[NUM_CMD_SETTINGS][GR_NUM_RESOLUTIONS][4]
char * Cmd_brief_fname[NUM_CMD_SETTINGS][GR_NUM_RESOLUTIONS]
int brief_color_text_init(const char *src, int w, const char default_color, int instance, int max_lines, const bool append)
unsigned char done_playing
UI_XSTR Cmd_brief_text[GR_NUM_RESOLUTIONS][CMD_BRIEF_NUM_TEXT]
void cmd_brief_stop_anim()
#define GR_NUM_RESOLUTIONS
__inline void gr_string(int x, int y, const char *string, int resize_mode=GR_RESIZE_FULL)
general failure sound for any event
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 cmd_brief_ani_wave_init(int index)
int Cmd_stage_y[GR_NUM_RESOLUTIONS]
char ani_filename[MAX_FILENAME_LEN]
#define GR_MAYBE_CLEAR_RES(bmap)
void common_music_close()
void help_overlay_set_state(int overlay_id, int resolution_index, int state)
void cmd_brief_init_voice()
void set_ignore_gadgets(int state)
void gr_set_color_fast(color *dst)
#define CMD_BRIEF_OVERLAY
cmd_brief Cmd_briefs[MAX_TVT_TEAMS]
int red_alert_mission(void)
void gr_set_bitmap(int bitmap_num, int alphablend_mode, int bitblt_mode, float alpha)
#define CMD_BRIEF_BUTTON_SCROLL_DOWN
GLenum GLuint GLenum GLsizei const GLchar * buf
int bm_release(int handle, int clear_render_targets)
Frees both a bitmap's data and it's associated slot.
void generic_anim_unload(generic_anim *ga)
int Cmd_image_center_coords[GR_NUM_RESOLUTIONS][2]
int audiostream_is_playing(int i)
void draw_forced(int frame_num)
#define CMD_BRIEF_BUTTON_OPTIONS
void set_mask_bmap(char *fname)
int set_bmaps(char *ani_filename, int nframes=3, int start_frame=1)
void common_maybe_play_cutscene(int movie_type, bool restart_music, int music)
int mission_has_cmd_brief()
void audiostream_stop(int i, int rewind, int paused)
Switching to a new screen, but not commit.
void cmd_brief_button_pressed(int n)
void generic_anim_render(generic_anim *ga, float frametime, int x, int y, bool menu)
sprintf(buf,"(%f,%f,%f)", v3->xyz.x, v3->xyz.y, v3->xyz.z)
int Briefing_music_handle
#define CMD_BRIEF_BUTTON_PAUSE
#define CMD_BRIEF_BUTTON_ACCEPT
void fsspeech_play(int type, const char *text)
#define CMD_BRIEF_BUTTON_FIRST_STAGE
cmd_brief_stage stage[CMD_BRIEF_STAGES_MAX]
#define CMD_BRIEF_NUM_TEXT
int common_num_cutscenes_valid(int movie_type)
void audiostream_unpause(int i, bool via_sexp_or_script)
GLint GLint GLint GLint GLint x
const char * XSTR(const char *str, int index)
user_click (mouse selects a control)
void set_hotkey(int keycode)
GLuint const GLchar * name
void cmd_brief_init(int team)
char background[GR_NUM_RESOLUTIONS][MAX_FILENAME_LEN]
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)
char * Cmd_brief_mask[NUM_CMD_SETTINGS][GR_NUM_RESOLUTIONS]
bool fsspeech_play_from(int type)
void cmd_brief_do_frame(float frametime)
scroll pressed (and scroll)
void link_hotspot(int num)
void create(UI_WINDOW *wnd, char *_text, int _x, int _y, int _w, int _h, int do_repeat=0, int ignore_focus=0)
#define UI_XSTR_COLOR_PINK
#define CMD_BRIEF_BUTTON_SCROLL_UP
void create(int _x, int _y, int _w, int _h, int _flags, int _f_id=-1)
int Top_cmd_brief_text_line
void gr_get_string_size(int *w, int *h, const char *text, int len=9999)
#define CMD_BRIEF_BUTTON_NEXT_STAGE
void common_play_highlight_sound()
char wave_filename[MAX_FILENAME_LEN]
BM_TYPE bm_get_type(int handle)
Returns the image type of the given bitmap handle.
void cmd_brief_new_stage(int stage)
void audiostream_play(int i, float volume, int looping)
int brief_render_text(int line_offset, int x, int y, int h, float frametime, int instance, int line_spacing)
char default_command_briefing_color
void gr_bitmap(int _x, int _y, int resize_mode)
#define UI_XSTR_COLOR_GREEN
cmd_brief * Cur_cmd_brief
#define CMD_BRIEF_BUTTON_PREV_STAGE
int generic_anim_init_and_stream(generic_anim *ga, const char *anim_filename, BM_TYPE bg_type, bool attempt_hi_res)
int mission_ui_background_load(const char *custom_background, const char *single_background, const char *multi_background)
#define CMD_BRIEF_BUTTON_LAST_STAGE
int audiostream_open(const char *filename, int type)
void audiostream_pause(int i, bool via_sexp_or_script)
void launch_context_help()
void gamesnd_play_iface(int n)
struct ui_button_info ui_button_info
void gr_set_font(int fontnum)
#define MOVIE_PRE_CMD_BRIEF
int cmd_brief_check_stage_done()
void cmd_brief_voice_play(int stage_num)
int process(int key_in=-1, int process_mouse=1)
int help_overlay_get_index(const char *overlay_name)
#define NUM_CMD_BRIEF_BUTTONS
int timer_get_milliseconds()
void gameseq_post_event(int event)
#define MAX_CMD_BRIEF_BUTTONS
void help_overlay_maybe_blit(int overlay_id, int resolution_index)
int help_overlay_active(int overlay_id)
float Master_voice_volume
void common_music_init(int score_index)