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

Ribbons that trace durable gems along the tunnel lanes. More...

#include <durgemtrails.h>

Public Types

enum  { kSegmentPointCount = 9 }
 The number of subdivision points AddSegment() places on one segment. More...

Public Member Functions

 DurGemTrails (AppTunnel *pTunnel, int nMaxPoints)
 Allocate the row table and six strips, and resolve the view "tnl strings".
 ~DurGemTrails ()
 Delete the row strings and the strips.
void CreateLane (float flWidth, int nLane, Rnd::Mat *pMat)
 Create the row strings of lane nLane for every slice row.
void AddSegment (int nLane, const Color &color, float flStartFrame, float flStartBlend, float flEndFrame, float flEndBlend)
 Add a segment of lane nLane between two tunnel positions.
void EndTrail (int nLane, int nRow)
 Clear the row string of lane nLane in slice row nRow and erase the curves of that lane and row.
void StartStrip (int nLane, const Color &color, int nId, float flFrame, float flBlend)
 Hand a new live trail to the first free strip.
void StopStrip (int nId, float flFrame)
 Stop the live trail nId at flFrame.
void Update (float flFrame)
 Show the ribbons of the slice rows from 480 frames behind flFrame onward and advance the strips.

Static Public Member Functions

static HxStr NewStringName ()
 Increment g_nDurGemStringCount and format the next ribbon name.

Detailed Description

Ribbons that trace durable gems along the tunnel lanes.

The class is not polymorphic and emits no RTTI. No descriptor, tag, or file path identifies it, and its name is inferred from the DurGemMsg handlers of AppTunnel that drive it and from the trails it draws. AppTunnel allocates one (0x30 bytes) and stores it at +0x88.

Straight segments go to a DurGemRowString per lane and slice row, curved segments to a DurGemCurve in a list sorted by row, and live trails to one of six DurGemStrip records. Every ribbon is added to the view "tnl strings". Update() shows the rows from the playhead onward, up to mMaxPoints ribbon points, and reports where the ribbons cross the playhead plane.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

The number of subdivision points AddSegment() places on one segment.

Enumerator
kSegmentPointCount 

Constructor & Destructor Documentation

◆ DurGemTrails()

DurGemTrails::DurGemTrails ( AppTunnel * pTunnel,
int nMaxPoints )

Allocate the row table and six strips, and resolve the view "tnl strings".

The table has room for eight lanes over eight slice rows, and every entry starts null until CreateLane() fills it.

Parameters
pTunnelThe owner and receiver of the crossing points Update() finds.
nMaxPointsThe most ribbon points Update() shows at once.
Ghidra address:
NTSC-U/C: 0x00432f60
Ghidra address:
PAL: 0x0046ecb0

◆ ~DurGemTrails()

DurGemTrails::~DurGemTrails ( )

Delete the row strings and the strips.

The curve list and the two vectors are torn down by their compiler-generated destructors.

Ghidra address:
NTSC-U/C: 0x00433320
Ghidra address:
PAL: 0x0046f090

Member Function Documentation

◆ CreateLane()

void DurGemTrails::CreateLane ( float flWidth,
int nLane,
Rnd::Mat * pMat )

Create the row strings of lane nLane for every slice row.

Parameters
flWidthThe width of each ribbon.
pMatThe material each ribbon draws with.
nLaneThe lane to fill.
Ghidra address:
NTSC-U/C: 0x004377f0
Ghidra address:
PAL: 0x00473588

◆ AddSegment()

void DurGemTrails::AddSegment ( int nLane,
const Color & color,
float flStartFrame,
float flStartBlend,
float flEndFrame,
float flEndBlend )

Add a segment of lane nLane between two tunnel positions.

The segment is subdivided until every midpoint lies within 0.01 of the chord. A segment that needs no midpoint goes to the row string of its start row as a straight line. Otherwise a DurGemCurve through the subdivision points is inserted before the first curve of the same or a later row, with the material and width of that row string.

Parameters
nLaneThe lane the segment follows.
colorThe colour of the segment.
flStartFrameThe tunnel frame of the start.
flStartBlendThe position across the lane at the start.
flEndFrameThe tunnel frame of the end.
flEndBlendThe position across the lane at the end.
Ghidra address:
NTSC-U/C: 0x004337d8
Ghidra address:
PAL: 0x0046f548

◆ EndTrail()

void DurGemTrails::EndTrail ( int nLane,
int nRow )

Clear the row string of lane nLane in slice row nRow and erase the curves of that lane and row.

Parameters
nLaneThe lane to clear.
nRowThe slice row to clear.
Ghidra address:
NTSC-U/C: 0x00433c40
Ghidra address:
PAL: 0x0046f9b0

◆ StartStrip()

void DurGemTrails::StartStrip ( int nLane,
const Color & color,
int nId,
float flFrame,
float flBlend )

Hand a new live trail to the first free strip.

The strip takes the material and width of the row-0 string of nLane. The trail is dropped when every strip is in use.

Parameters
nLaneThe lane the trail follows.
colorThe colour of the trail.
nIdThe identifier of the trail.
flFrameThe tunnel frame the trail starts at.
flBlendThe position across the lane.
Ghidra address:
NTSC-U/C: 0x00433db0
Ghidra address:
PAL: 0x0046fb20

◆ StopStrip()

void DurGemTrails::StopStrip ( int nId,
float flFrame )

Stop the live trail nId at flFrame.

Parameters
nIdThe identifier of the trail.
flFrameThe tunnel frame the trail ends at.
Ghidra address:
NTSC-U/C: 0x00437a60
Ghidra address:
PAL: 0x004737f8

◆ Update()

void DurGemTrails::Update ( float flFrame)

Show the ribbons of the slice rows from 480 frames behind flFrame onward and advance the strips.

Curves of rows behind the first shown row are erased. Ribbons past mMaxPoints points are hidden. Each crossing of the playhead plane by a ribbon of the first two rows, and the head of each live strip, goes to mTunnel.

Parameters
flFrameThe current tunnel frame.
Ghidra address:
NTSC-U/C: 0x00433f80
Ghidra address:
PAL: 0x0046fcf0

◆ NewStringName()

HxStr DurGemTrails::NewStringName ( )
static

Increment g_nDurGemStringCount and format the next ribbon name.

The three ribbon owners inline the body.

Returns
The new count formatted with the literal at 0x0081a768, four digits in angle brackets after a fixed prefix.
Ghidra address:
NTSC-U/C: 0x00436e38
Ghidra address:
PAL: 0x00472bd0

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