resonance 1.0.1
Loading...
Searching...
No Matches
TnlGemManager Class Reference

Keeper of every gem on the tunnel, which it draws within a per-frame cost budget. More...

#include <tnlgemmanager.h>

Public Types

enum  { kEffectKindBase = 0x40 }
 The first kind AddEffectKind() returns, and the bit that marks an effect kind. More...

Public Member Functions

 TnlGemManager (AppTunnel *pTunnel, float flCostBudget)
 Start with no gem kind and no gem.
 ~TnlGemManager ()
 Delete every gem kind.
char AddMeshKind (const char *pszName, float flLodOffset, float flCostScale)
 Register every level of detail of one mesh gem kind.
char AddEffectKind (const char *pszName)
 Register one effect gem kind from "<pszName>.ps".
void Add (const TnlGem &gem)
 Insert a copy of a gem after every gem at or before its frame.
void RemoveRange (char nTrack, float flStart, float flEnd)
 Release and remove every gem of one ring from flStart up to flEnd.
void Remove (char nTrack, float flFrame, float flBlend)
 Release and remove every gem at one frame, ring, and position.
void Update (float flFrame)
 Drop the gems the playhead has passed and place the rest within the budget.
TnlGemMeshKind * GetMeshKind (char nKind)
 Report the finest level of one mesh gem kind.
TnlGemEffectKind * GetEffectKind (char nKind)
 Report one effect gem kind.
void AddKindDraws (char nKind, Rnd::Drawable *pParent)
 Add every level of one mesh gem kind to a drawable.
void SetKindShowing (char nKind, int nShowing)
 Show or hide every level of one mesh gem kind.

Friends

class AppTunnel

Detailed Description

Keeper of every gem on the tunnel, which it draws within a per-frame cost budget.

The class is not polymorphic and emits no RTTI. No descriptor, tag, or file path identifies it, and its name is inferred from what it manages. AppTunnel's constructor allocates it (0x2c bytes, untagged) at 0x00443540, stores it at AppTunnel +0x84, and registers every gem kind through AddMeshKind() and AddEffectKind(). AppTunnel's destructor deletes it at 0x00445790.

A gem kind below kEffectKindBase indexes mMeshKinds, and a kind at or above it indexes mEffectKinds after kEffectKindBase is subtracted.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

The first kind AddEffectKind() returns, and the bit that marks an effect kind.

Enumerator
kEffectKindBase 

Constructor & Destructor Documentation

◆ TnlGemManager()

TnlGemManager::TnlGemManager ( AppTunnel * pTunnel,
float flCostBudget )

Start with no gem kind and no gem.

Parameters
pTunnelThe tunnel that owns the manager.
flCostBudgetThe drawing cost Update() places gems up to in one frame.
Ghidra address:
NTSC-U/C: 0x004122c0
Ghidra address:
PAL: 0x0044bdc0

◆ ~TnlGemManager()

TnlGemManager::~TnlGemManager ( )

Delete every gem kind.

The gems are dropped without Release().

Ghidra address:
NTSC-U/C: 0x00412490
Ghidra address:
PAL: 0x0044bf90

Member Function Documentation

◆ AddMeshKind()

char TnlGemManager::AddMeshKind ( const char * pszName,
float flLodOffset,
float flCostScale )

Register every level of detail of one mesh gem kind.

Looks up "<pszName>0.mm", "<pszName>1.mm", and so on until a name is missing or not a multi-mesh, and links the levels found from the first to the last through TnlGemMeshKind::mNext.

Parameters
pszNameThe base name, such as "gem_hex_g".
flLodOffsetThe frames added to every level's threshold.
flCostScaleThe cost of one triangle.
Returns
The kind of the first level, the number of levels registered before the call.
Ghidra address:
NTSC-U/C: 0x00412628
Ghidra address:
PAL: 0x0044c128

◆ AddEffectKind()

