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

Game-side driver of the tunnel the in-game renderer draws. More...

#include <apptunnel.h>

Inheritance diagram for AppTunnel:
Collaboration diagram for AppTunnel:

Public Member Functions

 AppTunnel (Renderer *pRenderer)
 Build the tunnel for the game about to start.
virtual ~AppTunnel ()
 Release every tunnel object and give each main camera back its saved state.
virtual void DispatchPriv (Message *pMsg)
 Act on one message the renderer sends on.
void SetFrame (float flFrame)
 Advance the tunnel to one song position.
void OnLeaderChanged (Player *pOldLeader, Player *pNewLeader)
 Move the leader marker from one player's activator to another's.
void OnBarChanged (int nTrack, int nBar, int nRefreshing, Player *pPlayer, int nPowerup, int nEnabled)
 Update the tunnel section of one bar whose state a BarStatusMsg changed.
void PrepareLocalView (int nView, float flFrame)
 Turn the now ring for one local view before the renderer draws it.
void PlaceStringFlare (const Vector3 &pos)
 Move the first unplaced particle of "string flare.ps" to a point.
int IsTrackBarLocked (int nTrack, int nBar)
 Report whether the player may not act on one bar of a track.
void ShowTrackGhost (int nTrack, Rnd::Drawable *pGhost)
 Show the ghost gems of one track in a drawable.
void HideTrackGhost (int nTrack)
 Make the ghost material of one track opaque again and fade the ghost out at -0.15.
Rnd::Mat * GetGhostMat (int nTrack)
 Report the "gem_ghost<n>.mat" material of one track.
void StartGemFlash (const Vector3 &pos)
 Start one flash of "gem_flash.ps" at a point.
int StartPanelFX (int nRing, int nSlice, int nForward)
 Start the first idle panel effect on one cell.
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

std::vector< TnlPlayer * > mPlayers
int mShowCrates

Detailed Description

Game-side driver of the tunnel the in-game renderer draws.

Its RTTI descriptor is at 0x008f0860. It has MsgSink as its one public base at offset 0. Its type function is at 0x00453ff8. The class sits in app/ beside Renderer, its one constructor caller, and it is a game-side class rather than a Rnd one.

The table at 0x0081ba38 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 0x170 bytes, the size Renderer's constructor requests under the MsgSink tag at 0x0042c89c. No routine of the unit reads or writes the words from +0x14c to +0x15c or from +0x164 to the end.

The unit ends with the out-of-line copies of the inline routines of the tunnel helper classes, and of the members below that DispatchPriv() and the helpers inline. Those copies have no caller.

Constructor & Destructor Documentation

◆ AppTunnel()

AppTunnel::AppTunnel ( Renderer * pRenderer)

Build the tunnel for the game about to start.

Records itself in g_pAppTunnel, sets the tunnel's rates and levels of detail for the local player count, and splits the screen between "tnl cam1" to "tnl cam4" and their outer cameras, saving a copy of each main camera first. It then registers the gem kinds, builds the gem trails, one TnlPlayer per player, and every effect, and runs "hx.nowring(1)", "hx.sections(1)", and "hx.fade_activator(1)". A jam in jukebox mode starts in the playing camera pose with every activator suppressed and the now ring hidden.

Parameters
pRendererThe renderer that constructs this object.
Ghidra address:
NTSC-U/C: 0x00442020
Ghidra address:
PAL: 0x0047ee28

◆ ~AppTunnel()

virtual AppTunnel::~AppTunnel ( )
virtual

Release every tunnel object and give each main camera back its saved state.

Clears g_pAppTunnel first. The pending triggers are not deleted.

Ghidra address:
NTSC-U/C: 0x00445740
Ghidra address:
PAL: 0x00482950

Member Function Documentation

◆ DispatchPriv()

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

Act on one message the renderer sends on.

The message type selects one handler. DisplayPointerMsg, ChoosePowerupMsg, StdMidiMsg, and every other type are ignored, and nothing is passed on to MsgSink.

Parameters
pMsgThe message.
Ghidra address:
NTSC-U/C: 0x00449688
Ghidra address:
PAL: 0x00486938

Implements MsgSink.

◆ SetFrame()

void AppTunnel::SetFrame ( float flFrame)

Advance the tunnel to one song position.

Fades the string flares, shrinks the gem flashes, retires finished panels and fired triggers, and advances every helper and effect. The fire effects' views, the arrows, and the players also receive the position scaled by the tempo rate. Renderer::Update() is the caller. The title is inferred from that caller, which hands the same value to Rnd::Animatable::SetFrame() on its three views.

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

◆ OnLeaderChanged()

void AppTunnel::OnLeaderChanged ( Player * pOldLeader,
Player * pNewLeader )

Move the leader marker from one player's activator to another's.

Does nothing in kGameModeSolo. A null player on either side is skipped. The body is TnlActivator::SetLeader() inlined for each side. The title is inferred.

Parameters
pOldLeaderThe previous leader, or null.
pNewLeaderThe new leader, or null.
Ghidra address:
NTSC-U/C: 0x00446838
Ghidra address:
PAL: 0x00483a68

◆ OnBarChanged()

