Open source remastering of the Freespace 2 engine
missionbriefcommon.h File Reference
#include "anim/packunpack.h"
#include "globalincs/globals.h"
#include "graphics/generic.h"
#include "hud/hud.h"

Go to the source code of this file.


struct  briefing_icon_info
struct  brief_icon
struct  brief_line
class  brief_stage
class  debrief_stage
class  briefing
class  debriefing
struct  brief_screen


#define MAX_TEXT_STREAMS   2
#define MIN_BRIEF_ICONS   35
#define ICON_FIGHTER   0
#define ICON_CARGO   2
#define ICON_CARGO_WING   3
#define ICON_LARGESHIP   4
#define ICON_CAPITAL   6
#define ICON_PLANET   7
#define ICON_WAYPOINT   9
#define ICON_SUPPORT_SHIP   10
#define ICON_BOMBER   16
#define ICON_BOMBER_WING   17
#define ICON_CRUISER   18
#define ICON_CRUISER_WING   19
#define ICON_UNKNOWN   20
#define ICON_UNKNOWN_WING   21
#define ICON_CORVETTE   28
#define ICON_GAS_MINER   29
#define ICON_AWACS   30
#define ICON_SUPERCAP   31
#define ICON_SENTRYGUN   32
#define ICON_JUMP_NODE   33
#define ICON_TRANSPORT   34
#define MAX_BRIEF_LINES   70
#define MAX_BRIEF_LINE_LEN   256
#define MAX_BRIEF_LINE_W_640   375
#define MAX_BRIEF_LINE_W_1024   600
#define MAX_DEBRIEF_LINES   60
#define MAX_DEBRIEF_LINE_LEN   256
#define MAX_DEBRIEF_LINE_W   500
#define MAX_ICON_TEXT_LEN   1024
#define MAX_ICON_TEXT_LINES   30
#define MAX_ICON_TEXT_LINE_LEN   256
#define MAX_ICON_TEXT_LINE_W   170
#define MAX_STAGE_ICONS   20
#define MAX_BRIEF_STAGES   15
#define MAX_LABEL_LEN   64
#define BI_HIGHLIGHT   (1<<0)
#define BI_SHOWHIGHLIGHT   (1<<1)
#define BI_FADEIN   (1<<2)
#define BI_MIRROR_ICON   (1<<3)
#define BI_USE_WING_ICON   (1<<4)
#define BI_USE_CARGO_ICON   (1<<5)
#define BS_FORWARD_CUT   (1<<0)
#define BS_BACKWARD_CUT   (1<<1)
#define BRIEF_GRID3_X1   42
#define BRIEF_GRID3_Y1   122
#define BRIEF_GRID0_X2   585
#define BRIEF_GRID0_Y2   371


typedef struct briefing_icon_info briefing_icon_type
typedef struct brief_icon brief_icon
typedef struct brief_line brief_line
typedef struct brief_screen brief_sceen


briefing_icon_infobrief_get_icon_info (brief_icon *bi)
void mission_brief_common_init ()
void mission_brief_common_reset ()
void mission_debrief_common_reset ()
void brief_reset ()
void debrief_reset ()
void brief_init_screen (int multiplayer_flag)
void brief_render_map (int stage_num, float frametime)
void brief_set_new_stage (vec3d *pos, matrix *orient, int time, int stage_num)
void brief_camera_move (float frametime, int stage_num)
void brief_render_icon (int stage_num, int icon_num, float frametime, int selected=0, float w_scale_factor=1.0f, float h_scale_factor=1.0f)
void brief_render_icon_line (int stage_num, int line_num)
void brief_init_map ()
void brief_parse_icon_tbl ()
void brief_common_close ()
void brief_reset_icons (int stage_num)
void brief_restart_text_wipe ()
void brief_reset_last_new_stage ()
void brief_blit_stage_num (int stage_num, int stage_max)
void brief_common_get_icon_dimensions (int *w, int *h, brief_icon *bi)
void brief_voice_init ()
void brief_voice_load_all ()
void brief_voice_unload_all ()
void brief_voice_play (int stage_num)
void brief_voice_stop (int stage_num)
void brief_voice_pause (int stage_num)
void brief_voice_unpause (int stage_num)
int brief_color_text_init (const char *src, int w, const char default_color= '\0', int instance=0, int max_lines=MAX_BRIEF_LINES, const bool append=false)
int brief_render_text (int line_offset, int x, int y, int h, float frametime, int instance=0, int line_spacing=0)
void cmd_brief_reset ()
int brief_time_to_advance (int stage_num)


SCP_vector< briefing_icon_infoBriefing_icon_info
int Brief_bmap_coords [GR_NUM_RESOLUTIONS][2]
int Brief_grid_coords [GR_NUM_RESOLUTIONS][4]
int Brief_text_coords [GR_NUM_RESOLUTIONS][4]
int Brief_text_max_lines [GR_NUM_RESOLUTIONS]
char * Brief_static_name [GR_NUM_RESOLUTIONS]
int Brief_static_coords [GR_NUM_RESOLUTIONS][2]
brief_screen bscreen
briefing Briefings [MAX_TVT_TEAMS]
debriefing Debriefings [MAX_TVT_TEAMS]
float Brief_text_wipe_time_elapsed
int Cur_brief_id
int Briefing_voice_enabled
int Num_brief_text_lines [MAX_TEXT_STREAMS]
int Top_brief_text_line
int Current_screen

Macro Definition Documentation

#define BI_FADEIN   (1<<2)

Definition at line 105 of file missionbriefcommon.h.

#define BI_HIGHLIGHT   (1<<0)

Definition at line 103 of file missionbriefcommon.h.

#define BI_MIRROR_ICON   (1<<3)

Definition at line 106 of file missionbriefcommon.h.

#define BI_SHOWHIGHLIGHT   (1<<1)

Definition at line 104 of file missionbriefcommon.h.

#define BI_USE_CARGO_ICON   (1<<5)

Definition at line 108 of file missionbriefcommon.h.

#define BI_USE_WING_ICON   (1<<4)

Definition at line 107 of file missionbriefcommon.h.

#define BRIEF_GRID0_X2   585

Definition at line 238 of file missionbriefcommon.h.

#define BRIEF_GRID0_Y2   371

Definition at line 239 of file missionbriefcommon.h.

#define BRIEF_GRID3_X1   42

Definition at line 236 of file missionbriefcommon.h.

#define BRIEF_GRID3_Y1   122

Definition at line 237 of file missionbriefcommon.h.


Definition at line 241 of file missionbriefcommon.h.


Definition at line 240 of file missionbriefcommon.h.

#define BS_BACKWARD_CUT   (1<<1)

Definition at line 138 of file missionbriefcommon.h.

#define BS_FORWARD_CUT   (1<<0)

Definition at line 137 of file missionbriefcommon.h.


Definition at line 36 of file missionbriefcommon.h.

#define ICON_AWACS   30

Definition at line 58 of file missionbriefcommon.h.

#define ICON_BOMBER   16

Definition at line 44 of file missionbriefcommon.h.


Definition at line 52 of file missionbriefcommon.h.

#define ICON_BOMBER_WING   17

Definition at line 45 of file missionbriefcommon.h.


Definition at line 53 of file missionbriefcommon.h.

#define ICON_CAPITAL   6

Definition at line 34 of file missionbriefcommon.h.

#define ICON_CARGO   2

Definition at line 30 of file missionbriefcommon.h.

#define ICON_CARGO_WING   3

Definition at line 31 of file missionbriefcommon.h.

#define ICON_CORVETTE   28

Definition at line 56 of file missionbriefcommon.h.

#define ICON_CRUISER   18

Definition at line 46 of file missionbriefcommon.h.

#define ICON_CRUISER_WING   19

Definition at line 47 of file missionbriefcommon.h.

#define ICON_FIGHTER   0

Definition at line 28 of file missionbriefcommon.h.


Definition at line 50 of file missionbriefcommon.h.


Definition at line 29 of file missionbriefcommon.h.


Definition at line 51 of file missionbriefcommon.h.


Definition at line 39 of file missionbriefcommon.h.


Definition at line 41 of file missionbriefcommon.h.


Definition at line 42 of file missionbriefcommon.h.


Definition at line 40 of file missionbriefcommon.h.

#define ICON_GAS_MINER   29

Definition at line 57 of file missionbriefcommon.h.


Definition at line 43 of file missionbriefcommon.h.

#define ICON_JUMP_NODE   33

Definition at line 61 of file missionbriefcommon.h.


Definition at line 54 of file missionbriefcommon.h.

#define ICON_LARGESHIP   4

Definition at line 32 of file missionbriefcommon.h.


Definition at line 33 of file missionbriefcommon.h.

#define ICON_PLANET   7

Definition at line 35 of file missionbriefcommon.h.

#define ICON_SENTRYGUN   32

Definition at line 60 of file missionbriefcommon.h.

#define ICON_SUPERCAP   31

Definition at line 59 of file missionbriefcommon.h.

#define ICON_SUPPORT_SHIP   10

Definition at line 38 of file missionbriefcommon.h.

#define ICON_TRANSPORT   34

Definition at line 62 of file missionbriefcommon.h.


Definition at line 55 of file missionbriefcommon.h.

#define ICON_UNKNOWN   20

Definition at line 48 of file missionbriefcommon.h.

#define ICON_UNKNOWN_WING   21

Definition at line 49 of file missionbriefcommon.h.

#define ICON_WAYPOINT   9

