coastline 0.0.4
Loading...
Searching...
No Matches
coastline::IntroSequence Class Reference

An ordered asset-pack sequence of images, movies, and static models. More...

#include <introsequence.h>

Public Member Functions

 ~IntroSequence ()
 Release current sequence resources before renderer destruction.
 IntroSequence (const IntroSequence &)=delete
 Prevent copying renderer-bound resources.
IntroSequence & operator= (const IntroSequence &)=delete
 Prevent assigning renderer-bound resources.
void Restart ()
 Start again at the first available entry.
bool Update (float seconds, bool skip)
 Advance playback and optionally skip the current entry.
void ControlVideo (bool pause, int seek, bool restart)
 Control the current movie without affecting image or model entries.
void Draw () const
 Draw the current entry, preserving image and movie aspect ratios.
void DrawProgress (SceneRenderer &renderer, float width, float height) const
 Draw movie or timed-image progress along the bottom of the output area, fitted to the requested aspect ratio.
bool ShowsProgress () const
bool PlayingVideo () const

Static Public Member Functions

static std::unique_ptr< IntroSequence > Load (SceneRenderer &renderer, const std::filesystem::path &assets, const nlohmann::json &entries, const nlohmann::json &settings)
 Validate a pack sequence and resolve its files relative to prepared assets.

Detailed Description

An ordered asset-pack sequence of images, movies, and static models.

Constructor & Destructor Documentation

◆ ~IntroSequence()

coastline::IntroSequence::~IntroSequence ( )

Release current sequence resources before renderer destruction.

◆ IntroSequence()

coastline::IntroSequence::IntroSequence ( const IntroSequence & )
delete

Prevent copying renderer-bound resources.

Member Function Documentation

◆ Load()

std::unique_ptr< IntroSequence > coastline::IntroSequence::Load ( SceneRenderer & renderer,
const std::filesystem::path & assets,
const nlohmann::json & entries,
const nlohmann::json & settings )
static

Validate a pack sequence and resolve its files relative to prepared assets.

Parameters
rendererThe renderer used for sequence resources.
assetsThe prepared, layered asset directory.
entriesUp to 64 entry objects with required type and file settings and optional duration, skippable, scale, and depth settings.
settingsAsset-pack settings, including optional videoControls preferences.
Returns
The sequence, or null for an invalid definition.

◆ operator=()

IntroSequence & coastline::IntroSequence::operator= ( const IntroSequence & )
delete

Prevent assigning renderer-bound resources.

◆ Restart()

void coastline::IntroSequence::Restart ( )

Start again at the first available entry.

◆ Update()

bool coastline::IntroSequence::Update ( float seconds,
bool skip )

Advance playback and optionally skip the current entry.

Parameters
secondsElapsed frame time in seconds, clamped to [0, 0.25]; non-finite values are ignored.
skipWhether a skip button was pressed during the frame.
Returns
Whether an entry remains active.

◆ ControlVideo()

void coastline::IntroSequence::ControlVideo ( bool pause,
int seek,
bool restart )

Control the current movie without affecting image or model entries.

Parameters
pauseWhether to toggle pause.
seekSeek direction, negative for backward and positive for forward.
restartWhether to restart the movie, taking precedence over seeking.

◆ Draw()

void coastline::IntroSequence::Draw ( ) const

Draw the current entry, preserving image and movie aspect ratios.

◆ DrawProgress()

void coastline::IntroSequence::DrawProgress ( SceneRenderer & renderer,
float width,
float height ) const

Draw movie or timed-image progress along the bottom of the output area, fitted to the requested aspect ratio.

Parameters
rendererThe overlay renderer, between Begin() and RenderInto().
widthOutput width in pixels.
heightOutput height in pixels; the bar is two pixels high.

◆ ShowsProgress()

bool coastline::IntroSequence::ShowsProgress ( ) const
Returns
Whether the active movie or timed image has a progress bar enabled.

◆ PlayingVideo()

bool coastline::IntroSequence::PlayingVideo ( ) const
Returns
Whether current movie audio replaces menu music.

The documentation for this class was generated from the following file: