FS2_Open
Open source remastering of the Freespace 2 engine
missioncmdbrief.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) Volition, Inc. 1999. All rights reserved.
3  *
4  * All source code herein is the property of Volition, Inc. You may not sell
5  * or otherwise commercially exploit the source or things you created based on the
6  * source.
7  *
8 */
9 
10 
11 
12 #include "anim/animplay.h"
13 #include "anim/packunpack.h"
14 #include "gamehelp/contexthelp.h"
16 #include "gamesnd/eventmusic.h"
17 #include "gamesnd/gamesnd.h"
18 #include "globalincs/alphacolors.h"
19 #include "graphics/font.h"
20 #include "io/key.h"
21 #include "io/timer.h"
25 #include "missionui/redalert.h"
26 #include "playerman/player.h"
27 #include "sound/audiostr.h"
28 #include "sound/fsspeech.h"
29 #include "ui/uidefs.h"
30 
31 
32 
33 #define NUM_CMD_SETTINGS 2
34 
36 {
37  {
38  "CommandBrief",
39  "2_CommandBrief"
40  },
41  {
42  "CommandBriefb",
43  "2_CommandBriefb"
44  }
45 };
46 
47 
49 {
50  {
51  "CommandBrief-m",
52  "2_CommandBrief-m"
53  },
54  {
55  "CommandBrief-mb",
56  "2_CommandBrief-mb"
57  },
58 };
59 
60 
61 // lookups for coordinates
62 #define CMD_X_COORD 0
63 #define CMD_Y_COORD 1
64 #define CMD_W_COORD 2
65 #define CMD_H_COORD 3
66 
68 {
69  // original
70  {
71  {
72  17, 109, 606, 108 // GR_640
73  },
74  {
75  28, 174, 969, 174 // GR_1024
76  }
77  },
78  // buttons
79  {
80  {
81  17, 109, 587, 108 // GR_640
82  },
83  {
84  28, 174, 939, 174 // GR_1024
85  }
86  }
87 };
88 
90 {
91  90, // GR_640
92  145 // GR_1024
93 };
94 
95 // Goober5000 - center coordinates only
97 {
98  {
99  246, 358 // GR_640
100  },
101  {
102  394, 573 // GR_1024
103  }
104 };
105 
107 
108 int Max_cmdbrief_Lines; // Maximum number of lines to be displayed
109 
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)
113 
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
124 
125 // buttons
127 {
128  { // GR_640
129  ui_button_info("CBB_00", 504, 221, -1, -1, 0),
130  ui_button_info("CBB_01", 527, 221, -1, -1, 1),
131  ui_button_info("CBB_02", 555, 221, -1, -1, 2),
132  ui_button_info("CBB_03", 583, 221, -1, -1, 3),
133  ui_button_info("CBB_04", 607, 221, -1, -1, 4),
134  ui_button_info("CBB_05", 539, 431, -1, -1, 5),
135  ui_button_info("CBB_06", 538, 455, -1, -1, 6),
136  ui_button_info("CBB_07", 575, 432, -1, -1, 7),
137  ui_button_info("CBB_08", 615, 144, -1, -1, 8),
138  ui_button_info("CBB_09", 615, 186, -1, -1, 9),
139  },
140  { // GR_1024
141  ui_button_info("2_CBB_00", 806, 354, -1, -1, 0),
142  ui_button_info("2_CBB_01", 844, 354, -1, -1, 1),
143  ui_button_info("2_CBB_02", 888, 354, -1, -1, 2),
144  ui_button_info("2_CBB_03", 933, 354, -1, -1, 3),
145  ui_button_info("2_CBB_04", 971, 354, -1, -1, 4),
146  ui_button_info("2_CBB_05", 863, 690, -1, -1, 5),
147  ui_button_info("2_CBB_06", 861, 728, -1, -1, 6),
148  ui_button_info("2_CBB_07", 920, 692, -1, -1, 7),
149  ui_button_info("2_CBB_08", 985, 232, -1, -1, 8),
150  ui_button_info("2_CBB_09", 985, 299, -1, -1, 9),
151  }
152 };
153 
154 // text
155 #define CMD_BRIEF_NUM_TEXT 3
157 {
158  { // GR_640
159  { "Help", 928, 500, 440, UI_XSTR_COLOR_GREEN, -1, &Cmd_brief_buttons[0][CMD_BRIEF_BUTTON_HELP].button },
160  { "Options", 1036, 479, 464, UI_XSTR_COLOR_GREEN, -1, &Cmd_brief_buttons[0][CMD_BRIEF_BUTTON_OPTIONS].button },
161  { "Continue", 1069, 564, 413, UI_XSTR_COLOR_PINK, -1, &Cmd_brief_buttons[0][CMD_BRIEF_BUTTON_ACCEPT].button },
162  },
163  { // GR_1024
164  { "Help", 928, 820, 704, UI_XSTR_COLOR_GREEN, -1, &Cmd_brief_buttons[1][CMD_BRIEF_BUTTON_HELP].button },
165  { "Options", 1036, 797, 743, UI_XSTR_COLOR_GREEN, -1, &Cmd_brief_buttons[1][CMD_BRIEF_BUTTON_OPTIONS].button },
166  { "Continue", 1069, 936, 661, UI_XSTR_COLOR_PINK, -1, &Cmd_brief_buttons[1][CMD_BRIEF_BUTTON_ACCEPT].button },
167  }
168 };
169 
170 static UI_WINDOW Ui_window;
171 static int Cmd_brief_background_bitmap; // bitmap for the background of the cmd_briefing
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;
177 static generic_anim Cur_Anim;
178 static char *Cur_anim_filename = "~~~~";
179 
180 static int Cmd_brief_last_voice;
181 static int Cmd_brief_last_stage;
182 static int Cmd_brief_paused = 0;
183 
184 static int Uses_scroll_buttons = 0;
185 
187 
189 {
190  int i;
191 
193  for (i=0; i<Cur_cmd_brief->num_stages; i++) {
194  Cur_cmd_brief->stage[i].wave = -1;
197  if (Cur_cmd_brief->stage[i].wave < 0) {
198  nprintf(("General", "Failed to load \"%s\"\n", Cur_cmd_brief->stage[i].wave_filename));
199  }
200  }
201  }
202 
203  Cmd_brief_last_voice = -1;
204  Cmd_brief_last_stage = -1;
205 }
206 
208 {
209  if (!Voice_good_to_go)
210  return 0;
211 
212  if (Cmd_brief_paused)
213  return 0;
214 
215  if (Voice_ended_time && (timer_get_milliseconds() - Voice_ended_time >= 1000))
216  return 1;
217 
218  // check normal speech
219  if (Briefing_voice_enabled && (Cmd_brief_last_voice >= 0)) {
220  if (audiostream_is_playing(Cmd_brief_last_voice)) {
221  return 0;
222  }
223 
224  if (!Voice_ended_time) {
225  Voice_ended_time = timer_get_milliseconds();
226  }
227 
228  return 0;
229  }
230 
231  // check simulated speech
232  if (Briefing_voice_enabled && (Cmd_brief_last_stage >= 0)) {
233  if (fsspeech_playing()) {
234  return 0;
235  }
236 
237  if (!Voice_ended_time) {
238  Voice_ended_time = timer_get_milliseconds();
239  }
240 
241  return 0;
242  }
243 
244  // if we get here, there is no voice, so we simulate the time it would take instead
245  if (!Voice_ended_time)
246  Voice_ended_time = Voice_started_time + MAX(5000, Num_brief_text_lines[0] * 3500);
247 
248  return 0;
249 }
250 
255 void cmd_brief_voice_play(int stage_num)
256 {
257  int voice = -1;
258  int stage = -1;
259 
260  if (!Voice_good_to_go) {
261  Voice_started_time = 0;
262  return;
263  }
264 
265  if (!Voice_started_time) {
266  Voice_started_time = timer_get_milliseconds();
267  Voice_ended_time = 0;
268  }
269 
271  return;
272  }
273 
274  if (Cur_stage >= 0 && Cur_stage < Cur_cmd_brief->num_stages){
275  voice = Cur_cmd_brief->stage[stage_num].wave;
276  stage = stage_num;
277  }
278 
279  // do we need to play simulated speech?
280  if (voice < 0 && fsspeech_play_from(FSSPEECH_FROM_BRIEFING)) {
281  // are we still on the same stage?
282  if (Cmd_brief_last_stage == stage) {
283  return; // no changes, nothing to do.
284  }
285 
286  // if previous stage is still playing, stop it first.
287  if (Cmd_brief_last_stage >= 0) {
288  fsspeech_stop();
289  Cmd_brief_last_stage = -1;
290  }
291 
292  // ok, new text needs speaking
293  Cmd_brief_last_stage = stage;
294  if (stage >= 0) {
296  }
297  } else {
298  // are we still on same voice that is currently playing/played?
299  if (Cmd_brief_last_voice == voice) {
300  return; // no changes, nothing to do.
301  }
302 
303  // if previous wave is still playing, stop it first.
304  if (Cmd_brief_last_voice >= 0) {
305  audiostream_stop(Cmd_brief_last_voice, 1, 0); // stream is automatically rewound
306  Cmd_brief_last_voice = -1;
307  }
308 
309  // ok, new wave needs playing, so we can start playing it now (and it becomes the current wave)
310  Cmd_brief_last_voice = voice;
311  if (voice >= 0) {
313  }
314  }
315 }
316 
321 {
322  // I know, going to red alert from cmd brief is stupid, but we have stupid fredders
323  if (red_alert_mission()) {
325  } else {
327  }
328 }
329 
334 {
335  Voice_good_to_go = 0;
336  if (Cmd_brief_last_voice >= 0) {
337  audiostream_stop(Cmd_brief_last_voice, 1, 0); // stream is automatically rewound
338  Cmd_brief_last_voice = -1;
339  }
340  if (Cmd_brief_last_stage >= 0) {
341  fsspeech_stop();
342  Cmd_brief_last_stage = -1;
343  }
344 }
345 
346 void cmd_brief_new_stage(int stage)
347 {
348  if (stage < 0) {
350  Cur_stage = -1;
351  }
352 
353  Cur_stage = stage;
355 
356  // load a new animation if it's different to what's already playing
357  if (strcmp(Cur_anim_filename, Cur_cmd_brief->stage[stage].ani_filename) != 0) {
358  // unload the previous anim
359  if(Cur_Anim.num_frames > 0) {
360  generic_anim_unload(&Cur_Anim);
361  }
362 
363  // save new filename
364  Cur_anim_filename = Cur_cmd_brief->stage[stage].ani_filename;
365 
366  // try to load the new anim in either high or low res
367  int stream_result = generic_anim_init_and_stream(&Cur_Anim, Cur_anim_filename, bm_get_type(Cmd_brief_background_bitmap), true);
368 
369  // we've failed to load any animation
370  if (stream_result < 0) {
371  // load an image and treat it like a 1 frame animation
372  Cur_Anim.first_frame = bm_load(Cur_cmd_brief->stage[stage].ani_filename); //if we fail here, the value is still -1
373  if(Cur_Anim.first_frame != -1) {
374  Cur_Anim.num_frames = 1;
375  }
376  }
377  }
378 
379  //resetting the audio here
381 
383 }
384 
386 {
388 }
389 
391 {
392  cmd_brief_new_stage(Cur_stage);
393 }
394 
395 extern int Briefing_music_handle;
396 
398 {
399  if (Cmd_brief_paused)
400  return;
401 
402  Cmd_brief_paused = 1;
403 
404  if (Cmd_brief_last_voice >= 0) {
405  audiostream_pause(Cmd_brief_last_voice);
406  }
407  if (Cmd_brief_last_stage >= 0) {
408  fsspeech_pause(true);
409  }
410 
411  if (Briefing_music_handle >= 0) {
413  }
414 }
415 
417 {
418  if (!Cmd_brief_paused)
419  return;
420 
421  Cmd_brief_paused = 0;
422 
423  if (Cmd_brief_last_voice >= 0) {
424  audiostream_unpause(Cmd_brief_last_voice);
425  }
426  if (Cmd_brief_last_stage >= 0) {
427  fsspeech_pause(false);
428  }
429 
430  if (Briefing_music_handle >= 0) {
432  }
433 }
434 
436 {
437  switch (n) {
441  break;
442 
446  break;
447 
450  audiostream_stop(Cmd_brief_last_voice);
453  }
454  else if (Cur_stage) {
457  }
458  else {
460  }
461 
462  break;
463 
465  if (!Cur_stage && common_num_cutscenes_valid(MOVIE_PRE_CMD_BRIEF)) {
466  audiostream_stop(Cmd_brief_last_voice);
469  }
470  else if (Cur_stage) {
471  cmd_brief_new_stage(Cur_stage - 1);
473  } else {
475  }
476 
477  break;
478 
480  if (Cur_stage < Cur_cmd_brief->num_stages - 1) {
481  cmd_brief_new_stage(Cur_stage + 1);
483  } else {
485  }
486 
487  break;
488 
490  if (Cur_stage < Cur_cmd_brief->num_stages - 1) {
493  } else {
495  }
496  break;
497 
499  cmd_brief_exit();
501  break;
502 
506  Player->auto_advance ^= 1;
507  break;
508 
511  if ( Top_cmd_brief_text_line < 0 ) {
514  } else {
516  }
517  break;
518 
524  } else {
526  }
527  break;
528  }
529 }
530 
532 {
533  char *name;
534 
535  // this is the first instance of the given anim filename
537  if (!name[0] || !stricmp(name, NOX("<default>")) || !stricmp(name, NOX("none.ani"))) {
538  name = NOX("CB_default");
539  strcpy_s(Cur_cmd_brief->stage[index].ani_filename, name);
540  }
541 }
542 
544 {
546 
547  int i;
548  ui_button_info *b;
549 
550  Cmd_brief_inited = 0;
552 
553  // Goober5000 - replace any variables (probably persistent variables) with their values
554  for (i = 0; i < Cur_cmd_brief->num_stages; i++)
556 
557  if (Cur_cmd_brief->num_stages <= 0)
558  return;
559 
560  gr_reset_clip();
561  gr_clear();
562  Mouse_hidden++;
563  gr_flip();
564  Mouse_hidden--;
565 
566  // first determine which layout to use
567  Uses_scroll_buttons = 1; // assume true
568  Cmd_brief_background_bitmap = mission_ui_background_load(Cur_cmd_brief->background[gr_screen.res], Cmd_brief_fname[Uses_scroll_buttons][gr_screen.res]); // try to load extra one first
569  if (Cmd_brief_background_bitmap < 0) // failed to load
570  {
571  Uses_scroll_buttons = 0; // nope, sorry
572  Cmd_brief_background_bitmap = mission_ui_background_load(NULL, Cmd_brief_fname[Uses_scroll_buttons][gr_screen.res]);
573  }
574 
576  Ui_window.set_mask_bmap(Cmd_brief_mask[Uses_scroll_buttons][gr_screen.res]);
577 
578  for (i=0; i<NUM_CMD_BRIEF_BUTTONS; i++) {
579  b = &Cmd_brief_buttons[gr_screen.res][i];
580 
581  b->button.create(&Ui_window, "", b->x, b->y, 60, 30, 0, 1);
582  // set up callback for when a mouse first goes over a button
584  b->button.set_bmaps(b->filename);
585  b->button.link_hotspot(b->hotspot);
586  }
587 
588  // add text
589  for(i=0; i<CMD_BRIEF_NUM_TEXT; i++){
590  Ui_window.add_XSTR(&Cmd_brief_text[gr_screen.res][i]);
591  }
592 
593  // set up readyrooms for buttons so we draw the correct animation frame when a key is pressed
601 
602  // extra - Goober5000
603  if (Uses_scroll_buttons)
604  {
607  }
608 
609  // load in help overlay bitmap
612 
613  for (i=0; i<Cur_cmd_brief->num_stages; i++)
615 
618  Cmd_brief_paused = 0;
619  Cmd_brief_inited = 1;
620 }
621 
623 {
624  int i;
625 
626  if (Cmd_brief_inited) {
628  generic_anim_unload(&Cur_Anim);
629  for (i=0; i<Cur_cmd_brief->num_stages; i++) {
630  if (Cur_cmd_brief->stage[i].wave >= 0)
632 
633  }
634 
635  // so that the same ani will reload properly upon return
636  Cur_anim_filename = "~~~~";
637 
638  if (Cmd_brief_background_bitmap >= 0)
639  bm_release(Cmd_brief_background_bitmap);
640 
641  Ui_window.destroy();
642 
643  game_flush();
644  Cmd_brief_inited = 0;
645  }
646 
647  // Stop any speech from running over
648  fsspeech_stop();
649 }
650 
651 void cmd_brief_do_frame(float frametime)
652 {
653  char buf[40];
654  int i, k, w, h, x, y;
655 
656  // if no command briefing exists, skip this screen.
657  if (!Cmd_brief_inited) {
658  cmd_brief_exit();
659  return;
660  }
661 
663  Cmd_brief_buttons[gr_screen.res][CMD_BRIEF_BUTTON_HELP].button.reset_status();
664  Ui_window.set_ignore_gadgets(1);
665  }
666 
667  k = Ui_window.process() & ~KEY_DEBUGGED;
668 
669  if ( (k > 0) || B1_JUST_RELEASED ) {
672  Ui_window.set_ignore_gadgets(0);
673  k = 0;
674  }
675  }
676 
678  Ui_window.set_ignore_gadgets(0);
679  }
680 
681  switch (k) {
682  case KEY_ESC:
685  break;
686  } // end switch
687 
688  for (i=0; i<NUM_CMD_BRIEF_BUTTONS; i++){
689  if (Cmd_brief_buttons[gr_screen.res][i].button.pressed()){
691  }
692  }
693 
694  cmd_brief_voice_play(Cur_stage);
695  common_music_do();
696 
697  if (cmd_brief_check_stage_done() && Player->auto_advance && (Cur_stage < Cur_cmd_brief->num_stages - 1)){
698  if((Cur_Anim.num_frames <= 1) || Cur_Anim.done_playing) {
699  cmd_brief_new_stage(Cur_stage + 1);
700  }
701  }
702 
703  GR_MAYBE_CLEAR_RES(Cmd_brief_background_bitmap);
704  if (Cmd_brief_background_bitmap >= 0) {
705  gr_set_bitmap(Cmd_brief_background_bitmap);
706  gr_bitmap(0, 0, GR_RESIZE_MENU);
707  }
708 
709  if(Cur_Anim.num_frames > 0) {
710  bm_get_info((Cur_Anim.streaming) ? Cur_Anim.bitmap_id : Cur_Anim.first_frame, &x, &y, NULL, NULL, NULL);
713  generic_anim_render(&Cur_Anim, (Cmd_brief_paused) ? 0 : frametime, x, y, true);
714  }
715 
716  Ui_window.draw();
717 
718  if (!Player->auto_advance){
719  Cmd_brief_buttons[gr_screen.res][CMD_BRIEF_BUTTON_PAUSE].button.draw_forced(2);
720  }
721 
724 
725  sprintf(buf, XSTR( "Stage %d of %d", 464), Cur_stage + 1, Cur_cmd_brief->num_stages);
726  gr_get_string_size(&w, NULL, buf);
728 
729  if (brief_render_text(Top_cmd_brief_text_line, Cmd_text_wnd_coords[Uses_scroll_buttons][gr_screen.res][CMD_X_COORD], Cmd_text_wnd_coords[Uses_scroll_buttons][gr_screen.res][CMD_Y_COORD], Cmd_text_wnd_coords[Uses_scroll_buttons][gr_screen.res][CMD_H_COORD], frametime, 0, 1)){
730  Voice_good_to_go = 1;
731  }
732 
733  Max_cmdbrief_Lines = Cmd_text_wnd_coords[Uses_scroll_buttons][gr_screen.res][CMD_H_COORD]/(gr_get_font_height() + 1); //Make the max number of lines dependent on the font height, keeping in mind that we have an extra pixel between lines.
734 
735  // maybe output the "more" indicator
737  // can be scrolled down
738  int more_txt_x = Cmd_text_wnd_coords[Uses_scroll_buttons][gr_screen.res][CMD_X_COORD] + (Cmd_text_wnd_coords[Uses_scroll_buttons][gr_screen.res][CMD_W_COORD]/2) - 10;
739  int more_txt_y = Cmd_text_wnd_coords[Uses_scroll_buttons][gr_screen.res][CMD_Y_COORD] + Cmd_text_wnd_coords[Uses_scroll_buttons][gr_screen.res][CMD_H_COORD] - 2; // located below brief text, centered
740 
741  gr_get_string_size(&w, &h, XSTR("more", 1469), strlen(XSTR("more", 1469)));
743  gr_rect(more_txt_x-2, more_txt_y, w+3, h, GR_RESIZE_MENU);
745  gr_string(more_txt_x, more_txt_y, XSTR("more", 1469), GR_RESIZE_MENU); // base location on the input x and y?
746  }
747 
748  // blit help overlay if active
750 
751  gr_flip();
752 }
753 
755 {
756  return (Cur_cmd_brief != NULL && Cur_cmd_brief->num_stages > 0);
757 }
void gr_rect(int x, int y, int w, int h, int resize_mode)
Definition: 2d.cpp:2068
void game_flush()
Definition: fredstubs.cpp:83
ui_button_info Cmd_brief_buttons[GR_NUM_RESOLUTIONS][MAX_CMD_BRIEF_BUTTONS]
void set_highlight_action(void(*_user_function)(void))
Definition: button.cpp:375
void fsspeech_pause(bool playing)
Definition: fsspeech.h:46
int i
Definition: multi_pxo.cpp:466
int Briefing_voice_enabled
int bitmap_id
Definition: generic.h:46
void add_XSTR(char *string, int _xstr_id, int _x, int _y, UI_GADGET *_assoc, int _color_type, int _font_id=-1)
Definition: window.cpp:476
void cmd_brief_exit()
#define gr_clear
Definition: 2d.h:749
#define CMD_BRIEF_BUTTON_HELP
void reset_status()
Definition: button.cpp:78
void fsspeech_stop()
Definition: fsspeech.h:45
int Num_brief_text_lines[MAX_TEXT_STREAMS]
#define KEY_DOWN
Definition: key.h:180
GLfloat GLfloat GLfloat GLfloat h
Definition: Glext.h:7280
#define KEY_LEFT
Definition: key.h:181
void gr_flip()
Definition: 2d.cpp:2113
commit pressed
Definition: gamesnd.h:294
int x
Definition: ui.h:658
#define GR_RESIZE_MENU
Definition: 2d.h:684
color Color_more_indicator
Definition: alphacolors.cpp:28
int Cmd_text_wnd_coords[NUM_CMD_SETTINGS][GR_NUM_RESOLUTIONS][4]
int y
Definition: ui.h:658
GLuint index
Definition: Glext.h:5608
#define ASF_VOICE
Definition: audiostr.h:21
char * Cmd_brief_fname[NUM_CMD_SETTINGS][GR_NUM_RESOLUTIONS]
#define KEY_RIGHT
Definition: key.h:182
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
Definition: generic.h:26
UI_XSTR Cmd_brief_text[GR_NUM_RESOLUTIONS][CMD_BRIEF_NUM_TEXT]
void cmd_brief_stop_anim()
Assert(pm!=NULL)
#define GR_NUM_RESOLUTIONS
Definition: 2d.h:651
__inline void gr_string(int x, int y, const char *string, int resize_mode=GR_RESIZE_FULL)
Definition: 2d.h:769
general failure sound for any event
Definition: gamesnd.h:297
int Max_cmdbrief_Lines
help pressed
Definition: gamesnd.h:293
int res
Definition: 2d.h:370
int max_h_unscaled
Definition: 2d.h:361
int bm_get_info(int handle, int *w, int *h, ubyte *flags, int *nframes, int *fps)
Gets info on the bitmap indexed by handle.
Definition: bmpman.cpp:769
CButton * team
int Mouse_hidden
Definition: mouse.cpp:52
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)
Definition: 2d.h:639
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)
Definition: window.cpp:471
void gr_set_color_fast(color *dst)
Definition: 2d.cpp:1197
#define SCORE_BRIEFING
Definition: eventmusic.h:51
#define CMD_BRIEF_OVERLAY
Definition: contexthelp.h:36
cmd_brief Cmd_briefs[MAX_TVT_TEAMS]
int red_alert_mission(void)
Definition: redalert.cpp:1031
void gr_set_bitmap(int bitmap_num, int alphablend_mode, int bitblt_mode, float alpha)
Definition: 2d.cpp:2105
int max_w_unscaled
Definition: 2d.h:361
#define CMD_BRIEF_BUTTON_SCROLL_DOWN
void cmd_brief_close()
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: Glext.h:7308
int bm_release(int handle, int clear_render_targets)
Frees both a bitmap's data and it's associated slot.
Definition: bmpman.cpp:2603
void cmd_brief_hold()
#define B1_JUST_RELEASED
Definition: uidefs.h:50
void generic_anim_unload(generic_anim *ga)
Definition: generic.cpp:291
int Cmd_image_center_coords[GR_NUM_RESOLUTIONS][2]
int audiostream_is_playing(int i)
Definition: audiostr.cpp:1827
void draw_forced(int frame_num)
Definition: button.cpp:104
#define CMD_BRIEF_BUTTON_OPTIONS
#define CMD_W_COORD
void destroy()
Definition: window.cpp:189
int num_frames
Definition: generic.h:20
#define gr_reset_clip
Definition: 2d.h:745
void set_mask_bmap(char *fname)
Definition: window.cpp:75
int set_bmaps(char *ani_filename, int nframes=3, int start_frame=1)
Definition: gadget.cpp:71
int auto_advance
Definition: player.h:190
#define CMD_X_COORD
void common_maybe_play_cutscene(int movie_type, bool restart_music, int music)
#define nprintf(args)
Definition: pstypes.h:239
int first_frame
Definition: generic.h:19
int mission_has_cmd_brief()
void audiostream_stop(int i, int rewind, int paused)
Definition: audiostr.cpp:1840
int hotspot
Definition: ui.h:659
int pressed()
Definition: button.cpp:325
Switching to a new screen, but not commit.
Definition: gamesnd.h:292
#define KEY_SHIFTED
Definition: key.h:62
void cmd_brief_button_pressed(int n)
void generic_anim_render(generic_anim *ga, float frametime, int x, int y, bool menu)
Definition: generic.cpp:437
#define w(p)
Definition: modelsinc.h:68
sprintf(buf,"(%f,%f,%f)", v3->xyz.x, v3->xyz.y, v3->xyz.z)
#define KEY_ENTER
Definition: key.h:125
int Briefing_music_handle
#define CMD_BRIEF_BUTTON_PAUSE
#define CMD_BRIEF_BUTTON_ACCEPT
UI_BUTTON button
Definition: ui.h:660
void fsspeech_play(int type, const char *text)
Definition: fsspeech.h:44
#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)
Definition: audiostr.cpp:1960
int Cmd_brief_overlay_id
GLint GLint GLint GLint GLint x
Definition: Glext.h:5182
GLclampd n
Definition: Glext.h:7286
const char * XSTR(const char *str, int index)
Definition: localize.cpp:851
user_click (mouse selects a control)
Definition: gamesnd.h:305
void cmd_brief_unpause()
#define NOX(s)
Definition: pstypes.h:473
void common_music_do()
#define KEY_F1
Definition: key.h:143
void set_hotkey(int keycode)
Definition: gadget.cpp:280
GLuint const GLchar * name
Definition: Glext.h:5608
void cmd_brief_init(int team)
color Color_black
Definition: alphacolors.cpp:32
char background[GR_NUM_RESOLUTIONS][MAX_FILENAME_LEN]
bool sexp_replace_variable_names_with_values(char *text, int max_len)
Definition: sexp.cpp:29395
int bm_load(const char *real_filename)
Loads a bitmap so we can draw with it later.
Definition: bmpman.cpp:1119
GLboolean GLboolean GLboolean b
Definition: Glext.h:5781
void audiostream_close_file(int i, int fade)
Definition: audiostr.cpp:1772
char * Cmd_brief_mask[NUM_CMD_SETTINGS][GR_NUM_RESOLUTIONS]
bool fsspeech_play_from(int type)
Definition: fsspeech.h:52
#define CMD_Y_COORD
void cmd_brief_do_frame(float frametime)
#define FONT1
Definition: font.h:65
scroll pressed (and scroll)
Definition: gamesnd.h:296
void link_hotspot(int num)
Definition: gadget.cpp:50
unsigned char streaming
Definition: generic.h:42
void create(UI_WINDOW *wnd, char *_text, int _x, int _y, int _w, int _h, int do_repeat=0, int ignore_focus=0)
Definition: button.cpp:26
#define KEY_ESC
Definition: key.h:124
#define UI_XSTR_COLOR_PINK
Definition: ui.h:161
brief stage change
Definition: gamesnd.h:301
#define CMD_BRIEF_BUTTON_SCROLL_UP
void create(int _x, int _y, int _w, int _h, int _flags, int _f_id=-1)
Definition: window.cpp:140
player * Player
int Top_cmd_brief_text_line
Definition: ui.h:584
screen gr_screen
Definition: 2d.cpp:46
void gr_get_string_size(int *w, int *h, const char *text, int len=9999)
Definition: font.cpp:196
Definition: ui.h:162
#define KEY_F2
Definition: key.h:144
int gr_get_font_height()
Definition: font.cpp:187
#define CMD_BRIEF_BUTTON_NEXT_STAGE
#define KEY_DEBUGGED
Definition: key.h:65
void common_play_highlight_sound()
Definition: gamesnd.cpp:1151
char wave_filename[MAX_FILENAME_LEN]
BM_TYPE bm_get_type(int handle)
Returns the image type of the given bitmap handle.
Definition: bmpman.cpp:894
void cmd_brief_new_stage(int stage)
void audiostream_play(int i, float volume, int looping)
Definition: audiostr.cpp:1803
#define KEY_CTRLED
Definition: key.h:64
char * filename
Definition: ui.h:657
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
Definition: alphacolors.cpp:41
void gr_bitmap(int _x, int _y, int resize_mode)
Definition: 2d.cpp:1303
#define KEY_UP
Definition: key.h:179
#define UI_XSTR_COLOR_GREEN
Definition: ui.h:160
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)
Definition: generic.cpp:32
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)
Definition: audiostr.cpp:1713
#define MAX(a, b)
Definition: pstypes.h:299
color Color_text_heading
Definition: alphacolors.cpp:28
void cmd_brief_pause()
void audiostream_pause(int i, bool via_sexp_or_script)
Definition: audiostr.cpp:1943
void launch_context_help()
void gamesnd_play_iface(int n)
Definition: gamesnd.cpp:260
bool fsspeech_playing()
Definition: fsspeech.h:53
void draw()
Definition: window.cpp:220
struct ui_button_info ui_button_info
void gr_set_font(int fontnum)
Definition: font.cpp:566
#define MOVIE_PRE_CMD_BRIEF
Definition: missionparse.h:117
int cmd_brief_check_stage_done()
void cmd_brief_voice_play(int stage_num)
#define CMD_H_COORD
int process(int key_in=-1, int process_mouse=1)
Definition: window.cpp:401
int help_overlay_get_index(const char *overlay_name)
#define NUM_CMD_BRIEF_BUTTONS
int timer_get_milliseconds()
Definition: timer.cpp:150
void gameseq_post_event(int event)
#define stricmp(s1, s2)
Definition: config.h:271
#define MAX_CMD_BRIEF_BUTTONS
void help_overlay_maybe_blit(int overlay_id, int resolution_index)
void cmd_brief_unhold()
int help_overlay_active(int overlay_id)
float Master_voice_volume
Definition: sound.cpp:54
void common_music_init(int score_index)
GLint y
Definition: Gl.h:1505
#define strcpy_s(...)
Definition: safe_strings.h:67
#define NUM_CMD_SETTINGS