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

Coloured particle fire that travels down the tunnel path from one lane. More...

#include <tnlfirefx.h>

Public Member Functions

 TnlFireFX (const HxStr &name, int nIndex)
 Resolve the path, the view, and the systems of one fire.
int Start (float flPathStart, int nIndex, int nSlot, const Color &color, const Color &altColor, float flPathEnd)
 Start the fire if it is idle and nIndex selects it.
void SetFrame (float flFrame, float flViewFrame)
 Drive the view and advance the path.

Detailed Description

Coloured particle fire that travels down the tunnel path from one lane.

The class is not polymorphic and emits no RTTI, and no allocation tag or file path identifies it. The name is inferred from the name prefixes AppTunnel builds these with, "fire%d", "firefs%d", and "firemult%d", and from the shared path "fx.path".

Each object resolves "<name>.view" and "<name>.ps". The "fire%d" objects, built with an index of -1, also resolve "<name>a.ps". Start() colours the systems, turns them to face a lane, and runs "fx.path" forward at four path frames per song frame until the path passes its end frame.

AppTunnel allocates these in three groups, 0x70 bytes each, and stores them in its vector at +0x24. The group built with the name "fire%d" passes -1, "firefs%d" passes -2, and "firemult%d" passes the loop index.

Constructor & Destructor Documentation

◆ TnlFireFX()

TnlFireFX::TnlFireFX ( const HxStr & name,
int nIndex )

Resolve the path, the view, and the systems of one fire.

Parameters
nameThe name prefix.
nIndexThe index Start() must be given, -1 when the object has a second system.
Ghidra address:
NTSC-U/C: 0x0043d368
Ghidra address:
PAL: 0x00479ac8

Member Function Documentation

◆ Start()

int TnlFireFX::Start ( float flPathStart,
int nIndex,
int nSlot,
const Color & color,
const Color & altColor,
float flPathEnd )

Start the fire if it is idle and nIndex selects it.

Each system spawns white and fades from its colour at full alpha to the same colour at zero alpha. Both systems are turned by -nSlot eighths of a turn about Y, and each recorded force is turned by that rotation composed with the path basis at flPathStart. The path then runs from flPathStart and the fire ends once it passes flPathEnd.

Parameters
flPathStartThe first path frame.
nIndexThe index this call is for.
nSlotThe lane the fire faces.
colorThe colour of the first system.
altColorThe colour of the second system.
flPathEndThe path frame that ends the fire.
Returns
1 when the fire started, 0 when it was busy or nIndex did not match.
Ghidra address:
NTSC-U/C: 0x0043d8c0
Ghidra address:
PAL: 0x0047a0f0

◆ SetFrame()

void TnlFireFX::SetFrame ( float flFrame,
float flViewFrame )

Drive the view and advance the path.

The first call after Start() records flFrame as the reference. While the fire runs, the path is attached to the view and driven to flPathStart + (flFrame - reference) * 4.

Parameters
flFrameThe current frame.
flViewFrameThe frame the view is driven to.
Ghidra address:
NTSC-U/C: 0x004565a8
Ghidra address:
PAL: 0x00493ad8

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