wavelength 1.0.0
Loading...
Searching...
No Matches
TnlGems Class Reference

The gems of the tunnel, with the groups that draw them. More...

#include <tnlgems.h>

Public Member Functions

 TnlGems (GfxTunnel *pTunnel, int nMaxGems, int nNumTracks)
 Construct an empty set of gems with a pool of instance transforms.
 ~TnlGems ()
 Delete the groups and the animations the gems created.
char AddMeshGroups (const char *pszName, const char *pszDrawParent, float flLookahead)
 Add one mesh group for each multimesh <name><n>.mm, chained in that order.
char AddCompositeMeshGroups (const char *pszName, const char *pszDrawParent, float flLookahead)
 Add one composite mesh group for each multimesh <name>_<n>.mm, chained in that order.
char AddSpriteGroup (const char *pszName)
 Add a sprite group for the particle system <name>.ps.
void AddRotations (char nType, int nKeys, int bLoop, RndAnimatable *pParent, float flStartFrame, float flStartAngle, float flEndFrame, float flEndAngle)
 Add an animation that turns each mesh of the groups of a gem type.
void ClearInstances (const char *pszName)
 Empty the instances of each multimesh <name><n>.mm.
MeshGroup * GetMeshGroup (char nType)
 Report the first mesh group of a gem type.
SpriteGroup * GetSpriteGroup (char nType)
 Report the sprite group of a gem type.
void AddGem (char nTrack, char nType, char nSlot, int bFlash, char nColor, float flTick, float flShowTick)
 Add a gem, and set the removal of a gem of the same tick, slot, and track to its show tick.
void RemoveGems (char nTrack, float flStartTick, float flEndTick)
 Remove the gems of a track over a span of ticks.
void RemoveGem (char nTrack, char nSlot, float flTick)
 Remove the gems of a tick, slot, and track.
void Clear ()
 Remove every gem.
void Poll (const TnlTrackRange *pRange)
 Drop the gems behind the song and far ahead of it, fire the events of the gems that pass, and place the gems that show.
void DrawComposites ()
 Draw the composite mesh groups, each mesh through the multimesh in turn.
std::list< TnlGem >::iterator LowerBound (float flTick)
 Find the first gem at or after a tick.
std::list< TnlGem >::iterator Find (float flTick)
 Find the first gem at or after a tick.
std::list< TnlGem > & GetGemList ()
void SetFocusTrack (char nTrack)
 Set the track whose passing gems fire hit events.
void SetHasFocusTrack (int bHasFocusTrack)
 Set whether the focus track applies.

Static Public Member Functions

static void LoadConfig (DataArray *pConfig, DataArray *pDefaults, GfxTunnel *pTunnel, int nOption)
 Load the shared settings of the gems.
static void ApplyRenderScales ()
 Scale the meshes and particle systems of the gems by the world length of a tick.

Detailed Description

The gems of the tunnel, with the groups that draw them.

The class is not polymorphic, and the name is inferred. The object is 0x4c bytes. The mesh groups are indexed by gem type, and the sprite groups by gem type less TnlGem::kTypeSprite.

Constructor & Destructor Documentation

◆ TnlGems()

TnlGems::TnlGems ( GfxTunnel * pTunnel,
int nMaxGems,
int nNumTracks )

Construct an empty set of gems with a pool of instance transforms.

Parameters
pTunnelThe tunnel.
nMaxGemsThe most gems placed at once.
nNumTracksThe number of tracks. The constructor does not read it.
Ghidra address:
NTSC-U/C: 0x001f4528
Ghidra address:
PAL: 0x001fd2c8

◆ ~TnlGems()

TnlGems::~TnlGems ( )

Delete the groups and the animations the gems created.

Ghidra address:
NTSC-U/C: 0x001f4748
Ghidra address:
PAL: 0x001fd4e8

Member Function Documentation

◆ LoadConfig()

