resonance 1.0.1
Loading...
Searching...
No Matches
metfade.h
Go to the documentation of this file.
1#pragma once
2
3#include "met/metrenderer.h"
4#include "rnd/mesh.h"
5
6class FadeUser;
7
29class MetFade {
30public:
32 enum State {
36 };
37
49 MetFade(MetRenderer *pRenderer);
50
65 void FadeOut(float duration, float start, FadeUser *pUser, int nRetainView);
66
81 void FadeIn(float duration, float start, FadeUser *pUser, int nRetainView);
82
92 void Update(float frame);
93
94#ifdef VIDEO_STANDARD_PAL
102 void Detach();
103
111 void ShowOpaque();
112
121 float GetCoverage() const;
122#endif
123
124private:
136 void UpdateOut(float frame);
148 void UpdateIn(float frame);
149
150 float outStart_; // 1.0e9 while no fade out runs.
151 float outEnd_;
152 float inStart_; // 1.0e9 while no fade in runs.
153 float inEnd_;
154 float rate_; // The slope of the alpha ramp, one over the span.
155 float offset_; // The ramp's value at frame 0.
156 int retainView_;
157 Rnd::Mesh *rect_; // The object named `metfade.rect`.
158 int state_; // A State value.
159 FadeUser *user_;
160 MetRenderer *renderer_;
161};
Mix-in for an object that takes part in a screen fade.
Definition fadeuser.h:28
State
The fade in progress.
Definition metfade.h:32
@ kStateOut
Definition metfade.h:34
@ kStateIdle
Definition metfade.h:33
@ kStateIn
Definition metfade.h:35
void FadeIn(float duration, float start, FadeUser *pUser, int nRetainView)
Start the fade in, the one a screen runs as it enters.
void FadeOut(float duration, float start, FadeUser *pUser, int nRetainView)
Start the fade out, the one a screen runs as it departs.
void Update(float frame)
Advance whichever fade is running.
MetFade(MetRenderer *pRenderer)
Resolve the fade rectangle and prime the two timers.
Front-end renderer that owns the screen stack and drives every MetScreen.
Definition metrenderer.h:68
Indexed triangle mesh with one material.
Definition mesh.h:46