FS2_Open
Open source remastering of the Freespace 2 engine
|
#include "anim/animplay.h"
#include "gamesnd/gamesnd.h"
#include "globalincs/alphacolors.h"
#include "globalincs/linklist.h"
#include "iff_defs/iff_defs.h"
#include "io/mouse.h"
#include "io/timer.h"
#include "localization/localize.h"
#include "math/fvi.h"
#include "mission/missionbriefcommon.h"
#include "mission/missiongrid.h"
#include "mission/missionparse.h"
#include "missionui/missionbrief.h"
#include "missionui/missioncmdbrief.h"
#include "missionui/missiondebrief.h"
#include "mod_table/mod_table.h"
#include "parse/parselo.h"
#include "playerman/player.h"
#include "render/3d.h"
#include "ship/ship.h"
#include "sound/audiostr.h"
#include "sound/fsspeech.h"
#include "species_defs/species_defs.h"
Go to the source code of this file.
Classes | |
struct | colored_char |
struct | icon_move_info |
struct | icon_fade_info |
Macros | |
#define | BRIEF_CUP_X1 400 |
#define | BRIEF_CUP_Y1 70 |
#define | BRIEF_CUP_X2 639 |
#define | BRIEF_CUP_Y2 245 |
#define | BRIEF_CUPINFO_X1 445 |
#define | BRIEF_CUPINFO_Y1 247 |
#define | BRIEF_CUPINFO_X2 639 |
#define | BRIEF_CUPINFO_Y2 438 |
#define | LOOKAT_DIST 500.0f |
#define | STAGE_ADVANCE_DELAY 1000 |
#define | BRIGHTEN_LEAD 2 |
#define | MAX_MOVING_ICONS MAX_STAGE_ICONS |
#define | MAX_FADING_ICONS MAX_STAGE_ICONS |
Typedefs | |
typedef struct colored_char | colored_char |
typedef SCP_vector< colored_char > | briefing_line |
typedef SCP_vector< briefing_line > | briefing_stream |
typedef struct icon_move_info | icon_move_info |
typedef struct icon_fade_info | fade_icon |
#define BRIEF_CUP_X1 400 |
Definition at line 45 of file missionbriefcommon.cpp.
#define BRIEF_CUP_X2 639 |
Definition at line 47 of file missionbriefcommon.cpp.
#define BRIEF_CUP_Y1 70 |
Definition at line 46 of file missionbriefcommon.cpp.
#define BRIEF_CUP_Y2 245 |
Definition at line 48 of file missionbriefcommon.cpp.
#define BRIEF_CUPINFO_X1 445 |
Definition at line 49 of file missionbriefcommon.cpp.
#define BRIEF_CUPINFO_X2 639 |
Definition at line 51 of file missionbriefcommon.cpp.
#define BRIEF_CUPINFO_Y1 247 |
Definition at line 50 of file missionbriefcommon.cpp.
#define BRIEF_CUPINFO_Y2 438 |
Definition at line 52 of file missionbriefcommon.cpp.
#define BRIGHTEN_LEAD 2 |
Definition at line 193 of file missionbriefcommon.cpp.
#define LOOKAT_DIST 500.0f |
Definition at line 117 of file missionbriefcommon.cpp.
#define MAX_FADING_ICONS MAX_STAGE_ICONS |
Definition at line 242 of file missionbriefcommon.cpp.
#define MAX_MOVING_ICONS MAX_STAGE_ICONS |
Definition at line 229 of file missionbriefcommon.cpp.
#define STAGE_ADVANCE_DELAY 1000 |
Definition at line 118 of file missionbriefcommon.cpp.
typedef SCP_vector<colored_char> briefing_line |
Definition at line 189 of file missionbriefcommon.cpp.
typedef SCP_vector<briefing_line> briefing_stream |
Definition at line 190 of file missionbriefcommon.cpp.
typedef struct colored_char colored_char |
typedef struct icon_fade_info fade_icon |
typedef struct icon_move_info icon_move_info |
Display what stage of the briefing is active
Definition at line 1143 of file missionbriefcommon.cpp.
Calculate how far the camera should have moved
Definition at line 1845 of file missionbriefcommon.cpp.
Update the camera position
Definition at line 1865 of file missionbriefcommon.cpp.
void brief_clear_fade_out_icons | ( | ) |
Definition at line 1721 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
src | paragraph of text to process | |
w | max width of line in pixels | |
[in] | default_color | optional, default color for this text (defaults to '\0', which gets converted to the first defined color tag (should be 'w')) |
instance | optional parameter, used when multiple text streams are required (default value is 0) | |
max_lines | maximum number of lines | |
[in] | append | add 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.
Create a nice default grid. Centered at origin, 10x10, 10.0 size squares, in xz plane.
Definition at line 2081 of file missionbriefcommon.cpp.
grid * brief_create_grid | ( | grid * | gridp, |
vec3d * | forward, | ||
vec3d * | right, | ||
vec3d * | center, | ||
int | nrows, | ||
int | ncols, | ||
float | square_size | ||
) |
Definition at line 1990 of file missionbriefcommon.cpp.
int brief_get_free_move_icon | ( | ) |
Get free handle to a move icon
Definition at line 1604 of file missionbriefcommon.cpp.
briefing_icon_info* brief_get_icon_info | ( | brief_icon * | bi | ) |
Definition at line 548 of file missionbriefcommon.cpp.
void brief_grid_read_camera_controls | ( | control_info * | ci, |
float | frametime | ||
) |
float brief_icon_get_dist_moved | ( | icon_move_info * | mi, |
float | elapsed_time | ||
) |
Figure out how far an icon should move based on the elapsed time
Definition at line 763 of file missionbriefcommon.cpp.
void brief_init_colors | ( | ) |
Definition at line 544 of file missionbriefcommon.cpp.
void brief_init_map | ( | ) |
Definition at line 686 of file missionbriefcommon.cpp.
Set up the screen regions. A mulitplayer briefing will look different than a single player briefing.
Definition at line 532 of file missionbriefcommon.cpp.
Definition at line 2191 of file missionbriefcommon.cpp.
Project the viewer's position onto the grid plane. If more than threshold distance from grid center, move grid center.
Definition at line 1914 of file missionbriefcommon.cpp.
Definition at line 2138 of file missionbriefcommon.cpp.
void brief_move_icon_reset | ( | ) |
Definition at line 361 of file missionbriefcommon.cpp.
void brief_parse_icon_tbl | ( | ) |
Definition at line 275 of file missionbriefcommon.cpp.
void brief_preload_anims | ( | ) |
Preload highlight, fadein and fadeout animations that are used in each stage
Definition at line 661 of file missionbriefcommon.cpp.
void brief_preload_fade_anim | ( | brief_icon * | bi | ) |
Definition at line 616 of file missionbriefcommon.cpp.
void brief_preload_highlight_anim | ( | brief_icon * | bi | ) |
Definition at line 636 of file missionbriefcommon.cpp.
void brief_preload_icon_anim | ( | brief_icon * | bi | ) |
Definition at line 599 of file missionbriefcommon.cpp.
Draw the lines that show objects positions on the grid
Definition at line 1313 of file missionbriefcommon.cpp.
Definition at line 717 of file missionbriefcommon.cpp.
Renders a grid
gridp | Grid defined in a grid struct to render |
Definition at line 2115 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_num | briefing stage number (start at 0) |
icon_num | icon number in stage |
frametime | time elapsed in seconds |
selected | FRED only (will be 0 or non-zero) |
w_scale_factor | scale icon in width by this amount (default 1.0f) |
h_scale_factor | scale icon in height by this amount (default 1.0f) |
Definition at line 855 of file missionbriefcommon.cpp.
Draw a line between two icons on the briefing screen
Definition at line 782 of file missionbriefcommon.cpp.
Definition at line 1048 of file missionbriefcommon.cpp.
Render a line of text for the briefings. Lines are drawn in as a wipe, with leading bright white characters. Have to jump through some hoops since we support colored words. This means that we need to process the line one character at a time.
line_num | number of the line of the briefing page to be drawn |
x | horizontal position where the text is drawn |
y | vertical position where the text is drawn |
instance | index of Colored_stream of the text page to display |
Definition at line 1167 of file missionbriefcommon.cpp.
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 | ||
) |
line_offset | |
x | |
y | |
h | |
frametime | time in seconds of previous frame |
instance | optional parameter. Used to indicate which text stream is used. This value is 0 unless multiple text streams are required |
line_spacing |
Definition at line 1274 of file missionbriefcommon.cpp.
void brief_reset | ( | ) |
Definition at line 505 of file missionbriefcommon.cpp.
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.
Rotate and project points and draw a line.
Definition at line 2100 of file missionbriefcommon.cpp.
Direct camera to look at target
pos | target position for the camera |
orient | target orientation for the camera |
time | time in ms to reach target |
Definition at line 1363 of file missionbriefcommon.cpp.
Definition at line 352 of file missionbriefcommon.cpp.
Set move list in briefing
new_stage | new stage number that briefing is now moving to |
current_stage | current stage that the briefing is on |
time | time in seconds |
Definition at line 1627 of file missionbriefcommon.cpp.
Set new stage in briefing
pos | target position for the camera |
orient | target orientation for the camera |
time | time in ms to reach target |
stage_num | stage number of briefing (start numbering at 0) |
Definition at line 1735 of file missionbriefcommon.cpp.
void brief_set_text_color | ( | char | color_tag | ) |
Definition at line 1426 of file missionbriefcommon.cpp.
See if there are any highlight animations to play
Definition at line 1071 of file missionbriefcommon.cpp.
int brief_text_colorize | ( | char * | src, |
int | instance, | ||
char | default_color_stack[], | ||
int & | color_stack_index | ||
) |
Builds a vector of colored characters from a string containing color markups and stores it to Colored_stream table.
A color markup is made of a minimum of three characters: '$' + a char standing for a color + contigous multiple spaces (chars t n and ' ') The markup is completely removed from the resulting character sequence.
src | a not null pointer to a C string terminated by a /0 char. | |
instance | index into Colored_stream where the result should be placed. Value is 0 unless multiple text streams are required. | |
[in,out] | default_color_stack | pointer to an array containing a stack of default colors (for color spans) |
[in,out] | color_stack_index | pointer to the current index in the above stack |
Definition at line 1455 of file missionbriefcommon.cpp.
int brief_text_wipe_finished | ( | ) |
Definition at line 1253 of file missionbriefcommon.cpp.
Should briefing advance to the next stage?
Definition at line 2357 of file missionbriefcommon.cpp.
void brief_unload_anims | ( | ) |
Definition at line 2144 of file missionbriefcommon.cpp.
bool brief_verify_color_tag | ( | char | color_tag | ) |
Definition at line 1417 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.
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.
Start playback of the voice for a particular briefing stage
Definition at line 2247 of file missionbriefcommon.cpp.
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.
Definition at line 2301 of file missionbriefcommon.cpp.
Definition at line 1802 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 get_camera_limits | ( | const matrix * | start_camera, |
const matrix * | end_camera, | ||
float | time, | ||
vec3d * | acc_max, | ||
vec3d * | w_max | ||
) |
Definition at line 2005 of file vecmat.cpp.
void interpolate_matrix | ( | matrix * | result, |
matrix * | goal, | ||
matrix * | start, | ||
float | elapsed_time, | ||
float | total_time | ||
) |
Interpolate between matrices. elapsed_time/total_time gives percentage of interpolation between cur and goal.
Definition at line 1821 of file missionbriefcommon.cpp.
bool is_a_word_separator | ( | char | character | ) |
Checks if a character is a word separator
character | the character to be analysed. |
Definition at line 1436 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
Definition at line 484 of file missionbriefcommon.cpp.
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.
const char BRIEF_META_CHAR = '$' |
Definition at line 139 of file missionbriefcommon.cpp.
int Brief_stage_text_coords[GR_NUM_RESOLUTIONS][2] |
Definition at line 95 of file missionbriefcommon.cpp.
int Brief_stage_text_coords_multi[GR_NUM_RESOLUTIONS][2] |
Definition at line 104 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.
const float BRIEF_TEXT_WIPE_TIME = 1.5f |
float Brief_text_wipe_time_elapsed |
Definition at line 195 of file missionbriefcommon.cpp.
int Brief_voices[MAX_BRIEF_STAGES] |
Definition at line 248 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 =1 |
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.
cmd_brief Cmd_briefs[MAX_TVT_TEAMS] |
Definition at line 251 of file missionbriefcommon.cpp.
int Cur_brief_id |
Definition at line 137 of file missionbriefcommon.cpp.
cmd_brief* Cur_cmd_brief |
Definition at line 250 of file missionbriefcommon.cpp.
debriefing* Debriefing |
Definition at line 128 of file missionbriefcommon.cpp.
debriefing Debriefings[MAX_TVT_TEAMS] |
Definition at line 126 of file missionbriefcommon.cpp.
icon_fade_info Fading_icons[MAX_FADING_ICONS] |
Definition at line 244 of file missionbriefcommon.cpp.
const int HIGHEST_COLOR_STACK_INDEX = 9 |
Definition at line 141 of file missionbriefcommon.cpp.
icon_move_info Icon_move_list |
Definition at line 232 of file missionbriefcommon.cpp.
icon_move_info Icon_movers[MAX_MOVING_ICONS] |
Definition at line 231 of file missionbriefcommon.cpp.
int Num_brief_text_lines[MAX_TEXT_STREAMS] |
Definition at line 177 of file missionbriefcommon.cpp.
int Num_fade_icons |
Definition at line 245 of file missionbriefcommon.cpp.
int Top_brief_text_line |
Definition at line 178 of file missionbriefcommon.cpp.