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

Game-side controller of the arena screens around the tunnel. More...

#include <tnlarena.h>

Inheritance diagram for TnlArena:
Collaboration diagram for TnlArena:

Classes

class  ScreenMesh
 One mesh that shows an arena screen, with the material it had when the arena was built. More...
class  PlayerMaterial
 One world player with the HUD freqd.mat material its index selects. More...

Public Member Functions

 TnlArena (Renderer *pRenderer)
 Build the arena screens for the game about to start.
virtual ~TnlArena ()
 Stop the screen animation and restore every screen mesh's original material.
virtual void DispatchPriv (Message *pMsg)
 Act on one message the renderer sends on.
void SetFrame (float flFrame)
 Advance the screen animation to one song position.
Public Member Functions inherited from MsgSink
void * operator new (size_t nSize)
 Allocate a sink from the tagged heap under the tag "MsgSink".
void operator delete (void *pBlock)
 Release a sink to the tagged heap.
virtual ~MsgSink ()
virtual void Dispatch (Message *pMsg)
 Accept a message.

Public Attributes

ScreenAnim * mScreenAnim
int mJuiceLock

Detailed Description

Game-side controller of the arena screens around the tunnel.

Its RTTI descriptor is at 0x008ef930. It has MsgSink as its one public base at offset 0. Its type function is at 0x0040c138. It is a game-side tunnel class rather than a Rnd one.

The table at 0x00817390 has four entries, the same length as MsgSink's table at 0x007ccc40, and the class therefore introduces no virtual. It overrides the destructor at slot 1 and DispatchPriv() at slot 3, and inherits MsgSink::Dispatch() at slot 2.

The object is 0x2c bytes, the size Renderer's constructor requests under the MsgSink tag at 0x0042c8fc. The constructor records the object in g_pTnlArena and the destructor clears it.

The arena shows the game on four screens, whose materials are screen01.mat to screen04.mat. The constructor finds every Rnd::Mesh that uses each of the four and records the mesh with its material in mScreenMeshes. It then builds one PlayerMaterial per world player, and one of three ScreenAnim classes by mode. Configuration code 0x3a1 selects the plain ScreenAnim, game mode 1 selects SoloScreenAnim, and every other mode selects MultiScreenAnim.

Constructor & Destructor Documentation

◆ TnlArena()

TnlArena::TnlArena ( Renderer * pRenderer)

Build the arena screens for the game about to start.

Starts at level 1, or at the play mode when that is kPlayModeJam, and passes the level to the animation it builds.

Parameters
pRendererThe renderer that constructs this object. The body does not read it.
Ghidra address:
NTSC-U/C: 0x004067e8
Ghidra address:
PAL: 0x00440128

◆ ~TnlArena()

virtual TnlArena::~TnlArena ( )
virtual

Stop the screen animation and restore every screen mesh's original material.

Passes level 1 to the animation, deletes it, frees every PlayerMaterial, and then restores each mesh's material twice over, once through ScreenMesh::SetMaterial() and once through the ScreenMesh destructor.

Ghidra address:
NTSC-U/C: 0x00406de0
Ghidra address:
PAL: 0x00440740

Member Function Documentation

◆ DispatchPriv()

virtual void TnlArena::DispatchPriv ( Message * pMsg)
virtual

Act on one message the renderer sends on.

A PointAmountMsg runs ScreenAnim::UpdateLeaders(). A JuiceAmountMsg, only in game mode 1 and play mode 1 and only while mJuiceLock is -1, sets the level from the juice amount (2 above 0.85, 0 below 0.2, and 1 otherwise) and passes it to ScreenAnim::SetLevel(). A WinMsg in game mode 1 with a non-empty winner list passes one level higher.

Parameters
pMsgThe message.
Ghidra address:
NTSC-U/C: 0x00406ff0
Ghidra address:
PAL: 0x00440950

Implements MsgSink.

◆ SetFrame()

void TnlArena::SetFrame ( float flFrame)

Advance the screen animation to one song position.

Forwards to ScreenAnim::SetFrame(). Renderer::Update() is the caller, and the title is inferred from it.

Parameters
flFrameThe song position, in MIDI ticks.
Ghidra address:
NTSC-U/C: 0x0040c958
Ghidra address:
PAL: 0x00446380

Member Data Documentation

◆ mScreenAnim

ScreenAnim* TnlArena::mScreenAnim

◆ mJuiceLock

int TnlArena::mJuiceLock

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