resonance 1.0.1
Loading...
Searching...
No Matches
tnlgemmanager.h
Go to the documentation of this file.
1#pragma once
2
3#include <list>
4#include <vector>
5
6#include "app/tnlgem.h"
7
8class AppTunnel;
9class HxStr;
11class TnlGemMeshKind;
12namespace Rnd {
13class Drawable;
14} // namespace Rnd
15
28public:
30 enum { kEffectKindBase = 0x40 };
31
40 TnlGemManager(AppTunnel *pTunnel, float flCostBudget);
41
51
66 char AddMeshKind(const char *pszName, float flLodOffset, float flCostScale);
67
76 char AddEffectKind(const char *pszName);
77
88 void Add(const TnlGem &gem);
89
99 void RemoveRange(char nTrack, float flStart, float flEnd);
100
110 void Remove(char nTrack, float flFrame, float flBlend);
111
125 void Update(float flFrame);
126
136
146
157 void AddKindDraws(char nKind, Rnd::Drawable *pParent);
158
170 void SetKindShowing(char nKind, int nShowing);
171
172private:
173 // AppTunnel's PlaybackToggleMsg handler walks mGems to reassign each gem's kind.
174 friend class AppTunnel;
175
182 static std::list<TnlGem>::iterator FindFirstAt(std::list<TnlGem> &gems, float flFrame);
183
184 std::vector<TnlGemMeshKind *> mMeshKinds; // Every level, each kind from its own index.
185 std::vector<TnlGemEffectKind *> mEffectKinds; // Every effect kind.
186 std::list<TnlGem> mGems; // Sorted by TnlGem::mFrame.
187 AppTunnel *mTunnel; // Owner of the flash particles.
188 float mCostBudget; // Cost Update() places gems up to per frame.
189 float mLateWindow; // Frames behind the playhead a gem is kept.
190 int mMaxPlaced; // Gems Update() places at most per frame.
191};
192
204
211extern int g_nTnlMeshNameCounter;
212
221extern float g_flTnlGemLastFrame;
Game-side driver of the tunnel the in-game renderer draws.
Definition apptunnel.h:88
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
Mix-in for an object that draws itself and then a list of other drawables.
Definition drawable.h:32
A gem kind that TnlGemManager draws as one particle of a particle system per gem.
Definition tnlgemeffectkind.h:15
void AddKindDraws(char nKind, Rnd::Drawable *pParent)
Add every level of one mesh gem kind to a drawable.
~TnlGemManager()
Delete every gem kind.
void Update(float flFrame)
Drop the gems the playhead has passed and place the rest within the budget.
TnlGemManager(AppTunnel *pTunnel, float flCostBudget)
Start with no gem kind and no gem.
void SetKindShowing(char nKind, int nShowing)
Show or hide every level of one mesh gem kind.
void Add(const TnlGem &gem)
Insert a copy of a gem after every gem at or before its frame.
void Remove(char nTrack, float flFrame, float flBlend)
Release and remove every gem at one frame, ring, and position.
char AddEffectKind(const char *pszName)
Register one effect gem kind from "<pszName>.ps".
char AddMeshKind(const char *pszName, float flLodOffset, float flCostScale)
Register every level of detail of one mesh gem kind.
void RemoveRange(char nTrack, float flStart, float flEnd)
Release and remove every gem of one ring from flStart up to flEnd.
TnlGemMeshKind * GetMeshKind(char nKind)
Report the finest level of one mesh gem kind.
friend class AppTunnel
Definition tnlgemmanager.h:174
@ kEffectKindBase
Definition tnlgemmanager.h:30
TnlGemEffectKind * GetEffectKind(char nKind)
Report one effect gem kind.
One level of detail of a gem kind that TnlGemManager draws as instances of a multi-mesh.
Definition tnlgemmeshkind.h:16
One gem on the tunnel, as TnlGemManager keeps it sorted by mFrame.
Definition tnlgem.h:28
The rendering engine.
Definition animhelper.h:3
float g_flTnlGemLastFrame
The tunnel frame TnlGemManager::Update() last ran for.
HxStr NextTnlMeshName()
Create the next name of the form "<tnlmesh0000>".
int g_nTnlMeshNameCounter
The number of the last NextTnlMeshName() name.