|
resonance 1.0.1
|
Selectable widget, as one mesh and one text run plus a palette for each. More...
#include <button.h>


Public Member Functions | |
| Button (const HxStr &name) | |
| Construct a button with no targets and one empty palette entry each. | |
| virtual | ~Button () |
| Drop this object's reference on both targets and on every palette entry. | |
| virtual void | DumpText (Dbg &sink) |
| Write a description of this button to sink. | |
| virtual void | Save (Stream &stream) |
| Write this button to stream at revision 0. | |
| virtual void | Replace (Object *pFrom, Object *pTo) |
| Retarget both targets and every palette entry that refers to the replaced object. | |
| virtual const HxStr & | ClassName () const |
| Report the class key a .rnd file writes for a button. | |
| virtual void | Copy (const Object *pSource, unsigned nFlags) |
| Copy the state and both palettes of pSource into this button. | |
| virtual void | Load (Stream &stream) |
| Read this button from stream. | |
| void | SetShowing (int nShowing) |
| Show or hide both targets. | |
| void | SetMesh (Mesh *pMesh) |
| Replace mMesh, moving this object's reference to the new mesh. | |
| void | SetText (Text *pText) |
| Replace mText, moving this object's reference to the new text. | |
| void | SetMat (int nState, Mat *pMat) |
| Replace one entry of mMats, moving this object's reference to the new material. | |
| void | SetFont (int nState, Font *pFont) |
| Replace one entry of mFonts, moving this object's reference to the new font. | |
| void | SetState (int nState) |
| Select one of mMats and one of mFonts. | |
| Public Member Functions inherited from Rnd::Object | |
| Object () | |
| Construct an unnamed object. | |
| Object (const HxStr &name) | |
| Construct an object and register it under name. | |
| virtual | ~Object () |
| Erase the registry entry and release the name buffer. | |
| void | SetName (const HxStr &name) |
| Re-register this object under a different name. | |
| void | AddRef (Object *pReferrer) |
| Register pReferrer as a store of a pointer to this object. | |
| void | RemoveRef (Object *pReferrer) |
| Drop one registration made by AddRef(). | |
Static Public Member Functions | |
| static void * | operator new (size_t nSize) |
| Allocate a button under the tag "Rnd::Button". | |
| static void | operator delete (void *pBlock) |
| Release a button block under the same tag. | |
Public Attributes | |
| int | mState |
| The palette entry SetState() last selected. | |
| Text * | mText |
| Label drawn over mMesh. | |
| std::vector< Mat * > | mMats |
| Materials the state selects among, for mMesh. | |
| std::vector< Font * > | mFonts |
| Fonts the state selects among, for mText. | |
| Public Attributes inherited from Rnd::Object | |
| HxStr | mName |
| int | mInternal |
Additional Inherited Members | |
| Protected Member Functions inherited from Rnd::Object | |
| void | ReleaseAllRefs () |
| Tell every referrer to drop its pointer to this object. | |
| Protected Attributes inherited from Rnd::Object | |
| std::list< Object * > | mRefs |
Selectable widget, as one mesh and one text run plus a palette for each.
Its RTTI descriptor is at 0x008efde0. It has Rnd::Object as its only public non-virtual base at offset 0. The factory at 0x005346f8 pins the class at 0x40 bytes by requesting exactly that many. The Rnd::Object vptr therefore sits at +0x18 and this class's members run from +0x1c to +0x3f with no padding. The eight-entry vtable at 0x008282d8 is the Rnd::Object set exactly, and the class does not declare a virtual.
The member titles come from the text DumpText() writes, "state: ", " mesh: ", " text: ", "mats: ", and "fonts: ".
What the state selects is not implemented here. SetState() records the index and SetShowing() forwards to both targets, and the class draws nothing and updates nothing, so the two palettes and the index are a record the front end reads. Over two hundred call sites across the metagame and the front-end screens narrow an object to this class, and few of those translation units are reconstructed yet, so which palette entry a given state applies to which of the two targets is recovered nowhere in this tree.
|
explicit |
Construct a button with no targets and one empty palette entry each.
Both palettes start with a single null entry rather than empty, which the constructor produces by requesting four bytes and then inserting one null.
| name | The registry key for this object. |
|
virtual |
Drop this object's reference on both targets and on every palette entry.
|
static |
Allocate a button under the tag "Rnd::Button".
| nSize | The object size the compiler supplies. |
|
static |
Release a button block under the same tag.
| pBlock | The block. |
|
virtual |
Write a description of this button to sink.
| sink | The diagnostic sink to write to. |
Reimplemented from Rnd::Object.
|
virtual |
Write this button to stream at revision 0.
| stream | The stream to write to. |
Implements Rnd::Object.
Retarget both targets and every palette entry that refers to the replaced object.
A palette entry whose replacement is null is still overwritten with that null, and the whole of each palette is walked rather than stopping at the first match.
| pFrom | The object being replaced. |
| pTo | The replacement, or null. |
Implements Rnd::Object.
|
virtual |
Report the class key a .rnd file writes for a button.
The returned string is the global at 0x0071d8f8, which the class registration fills with "Button".
Implements Rnd::Object.
|
virtual |
Copy the state and both palettes of pSource into this button.
Neither target is copied; both are cleared instead. nFlags is not read, and no base implementation is invoked. A pSource that is not a Button is dereferenced through the null the cast produces rather than rejected.
| pSource | The button to copy from. |
| nFlags | Unread. |
Implements Rnd::Object.
|
virtual |
Read this button from stream.
A revision above 0 produces the report "Can't load new Button" and then returns, leaving the object as it was. Unlike the other renderer classes, this one does not transfer control to the abort handler of Rnd::TheDbg afterwards.
| stream | The stream to read from. |
Implements Rnd::Object.
| void Rnd::Button::SetShowing | ( | int | nShowing | ) |
Show or hide both targets.
The argument goes to slot 1 of the Rnd::Drawable table of mMesh and then of mText, and a null target is passed over. The class declares no virtual of its own, so the member is an ordinary method rather than an override.
| nShowing | Whether the button draws. |
| void Rnd::Button::SetMesh | ( | Mesh * | pMesh | ) |
Replace mMesh, moving this object's reference to the new mesh.
The new mesh also takes the material mState selects. The routine has no caller in the shipped build.
| pMesh | The new mesh, or null. |
| void Rnd::Button::SetText | ( | Text * | pText | ) |
Replace mText, moving this object's reference to the new text.
The new text also takes the font mState selects. The routine has no caller in the shipped build. The name is inferred from SetMesh().
| pText | The new text, or null. |
| void Rnd::Button::SetMat | ( | int | nState, |
| Mat * | pMat ) |
Replace one entry of mMats, moving this object's reference to the new material.
When nState is the current state, mMesh takes the new material at once. The index is not checked against the palette size. The name is inferred.
| nState | The palette entry. |
| pMat | The new material, or null. |
| void Rnd::Button::SetFont | ( | int | nState, |
| Font * | pFont ) |
Replace one entry of mFonts, moving this object's reference to the new font.
When nState is the current state, mText takes the new font at once. The index is not checked against the palette size. The name is inferred.
| nState | The palette entry. |
| pFont | The new font, or null. |
| void Rnd::Button::SetState | ( | int | nState | ) |
Select one of mMats and one of mFonts.
| nState | The state index. MetButtonList passes over an entry whose state is 3, which is how a disabled button is skipped. |
| int Rnd::Button::mState |
The palette entry SetState() last selected.
Public rather than private, because MetButtonList::SelectPrevious() at 0x001fcc40 and MetButtonList::SelectNext() at 0x001fcd10 read it directly to pass over a disabled button, and the image has no accessor to route that read through. +0x1c
| Text* Rnd::Button::mText |
Label drawn over mMesh.
Public rather than private, because MetButtonList::Add() and MetLoadFreqBaseScreen::UpdateNameLabel() both set the label text through a plain load at +0x24 and the image has no accessor to route either read through. A friend declaration fits the image equally well. +0x24
| std::vector<Mat *> Rnd::Button::mMats |
Materials the state selects among, for mMesh.
The assignment operator this class uses is instantiated out of line at 0x00533260. Public rather than private, because MetArenasScreen::ResolveContainerViews() at 0x001f6a08 reads its elements directly. +0x28
| std::vector<Font *> Rnd::Button::mFonts |
Fonts the state selects among, for mText.
Three of its operations are instantiated out of line, the assignment operator at 0x00533488, the grow-and-fill that insert() and resize() share at 0x00533f88, and the uninitialised fill that grow-and-fill calls at 0x00534fd0. Public rather than private, because MetArenasScreen::ResolveContainerViews() at 0x001f6a08 reads its elements directly. +0x34