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

One section of a Rnd::TunnelSeekStrip, a copy of the tunnel's cell geometry placed on one slice. More...

#include <tunnelseeksection.h>

Collaboration diagram for Rnd::TunnelSeekSection:

Public Member Functions

 TunnelSeekSection ()
 Construct an unplaced section.
void Set (int nSlice, int nRing, int bEndCap, int bStartCap)
 Place the section on a slice and ring, marking it dirty.
void Invalidate ()
 Remove the section from its slice, marking it dirty.
void Build (const HxStr &name, const LodMesh &templates)
 Create one mesh per level of the tunnel's first cell, sharing that cell's triangles.
void Update (Tunnel *pTunnel, const Color &color)
 Copy the geometry of the tunnel cell the section is placed on and clear mDirty.

Public Attributes

int mDirty
int mEndCap
int mStartCap
LodMesh mMeshes
int mRing
int mSlice

Detailed Description

One section of a Rnd::TunnelSeekStrip, a copy of the tunnel's cell geometry placed on one slice.

The record is not polymorphic and has no RTTI, and the image retains no title for it. The name is inferred from the format "[%s_seek%d.%d]" that labels its meshes with the strip index and then this section's index.

The record is 0x20 bytes, the element size of the section vector of Rnd::TunnelSeekStrip. Its destructor is the implicit one, emitted at 0x00478018, which deletes the meshes through Rnd::LodMesh. Its copy constructor is the implicit one, emitted at 0x00471e28. It copies the three leading words, mMeshes, and the two trailing words.

mDirty defers the geometry copy. Set() only records the slice, and Update() copies the vertices of the matching tunnel cell the next time the section is drawn.

Constructor & Destructor Documentation

◆ TunnelSeekSection()

Rnd::TunnelSeekSection::TunnelSeekSection ( )

Construct an unplaced section.

Sets mRing to -1 and mSlice to kTunnelSeekNoSlice. The other scalar members are left unset.

Ghidra address:
NTSC-U/C: 0x0046ed38
Ghidra address:
PAL: 0x004ac938

Member Function Documentation

◆ Set()

void Rnd::TunnelSeekSection::Set ( int nSlice,
int nRing,
int bEndCap,
int bStartCap )

Place the section on a slice and ring, marking it dirty.

Parameters
nSliceThe slice.
nRingThe ring.
bEndCapWhether the section is the last of its strip.
bStartCapWhether the section is the first of its strip.
Ghidra address:
NTSC-U/C: 0x004780d0
Ghidra address:
PAL: 0x004b5d48

◆ Invalidate()

void Rnd::TunnelSeekSection::Invalidate ( )

Remove the section from its slice, marking it dirty.

Ghidra address:
NTSC-U/C: 0x004780f0
Ghidra address:
PAL: 0x004b5d68

◆ Build()

void Rnd::TunnelSeekSection::Build ( const HxStr & name,
const LodMesh & templates )

Create one mesh per level of the tunnel's first cell, sharing that cell's triangles.

Builds mMeshes with an internal title, points each level at the matching template level for its faces, and copies the screen size thresholds. The finest level then draws with kZModeZReadOnly and kZFuncEqual, which carries down the chain.

Parameters
nameThe base title of the meshes.
templatesThe chain whose triangles and thresholds to share.
Ghidra address:
NTSC-U/C: 0x0046ed78
Ghidra address:
PAL: 0x004ac978

◆ Update()

void Rnd::TunnelSeekSection::Update ( Tunnel * pTunnel,
const Color & color )

Copy the geometry of the tunnel cell the section is placed on and clear mDirty.

The vertices are copied from the finest level of the cell into the finest level of this section, recoloured with color, and given texture coordinates. The vertices are two rows. The first row takes the horizontal coordinate 0 and the second 1, and every vertex takes the vertical coordinate 0.5. A start cap overrides the vertical coordinate of the last vertex of each row to 0, and an end cap that of the first vertex of each row to 1. The mesh is then resynchronised whole.

Parameters
pTunnelThe tunnel.
colorThe vertex colour.
Ghidra address:
NTSC-U/C: 0x0046ee80
Ghidra address:
PAL: 0x004aca80

Member Data Documentation

◆ mDirty

int Rnd::TunnelSeekSection::mDirty

Set until Update() has copied the geometry. +0x00

◆ mEndCap

int Rnd::TunnelSeekSection::mEndCap

Set for the last section of the strip. +0x04

◆ mStartCap

int Rnd::TunnelSeekSection::mStartCap

Set for the first section of the strip. +0x08

◆ mMeshes

LodMesh Rnd::TunnelSeekSection::mMeshes

The generated meshes, finest first. +0x0c

◆ mRing

int Rnd::TunnelSeekSection::mRing

The ring the section sits on. +0x18

◆ mSlice

int Rnd::TunnelSeekSection::mSlice

The slice, or kTunnelSeekNoSlice. +0x1c


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