|
resonance 1.0.1
|
Mix-in for an object that draws itself and then a list of other drawables. More...
#include <drawable.h>


Public Member Functions | |
| Drawable () | |
| Construct a visible drawable with no children. | |
| virtual | ~Drawable () |
| Drop this object's references on its children. | |
| void | Draw () |
| Draw this object followed by each of its children. | |
| Drawable * | Parent () |
| Report the drawable that draws this one. | |
| void | AddDraw (Drawable *pDraw, Drawable *pBefore) |
| Insert pDraw into mDraws in front of pBefore. | |
| void | AddDraw (Drawable *pDraw) |
| Insert pDraw at the front of mDraws. | |
| void | RemoveDraw (Drawable *pDraw) |
| Erase pDraw from mDraws. | |
| void | RemoveAllDraws () |
| Empty mDraws, dropping this object's reference on every entry. | |
| void | MoveDraw (Drawable *pDraw, int nSteps) |
| Move pDraw nSteps places later in mDraws, or earlier for a negative count. | |
| virtual void | SetShowing (int nShowing) |
| Set whether this object draws at all. | |
| void | SetShowingRecursive (int nShowing) |
| Set whether this object and every drawable beneath it in mDraws draw at all. | |
| virtual void | SetHighlight (int nHighlight) |
| Set whether this object draws with its highlight treatment. | |
| int | GetHighlight () const |
| Report the highlight flag. | |
| int | GetShowing () const |
| Report the showing flag. | |
| std::list< Drawable * > & | GetDraws () |
| Report the child list. | |
| virtual void | DumpText (Dbg &sink) |
| Write a description of this object to sink. | |
| virtual void | Save (Stream &stream) |
| Write the revision, the showing flag as one byte, and the draw list. | |
| virtual void | Replace (Object *pFrom, Object *pTo) |
| Point every mDraws entry that is pFrom at pTo instead, moving the reference, and drop the entries left null. | |
| virtual void | Copy (const Object *pSource, unsigned nFlags) |
| Take the showing flag, and with kCopyChildLists the draw list, from another drawable. | |
| virtual void | Load (Stream &stream) |
| Read what Save() writes, replacing the draw list and moving its references. | |
| 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(). | |
| virtual const HxStr & | ClassName () const =0 |
| Report the name of this object's most derived class. | |
Static Public Member Functions | |
| static Drawable * | Find (const HxStr &name) |
| Resolve a registry key to a drawable. | |
Public Attributes | |
| int | mShowing |
| Public Attributes inherited from Rnd::Object | |
| HxStr | mName |
| int | mInternal |
Protected Member Functions | |
| virtual int | DrawShowing () |
| Draw this object alone. | |
| void | ReleaseDrawsRefs () |
| Drop this object's reference on every mDraws entry without emptying the list. | |
| Protected Member Functions inherited from Rnd::Object | |
| void | ReleaseAllRefs () |
| Tell every referrer to drop its pointer to this object. | |
Additional Inherited Members | |
| Protected Attributes inherited from Rnd::Object | |
| std::list< Object * > | mRefs |
Mix-in for an object that draws itself and then a list of other drawables.
Its RTTI descriptor is at 0x008ef320. It has Rnd::Object as a public virtual base at offset
Two vtables belong to the class. The four-entry table at 0x00825498 is addressed by the vptr at +0x10 and stores the three virtuals declared here. The nine-entry table at 0x008254c0 is addressed by the Rnd::Object subobject vptr and stores the overrides of the Rnd::Object virtuals, each with a -0x14 adjustment back to the Drawable subobject.
Every entry of mDraws registers this object as a referrer through Rnd::Object::AddRef(), so a drawable that goes away is removed from its parents' lists by Replace() rather than leaving a stale pointer.
| Rnd::Drawable::Drawable | ( | ) |
Construct a visible drawable with no children.
|
virtual |
Drop this object's references on its children.
| void Rnd::Drawable::Draw | ( | ) |
Draw this object followed by each of its children.
Draws nothing when mShowing is clear, and skips the children when DrawShowing() reports that the subtree is invisible.
| Drawable * Rnd::Drawable::Parent | ( | ) |
Report the drawable that draws this one.
Walks the referrer list of the Rnd::Object subobject, casts each referrer to Drawable and returns the first whose own mDraws list includes this object, which makes the result the parent in the draw hierarchy rather than a plain cast.
Insert pDraw into mDraws in front of pBefore.
Registers this object as a referrer of pDraw. A pBefore that is absent from mDraws appends instead. A pDraw already in mDraws produces the report "%s already in %s" and no insertion.
| pDraw | The drawable to add. |
| pBefore | The drawable to insert in front of. |
| void Rnd::Drawable::AddDraw | ( | Drawable * | pDraw | ) |
Insert pDraw at the front of mDraws.
| pDraw | The drawable to add. |
| void Rnd::Drawable::RemoveDraw | ( | Drawable * | pDraw | ) |
Erase pDraw from mDraws.
Drops this object's reference on pDraw first. A pDraw absent from mDraws does nothing.
| pDraw | The drawable to remove. |
| void Rnd::Drawable::RemoveAllDraws | ( | ) |
Empty mDraws, dropping this object's reference on every entry.
| void Rnd::Drawable::MoveDraw | ( | Drawable * | pDraw, |
| int | nSteps ) |
Move pDraw nSteps places later in mDraws, or earlier for a negative count.
The move stops at either end of the list, and a pDraw absent from mDraws does nothing. No reference changes hands. FreqAppearanceDetail reorders the parts of an avatar with it. The title is inferred.
| pDraw | The drawable to move. |
| nSteps | The number of places to move it. |
|
virtual |
|
inline |
Set whether this object and every drawable beneath it in mDraws draw at all.
Runs SetShowing() on this object and then recurses over mDraws. Defined in the header. The one out-of-line copy is emitted in FreqAppearance's translation unit, where FreqAppearance::AttachToBurnSlot() expands the first level of the recursion.
| nShowing | Non-zero to draw. |
|
virtual |
Set whether this object draws with its highlight treatment.
Drawable vtable slot 2.
| nHighlight | Non-zero to highlight. |
Reimplemented in Rnd::String, and Rnd::Text.
|
inline |
Report the highlight flag.
|
inline |
Report the showing flag.
The out-of-line copy has no callers. Rnd::LodMesh::Draw() inlines it.
Resolve a registry key to a drawable.
A key that resolves to an object of another class produces null. The image has no caller.
| name | The registry key to resolve. |
|
inline |
Report the child list.
|
virtual |
Write a description of this object to sink.
Writes mShowing, mHighlight, and the mDraws list, and produces nothing at all when the dump level of sink is not positive. Dbg::Print() discards its text in the shipped build. The routine therefore produces no output on this target either way.
| sink | The diagnostic sink to write to. |
Reimplemented from Rnd::Object.
Reimplemented in Rnd::Arena, Rnd::Blur, Rnd::Cam, Rnd::Environ, Rnd::Generator, Rnd::Mesh, Rnd::MultiMesh, Rnd::ParticleSys, Rnd::String, Rnd::Text, Rnd::TransAnim, Rnd::Tunnel, and Rnd::View.
|
virtual |
Write the revision, the showing flag as one byte, and the draw list.
| stream | The stream to write to. |
Implements Rnd::Object.
Reimplemented in Rnd::Arena, Rnd::Blur, Rnd::Cam, Rnd::Environ, Rnd::Generator, Rnd::Mesh, Rnd::MultiMesh, Rnd::ParticleSys, Rnd::String, Rnd::Text, Rnd::TransAnim, Rnd::Tunnel, and Rnd::View.
Point every mDraws entry that is pFrom at pTo instead, moving the reference, and drop the entries left null.
An entry already equal to pTo is reported through the debug sink.
| pFrom | The object to replace. |
| pTo | The replacement, which only counts when it is a Drawable. |
Implements Rnd::Object.
Reimplemented in Rnd::Arena, Rnd::Blur, Rnd::Cam, Rnd::Environ, Rnd::Generator, Rnd::Mesh, Rnd::MultiMesh, Rnd::ParticleSys, Rnd::String, Rnd::Text, Rnd::TransAnim, Rnd::Tunnel, and Rnd::View.
|
virtual |
Take the showing flag, and with kCopyChildLists the draw list, from another drawable.
The references on the old and new draw lists are released and taken around the copy.
| pSource | The drawable to copy from. |
| nFlags | The copy flags. |
Implements Rnd::Object.
Reimplemented in Rnd::Arena, Rnd::Blur, Rnd::Cam, Rnd::Environ, Rnd::Generator, Rnd::Mesh, Rnd::MultiMesh, Rnd::ParticleSys, Rnd::String, Rnd::Text, Rnd::TransAnim, Rnd::Tunnel, and Rnd::View.
|
virtual |
Read what Save() writes, replacing the draw list and moving its references.
A revision newer than this build supports is reported and aborts the load.
| stream | The stream to read from. |
Implements Rnd::Object.
Reimplemented in Rnd::Arena, Rnd::Blur, Rnd::Cam, Rnd::Environ, Rnd::Generator, Rnd::Mesh, Rnd::MultiMesh, Rnd::ParticleSys, Rnd::String, Rnd::Text, Rnd::TransAnim, Rnd::Tunnel, and Rnd::View.
|
protectedvirtual |
Draw this object alone.
Drawable vtable slot 3. The base implementation draws nothing and reports that the children are still to be drawn. Only Draw() invokes it.
Reimplemented in Rnd::Arena, Rnd::Blur, Rnd::Cam, Rnd::Environ, Rnd::Generator, Rnd::MultiMesh, Rnd::PsCam, Rnd::PsEnviron, Rnd::PsMesh, Rnd::PsMultiMesh, Rnd::PsParticleSys, Rnd::String, Rnd::Text, and Rnd::Tunnel.
|
protected |
Drop this object's reference on every mDraws entry without emptying the list.
Every derived destructor invokes this before its own teardown.
| int Rnd::Drawable::mShowing |