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

Selectable widget, as a mesh and a text with a material and a font for each state. More...

#include <rndbutton.h>

Inheritance diagram for RndButton:
Collaboration diagram for RndButton:

Public Member Functions

 RndButton (const char *pszName)
 Construct a button in state 0 without targets and with four empty entries in each palette.
 ~RndButton () override
 Drop the references on the targets and on every palette entry.
void * operator new (size_t nSize)
 Allocate a button, billed to the class name.
void operator delete (void *pBlock)
 Release a button.
void DumpText (PrnStream &stream) override
 Write a description of the button and its base.
void Save (BinStream &stream) override
 Write the version, the state, the names of the targets, and the palettes.
void Replace (RndObject *pFrom, RndObject *pTo) override
 Replace a target or a palette entry with another object.
const char * ClassName () const override
 Report the class name.
void Copy (const RndObject *pSource, int nFlags) override
 Copy the state and the palettes of another button.
void Load (BinStream &stream) override
 Read what Save() wrote.
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 button.

Static Public Attributes

static constexpr int kStateCount = 4
 The number of entries each palette starts with.
static const char * sClassName
 The class name a .rnd file writes, Button.
static int sRev
 The format version Save() writes and Load() accepts.
static int sLoadRev
 The version Load() read last.
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 targets and on every palette entry.
void AcquireRefs ()
 Take a reference on the targets and on every palette entry.

Additional Inherited Members

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

Detailed Description

Selectable widget, as a mesh and a text with a material and a font for each state.

The RTTI includes the class name and records RndObject as the one base, non-virtual. The class draws nothing. The front end reads the state and the palettes.

Constructor & Destructor Documentation

◆ RndButton()

RndButton::RndButton ( const char * pszName)
explicit

Construct a button in state 0 without targets and with four empty entries in each palette.

Parameters
pszNameThe registry key.
Ghidra address:
NTSC-U/C: 0x0024af90
Ghidra address:
PAL: 0x002539f8

◆ ~RndButton()

RndButton::~RndButton ( )
override

Drop the references on the targets and on every palette entry.

Ghidra address:
NTSC-U/C: 0x0024aee8
Ghidra address:
PAL: 0x00253950

Member Function Documentation

◆ operator new()

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

Allocate a button, billed to the class name.

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

◆ operator delete()

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

Release a button.

Parameters
pBlockThe block.

◆ DumpText()

void RndButton::DumpText ( PrnStream & stream)
overridevirtual

Write a description of the button and its base.

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

Reimplemented from RndObject.

◆ Save()

void RndButton::Save ( BinStream & stream)
overridevirtual

Write the version, the state, the names of the targets, and the palettes.

The base writes nothing.

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

Implements RndObject.

◆ Replace()

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

Replace a target or a palette entry with another object.

A replacement of another class, or null, clears the target or the entry.

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

Implements RndObject.

◆ ClassName()

const char * RndButton::ClassName ( ) const
inlineoverridevirtual

Report the class name.

Returns
sClassName.
Ghidra address:
NTSC-U/C: 0x00395900
Ghidra address:
PAL: 0x00403ff0

Implements RndObject.

◆ Copy()

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

Copy the state and the palettes of another button.

The targets are cleared rather than copied.

Parameters
pSourceThe button to copy from.
nFlagsThe set of fields to copy. The routine ignores it.
Ghidra address:
NTSC-U/C: 0x0024a5c8
Ghidra address:
PAL: 0x00253030

Implements RndObject.

◆ Load()

void RndButton::Load ( BinStream & stream)
overridevirtual

Read what Save() wrote.

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

Implements RndObject.

◆ New()

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

Create a button.

Parameters
pszNameThe registry key.
Returns
The button.
Ghidra address:
NTSC-U/C: 0x00395920
Ghidra address:
PAL: 0x00404010

◆ ReleaseRefs()

void RndButton::ReleaseRefs ( )
protected

Drop the references on the targets and on every palette entry.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x0024ab58
Ghidra address:
PAL: 0x002535c0

◆ AcquireRefs()

void RndButton::AcquireRefs ( )
protected

Take a reference on the targets and on every palette entry.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x0024aa78
Ghidra address:
PAL: 0x002534e0

Member Data Documentation

◆ kStateCount

int RndButton::kStateCount = 4
staticconstexpr

The number of entries each palette starts with.

◆ sClassName

const char* RndButton::sClassName
static

The class name a .rnd file writes, Button.

Ghidra address:
NTSC-U/C: 0x003b0a74
Ghidra address:
PAL: 0x0042f90c

◆ sRev

int RndButton::sRev
static

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

Ghidra address:
NTSC-U/C: 0x003b0a78
Ghidra address:
PAL: 0x0042f910

◆ sLoadRev

int RndButton::sLoadRev
static

The version Load() read last.

Ghidra address:
NTSC-U/C: 0x0043c824

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