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

One gem on a track of the tunnel, 0x24 bytes. More...

#include <tnlgem.h>

Public Types

enum  { kTypeSprite = 0x40 }
 Flags of mType. More...
enum  {
  kFlagColorMask = 0x03 , kFlagPlayerColor = 0x08 , kFlagNoFlash = 0x10 , kFlagFlash = 0x20 ,
  kFlagPassed = 0x40
}
 Bits of mFlags. More...

Public Member Functions

void Update (TnlGems *pGems, GfxTunnel *pTunnel, const TnlTrackRange *pRange, float flTick)
 Place the gem on its track, giving it a mesh or sprite first, and pick the mesh group of its distance.
void Release (GfxTunnel *pTunnel)
 Return the mesh instance or the particle of the gem.
void Flash (GfxTunnel *pTunnel)
 Start a flash of the tunnel at the gem.
float Lateral () const
 Report the position of the gem across its track.
char GetType () const
void SetType (char nType)
unsigned char GetFlags () const
void SetFlags (unsigned char nFlags)
char GetTrack () const
void SetTrack (char nTrack)
float GetTick () const
void SetTick (float flTick)
char GetSlot () const
void SetSlot (char nSlot)
float GetShowTick () const
void SetShowTick (float flShowTick)
float GetRemoveTick () const
void SetRemoveTick (float flRemoveTick)
MeshGroup * GetMeshGroup () const
Particle * GetParticle () const
void SetParticle (Particle *pParticle)
const std::list< Transform >::iterator & GetTransform () const
void SetTransform (const std::list< Transform >::iterator &transform)

Static Public Attributes

static constexpr float kNever = 1e9f
 A tick that marks a gem as never removed.
static constexpr float kSlotWidth = 0.295f
 A gem in slot n sits n times kSlotWidth plus kSlotOffset across its track.
static constexpr float kSlotOffset = 0.205f
 The position across the track of slot 0.
static float sParticleHeight
 The height of the glow particle above a mesh gem, gem_particle_height.
static float sSpriteHeight
 The height of a sprite gem as a raise of PlaceCell(), one less sprite_gem_height.
static float sFlareFlashSize
 The size of the flash of a sprite gem as a multiple of its particle size.
static float sFlareFlashRate
 One over gem_flare_flash_time, a multiple of the particle size of a sprite gem.
static float sMeshFlashSize
 The size of the flash of a mesh gem, gem_mesh_flash_size.
static float sMeshFlashRate
 The world length of a tick divided by gem_mesh_flash_time, the growth of a mesh flash.

Detailed Description

One gem on a track of the tunnel, 0x24 bytes.

The class is not polymorphic, and the name is inferred. TnlGems stores the gems in a list sorted by mTick. A mesh gem is drawn as an instance of a MeshGroup, and a sprite gem as a particle of a SpriteGroup.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Flags of mType.

Enumerator
kTypeSprite 

The gem is a sprite rather than a mesh.

◆ anonymous enum

anonymous enum

Bits of mFlags.

Enumerator
kFlagColorMask 

The player colour of a gem with kFlagPlayerColor.

kFlagPlayerColor 

The sprite takes a player colour.

kFlagNoFlash 

The gem does not flash as it passes.

kFlagFlash 

The gem flashes as it passes.

kFlagPassed 

The gem has passed and fired its trigger events.

Member Function Documentation

◆ Update()

void TnlGem::Update ( TnlGems * pGems,
GfxTunnel * pTunnel,
const TnlTrackRange * pRange,
float flTick )

Place the gem on its track, giving it a mesh or sprite first, and pick the mesh group of its distance.

A gem that has its mesh or sprite is placed again only inside a range of the tunnel that changed.

Parameters
pGemsThe gems.
pTunnelThe tunnel.
pRangeThe range that changed, or null.
flTickThe tick of the song.
Ghidra address:
NTSC-U/C: 0x001f3ce0
Ghidra address:
PAL: 0x001fca80

◆ Release()

void TnlGem::Release ( GfxTunnel * pTunnel)

Return the mesh instance or the particle of the gem.

Parameters
pTunnelThe tunnel to tell of a removed mesh gem, or null.
Ghidra address:
NTSC-U/C: 0x001f4058
Ghidra address:
PAL: 0x001fcdf8

◆ Flash()

void TnlGem::Flash ( GfxTunnel * pTunnel)

Start a flash of the tunnel at the gem.

Parameters
pTunnelThe tunnel.
Ghidra address:
NTSC-U/C: 0x001f40e8
Ghidra address:
PAL: 0x001fce88

◆ Lateral()

float TnlGem::Lateral ( ) const
inline

Report the position of the gem across its track.

Every caller expands it.

Returns
The position, from 0 to 1.