void TnlGems::LoadConfig ( DataArray * pConfig,
DataArray * pDefaults,
GfxTunnel * pTunnel,
int nOption )
static

Load the shared settings of the gems.

Parameters
pConfigThe configuration.
pDefaultsThe defaults of the configuration.
pTunnelThe tunnel. The routine does not read it.
nOptionThe fourth argument every loader of the tunnel receives. The routine does not read it.
Ghidra address:
NTSC-U/C: 0x001f4930
Ghidra address:
PAL: 0x001fd6d0

◆ AddMeshGroups()

char TnlGems::AddMeshGroups ( const char * pszName,
const char * pszDrawParent,
float flLookahead )

Add one mesh group for each multimesh <name><n>.mm, chained in that order.

Parameters
pszNameThe prefix of the multimeshes.
pszDrawParentThe drawable the multimeshes draw under, or null.
flLookaheadThe ticks beyond the minimum screen size of a mesh the group draws to.
Returns
The gem type of the first group.
Ghidra address:
NTSC-U/C: 0x001f4ae8
Ghidra address:
PAL: 0x001fd888

◆ AddCompositeMeshGroups()

char TnlGems::AddCompositeMeshGroups ( const char * pszName,
const char * pszDrawParent,
float flLookahead )

Add one composite mesh group for each multimesh <name>_<n>.mm, chained in that order.

The meshes of group n are <name><letter>_<n>.mesh from a on, and the glow particles are <name>.ps.

Parameters
pszNameThe prefix of the multimeshes.
pszDrawParentThe drawable the multimeshes draw under, or null.
flLookaheadThe ticks beyond the minimum screen size of a mesh the group draws to.
Returns
The gem type of the first group.
Ghidra address:
NTSC-U/C: 0x001f4dc8
Ghidra address:
PAL: 0x001fdb68

◆ AddSpriteGroup()

char TnlGems::AddSpriteGroup ( const char * pszName)

Add a sprite group for the particle system <name>.ps.

Parameters
pszNameThe name of the particle system, without its extension.
Returns
The gem type of the group.
Ghidra address:
NTSC-U/C: 0x001f5278
Ghidra address:
PAL: 0x001fe018

◆ AddRotations()

void TnlGems::AddRotations ( char nType,
int nKeys,
int bLoop,
RndAnimatable * pParent,
float flStartFrame,
float flStartAngle,
float flEndFrame,
float flEndAngle )

Add an animation that turns each mesh of the groups of a gem type.

A mesh that already has its animation <mesh> rot.msnm is passed over.

Parameters
nTypeThe gem type.
nKeysThe number of keys of each animation.
bLoopWhether the animations loop between their first and last frames.
pParentThe animatable the animations run under.
flStartFrameThe frame of the first key.
flStartAngleThe angle of the first key, in radians.
flEndFrameThe frame of the last key.
flEndAngleThe angle of the last key, in radians.
Ghidra address:
NTSC-U/C: 0x001f5438
Ghidra address:
PAL: 0x001fe1d8

◆ ClearInstances()

void TnlGems::ClearInstances ( const char * pszName)

Empty the instances of each multimesh <name><n>.mm.

Parameters
pszNameThe prefix of the multimeshes.
Ghidra address:
NTSC-U/C: 0x001f5588
Ghidra address:
PAL: 0x001fe328

◆ ApplyRenderScales()

void TnlGems::ApplyRenderScales ( )
static

Scale the meshes and particle systems of the gems by the world length of a tick.

Ghidra address:
NTSC-U/C: 0x001f5648
Ghidra address:
PAL: 0x001fe3e8

◆ GetMeshGroup()

MeshGroup * TnlGems::GetMeshGroup ( char nType)

Report the first mesh group of a gem type.

Parameters
nTypeThe gem type.
Returns
The group.
Ghidra address:
NTSC-U/C: 0x001f5670
Ghidra address:
PAL: 0x001fe410

