void pilotfile::csg_read_cutscenes() { size_t list_size = cfread_uint(cfp); for(size_t i = 0; i < list_size; i++) { char tempFilename[MAX_FILENAME_LEN]; cfread_string_len(tempFilename, MAX_FILENAME_LEN, cfp); cutscene_mark_viewable(tempFilename); } }
// Play one movie bool movie_play(char *name) { // mark the movie as viewable to the player when in a campaign // do this before anything else so that we're sure the movie is available // to the player even if it's not going to play right now if (Game_mode & GM_CAMPAIGN_MODE) { cutscene_mark_viewable(name); } extern int Mouse_hidden; extern int Is_standalone; if (Cmdline_nomovies || Is_standalone) return false; char full_name[MAX_PATH]; int rc = 0; memset(full_name, 0, sizeof(full_name)); rc = movie_find(name, full_name); if (rc == MOVIE_NONE) { strcpy_s(full_name, name); char *p = strrchr(full_name, '.'); if ( p ) *p = 0; mprintf(("Movie Error: Unable to open '%s' movie in any supported format.\n", full_name)); return false; } // clear the screen and hide the mouse cursor Mouse_hidden++; gr_reset_clip(); gr_set_color(255, 255, 255); gr_set_clear_color(0, 0, 0); gr_zbuffer_clear(0); // clear first buffer gr_clear(); gr_flip(); // clear second buffer (may not be one, but that's ok) gr_clear(); gr_flip(); // clear third buffer (may not be one, but that's ok) gr_clear(); if (rc == MOVIE_OGG) { THEORAFILE *movie_ogg = theora_open(name); if (movie_ogg) { // start playing ... theora_play(movie_ogg); // ... done playing, close the movie theora_close(movie_ogg); } else { // uh-oh, movie is invalid... Abory, Retry, Fail? mprintf(("MOVIE ERROR: Found invalid movie! (%s)\n", name)); Mouse_hidden--; // show the mouse cursor! return false; } } else if (rc == MOVIE_MVE) { MVESTREAM *movie_mve = mve_open(name); if (movie_mve) { // start playing ... mve_init(movie_mve); mve_play(movie_mve); // ... done playing, close the movie mve_shutdown(); mve_close(movie_mve); } else { // uh-oh, movie is invalid... Abory, Retry, Fail? mprintf(("MOVIE ERROR: Found invalid movie! (%s)\n", name)); Mouse_hidden--; // show the mouse cursor! return false; } } // show the mouse cursor again Mouse_hidden--; return true; }