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

Cursor that sweeps along one line of text, hiding the characters it has not reached. More...

#include <rndcursor.h>

Inheritance diagram for RndCursor:
Collaboration diagram for RndCursor:

Public Member Functions

 RndCursor (const char *pszName)
 Construct a cursor without a text or a blur, offset by -0.1 and resting 0.8 of a frame.
 ~RndCursor () override
 Drop the references and delete the mask and the internal blur.
void * operator new (size_t nSize)
 Allocate a cursor, billed to the class name.
void operator delete (void *pBlock)
 Release a cursor.
float EndFrame () override
 Report the last frame, the length of the text plus the rest at the end.
void ListDrawObjects (std::list< RndObject * > &objects) override
 Add the objects of the blur and of the text to a list.
void ListDrawables (std::list< RndDrawable * > &drawables) override
 Add the drawables of the text, then the children, to a list.
int DrawShowing () override
 Move the mask and the internal blur to the cursor position and draw them with the text.
void DumpText (PrnStream &stream) override
 Write a description of the cursor and its bases.
void Save (BinStream &stream) override
 Write the cursor and its bases.
void Replace (RndObject *pFrom, RndObject *pTo) override
 Replace a referenced text or blur with another, and rebuild what depends on it.
const char * ClassName () const override
 Report the class name.
void Copy (const RndObject *pSource, int nFlags) override
 Copy another cursor and its bases.
void Load (BinStream &stream) override
 Read what Save() wrote.
void SetText (RndText *pText)
 Set the text the cursor sweeps, then rebuild the mask.
void AcquireRefs ()
 Take the references on the text and the blur, then build the mask and the internal blur.
void ReleaseRefs ()
 Drop the references on the text and the blur, and delete the mask and the internal blur.
void BuildCursor ()
 Replace the internal blur with a copy of mBlur, whose mesh is not drawn by itself.
void BuildMask ()
 Replace the mask with a quad over the line of the text, and measure the line.
float CursorPos ()
 Report the character the cursor has reached, resting on each for mStutter of a frame.
Public Member Functions inherited from RndAnimatable
 RndAnimatable ()
 Construct an animatable at frame 0 without children or filters.
 ~RndAnimatable () override
 Drop the references on the children and delete the filters.
virtual void ListAnimObjects (std::list< RndObject * > &objects)
 Add the objects the animation uses to a list.
virtual int SetFrameSelf (float fFrame)
 Apply a filtered frame to this object alone.
RndAnimatable * Parent ()
 Find the animatable whose children include this one.
void SetFrame (float fFrame)
 Filter a frame, apply it, and pass the result on to the children.
float FilterFrame (float fValue)
 Run a frame through the filters.
float UnfilterFrame (float fValue)
 Run a filtered frame back through the filters, last first.
float ChildrenEndFrame ()
 Report the latest end frame of the children, unfiltered through this animatable.
bool AddAnim (RndAnimatable *pAnim)
 Append a child.
void RemoveAnim (RndAnimatable *pAnim)
 Remove a child.
void RemoveAllAnims ()
 Remove every child.
const std::list< Filter * > & GetFilters () const
float GetFrame () const
float GetFilteredFrame () const
const std::list< RndAnimatable * > & GetAnims () const
std::list< Filter * > & GetFilters ()
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)
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

Static Public Member Functions

static RndObject * New (const char *pszName)
 Create a cursor.
Static Public Member Functions inherited from RndAnimatable
static Filter * NewFilter (int nType)
 Create a filter stage of a type, with its parameters unset.
static void CollectChildren (std::list< RndObject * > &objects, RndAnimatable *pAnimatable)
 Append every animation descendant of an animatable, depth first, each before its descendants.
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, Cursor.
static int sRev
 The format version Save() writes and Load() accepts.
static int sLoadRev
 The version Load() read last.
Static Public Attributes inherited from RndAnimatable
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.
Static Public Attributes inherited from RndDrawable
static int sRev
 The format version Save() writes and Load() accepts.

Additional Inherited Members

Public Types inherited from RndAnimatable
enum  FilterType {
  kFilterScaleOffset = 0 , kFilterMinMaxLoop = 1 , kFilterZeroOrder = 2 , kFilterFirstOrder = 3 ,
  kFilterSecondOrder = 4
}
 The type tags of the filters, as Save() writes them. More...
Protected Member Functions inherited from RndAnimatable
void ReleaseObjects ()
 Drop the references on the children without emptying the list, and delete the filters.
void AcquireAnimRefs ()
 Take a reference on every child.
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.
Protected Attributes inherited from RndAnimatable
std::list< RndAnimatable * > mAnims
std::list< Filter * > mFilters
float mFrame
float mFilteredFrame
Protected Attributes inherited from RndObject
std::list< RndObject * > mRefs
String mName
Protected Attributes inherited from RndDrawable
int mShowing

Detailed Description

Cursor that sweeps along one line of text, hiding the characters it has not reached.

The RTTI includes the class name and records RndAnimatable and RndDrawable as bases. The frame counts characters. A mask mesh in front of the text hides the characters past the cursor, and an internal copy of mBlur marks the cursor position. The cursor rests on each character for mStutter of a frame before it moves on.

Constructor & Destructor Documentation

◆ RndCursor()

RndCursor::RndCursor ( const char * pszName)
explicit

