resonance 1.0.1
Loading...
Searching...
No Matches
Rnd::TunnelSeekStrip Class Reference

Run of consecutive tunnel slices a Rnd::TunnelSeeker highlights on one ring. More...

#include <tunnelseekstrip.h>

Collaboration diagram for Rnd::TunnelSeekStrip:

Public Member Functions

 TunnelSeekStrip ()
 Construct an empty strip with a white colour.
 ~TunnelSeekStrip ()
 Release the material reference and destroy the strip.
void Clear ()
 Release the material reference and empty the sections.
void SetRange (int nFirstSlice, int nSliceCount, int nRing)
 Place the strip on a run of slices.
void Refresh ()
 Place the strip again on the run it last received.
void Build (Tunnel *pTunnel, TunnelSeeker *pOwner, int nIndex)
 Generate the sections for a tunnel.
void SetMat (Mat *pMat)
 Replace the material and hand it to the finest mesh of every section.
void SetColor (const Color &color)
 Store a colour and recolour every section already updated.
void DrawSection (int nSlice, float flScreenSize)
 Draw the section placed on one slice.
void Replace (Object *pFrom, Object *pTo, Object *pReferrer)
 Replace the material reference.

Public Attributes

int mFirstSlice
int mSliceCount
int mRing
Color mColor
Mat * mMat
Tunnel * mTunnel
TunnelSeeker * mOwner
int mStepNumerator
int mStepSize
int mStepCount
std::vector< TunnelSeekSection > mSections

Detailed Description

Run of consecutive tunnel slices a Rnd::TunnelSeeker highlights on one ring.

The record is not polymorphic and has no RTTI. The name is inferred from its owner, the record the tunnel stores one of per seeker, and from the "_seek" titles of the meshes its sections generate.

The record is 0x50 bytes and is the first member of Rnd::TunnelSeeker. The sections form a ring buffer of three, indexed by slice modulo the section count, so the strip never shows more than three slices at once.

The copy constructor is the implicit one, emitted at 0x00471e90. It copies the leading members word by word, mColor as one quadword, and then mSections element by element through the implicit copy constructor of Rnd::TunnelSeekSection.

Constructor & Destructor Documentation

◆ TunnelSeekStrip()

Rnd::TunnelSeekStrip::TunnelSeekStrip ( )

Construct an empty strip with a white colour.

The step counters at +0x30 and +0x34 are left unset until Build().

Ghidra address:
NTSC-U/C: 0x0046e7d8
Ghidra address:
PAL: 0x004ac3b8

◆ ~TunnelSeekStrip()

Rnd::TunnelSeekStrip::~TunnelSeekStrip ( )
inline

Release the material reference and destroy the strip.

The image has no separate copy. The body is inlined into the implicit destructor of Rnd::TunnelSeeker at 0x00477cc0, which calls Clear() and then frees the section storage.

Member Function Documentation

◆ Clear()

void Rnd::TunnelSeekStrip::Clear ( )

Release the material reference and empty the sections.

mTunnel is cleared as well, and mMat is not.

Ghidra address:
NTSC-U/C: 0x0046ea98
Ghidra address:
PAL: 0x004ac698

◆ SetRange()

void Rnd::TunnelSeekStrip::SetRange ( int nFirstSlice,
int nSliceCount,
int nRing )

Place the strip on a run of slices.

Every section is invalidated first. The count is clamped to the section count, and each slice of the run is placed in the section its slice index selects, with the first flagged as the start cap and the last as the end cap.

Parameters
nFirstSliceThe first slice of the run.
nSliceCountThe number of slices.
nRingThe ring.
Ghidra address:
NTSC-U/C: 0x0046eb48
Ghidra address:
PAL: 0x004ac748

◆ Refresh()

void Rnd::TunnelSeekStrip::Refresh ( )

Place the strip again on the run it last received.

Ghidra address:
NTSC-U/C: 0x00477ff0
Ghidra address:
PAL: 0x004b5c68

◆ Build()

void Rnd::TunnelSeekStrip::Build ( Tunnel * pTunnel,
TunnelSeeker * pOwner,
int nIndex )

Generate the sections for a tunnel.

Creates three sections called "[<tunnel>_seek<index>.<section>]" from the first cell of the tunnel mesh grid, hands mMat to the finest mesh of each, copies the tunnel step counters, takes a reference on mMat on behalf of the tunnel, and then calls Refresh().

Parameters
pTunnelThe tunnel.
pOwnerThe seeker that owns the strip.
nIndexThe index of the seeker, used in the mesh titles.
Ghidra address:
NTSC-U/C: 0x0046e830
Ghidra address:
PAL: 0x004ac410

◆ SetMat()

void Rnd::TunnelSeekStrip::SetMat ( Mat * pMat)

Replace the material and hand it to the finest mesh of every section.

Parameters
pMatThe material, or null.
Ghidra address:
NTSC-U/C: 0x00477f18
Ghidra address:
PAL: 0x004b5b90

◆ SetColor()

void Rnd::TunnelSeekStrip::SetColor ( const Color & color)

Store a colour and recolour every section already updated.

A dirty section takes the colour when Update() next copies its geometry.

Parameters
colorThe colour.
Ghidra address:
NTSC-U/C: 0x00477e68
Ghidra address:
PAL: 0x004b5ae0

◆ DrawSection()

void Rnd::TunnelSeekStrip::DrawSection ( int nSlice,
float flScreenSize )

Draw the section placed on one slice.

Does nothing unless the section the slice selects is placed on that slice. A dirty section is updated first, and the level of detail is chosen against flScreenSize the way Rnd::LodMesh chooses it.

Parameters
nSliceThe slice being drawn.
flScreenSizeThe screen size used to pick the level of detail.
Ghidra address:
NTSC-U/C: 0x0046ec40
Ghidra address:
PAL: 0x004ac840

◆ Replace()

void Rnd::TunnelSeekStrip::Replace ( Object * pFrom,
Object * pTo,
Object * pReferrer )

Replace the material reference.

Parameters
pFromThe object being replaced.
pToThe replacement, which must be a Rnd::Mat or null.
pReferrerThe object the reference is held on behalf of.
Ghidra address:
NTSC-U/C: 0x00477db8
Ghidra address:
PAL: 0x004b5a30

Member Data Documentation

◆ mFirstSlice

int Rnd::TunnelSeekStrip::mFirstSlice

The first slice of the run.

◆ mSliceCount

int Rnd::TunnelSeekStrip::mSliceCount

The number of slices in the run.

◆ mRing

int Rnd::TunnelSeekStrip::mRing

The ring of the run.

◆ mColor

Color Rnd::TunnelSeekStrip::mColor

The vertex colour of the sections.

◆ mMat

Mat* Rnd::TunnelSeekStrip::mMat

The material of the sections.

◆ mTunnel

Tunnel* Rnd::TunnelSeekStrip::mTunnel

The tunnel, which holds the references.

◆ mOwner

TunnelSeeker* Rnd::TunnelSeekStrip::mOwner

The owning seeker.

◆ mStepNumerator

int Rnd::TunnelSeekStrip::mStepNumerator

The tunnel step numerator, truncated.

◆ mStepSize

int Rnd::TunnelSeekStrip::mStepSize

mStepNumerator divided by mStepCount.

◆ mStepCount

int Rnd::TunnelSeekStrip::mStepCount

The tunnel step divisor.

◆ mSections

std::vector<TunnelSeekSection> Rnd::TunnelSeekStrip::mSections

The section ring buffer.


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