wavelength 1.0.0
Loading...
Searching...
No Matches
RndBlur Class Reference

Motion trail that draws a mesh or a text again at the transforms it recently occupied. More...

#include <rndblur.h>

Inheritance diagram for RndBlur:
Collaboration diagram for RndBlur:

Public Member Functions

 RndBlur (const char *pszName)
 Construct a trail without a subject, recording nothing, every frame, at full falloff.
 ~RndBlur () override
 Drop the references on the subjects.
void * operator new (size_t nSize)
 Allocate a trail, billed to the class name.
void operator delete (void *pBlock)
 Release a trail.
void ListDrawObjects (std::list< RndObject * > &objects) override
 Add the objects of the mesh and of the text to a list.
void ListDrawables (std::list< RndDrawable * > &drawables) override
 Add the trail when its subject draws at the current transform or a recorded one, then the children, to a list.
int DrawShowing () override
 Draw the subject, then once per recorded transform with a falling alpha.
void DumpText (PrnStream &stream) override
 Write a description of the trail and its base.
void Save (BinStream &stream) override
 Write the version, the base, the subjects' names, the length, the rate, and the falloff.
void Replace (RndObject *pFrom, RndObject *pTo) override
 Replace a subject with another object.
const char * ClassName () const override
 Report the class name.
void Copy (const RndObject *pSource, int nFlags) override
 Copy the subjects, the length, the rate, and the falloff, and discard the recorded transforms.
void Load (BinStream &stream) override
 Read what Save() wrote.
void SetLength (int nLength)
 Set how many transforms the trail records and discard the recorded ones.
void SetRate (int nRate)
 Set how many frames pass between two recorded transforms and discard the recorded ones.
float GetFalloff () const
void SetFalloff (float fFalloff)
RndMesh * GetMesh () const
const std::list< Transform > & GetXfms () const
std::list< Transform > & GetXfms ()
Public Member Functions inherited from RndDrawable
 RndDrawable ()
 Construct a showing drawable without a highlight or children.
 ~RndDrawable () override
 Drop the references on the children.
virtual void SetShowing (int nShowing)
 Set whether the drawable draws at all.
virtual void SetHighlight (int nHighlight)
 Set whether the drawable draws with its highlight treatment.
void DumpText (PrnStream &stream) override
 Write a description of the drawable.
void Save (BinStream &stream) override
 Write the showing flag and the names of the children.
void Replace (RndObject *pFrom, RndObject *pTo) override
 Replace a child with another object.
void Copy (const RndObject *pSource, int nFlags) override
 Copy the showing flag, and the children when the flags request them.
void Load (BinStream &stream) override
 Read what Save() wrote.
RndDrawable * Parent ()
 Find the drawable whose children include this one.
void Draw ()
 Draw the drawable and then its children, when it is showing.
bool AddDraw (RndDrawable *pDraw, RndDrawable *pBefore)
 Add a child before another.
void RemoveDraw (RndDrawable *pDraw)
 Remove a child.
void ClearDraws ()
 Remove every child.
int GetShowing () const
const std::list< RndDrawable * > & GetDraws () const
Public Member Functions inherited from RndObject
 RndObject (const char *pszName)
 Construct an object and register it under a name.
virtual ~RndObject ()
 Notify every referrer, then erase the registration.
void SetName (const char *pszName)
 Register the object under a different name.
void AddRef (RndObject *pReferrer)
 Register an object as a store of a pointer to this one.
void RemoveRef (RndObject *pReferrer)
 Drop the first registration AddRef() made for a referrer.
const char * GetName () const
const std::list< RndObject * > & GetRefs () const
int GetInternal () const
void SetInternal (int nInternal)

Static Public Member Functions

static RndObject * New (const char *pszName)
 Create a trail.
Static Public Member Functions inherited from RndDrawable
static void CollectChildren (std::list< RndObject * > &objects, RndDrawable *pDrawable)
 Append every draw descendant of a drawable, depth first, each before its descendants.

Static Public Attributes

static const char * sClassName
 The class name a .rnd file writes, Blur.
static int sRev
 The format version Save() writes and Load() accepts.
static int sLoadRev
 The version Load() read last.
