|
resonance 1.0.1
|
Colour, material, and slice range of one player's tunnel seeker. More...
#include <tnlseekerfade.h>
Public Member Functions | |
| TnlSeekerFade (int nIndex, const Color &color) | |
| Give the seeker its material and colour and apply an empty range. | |
| void | SetActive (int nActive) |
| Apply the stored range to the seeker, or an empty range. | |
| void | Update () |
| Advance the alpha by mFadeRate, clamped to 0 through 1. | |
| void | SetRange (int nFirstSlice, int nSliceCount, int nRing) |
| Record a new seeker range and fade the seeker out so that Update() brings it back there. | |
| void | ClearRange () |
| Drop the recorded range and fade the seeker out. | |
Public Attributes | |
| int | mActive |
| int | mFirstSlice |
| int | mSliceCount |
| int | mRing |
| int | mIndex |
Colour, material, and slice range of one player's tunnel seeker.
The class is not polymorphic and emits no RTTI, and no allocation tag or file path identifies it. The name is inferred from what it drives, the Rnd::TunnelSeeker of index mIndex, and from the alpha fade Update() runs on it.
Update() changes the range behind a fade. With a negative mFadeRate the alpha falls, and once it drops below zero Update() hands the stored range to the seeker and fades back in at 0.2 per call, or stops at zero when the stored range is empty. The writer of the range fields and of a negative mFadeRate is not among the recovered routines.
TnlPlayer embeds one, 0x28 bytes, at +0x170.
| TnlSeekerFade::TnlSeekerFade | ( | int | nIndex, |
| const Color & | color ) |
Give the seeker its material and colour and apply an empty range.
The material is "seeker.mat" in kPlayModeGame and "seeker_loop.mat" in every other play mode. The alpha of color is replaced with 1.
| nIndex | The seeker, and the player index. |
| color | The seeker colour. |
| void TnlSeekerFade::SetActive | ( | int | nActive | ) |
Apply the stored range to the seeker, or an empty range.
| nActive | Non-zero to apply mFirstSlice, mSliceCount, and mRing, zero to apply (0, 0, 0). |
| void TnlSeekerFade::Update | ( | ) |
Advance the alpha by mFadeRate, clamped to 0 through 1.
Crossing below zero applies the stored range when mActive is set, and sets mFadeRate to 0.2 for a non-empty range and to 0 otherwise. The seeker colour is rewritten only when the alpha changed.
|
inline |
Record a new seeker range and fade the seeker out so that Update() brings it back there.
Nothing changes when the range is the one already recorded. AppTunnel's SeekerMsg handler inlines the body, and the image has no out-of-line copy.
| nFirstSlice | The first slice of the range. |
| nSliceCount | The slices in the range. |
| nRing | The ring of the range. |
|
inline |
| int TnlSeekerFade::mActive |
| int TnlSeekerFade::mFirstSlice |
| int TnlSeekerFade::mSliceCount |
| int TnlSeekerFade::mRing |
| int TnlSeekerFade::mIndex |