Debian Codegraph @

d2x-rebirth/main/movie.h

raw symbols SCIP
1 /*
2 * Portions of this file are copyright Rebirth contributors and licensed as
3 * described in COPYING.txt.
4 * Portions of this file are copyright Parallax Software and licensed
5 * according to the Parallax license below.
6 * See COPYING.txt for license details.
7
8 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
9 SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
10 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
11 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
12 IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
13 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
14 FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
15 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
16 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
17 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
18 */
19
20 /*
21 *
22 * Header for movie.c
23 *
24 */
25
26 #pragma once
27
28 #include <limits.h>
29 #include <span>
30 #include "d2x-rebirth/libmve/mvelib.h"
31 #include "dsx-ns.h"
32 #include "physfsrwops.h"
33
34 namespace dsx {
35
36 enum class play_movie_warn_missing : bool
37 {
38 verbose,
39 urgent,
40 };
41
42 enum class movie_play_status : bool
43 {
44 skipped, // movie wasn't present
45 started, // movie was present and started; it may or may not have completed
46 };
47
48 enum class movie_resolution : bool
49 {
50 high,
51 low,
52 };
53
54 #if DXX_USE_OGL
55 #define MOVIE_WIDTH (!GameArg.GfxSkipHiresMovie && grd_curscreen->get_screen_width() < 640 ? static_cast<uint16_t>(640) : grd_curscreen->get_screen_width())
56 #define MOVIE_HEIGHT (!GameArg.GfxSkipHiresMovie && grd_curscreen->get_screen_height() < 480 ? static_cast<uint16_t>(480) : grd_curscreen->get_screen_height())
57 #else
58 #define MOVIE_WIDTH static_cast<uint16_t>(!GameArg.GfxSkipHiresMovie? 640 : 320)
59 #define MOVIE_HEIGHT static_cast<uint16_t>(!GameArg.GfxSkipHiresMovie? 480 : 200)
60 #endif
61
62 movie_play_status PlayMovie(std::span<const char> subtitles, const char *filename, play_movie_warn_missing);
63 const MVESTREAM *InitRobotMovie(const char *filename, MVESTREAM_ptr_t &pMovie);
64 int RotateRobot(MVESTREAM *pMovie);
65 void DeInitRobotMovie(MVESTREAM_ptr_t &pMovie);
66
67 struct LoadedMovie
68 {
69 std::array<char, PATH_MAX> pathname;
70 LoadedMovie()
71 {
72 pathname[0] = 0;
73 }
74 ~LoadedMovie();
75 };
76
77 struct LoadedMovieWithResolution : LoadedMovie
78 {
79 movie_resolution resolution;
80 };
81
82 struct BuiltinMovies
83 {
84 std::array<LoadedMovie, 3> movies;
85 BuiltinMovies();
86 };
87
88 // find and initialize the movie libraries
89 [[nodiscard]]
90 std::unique_ptr<BuiltinMovies> init_movies();
91 [[nodiscard]]
92 std::unique_ptr<LoadedMovieWithResolution> init_extra_robot_movie(const char *filename);
93
94 }