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

Flash that lifts one tunnel panel out of the wall and fades it away. More...

#include <tnlpanelfx.h>

Public Member Functions

 TnlPanelFX (int nIndex)
 Build the panel mesh and resolve the material for one panel slot.
 ~TnlPanelFX ()
 Take the mesh out of "tnl transparent" and delete it.
void Start (int nRing, int nSlice, int nForward)
 Show the panel over one ring section and begin the rise phase.
void Update (float flFrame)
 Advance the phase the panel is in.
bool IsIdle () const
 Report whether the panel waits for Start().

Detailed Description

Flash that lifts one tunnel panel out of the wall and fades it away.

The class is not polymorphic and emits no RTTI, and no allocation tag or file path identifies it. The name is inferred from its mesh name prefix "pnl", from the "tunnel erase%d" material it draws with, and from the delayed-panel record at 0x00457648 that fires it through AppTunnel.

Start() copies the geometry of one ring section onto a private mesh and places it in "tnl transparent". Update() then runs three timed phases. The panel slides from its offset position onto the tunnel wall while it fades in, stays with an additive blend, and fades out before the mesh drops back to its empty faces.

AppTunnel allocates one per entry of its panel vector at +0x3c, 0x30 bytes each.

Constructor & Destructor Documentation

◆ TnlPanelFX()

TnlPanelFX::TnlPanelFX ( int nIndex)
explicit

Build the panel mesh and resolve the material for one panel slot.

The mesh name is "pnl" followed by NextAppTunnelName(). The mesh reads Z without writing it, does not draw until Start(), and is added to "tnl transparent". The material is "tunnel erase<nIndex>". When no such material is loaded, a new one of that name is created as a copy of "tunnel erase0".

Parameters
nIndexThe panel slot, also the material number.
Ghidra address:
NTSC-U/C: 0x0043c688
Ghidra address:
PAL: 0x00478cc8

◆ ~TnlPanelFX()

TnlPanelFX::~TnlPanelFX ( )
inline

Take the mesh out of "tnl transparent" and delete it.

AppTunnel's destructor inlines the body. The deleting copy at 0x00456418 has no caller.

Ghidra address:
NTSC-U/C: 0x00456418
Ghidra address:
PAL: 0x00493948

Member Function Documentation

◆ Start()

void TnlPanelFX::Start ( int nRing,
int nSlice,
int nForward )

Show the panel over one ring section and begin the rise phase.

The mesh shares the faces of the ring section and copies its vertices. The path frame is the middle of the bar, nSlice * 1920 + 960. mOffset becomes the ring point halfway to the next ring less the path origin at the same frame.

Parameters
nRingThe ring of the section.
nSliceThe slice of the section, also the bar.
nForwardNon-zero to rise along mOffset, zero to rise against it.
Ghidra address:
NTSC-U/C: 0x0043cb78
Ghidra address:
PAL: 0x00479278

◆ Update()

void TnlPanelFX::Update ( float flFrame)

Advance the phase the panel is in.

While idle the routine only records flFrame. The rise lasts 200 frames and moves the mesh origin from mOffset * mDirection to zero while the alpha climbs twice as fast as the phase. The hold lasts 400 frames with an additive blend and the fade 200 frames, and both take the alpha from 1 to 0. The end of the fade hides the mesh and makes it the owner of its faces again.

Parameters
flFrameThe current frame.
Ghidra address:
NTSC-U/C: 0x0043cd38
Ghidra address:
PAL: 0x00479438

◆ IsIdle()

bool TnlPanelFX::IsIdle ( ) const
inline

Report whether the panel waits for Start().

AppTunnel's routine at 0x00457648 tests the state inline to find a free panel, and no out-of-line copy exists.

Returns
True while idle.

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