Monopoly — Portage moderne 0.1.0
Portage moderne C/C++23 du Monopoly de 1999
Loading...
Searching...
No Matches
OpeningMoviePresentation.hpp
Go to the documentation of this file.
1#pragma once
2#include "LegacyBitmap.hpp"
3#include "DataBanks.hpp"
4#include <array>
5#include <expected>
6#include <functional>
7#include <optional>
8#include <string>
9#include <string_view>
10namespace monopoly::engine { class SequencePlayback; }
12{
13 using MovieRect = std::array<int,4>;
14 using HintRasterizer = std::function<std::expected<data::LegacyBitmapRGBA8,std::string>(std::string_view)>;
15 // Optional decoration only: the movie aperture stays transparent, its native owner unchanged.
16 [[nodiscard]] std::expected<data::LegacyBitmapRGBA8,std::string> movieBackdrop(
19 {
20 public:
21 static constexpr unsigned Priority = 1099; // OpeningMovies movie priority is1100.
22 [[nodiscard]] std::expected<void,std::string> sync(
23 std::optional<MovieRect> movie, const HintRasterizer& rasterize, engine::SequencePlayback& playback);
24 [[nodiscard]] std::expected<void,std::string> reset(engine::SequencePlayback& playback);
25 [[nodiscard]] bool active() const noexcept { return surface_.has_value(); }
26 private:
27 std::optional<data::DataId> surface_;
28 std::optional<MovieRect> rectangle_;
29 };
30}
unsigned index
std::expected< void, std::string > reset(engine::SequencePlayback &playback)
std::expected< void, std::string > sync(std::optional< MovieRect > movie, const HintRasterizer &rasterize, engine::SequencePlayback &playback)
std::function< std::expected< data::LegacyBitmapRGBA8, std::string >(std::string_view)> HintRasterizer
std::expected< data::LegacyBitmapRGBA8, std::string > movieBackdrop(MovieRect movie, const HintRasterizer &rasterize)