Static Public Attributes inherited from RndDrawable
static int sRev
 The format version Save() writes and Load() accepts.
Static Public Attributes inherited from RndObject
static constexpr int kCopyChildLists = 0x200
 The bit of the Copy() flags that copies the child lists of the mix-ins.

Protected Member Functions

void ReleaseRefs ()
 Drop the references on the subjects.
void AcquireRefs ()
 Take a reference on the subjects and discard the recorded transforms.
Protected Member Functions inherited from RndDrawable
void ReleaseDrawRefs ()
 Drop the reference on every child without emptying the list.
void AcquireDrawRefs ()
 Take a reference on every child.

Additional Inherited Members

Protected Attributes inherited from RndDrawable
int mShowing
Protected Attributes inherited from RndObject
std::list< RndObject * > mRefs
String mName

Detailed Description

Motion trail that draws a mesh or a text again at the transforms it recently occupied.

The RTTI includes the class name and records RndDrawable as the one base. A text subject takes precedence over a mesh subject, but a mesh subject supplies the material even when a text is set. The trail records a transform every mRate frames and retains the newest mLength of them.

Constructor & Destructor Documentation

◆ RndBlur()

RndBlur::RndBlur ( const char * pszName)
explicit

Construct a trail without a subject, recording nothing, every frame, at full falloff.

Parameters
pszNameThe registry key.
Ghidra address:
NTSC-U/C: 0x002200c8
Ghidra address:
PAL: 0x00228e98

◆ ~RndBlur()

RndBlur::~RndBlur ( )
override

Drop the references on the subjects.

Ghidra address:
NTSC-U/C: 0x0021fe78
Ghidra address:
PAL: 0x00228c48

Member Function Documentation

◆ operator new()

void * RndBlur::operator new ( size_t nSize)
inline

Allocate a trail, billed to the class name.

Parameters
nSizeThe object size the compiler supplies.
Returns
The block.

◆ operator delete()

void RndBlur::operator delete ( void * pBlock)
inline

Release a trail.

Parameters
pBlockThe block.

◆ ListDrawObjects()

void RndBlur::ListDrawObjects ( std::list< RndObject * > & objects)
overridevirtual

Add the objects of the mesh and of the text to a list.

The children are not added.

Parameters
objectsThe list to add to.
Ghidra address:
NTSC-U/C: 0x0021f598
Ghidra address:
PAL: 0x00228368

Reimplemented from RndDrawable.

◆ ListDrawables()

void RndBlur::ListDrawables ( std::list< RndDrawable * > & drawables)
overridevirtual

Add the trail when its subject draws at the current transform or a recorded one, then the children, to a list.

The subject is moved to each recorded transform in turn and put back afterwards.

Parameters
drawablesThe list to add to.
Ghidra address:
NTSC-U/C: 0x0021f600
Ghidra address:
PAL: 0x002283d0

Reimplemented from RndDrawable.

◆ DrawShowing()

int RndBlur::DrawShowing ( )
overridevirtual

Draw the subject, then once per recorded transform with a falling alpha.

The first step is drawn at the material alpha scaled by mFalloff, less the part of a step the countdown has used, and each later step loses an equal share. A recorded transform equal to the one before it, the first compared with the current world transform, is skipped. A mesh with depth testing draws its trail with RndMesh::kZModeZReadOnly. The subject's transforms, the material alpha, and the depth mode are restored afterwards. Every mRate frames the world transform goes to the front of mXfms, the oldest dropping once mLength are stored.

Returns
1, to draw the children.
Ghidra address:
NTSC-U/C: 0x0021f8d0
Ghidra address:
PAL: 0x002286a0

Reimplemented from RndDrawable.

◆ DumpText()

void RndBlur::DumpText ( PrnStream & stream)
overridevirtual

Write a description of the trail and its base.

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x0021ef20
Ghidra address:
PAL: 0x00227cf0

Reimplemented from RndObject.

◆ Save()

void RndBlur::Save ( BinStream & stream)
overridevirtual

Write the version, the base, the subjects' names, the length, the rate, and the falloff.

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x0021f048
Ghidra address:
PAL: 0x00227e18

Implements RndObject.