Construct a cursor without a text or a blur, offset by -0.1 and resting 0.8 of a frame.

Parameters
pszNameThe registry key.
Ghidra address:
NTSC-U/C: 0x00223c80
Ghidra address:
PAL: 0x0022ca50

◆ ~RndCursor()

RndCursor::~RndCursor ( )
override

Drop the references and delete the mask and the internal blur.

Ghidra address:
NTSC-U/C: 0x00223930
Ghidra address:
PAL: 0x0022c700

Member Function Documentation

◆ operator new()

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

Allocate a cursor, billed to the class name.

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

◆ operator delete()

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

Release a cursor.

Parameters
pBlockThe block.

◆ EndFrame()

float RndCursor::EndFrame ( )
overridevirtual

Report the last frame, the length of the text plus the rest at the end.

Returns
The frame.
Ghidra address:
NTSC-U/C: 0x00223600
Ghidra address:
PAL: 0x0022c3d0

Reimplemented from RndAnimatable.

◆ ListDrawObjects()

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

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

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

Reimplemented from RndDrawable.

◆ ListDrawables()

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

Add the drawables of the text, then the children, to a list.

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

Reimplemented from RndDrawable.

◆ DrawShowing()

int RndCursor::DrawShowing ( )
overridevirtual

Move the mask and the internal blur to the cursor position and draw them with the text.

Nothing is drawn while the text is missing or hidden. The internal blur is collapsed before the first character and after the last.

Returns
1.
Ghidra address:
NTSC-U/C: 0x00223668
Ghidra address:
PAL: 0x0022c438

Reimplemented from RndDrawable.

◆ DumpText()

void RndCursor::DumpText ( PrnStream & stream)
overridevirtual

Write a description of the cursor and its bases.

The mask and the internal blur are listed at a dump level of 2 and above.

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

Reimplemented from RndAnimatable.

◆ Save()

void RndCursor::Save ( BinStream & stream)
overridevirtual

Write the cursor and its bases.

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

Reimplemented from RndAnimatable.

◆ Replace()

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

Replace a referenced text or blur with another, and rebuild what depends on it.

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

Reimplemented from RndAnimatable.

◆ ClassName()

const char * RndCursor::ClassName ( ) const
inlineoverridevirtual

Report the class name.

Returns
sClassName.
Ghidra address:
NTSC-U/C: 0x00380180
Ghidra address:
PAL: 0x003ee898

Implements RndObject.

◆ Copy()

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

Copy another cursor and its bases.

Parameters
pSourceThe cursor to copy from.
nFlagsThe set of fields to copy.
Ghidra address:
NTSC-U/C: 0x002227d0
Ghidra address:
PAL: 0x0022b5a0

Reimplemented from RndAnimatable.

◆ Load()

void RndCursor::Load ( BinStream & stream)
overridevirtual

Read what Save() wrote.

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

Reimplemented from RndAnimatable.

◆ SetText()

void RndCursor::SetText ( RndText * pText)

Set the text the cursor sweeps, then rebuild the mask.

Parameters
pTextThe text, or null.
Ghidra address:
NTSC-U/C: 0x00224080
Ghidra address:
PAL: 0x0022ce50

◆ AcquireRefs()

void RndCursor::AcquireRefs ( )

Take the references on the text and the blur, then build the mask and the internal blur.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x00222d30
Ghidra address:
PAL: 0x0022bb00

◆ ReleaseRefs()

void RndCursor::ReleaseRefs ( )

Drop the references on the text and the blur, and delete the mask and the internal blur.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x00223318
Ghidra address:
PAL: 0x0022c0e8

◆ BuildCursor()

void RndCursor::BuildCursor ( )

Replace the internal blur with a copy of mBlur, whose mesh is not drawn by itself.

A blur without a mesh gives no internal blur. The name is inferred.

Ghidra address:
NTSC-U/C: 0x00222d90
Ghidra address:
PAL: 0x0022bb60

◆ BuildMask()

void RndCursor::BuildMask ( )

Replace the mask with a quad over the line of the text, and measure the line.

Text without a font gives no mask, and text of more than one line is refused with a notice. The name is inferred.

Ghidra address:
NTSC-U/C: 0x00222eb0
Ghidra address:
PAL: 0x0022bc80

◆ CursorPos()

float RndCursor::CursorPos ( )

Report the character the cursor has reached, resting on each for mStutter of a frame.

The name is inferred.

Returns
The position, in characters.
Ghidra address:
NTSC-U/C: 0x00223598
Ghidra address:
PAL: 0x0022c368

◆ New()

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

Create a cursor.

Parameters
pszNameThe registry key.
Returns
The cursor.
Ghidra address:
NTSC-U/C: 0x00380190
Ghidra address:
PAL: 0x003ee8a8

Member Data Documentation

◆ sClassName

const char* RndCursor::sClassName
static

The class name a .rnd file writes, Cursor.

Ghidra address:
NTSC-U/C: 0x003b099c
Ghidra address:
PAL: 0x0042f834

◆ sRev

int RndCursor::sRev
static

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

Ghidra address:
NTSC-U/C: 0x003b09a0
Ghidra address:
PAL: 0x0042f838

◆ sLoadRev

int RndCursor::sLoadRev
static

The version Load() read last.

Ghidra address:
NTSC-U/C: 0x0043c684

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