|
resonance 1.0.1
|
Game-side driver of the tunnel the in-game renderer draws. More...
#include <apptunnel.h>


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 |
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.
| 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.
| pRenderer | The renderer that constructs this object. |
|
virtual |
Release every tunnel object and give each main camera back its saved state.
Clears g_pAppTunnel first. The pending triggers are not deleted.
|
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.
| pMsg | The message. |
Implements MsgSink.
| 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.
| flFrame | The song position, in MIDI ticks. |
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.
| pOldLeader | The previous leader, or null. |
| pNewLeader | The new leader, or null. |
| 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.
| nTrack | The track. |
| nBar | The bar. |
| nRefreshing | Non-zero when PhraseMgr posted the BarStatusMsg while refreshing bars. |
| pPlayer | The cell's player. |
| nPowerup | The cell's mPowerup. |
| nEnabled | The cell's mEnabled. |
| 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.
| nView | The index of the local view. |
| flFrame | The song position, in MIDI ticks. The body does not read it. |
| 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.
| pos | The point, in the space of the tunnel strings. |
| 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.
| nTrack | The track. |
| nBar | The bar. |
| 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.
| nTrack | The track. |
| pGhost | The drawable, the Rnd::Drawable subobject of the activator's ghost view. |
| 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.
| nTrack | The track. |
| Rnd::Mat * AppTunnel::GetGhostMat | ( | int | nTrack | ) |
Report the "gem_ghost<n>.mat" material of one track.
| nTrack | The track. |
| 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.
| pos | The point. |
| 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.
| nRing | The ring of the cell. |
| nSlice | The slice of the cell. |
| nForward | Non-zero to run the effect forward. |
| std::vector<TnlPlayer *> AppTunnel::mPlayers |
| int AppTunnel::mShowCrates |