coastline 0.0.4
Loading...
Searching...
No Matches
intro.h
Go to the documentation of this file.
1#pragma once
2
8
9#include <cstdint>
10#include <filesystem>
11#include <memory>
12#include <string_view>
13
14#include <nlohmann/json.hpp>
15
16namespace coastline {
17
18class SceneRenderer;
19
22 bool skip = false;
23 bool buildDate = false;
24 bool pauseVideo = false;
25 int seekVideo = 0;
26 bool restartVideo = false;
27};
28
35
37class Intro {
38public:
50 const std::filesystem::path &release,
51 std::string_view region = {},
52 const std::filesystem::path &assets = {},
53 const nlohmann::json &settings = nlohmann::json::object());
57 Intro(const Intro &) = delete;
59 Intro &operator=(const Intro &) = delete;
60
62 void Restart();
63
71 IntroEnd Update(float seconds, const IntroButtons &buttons);
72
78 void Draw(SceneRenderer &renderer) const;
85 void DrawProgress(SceneRenderer &renderer, float width, float height) const;
87 bool ShowsProgress() const;
88
90 bool PlayingVideo() const;
91
92private:
93 struct State;
94 explicit Intro(std::unique_ptr<State> state);
96};
97
98} // namespace coastline
Attract-demo rotation for one front end.
Definition racedemo.h:29
void Restart()
Start the splash screens again from the first logo, fading in.
bool ShowsProgress() const
void DrawProgress(SceneRenderer &renderer, float width, float height) const
Draw pack-sequence progress after screen filters, or omit it for regional splash screens.
Intro(const Intro &)=delete
Prevent copying renderer-bound splash-screen resources.
void Draw(SceneRenderer &renderer) const
Draw the frame.
static std::unique_ptr< Intro > Load(SceneRenderer &renderer, const std::filesystem::path &release, std::string_view region={}, const std::filesystem::path &assets={}, const nlohmann::json &settings=nlohmann::json::object())
Read the models, the lights, the fonts, and the sounds of the splash screens.
Intro & operator=(const Intro &)=delete
Prevent assignment of renderer-bound splash-screen resources.
bool PlayingVideo() const
~Intro()
Release splash-screen resources before their renderer is destroyed.
IntroEnd Update(float seconds, const IntroButtons &buttons)
Advance the splash screens by a frame.
The renderer of a frame.
Definition scenerenderer.h:467
Definition assetimport.h:11
@ Running
Definition setupwizard.h:179
IntroEnd
Where the splash screens go once they fade out.
Definition intro.h:30
@ MainMenu
Definition intro.h:32
The buttons of the first controller that act on the splash screens.
Definition intro.h:21
bool restartVideo
Definition intro.h:26
bool skip
Definition intro.h:22
bool buildDate
Definition intro.h:23
bool pauseVideo
Definition intro.h:24
int seekVideo
Definition intro.h:25