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

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

Detailed Description

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.

Constructor & Destructor Documentation

◆ TnlSeekerFade()

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.

Parameters
nIndexThe seeker, and the player index.
colorThe seeker colour.
Ghidra address:
NTSC-U/C: 0x00438308
Ghidra address:
PAL: 0x004740b8

Member Function Documentation

◆ SetActive()

void TnlSeekerFade::SetActive ( int nActive)

Apply the stored range to the seeker, or an empty range.

Parameters
nActiveNon-zero to apply mFirstSlice, mSliceCount, and mRing, zero to apply (0, 0, 0).
Ghidra address:
NTSC-U/C: 0x00454a68
Ghidra address:
PAL: 0x00491f98

◆ Update()

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.

Ghidra address:
NTSC-U/C: 0x00454b58
Ghidra address:
PAL: 0x00492088

◆ SetRange()

void TnlSeekerFade::SetRange ( int nFirstSlice,
int nSliceCount,
int nRing )
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.

Parameters
nFirstSliceThe first slice of the range.
nSliceCountThe slices in the range.
nRingThe ring of the range.

◆ ClearRange()

void TnlSeekerFade::ClearRange ( )
inline

Drop the recorded range and fade the seeker out.

Nothing changes when no range is recorded. AppTunnel's SeekerMsg handler inlines the body, and the image has no out-of-line copy.

Member Data Documentation

◆ mActive

int TnlSeekerFade::mActive

◆ mFirstSlice

int TnlSeekerFade::mFirstSlice

◆ mSliceCount

int TnlSeekerFade::mSliceCount

◆ mRing

int TnlSeekerFade::mRing

◆ mIndex

int TnlSeekerFade::mIndex

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