FS2_Open
Open source remastering of the Freespace 2 engine
missionbrief.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 
13 #include "asteroid/asteroid.h"
14 #include "cmdline/cmdline.h"
15 #include "freespace2/freespace.h"
16 #include "gamehelp/contexthelp.h"
18 #include "gamesnd/eventmusic.h"
19 #include "gamesnd/gamesnd.h"
20 #include "globalincs/alphacolors.h"
21 #include "globalincs/linklist.h"
22 #include "graphics/font.h"
23 #include "hud/hud.h"
24 #include "io/key.h"
25 #include "io/mouse.h"
26 #include "io/timer.h"
27 #include "lighting/lighting.h"
28 #include "menuui/snazzyui.h"
31 #include "mission/missiongoals.h"
32 #include "mission/missionmessage.h"
33 #include "missionui/chatbox.h"
34 #include "missionui/missionbrief.h"
37 #include "model/model.h"
38 #include "network/multi.h"
39 #include "network/multimsgs.h"
41 #include "network/multiui.h"
42 #include "parse/parselo.h"
43 #include "parse/sexp.h"
44 #include "playerman/player.h"
45 #include "popup/popup.h"
46 #include "render/3d.h"
47 #include "ship/ship.h"
48 #include "sound/audiostr.h"
49 #include "sound/fsspeech.h"
50 
51 
52 static int Brief_goals_coords[GR_NUM_RESOLUTIONS][4] = {
53  {
54  65,152,508,211 // GR_640
55  },
56  {
57  104,243,813,332 // GR_1024
58  }
59 };
60 
61 static int Current_brief_stage; // what stage of the briefing we're on
62 static int Last_brief_stage;
63 static int Num_brief_stages;
64 static int Brief_multiplayer = FALSE;
65 
66 static int Brief_last_auto_advance = 0; // timestamp of last auto-advance
67 
68 // for managing the scene cut transition
69 static int Quick_transition_stage;
70 static int Start_fade_up_anim, Start_fade_down_anim;
71 static int Brief_playing_fade_sound;
73 
76 
78 
79 // --------------------------------------------------------------------------------------
80 // Module scope globals
81 // --------------------------------------------------------------------------------------
82 
83 static MENU_REGION Briefing_select_region[NUM_BRIEFING_REGIONS];
84 static int Num_briefing_regions;
85 
86 // For closeup display
87 #define ONE_REV_TIME 6 // time (sec) for one revolution
88 #define MAX_ANG_CHG 0.15f
89 
90 static int Closeup_coords[GR_NUM_RESOLUTIONS][4] = {
91  {
92  203, 151, 200, 213 // GR_640
93  },
94  {
95  325, 241, 200, 213 // GR_1024
96  }
97 };
98 
99 /* no longer used - taylor
100 static int Closeup_img_h[GR_NUM_RESOLUTIONS] = {
101  150, // GR_640
102  150 // GR_1024
103 };
104 
105 static int Closeup_text_h[GR_NUM_RESOLUTIONS][4] = {
106  63, // GR_640
107  63 // GR_1024
108 }; */
109 
110 static int Brief_infobox_coords[GR_NUM_RESOLUTIONS][2] = {
111  { // GR_640
112  0, 391
113  },
114  { // GR_1024
115  0, 627
116  }
117 };
118 
119 static char *Brief_infobox_filename[GR_NUM_RESOLUTIONS] = {
120  "InfoBox",
121  "2_Infobox"
122 };
123 
124 static char *Brief_filename[GR_NUM_RESOLUTIONS] = {
125  "Brief",
126  "2_Brief"
127 };
128 
129 static char *Brief_multi_filename[GR_NUM_RESOLUTIONS] = {
130  "BriefMulti",
131  "2_BriefMulti"
132 };
133 
134 static char *Brief_mask_filename[GR_NUM_RESOLUTIONS] = {
135  "Brief-m",
136  "2_Brief-m"
137 };
138 
139 static char *Brief_multi_mask_filename[GR_NUM_RESOLUTIONS] = {
140  "BriefMulti-m",
141  "2_BriefMulti-m"
142 };
143 
144 
145 static char *Brief_win_filename[GR_NUM_RESOLUTIONS] = {
146  "Briefwin",
147  "2_Briefwin"
148 };
149 
150 // coordinate inidices
151 #define BRIEF_X_COORD 0
152 #define BRIEF_Y_COORD 1
153 #define BRIEF_W_COORD 2
154 #define BRIEF_H_COORD 3
155 
156 //static int Closeup_region[4] = {220,132,420,269};
158  { // GR_640
159  211, 158, 215, 157
160  },
161  { // GR_1024
162  337, 253, 345, 252
163  },
164 };
165 
167  NOX("BriefPop"), // GR_640
168  NOX("2_BriefPop") // GR_1024
169 };
170 
172  NOX("BPB_00"), // GR_640
173  NOX("2_BPB_00"), // GR_1024
174 };
175 
177 
178 //static int Closeup_button_coords[2] = {CLOSEUP_X+164,CLOSEUP_Y+227};
180  { 374, 316 }, // GR_640
181  { 599, 506 } // GR_1024
182 };
183 
187 
194 
195 // used for the 3d view of a closeup ship
198 
199 // Mask bitmap pointer and Mask bitmap_id
200 ubyte* Brief_ui_mask_data; // pointer to actual bitmap data
201 static int Brief_ui_mask_w = -1;
202 static int Brief_ui_mask_h = -1;
204 
205 int Briefing_paused = 0; // for stopping audio and stage progression
206 
208 
209 // --------------------------------------------------------------------------------------
210 // Briefing specific UI
211 // --------------------------------------------------------------------------------------
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
220 
221 struct brief_buttons {
222  char *filename;
223  int x, y;
224  int xt, yt;
225  int hotspot;
226  int repeat;
227  UI_BUTTON button; // because we have a class inside this struct, we need the constructor below..
228 
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) {}
230 };
231 
234 
237 
239 
240 // Briefing specific buttons
241 #define NUM_BRIEF_BUTTONS 10
242 
244  { // GR_640
245  brief_buttons("BRB_08", 110, 116, 117, 157, 8),
246  brief_buttons("BRB_09", 84, 116, 117, 157, 9),
247  brief_buttons("BRB_10", 29, 116, 117, 157, 10),
248  brief_buttons("BRB_11", 4, 116, 117, 157, 11),
249  brief_buttons("BRB_12", 0, 405, 117, 157, 12),
250  brief_buttons("BRB_13", 0, 447, 117, 157, 13),
251  brief_buttons("BRB_15", 562, 0, 117, 157, 15), // skip training
252  brief_buttons("BRB_16", 56, 116, 117, 157, 16),
253  brief_buttons("TSB_34", 603, 374, 117, 157, 34),
254  brief_buttons("BRB_15", 562, 0, 117, 157, 15) // exit loop
255  },
256  { // GR_1024
257  brief_buttons("2_BRB_08", 175, 187, 117, 157, 8),
258  brief_buttons("2_BRB_09", 135, 187, 117, 157, 9),
259  brief_buttons("2_BRB_10", 47, 187, 117, 157, 10),
260  brief_buttons("2_BRB_11", 8, 187, 117, 157, 11),
261  brief_buttons("2_BRB_12", 0, 649, 117, 157, 12),
262  brief_buttons("2_BRB_13", 0, 716, 117, 157, 13),
263  brief_buttons("2_BRB_15", 900, 0, 117, 157, 15), // skip training
264  brief_buttons("2_BRB_16", 91, 187, 117, 157, 16),
265  brief_buttons("2_TSB_34", 966, 599, 117, 157, 34),
266  brief_buttons("2_BRB_15", 900, 0, 117, 157, 15) // exit loop
267  },
268 };
269 
270 // briefing UI
271 #define BRIEF_SELECT_NUM_TEXT 3
273  { // GR_640
274  { "Lock", 1270, 602, 364, UI_XSTR_COLOR_GREEN, -1, &Brief_buttons[0][BRIEF_BUTTON_MULTI_LOCK].button },
275  { "Skip Training", 1442, 467, 7, UI_XSTR_COLOR_GREEN, -1, &Brief_buttons[0][BRIEF_BUTTON_SKIP_TRAINING].button },
276  { "Exit Loop", 1477, 490, 7, UI_XSTR_COLOR_GREEN, -1, &Brief_buttons[0][BRIEF_BUTTON_EXIT_LOOP].button }
277  },
278  { // GR_1024
279  { "Lock", 1270, 964, 584, UI_XSTR_COLOR_GREEN, -1, &Brief_buttons[1][BRIEF_BUTTON_MULTI_LOCK].button },
280  { "Skip Training", 1442, 805, 12, UI_XSTR_COLOR_GREEN, -1, &Brief_buttons[1][BRIEF_BUTTON_SKIP_TRAINING].button },
281  { "Exit Loop", 1477, 830, 12, UI_XSTR_COLOR_GREEN, -1, &Brief_buttons[1][BRIEF_BUTTON_EXIT_LOOP].button }
282  }
283 };
284 
285 // coordinates for briefing title -- the x value is for the RIGHT side of the text
286 static int Title_coords[GR_NUM_RESOLUTIONS][2] = {
287  {575, 117}, // GR_640
288  {918, 194} // GR_1024
289 };
290 
291 // coordinates for briefing title in multiplayer briefings -- the x value is for the LEFT side of the text
292 // third coord is max width of area for it to fit into (it is force fit there)
293 static int Title_coords_multi[GR_NUM_RESOLUTIONS][3] = {
294  {1, 105, 190}, // GR_640
295  {1, 174, 304} // GR_1024
296 };
297 
298 // briefing line widths
301 };
302 
303 //stuff for ht&l. vars and such
304 extern int Cmdline_nohtl;
305 extern bool Cmdline_brief_lighting;
306 
307 
308 // --------------------------------------------------------------------------------------
309 // Forward declarations
310 // --------------------------------------------------------------------------------------
312 void brief_maybe_blit_scene_cut(float frametime);
314 
315 const char *brief_tooltip_handler(const char *str)
316 {
317  if (!stricmp(str, NOX("@close"))) {
318  if (Closeup_icon)
319  return XSTR( "Close", 428);
320  }
321 
322  return NULL;
323 }
324 
325 // brief_skip_training_pressed()
326 //
327 // called when the skip training button on the briefing screen is hit. When this happens,
328 // do a popup, then move to the next mission in the campaign.
330 {
331  int val;
332 
333  val = popup(PF_USE_NEGATIVE_ICON | PF_USE_AFFIRMATIVE_ICON,2,POPUP_NO,POPUP_YES,XSTR( "Skip Training\n\n\n\nAre you sure you want to skip this training mission?", 429));
334 
335  // val is 0 when we hit no (first on the list)
336  // AL: also, -1 is returned when ESC is hit
337  if ( val <= 0 ){
338  return;
339  }
340 
341  // page out mission messages
343 
344  if ( !(Game_mode & GM_CAMPAIGN_MODE) ){
346  }
347 
348  // tricky part. Need to move to the next mission in the campaign.
352 
355 
358  } else {
360  }
361 }
362 
363 // --------------------------------------------------------------------------------------
364 // brief_do_next_pressed()
365 //
366 //
367 void brief_do_next_pressed(int play_sound)
368 {
369  int now;
370  now = timer_get_milliseconds();
371 
372  if ( (now - Brief_last_auto_advance) < 500 ) {
373  return;
374  }
375 
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 )
382  } else {
383  if ( play_sound ) {
385  }
386  }
387 
388  Assert(Current_brief_stage >= 0);
389 }
390 
391 // --------------------------------------------------------------------------------------
392 // brief_do_prev_pressed()
393 //
394 //
396 {
397  Current_brief_stage--;
398  if ( Current_brief_stage < 0 ) {
399  Current_brief_stage = 0;
402  }
403  else {
405  if ( Quick_transition_stage != -1 )
407  }
408  } else {
410  }
411  Assert(Current_brief_stage >= 0);
412 }
413 
414 
415 // --------------------------------------------------------------------------------------
416 // brief_do_start_pressed()
417 //
418 //
420 {
423  Current_brief_stage = 0;
424  }
425  else if ( Current_brief_stage != 0 ) {
427  Current_brief_stage = 0;
428  if ( Quick_transition_stage != -1 )
430  } else {
432  }
433  Assert(Current_brief_stage >= 0);
434 }
435 
436 // --------------------------------------------------------------------------------------
437 // brief_do_end_pressed()
438 //
439 //
441 {
442  if ( Current_brief_stage != Num_brief_stages - 1 ) {
444  Current_brief_stage = Num_brief_stages - 1;
445  if ( Quick_transition_stage != -1 )
447 
448  } else {
450  }
451  Assert(Current_brief_stage >= 0);
452 }
453 
454 
456 {
458  if ( Top_brief_text_line < 0 ) {
461  } else {
463  }
464 }
465 
467 {
472  } else {
474  }
475 }
476 
477 
478 // handles the exit loop option
480 {
481  int val = popup(PF_USE_NEGATIVE_ICON | PF_USE_AFFIRMATIVE_ICON, 2, POPUP_NO, POPUP_YES, XSTR( "Exit Loop\n\n\n\nAre you sure you want to leave the mission loop?", 1489));
482 
483  // bail if esc hit or no clicked
484  if (val <= 0) {
485  return;
486  }
487 
488  // handle the details
489  // this also posts the start game event
491 }
492 
493 
494 // -------------------------------------------------------------------------------------
495 // brief_select_button_do() do the button action for the specified pressed button
496 //
498 {
499  switch ( i ) {
502  break;
503 
506  break;
507 
510  break;
511 
514  break;
515 
518  break;
519 
522  break;
523 
524  case BRIEF_BUTTON_PAUSE:
527  Player->auto_advance ^= 1;
528  break;
529 
531  fsspeech_stop();
533  break;
534 
536  fsspeech_stop();
538  break;
539 
542  // the "lock" button has been pressed
544 
545  // disable the button if it is now locked
546  if(multi_ts_is_locked()){
548  }
549  break;
550  } // end switch
551 }
552 
553 // -------------------------------------------------------------------
554 // brief_check_buttons()
555 //
556 // Iterate through the briefing buttons, checking if they are pressed
557 //
559 {
560  int i;
561  UI_BUTTON *b;
562 
563  for (i=0; i<NUM_BRIEF_BUTTONS; i++) {
564  b = &Brief_buttons[gr_screen.res][i].button;
565  if ( b->pressed() ) {
567  brief_button_do(i);
568  }
569  }
570 
571  if (Closeup_close_button.pressed()) {
573  }
574 }
575 
576 // -------------------------------------------------------------------
577 // brief_redraw_pressed_buttons()
578 //
579 // Redraw any briefing buttons that are pressed down. This function is needed
580 // since we sometimes need to draw pressed buttons last to ensure the entire
581 // button gets drawn (and not overlapped by other buttons)
582 //
584 {
585  int i;
586  UI_BUTTON *b;
587 
589 
590  for ( i = 0; i < NUM_BRIEF_BUTTONS; i++ ) {
591  b = &Brief_buttons[gr_screen.res][i].button;
592  if ( b->button_down() ) {
593  b->draw_forced(2);
594  }
595  }
596 
597  if ( !Player->auto_advance ) {
599  }
600 }
601 
603 {
604  UI_BUTTON *b;
605  int i;
606 
607  //if ( Briefing->num_stages <= 0 )
608  // return;
609 
610  for ( i = 0; i < NUM_BRIEF_BUTTONS; i++ ) {
611  b = &Brief_buttons[gr_screen.res][i].button;
612  b->create( &Brief_ui_window, "", Brief_buttons[gr_screen.res][i].x, Brief_buttons[gr_screen.res][i].y, 60, 30, 0, 1 );
613  // set up callback for when a mouse first goes over a button
615 
616  if ((i == BRIEF_BUTTON_SKIP_TRAINING) || (i == BRIEF_BUTTON_EXIT_LOOP)) {
617  b->set_bmaps(Brief_buttons[gr_screen.res][i].filename, 3, 0);
618  } else {
619  b->set_bmaps(Brief_buttons[gr_screen.res][i].filename);
620  }
621  b->link_hotspot(Brief_buttons[gr_screen.res][i].hotspot);
622  }
623 
624  // add all xstrs
625  for(i=0; i<BRIEF_SELECT_NUM_TEXT; i++) {
626  Brief_ui_window.add_XSTR(&Brief_select_text[gr_screen.res][i]);
627  }
628 
629  // Hide the 'skip training' button by default. Only enable and unhide if we are playing a training
630  // mission
636  }
637 
638  // Hide the 'exit loop' button by default. Only enable and unhide if we are playing a loop
639  // mission
641  Brief_buttons[gr_screen.res][BRIEF_BUTTON_EXIT_LOOP].button.hide();
642  if ( (Game_mode & GM_NORMAL) && (Campaign.loop_enabled) && (Game_mode & GM_CAMPAIGN_MODE) ) {
645  }
646 
647  // maybe disable the multi-lock button
648  if(!(Game_mode & GM_MULTIPLAYER)){
649  Brief_buttons[gr_screen.res][BRIEF_BUTTON_MULTI_LOCK].button.hide();
651  } else {
652  // if we're not the host of the game (or a tema captain in team vs. team mode), disable the lock button
656  }
657  } else {
660  }
661  }
662  }
663 
664  // create close button for closeup popup
665  Closeup_close_button.create( &Brief_ui_window, "", Closeup_button_coords[gr_screen.res][BRIEF_X_COORD], Closeup_button_coords[gr_screen.res][BRIEF_Y_COORD], 60, 30, 0, 1 );
666  Closeup_close_button.set_highlight_action( common_play_highlight_sound );
667  Closeup_close_button.set_bmaps(Closeup_button_filename[gr_screen.res]);
668  Closeup_close_button.link_hotspot(Closeup_button_hotspot);
669 
670  // set up hotkeys for buttons so we draw the correct animation frame when a key is pressed
677 
678  Closeup_close_button.disable();
679  Closeup_close_button.hide();
680 
681  // if we have no briefing stages, hide and disable briefing buttons
682  if(Num_brief_stages <= 0){
684  Brief_buttons[gr_screen.res][BRIEF_BUTTON_LAST_STAGE].button.hide();
686  Brief_buttons[gr_screen.res][BRIEF_BUTTON_NEXT_STAGE].button.hide();
688  Brief_buttons[gr_screen.res][BRIEF_BUTTON_PREV_STAGE].button.hide();
692  Brief_buttons[gr_screen.res][BRIEF_BUTTON_SCROLL_UP].button.hide();
695  Brief_buttons[gr_screen.res][BRIEF_BUTTON_PAUSE].button.disable();
696  Brief_buttons[gr_screen.res][BRIEF_BUTTON_PAUSE].button.hide();
697  }
698 }
699 
700 // --------------------------------------------------------------------------------------
701 // brief_get_closeup_icon()
702 //
703 //
704 // changed from uint for 64-bit support - taylor
706 {
707  return Closeup_icon;
708 }
709 
710 // stop showing the closeup view of an icon
712 {
713  // turn off closup
714  if ( Closeup_icon != NULL ) {
716  Closeup_icon = NULL;
717  Closeup_close_button.disable();
718  Closeup_close_button.hide();
719  }
720 }
721 
722 // --------------------------------------------------------------------------------------
723 // brief_load_bitmaps()
724 //
725 //
727 {
728  Brief_text_bitmap = bm_load(Brief_infobox_filename[gr_screen.res]);
729  Brief_grid_bitmap = bm_load(Brief_win_filename[gr_screen.res]);
730 
731  if ( Closeup_bitmap == -1 ) {
733  }
734 }
735 
736 // --------------------------------------------------------------------------------------
737 // brief_ui_init()
738 //
739 //
741 {
743 
744  if ( Num_brief_stages <= 0 ){
745  return;
746  }
747 
749 }
750 
751 
752 // --------------------------------------------------------------------------------------
753 // brief_set_default_closeup()
754 //
755 //
757 {
758  brief_stage *bs;
759  int i;
760 
761  bs = &Briefing->stages[0];
762 
763  if ( Briefing->num_stages <= 0 ) {
764  Closeup_icon = NULL;
765  return;
766  }
767 
768  if ( bs->num_icons <= 0 ) {
769  Closeup_icon = NULL;
770  return;
771  }
772 
773  // check for the first highlighted icons to have as the default closeup
774  for ( i = 0; i < bs->num_icons; i++ ) {
775  if ( bs->icons[i].flags & BI_HIGHLIGHT )
776  break;
777  }
778 
779  if ( i == bs->num_icons ) {
780  brief_setup_closeup(&bs->icons[0]);
781  }
782  else {
783  brief_setup_closeup(&bs->icons[i]);
784  }
785 }
786 
792 {
793  int num, before, result, i;
794 
795  before = Briefing->num_stages;
796 
797  num = 0;
798  while ( num < Briefing->num_stages ) {
799  result = eval_sexp( Briefing->stages[num].formula );
800  if ( !result ) {
801  Briefing->stages[num].text = "";
802 
803  if ( Briefing->stages[num].icons != NULL ) {
804  vm_free( Briefing->stages[num].icons );
805  Briefing->stages[num].icons = NULL;
806  }
807 
808  if ( Briefing->stages[num].lines != NULL ) {
809  vm_free( Briefing->stages[num].lines );
810  Briefing->stages[num].lines = NULL;
811  }
812 
814  for ( i = num+1; i < Briefing->num_stages; i++ ) {
815  Briefing->stages[i-1] = Briefing->stages[i];
816  }
817  Briefing->num_stages--;
818  continue;
819  }
820  num++;
821  }
822 
823  // completely clear out the old entries (if any) so we don't access them by mistake - taylor
824  if ( before > Briefing->num_stages ) {
825  for ( i = Briefing->num_stages; i < before; i++ ) {
827  }
828  }
829 }
830 
831 
832 // --------------------------------------------------------------------------------------
833 // brief_init()
834 //
835  int red_alert_mission(void);
836 //
838 {
839  int i;
840 
841  // for multiplayer, change the state in my netplayer structure
842  // and initialize the briefing chat area thingy
843  if ( Game_mode & GM_MULTIPLAYER ){
845  }
846 
847  // Non standard briefing in red alert mission
848  if ( red_alert_mission() ) {
849  Int3(); // since we shouldn't be here
851  return;
852  }
853 
854  // get a pointer to the appropriate briefing structure
855  if(MULTI_TEAM){
857  } else {
858  Briefing = &Briefings[0];
859  }
860 
861  // Goober5000 - replace any variables (probably persistent variables) with their values
862  for (i = 0; i < Briefing->num_stages; i++)
864 
865  Brief_last_auto_advance = 0;
866 
867  brief_compact_stages(); // compact the briefing array to eliminate unused stages
868 
869  common_set_interface_palette("BriefingPalette");
870 
871  set_active_ui(&Brief_ui_window);
876 
879 
880  if ( Brief_inited == TRUE ) {
881  common_buttons_maybe_reload(&Brief_ui_window); // AL 11-21-97: this is necessary since we may returning from the hotkey
882  // screen, which can release common button bitmaps.
884  nprintf(("Alan","brief_init() returning without doing anything\n"));
885  return;
886  }
887 
889  Num_brief_stages = Briefing->num_stages + 1;
890  else
891  Num_brief_stages = Briefing->num_stages;
892 
893  Current_brief_stage = 0;
894  Last_brief_stage = 0;
895 
896  // init the scene-cut data
898 
900  hud_anim_load(&Fade_anim);
901 
902  nprintf(("Alan","Entering brief_init()\n"));
904 
905  // Set up the mask regions
906  // initialize the different regions of the menu that will react when the mouse moves over it
907  Num_briefing_regions = 0;
908 
909  snazzy_menu_add_region(&Briefing_select_region[Num_briefing_regions++], "", COMMON_BRIEFING_REGION, 0);
910  snazzy_menu_add_region(&Briefing_select_region[Num_briefing_regions++], "", COMMON_SS_REGION, 0);
911  snazzy_menu_add_region(&Briefing_select_region[Num_briefing_regions++], "", COMMON_WEAPON_REGION, 0);
912  snazzy_menu_add_region(&Briefing_select_region[Num_briefing_regions++], "", COMMON_COMMIT_REGION, 0);
913  snazzy_menu_add_region(&Briefing_select_region[Num_briefing_regions++], "", COMMON_HELP_REGION, 0);
914  snazzy_menu_add_region(&Briefing_select_region[Num_briefing_regions++], "", COMMON_OPTIONS_REGION, 0);
915 
916  snazzy_menu_add_region(&Briefing_select_region[Num_briefing_regions++], "", BRIEF_LAST_STAGE_MASK, 0);
917  snazzy_menu_add_region(&Briefing_select_region[Num_briefing_regions++], "", BRIEF_NEXT_STAGE_MASK, 0);
918  snazzy_menu_add_region(&Briefing_select_region[Num_briefing_regions++], "", BRIEF_PREV_STAGE_MASK, 0);
919  snazzy_menu_add_region(&Briefing_select_region[Num_briefing_regions++], "", BRIEF_FIRST_STAGE_MASK, 0);
920  snazzy_menu_add_region(&Briefing_select_region[Num_briefing_regions++], "", BRIEF_TEXT_SCROLL_UP_MASK, 0);
921  snazzy_menu_add_region(&Briefing_select_region[Num_briefing_regions++], "", BRIEF_TEXT_SCROLL_DOWN_MASK, 0);
922 
923  // init common UI
924  Brief_ui_window.create( 0, 0, gr_screen.max_w_unscaled, gr_screen.max_h_unscaled, 0 );
925 
926  if(Game_mode & GM_MULTIPLAYER){
927  Brief_ui_window.set_mask_bmap(Brief_multi_mask_filename[gr_screen.res]);
928  } else {
929  Brief_ui_window.set_mask_bmap(Brief_mask_filename[gr_screen.res]);
930  }
931 
932  // get a pointer to the mask data
933  Brief_ui_mask_data = Brief_ui_window.get_mask_data( &Brief_ui_mask_w, &Brief_ui_mask_h );
934 
935  Brief_ui_window.tooltip_handler = brief_tooltip_handler;
936  common_buttons_init(&Brief_ui_window);
938 
939  // if multiplayer, initialize a few other systems
940  if(Game_mode & GM_MULTIPLAYER){
941  // again, should not be necessary, but we'll leave it for now
942  chatbox_create();
943 
944  // force the chatbox to be small
946  }
947 
948  // set up the screen regions
949  brief_init_screen(Brief_multiplayer);
950 
951  // init briefing specific UI
952  brief_ui_init();
953 
954  // init the briefing map
955  brief_init_map();
956 
957  // init the briefing voice playback
960 
961  // init objectives display stuff
962  ML_objectives_init(Brief_goals_coords[gr_screen.res][BRIEF_X_COORD], Brief_goals_coords[gr_screen.res][BRIEF_Y_COORD], Brief_goals_coords[gr_screen.res][BRIEF_W_COORD], Brief_goals_coords[gr_screen.res][BRIEF_H_COORD]);
963 
964  // set the camera target
965  if ( Briefing->num_stages > 0 ) {
966  brief_set_new_stage(&Briefing->stages[0].camera_pos, &Briefing->stages[0].camera_orient, 0, Current_brief_stage);
967  brief_reset_icons(Current_brief_stage);
968  }
969 
970  Brief_playing_fade_sound = 0;
973  Closeup_icon = NULL;
974  Brief_inited = TRUE;
975 }
976 
977 // -------------------------------------------------------------------------------------
978 // brief_render_closeup_text()
979 //
980 //
981 #define CLOSEUP_TEXT_OFFSET 10
983 {
984 /*
985  brief_icon *bi;
986  char line[MAX_ICON_TEXT_LINE_LEN];
987  int n_lines, i, render_x, render_y;
988  int n_chars[MAX_ICON_TEXT_LINES];
989  char *p_str[MAX_ICON_TEXT_LINES];
990 
991  if ( Closeup_icon == NULL ) {
992  Int3();
993  return;
994  }
995 
996  bi = Closeup_icon;
997 
998  render_x = Closeup_region[0];
999  render_y = Closeup_region[1] + CLOSEUP_IMG_H;
1000 
1001  gr_set_clip(render_x+CLOSEUP_TEXT_OFFSET, render_y, CLOSEUP_W,CLOSEUP_TEXT_H, GR_RESIZE_MENU);
1002  gr_set_color_fast(&Color_white);
1003 
1004 // n_lines = split_str(bi->text, CLOSEUP_W - 2*CLOSEUP_TEXT_OFFSET, n_chars, p_str, MAX_ICON_TEXT_LINES);
1005  Assert(n_lines != -1);
1006 
1007  for ( i = 0; i < n_lines; i++ ) {
1008  Assert(n_chars[i] < MAX_ICON_TEXT_LINE_LEN);
1009  strncpy(line, p_str[i], n_chars[i]);
1010  line[n_chars[i]] = 0;
1011  gr_printf_menu(0,0+i*Closeup_font_height,line);
1012  }
1013 */
1014 }
1015 
1016 // -------------------------------------------------------------------------------------
1017 // brief_render_closeup()
1018 //
1019 //
1020 void brief_render_closeup(int ship_class, float frametime)
1021 {
1023  matrix temp_matrix;
1024  float ang;
1025  int w,h;
1026 
1027  if (ship_class < 0)
1028  return;
1029 
1030  if (Closeup_bitmap < 0)
1031  return;
1032 
1033  ang = PI2 * frametime/Closeup_one_revolution_time;
1034  if ( ang > MAX_ANG_CHG )
1035  ang = MAX_ANG_CHG;
1036 
1037  Closeup_angles.h += ang;
1038  if ( Closeup_angles.h > PI2 )
1039  Closeup_angles.h -= PI2;
1040  vm_angles_2_matrix(&temp_matrix, &Closeup_angles );
1041  Closeup_orient = temp_matrix;
1042 
1043  w = Closeup_region[gr_screen.res][2];
1044  h = Closeup_region[gr_screen.res][3];
1046 
1047  g3_start_frame(1);
1048  g3_set_view_matrix(&Closeup_cam_pos, &view_orient, Closeup_zoom);
1049 
1050 
1051  if (!Cmdline_nohtl) {
1054  }
1055 
1056  if (Cmdline_brief_lighting) {
1057  // the following is copied from menuui/techmenu.cpp ... it works heehee :D - delt.
1058  // lighting for techroom
1059  light_reset();
1060  vec3d light_dir = vmd_zero_vector;
1061  light_dir.xyz.y = 1.0f;
1062  light_add_directional(&light_dir, 0.85f, 1.0f, 1.0f, 1.0f);
1063  light_rotate_all();
1064  // lighting for techroom
1066  }
1067 
1068  model_clear_instance( Closeup_icon->modelnum );
1069 
1070  int is_neb = The_mission.flags & MISSION_FLAG_FULLNEB;
1071 
1072  // maybe switch off nebula rendering
1073  if(is_neb){
1075  }
1076 
1077  model_render_params render_info;
1078  render_info.set_detail_level_lock(0);
1079 
1080  if ( Closeup_icon->type == ICON_JUMP_NODE) {
1083  } else if (Cmdline_brief_lighting) {
1084  render_info.set_flags(MR_AUTOCENTER);
1085  } else {
1086  render_info.set_flags(MR_NO_LIGHTING | MR_AUTOCENTER);
1087  }
1088 
1089  model_render_immediate( &render_info, Closeup_icon->modelnum, &Closeup_orient, &Closeup_pos );
1090 
1091  if (is_neb) {
1093  }
1094 
1095  if (!Cmdline_nohtl)
1096  {
1099  }
1100 
1101  g3_end_frame();
1102 
1104 
1105  gr_string(0x8000,2,Closeup_icon->closeup_label,GR_RESIZE_MENU);
1106 // brief_render_closeup_text();
1107 
1108  Closeup_close_button.enable();
1109  Closeup_close_button.unhide();
1110 
1111  gr_reset_clip();
1112 }
1113 
1114 // -------------------------------------------------------------------------------------
1115 // brief_render()
1116 //
1117 // frametime is in seconds
1118 void brief_render(float frametime)
1119 {
1120  int z, w, h;
1121 
1122  if ( Num_brief_stages <= 0 ) {
1125  gr_printf_menu(0x8000,200,XSTR( "No Briefing exists for mission: %s", 430), Game_current_mission_filename);
1126 
1127  #ifndef NDEBUG
1130  gr_printf_menu(0x8000, 230, NOX("[filename: %s, last mod: %s]"), Mission_filename, The_mission.modified);
1131  #endif
1132 
1133  return;
1134  }
1135 
1138 
1139  brief_render_map(Current_brief_stage, frametime);
1140 
1141  // draw the frame bitmaps
1143  gr_bitmap(Brief_infobox_coords[gr_screen.res][0], Brief_infobox_coords[gr_screen.res][1], GR_RESIZE_MENU);
1144  brief_blit_stage_num(Current_brief_stage, Num_brief_stages);
1145 
1146  // only try to render text and play audio if there is really something here - taylor
1147  if (Briefing->num_stages > 0) {
1149  if (z) {
1150  brief_voice_play(Current_brief_stage);
1151  }
1152 
1153  Max_brief_Lines = Brief_text_coords[gr_screen.res][3]/gr_get_font_height(); //Make the max number of lines dependent on the font height.
1154 
1155  // maybe output the "more" indicator
1157  // can be scrolled down
1158  int more_txt_x = Brief_text_coords[gr_screen.res][0] + (Brief_max_line_width[gr_screen.res]/2) - 10;
1159  int more_txt_y = Brief_text_coords[gr_screen.res][1] + Brief_text_coords[gr_screen.res][3] - 2; // located below brief text, centered
1160 
1161  gr_get_string_size(&w, &h, XSTR("more", 1469), strlen(XSTR("more", 1469)));
1163  gr_rect(more_txt_x-2, more_txt_y, w+3, h, GR_RESIZE_MENU);
1165  gr_string(more_txt_x, more_txt_y, XSTR("more", 1469), GR_RESIZE_MENU); // base location on the input x and y?
1166  }
1167  }
1168 
1169  brief_maybe_blit_scene_cut(frametime);
1170 
1171 #if !defined(NDEBUG)
1173  int title_y_offset = (Game_mode & GM_MULTIPLAYER) ? 20 : 10;
1175 #endif
1176 
1177  // output mission title
1179 
1180  if (Game_mode & GM_MULTIPLAYER) {
1181  char buf[256];
1182  strncpy(buf, The_mission.name, 256);
1183  gr_force_fit_string(buf, 255, Title_coords_multi[gr_screen.res][2]);
1184  gr_string(Title_coords_multi[gr_screen.res][0], Title_coords_multi[gr_screen.res][1], buf, GR_RESIZE_MENU);
1185  } else {
1186  gr_get_string_size(&w, NULL, The_mission.name);
1187  gr_string(Title_coords[gr_screen.res][0] - w, Title_coords[gr_screen.res][1], The_mission.name, GR_RESIZE_MENU);
1188  }
1189 
1190  // maybe do objectives
1191  if (Current_brief_stage == Briefing->num_stages) {
1193  }
1194 }
1195 
1196 // -------------------------------------------------------------------------------------
1197 // brief_set_closeup_pos()
1198 //
1199 //
1200 #define CLOSEUP_OFFSET 20
1202 {
1203  Closeup_y1 = 10;
1204  Closeup_x1 = fl2i(320 - Closeup_coords[gr_screen.res][BRIEF_W_COORD]/2.0f + 0.5f);
1205 }
1206 
1208 {
1209  object *objp;
1210  ship *sp;
1211 
1212  // find the model number for the ship to display
1213  for ( objp = GET_FIRST(&obj_used_list); objp !=END_OF_LIST(&obj_used_list); objp = GET_NEXT(objp) ) {
1214 
1215  if ( objp == &obj_used_list || objp->type != OBJ_SHIP ) {
1216  continue;
1217  }
1218 
1219  sp = &Ships[objp->instance];
1220  if ( sp->ship_info_index == ci->ship_class ) {
1221  ci->ship_class = sp->ship_info_index;
1222  ci->modelnum = Ship_info[sp->ship_info_index].model_num;
1223  ci->radius = objp->radius;
1224  break;
1225  }
1226  }
1227 }
1228 
1229 // -------------------------------------------------------------------------------------
1230 // brief_setup_closeup()
1231 //
1232 // exit: 0 => set-up icon sucessfully
1233 // -1 => could not setup closeup icon
1235 {
1236  char pof_filename[NAME_LENGTH];
1237  ship_info *sip=NULL;
1238  vec3d tvec;
1239 
1240  Closeup_icon = bi;
1241  Closeup_icon->ship_class = bi->ship_class;
1242  Closeup_icon->modelnum = -1;
1243 
1245 
1246  switch(Closeup_icon->type) {
1247  case ICON_PLANET:
1248  Closeup_icon = NULL;
1249  return -1;
1250  /*
1251  strcpy_s(pof_filename, NOX("planet.pof"));
1252  strcpy_s(Closeup_icon->closeup_label, XSTR("planet",-1));
1253  vm_vec_make(&Closeup_cam_pos, 0.0f, 0.0f, -8300.0f);
1254  Closeup_zoom = 0.5f;
1255  Closeup_one_revolution_time = ONE_REV_TIME * 3;
1256  */
1257  break;
1258  case ICON_ASTEROID_FIELD:
1259  strcpy_s(pof_filename, Asteroid_icon_closeup_model);
1260  strcpy_s(Closeup_icon->closeup_label, XSTR( "asteroid", 431));
1261  Closeup_cam_pos = Asteroid_icon_closeup_position;
1263  break;
1264  case ICON_JUMP_NODE:
1265  strcpy_s(pof_filename, NOX("subspacenode.pof"));
1266  strcpy_s(Closeup_icon->closeup_label, XSTR( "jump node", 432));
1267  vm_vec_make(&Closeup_cam_pos, 0.0f, 0.0f, -2700.0f);
1268  Closeup_zoom = 0.5f;
1270  break;
1271  case ICON_UNKNOWN:
1272  case ICON_UNKNOWN_WING:
1273  strcpy_s(pof_filename, NOX("unknownship.pof"));
1274  strcpy_s(Closeup_icon->closeup_label, XSTR( "unknown", 433));
1275  vm_vec_make(&Closeup_cam_pos, 0.0f, 0.0f, -22.0f);
1276  Closeup_zoom = 0.5f;
1277  break;
1278  default:
1279  brief_get_closeup_ship_modelnum(Closeup_icon);
1280  Assert( Closeup_icon->ship_class != -1 );
1281  sip = &Ship_info[Closeup_icon->ship_class];
1282 
1283  strcpy_s(Closeup_icon->closeup_label,(sip->alt_name[0]) ? sip->alt_name : sip->name);
1284 
1285  // cut any text off after (and including) '#' char
1287 
1288  // Goober5000 - wcsaga doesn't want this
1289  if (Ship_types[sip->class_type].hud_bools & STI_HUD_NO_CLASS_DISPLAY ) {
1290  strcat_s(Closeup_icon->closeup_label, XSTR( " class", 434));
1291  }
1292 
1293  break;
1294  }
1295 
1296  if ( Closeup_icon->modelnum == -1 ) {
1297  if ( sip == NULL ) {
1298  Closeup_icon->modelnum = model_load(pof_filename, 0, NULL);
1299  } else {
1300  Closeup_icon->modelnum = model_load(sip->pof_file, sip->n_subsystems, &sip->subsystems[0]);
1301  }
1302  Closeup_icon->radius = model_get_radius(Closeup_icon->modelnum);
1303  }
1304 
1305  vm_set_identity(&Closeup_orient);
1306  vm_vec_make(&tvec, 0.0f, 0.0f, -1.0f);
1307  Closeup_orient.vec.fvec = tvec;
1308  vm_vec_zero(&Closeup_pos);
1309  Closeup_angles.p = 0.0f;
1310  Closeup_angles.b = 0.0f;
1311  Closeup_angles.h = PI;
1312 
1314 
1315  if ( sip ) {
1316  Closeup_cam_pos = sip->closeup_pos;
1317  Closeup_zoom = sip->closeup_zoom;
1318  }
1319 
1320  return 0;
1321 }
1322 
1323 // -------------------------------------------------------------------------------------
1324 // brief_update_closeup_icon()
1325 //
1326 // input: mode => how to update the closeup view
1327 // 0 -> disable
1328 //
1330 {
1331  brief_stage *bs;
1332  brief_icon *bi;
1333  int i, closeup_index;
1334 
1335 
1336  if ( mode == 0 ) {
1337  // mode 0 means disable the closeup icon
1338  if ( Closeup_icon != NULL ) {
1340  }
1341  return;
1342  }
1343 
1344  if ( Closeup_icon == NULL )
1345  return;
1346 
1347  bs = &Briefing->stages[Current_brief_stage];
1348 
1349  closeup_index = -1;
1350  // see if any icons are being highlighted this stage
1351  for ( i = 0; i < bs->num_icons; i++ ) {
1352  bi = &bs->icons[i];
1353  if ( bi->flags & BI_HIGHLIGHT ) {
1354  closeup_index = i;
1355  break;
1356  }
1357  }
1358 
1359  if ( closeup_index != -1 ) {
1360  bi = &bs->icons[closeup_index];
1361  brief_setup_closeup(bi);
1362  }
1363  else {
1364  Closeup_icon = NULL;
1365  }
1366 }
1367 
1368 
1369 // -------------------------------------------------------------------------------------
1370 // brief_check_for_anim()
1371 //
1372 //
1374 {
1375  int mx, my, i, iw, ih, x, y;
1376  brief_stage *bs;
1377  brief_icon *bi = NULL;
1378 
1379  bs = &Briefing->stages[Current_brief_stage];
1380  mouse_get_pos_unscaled( &mx, &my );
1381 
1382  // if mouse click is over the VCR controls, don't launch an icon
1383  // FIXME - should prolly push these into defines instead of hardcoding this
1384 // if ( mx >= 0 && mx <= 115 && my >= 136 && my <= 148 ) {
1385 // return;
1386 // }
1387 
1388  // same as above but without the hardcoded values, which were wrong anyway. don't know
1389  // how this will work longterm but will hopefully keep things working well - taylor
1390  for (i = 0; i <= BRIEF_BUTTON_FIRST_STAGE; i++) {
1391  Brief_buttons[gr_screen.res][i].button.get_dimensions(&x, &y, &iw, &ih);
1392 
1393  if (mx >= x && mx <= (x+iw) && my >= y && my <= (y+ih)) {
1394  return;
1395  }
1396  }
1397 
1398  // if mouse coords are outside the briefing screen, then go away
1399  my -= bscreen.map_y1;
1400  mx -= bscreen.map_x1;
1401  if ( my < 0 || mx < 0 || mx > (bscreen.map_x2-bscreen.map_x1+1) || my > (bscreen.map_y2-bscreen.map_y1+1) )
1402  return;
1403 
1404  for ( i = 0; i < bs->num_icons; i++ ) {
1405  bi = &bs->icons[i];
1406  brief_common_get_icon_dimensions(&iw, &ih, bi);
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;
1411  // if we've got here, must be a hit
1412  break;
1413  }
1414 
1415  if ( i == bs->num_icons ) {
1417  return;
1418  }
1419 
1420  if ( brief_setup_closeup(bi) == 0 ) {
1422  } else {
1424  }
1425 }
1426 
1427 // maybe flash a button if player hasn't done anything for a while
1429 {
1430  UI_BUTTON *b;
1431 
1432  if ( Num_brief_stages <= 0 )
1433  return;
1434 
1435  if ( Closeup_icon != NULL ) {
1437  return;
1438  }
1439 
1440  if ( common_flash_bright() ) {
1441  if ( Current_brief_stage == (Num_brief_stages-1) ) {
1442  // AL 30-3-98: Don't flash ship selection button if in a training mission,
1443  if ( brief_only_allow_briefing() ) {
1444  return;
1445  }
1446 
1447  b = &Common_buttons[Current_screen-1][gr_screen.res][1].button; // ship select button
1448  } else {
1449  b = &Brief_buttons[gr_screen.res][1].button; // next stage button
1450  }
1451 
1452  if ( b->button_hilighted() ) {
1454  } else {
1455  b->draw_forced(1);
1456  }
1457  }
1458 }
1459 
1460 // -------------------------------------------------------------------------------------
1461 // brief_do_frame()
1462 //
1463 // frametime is in seconds
1464 //
1465 void brief_do_frame(float frametime)
1466 {
1467  int k, brief_choice;
1468 
1469  if ( red_alert_mission() ) {
1470  return;
1471  }
1472 
1473 
1474  if ( !Brief_inited ){
1475  brief_init();
1476  }
1477 
1478  // commit if skipping briefing, but not in multi - Goober5000
1479  if (!(Game_mode & GM_MULTIPLAYER))
1480  {
1482  {
1483  commit_pressed();
1484  return;
1485  }
1486  }
1487 
1488  int snazzy_action = -1;
1489  brief_choice = snazzy_menu_do(Brief_ui_mask_data, Brief_ui_mask_w, Brief_ui_mask_h, Num_briefing_regions, Briefing_select_region, &snazzy_action, 0);
1490 
1491  k = common_select_do(frametime);
1492 
1493  if ( Closeup_icon ) {
1494  Brief_mouse_up_flag = 0;
1495  }
1496 
1500  }
1501 
1502  // Check common keypresses
1503  common_check_keys(k);
1504 
1505 #ifndef NDEBUG
1506  int cam_change = 0;
1507 #endif
1508 
1509  if ( Briefing->num_stages > 0 ) {
1510 
1511  // check for special keys
1512  switch(k) {
1513 
1514 #ifndef NDEBUG
1515  case KEY_CTRLED | KEY_PAGEUP: {
1516  if ( Closeup_icon && Closeup_icon->ship_class ) {
1517  Closeup_icon->ship_class--;
1518 
1519  ship_info *sip = &Ship_info[Closeup_icon->ship_class];
1520  if (sip->model_num < 0)
1521  sip->model_num = model_load(sip->pof_file, 0, NULL);
1522 
1523  mprintf(("Shiptype = %d (%s)\n", Closeup_icon->ship_class, sip->name));
1524  mprintf(("Modelnum = %d (%s)\n", sip->model_num, sip->pof_file));
1525  brief_setup_closeup(Closeup_icon);
1526  }
1527 
1528  break;
1529  }
1530 
1531  case KEY_CTRLED | KEY_PAGEDOWN: {
1532  if ( Closeup_icon && (Closeup_icon->ship_class < static_cast<int>(Ship_info.size()) - 1) ) {
1533  Closeup_icon->ship_class++;
1534 
1535  ship_info *sip = &Ship_info[Closeup_icon->ship_class];
1536  if (sip->model_num < 0)
1537  sip->model_num = model_load(sip->pof_file, 0, NULL);
1538 
1539  mprintf(("Shiptype = %d (%s)\n", Closeup_icon->ship_class, sip->name));
1540  mprintf(("Modelnum = %d (%s)\n", sip->model_num, sip->pof_file));
1541  brief_setup_closeup(Closeup_icon);
1542  }
1543 
1544  break;
1545  }
1546 
1547  case KEY_A:
1548  Closeup_cam_pos.xyz.z += 1;
1549  cam_change = 1;
1550  break;
1551 
1552  case KEY_A + KEY_SHIFTED:
1553  Closeup_cam_pos.xyz.z += 10;
1554  cam_change = 1;
1555  break;
1556 
1557  case KEY_Z:
1558  Closeup_cam_pos.xyz.z -= 1;
1559  cam_change = 1;
1560  break;
1561 
1562  case KEY_Z + KEY_SHIFTED:
1563  Closeup_cam_pos.xyz.z -= 10;
1564  cam_change = 1;
1565  break;
1566 
1567  case KEY_Y:
1568  Closeup_cam_pos.xyz.y += 1;
1569  cam_change = 1;
1570  break;
1571 
1572  case KEY_Y + KEY_SHIFTED:
1573  Closeup_cam_pos.xyz.y += 10;
1574  cam_change = 1;
1575  break;
1576 
1577  case KEY_H:
1578  Closeup_cam_pos.xyz.y -= 1;
1579  cam_change = 1;
1580  break;
1581 
1582  case KEY_H + KEY_SHIFTED:
1583  Closeup_cam_pos.xyz.y -= 10;
1584  cam_change = 1;
1585  break;
1586 
1587  case KEY_COMMA:
1588  Closeup_zoom -= 0.1f;
1589  if ( Closeup_zoom < 0.1 )
1590  Closeup_zoom = 0.1f;
1591  cam_change = 1;
1592  break;
1593 
1594  case KEY_COMMA+KEY_SHIFTED:
1595  Closeup_zoom -= 0.5f;
1596  if ( Closeup_zoom < 0.1 )
1597  Closeup_zoom = 0.1f;
1598  cam_change = 1;
1599  break;
1600 
1601  case KEY_PERIOD:
1602  Closeup_zoom += 0.1f;
1603  cam_change = 1;
1604  break;
1605 
1606  case KEY_PERIOD+KEY_SHIFTED:
1607  Closeup_zoom += 0.5f;
1608  cam_change = 1;
1609  break;
1610 #endif
1611  case 1000: // need this to avoid warning about no case
1612  break;
1613 
1614  default:
1615  break;
1616  } // end switch
1617  }
1618 
1619 #ifndef NDEBUG
1620  if ( cam_change ) {
1621  nprintf(("General","Camera pos: %.2f, %.2f %.2f // ", Closeup_cam_pos.xyz.x, Closeup_cam_pos.xyz.y, Closeup_cam_pos.xyz.z));
1622  nprintf(("General","Camera zoom: %.2f\n", Closeup_zoom));
1623  }
1624 #endif
1625 
1626  if ( brief_choice > -1 && snazzy_action == SNAZZY_OVER ) {
1627  Brief_mouse_up_flag = 0;
1628  brief_choice = -1;
1629  }
1630 
1631 
1633  // if ( Briefing->num_stages > 0 )
1635 
1636  if ( brief_choice != -1 ) {
1637  Brief_mouse_up_flag = 0;
1638  }
1639 
1640  gr_reset_clip();
1641 
1642  common_render(frametime);
1643 
1644  if ( Current_brief_stage < (Num_brief_stages-1) ) {
1645  if ( !help_overlay_active(Briefing_overlay_id) && brief_time_to_advance(Current_brief_stage) ) {
1648  Brief_last_auto_advance = timer_get_milliseconds();
1649  }
1650  }
1651 
1652  if ( !Background_playing ) {
1653  int time = -1;
1654  int check_jump_flag = 1;
1655  if ( Current_brief_stage != Last_brief_stage ) {
1656 
1657  // Check if we have a quick transition pending
1658  if ( Quick_transition_stage != -1 ) {
1659  Quick_transition_stage = -1;
1661  time = 0;
1662  check_jump_flag = 0;
1663  }
1664 
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;
1672  }
1673  }
1674 
1675  if ( time != 0 ) {
1676  if ( Current_brief_stage > Last_brief_stage ) {
1677  if ( Briefing->stages[Last_brief_stage].flags & BS_FORWARD_CUT ) {
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;
1683  } else {
1684  time = Briefing->stages[Current_brief_stage].camera_time;
1685  }
1686  }
1687  else {
1688  if ( Briefing->stages[Last_brief_stage].flags & BS_BACKWARD_CUT ) {
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;
1694  } else {
1695  time = Briefing->stages[Last_brief_stage].camera_time;
1696  }
1697  }
1698  }
1699 
1700  brief_voice_stop(Last_brief_stage);
1701  fsspeech_stop();
1702 
1703  if ( Current_brief_stage < 0 ) {
1704  Int3();
1705  Current_brief_stage=0;
1706  }
1707 
1708  // set the camera target
1709  brief_set_new_stage(&Briefing->stages[Current_brief_stage].camera_pos,
1710  &Briefing->stages[Current_brief_stage].camera_orient,
1711  time, Current_brief_stage);
1712 
1713  Brief_playing_fade_sound = 0;
1714  Last_brief_stage = Current_brief_stage;
1715  brief_reset_icons(Current_brief_stage);
1717  }
1718 
1719  Transition_done:
1720 
1721  if ( Brief_mouse_up_flag && !Closeup_icon) {
1723  }
1724 
1725  brief_render(frametime);
1726  brief_camera_move(frametime, Current_brief_stage);
1727 
1728  if (Closeup_icon && (Closeup_bitmap >= 0)) {
1729  // blit closeup background
1731  gr_bitmap(Closeup_coords[gr_screen.res][BRIEF_X_COORD], Closeup_coords[gr_screen.res][BRIEF_Y_COORD], GR_RESIZE_MENU);
1732  }
1733 
1734  Brief_ui_window.draw();
1737 
1738  if (Closeup_icon) {
1739  brief_render_closeup(Closeup_icon->ship_class, frametime);
1740  }
1741 
1742  // render some extra stuff in multiplayer
1743  if (Game_mode & GM_MULTIPLAYER) {
1744  // should render this last so that it overlaps all controls
1745  chatbox_render();
1746 
1747  // render the status indicator for the voice system
1749 
1750  // maybe blit the multiplayer "locked" button
1751  // if its locked, everyone blits it as such
1752  if(multi_ts_is_locked()){
1754  }
1755  // anyone who can't hit the button sees it off, otherwise
1756  else {
1760  } else {
1761  Brief_buttons[gr_screen.res][BRIEF_BUTTON_MULTI_LOCK].button.draw();
1762  }
1763  }
1764  }
1765  }
1766 
1767  // maybe flash a button if player hasn't done anything for a while
1769 
1770  // blit help overlay if active
1772 
1773  gr_flip();
1774 
1775  // If the commit button was pressed, do the commit button actions. Done at the end of the
1776  // loop so there isn't a skip in the animation (since ship_create() can take a long time if
1777  // the ship model is not in memory
1778  if (Commit_pressed) {
1779  if (Game_mode & GM_MULTIPLAYER) {
1781  } else {
1782  commit_pressed();
1783  }
1784 
1785  Commit_pressed = 0;
1786  }
1787 }
1788 
1789 // --------------------------------------------------------------------------------------
1790 // brief_unload_bitmaps()
1791 //
1792 //
1794 {
1795  if ( Brief_text_bitmap != -1 ) {
1797  Brief_text_bitmap = -1;
1798  }
1799 
1800  if(Brief_grid_bitmap != -1){
1802  Brief_grid_bitmap = -1;
1803  }
1804 
1805  if ( Brief_multitext_bitmap != -1 ) {
1808  }
1809 
1810  if ( Brief_background_bitmap != -1 ) {
1813  }
1814 }
1815 
1816 // ------------------------------------------------------------------------------------
1817 // brief_close()
1818 //
1819 //
1821 {
1822  if ( Brief_inited == FALSE ) {
1823  nprintf(("Warning","brief_close() returning without doing anything\n"));
1824  return;
1825  }
1826 
1827  nprintf(("Alan", "Entering brief_close()\n"));
1828 
1830  fsspeech_stop();
1831 
1832  // unload the audio streams used for voice playback
1834 
1835  bm_unload(Fade_anim.first_frame);
1836 
1837  Brief_ui_window.destroy();
1838 
1839  // unload the bitmaps
1841 
1843 
1844  Briefing_paused = 0;
1845 
1846  Brief_inited = FALSE;
1847 }
1848 
1849 void briefing_stop_music(bool fade)
1850 {
1851  if ( Briefing_music_handle != -1 ) {
1853  Briefing_music_handle = -1;
1854  }
1855 }
1856 
1857 void briefing_load_music(char* fname)
1858 {
1860  return;
1861  }
1862 
1863  if ( Briefing_music_handle != -1 )
1864  return;
1865 
1866  if ( fname )
1868 }
1869 
1871 {
1872  if ( Briefing_music_handle != -1 ) {
1875  }
1876  else {
1877  nprintf(("Warning", "No music file exists to play music at this briefing!\n"));
1878  }
1879 }
1880 
1882 {
1883  brief_voice_stop(Current_brief_stage);
1884 }
1885 
1887 {
1888  if (Briefing_paused)
1889  return;
1890 
1891  Briefing_paused = 1;
1892 
1893  if (Briefing_music_handle >= 0) {
1895  }
1896 
1897  brief_voice_pause(Current_brief_stage);
1898 }
1899 
1901 {
1902  if (!Briefing_paused)
1903  return;
1904 
1905  Briefing_paused = 0;
1906 
1907  if (Briefing_music_handle >= 0) {
1909  }
1910 
1911  brief_voice_unpause(Current_brief_stage);
1912 }
1913 
1914 void brief_maybe_blit_scene_cut(float frametime)
1915 {
1916  if ( Start_fade_up_anim ) {
1917  int framenum;
1918 
1919  Fade_anim.time_elapsed += frametime;
1920 
1921  if ( !Brief_playing_fade_sound ) {
1923  Brief_playing_fade_sound = 1;
1924  }
1925 
1926  if ( Fade_anim.time_elapsed > Fade_anim.total_time ) {
1927  Fade_anim.time_elapsed = 0.0f;
1928  Start_fade_up_anim = 0;
1929  Start_fade_down_anim = 1;
1930  Current_brief_stage = Quick_transition_stage;
1931 
1932  if ( Current_brief_stage < 0 ) {
1934  Current_brief_stage = Last_brief_stage;
1935  }
1936 
1937  Assert(Current_brief_stage >= 0);
1938  goto Fade_down_anim_start;
1939  }
1940 
1941  // draw the correct frame of animation
1942  framenum = fl2i( (Fade_anim.time_elapsed * Fade_anim.num_frames) / Fade_anim.total_time );
1943  if ( framenum < 0 )
1944  framenum = 0;
1945  if ( framenum >= Fade_anim.num_frames )
1946  framenum = Fade_anim.num_frames-1;
1947 
1948  // Blit the bitmap for this frame
1949  gr_set_bitmap(Fade_anim.first_frame + framenum);
1950  gr_bitmap(Fade_anim.sx, Fade_anim.sy, GR_RESIZE_MENU);
1951  }
1952 
1953 
1954  Fade_down_anim_start:
1955  if ( Start_fade_down_anim ) {
1956  int framenum;
1957 
1958  Fade_anim.time_elapsed += frametime;
1959 
1960  if ( Fade_anim.time_elapsed > Fade_anim.total_time ) {
1961  Fade_anim.time_elapsed = 0.0f;
1962  Start_fade_up_anim = 0;
1963  Start_fade_down_anim = 0;
1964  return;
1965  }
1966 
1967  // draw the correct frame of animation
1968  framenum = fl2i( (Fade_anim.time_elapsed * Fade_anim.num_frames) / Fade_anim.total_time );
1969  if ( framenum < 0 )
1970  framenum = 0;
1971  if ( framenum >= Fade_anim.num_frames )
1972  framenum = Fade_anim.num_frames-1;
1973 
1974  // Blit the bitmap for this frame
1975  gr_set_bitmap(Fade_anim.first_frame + (Fade_anim.num_frames-1) - framenum);
1976  gr_bitmap(Fade_anim.sx, Fade_anim.sy, GR_RESIZE_MENU);
1977  }
1978 }
1979 
1981 {
1982  Quick_transition_stage = -1;
1983  Start_fade_up_anim = 0;
1984  Start_fade_down_anim = 0;
1985  Fade_anim.time_elapsed = 0.0f;
1986 }
1987 
1988 // return 1 if this mission only allow players to use the briefing (and not ship or
1989 // weapon loadout). Otherwise return 0.
1991 {
1993  return 1;
1994  }
1995 
1997  return 1;
1998  }
1999 
2000  return 0;
2001 }
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)
Definition: lighting.cpp:209
void gr_rect(int x, int y, int w, int h, int resize_mode)
Definition: 2d.cpp:2068
GLuint64EXT * result
Definition: Glext.h:10775
brief_buttons Brief_buttons[GR_NUM_RESOLUTIONS][NUM_BRIEF_BUTTONS]
void set_highlight_action(void(*_user_function)(void))
Definition: button.cpp:375
void multi_ts_lock_pressed()
void brief_voice_init()
int Brief_grid_bitmap
#define BRIEF_BUTTON_FIRST_STAGE
Definition: missionbrief.h:26
brief_buttons(char *name, int x1, int y1, int xt1, int yt1, int h, int r=0)
void fsspeech_pause(bool playing)
Definition: fsspeech.h:46
int i
Definition: multi_pxo.cpp:466
#define vm_free(ptr)
Definition: pstypes.h:548
int chatbox_create(int mode_flags)
Definition: chatbox.cpp:495
float p
Definition: pstypes.h:111
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
int button_hilighted()
Definition: button.cpp:387
int Closeup_button_hotspot
#define MR_SHOW_OUTLINE_HTL
Definition: model.h:885
void mission_campaign_exit_loop()
float Proj_fov
Definition: 3dsetup.cpp:31
#define BI_HIGHLIGHT
void fsspeech_stop()
Definition: fsspeech.h:45
void brief_init_map()
#define BRIEF_BUTTON_EXIT_LOOP
Definition: missionbrief.h:32
void briefing_load_music(char *fname)
#define ASF_MENUMUSIC
Definition: audiostr.h:20
int Num_brief_text_lines[MAX_TEXT_STREAMS]
void brief_do_end_pressed()
#define KEY_DOWN
Definition: key.h:180
#define ICON_UNKNOWN_WING
int Cmdline_freespace_no_music
Definition: cmdline.cpp:271
void brief_maybe_flash_button()
void brief_button_do(int i)
int Closeup_bitmap
#define KEY_Y
Definition: key.h:106
void brief_do_prev_pressed()
int Game_mode
Definition: systemvars.cpp:24
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
Definition: Glext.h:7280
#define KEY_LEFT
Definition: key.h:181
int game_type
Definition: missionparse.h:138
void gr_flip()
Definition: 2d.cpp:2113
#define MISSION_FLAG_FULLNEB
Definition: missionparse.h:70
bool Cmdline_brief_lighting
Definition: cmdline.cpp:343
brief_common_buttons Common_buttons[3][GR_NUM_RESOLUTIONS][NUM_COMMON_BUTTONS]
char Game_current_mission_filename[MAX_FILENAME_LEN]
Definition: fredstubs.cpp:26
#define KEY_PAGEDOWN
Definition: key.h:178
UI_XSTR Brief_select_text[GR_NUM_RESOLUTIONS][BRIEF_SELECT_NUM_TEXT]
#define BRIEF_W_COORD
char * Brief_static_name[GR_NUM_RESOLUTIONS]
#define GR_RESIZE_MENU
Definition: 2d.h:684
net_player * Net_player
Definition: multi.cpp:94
int HUD_color_green
Definition: hud.cpp:74
#define MISSION_FLAG_SCRAMBLE
Definition: missionparse.h:85
#define gr_end_view_matrix
Definition: 2d.h:896
color Color_more_indicator
Definition: alphacolors.cpp:28
char name[NAME_LENGTH]
Definition: missionparse.h:131
int Closeup_one_revolution_time
matrix * vm_angles_2_matrix(matrix *m, const angles *a)
Definition: vecmat.cpp:752
int Brief_text_bitmap
#define KEY_RIGHT
Definition: key.h:182
int Briefing_overlay_id
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)
Definition: snazzyui.cpp:59
int model_num
Definition: ship.h:1189
brief_stage stages[MAX_BRIEF_STAGES]
#define ONE_REV_TIME
#define KEY_Z
Definition: key.h:107
int class_type
Definition: ship.h:1167
#define BRIEF_X_COORD
virtual void unhide()
Definition: gadget.cpp:217
Assert(pm!=NULL)
#define MR_NO_POLYS
Definition: model.h:866
Definition: pstypes.h:88
virtual void draw()
Definition: button.cpp:120
#define GR_NUM_RESOLUTIONS
Definition: 2d.h:651
#define mprintf(args)
Definition: pstypes.h:238
__inline void gr_string(int x, int y, const char *string, int resize_mode=GR_RESIZE_FULL)
Definition: 2d.h:769
void brief_render(float frametime)
int Closeup_region[GR_NUM_RESOLUTIONS][4]
#define MAX_ANG_CHG
general failure sound for any event
Definition: gamesnd.h:297
matrix Eye_matrix
Definition: 3dsetup.cpp:26
void brief_common_close()
int res
Definition: 2d.h:370
int max_h_unscaled
Definition: 2d.h:361
void set_flags(uint flags)
#define MR_NO_LIGHTING
Definition: model.h:867
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)
GLclampf f
Definition: Glext.h:7097
#define TRUE
Definition: pstypes.h:399
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()
object obj_used_list
Definition: object.cpp:53
void brief_unload_bitmaps()
void brief_init()
model_subsystem * subsystems
Definition: ship.h:1271
void set_detail_level_lock(int detail_level_lock)
GLenum mode
Definition: Glext.h:5794
int Background_playing
void commit_pressed()
int Brief_max_line_width[GR_NUM_RESOLUTIONS]
void help_overlay_set_state(int overlay_id, int resolution_index, int state)
virtual void hide(int n)
Definition: gadget.cpp:207
void gr_set_color_fast(color *dst)
Definition: 2d.cpp:1197
void mission_campaign_mission_over(bool do_next_mission)
#define SCORE_BRIEFING
Definition: eventmusic.h:51
#define KEY_PAGEUP
Definition: key.h:175
void common_buttons_maybe_reload(UI_WINDOW *ui_window)
Definition: ui.h:195
int flags
Definition: multi.h:463
#define BRIEF_TEXT_SCROLL_UP_MASK
object * objp
Definition: lua.cpp:3105
void set_active_ui(UI_WINDOW *ui_window)
int red_alert_mission(void)
Definition: redalert.cpp:1031
int Brief_text_coords[GR_NUM_RESOLUTIONS][4]
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 Int3()
Definition: pstypes.h:292
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
Definition: Glext.h:7308
void brief_check_buttons()
const char *(* tooltip_handler)(const char *text)
Definition: ui.h:649
#define BRIEF_BUTTON_SKIP_TRAINING
Definition: missionbrief.h:29
int bm_release(int handle, int clear_render_targets)
Frees both a bitmap's data and it's associated slot.
Definition: bmpman.cpp:2603
char Asteroid_icon_closeup_model[NAME_LENGTH]
Definition: asteroid.cpp:69
void brief_stop_voices()
float time_elapsed
Definition: hud.h:29
void snazzy_menu_add_region(MENU_REGION *region, const char *text, int mask, int key, int click_sound)
Definition: snazzyui.cpp:163
#define gr_end_proj_matrix
Definition: 2d.h:894
#define BR_OVERLAY
Definition: contexthelp.h:23
#define ICON_JUMP_NODE
int multi_ts_is_locked()
int mouse_get_pos_unscaled(int *xpos, int *ypos)
Definition: mouse.cpp:580
#define ON_BRIEFING_SELECT
Definition: missionbrief.h:18
void brief_close()
int audiostream_is_playing(int i)
Definition: audiostr.cpp:1827
void common_reset_buttons()
void common_set_interface_palette(char *filename)
void common_flash_button_init()
#define STI_HUD_NO_CLASS_DISPLAY
Definition: ship.h:994
__inline void gr_set_clip(int x, int y, int w, int h, int resize_mode=GR_RESIZE_FULL)
Definition: 2d.h:741
void draw_forced(int frame_num)
Definition: button.cpp:104
#define KEY_A
Definition: key.h:82
ubyte * Brief_ui_mask_data
#define SNAZZY_OVER
Definition: snazzyui.h:28
#define MAX_BRIEF_LINE_W_640
UI_BUTTON Closeup_close_button
#define gr_set_view_matrix
Definition: 2d.h:895
void destroy()
Definition: window.cpp:189
void brief_restart_text_wipe()
brief_icon * icons
#define gr_reset_clip
Definition: 2d.h:745
int instance
Definition: object.h:150
void set_mask_bmap(char *fname)
Definition: window.cpp:75
#define MISSION_FLAG_NO_BRIEFING
Definition: missionparse.h:78
int set_bmaps(char *ani_filename, int nframes=3, int start_frame=1)
Definition: gadget.cpp:71
void brief_do_frame(float frametime)
int Closeup_font_height
const float PI2
Definition: pstypes.h:305
void chatbox_render()
Definition: chatbox.cpp:683
char pof_file[MAX_FILENAME_LEN]
Definition: ship.h:1183
void brief_ui_init()
int auto_advance
Definition: player.h:190
net_player_info p_info
Definition: multi.h:473
#define gr_set_proj_matrix
Definition: 2d.h:893
#define BRIEF_PREV_STAGE_MASK
int type_flags
Definition: multi.h:493
GLdouble GLdouble GLdouble r
Definition: Glext.h:5337
#define NUM_BRIEFING_REGIONS
Definition: missionbrief.h:35
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)
Definition: gadget.cpp:195
int first_frame
Definition: hud.h:24
matrix view_orient
Definition: fredrender.cpp:112
#define MISSION_FLAG_ALWAYS_SHOW_GOALS
Definition: missionparse.h:91
int Briefing_music_handle
int state
Definition: multi.h:464
int brief_time_to_advance(int stage_num)
void ML_objectives_close()
#define nprintf(args)
Definition: pstypes.h:239
#define GM_MULTIPLAYER
Definition: systemvars.h:18
void brief_maybe_blit_scene_cut(float frametime)
void brief_scroll_down_text()
int Brief_static_coords[GR_NUM_RESOLUTIONS][2]
float clip_aspect
Definition: 2d.h:372
#define MR_NO_TEXTURING
Definition: model.h:868
void brief_init_screen(int multiplayer_flag)
float Closeup_zoom
int sx
Definition: hud.h:27
int Brief_bmap_coords[GR_NUM_RESOLUTIONS][2]
void g3_set_view_matrix(const vec3d *view_pos, const matrix *view_matrix, float zoom)
Definition: 3dsetup.cpp:152
#define MISSION_FLAG_RED_ALERT
Definition: missionparse.h:84
void brief_voice_play(int stage_num)
void model_clear_instance(int model_num)
Definition: modelread.cpp:4624
netgame_info Netgame
Definition: multi.cpp:97
void brief_compact_stages()
int pressed()
Definition: button.cpp:325
#define BS_BACKWARD_CUT
#define KEY_SHIFTED
Definition: key.h:62
void brief_reset_icons(int stage_num)
int Commit_pressed
#define COMMON_SS_REGION
int Brief_mouse_up_flag
void multi_ts_commit_pressed()
void chatbox_force_small()
Definition: chatbox.cpp:1020
float Max_draw_distance
Definition: 2d.cpp:85
void brief_do_next_pressed(int play_sound)
#define MISSION_FLAG_END_TO_MAINHALL
Definition: missionparse.h:92
#define w(p)
Definition: modelsinc.h:68
void vm_set_identity(matrix *m)
Definition: vecmat.cpp:150
#define NG_TYPE_TEAM
Definition: multi.h:650
matrix Closeup_orient
GLdouble GLdouble z
Definition: Glext.h:5451
int n_subsystems
Definition: ship.h:1270
int Brief_multitext_bitmap
void brief_camera_move(float frametime, int stage_num)
#define BRIEF_BUTTON_PAUSE
Definition: missionbrief.h:30
void brief_transition_reset()
void brief_render_closeup_text()
int Top_brief_text_line
UI_WINDOW Brief_ui_window
void message_mission_shutdown()
#define NETINFO_FLAG_TEAM_CAPTAIN
Definition: multi.h:612
void common_select_init()
#define NETINFO_FLAG_GAME_HOST
Definition: multi.h:603
vec3d closeup_pos
Definition: ship.h:1327
#define BRIEF_BUTTON_SCROLL_UP
Definition: missionbrief.h:27
void brief_do_start_pressed()
Definition: ship.h:534
int model_load(char *filename, int n_subsystems, model_subsystem *subsystems, int ferror=1, int duplicate=0)
Definition: modelread.cpp:2573
char Mission_filename[80]
vec3d Closeup_cam_pos
void brief_set_closeup_pos(brief_icon *bi)
void set_color(color &clr)
void brief_set_default_closeup()
int Briefing_music_begin_timestamp
vec3d Closeup_pos
void brief_pause()
hud_anim Fade_anim
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
Definition: missionbrief.h:24
void audiostream_unpause(int i, bool via_sexp_or_script)
Definition: audiostr.cpp:1960
void common_check_keys(int k)
void common_render_selected_screen_button()
void brief_voice_pause(int stage_num)
char name[NAME_LENGTH]
Definition: ship.h:1163
GLint GLint GLint GLint GLint x
Definition: Glext.h:5182
bool Glowpoint_use_depth_buffer
Definition: systemvars.cpp:76
unsigned char ubyte
Definition: pstypes.h:62
brief_icon * Closeup_icon
#define vm_vec_zero(v)
Definition: vecmat.h:37
const char * XSTR(const char *str, int index)
Definition: localize.cpp:851
int Max_brief_Lines
Definition: hud.h:22
#define MULTI_TEAM
Definition: multi.h:655
user_click (mouse selects a control)
Definition: gamesnd.h:305
#define vm_vec_make(v, _x, _y, _z)
Definition: vecmat.h:48
char modified[DATE_TIME_LENGTH]
Definition: missionparse.h:135
void brief_blit_stage_num(int stage_num, int stage_max)
int Closeup_y1
#define BRIEF_BUTTON_LAST_STAGE
Definition: missionbrief.h:23
#define NOX(s)
Definition: pstypes.h:473
void briefing_stop_music(bool fade)
bool end_string_at_first_hash_symbol(char *src)
Definition: parselo.cpp:3833
#define OBJ_SHIP
Definition: object.h:32
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)
Definition: gadget.cpp:280
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.
Definition: hud.cpp:2169
GLuint const GLchar * name
Definition: Glext.h:5608
#define KEY_COMMA
Definition: key.h:114
int Cmdline_nohtl
Definition: cmdline.cpp:438
#define IDENTITY_MATRIX
Definition: vecmat.h:64
#define KEY_H
Definition: key.h:89
GLuint GLfloat * val
Definition: Glext.h:6741
void mission_goal_fail_incomplete()
color Color_black
Definition: alphacolors.cpp:32
void common_buttons_init(UI_WINDOW *ui_window)
#define BRIEF_LAST_STAGE_MASK
int num_frames
Definition: hud.h:26
#define COMMON_HELP_REGION
#define MISSION_TYPE_TRAINING
Definition: missionparse.h:63
bool sexp_replace_variable_names_with_values(char *text, int max_len)
Definition: sexp.cpp:29395
vec3d Eye_position
Definition: 3dsetup.cpp:27
UI_BUTTON button
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
ship Ships[MAX_SHIPS]
Definition: ship.cpp:122
void audiostream_close_file(int i, int fade)
Definition: audiostr.cpp:1772
briefing * Briefing
static in a briefing stage cut
Definition: gamesnd.h:329
GLuint GLuint num
Definition: Glext.h:9089
color Color_bright_white
Definition: alphacolors.cpp:32
#define ICON_ASTEROID_FIELD
char alt_name[NAME_LENGTH]
Definition: ship.h:1164
#define BRIEF_H_COORD
void brief_skip_training_pressed()
void mission_campaign_eval_next_mission()
brief_icon * brief_get_closeup_icon()
scroll pressed (and scroll)
Definition: gamesnd.h:296
color Color_white
Definition: alphacolors.cpp:32
void mission_campaign_store_goals_and_events_and_variables()
void link_hotspot(int num)
Definition: gadget.cpp:50
campaign Campaign
ubyte * get_mask_data(int *w_md, int *h_md)
Definition: ui.h:643
#define strcat_s(...)
Definition: safe_strings.h:68
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 NAME_LENGTH
Definition: globals.h:15
#define COMMON_COMMIT_REGION
int Closeup_x1
brief stage change
Definition: gamesnd.h:301
int button_down()
Definition: button.cpp:363
#define fl2i(fl)
Definition: floating.h:33
void create(int _x, int _y, int _w, int _h, int _flags, int _f_id=-1)
Definition: window.cpp:140
#define BRIEF_BUTTON_SCROLL_DOWN
Definition: missionbrief.h:28
int HUD_color_red
Definition: hud.cpp:73
int eval_sexp(int cur_node, int referenced_node)
Definition: sexp.cpp:22894
player * Player
int gr_force_fit_string(char *str, int max_str, int max_width)
Definition: font.cpp:48
#define g3_end_frame()
Definition: 3d.h:49
brief_screen bscreen
#define BRIEF_NEXT_STAGE_MASK
Definition: ui.h:584
screen gr_screen
Definition: 2d.cpp:46
float total_time
Definition: hud.h:28
float Min_draw_distance
Definition: 2d.cpp:84
void gr_get_string_size(int *w, int *h, const char *text, int len=9999)
Definition: font.cpp:196
int sy
Definition: hud.h:27
Definition: ui.h:162
#define ICON_UNKNOWN
float Asteroid_icon_closeup_zoom
Definition: asteroid.cpp:71
#define MAX_BRIEF_LINE_W_1024
void enable(int n=1)
Definition: gadget.cpp:440
int Briefing_paused
float model_get_radius(int modelnum)
Definition: modelread.cpp:3105
int gr_get_font_height()
Definition: font.cpp:187
int ship_info_index
Definition: ship.h:539
void light_reset()
Definition: lighting.cpp:150
#define COMMON_OPTIONS_REGION
int Brief_inited
SCP_vector< ship_info > Ship_info
Definition: ship.cpp:164
void common_play_highlight_sound()
Definition: gamesnd.cpp:1151
float Master_event_music_volume
Definition: eventmusic.cpp:40
void brief_check_for_anim()
angles Closeup_angles
void brief_unpause()
#define BRIEF_FIRST_STAGE_MASK
int hud_anim_load(hud_anim *ha)
Load a hud_anim.
Definition: hud.cpp:2193
void multi_common_voice_display_status()
Definition: multiui.cpp:369
#define BS_FORWARD_CUT
#define PI
Definition: pstypes.h:303
void audiostream_play(int i, float volume, int looping)
Definition: audiostr.cpp:1803
int Brief_background_bitmap
#define ICON_PLANET
void ML_objectives_do_frame(int scroll_offset)
#define KEY_CTRLED
Definition: key.h:64
color Color_normal
Definition: alphacolors.cpp:28
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)
Definition: 2d.cpp:1303
#define KEY_UP
Definition: key.h:179
#define BRIEF_Y_COORD
#define UI_XSTR_COLOR_GREEN
Definition: ui.h:160
#define NETPLAYER_STATE_BRIEFING
Definition: multi.h:680
selet brief icon
Definition: gamesnd.h:303
void brief_turn_off_closeup_icon()
#define BRIEF_BUTTON_MULTI_LOCK
Definition: missionbrief.h:31
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)
Definition: audiostr.cpp:1713
#define BRIEF_TEXT_SCROLL_DOWN_MASK
void brief_render_map(int stage_num, float frametime)
float closeup_zoom
Definition: ship.h:1328
int bm_unload(int handle, int clear_render_targets, bool nodebug)
Unloads a bitmap's data, but not the bitmap info.
Definition: bmpman.cpp:2890
void audiostream_pause(int i, bool via_sexp_or_script)
Definition: audiostr.cpp:1943
void brief_redraw_pressed_buttons()
#define GM_NORMAL
Definition: systemvars.h:19
float radius
Definition: object.h:154
void gamesnd_play_iface(int n)
Definition: gamesnd.cpp:260
mission The_mission
void brief_voice_unload_all()
void disable()
Definition: gadget.cpp:432
void draw()
Definition: window.cpp:220
#define COMMON_BRIEFING_REGION
float h
Definition: pstypes.h:111
#define KEY_PERIOD
Definition: key.h:115
char type
Definition: object.h:146
void common_render(float frametime)
char closeup_label[MAX_LABEL_LEN]
int Current_screen
vec3d vmd_zero_vector
Definition: vecmat.cpp:24
#define FALSE
Definition: pstypes.h:400
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,...)
Definition: font.cpp:314
int timer_get_milliseconds()
Definition: timer.cpp:150
void gameseq_post_event(int event)
#define GM_CAMPAIGN_MODE
Definition: systemvars.h:29
#define stricmp(s1, s2)
Definition: config.h:271
#define MOVIE_PRE_BRIEF
Definition: missionparse.h:118
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
Definition: asteroid.cpp:70
void light_rotate_all()
Definition: lighting.cpp:585
void brief_scroll_up_text()
SCP_vector< ship_type_info > Ship_types
Definition: ship.cpp:168
void common_music_init(int score_index)
float b
Definition: pstypes.h:111
GLint y
Definition: Gl.h:1505
void brief_update_closeup_icon(int mode)
void brief_voice_stop(int stage_num)
brief_line * lines
#define g3_start_frame(zbuffer_flag)
Definition: 3d.h:39
#define strcpy_s(...)
Definition: safe_strings.h:67
const char * brief_tooltip_handler(const char *str)
void brief_buttons_init()
#define BRIEF_BUTTON_PREV_STAGE
Definition: missionbrief.h:25
int brief_setup_closeup(brief_icon *bi)
#define MR_AUTOCENTER
Definition: model.h:875
int HUD_color_blue
Definition: hud.cpp:75