|
resonance 1.0.1
|
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. | |
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.
| enum TnlPanel::Kind |
| 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.
| nRing | The lane. |
| nSlice | The slice. |
| pPlayer | The lane owner, or the null player. |
| nPowerbar | -1 for a plain lane, selecting "tunnel mat<n>" over "powerbar mat<n>". |
| kind | The kind of panel. |
| nShowing | Non-zero when the section should show. |
| nColorIndex | The material number, taken modulo 4. |
|
inline |
| 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.
| 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.
| 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.
| flFrame | The current frame. |
| pTunnel | The tunnel whose panel effects a lane with no owner starts. |