wavelength 1.0.0
Loading...
Searching...
No Matches
RndObject Class Referenceabstract

Base of every object the renderer can load, resolve by name, and serialise. More...

#include <rndobject.h>

Inheritance diagram for RndObject:
Collaboration diagram for RndObject:

Public Member Functions

 RndObject (const char *pszName)
 Construct an object and register it under a name.
virtual ~RndObject ()
 Notify every referrer, then erase the registration.
virtual void DumpText (PrnStream &stream)
 Write a description of the object.
virtual void Save (BinStream &stream)=0
 Write the object's serialised form.
virtual void Replace (RndObject *pFrom, RndObject *pTo)=0
 Replace every stored pointer to one object with another.
virtual const char * ClassName () const =0
 Report the name of the object's most derived class.
virtual void Copy (const RndObject *pSource, int nFlags)=0
 Copy the state of another object into this one.
virtual void Load (BinStream &stream)=0
 Read the object's serialised form.
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 Attributes

static constexpr int kCopyChildLists = 0x200
 The bit of the Copy() flags that copies the child lists of the mix-ins.

Protected Attributes

std::list< RndObject * > mRefs
String mName

Detailed Description

Base of every object the renderer can load, resolve by name, and serialise.

The RTTI includes the class name and records no base. Every renderer mix-in derives from the class virtually.

Construction registers the object in TheManager under its name, and destruction erases that registration. A second object that stores a pointer to this one registers itself through AddRef(). The destructor then notifies every referrer through Replace() before the object goes away.

Constructor & Destructor Documentation

◆ RndObject()

RndObject::RndObject ( const char * pszName)
explicit

Construct an object and register it under a name.

An object already registered under the name loses its registration to this one.

Parameters
pszNameThe registry key.
Ghidra address:
NTSC-U/C: 0x0023bfa0
Ghidra address:
PAL: 0x00244b20

◆ ~RndObject()

virtual RndObject::~RndObject ( )
virtual

Notify every referrer, then erase the registration.

Adjacent duplicate referrers are collapsed first. Each referrer then has Replace() called with this object and null.

Ghidra address:
NTSC-U/C: 0x0023c0f8
Ghidra address:
PAL: 0x00244c78

Member Function Documentation

◆ DumpText()

virtual void RndObject::DumpText ( PrnStream & stream)
virtual

Write a description of the object.

The referrers are included only when the dump level of the stream is above 0.

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

Reimplemented in RndAnimatable, RndArena, RndBlur, RndButton, RndCam, RndCollideable, RndCursor, RndDrawable, RndEnviron, RndFont, RndGenerator, RndLight, RndLightAnim, RndLine, RndMat, RndMatAnim, RndMesh, RndMeshAnim, RndMovie, RndMultiMesh, RndParticleSys, RndParticleSysAnim, RndTex, RndText, RndTransAnim, RndTransformable, and RndView.

◆ Save()

virtual void RndObject::Save ( BinStream & stream)
pure virtual

◆ Replace()

virtual void RndObject::Replace ( RndObject * pFrom,
RndObject * pTo )
pure virtual

Replace every stored pointer to one object with another.

A null replacement means the object is going away and the pointer is to be dropped.

Parameters
pFromThe object being replaced.
pToThe replacement, or null.

Implemented in PsMovie, RndAnimatable, RndArena, RndBlur, RndButton, RndCam, RndCollideable, RndCursor, RndDrawable, RndEnviron, RndFont, RndGenerator, RndLight, RndLightAnim, RndLine, RndMat, RndMatAnim, RndMesh, RndMeshAnim, RndMovie, RndMultiMesh, RndParticleSys, RndParticleSysAnim, RndTex, RndText, RndTransAnim, RndTransformable, and RndView.

◆ ClassName()

virtual const char * RndObject::ClassName ( ) const
pure virtual

Report the name of the object's most derived class.

Returns
The type name a .rnd file writes for the class.

Implemented in RndArena, RndBlur, RndButton, RndCam, RndCursor, RndEnviron, RndFont, RndGenerator, RndLight, RndLightAnim, RndLine, RndMat, RndMatAnim, RndMesh, RndMeshAnim, RndMovie, RndMultiMesh, RndParticleSys, RndParticleSysAnim, RndTex, RndText, RndTransAnim, and RndView.

◆ Copy()

virtual void RndObject::Copy ( const RndObject * pSource,
int nFlags )
pure virtual

Copy the state of another object into this one.

Parameters
pSourceThe object to copy from.
nFlagsThe set of fields to copy.

Implemented in PsMesh, RndAnimatable, RndArena, RndBlur, RndButton, RndCam, RndCollideable, RndCursor, RndDrawable, RndEnviron, RndFont, RndGenerator, RndLight, RndLightAnim, RndLine, RndMat, RndMatAnim, RndMesh, RndMeshAnim, RndMovie, RndMultiMesh, RndParticleSys, RndParticleSysAnim, RndTex, RndText, RndTransAnim, RndTransformable, and RndView.

◆ Load()

virtual void RndObject::Load ( BinStream & stream)
pure virtual

◆ SetName()

void RndObject::SetName ( const char * pszName)

Register the object under a different name.

A name equal to the current one changes nothing. Otherwise every registration under the current name is erased first.

Parameters
pszNameThe new registry key.
Ghidra address:
NTSC-U/C: 0x0023c380
Ghidra address:
PAL: 0x00244f00

◆ AddRef()

void RndObject::AddRef ( RndObject * pReferrer)

Register an object as a store of a pointer to this one.

The object itself is not registered. The same referrer may register more than once.

Parameters
pReferrerThe object that stores a pointer to this one.
Ghidra address:
NTSC-U/C: 0x0023c750
Ghidra address:
PAL: 0x002452d0

◆ RemoveRef()

void RndObject::RemoveRef ( RndObject * pReferrer)

Drop the first registration AddRef() made for a referrer.

The destructor's walk of the referrers is not disturbed. While it runs, the call does nothing.

Parameters
pReferrerThe object whose registration is to be dropped.
Ghidra address:
NTSC-U/C: 0x0023c7e8
Ghidra address:
PAL: 0x00245368

◆ GetName()

const char * RndObject::GetName ( ) const
inline
Returns
The registry key.

◆ GetRefs()

const std::list< RndObject * > & RndObject::GetRefs ( ) const
inline
Returns
The objects that store a pointer to this one.

◆ GetInternal()

int RndObject::GetInternal ( ) const
inline
Returns
Non-zero for an object the renderer made, not a file.

◆ SetInternal()

void RndObject::SetInternal ( int nInternal)
inline
Parameters
nInternalNon-zero for an object the renderer made, not a file.

Member Data Documentation

◆ kCopyChildLists

int RndObject::kCopyChildLists = 0x200
staticconstexpr

The bit of the Copy() flags that copies the child lists of the mix-ins.

◆ mRefs

std::list<RndObject *> RndObject::mRefs
protected

Objects that store a pointer to this one.

◆ mName

String RndObject::mName
protected

Registry key.


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