void AppTunnel::OnBarChanged ( int nTrack,
int nBar,
int nRefreshing,
Player * pPlayer,
int nPowerup,
int nEnabled )

Update the tunnel section of one bar whose state a BarStatusMsg changed.

Nothing happens once the renderer's song tick is more than a quarter bar past the end of the bar. In kPlayModeGame, with nRefreshing zero and a song tick that is not negative, a new TnlPanel starts a quarter of the way from the song tick to the start of the bar. Otherwise a TnlPanel is built on the stack and applied at once. A jukebox game always passes 0 as the panel's showing flag. The title is inferred.

Parameters
nTrackThe track.
nBarThe bar.
nRefreshingNon-zero when PhraseMgr posted the BarStatusMsg while refreshing bars.
pPlayerThe cell's player.
nPowerupThe cell's mPowerup.
nEnabledThe cell's mEnabled.
Ghidra address:
NTSC-U/C: 0x004465a0
Ghidra address:
PAL: 0x004837d0

◆ PrepareLocalView()

void AppTunnel::PrepareLocalView ( int nView,
float flFrame )

Turn the now ring for one local view before the renderer draws it.

The body is TnlNowRing::SetRotation() with the view index as the step, inlined. Renderer::Draw() is the caller. The title is inferred.

Parameters
nViewThe index of the local view.
flFrameThe song position, in MIDI ticks. The body does not read it.
Ghidra address:
NTSC-U/C: 0x00457bd0
Ghidra address:
PAL: 0x00495100

◆ PlaceStringFlare()

void AppTunnel::PlaceStringFlare ( const Vector3 & pos)

Move the first unplaced particle of "string flare.ps" to a point.

A particle counts as unplaced while its colour alpha differs from 1. The routine sets the alpha to 1 as it places the particle, and a system whose live particles are all placed is not changed. The title is inferred from the particle system and its DurGemTrails callers.

Parameters
posThe point, in the space of the tunnel strings.
Ghidra address:
NTSC-U/C: 0x00457a98
Ghidra address:
PAL: 0x00494fc8

◆ IsTrackBarLocked()

int AppTunnel::IsTrackBarLocked ( int nTrack,
int nBar )

Report whether the player may not act on one bar of a track.

A riff track in a jam never locks. An axe, scratch, or vocal track always locks. Any other bar locks unless its Renderer cell holds the null player and is enabled. TnlGridMarkers is the caller. The title is inferred.

Parameters
nTrackThe track.
nBarThe bar.
Returns
1 when the bar is locked, 0 otherwise.
Ghidra address:
NTSC-U/C: 0x00457338
Ghidra address:
PAL: 0x00494868

◆ ShowTrackGhost()

void AppTunnel::ShowTrackGhost ( int nTrack,
Rnd::Drawable * pGhost )

Show the ghost gems of one track in a drawable.

The drawable's draw list is emptied, the track's ghost gem kind is drawn in it and shown, the track's ghost material becomes transparent, and the track's ghost fade rate becomes 0.15. TnlActivator is the caller. The title is inferred.

Parameters
nTrackThe track.
pGhostThe drawable, the Rnd::Drawable subobject of the activator's ghost view.
Ghidra address:
NTSC-U/C: 0x00457418
Ghidra address:
PAL: 0x00494948

◆ HideTrackGhost()

void AppTunnel::HideTrackGhost ( int nTrack)

Make the ghost material of one track opaque again and fade the ghost out at -0.15.

TnlActivator is the caller. The title is inferred.

Parameters
nTrackThe track.
Ghidra address:
NTSC-U/C: 0x004574c8
Ghidra address:
PAL: 0x004949f8

◆ GetGhostMat()

Rnd::Mat * AppTunnel::GetGhostMat ( int nTrack)

Report the "gem_ghost<n>.mat" material of one track.

Parameters
nTrackThe track.
Returns
The material.
Ghidra address:
NTSC-U/C: 0x00457570
Ghidra address:
PAL: 0x00494aa0

◆ StartGemFlash()

void AppTunnel::StartGemFlash ( const Vector3 & pos)

Start one flash of "gem_flash.ps" at a point.

The first gem flash record with no particle takes a new particle, which becomes white at full alpha and size 1 at the point. Nothing happens when every record has a particle. TnlGem::Flash() and TnlGemManager::Update() are the callers. The title is inferred.

Parameters
posThe point.
Ghidra address:
NTSC-U/C: 0x00457588
Ghidra address:
PAL: 0x00494ab8

◆ StartPanelFX()

int AppTunnel::StartPanelFX ( int nRing,
int nSlice,
int nForward )

Start the first idle panel effect on one cell.

TnlPanel::Update() and TnlPanelFXDelay::Fire() are the callers. The title is inferred.

Parameters
nRingThe ring of the cell.
nSliceThe slice of the cell.
nForwardNon-zero to run the effect forward.
Returns
1 when an effect started, 0 when every effect was busy.
Ghidra address:
NTSC-U/C: 0x00457648
Ghidra address:
PAL: 0x00494b78

Member Data Documentation

◆ mPlayers

std::vector<TnlPlayer *> AppTunnel::mPlayers

◆ mShowCrates

int AppTunnel::mShowCrates

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