wavelength 1.0.0
Loading...
Searching...
No Matches
ovysongpos.h
Go to the documentation of this file.
1#pragma once
2
3#include <list>
4#include <memory>
5
6#include "app/hideablepanel.h"
7#include "math/vector3.h"
8#include "rnd/rndanimatable.h"
9#include "rnd/rnddrawable.h"
10#include "rnd/rndmesh.h"
11#include "rnd/rndtext.h"
13#include "rnd/rndview.h"
14
20class OvySongPos : public HideablePanel {
21public:
23 struct Section {
32 bool operator<(float fPos) const {
33 return mPos < fPos;
34 }
35
36 float mPos;
37 std::unique_ptr<RndText> mText;
38 };
39
52 explicit OvySongPos(RndView *pHudView);
53
60 ~OvySongPos() override {
62 }
63
72 void AddCheckpoint(float fPos, const char *pszLabel);
73
81
88 void Reset();
89
97 void SetFuture(float fFuture);
98
105 void Poll();
106
113 void Draw();
114
121
128
135 static int sNumLabels;
136
137private:
138 RndView *mView;
139 RndMesh *mCheckpointMesh;
140 RndTransformable *mFuture;
141 RndDrawable *mShip;
142 RndAnimatable *mFutureAnim;
143 RndText *mLabelTemplate;
144 std::list<Section> mCheckpoints;
145};
HideablePanel(const char *pszAnim, const char *pszDrawable, bool bShown)
Construct a panel and find its animation and drawable.
void SetFuture(float fFuture)
Pose the future part of the bar.
~OvySongPos() override
Destroy the bar and its checkpoint labels.
Definition ovysongpos.h:60
static Vector3 sEndPos
The place of the end of the bar, song_pos_end_pos.
Definition ovysongpos.h:127
void AddCheckpoint(float fPos, const char *pszLabel)
Add a checkpoint marker, unless one is already at the place.
void ClearCheckpoints()
Remove every checkpoint marker and its label.
OvySongPos(RndView *pHudView)
Construct a hidden bar and find its scene objects.
static int sNumLabels
The number of checkpoint labels created, which numbers their names.
Definition ovysongpos.h:135
void Reset()
Remove the checkpoints and empty the future part of the bar.
static Vector3 sStartPos
The place of the start of the bar, song_pos_start_pos.
Definition ovysongpos.h:120
void Draw()
Draw the bar, the checkpoints, and the ship while the bar is not hidden.
void Poll()
Advance the slide.
Mix-in for an object driven by a frame.
Definition rndanimatable.h:16
Mix-in for an object that draws itself and then a list of other drawables.
Definition rnddrawable.h:16
Triangle mesh with a material.
Definition rndmesh.h:31
Text drawn with a bitmap font as a mesh of one quad per character.
Definition rndtext.h:27
Mix-in for an object with a local transform and a world transform derived from its parent's.
Definition rndtransformable.h:17
View that shows the children of another view, its children owner, under its own transform and frame.
Definition rndview.h:27
One checkpoint marker.
Definition ovysongpos.h:23
float mPos
Definition ovysongpos.h:36
bool operator<(float fPos) const
Order a checkpoint before a place on the bar.
Definition ovysongpos.h:32
std::unique_ptr< RndText > mText
Definition ovysongpos.h:37
Three-component vector, padded to a PlayStation 2 quadword.
Definition vector3.h:14