Definition at line 37 of file missionbriefcommon.h.

#define MAX_BRIEF_LINE_LEN   256

Definition at line 85 of file missionbriefcommon.h.

#define MAX_BRIEF_LINE_W_1024   600

Definition at line 87 of file missionbriefcommon.h.

#define MAX_BRIEF_LINE_W_640   375

Definition at line 86 of file missionbriefcommon.h.

#define MAX_BRIEF_LINES   70

Definition at line 84 of file missionbriefcommon.h.


Definition at line 130 of file missionbriefcommon.h.

#define MAX_BRIEF_STAGES   15

Definition at line 99 of file missionbriefcommon.h.

#define MAX_DEBRIEF_LINE_LEN   256

Definition at line 90 of file missionbriefcommon.h.

#define MAX_DEBRIEF_LINE_W   500

Definition at line 91 of file missionbriefcommon.h.

#define MAX_DEBRIEF_LINES   60

Definition at line 89 of file missionbriefcommon.h.


Definition at line 100 of file missionbriefcommon.h.

#define MAX_ICON_TEXT_LEN   1024

Definition at line 93 of file missionbriefcommon.h.

#define MAX_ICON_TEXT_LINE_LEN   256

Definition at line 95 of file missionbriefcommon.h.

#define MAX_ICON_TEXT_LINE_W   170

Definition at line 96 of file missionbriefcommon.h.

#define MAX_ICON_TEXT_LINES   30

Definition at line 94 of file missionbriefcommon.h.

#define MAX_LABEL_LEN   64

Definition at line 101 of file missionbriefcommon.h.

#define MAX_STAGE_ICONS   20

Definition at line 98 of file missionbriefcommon.h.

#define MAX_TEXT_STREAMS   2

Definition at line 20 of file missionbriefcommon.h.

#define MIN_BRIEF_ICONS   35

Definition at line 26 of file missionbriefcommon.h.

Typedef Documentation

typedef struct brief_icon brief_icon
typedef struct brief_line brief_line
typedef struct brief_screen brief_sceen

Function Documentation

