49 void *
operator new(
size_t nSize) {
50 return PoolMemAlloc(
static_cast<int>(nSize),
"Cursor", 0);
58 void operator delete(
void *pBlock) {
260 std::unique_ptr<RndBlur> mCursor;
261 std::unique_ptr<RndMesh> mMask;
Stream of raw bytes, the base of the memory, file, and network streams.
Definition binstream.h:22
Text output stream.
Definition prnstream.h:16
RndAnimatable()
Construct an animatable at frame 0 without children or filters.
Definition rndanimatable.h:600
Motion trail that draws a mesh or a text again at the transforms it recently occupied.
Definition rndblur.h:21
void Save(BinStream &stream) override
Write the cursor and its bases.
void Load(BinStream &stream) override
Read what Save() wrote.
~RndCursor() override
Drop the references and delete the mask and the internal blur.
void ReleaseRefs()
Drop the references on the text and the blur, and delete the mask and the internal blur.
static RndObject * New(const char *pszName)
Create a cursor.
Definition rndcursor.h:230
void SetText(RndText *pText)
Set the text the cursor sweeps, then rebuild the mask.
void BuildMask()
Replace the mask with a quad over the line of the text, and measure the line.
void AcquireRefs()
Take the references on the text and the blur, then build the mask and the internal blur.
void BuildCursor()
Replace the internal blur with a copy of mBlur, whose mesh is not drawn by itself.
static int sRev
The format version Save() writes and Load() accepts.
Definition rndcursor.h:248
void Replace(RndObject *pFrom, RndObject *pTo) override
Replace a referenced text or blur with another, and rebuild what depends on it.
void ListDrawables(std::list< RndDrawable * > &drawables) override
Add the drawables of the text, then the children, to a list.
void DumpText(PrnStream &stream) override
Write a description of the cursor and its bases.
RndCursor(const char *pszName)
Construct a cursor without a text or a blur, offset by -0.1 and resting 0.8 of a frame.
static const char * sClassName
The class name a .rnd file writes, Cursor.
Definition rndcursor.h:240
float EndFrame() override
Report the last frame, the length of the text plus the rest at the end.
int DrawShowing() override
Move the mask and the internal blur to the cursor position and draw them with the text.
float CursorPos()
Report the character the cursor has reached, resting on each for mStutter of a frame.
void Copy(const RndObject *pSource, int nFlags) override
Copy another cursor and its bases.
void ListDrawObjects(std::list< RndObject * > &objects) override
Add the objects of the blur and of the text to a list.
static int sLoadRev
The version Load() read last.
Definition rndcursor.h:255
const char * ClassName() const override
Report the class name.
Definition rndcursor.h:138
RndDrawable()
Construct a showing drawable without a highlight or children.
Definition rnddrawable.h:23
RndObject(const char *pszName)
Construct an object and register it under a name.
Text drawn with a bitmap font as a mesh of one quad per character.
Definition rndtext.h:27
void * PoolMemAlloc(int nSize, const char *pszTag, int nAlign)
Allocate a block from the pool heaps and bill it to a tag.
void PoolMemFree(void *pBlock)
Return a block PoolMemAlloc() handed out to the pool heap that owns it.