◆ Replace()

void RndBlur::Replace ( RndObject * pFrom,
RndObject * pTo )
overridevirtual

Replace a subject with another object.

A replacement of another class, or null, clears the subject.

Parameters
pFromThe object being replaced.
pToThe replacement, or null.
Ghidra address:
NTSC-U/C: 0x0021f420
Ghidra address:
PAL: 0x002281f0

Implements RndObject.

◆ ClassName()

const char * RndBlur::ClassName ( ) const
inlineoverridevirtual

Report the class name.

Returns
sClassName.
Ghidra address:
NTSC-U/C: 0x0037eff0
Ghidra address:
PAL: 0x003ed708

Implements RndObject.

◆ Copy()

void RndBlur::Copy ( const RndObject * pSource,
int nFlags )
overridevirtual

Copy the subjects, the length, the rate, and the falloff, and discard the recorded transforms.

Parameters
pSourceThe trail to copy from.
nFlagsThe set of fields to copy.
Ghidra address:
NTSC-U/C: 0x0021ee58
Ghidra address:
PAL: 0x00227c28

Implements RndObject.

◆ Load()

void RndBlur::Load ( BinStream & stream)
overridevirtual

Read what Save() wrote.

Version 1 adds the falloff and version 2 the text.

Parameters
streamThe stream to read from.
Ghidra address:
NTSC-U/C: 0x0021f158
Ghidra address:
PAL: 0x00227f28

Implements RndObject.

◆ SetLength()

void RndBlur::SetLength ( int nLength)

Set how many transforms the trail records and discard the recorded ones.

A negative length is clamped to 0 and disables the trail. The name is inferred.

Parameters
nLengthThe number of transforms.
Ghidra address:
NTSC-U/C: 0x00220390
Ghidra address:
PAL: 0x00229160

◆ SetRate()

void RndBlur::SetRate ( int nRate)

Set how many frames pass between two recorded transforms and discard the recorded ones.

A rate below 1 is clamped to 1. The name is inferred.

Parameters
nRateThe frame interval.
Ghidra address:
NTSC-U/C: 0x002203d0
Ghidra address:
PAL: 0x002291a0

◆ New()

RndObject * RndBlur::New ( const char * pszName)
inlinestatic

Create a trail.

Parameters
pszNameThe registry key.
Returns
The trail.
Ghidra address:
NTSC-U/C: 0x0037f008
Ghidra address:
PAL: 0x003ed720

◆ GetFalloff()

float RndBlur::GetFalloff ( ) const
inline
Returns
The fraction of the material alpha of the first step.

◆ SetFalloff()

void RndBlur::SetFalloff ( float fFalloff)
inline
Parameters
fFalloffThe fraction of the material alpha of the first step.

◆ GetMesh()

RndMesh * RndBlur::GetMesh ( ) const
inline
Returns
The mesh subject, or null.

◆ GetXfms() [1/2]

const std::list< Transform > & RndBlur::GetXfms ( ) const
inline
Returns
The recorded world transforms, newest first.

◆ GetXfms() [2/2]

std::list< Transform > & RndBlur::GetXfms ( )
inline
Returns
The recorded world transforms, newest first, for writing.

◆ ReleaseRefs()

void RndBlur::ReleaseRefs ( )
protected

Drop the references on the subjects.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x0021f3d0
Ghidra address:
PAL: 0x002281a0

◆ AcquireRefs()

void RndBlur::AcquireRefs ( )
protected

Take a reference on the subjects and discard the recorded transforms.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x0021f378
Ghidra address:
PAL: 0x00228148

Member Data Documentation

◆ sClassName

const char* RndBlur::sClassName
static

The class name a .rnd file writes, Blur.

Ghidra address:
NTSC-U/C: 0x003b0980
Ghidra address:
PAL: 0x0042f818

◆ sRev

int RndBlur::sRev
static

The format version Save() writes and Load() accepts.

Ghidra address:
NTSC-U/C: 0x003b0984
Ghidra address:
PAL: 0x0042f81c

◆ sLoadRev

int RndBlur::sLoadRev
static

The version Load() read last.

Ghidra address:
NTSC-U/C: 0x0043c680

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