void brief_blit_stage_num ( int  stage_num,
int  stage_max 

Display what stage of the briefing is active

Definition at line 1143 of file missionbriefcommon.cpp.

void brief_camera_move ( float  frametime,
int  stage_num 

Update the camera position

Definition at line 1865 of file missionbriefcommon.cpp.

int brief_color_text_init ( const char *  src,
int  w,
const char  default_color,
int  instance,
int  max_lines,
const bool  append 

Initialise briefing coloured text

srcparagraph of text to process
wmax width of line in pixels
[in]default_coloroptional, default color for this text (defaults to '\0', which gets converted to the first defined color tag (should be 'w'))
instanceoptional parameter, used when multiple text streams are required (default value is 0)
max_linesmaximum number of lines
[in]appendadd on to the existing lines instead of replacing them (defaults to false)

Definition at line 1543 of file missionbriefcommon.cpp.

void brief_common_close ( )

Definition at line 2168 of file missionbriefcommon.cpp.

void brief_common_get_icon_dimensions ( int w,
int h,
brief_icon bi 

Get the dimensions for a briefing icon

Definition at line 2318 of file missionbriefcommon.cpp.

briefing_icon_info* brief_get_icon_info ( brief_icon bi)

Definition at line 548 of file missionbriefcommon.cpp.

void brief_init_map ( )

Definition at line 686 of file missionbriefcommon.cpp.

void brief_init_screen ( int  multiplayer_flag)

Set up the screen regions. A mulitplayer briefing will look different than a single player briefing.

Definition at line 532 of file missionbriefcommon.cpp.

void brief_parse_icon_tbl ( )

Definition at line 275 of file missionbriefcommon.cpp.

void brief_render_icon ( int  stage_num,
int  icon_num,
float  frametime,
int  selected,
float  w_scale_factor,
float  h_scale_factor 

Draw a briefing icon

stage_numbriefing stage number (start at 0)
icon_numicon number in stage
frametimetime elapsed in seconds
selectedFRED only (will be 0 or non-zero)
w_scale_factorscale icon in width by this amount (default 1.0f)
h_scale_factorscale icon in height by this amount (default 1.0f)

Definition at line 855 of file missionbriefcommon.cpp.

void brief_render_icon_line ( int  stage_num,
int  line_num 

Draw a line between two icons on the briefing screen

Definition at line 782 of file missionbriefcommon.cpp.

void brief_render_map ( int  stage_num,
float  frametime 

Definition at line 1105 of file missionbriefcommon.cpp.

int brief_render_text ( int  line_offset,
int  x,
int  y,
int  h,
float  frametime,
int  instance,
int  line_spacing 


frametimetime in seconds of previous frame
instanceoptional parameter. Used to indicate which text stream is used. This value is 0 unless multiple text streams are required

Definition at line 1274 of file missionbriefcommon.cpp.

void brief_reset ( )

Definition at line 505 of file missionbriefcommon.cpp.

void brief_reset_icons ( int  stage_num)

Definition at line 1340 of file missionbriefcommon.cpp.

void brief_reset_last_new_stage ( )

Definition at line 2310 of file missionbriefcommon.cpp.

void brief_restart_text_wipe ( )

Definition at line 2173 of file missionbriefcommon.cpp.

void brief_set_new_stage ( vec3d pos,
matrix orient,
int  time,
int  stage_num 

Set new stage in briefing

postarget position for the camera
orienttarget orientation for the camera
timetime in ms to reach target
stage_numstage number of briefing (start numbering at 0)

Definition at line 1735 of file missionbriefcommon.cpp.

int brief_time_to_advance ( int  stage_num)

Should briefing advance to the next stage?

Definition at line 2357 of file missionbriefcommon.cpp.

void brief_voice_init ( )

Initialize the array of handles to the different voice streams

Definition at line 2183 of file missionbriefcommon.cpp.

void brief_voice_load_all ( )

Open and pre-load the stream buffers for the different voice streams

Definition at line 2215 of file missionbriefcommon.cpp.

void brief_voice_pause ( int  stage_num)

Pause playback of the voice for a particular briefing stage, to resume just call brief_voice_unpause() again

Definition at line 2292 of file missionbriefcommon.cpp.

void brief_voice_play ( int  stage_num)

Start playback of the voice for a particular briefing stage

Definition at line 2247 of file missionbriefcommon.cpp.

void brief_voice_stop ( int  stage_num)

Stop playback of the voice for a particular briefing stage

Definition at line 2279 of file missionbriefcommon.cpp.

void brief_voice_unload_all ( )

Close all the briefing voice streams

Definition at line 2232 of file missionbriefcommon.cpp.

void brief_voice_unpause ( int  stage_num)

Definition at line 2301 of file missionbriefcommon.cpp.

void cmd_brief_reset ( )

Definition at line 2336 of file missionbriefcommon.cpp.

void debrief_reset ( )

Definition at line 517 of file missionbriefcommon.cpp.

void mission_brief_common_init ( )

Does one time initialization of the briefing and debriefing structures. Namely setting all malloc'ble pointers to NULL. Called once at game startup.

Definition at line 375 of file missionbriefcommon.cpp.

void mission_brief_common_reset ( )

Frees all the memory allocated in the briefing and debriefing structures and sets all pointers to NULL.

Definition at line 443 of file missionbriefcommon.cpp.

void mission_debrief_common_reset ( )

Split from above since we need to clear them separately

See also

Definition at line 484 of file missionbriefcommon.cpp.

Variable Documentation

int Brief_bmap_coords[GR_NUM_RESOLUTIONS][2]

Definition at line 68 of file missionbriefcommon.cpp.

int Brief_grid_coords[GR_NUM_RESOLUTIONS][4]

Definition at line 77 of file missionbriefcommon.cpp.

int Brief_static_coords[GR_NUM_RESOLUTIONS][2]

Definition at line 59 of file missionbriefcommon.cpp.

char* Brief_static_name[GR_NUM_RESOLUTIONS]

Definition at line 54 of file missionbriefcommon.cpp.

int Brief_text_coords[GR_NUM_RESOLUTIONS][4]

Definition at line 86 of file missionbriefcommon.cpp.

int Brief_text_max_lines[GR_NUM_RESOLUTIONS]

Definition at line 113 of file missionbriefcommon.cpp.

float Brief_text_wipe_time_elapsed

Definition at line 195 of file missionbriefcommon.cpp.

briefing* Briefing

Definition at line 127 of file missionbriefcommon.cpp.

SCP_vector<briefing_icon_info> Briefing_icon_info

Definition at line 253 of file missionbriefcommon.cpp.

int Briefing_voice_enabled

Definition at line 130 of file missionbriefcommon.cpp.

briefing Briefings[MAX_TVT_TEAMS]

Definition at line 125 of file missionbriefcommon.cpp.

brief_screen bscreen

Definition at line 42 of file missionbriefcommon.cpp.

int Cur_brief_id

Definition at line 137 of file missionbriefcommon.cpp.

int Current_screen

Definition at line 70 of file missionscreencommon.cpp.

debriefing* Debriefing

Definition at line 128 of file missionbriefcommon.cpp.

debriefing Debriefings[MAX_TVT_TEAMS]

Definition at line 126 of file missionbriefcommon.cpp.

int Num_brief_text_lines[MAX_TEXT_STREAMS]

Definition at line 177 of file missionbriefcommon.cpp.

int Top_brief_text_line

Definition at line 178 of file missionbriefcommon.cpp.