resonance 1.0.1
Loading...
Searching...
No Matches
hudpoints.h
Go to the documentation of this file.
1#pragma once
2
3#include "app/animhelper.h"
4
5namespace Rnd {
6class Blur;
7class Mat;
8class Text;
9class View;
10} // namespace Rnd
11
22class HudPoints {
23public:
32 HudPoints(int nIndex);
33
45 void SetFrame(float flTime);
46
57 void ShowExit(int nPoints);
58
67 void Bank();
68
77 void Pulse(float flFraction) {
78 mPulseRest = flFraction;
79 mPulse = flFraction + kPulseLift;
80 mFlash = kFullFlash;
81 }
82
92 void SetPoints(int nPoints);
93
104 void SetMultiplier(int nMultiplier);
105
106private:
107 // The amount Pulse() lifts the pulse above its resting fraction.
108 static constexpr float kPulseLift = 0.25f;
109 // The flash at a change.
110 static constexpr float kFullFlash = 1.0f;
111
112 // The flash, 1 at a change and falling by 0.2 each frame to 0.
113 float mFlash;
114 // The pulse, falling by 0.05 each frame to mPulseRest.
115 float mPulse;
116 float mPulseRest;
117 // The multiplier SetMultiplier() last showed. Starts at 1.
118 int mMultiplier;
119 // The points SetPoints() last showed.
120 int mPoints;
121 // Non-zero while points are shown.
122 int mShowing;
123
124public:
131 int mHot;
132
133private:
134 Rnd::View *mExitView; // `pts_exit<n>.view`
135 Rnd::Text *mExitText; // `pts_exit<n>.txt`
136 Rnd::Blur *mExitBlur; // `pts_exit<n>.blur`
137 Rnd::Text *mPointsText; // `pts<n>.txt`
138 Rnd::Text *mMultiplierText; // `ptsmult<n>.txt`
139 Rnd::Mat *mPlainMat; // `HUD ptstmp.mat`
140 Rnd::Mat *mHotMat; // `HUD ptstmphot.mat`
141 int mUnusedWord; // +0x38 Zeroed by the constructor and never read.
142 // The exit animation.
143 AnimHelper mExit;
144};
One run of an animation between two frames, played against a running time.
Definition animhelper.h:18
void Bank()
Send the points shown out through the exit animation, if any are shown, and hide the text.
void SetPoints(int nPoints)
Show a points total and start its flash from zero.
void Pulse(float flFraction)
Flash the readout and pulse it to a fraction of a phrase.
Definition hudpoints.h:77
void SetFrame(float flTime)
Advance the exit animation, apply the pulse and flash, and let both decay.
int mHot
Selects the hot material for the multiplier text.
Definition hudpoints.h:131
void SetMultiplier(int nMultiplier)
Show a multiplier as x<n>, visible only above 1.
HudPoints(int nIndex)
Resolve the readout's objects, arm the exit animation at frame 100, and hide both texts.
void ShowExit(int nPoints)
Show banked points exiting the readout.
Motion trail that redraws one drawable at the transforms it recently occupied.
Definition blur.h:39
Surface description a Rnd::Mesh draws with.
Definition mat.h:36
Run of text drawn as a quad per glyph.
Definition text.h:57
Root of a loadable scene.
Definition view.h:47
The rendering engine.
Definition animhelper.h:3