FS2_Open
Open source remastering of the Freespace 2 engine
credits.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) Volition, Inc. 1999. All rights reserved.
3  *
4  * All source code herein is the property of Volition, Inc. You may not sell
5  * or otherwise commercially exploit the source or things you created based on the
6  * source.
7  *
8 */
9 
10 
11 
12 #include <stdlib.h>
13 
14 #include "cfile/cfile.h"
15 #include "freespace2/freespace.h"
17 #include "gamesnd/eventmusic.h" /* for Master_event_music_volume */
18 #include "gamesnd/gamesnd.h"
19 #include "globalincs/alphacolors.h"
20 #include "graphics/font.h"
21 #include "io/key.h"
22 #include "io/timer.h"
23 #include "localization/localize.h"
24 #include "menuui/credits.h"
26 #include "parse/parselo.h"
27 #include "playerman/player.h"
28 #include "sound/audiostr.h"
29 #include "ui/ui.h"
30 
31 
32 
33 // This is the fs2_open credit list, please only add yourself if you have actually contributed code
34 // Rules!
36 "SOURCE CODE PROJECT STAFF:\n"
37  "\n"
38  "Project Leader:\n"
39  "\n"
40  "Fabian \"The E\" Woltermann\n"
41  "\n"
42  "Senior Advisors:\n"
43  "\n"
44  "Ian \"Goober5000\" Warfield\n"
45  "Michael \"Zacam\" LaFleur\n"
46  "Taylor Richards\n"
47  "Edward \"Inquisitor\" Gardner\n"
48  "Cliff \"chief1983\" Gordon\n"
49  "\n"
50  "Programmers:\n"
51  "\n"
52  "Hassan \"Karajorma\" Kazmi\n"
53  "Derek \"Kazan\" Meek\n"
54  "Nick \"phreak\" Iannetta\n"
55  "Mike \"Bobboau\" Abegg\n"
56  "Backslash, Echelon9, Flaming_Sword\n"
57  "FUBAR, Iss Mneur, kkmic\n"
58  "Shade, Soulstorm, Sushi\n"
59  "Swifty, Wanderer, CommanderDJ\n"
60  "Valathil, MageKing17, Yarn\n"
61  "m!m, z64555, zookeeper\n"
62  "jg18, niffiwan\n"
63  "\n"
64  "\n"
65  "Readme Staff:\n"
66  "\n"
67  "Peter \"Flipside\" Dibble\n"
68  "\n"
69  "Web Support:\n"
70  "\n"
71  "http://www.hard-light.net/\n"
72  "http://scp.indiegames.us/\n"
73  "\n"
74  "Special thanks to:\n"
75  "\n"
76  "portej05\n"
77  "Hery\n"
78  "QuantumDelta\n"
79  "Fury\n"
80  "\n"
81  "Linux and OSX version with the support of\n"
82  "the icculus.org FreeSpace2 project:\n"
83  "Steven \"relnev\" Fuller\n"
84  "Ryan Gordon\n"
85  "Charles Mason\n"
86  "Dan Olson\n"
87  "Taylor Richards\n"
88  "\"tigital\"\n"
89  "\n"
90  "Very special thanks to:\n"
91  "\n"
92  "Volition for making FS2 such a great game\n"
93  "Dave Baranec for giving us the code and keeping us sanity checked\n"
94  "\n\n"
95  "FS2_Open makes use of the following technologies:\n"
96  "\n"
97  "Ogg Vorbis - (C) 2005, Xiph.Org Foundation\n"
98  "JPEG - Independent JPEG Group, (C) 1991-1998, Thomas G. Lane\n"
99  "libpng - Copyright (C) 1998-2010 Glenn Randers-Pehrson\n"
100  "liblua - Copyright (C) 1994-2008 Lua.org, PUC-Rio\n"
101  "zlib - Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler\n"
102  "FXAA - Copyright (c) 2010 NVIDIA Corporation. All rights reserved.\n"
103  "\n"
104  "\n"
105  "\n";
106 
107 char *unmodified_credits = "ORIGINAL VOLITION STAFF:\n\n\n";
108 char *mod_check = "Design:";
109 
110 #define NUM_BUTTONS 5
111 #define DEFAULT_NUM_IMAGES 46
112 
113 #define TECH_DATABASE_BUTTON 0
114 #define SIMULATOR_BUTTON 1
115 #define CUTSCENES_BUTTON 2
116 #define CREDITS_BUTTON 3
117 #define EXIT_BUTTON 4
118 
119 // inidicies for coordinates
120 #define CREDITS_X_COORD 0
121 #define CREDITS_Y_COORD 1
122 #define CREDITS_W_COORD 2
123 #define CREDITS_H_COORD 3
124 
125 static char* Credits_bitmap_fname[GR_NUM_RESOLUTIONS] = {
126  "Credits", // GR_640
127  "2_Credits"
128 };
129 
130 static char* Credits_bitmap_mask_fname[GR_NUM_RESOLUTIONS] = {
131  "Credits-M", // GR_640
132  "2_Credits-M"
133 };
134 
136  {
137  219, 15, 394, 286 // GR_640
138  },
139  {
140  351, 25, 629, 455 // GR_1024
141  }
142 };
143 
144 // x, y, w, h
146  {
147  26, 316, 482, 157 // GR_640
148  },
149  {
150  144, 507, 568, 249 // GR_640
151  }
152 };
153 
155  char *filename;
156  int x, y, xt, yt;
157  int hotspot;
158  UI_BUTTON button; // because we have a class inside this struct, we need the constructor below..
159 
160  credits_screen_buttons(char *name, int x1, int y1, int xt1, int yt1, int h) : filename(name), x(x1), y(y1), xt(xt1), yt(yt1), hotspot(h) {}
161 };
162 
163 static int Background_bitmap;
164 static UI_WINDOW Ui_window;
165 
167 //XSTR:OFF
168  {
169  credits_screen_buttons("TDB_00", 7, 3, 37, 7, 0), // GR_640
170  credits_screen_buttons("2_TDB_00", 12, 5, 59, 12, 0) // GR_1024
171  },
172  {
173  credits_screen_buttons("TDB_01", 7, 18, 37, 23, 1), // GR_640
174  credits_screen_buttons("2_TDB_01", 12, 31, 59, 37, 1) // GR_1024
175  },
176  {
177  credits_screen_buttons("TDB_02", 7, 34, 37, 38, 2), // GR_640
178  credits_screen_buttons("2_TDB_02", 12, 56, 59, 62, 2) // GR_1024
179  },
180  {
181  credits_screen_buttons("TDB_03", 7, 49, 37, 54, 3), // GR_640
182  credits_screen_buttons("2_TDB_03", 12, 81, 59, 88, 3) // GR_1024
183  },
184  {
185  credits_screen_buttons("CRB_04", 571, 425, 588, 413, 4), // GR_640
186  credits_screen_buttons("2_CRB_04", 914, 681, 953, 668, 4) // GR_1024
187  }
188 //XSTR:ON
189 };
190 
191 static char Credits_music_name[NAME_LENGTH];
192 static int Credits_music_handle = -1;
193 static int Credits_music_begin_timestamp;
194 
195 static int Credits_frametime; // frametime of credits_do_frame() loop in ms
196 static int Credits_last_time; // timestamp used to calc frametime (in ms)
197 static float Credits_counter;
198 
199 static int Credits_num_images;
200 static int Credits_artwork_index;
201 static SCP_vector<int> Credits_bmps;
202 
203 // Positions for credits...
205 
206 static int Credits_music_delay = 2000;
207 static float Credits_scroll_rate = 15.0f;
208 static float Credits_artwork_display_time = 9.0f;
209 static float Credits_artwork_fade_time = 1.0f;
210 
211 static SCP_vector<SCP_string> Credit_text_parts;
212 
213 static bool Credits_parsed;
214 
216 {
219 };
220 
221 static CreditsPosition SCP_credits_position = START;
222 
223 void credits_stop_music(bool fade)
224 {
225  if ( Credits_music_handle != -1 ) {
226  audiostream_close_file(Credits_music_handle, fade);
227  Credits_music_handle = -1;
228  }
229 }
230 
231 void credits_load_music(char* fname)
232 {
233  if ( Credits_music_handle != -1 ){
234  return;
235  }
236 
237  if ( fname && *fname ){
238  Credits_music_handle = audiostream_open( fname, ASF_MENUMUSIC );
239  }
240 }
241 
243 {
244  if (Credits_music_handle != -1) {
245  if ( !audiostream_is_playing(Credits_music_handle) ){
246  audiostream_play(Credits_music_handle, Master_event_music_volume, 1);
247  }
248  } else {
249  nprintf(("Warning", "Cannot play credits music\n"));
250  }
251 }
252 
254 {
255  switch (n) {
259  return 1;
260 
261  case SIMULATOR_BUTTON:
264  return 1;
265 
266  case CUTSCENES_BUTTON:
269  return 1;
270 
271  case EXIT_BUTTON:
274  game_flush();
275  break;
276  }
277 
278  return 0;
279 }
280 
281 void credits_parse_table(const char* filename)
282 {
283  try
284  {
285  read_file_text(filename, CF_TYPE_TABLES);
286  reset_parse();
287 
288  // any metadata?
289  if (optional_string("$Music:"))
290  {
291  stuff_string(Credits_music_name, F_NAME, NAME_LENGTH);
292  }
293  if (optional_string("$Number of Images:"))
294  {
295  int temp;
296  stuff_int(&temp);
297  if (temp > 0)
298  Credits_num_images = temp;
299  }
300  if (optional_string("$Start Image Index:"))
301  {
302  stuff_int(&Credits_artwork_index);
303 
304  // bounds check
305  if (Credits_artwork_index < 0)
306  {
307  Credits_artwork_index = 0;
308  }
309  else if (Credits_artwork_index >= Credits_num_images)
310  {
311  Credits_artwork_index = Credits_num_images - 1;
312  }
313  }
314  if (optional_string("$Text scroll rate:"))
315  {
316  stuff_float(&Credits_scroll_rate);
317  if (Credits_scroll_rate < 0.01f)
318  Credits_scroll_rate = 0.01f;
319  }
320  if (optional_string("$Artworks display time:"))
321  {
322  stuff_float(&Credits_artwork_display_time);
323  if (Credits_artwork_display_time < 0.01f)
324  Credits_artwork_display_time = 0.01f;
325  }
326  if (optional_string("$Artworks fade time:"))
327  {
328  stuff_float(&Credits_artwork_fade_time);
329  if (Credits_artwork_fade_time < 0.01f)
330  Credits_artwork_fade_time = 0.01f;
331  }
332  if (optional_string("$SCP Credits position:"))
333  {
334  char mode[NAME_LENGTH];
335 
337 
338  if (!stricmp(mode, "Start"))
339  SCP_credits_position = START;
340  else if (!stricmp(mode, "End"))
341  SCP_credits_position = END;
342  else
343  Warning(LOCATION, "Unknown credits position mode \"%s\".", mode);
344  }
345 
347 
348  SCP_string credits_text;
349  SCP_string line;
350 
351  SCP_vector<int> charNum;
353  int numLines = -1;
354 
355  bool first_run = true;
356  while (!check_for_string_raw("#end"))
357  {
358  // Read in a line of text
359  stuff_string_line(line);
360 
361  // This is a bit odd but it means if a total conversion uses different credits the
362  // Volition credit won't happen
363  // Also don't append the default credits anymore when there was already a parsed table
364  if (first_run && !Credits_parsed && !line.compare(mod_check))
365  {
366  credits_text.append(unmodified_credits);
367  }
368 
369  first_run = false;
370 
371  if (line.empty())
372  {
373  // If the line is empty then just append a newline, don't bother with splitting it first
374  credits_text.append("\n");
375  }
376  else
377  {
378  // split_str doesn't take care of this.
379  charNum.clear();
380 
381  // Split the string into multiple lines if it's too long
382  numLines = split_str(line.c_str(), Credits_text_coords[gr_screen.res][2], charNum, lines, -1);
383 
384  // Make sure that we have valid data
385  Assertion(lines.size() == (size_t)numLines, "split_str reported %d lines but vector contains " SIZE_T_ARG " entries!", numLines, lines.size());
386 
387  Assertion(lines.size() <= charNum.size(),
388  "Something has gone wrong while splitting strings. Got " SIZE_T_ARG " lines but only " SIZE_T_ARG " chacter lengths.",
389  lines.size(), charNum.size());
390 
391  // Now add all splitted lines to the credit text and append a newline to the end
392  for (int i = 0; i < numLines; i++)
393  {
394  credits_text.append(SCP_string(lines[i], charNum[i]));
395  credits_text.append("\n");
396  }
397  }
398  }
399 
400  Credit_text_parts.push_back(credits_text);
401 
402  Credits_parsed = true;
403  }
404  catch (const parse::ParseException& e)
405  {
406  mprintf(("TABLES: Unable to parse '%s'! Error message = %s.\n", filename, e.what()));
407  return;
408  }
409 }
410 
412 {
413  // Parse main table
414  credits_parse_table("credits.tbl");
415 
416  // Parse modular tables
418 }
419 
421 {
422  int i;
424 
425  // pre-initialize
426  Credits_num_images = DEFAULT_NUM_IMAGES;
427  Credits_artwork_index = -1;
428 
429  // this is moved up here so we can override it if desired
430  strcpy_s(Credits_music_name, "Cinema");
431 
432  // parse credits early so as to set up any overrides (for music and such)
433  Credits_parsed = false;
434  credits_parse();
435 
436  // we could conceivably have specified a number of images but not an index,
437  // so if that's the case, set the value here
438  if (Credits_artwork_index < 0) {
439  Credits_artwork_index = rand() % Credits_num_images;
440  }
441 
442  int credits_spooled_music_index = event_music_get_spooled_music_index(Credits_music_name);
443  if(credits_spooled_music_index != -1){
444  char *credits_wavfile_name = Spooled_music[credits_spooled_music_index].filename;
445  if(credits_wavfile_name != NULL){
446  credits_load_music(credits_wavfile_name);
447  }
448  }
449 
450  // Use this id to trigger the start of music playing on the briefing screen
451  Credits_music_begin_timestamp = timestamp(Credits_music_delay);
452 
453  Credits_frametime = 0;
454  Credits_last_time = timer_get_milliseconds();
455 
456  if (!Credits_parsed)
457  {
458  Credit_text_parts.push_back(SCP_string("No credits available.\n"));
459  }
460  else
461  {
462  switch (SCP_credits_position)
463  {
464  case START:
465  Credit_text_parts.insert(Credit_text_parts.begin(), fs2_open_credit_text);
466  break;
467 
468  case END:
469  Credit_text_parts.push_back(fs2_open_credit_text);
470  break;
471 
472  default:
473  Error(LOCATION, "Unimplemented credits position %d. Get a coder!", (int) SCP_credits_position);
474  break;
475  }
476  }
477 
478  int ch;
480 
481  for (iter = Credit_text_parts.begin(); iter != Credit_text_parts.end(); ++iter)
482  {
483  for (SCP_string::iterator ii = iter->begin(); ii != iter->end(); ++ii)
484  {
485  ch = *ii;
486  switch (ch)
487  {
488  case -4:
489  ch = 129;
490  break;
491 
492  case -28:
493  ch = 132;
494  break;
495 
496  case -10:
497  ch = 148;
498  break;
499 
500  case -23:
501  ch = 130;
502  break;
503 
504  case -30:
505  ch = 131;
506  break;
507 
508  case -25:
509  ch = 135;
510  break;
511 
512  case -21:
513  ch = 137;
514  break;
515 
516  case -24:
517  ch = 138;
518  break;
519 
520  case -17:
521  ch = 139;
522  break;
523 
524  case -18:
525  ch = 140;
526  break;
527 
528  case -60:
529  ch = 142;
530  break;
531 
532  case -55:
533  ch = 144;
534  break;
535 
536  case -12:
537  ch = 147;
538  break;
539 
540  case -14:
541  ch = 149;
542  break;
543 
544  case -5:
545  ch = 150;
546  break;
547 
548  case -7:
549  ch = 151;
550  break;
551 
552  case -42:
553  ch = 153;
554  break;
555 
556  case -36:
557  ch = 154;
558  break;
559 
560  case -31:
561  ch = 160;
562  break;
563 
564  case -19:
565  ch = 161;
566  break;
567 
568  case -13:
569  ch = 162;
570  break;
571 
572  case -6:
573  ch = 163;
574  break;
575 
576  case -32:
577  ch = 133;
578  break;
579 
580  case -22:
581  ch = 136;
582  break;
583 
584  case -20:
585  ch = 141;
586  break;
587  }
588 
589  *ii = (char) ch;
590  }
591  }
592 
593  int temp_h;
594  int h = 0;
595 
596  for (iter = Credit_text_parts.begin(); iter != Credit_text_parts.end(); ++iter)
597  {
598  gr_get_string_size(NULL, &temp_h, iter->c_str(), iter->length());
599 
600  h = h + temp_h;
601  }
602 
604  Credit_stop_pos = -i2fl(h);
606 
608  Ui_window.set_mask_bmap(Credits_bitmap_mask_fname[gr_screen.res]);
609  common_set_interface_palette("InterfacePalette"); // set the interface palette
610 
611  for (i=0; i<NUM_BUTTONS; i++) {
612  b = &Buttons[i][gr_screen.res];
613 
614  b->button.create(&Ui_window, "", b->x, b->y, 60, 30, (i < 2), 1);
615  // set up callback for when a mouse first goes over a button
617  b->button.set_bmaps(b->filename);
618  b->button.link_hotspot(b->hotspot);
619  }
620 
621  // add some text
622  Ui_window.add_XSTR("Technical Database", 1055, Buttons[TECH_DATABASE_BUTTON][gr_screen.res].xt, Buttons[TECH_DATABASE_BUTTON][gr_screen.res].yt, &Buttons[TECH_DATABASE_BUTTON][gr_screen.res].button, UI_XSTR_COLOR_GREEN);
623  Ui_window.add_XSTR("Mission Simulator", 1056, Buttons[SIMULATOR_BUTTON][gr_screen.res].xt, Buttons[SIMULATOR_BUTTON][gr_screen.res].yt, &Buttons[SIMULATOR_BUTTON][gr_screen.res].button, UI_XSTR_COLOR_GREEN);
624  Ui_window.add_XSTR("Cutscenes", 1057, Buttons[CUTSCENES_BUTTON][gr_screen.res].xt, Buttons[CUTSCENES_BUTTON][gr_screen.res].yt, &Buttons[CUTSCENES_BUTTON][gr_screen.res].button, UI_XSTR_COLOR_GREEN);
625  Ui_window.add_XSTR("Credits", 1058, Buttons[CREDITS_BUTTON][gr_screen.res].xt, Buttons[CREDITS_BUTTON][gr_screen.res].yt, &Buttons[CREDITS_BUTTON][gr_screen.res].button, UI_XSTR_COLOR_GREEN);
626  Ui_window.add_XSTR("Exit", 1420, Buttons[EXIT_BUTTON][gr_screen.res].xt, Buttons[EXIT_BUTTON][gr_screen.res].yt, &Buttons[EXIT_BUTTON][gr_screen.res].button, UI_XSTR_COLOR_PINK);
627 
631  }
632 
634 
635  Background_bitmap = bm_load(Credits_bitmap_fname[gr_screen.res]);
636 
637  Credits_bmps.resize(Credits_num_images);
638  for (i=0; i<Credits_num_images; i++) {
639  Credits_bmps[i] = -1;
640  }
641 }
642 
644 {
645  int i;
646 
647  for (i=0; i<Credits_num_images; i++) {
648  if (Credits_bmps[i] >= 0){
649  bm_release(Credits_bmps[i]);
650  }
651  }
652  Credits_bmps.clear();
653 
654  credits_stop_music(true);
655 
656  Credit_text_parts.clear();
657 
658  if (Background_bitmap){
659  bm_release(Background_bitmap);
660  }
661 
662  Ui_window.destroy();
663  common_free_interface_palette(); // restore game palette
664 }
665 
666 void credits_do_frame(float frametime)
667 {
668  int i, k, next, percent, bm1, bm2;
669  int bx1, by1, bw1, bh1;
670  int bx2, by2, bw2, bh2;
671 
672  // Use this id to trigger the start of music playing on the credits screen
673  if ( timestamp_elapsed(Credits_music_begin_timestamp) ) {
674  Credits_music_begin_timestamp = 0;
676  }
677 
678  k = Ui_window.process();
679  switch (k) {
680  case KEY_ESC:
682  key_flush();
683  break;
684 
685  case KEY_CTRLED | KEY_UP:
686  case KEY_SHIFTED | KEY_TAB:
687  if ( !(Player->flags & PLAYER_FLAGS_IS_MULTI) ) {
689  break;
690  }
691  // else, react like tab key.
692 
693  case KEY_CTRLED | KEY_DOWN:
694  case KEY_TAB:
696  break;
697 
698  default:
699  break;
700  } // end switch
701 
702  for (i=0; i<NUM_BUTTONS; i++){
703  if (Buttons[i][gr_screen.res].button.pressed()){
705  return;
706  }
707  }
708  }
709 
710  gr_reset_clip();
711  GR_MAYBE_CLEAR_RES(Background_bitmap);
712  if (Background_bitmap >= 0) {
713  gr_set_bitmap(Background_bitmap);
714  gr_bitmap(0, 0, GR_RESIZE_MENU);
715  }
716 
717  percent = (int) (100.0f - (Credits_artwork_display_time - Credits_counter) * 100.0f / Credits_artwork_fade_time);
718  if (percent < 0){
719  percent = 0;
720  }
721 
722  next = Credits_artwork_index + 1;
723  if (next >= Credits_num_images){
724  next = 0;
725  }
726 
727  if (Credits_bmps[Credits_artwork_index] < 0) {
728  char buf[40];
729 
730  if (gr_screen.res == GR_1024) {
731  sprintf(buf, NOX("2_CrIm%.2d"), Credits_artwork_index);
732  } else {
733  sprintf(buf, NOX("CrIm%.2d"), Credits_artwork_index);
734  }
735  Credits_bmps[Credits_artwork_index] = bm_load(buf);
736  }
737 
738  if (Credits_bmps[next] < 0) {
739  char buf[40];
740 
741  if (gr_screen.res == GR_1024) {
742  sprintf(buf, NOX("2_CrIm%.2d"), next);
743  } else {
744  sprintf(buf, NOX("CrIm%.2d"), next);
745  }
746  Credits_bmps[next] = bm_load(buf);
747  }
748 
749  bm1 = Credits_bmps[Credits_artwork_index];
750  bm2 = Credits_bmps[next];
751 
752  if((bm1 != -1) && (bm2 != -1)){
753  Assert(percent >= 0 && percent <= 100);
754 
755  // get width and height
756  bm_get_info(bm1, &bw1, &bh1, NULL, NULL, NULL);
757  bm_get_info(bm2, &bw2, &bh2, NULL, NULL, NULL);
758 
759  // determine where to draw the coords
764 
765  gr_cross_fade(bm1, bm2, bx1, by1, bx2, by2, (float)percent / 100.0f, GR_RESIZE_MENU);
766  }
767 
768  Ui_window.draw();
769 
770  for (i=TECH_DATABASE_BUTTON; i<=CREDITS_BUTTON; i++){
771  if (Buttons[i][gr_screen.res].button.button_down()){
772  break;
773  }
774  }
775 
776  if (i > CREDITS_BUTTON){
778  }
779 
783 
784  int y_offset = 0;
785  for (SCP_vector<SCP_string>::iterator iter = Credit_text_parts.begin(); iter != Credit_text_parts.end(); ++iter)
786  {
787  int height;
788 
789  gr_get_string_size(NULL, &height, iter->c_str(), iter->length());
790 
791  // Check if the text part is actually visible
792  if (Credit_position + y_offset + height > 0.0f)
793  {
794  extern void gr_opengl_string(float sx, float sy, const char *s, int resize_mode);
795  gr_opengl_string((float)0x8000, Credit_position + y_offset, iter->c_str(), GR_RESIZE_MENU);
796  }
797 
798  y_offset += height;
799  }
800 
801  int temp_time;
802  temp_time = timer_get_milliseconds();
803 
804  Credits_frametime = temp_time - Credits_last_time;
805  Credits_last_time = temp_time;
806  timestamp_inc(Credits_frametime);
807 
808  float fl_frametime = i2fl(Credits_frametime) / 1000.f;
809  if (keyd_pressed[KEY_LSHIFT]) {
810  Credit_position -= fl_frametime * Credits_scroll_rate * 4.0f;
811  } else {
812  Credit_position -= fl_frametime * Credits_scroll_rate;
813  }
814 
817  }
818 
819  Credits_counter += fl_frametime;
820  while (Credits_counter >= Credits_artwork_display_time) {
821  Credits_counter -= Credits_artwork_display_time;
822  Credits_artwork_index = next;
823  }
824 
825  gr_flip();
826 }
void game_flush()
Definition: fredstubs.cpp:83
void set_highlight_action(void(*_user_function)(void))
Definition: button.cpp:375
int timestamp(int delta_ms)
Definition: timer.cpp:226
int i
Definition: multi_pxo.cpp:466
char * fs2_open_credit_text
Definition: credits.cpp:35
void add_XSTR(char *string, int _xstr_id, int _x, int _y, UI_GADGET *_assoc, int _color_type, int _font_id=-1)
Definition: window.cpp:476
void credits_parse()
Definition: credits.cpp:411
#define ASF_MENUMUSIC
Definition: audiostr.h:20
#define KEY_DOWN
Definition: key.h:180
int flags
Definition: player.h:104
GLfloat GLfloat GLfloat GLfloat h
Definition: Glext.h:7280
void gr_flip()
Definition: 2d.cpp:2113
commit pressed
Definition: gamesnd.h:294
#define GR_RESIZE_MENU
Definition: 2d.h:684
credits_screen_buttons(char *name, int x1, int y1, int xt1, int yt1, int h)
Definition: credits.cpp:160
void credits_stop_music(bool fade)
Definition: credits.cpp:223
float Credit_start_pos
Definition: credits.cpp:204
int check_for_string_raw(const char *pstr)
Definition: parselo.cpp:528
void stuff_string_line(char *outstr, int len)
Definition: parselo.cpp:1354
void _cdecl void void _cdecl void _cdecl Warning(char *filename, int line, SCP_FORMAT_STRING const char *format,...) SCP_FORMAT_STRING_ARGS(3
Assert(pm!=NULL)
#define GR_NUM_RESOLUTIONS
Definition: 2d.h:651
#define mprintf(args)
Definition: pstypes.h:238
#define CUTSCENES_BUTTON
Definition: credits.cpp:115
int res
Definition: 2d.h:370
int max_h_unscaled
Definition: 2d.h:361
int bm_get_info(int handle, int *w, int *h, ubyte *flags, int *nframes, int *fps)
Gets info on the bitmap indexed by handle.
Definition: bmpman.cpp:769
#define KEY_LSHIFT
Definition: key.h:134
GLclampf f
Definition: Glext.h:7097
#define NUM_BUTTONS
Definition: credits.cpp:110
#define SIZE_T_ARG
Definition: clang.h:61
#define EXIT_BUTTON
Definition: credits.cpp:117
Definition: credits.cpp:218
#define Assertion(expr, msg,...)
Definition: clang.h:41
#define GR_MAYBE_CLEAR_RES(bmap)
Definition: 2d.h:639
GLenum mode
Definition: Glext.h:5794
void credits_parse_table(const char *filename)
Definition: credits.cpp:281
void key_flush()
Definition: key.cpp:356
void gr_set_color_fast(color *dst)
Definition: 2d.cpp:1197
int Credits_image_coords[GR_NUM_RESOLUTIONS][4]
Definition: credits.cpp:135
Definition: ui.h:195
std::basic_string< char, std::char_traits< char >, std::allocator< char > > SCP_string
Definition: vmallocator.h:21
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
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: Glext.h:7308
int bm_release(int handle, int clear_render_targets)
Frees both a bitmap's data and it's associated slot.
Definition: bmpman.cpp:2603
#define CREDITS_H_COORD
Definition: credits.cpp:123
void stuff_float(float *f)
Definition: parselo.cpp:2328
int audiostream_is_playing(int i)
Definition: audiostr.cpp:1827
void common_set_interface_palette(char *filename)
__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
void destroy()
Definition: window.cpp:189
typedef int(SCP_EXT_CALLCONV *SCPDLL_PFVERSION)(SCPDLL_Version *)
#define gr_reset_clip
Definition: 2d.h:745
void set_mask_bmap(char *fname)
Definition: window.cpp:75
int set_bmaps(char *ani_filename, int nframes=3, int start_frame=1)
Definition: gadget.cpp:71
void credits_start_music()
Definition: credits.cpp:242
void common_free_interface_palette()
#define nprintf(args)
Definition: pstypes.h:239
#define TECH_DATABASE_BUTTON
Definition: credits.cpp:113
char * filename
int pressed()
Definition: button.cpp:325
Switching to a new screen, but not commit.
Definition: gamesnd.h:292
#define KEY_SHIFTED
Definition: key.h:62
void stuff_string(char *outstr, int type, int len, char *terminators)
Definition: parselo.cpp:1189
#define CF_TYPE_TABLES
Definition: cfile.h:50
sprintf(buf,"(%f,%f,%f)", v3->xyz.x, v3->xyz.y, v3->xyz.z)
void credits_do_frame(float frametime)
Definition: credits.cpp:666
#define KEY_ENTER
Definition: key.h:125
#define CREDITS_X_COORD
Definition: credits.cpp:120
GLdouble s
Definition: Glext.h:5321
int credits_screen_button_pressed(int n)
Definition: credits.cpp:253
int split_str(const char *src, int max_pixel_w, int *n_chars, const char **p_str, int max_lines, char ignore_char)
Definition: parselo.cpp:3412
int optional_string(const char *pstr)
Definition: parselo.cpp:539
void gr_opengl_string(float sx, float sy, const char *s, int resize_mode)
void read_file_text(const char *filename, int mode, char *processed_text, char *raw_text)
Definition: parselo.cpp:1995
float Credit_position
Definition: credits.cpp:204
GLclampd n
Definition: Glext.h:7286
#define NOX(s)
Definition: pstypes.h:473
void _cdecl void void _cdecl Error(const char *filename, int line, SCP_FORMAT_STRING const char *format,...) SCP_FORMAT_STRING_ARGS(3
menu_music Spooled_music[MAX_SPOOLED_MUSIC]
Definition: eventmusic.cpp:249
void set_hotkey(int keycode)
Definition: gadget.cpp:280
void reset_parse(char *text)
Definition: parselo.cpp:3305
GLuint const GLchar * name
Definition: Glext.h:5608
int bm_load(const char *real_filename)
Loads a bitmap so we can draw with it later.
Definition: bmpman.cpp:1119
GLboolean GLboolean GLboolean b
Definition: Glext.h:5781
void stuff_int(int *i)
Definition: parselo.cpp:2372
void audiostream_close_file(int i, int fade)
Definition: audiostr.cpp:1772
#define FONT1
Definition: font.h:65
void link_hotspot(int num)
Definition: gadget.cpp:50
GLint GLsizei GLsizei height
Definition: Gl.h:1505
void create(UI_WINDOW *wnd, char *_text, int _x, int _y, int _w, int _h, int do_repeat=0, int ignore_focus=0)
Definition: button.cpp:26
#define KEY_ESC
Definition: key.h:124
#define NAME_LENGTH
Definition: globals.h:15
#define CREDITS_W_COORD
Definition: credits.cpp:122
#define UI_XSTR_COLOR_PINK
Definition: ui.h:161
int button_down()
Definition: button.cpp:363
void create(int _x, int _y, int _w, int _h, int _flags, int _f_id=-1)
Definition: window.cpp:140
player * Player
Definition: ui.h:584
screen gr_screen
Definition: 2d.cpp:46
void gr_get_string_size(int *w, int *h, const char *text, int len=9999)
Definition: font.cpp:196
#define CREDITS_Y_COORD
Definition: credits.cpp:121
void credits_load_music(char *fname)
Definition: credits.cpp:231
CreditsPosition
Definition: credits.cpp:215
void timestamp_inc(int frametime_ms)
Definition: timer.cpp:212
#define F_NAME
Definition: parselo.h:34
ubyte keyd_pressed[NUM_KEYS]
Definition: key.cpp:42
#define LOCATION
Definition: pstypes.h:245
void common_play_highlight_sound()
Definition: gamesnd.cpp:1151
float Master_event_music_volume
Definition: eventmusic.cpp:40
#define timestamp_elapsed(stamp)
Definition: timer.h:102
void audiostream_play(int i, float volume, int looping)
Definition: audiostr.cpp:1803
void ignore_white_space()
Definition: parselo.cpp:77
#define KEY_CTRLED
Definition: key.h:64
color Color_normal
Definition: alphacolors.cpp:28
#define KEY_TAB
Definition: key.h:127
#define gr_cross_fade
Definition: 2d.h:841
#define i2fl(i)
Definition: floating.h:32
char * unmodified_credits
Definition: credits.cpp:107
int Credits_text_coords[GR_NUM_RESOLUTIONS][4]
Definition: credits.cpp:145
int parse_modular_table(const char *name_check, void(*parse_callback)(const char *filename), int path_type, int sort_type)
Definition: parselo.cpp:4205
void gr_bitmap(int _x, int _y, int resize_mode)
Definition: 2d.cpp:1303
#define KEY_UP
Definition: key.h:179
#define UI_XSTR_COLOR_GREEN
Definition: ui.h:160
int event_music_get_spooled_music_index(const char *name)
int temp
Definition: lua.cpp:4996
int audiostream_open(const char *filename, int type)
Definition: audiostr.cpp:1713
#define PLAYER_FLAGS_IS_MULTI
Definition: player.h:42
void credits_close()
Definition: credits.cpp:643
void gamesnd_play_iface(int n)
Definition: gamesnd.cpp:260
#define CREDITS_BUTTON
Definition: credits.cpp:116
void disable()
Definition: gadget.cpp:432
void draw()
Definition: window.cpp:220
void gr_set_font(int fontnum)
Definition: font.cpp:566
char * mod_check
Definition: credits.cpp:108
int process(int key_in=-1, int process_mouse=1)
Definition: window.cpp:401
int timer_get_milliseconds()
Definition: timer.cpp:150
void gameseq_post_event(int event)
#define stricmp(s1, s2)
Definition: config.h:271
#define GR_1024
Definition: 2d.h:653
#define SIMULATOR_BUTTON
Definition: credits.cpp:114
float Credit_stop_pos
Definition: credits.cpp:204
void credits_init()
Definition: credits.cpp:420
#define strcpy_s(...)
Definition: safe_strings.h:67
char filename[MAX_FILENAME_LEN]
Definition: eventmusic.h:66
#define DEFAULT_NUM_IMAGES
Definition: credits.cpp:111