wavelength 1.0.0
Loading...
Searching...
No Matches
tnlcursor.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4
5#include "gfx/gfxtunnel.h"
7#include "gfx/tnlgem.h"
8#include "gfx/tnlgems.h"
9#include "gfx/tnlseeker.h"
10#include "gfx/tnltrackrange.h"
11#include "math/color.h"
12#include "script/dataarray.h"
13
20class TnlCursor {
21public:
28
41 int nPlayer,
42 const char *pszColor,
43 char nExcludedType,
44 char nOtherExcludedType);
45
53
64 void LoadConfig(DataArray *pConfig, DataArray *pDefaults, GfxTunnel *pTunnel, int nOption);
65
72 void Reset();
73
81 void Refresh(int nStyle);
82
96 void SetTarget(char nTrack, TnlGems *pGems, float flStartTick, float flEndTick);
97
105 void OnRangeChanged(const TnlTrackRange *pRange);
106
117 void OnGemAdded(char nTrack, char nType, TnlGems *pGems, float flTick);
118
129 void OnTicksChanged(char nTrack, TnlGems *pGems, float flStartTick, float flEndTick);
130
138 void OnGemRemoved(const TnlGem *pGem);
139
147 void Pulse(float flTick);
148
156 void SetEnergy(float flEnergy);
157
166 void StartMultiplier(TnlGems *pGems, float flEndTick);
167
178 void Poll(bool bCaptured, float flTime, float flDelta);
179
182 return mBeam.get();
183 }
184
187 return mSeeker.get();
188 }
189
191 const Color &GetColor() const {
192 return mColor;
193 }
194
196 float GetTargetStartTick() const {
197 return mTargetStartTick;
198 }
199
201 float GetTargetEndTick() const {
202 return mTargetEndTick;
203 }
204
206 char GetTargetTrack() const {
207 return mTargetTrack;
208 }
209
210private:
211 int mPlayer;
212 GfxTunnel *mTunnel;
213 float mFade;
214 State mState;
215 char mTrack;
216 float mStartTick;
217 float mEndTick;
218 TnlGems *mGems;
219 Color mColor;
220 float mTargetStartTick;
221 float mTargetEndTick;
222 char mTargetTrack;
223 std::unique_ptr<TnlConnectorBeam> mBeam;
224 std::unique_ptr<TnlSeeker> mSeeker;
225};
Reference-counted array of script data nodes.
Definition dataarray.h:20
Tunnel of tracks the players fly down, with the gems, the cameras of the players, and the effects dra...
Definition gfxtunnel.h:58
The beam that links the gems ahead of a player's cursor on its track.
Definition tnlconnectorbeam.h:24
void Refresh(int nStyle)
Retarget the pending window with no gems and no length.
void SetEnergy(float flEnergy)
Set the energy of the beam.
char GetTargetTrack() const
Definition tnlcursor.h:206
TnlCursor(GfxTunnel *pTunnel, int nPlayer, const char *pszColor, char nExcludedType, char nOtherExcludedType)
Create the beam and the frame of a player.
void SetTarget(char nTrack, TnlGems *pGems, float flStartTick, float flEndTick)
Move the cursor to a window.
TnlSeeker * GetSeeker() const
Definition tnlcursor.h:186
void OnTicksChanged(char nTrack, TnlGems *pGems, float flStartTick, float flEndTick)
Pass a changed span of ticks to the beam.
void LoadConfig(DataArray *pConfig, DataArray *pDefaults, GfxTunnel *pTunnel, int nOption)
Load the settings of the beam, the frame, and the fade, and take the colour of the player.
TnlConnectorBeam * GetBeam() const
Definition tnlcursor.h:181
float GetTargetEndTick() const
Definition tnlcursor.h:201
void Pulse(float flTick)
Pulse the beam on a beat.
const Color & GetColor() const
Definition tnlcursor.h:191
void OnGemAdded(char nTrack, char nType, TnlGems *pGems, float flTick)
Pass a new gem to the beam.
State
Values of mState.
Definition tnlcursor.h:23
@ kStateFadingIn
Definition tnlcursor.h:25
@ kStateFadingOut
Definition tnlcursor.h:26
@ kStateIdle
Definition tnlcursor.h:24
float GetTargetStartTick() const
Definition tnlcursor.h:196
void OnRangeChanged(const TnlTrackRange *pRange)
Pass a changed range of the tunnel to the beam and the frame.
~TnlCursor()
Delete the frame and the beam.
void OnGemRemoved(const TnlGem *pGem)
Pass a removed gem to the beam.
void Poll(bool bCaptured, float flTime, float flDelta)
Advance the fade, the beam, and the frame.
void StartMultiplier(TnlGems *pGems, float flEndTick)
Start the multiplier colouring of the beam and the frame.
void Reset()
Reset the beam and the frame, and forget the last target.
One gem on a track of the tunnel, 0x24 bytes.
Definition tnlgem.h:22
The gems of the tunnel, with the groups that draw them.
Definition tnlgems.h:25
The frame that marks the gems ahead of a player's cursor on its track.
Definition tnlseeker.h:22
A run of tracks over a span of ticks, which the tunnel reports when the region changes.
Definition tnltrackrange.h:8
Linear colour with four float components.
Definition color.h:12