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

Mix-in for an object that draws itself and then a list of other drawables. More...

#include <rnddrawable.h>

Inheritance diagram for RndDrawable:
Collaboration diagram for RndDrawable:

Public Member Functions

 RndDrawable ()
 Construct a showing drawable without a highlight or children.
 ~RndDrawable () override
 Drop the references on the children.
virtual void ListDrawObjects (std::list< RndObject * > &objects)
 Add the objects the drawable uses to a list.
virtual void ListDrawables (std::list< RndDrawable * > &drawables)
 Add the drawables to draw this frame to a list.
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.
virtual int DrawShowing ()
 Draw the drawable alone.
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.
virtual const char * ClassName () const =0
 Report the name of the object's most derived class.
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 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 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 ReleaseDrawRefs ()
 Drop the reference on every child without emptying the list.
void AcquireDrawRefs ()
 Take a reference on every child.

Protected Attributes

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

Detailed Description

Mix-in for an object that draws itself and then a list of other drawables.

The RTTI includes the class name and records RndObject as a virtual base. Every entry of mDraws registers this object as a referrer through RndObject::AddRef(). A drawable that goes away is therefore removed from its parents' lists by Replace().

Constructor & Destructor Documentation

◆ RndDrawable()

RndDrawable::RndDrawable ( )
inline

Construct a showing drawable without a highlight or children.

The constructor has no out-of-line copy.

◆ ~RndDrawable()

RndDrawable::~RndDrawable ( )
override

Drop the references on the children.

Ghidra address:
NTSC-U/C: 0x003809b8
Ghidra address:
PAL: 0x003ef0d0

Member Function Documentation

◆ ListDrawObjects()

virtual void RndDrawable::ListDrawObjects ( std::list< RndObject * > & objects)
virtual

Add the objects the drawable uses to a list.

The base body adds nothing. The name is inferred.

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

Reimplemented in RndBlur, RndCam, RndCursor, RndEnviron, RndGenerator, RndLine, RndMesh, RndMultiMesh, RndParticleSys, and RndText.

◆ ListDrawables()

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

Add the drawables to draw this frame to a list.

The base body adds the drawables of the children. The name is inferred.

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

Reimplemented in RndBlur, RndCam, RndCursor, RndGenerator, RndLine, RndMesh, RndMultiMesh, RndParticleSys, RndText, and RndView.

◆ SetShowing()

virtual void RndDrawable::SetShowing ( int nShowing)
inlinevirtual

Set whether the drawable draws at all.

Parameters
nShowingNon-zero to draw.
Ghidra address:
NTSC-U/C: 0x00380b00
Ghidra address:
PAL: 0x003ef218

Reimplemented in RndText.

◆ SetHighlight()

virtual void RndDrawable::SetHighlight ( int nHighlight)
virtual

Set whether the drawable draws with its highlight treatment.

Parameters
nHighlightNon-zero to highlight.
Ghidra address:
NTSC-U/C: 0x00224a90
Ghidra address:
PAL: 0x0022d848

Reimplemented in RndLine, and RndText.

◆ DrawShowing()

virtual int RndDrawable::DrawShowing ( )
inlinevirtual

Draw the drawable alone.

The base body draws nothing and reports that the children are still to be drawn.

Returns
Non-zero when the children are to be drawn as well.
Ghidra address:
NTSC-U/C: 0x00380b08
Ghidra address:
PAL: 0x003ef220

Reimplemented in PsCam, PsEnviron, PsMesh, PsMultiMesh, PsParticleSys, RndArena, RndBlur, RndCam, RndCursor, RndEnviron, RndGenerator, RndLine, RndMultiMesh, RndText, and RndView.

◆ DumpText()

void RndDrawable::DumpText ( PrnStream & stream)
overridevirtual

Write a description of the drawable.

Nothing is written unless the dump level of the stream is above 0.

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

Reimplemented from RndObject.

Reimplemented in RndEnviron, RndGenerator, RndLine, RndMesh, RndMultiMesh, RndParticleSys, RndText, RndTransAnim, and RndView.

◆ Save()

void RndDrawable::Save ( BinStream & stream)
overridevirtual

Write the showing flag and the names of the children.

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

Implements RndObject.

