| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 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, |
| 45 |
started, |
| 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 |
|
| 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 |
} |