char TnlGemManager::AddEffectKind ( const char * pszName)

Register one effect gem kind from "<pszName>.ps".

Parameters
pszNameThe base name, such as "gem_drum".
Returns
The kind, kEffectKindBase plus the number of effect kinds registered before the call.
Ghidra address:
NTSC-U/C: 0x00412878
Ghidra address:
PAL: 0x0044c3a0

◆ Add()

void TnlGemManager::Add ( const TnlGem & gem)

Insert a copy of a gem after every gem at or before its frame.

Every gem already at the same frame, ring, and position expires at the new gem's mAppearFrame.

Parameters
gemThe gem.
Ghidra address:
NTSC-U/C: 0x00412968
Ghidra address:
PAL: 0x0044c490

◆ RemoveRange()

void TnlGemManager::RemoveRange ( char nTrack,
float flStart,
float flEnd )

Release and remove every gem of one ring from flStart up to flEnd.

Parameters
nTrackThe ring.
flStartThe first frame removed.
flEndThe frame the removal stops before.
Ghidra address:
NTSC-U/C: 0x00412b18
Ghidra address:
PAL: 0x0044c640

◆ Remove()

void TnlGemManager::Remove ( char nTrack,
float flFrame,
float flBlend )

Release and remove every gem at one frame, ring, and position.

Parameters
nTrackThe ring.
flFrameThe frame.
flBlendThe position across the ring.
Ghidra address:
NTSC-U/C: 0x00412c50
Ghidra address:
PAL: 0x0044c778

◆ Update()

void TnlGemManager::Update ( float flFrame)

Drop the gems the playhead has passed and place the rest within the budget.

A gem more than mLateWindow frames behind the playhead, or past its mExpireFrame, is released and removed. A pending flash starts 20 frames before its gem. Visible gems are placed in frame order until mCostBudget or mMaxPlaced is used up, and the rest release their drawing resources. mMaxPlaced then shrinks to the number placed, or grows by one when the limit was reached. AppTunnel::SetFrame() calls it at 0x00446a08.

Parameters
flFrameThe tunnel frame of the playhead.
Ghidra address:
NTSC-U/C: 0x00412db0
Ghidra address:
PAL: 0x0044c8d8

◆ GetMeshKind()

TnlGemMeshKind * TnlGemManager::GetMeshKind ( char nKind)

Report the finest level of one mesh gem kind.

Parameters
nKindThe kind.
Returns
The level.
Ghidra address:
NTSC-U/C: 0x00415a50
Ghidra address:
PAL: 0x0044f5a0

◆ GetEffectKind()

TnlGemEffectKind * TnlGemManager::GetEffectKind ( char nKind)

Report one effect gem kind.

Parameters
nKindThe kind, kEffectKindBase or above.
Returns
The kind record.
Ghidra address:
NTSC-U/C: 0x00415a68
Ghidra address:
PAL: 0x0044f5b8

◆ AddKindDraws()

void TnlGemManager::AddKindDraws ( char nKind,
Rnd::Drawable * pParent )

Add every level of one mesh gem kind to a drawable.

Does nothing for an effect kind. AppTunnel::ShowTrackGhost() calls it at 0x00457450.

Parameters
nKindThe kind.
pParentThe drawable to add to, or null.
Ghidra address:
NTSC-U/C: 0x00415a88
Ghidra address:
PAL: 0x0044f5d8

◆ SetKindShowing()

void TnlGemManager::SetKindShowing ( char nKind,
int nShowing )

Show or hide every level of one mesh gem kind.

Does nothing for an effect kind. AppTunnel calls it at 0x00443880, 0x00446514, and 0x00457468.

Parameters
nKindThe kind.
nShowingNon-zero to show.
Ghidra address:
NTSC-U/C: 0x00415af8
Ghidra address:
PAL: 0x0044f648

◆ AppTunnel

friend class AppTunnel
friend

The documentation for this class was generated from the following file: