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

One tunnel section whose material and colour follow the lane owner, with a timed show or erase. More...

#include <tnlpanel.h>

Public Types

enum  Kind { kKindLane = 0 , kKindAxe = 1 , kKindScratch = 2 , kKindVox = 3 }
 Kind of panel. More...

Public Member Functions

 TnlPanel (int nRing, int nSlice, Player *pPlayer, int nPowerbar, Kind kind, int nShowing, int nColorIndex)
 Record the section and pick its material.
void SetStartFrame (float flFrame)
 Set the frame Update() starts from.
void Refresh ()
 Pick the material and colour for the kind of panel.
void Apply ()
 Show or hide the section and colour the lane divider after the lane owner.
int Update (float flFrame, AppTunnel *pTunnel)
 Run the panel from its start frame.

Detailed Description

One tunnel section whose material and colour follow the lane owner, with a timed show or erase.

The class is not polymorphic and emits no RTTI, and no allocation tag or file path identifies it. The name is inferred from the materials and animations it uses, "tunnel mat<n>", "powerbar mat<n>", "panel axe mat", "panel scratch mat", "panel vox mat", "panel show.msnm", and "panel erase.msnm".

A panel drives the ring section mesh of one lane and slice. Refresh() picks the material, and Apply() shows or hides the mesh and colours the lane divider after the lane owner. From the start frame, Update() plays the show or erase animation, or hands a lane with no owner to a TnlPanelFX, and then applies the result.

AppTunnel builds these in its bar handler and in its message handler at 0x00447ba8. Both inline the constructor. The bar handler allocates 0x40 bytes and queues the panel through 0x00447268. The message handler builds it on the stack and applies it at once.

Member Enumeration Documentation

◆ Kind

Kind of panel.

It selects the material Refresh() applies.

Enumerator
kKindLane 

A lane section, "tunnel mat<n>" or "powerbar mat<n>".

kKindAxe 

"panel axe mat".

kKindScratch 

"panel scratch mat".

kKindVox 

"panel vox mat".

Constructor & Destructor Documentation

◆ TnlPanel()

TnlPanel::TnlPanel ( int nRing,
int nSlice,
Player * pPlayer,
int nPowerbar,
Kind kind,
int nShowing,
int nColorIndex )

Record the section and pick its material.

Every caller inlines the constructor, and this copy has no caller.

Parameters
nRingThe lane.
nSliceThe slice.
pPlayerThe lane owner, or the null player.
nPowerbar-1 for a plain lane, selecting "tunnel mat<n>" over "powerbar mat<n>".
kindThe kind of panel.
nShowingNon-zero when the section should show.
nColorIndexThe material number, taken modulo 4.
Ghidra address:
NTSC-U/C: 0x00457228
Ghidra address:
PAL: 0x00494758

Member Function Documentation

◆ SetStartFrame()

void TnlPanel::SetStartFrame ( float flFrame)
inline

Set the frame Update() starts from.

AppTunnel inlines the store at 0x00447314, and no out-of-line copy exists.

Parameters
flFrameThe start frame.

◆ Refresh()

void TnlPanel::Refresh ( )

Pick the material and colour for the kind of panel.

A lane uses "tunnel mat<n>" or "powerbar mat<n>" in white. The other kinds use their panel material in white at half alpha.

Ghidra address:
NTSC-U/C: 0x004417f8
Ghidra address:
PAL: 0x0047e510

◆ Apply()

void TnlPanel::Apply ( )

Show or hide the section and colour the lane divider after the lane owner.

In game mode a lane panel whose owner is a real player hides. A shown section takes the material and colour.

Ghidra address:
NTSC-U/C: 0x00441c68
Ghidra address:
PAL: 0x0047ea20

◆ Update()

int TnlPanel::Update ( float flFrame,
AppTunnel * pTunnel )

Run the panel from its start frame.

The first call at or after the start frame picks the animation. A lane with a real owner plays "panel erase.msnm" over 480 frames. A lane with no owner runs for 200 frames with no animation, and in game mode it starts a TnlPanelFX through pTunnel. Any other kind applies at once and, when it should show and was hidden, plays "panel show.msnm" over 480 frames.

Parameters
flFrameThe current frame.
pTunnelThe tunnel whose panel effects a lane with no owner starts.
Returns
1 while the panel runs, and 0 once it has been applied.
Ghidra address:
NTSC-U/C: 0x00441d98
Ghidra address:
PAL: 0x0047eb70

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