◆ GetSpriteGroup()

SpriteGroup * TnlGems::GetSpriteGroup ( char nType)

Report the sprite group of a gem type.

Parameters
nTypeThe gem type, with TnlGem::kTypeSprite.
Returns
The group.
Ghidra address:
NTSC-U/C: 0x001f5688
Ghidra address:
PAL: 0x001fe428

◆ AddGem()

void TnlGems::AddGem ( char nTrack,
char nType,
char nSlot,
int bFlash,
char nColor,
float flTick,
float flShowTick )

Add a gem, and set the removal of a gem of the same tick, slot, and track to its show tick.

Parameters
nTrackThe track.
nTypeThe gem type.
nSlotThe lateral slot.
bFlashWhether the gem flashes as it passes.
nColorThe player colour of a sprite gem, or a negative value for its own colour.
flTickThe tick of the gem.
flShowTickThe tick the gem is placed from.
Ghidra address:
NTSC-U/C: 0x001f56a8
Ghidra address:
PAL: 0x001fe448

◆ RemoveGems()

void TnlGems::RemoveGems ( char nTrack,
float flStartTick,
float flEndTick )

Remove the gems of a track over a span of ticks.

Parameters
nTrackThe track.
flStartTickThe start of the span.
flEndTickThe end of the span.
Ghidra address:
NTSC-U/C: 0x001f58b8
Ghidra address:
PAL: 0x001fe658

◆ RemoveGem()

void TnlGems::RemoveGem ( char nTrack,
char nSlot,
float flTick )

Remove the gems of a tick, slot, and track.

Parameters
nTrackThe track.
nSlotThe lateral slot.
flTickThe tick.
Ghidra address:
NTSC-U/C: 0x001f59a0
Ghidra address:
PAL: 0x001fe740

◆ Clear()

void TnlGems::Clear ( )

Remove every gem.

Ghidra address:
NTSC-U/C: 0x001f5aa0
Ghidra address:
PAL: 0x001fe840

◆ Poll()

void TnlGems::Poll ( const TnlTrackRange * pRange)

Drop the gems behind the song and far ahead of it, fire the events of the gems that pass, and place the gems that show.

Parameters
pRangeThe range of the tunnel that changed, or null.
Ghidra address:
NTSC-U/C: 0x001f5b40
Ghidra address:
PAL: 0x001fe8e0

◆ DrawComposites()

void TnlGems::DrawComposites ( )

Draw the composite mesh groups, each mesh through the multimesh in turn.

The glow particles of a group draw after its first mesh.

Ghidra address:
NTSC-U/C: 0x001f5dd0
Ghidra address:
PAL: 0x001feb70

◆ LowerBound()

std::list< TnlGem >::iterator TnlGems::LowerBound ( float flTick)

Find the first gem at or after a tick.

Parameters
flTickThe tick.
Returns
The gem, or the end of mGems when every gem is earlier.
Ghidra address:
NTSC-U/C: 0x001f5ed8
Ghidra address:
PAL: 0x001fec78

◆ Find()

std::list< TnlGem >::iterator TnlGems::Find ( float flTick)

Find the first gem at or after a tick.

Parameters
flTickThe tick.
Returns
The gem, or the end of mGems when every gem is earlier.
Ghidra address:
NTSC-U/C: 0x001f5ef8
Ghidra address:
PAL: 0x001fec98

◆ GetGemList()

std::list< TnlGem > & TnlGems::GetGemList ( )
inline
Returns
The gems, sorted by tick.

◆ SetFocusTrack()

void TnlGems::SetFocusTrack ( char nTrack)
inline

Set the track whose passing gems fire hit events.

Parameters
nTrackThe track.

◆ SetHasFocusTrack()

void TnlGems::SetHasFocusTrack ( int bHasFocusTrack)
inline

Set whether the focus track applies.

Parameters
bHasFocusTrackWhether it applies.

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