Reimplemented in RndEnviron, RndGenerator, RndLine, RndMesh, RndMultiMesh, RndParticleSys, RndText, RndTransAnim, and RndView.

◆ Replace()

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

Replace a child with another object.

A replacement that is not a drawable, or null, removes the child.

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

Implements RndObject.

Reimplemented in RndEnviron, RndGenerator, RndLine, RndMesh, RndMultiMesh, RndParticleSys, RndText, RndTransAnim, and RndView.

◆ Copy()

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

Copy the showing flag, and the children when the flags request them.

Parameters
pSourceThe drawable to copy from.
nFlagsThe set of fields to copy. RndObject::kCopyChildLists copies the children.
Ghidra address:
NTSC-U/C: 0x00224528
Ghidra address:
PAL: 0x0022d2f8

Implements RndObject.

Reimplemented in RndEnviron, RndGenerator, RndLine, RndMesh, RndMultiMesh, RndParticleSys, RndText, RndTransAnim, and RndView.

◆ Load()

void RndDrawable::Load ( BinStream & stream)
overridevirtual

Read what Save() wrote.

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

Implements RndObject.

Reimplemented in RndEnviron, RndGenerator, RndLine, RndMesh, RndMultiMesh, RndParticleSys, RndText, RndTransAnim, and RndView.

◆ Parent()

RndDrawable * RndDrawable::Parent ( )

Find the drawable whose children include this one.

The referrers are searched in the order they registered.

Returns
The parent, or null.
Ghidra address:
NTSC-U/C: 0x002240e8
Ghidra address:
PAL: 0x0022ceb8

◆ Draw()

void RndDrawable::Draw ( )

Draw the drawable and then its children, when it is showing.

Ghidra address:
NTSC-U/C: 0x00224238
Ghidra address:
PAL: 0x0022d008

◆ AddDraw()

bool RndDrawable::AddDraw ( RndDrawable * pDraw,
RndDrawable * pBefore )

Add a child before another.

A drawable already among the children is not added again.

Parameters
pDrawThe new child.
pBeforeThe child to insert before, or null to append.
Returns
Whether the child was added.
Ghidra address:
NTSC-U/C: 0x002247f8
Ghidra address:
PAL: 0x0022d5b0

◆ RemoveDraw()

void RndDrawable::RemoveDraw ( RndDrawable * pDraw)

Remove a child.

Parameters
pDrawThe child.
Ghidra address:
NTSC-U/C: 0x00224918
Ghidra address:
PAL: 0x0022d6d0

◆ ClearDraws()

void RndDrawable::ClearDraws ( )

Remove every child.

Ghidra address:
NTSC-U/C: 0x002249e8
Ghidra address:
PAL: 0x0022d7a0

◆ CollectChildren()

void RndDrawable::CollectChildren ( std::list< RndObject * > & objects,
RndDrawable * pDrawable )
inlinestatic

Append every draw descendant of a drawable, depth first, each before its descendants.

Each unit that uses the inline routine emits a copy. The first address is the copy of RndManager, and the second the copy of UIList.

Parameters
objectsThe list to append to.
pDrawableThe drawable to start from, or null.
Ghidra address:
NTSC-U/C: 0x002380b0
Ghidra address:
PAL: 0x00240c30
Ghidra address:
NTSC-U/C: 0x00205630
Ghidra address:
PAL: 0x0020e3e8

◆ GetShowing()

int RndDrawable::GetShowing ( ) const
inline
Returns
Non-zero to draw.

◆ GetDraws()

const std::list< RndDrawable * > & RndDrawable::GetDraws ( ) const
inline
Returns
The children, drawn after the drawable.

◆ ReleaseDrawRefs()

void RndDrawable::ReleaseDrawRefs ( )
protected

Drop the reference on every child without emptying the list.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x00224640
Ghidra address:
PAL: 0x0022d408

◆ AcquireDrawRefs()

void RndDrawable::AcquireDrawRefs ( )
protected

Take a reference on every child.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x002246c8
Ghidra address:
PAL: 0x0022d490

Member Data Documentation

◆ sRev

int RndDrawable::sRev
static

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

Ghidra address:
NTSC-U/C: 0x003b09a4

◆ mShowing

int RndDrawable::mShowing
protected

Non-zero to draw.


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