|
resonance 1.0.1
|
Motion trail that redraws one drawable at the transforms it recently occupied. More...
#include <blur.h>


Classes | |
| struct | Xfm |
| One recorded transform. More... | |
Public Member Functions | |
| Blur (const HxStr &name) | |
| Construct a trail with no subject. | |
| virtual | ~Blur () |
| void | SetMesh (Mesh *pMesh) |
| Set the mesh the trail is drawn from and discard the recorded transforms. | |
| void | SetText (Text *pText) |
| Set the text the trail is drawn from and discard the recorded transforms. | |
| void | SetLength (int nLength) |
| Set how many transforms the trail records and discard the recorded transforms. | |
| void | SetRate (int nRate) |
| Set how many frames pass between two recorded transforms and discard the recorded ones. | |
| void | SetFalloff (float flFalloff) |
| Set the fraction of the subject's alpha the oldest trail step is drawn with. | |
| Mesh * | GetMesh () const |
| Report the mesh the trail is drawn from. | |
| Text * | GetText () const |
| Report the text the trail is drawn from. | |
| int | GetLength () const |
| Report how many transforms the trail records. | |
| int | GetRate () const |
| Report how many frames pass between two recorded transforms. | |
| float | GetFalloff () const |
| Report the alpha fraction of the oldest trail step. | |
| virtual void | DumpText (Dbg &sink) |
| Write a description of this trail to sink. | |
| virtual void | Save (Stream &stream) |
| Write this trail's serialised form to stream. | |
| virtual void | Replace (Object *pFrom, Object *pTo) |
| Repoint a subject when the object it addressed is replaced. | |
| virtual const HxStr & | ClassName () const |
| Report the class key a .rnd file writes for a trail. | |
| virtual void | Copy (const Object *pSource, unsigned nFlags) |
| Copy the state of pSource into this trail. | |
| virtual void | Load (Stream &stream) |
| Read this trail's serialised form from stream. | |
| Public Member Functions inherited from Rnd::Drawable | |
| 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. | |
| 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 Blur * | NewBlur (const HxStr &name) |
| Build a trail the class registry vends. | |
| static Blur * | NewFromHook (const HxStr &name) |
| Build a trail through g_pfnNewBlur. | |
| static Blur * | Find (const HxStr &name) |
| Resolve a registry key to a trail. | |
| static void | Init () |
| Install the trail factory and register the class key with Rnd::TheManager. | |
| Static Public Member Functions inherited from Rnd::Drawable | |
| static Drawable * | Find (const HxStr &name) |
| Resolve a registry key to a drawable. | |
Public Attributes | |
| std::list< Xfm > | mXfms |
| The transforms recorded for the trail. | |
| Public Attributes inherited from Rnd::Drawable | |
| int | mShowing |
| Public Attributes inherited from Rnd::Object | |
| HxStr | mName |
| int | mInternal |
Protected Member Functions | |
| virtual int | DrawShowing () |
| Draw the subject at its own transform, then once per recorded transform. | |
| Protected Member Functions inherited from Rnd::Drawable | |
| 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 |
Motion trail that redraws one drawable at the transforms it recently occupied.
Its RTTI descriptor is at 0x008ef068, its name string at 0x00821b28, and its single base entry at 0x00821b38 records Rnd::Drawable at offset 0, non-virtual and public. The class is 0x4c bytes, which the factory at 0x004c3570 proves by allocating exactly that much, and the Rnd::Object virtual base subobject sits at 0x30, which the constructor proves by writing that address into the virtual-base pointer at +0x00.
Two vtables belong to the class. The four-entry table at 0x00821ae8 is addressed by the Rnd::Drawable vptr at +0x10 and overrides only DrawShowing(), and the eight-entry table at 0x00821aa0 is addressed by the Rnd::Object subobject vptr with a -0x30 adjustment on every entry. Both tables end in an all-zero entry, which is the terminator rather than a null slot.
The member titles come from the text DumpText() writes: "[Blur]", "mesh:", " length:", " rate:", "falloff:", and " text:".
The seventeen routines between 0x004b9a68 and 0x004bf858 belong to Rnd::String. Only the routines listed below belong to this class.
|
explicit |
Construct a trail with no subject.
The trail length starts at 0, the rate at 1, the falloff at 1.0, and the countdown at the rate. Both subject pointers start null, so the two reference acquisitions the constructor ends with take no effect on a freshly built object.
| name | The registry key for this object. |
|
virtual |
| void Rnd::Blur::SetMesh | ( | Mesh * | pMesh | ) |
Set the mesh the trail is drawn from and discard the recorded transforms.
The previous subject loses its reference on this object and the new one gains one. The pointer is stored before the null test, so clearing the mesh stores the null.
| pMesh | The mesh to trail, or null for none. |
| void Rnd::Blur::SetText | ( | Text * | pText | ) |
Set the text the trail is drawn from and discard the recorded transforms.
A text subject takes precedence over a mesh subject in DrawShowing().
| pText | The text to trail, or null for none. |
| void Rnd::Blur::SetLength | ( | int | nLength | ) |
Set how many transforms the trail records and discard the recorded transforms.
A negative argument is clamped to 0, which disables the trail.
| nLength | The number of transforms to record. |
| void Rnd::Blur::SetRate | ( | int | nRate | ) |
Set how many frames pass between two recorded transforms and discard the recorded ones.
An argument below 1 is clamped to 1.
| nRate | The frame interval. |
| void Rnd::Blur::SetFalloff | ( | float | flFalloff | ) |
Set the fraction of the subject's alpha the oldest trail step is drawn with.
| flFalloff | The fraction. |
| Mesh * Rnd::Blur::GetMesh | ( | ) | const |
Report the mesh the trail is drawn from.
| Text * Rnd::Blur::GetText | ( | ) | const |
Report the text the trail is drawn from.
| int Rnd::Blur::GetLength | ( | ) | const |
Report how many transforms the trail records.
| int Rnd::Blur::GetRate | ( | ) | const |
Report how many frames pass between two recorded transforms.
| float Rnd::Blur::GetFalloff | ( | ) | const |
Report the alpha fraction of the oldest trail step.
|
virtual |
Write a description of this trail to sink.
The two base descriptions come first, and everything below is produced only at a positive dump level. A subject that is not set produces "no object".
| sink | The diagnostic sink to write to. |
Reimplemented from Rnd::Drawable.
|
virtual |
Write this trail's serialised form to stream.
| stream | The stream to write to. |
Reimplemented from Rnd::Drawable.
Repoint a subject when the object it addressed is replaced.
A replacement that is not of the subject's class clears the subject rather than storing a pointer of the wrong type.
| pFrom | The object going away. |
| pTo | The object to store instead, or null. |
Reimplemented from Rnd::Drawable.
|
virtual |
Report the class key a .rnd file writes for a trail.
The returned string is g_blurClassName, which the static initialiser at 0x004c32a8 fills with "Blur".
Implements Rnd::Object.
|
virtual |
Copy the state of pSource into this trail.
Both subject pointers are copied without a reference transfer of their own, because the acquisition at the end registers this object against whichever subjects it ends up with.
| pSource | The trail to copy from. |
| nFlags | The set of fields to copy. |
Reimplemented from Rnd::Drawable.
|
virtual |
Read this trail's serialised form from stream.
A revision of 3 or more is rejected with "Can't load new Blur". The falloff is present from revision 1 and the text subject from revision 2.
| stream | The stream to read from. |
Reimplemented from Rnd::Drawable.
Build a trail the class registry vends.
| name | The registry key for the new trail. |
Build a trail through g_pfnNewBlur.
Unlike the registered thunk at 0x004c34e0, the result is returned as a Blur without the narrowing to Rnd::Object. An exception from the factory produces null. Nothing in the image calls it, and the only reference is the exception range table at 0x008693d0. The name is inferred.
| name | The registry key for the new trail. |
Resolve a registry key to a trail.
A key that resolves to an object of another class produces null rather than a pointer of the wrong type.
| name | The registry key to resolve. |
|
static |
Install the trail factory and register the class key with Rnd::TheManager.
Rnd::Manager::Init() also expands this inline.
|
protectedvirtual |
Draw the subject at its own transform, then once per recorded transform.
Drawable vtable slot 3. The text subject is drawn in preference to the mesh, but a mesh subject supplies the material even when a text is set, and a subject with no material draws no trail. Each recorded transform, newest first, is written into the subject's local transform and drawn with Rnd::Mat::SetAlpha() at a value that starts at the material alpha scaled by mFalloff and falls by an equal step per entry. A recorded transform equal to the one before it, the first compared with the current world transform, is skipped. A mesh subject draws its trail with Rnd::Mesh::kZModeZReadOnly. The subject's transforms, the material alpha, and the depth state are restored afterwards. Every mRate frames the current world transform goes to the front of mXfms, the oldest entry dropping once mLength are stored.
Reimplemented from Rnd::Drawable.
| std::list<Xfm> Rnd::Blur::mXfms |
The transforms recorded for the trail.
+0x28
Public because the head-up display empties it directly through the list's clear() at 0x00415de8 whenever it restarts a trail, from HudPoints, HudTextMessage, ten of Overlay's handlers, and three further routines at 0x00412628, 0x004158c0, and 0x0041b658, and the image has no accessor for it.