◆ GetType()

char TnlGem::GetType ( ) const
inline
Returns
The gem type, with the flags above.

◆ SetType()

void TnlGem::SetType ( char nType)
inline
Parameters
nTypeThe gem type, with the flags above.

◆ GetFlags()

unsigned char TnlGem::GetFlags ( ) const
inline
Returns
The flags of the gem.

◆ SetFlags()

void TnlGem::SetFlags ( unsigned char nFlags)
inline
Parameters
nFlagsThe flags of the gem.

◆ GetTrack()

char TnlGem::GetTrack ( ) const
inline
Returns
The track the gem sits on.

◆ SetTrack()

void TnlGem::SetTrack ( char nTrack)
inline
Parameters
nTrackThe track the gem sits on.

◆ GetTick()

float TnlGem::GetTick ( ) const
inline
Returns
The tick of the gem.

◆ SetTick()

void TnlGem::SetTick ( float flTick)
inline
Parameters
flTickThe tick of the gem.

◆ GetSlot()

char TnlGem::GetSlot ( ) const
inline
Returns
The lateral slot of the gem on its track.

◆ SetSlot()

void TnlGem::SetSlot ( char nSlot)
inline
Parameters
nSlotThe lateral slot of the gem on its track.

◆ GetShowTick()

float TnlGem::GetShowTick ( ) const
inline
Returns
The tick the gem is placed from.

◆ SetShowTick()

void TnlGem::SetShowTick ( float flShowTick)
inline
Parameters
flShowTickThe tick the gem is placed from.

◆ GetRemoveTick()

float TnlGem::GetRemoveTick ( ) const
inline
Returns
The tick the gem is removed at, or kNever.

◆ SetRemoveTick()

void TnlGem::SetRemoveTick ( float flRemoveTick)
inline
Parameters
flRemoveTickThe tick the gem is removed at, or kNever.

◆ GetMeshGroup()

MeshGroup * TnlGem::GetMeshGroup ( ) const
inline
Returns
The group that draws a mesh gem, or null.

◆ GetParticle()

Particle * TnlGem::GetParticle ( ) const
inline
Returns
The particle of the gem, or null.

◆ SetParticle()

void TnlGem::SetParticle ( Particle * pParticle)
inline
Parameters
pParticleThe particle of the gem, or null.

◆ GetTransform()

const std::list< Transform >::iterator & TnlGem::GetTransform ( ) const
inline
Returns
The instance of the gem in mMeshGroup.

◆ SetTransform()

void TnlGem::SetTransform ( const std::list< Transform >::iterator & transform)
inline
Parameters
transformThe instance of the gem in mMeshGroup.

Member Data Documentation

◆ kNever

float TnlGem::kNever = 1e9f
staticconstexpr

A tick that marks a gem as never removed.

◆ kSlotWidth

float TnlGem::kSlotWidth = 0.295f
staticconstexpr

A gem in slot n sits n times kSlotWidth plus kSlotOffset across its track.

◆ kSlotOffset

float TnlGem::kSlotOffset = 0.205f
staticconstexpr

The position across the track of slot 0.

◆ sParticleHeight

float TnlGem::sParticleHeight
static

The height of the glow particle above a mesh gem, gem_particle_height.

Ghidra address:
NTSC-U/C: 0x003afba0
Ghidra address:
PAL: 0x0042ea38

◆ sSpriteHeight

float TnlGem::sSpriteHeight
static

The height of a sprite gem as a raise of PlaceCell(), one less sprite_gem_height.

Ghidra address:
NTSC-U/C: 0x003afba4
Ghidra address:
PAL: 0x0042ea3c

◆ sFlareFlashSize

float TnlGem::sFlareFlashSize
static

The size of the flash of a sprite gem as a multiple of its particle size.

Ghidra address:
NTSC-U/C: 0x003afba8
Ghidra address:
PAL: 0x0042ea40

◆ sFlareFlashRate

float TnlGem::sFlareFlashRate
static

One over gem_flare_flash_time, a multiple of the particle size of a sprite gem.

Ghidra address:
NTSC-U/C: 0x003afbac
Ghidra address:
PAL: 0x0042ea44

◆ sMeshFlashSize

float TnlGem::sMeshFlashSize
static

The size of the flash of a mesh gem, gem_mesh_flash_size.

Ghidra address:
NTSC-U/C: 0x003afbb0
Ghidra address:
PAL: 0x0042ea48

◆ sMeshFlashRate

float TnlGem::sMeshFlashRate
static

The world length of a tick divided by gem_mesh_flash_time, the growth of a mesh flash.

Ghidra address:
NTSC-U/C: 0x003afbb4
Ghidra address:
PAL: 0x0042ea4c

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