44 if(cut->description != NULL) {
46 cut->description = NULL;
67 bool isFirstCutscene =
true;
90 if (isFirstCutscene) {
91 isFirstCutscene =
false;
100 Cutscenes.push_back(cutinfo);
107 mprintf((
"TABLES: Unable to parse '%s'! Error message = %s.\n",
"cutscenes.tbl", e.what()));
117 if ( !
stricmp(cut->filename, filename) ) {
118 return (cut->cd - 1);
135 char *
p = strchr( file,
'.' );
149 if ( strstr(cut_file, file) != NULL ) {
150 cut->viewable =
true;
156 Warning(
LOCATION,
"Could not find cutscene '%s' in listing; cannot mark it viewable...", filename);
159 #define NUM_BUTTONS 8
161 #define TECH_DATABASE_BUTTON 0
162 #define SIMULATOR_BUTTON 1
163 #define CUTSCENES_BUTTON 2
164 #define CREDITS_BUTTON 3
166 #define SCROLL_UP_BUTTON 4
167 #define SCROLL_DOWN_BUTTON 5
168 #define PLAY_BUTTON 6
169 #define EXIT_BUTTON 7
173 static int Selected_line = 0;
174 static int Scroll_offset;
175 static int Background_bitmap;
205 #define NUM_CUTSCENE_TEXT 6
245 #define MAX_TEXT_LINES 20
250 #define MAX_TEXT_LINE_LEN 256
252 static int Text_size;
253 static int Text_offset = 0;
265 int num_attempts = 0;
271 if ((cd_mve_is_on != 0) && (cd_mve_is_on != 1) && (cd_mve_is_on != 2)) {
276 sprintf(volume_name,
NOX(
"FREESPACE2_%c"),
'1' + cd_mve_is_on);
286 if ( !prompt_for_cd ) {
295 sprintf(popup_msg,
XSTR(
"Movie not found\n\nInsert FreeSpace CD #%d to continue", 203), cd_mve_is_on+1);
298 if ( popup_rval != 1 ) {
303 if ( num_attempts++ > 5 ) {
317 Assert( (Selected_line >= 0) && (Selected_line < (
int)Cutscene_list.size()) );
318 which_cutscene = Cutscene_list[Selected_line];
332 strcpy_s(str,
XSTR(
"Movies are currently disabled.", 1574));
334 sprintf(str,
XSTR(
"Unable to play movie %s.", 204), Cutscenes[which_cutscene].name);
350 if (Selected_line < Scroll_offset)
351 Scroll_offset = Selected_line;
358 if (Selected_line < (
int)Cutscene_list.size() - 1) {
366 if (Selected_line >= Scroll_offset + h){
377 Assert(Selected_line > Scroll_offset);
379 while (Selected_line >= Scroll_offset + h){
395 if (Scroll_offset + h < (
int)Cutscene_list.size()) {
397 if (Selected_line < Scroll_offset){
398 Selected_line = Scroll_offset;
482 Scroll_offset = Selected_line = 0;
485 Cutscene_list.clear();
489 if ( (*cut).viewable ) {
490 Cutscene_list.push_back(u);
497 if (Background_bitmap)
507 int select_tease_line = -1;
548 Cutscene_list.clear();
549 size_t size = Cutscenes.size();
550 for (
size_t t = 0;
t <
size;
t++) {
551 Cutscene_list.push_back((
int)
t);
568 z = Scroll_offset + y / font_height;
569 if ((z >= 0) && (z < (
int)Cutscene_list.size()))
570 select_tease_line =
z;
575 z = Scroll_offset + y / font_height;
576 if ((z >= 0) && (z < (
int)Cutscene_list.size()))
581 if (Background_bitmap >= 0) {
601 if (z >= (
int)Cutscene_list.size()){
605 if (z == Selected_line){
607 }
else if (z == select_tease_line) {
646 len = Text_line_size[
z];
650 strncpy(line, Text_lines[z], len);
void set_highlight_action(void(*_user_function)(void))
void add_XSTR(char *string, int _xstr_id, int _x, int _y, UI_GADGET *_assoc, int _color_type, int _font_id=-1)
SCP_vector< cutscene_info > Cutscenes
int find_freespace_cd(char *)
GLfloat GLfloat GLfloat GLfloat h
void _cdecl void void _cdecl void _cdecl Warning(char *filename, int line, SCP_FORMAT_STRING const char *format,...) SCP_FORMAT_STRING_ARGS(3
#define GR_NUM_RESOLUTIONS
__inline void gr_string(int x, int y, const char *string, int resize_mode=GR_RESIZE_FULL)
int Cutscene_list_coords[GR_NUM_RESOLUTIONS][4]
general failure sound for any event
char * drop_white_space(char *str)
void compact_multitext_string(char *str)
#define NUM_CUTSCENE_TEXT
#define GR_MAYBE_CLEAR_RES(bmap)
void gr_set_color_fast(color *dst)
#define SCROLL_DOWN_BUTTON
void gr_set_bitmap(int bitmap_num, int alphablend_mode, int bitblt_mode, float alpha)
int required_string_either(char *str1, char *str2)
Checks for one of two required strings.
GLenum GLuint GLenum GLsizei const GLchar * buf
int bm_release(int handle, int clear_render_targets)
Frees both a bitmap's data and it's associated slot.
char * Cutscene_bitmap_name[GR_NUM_RESOLUTIONS]
void draw_forced(int frame_num)
char * Cutscene_mask_name[GR_NUM_RESOLUTIONS]
#define MAX_TEXT_LINE_LEN
typedef int(SCP_EXT_CALLCONV *SCPDLL_PFVERSION)(SCPDLL_Version *)
void set_mask_bmap(char *fname)
int set_bmaps(char *ani_filename, int nframes=3, int start_frame=1)
Switching to a new screen, but not commit.
int cutscenes_validate_cd(char *mve_name, int prompt_for_cd)
void stuff_string(char *outstr, int type, int len, char *terminators)
sprintf(buf,"(%f,%f,%f)", v3->xyz.x, v3->xyz.y, v3->xyz.z)
void cutscenes_screen_scroll_screen_down()
void cutscenes_screen_close()
int Cutscene_desc_coords[GR_NUM_RESOLUTIONS][4]
void main_hall_stop_ambient()
int required_string(const char *pstr)
int split_str(const char *src, int max_pixel_w, int *n_chars, const char **p_str, int max_lines, char ignore_char)
int optional_string(const char *pstr)
void cutscenes_screen_scroll_line_up()
void cutscenes_screen_scroll_line_down()
void read_file_text(const char *filename, int mode, char *processed_text, char *raw_text)
#define TECH_DATABASE_BUTTON
void cutscenes_screen_scroll_screen_up()
const char * XSTR(const char *str, int index)
int cutscenes_get_cd_num(char *filename)
void stuff_boolean(int *i, bool a_to_eol)
int cutscenes_screen_button_pressed(int n)
void set_hotkey(int keycode)
void reset_parse(char *text)
GLuint const GLchar * name
int bm_load(const char *real_filename)
Loads a bitmap so we can draw with it later.
color Color_text_subselected
GLboolean GLboolean GLboolean b
color Color_text_selected
scroll pressed (and scroll)
void link_hotspot(int num)
void create(UI_WINDOW *wnd, char *_text, int _x, int _y, int _w, int _h, int do_repeat=0, int ignore_focus=0)
#define UI_XSTR_COLOR_PINK
UI_XSTR Cutscene_text[GR_NUM_RESOLUTIONS][NUM_CUTSCENE_TEXT]
void create(int _x, int _y, int _w, int _h, int _flags, int _f_id=-1)
void cutscenes_screen_do_frame()
void common_play_highlight_sound()
void main_hall_start_music()
void get_mouse_pos(int *xx, int *yy)
void ignore_white_space()
bool movie_play(char *name)
void cutscenes_screen_init()
void gr_bitmap(int _x, int _y, int resize_mode)
void cutscene_mark_viewable(char *filename)
#define UI_XSTR_COLOR_GREEN
int Cutscene_max_text_lines[GR_NUM_RESOLUTIONS]
void gamesnd_play_iface(int n)
struct ui_button_info ui_button_info
void main_hall_stop_music(bool fade)
int process(int key_in=-1, int process_mouse=1)
char filename[MAX_FILENAME_LEN]
void _cdecl gr_printf_menu(int x, int y, const char *format,...)
void gameseq_post_event(int event)
int skip_to_string(char *pstr, char *end)
void cutscenes_screen_play()