|
resonance 1.0.1
|
One gem on the tunnel, as TnlGemManager keeps it sorted by mFrame. More...
#include <tnlgem.h>

Public Types | |
| enum | State { kStateNone = 0 , kStateFlashPending = 1 , kStateFlashed = 2 } |
| Progress of the flash a gem shows as the playhead arrives. More... | |
Public Member Functions | |
| TnlGem (char nKind, char nTrack, char nColor, bool bFlash, float flFrame, float flBlend, float flAppearFrame) | |
| Describe a gem that holds no drawing resource and never expires. | |
| float | Place (TnlGemManager *pManager, float flFrame) |
| Place the gem for one frame and report what drawing it costs. | |
| void | Release () |
| Give back the instance or the particle the gem holds. | |
| void | Flash (AppTunnel *pTunnel) |
| Start a gem flash at the position of the gem's instance or particle. | |
Public Attributes | |
| char | mKind |
| char | mTrack |
| char | mState |
| char | mColor |
| float | mFrame |
| float | mBlend |
| float | mAppearFrame |
| float | mExpireFrame |
| TnlGemMeshKind * | mMeshKind |
| TnlGemEffectKind * | mEffectKind |
| std::list< Transform >::iterator | mInstance |
| Rnd::Particle * | mParticle |
One gem on the tunnel, as TnlGemManager keeps it sorted by mFrame.
The class is not polymorphic and emits no RTTI. No descriptor, tag, or file path identifies it, and its name is inferred from the gem kinds it draws. It is 0x24 bytes, the element of the std::list at TnlGemManager +0x18. AppTunnel builds one on the stack for every gem it places and hands it to TnlGemManager::Add(), which stores a copy.
A gem holds no drawing resource until TnlGemManager::Update() places it. Placing a mesh kind adds one instance transform to a TnlGemMeshKind multi-mesh, and placing an effect kind takes one particle from a TnlGemEffectKind particle system. Release() gives the resource back.
| enum TnlGem::State |
| TnlGem::TnlGem | ( | char | nKind, |
| char | nTrack, | ||
| char | nColor, | ||
| bool | bFlash, | ||
| float | flFrame, | ||
| float | flBlend, | ||
| float | flAppearFrame ) |
Describe a gem that holds no drawing resource and never expires.
AppTunnel calls it at 0x004478c4 and 0x00447b40.
| nKind | The kind TnlGemManager::AddMeshKind() or TnlGemManager::AddEffectKind() returned. |
| nTrack | The ring of the tunnel the gem sits on. |
| nColor | The colour index an effect gem's particle takes, as TnlColorIndexFromName() numbers the player colours. |
| bFlash | Whether the gem flashes as the playhead arrives. |
| flFrame | The tunnel frame of the gem. |
| flBlend | The position across the ring. |
| flAppearFrame | The tunnel frame from which the gem is drawn. |
| float TnlGem::Place | ( | TnlGemManager * | pManager, |
| float | flFrame ) |
Place the gem for one frame and report what drawing it costs.
A mesh gem takes an instance of the finest TnlGemMeshKind the first time, and then moves its instance to the first level whose mLodDistance, added to flFrame, falls short of mFrame. An effect gem takes a particle the first time, coloured by mColor and sized by the system's low size, and is not moved afterwards. An effect gem whose system has no free particle stays unplaced and costs nothing.
| pManager | The manager that owns the gem kinds. |
| flFrame | The tunnel frame of the playhead. |
| void TnlGem::Release | ( | ) |
Give back the instance or the particle the gem holds.
AppTunnel calls it at 0x004483bc, and TnlGemManager inlines it.
| void TnlGem::Flash | ( | AppTunnel * | pTunnel | ) |
Start a gem flash at the position of the gem's instance or particle.
Does nothing for a gem that holds neither. The out-of-line copy has no callers, and TnlGemManager::Update() inlines it.
| pTunnel | The tunnel that owns the flash particles. |
| char TnlGem::mKind |
Below 0x40 a TnlGemMeshKind index, else a TnlGemEffectKind one.
| char TnlGem::mTrack |
The ring of the tunnel the gem sits on.
| char TnlGem::mState |
The flash progress, one of State.
| char TnlGem::mColor |
The colour index of an effect gem's particle.
| float TnlGem::mFrame |
The tunnel frame of the gem, the sort key.
| float TnlGem::mBlend |
The position across the ring.
| float TnlGem::mAppearFrame |
The tunnel frame from which the gem is drawn. The tunnel frame after which the gem is dropped, 1e9 until a later gem at the same frame, ring, and position appears.
| float TnlGem::mExpireFrame |
| TnlGemMeshKind* TnlGem::mMeshKind |
The level whose multi-mesh holds mInstance, or null.
| TnlGemEffectKind* TnlGem::mEffectKind |
The kind whose system mParticle belongs to, or null. The gem's transform in mMeshKind's multi-mesh, set while mMeshKind is.
| std::list<Transform>::iterator TnlGem::mInstance |
| Rnd::Particle* TnlGem::mParticle |
The gem's particle, set while mEffectKind is.