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

Live trail of one held durable gem, a two-point ribbon that grows with the playhead. More...

#include <durgemstrip.h>

Public Member Functions

 DurGemStrip (Rnd::View *pView)
 Create the free strip's hidden two-point ribbon and add it to pView.
 ~DurGemStrip ()
 Delete the ribbon.
bool Start (int nLane, const Color &color, int nId, float flFrame, float flBlend, float flWidth, Rnd::Mat *pMat)
 Claim the strip for trail nId when it is free.
void Update (float flFrame)
 Extend the head of the trail to flFrame and free the strip once the trail is behind.
bool Stop (int nId, float flFrame)
 Extend and then stop the trail when it is trail nId.
bool GetHeadPos (float flFrame, Vector3 *pOut)
 Report the lane position at flFrame when flFrame lies on the trail.

Detailed Description

Live trail of one held durable gem, a two-point ribbon that grows with the playhead.

The class is not polymorphic and emits no RTTI. No descriptor, tag, or file path identifies it, and its name is inferred from the growing two-point strip it draws. DurGemTrails allocates six with the untagged scalar allocator (0x1c bytes) and hands each new trail to the first free one.

The trail runs from mStart to mEnd along lane mLane, at most 720 frames long. Once stopped, it stays in place until the playhead passes mEnd by 480 frames and the strip is freed.

Constructor & Destructor Documentation

◆ DurGemStrip()

DurGemStrip::DurGemStrip ( Rnd::View * pView)
explicit

Create the free strip's hidden two-point ribbon and add it to pView.

The ribbon takes the next DurGemTrails::NewStringName() name.

Parameters
pViewThe view that draws the ribbon.
Ghidra address:
NTSC-U/C: 0x004329e8
Ghidra address:
PAL: 0x0046e6f8

◆ ~DurGemStrip()

DurGemStrip::~DurGemStrip ( )

Delete the ribbon.

The destructor of DurGemTrails inlines it. The out-of-line copy is the deleting form, which frees the object only when bit 0 of the flag is set, and it has no caller. Its place at the head of this unit, ahead of Start(), is what assigns it to this class rather than to DurGemRowString, whose destructor has the same body.

Ghidra address:
NTSC-U/C: 0x004372d8
Ghidra address:
PAL: 0x00473070

Member Function Documentation

◆ Start()

bool DurGemStrip::Start ( int nLane,
const Color & color,
int nId,
float flFrame,
float flBlend,
float flWidth,
Rnd::Mat * pMat )

Claim the strip for trail nId when it is free.

Both ends start at flFrame. DurGemTrails::StartStrip() inlines the body.

Parameters
nLaneThe lane the trail follows.
colorThe colour of both ends.
nIdThe identifier of the trail.
flFrameThe tunnel frame the trail starts at.
flBlendThe position across the lane.
flWidthThe width of the ribbon.
pMatThe material the ribbon draws with.
Returns
True when the strip was free and now draws the trail.
Ghidra address:
NTSC-U/C: 0x00437340
Ghidra address:
PAL: 0x004730d8

◆ Update()

void DurGemStrip::Update ( float flFrame)

Extend the head of the trail to flFrame and free the strip once the trail is behind.

A stopped trail does not extend. A trail longer than 720 frames moves its tail up behind the head. The strip is hidden and freed once flFrame passes mEnd by more than 480 frames.

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

◆ Stop()

bool DurGemStrip::Stop ( int nId,
float flFrame )

Extend and then stop the trail when it is trail nId.

DurGemTrails::StopStrip() inlines the body.

Parameters
nIdThe identifier of the trail to stop.
flFrameThe tunnel frame the trail ends at.
Returns
True when the strip drew trail nId.
Ghidra address:
NTSC-U/C: 0x00437480
Ghidra address:
PAL: 0x00473218

◆ GetHeadPos()

bool DurGemStrip::GetHeadPos ( float flFrame,
Vector3 * pOut )

Report the lane position at flFrame when flFrame lies on the trail.

DurGemTrails::Update() inlines the body.

Parameters
flFrameThe tunnel frame to test.
pOutReceives the position.
Returns
True when the strip is in use and flFrame lies between mStart and mEnd.
Ghidra address:
NTSC-U/C: 0x004374c0
Ghidra address:
PAL: 0x00473258

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