resonance 1.0.1
Loading...
Searching...
No Matches
RendererBase Class Referenceabstract

Base of every renderer, with a message queue and a router of its own. More...

#include <rendererbase.h>

Inheritance diagram for RendererBase:
Collaboration diagram for RendererBase:

Classes

class  Router
 Sink that forwards every message it receives to one other sink. More...

Public Member Functions

 RendererBase ()
 Start the queue with the router as its one sink.
virtual ~RendererBase ()
 Release the queue and the router.
virtual void Dispatch (Message *pMsg)
 Accept a message into the queue.
virtual void Start ()
 Start the renderer running.
virtual void Stop ()
 Stop the renderer running.
virtual void PollMessages ()
 Deliver every queued message.
virtual void Update ()=0
 Advance the renderer by one frame.
virtual void Draw ()=0
 Draw the frame.
virtual void UpdateSimple ()
 Advance the renderer by one frame without the full update.
virtual void DrawSimple ()
 Draw the frame without the full draw.
Public Member Functions inherited from MsgSink
void * operator new (size_t nSize)
 Allocate a sink from the tagged heap under the tag "MsgSink".
void operator delete (void *pBlock)
 Release a sink to the tagged heap.
virtual ~MsgSink ()
virtual void DispatchPriv (Message *pMsg)=0
 Act on a message.

Detailed Description

Base of every renderer, with a message queue and a router of its own.

It derives from MsgSink at offset 0, with its own type function at 0x00139e88. Three classes derive from it: MetRenderer, MetNullRenderer, and Renderer. Each of their constructors calls this class's constructor directly.

The table at 0x007d2d20 runs eleven entries against MsgSink's four, so slots 4 through 10 are the seven virtuals this class introduces. Slots 3, 7, and 8 address the pure-virtual stub at 0x005381a8, and the class is therefore abstract. Slot 3 is MsgSink::DispatchPriv(), which this class leaves pure. Slot 2 overrides MsgSink::Dispatch().

Each of the seven takes its name from the overrides and from the callers. MetaGameWorld runs slots 4 and 5 to start and stop the front end, GameManagerImpl::DrawFrame() runs slots 6, 7, and 8 on every frame, and GameManagerImpl::DrawFrameSimple() runs slots 9 and 10. The six MetRenderer overrides take no argument and return nothing, and Renderer's three overrides agree. Those overrides fix the signatures. The base bodies of slots 4, 5, 9, and 10 are empty and do not read an argument register.

Constructor & Destructor Documentation

◆ RendererBase()

RendererBase::RendererBase ( )

Start the queue with the router as its one sink.

The router's target is this object, so every message the queue delivers arrives at this object's DispatchPriv().

Ghidra address:
NTSC-U/C: 0x00139c10
Ghidra address:
PAL: 0x0013a558

◆ ~RendererBase()

virtual RendererBase::~RendererBase ( )
virtual

Release the queue and the router.

The body writes the MsgSink table pointer at +0x00 and again at +0x40, tears the queue down through MsgQueue::~MsgQueue(), and releases the object under its __in_chrg flag. The second table write is the router member rather than a second base, because the RTTI records MsgSink as the one base of this class and Router as a nested class with its own descriptor.

Ghidra address:
NTSC-U/C: 0x00139e20
Ghidra address:
PAL: 0x0013a768

Member Function Documentation

◆ Dispatch()

virtual void RendererBase::Dispatch ( Message * pMsg)
virtual

Accept a message into the queue.

Slot 2. The message is stored rather than acted on, and reaches DispatchPriv() only when PollMessages() drains the queue. MetRenderer and Renderer both inherit this body.

Parameters
pMsgThe message to store.
Ghidra address:
NTSC-U/C: 0x00139f80
Ghidra address:
PAL: 0x0013a8c8

Reimplemented from MsgSink.

◆ Start()

virtual void RendererBase::Start ( )
virtual

Start the renderer running.

Slot 4, with an empty body in this class.

MetaGameWorld's forwarder at 0x003d4860 is the caller.

Ghidra address:
NTSC-U/C: 0x00139f28
Ghidra address:
PAL: 0x0013a870

Reimplemented in MetRenderer.

◆ Stop()

virtual void RendererBase::Stop ( )
virtual

Stop the renderer running.

Slot 5, with an empty body in this class.

MetaGameWorld's forwarder at 0x003d4890 is a caller.

Ghidra address:
NTSC-U/C: 0x00139f30
Ghidra address:
PAL: 0x0013a878

Reimplemented in MetRenderer.

◆ PollMessages()

virtual void RendererBase::PollMessages ( )
virtual

Deliver every queued message.

Slot 6.

The body drains the queue through MsgQueue::Poll(). MetRenderer inherits it, and Renderer's override calls it explicitly.

Ghidra address:
NTSC-U/C: 0x00139fb0
Ghidra address:
PAL: 0x0013a8f8

Reimplemented in Renderer.

◆ Update()

virtual void RendererBase::Update ( )
pure virtual

Advance the renderer by one frame.

Slot 7, pure in this class.

Implemented in MetNullRenderer, MetRenderer, and Renderer.

◆ Draw()

virtual void RendererBase::Draw ( )
pure virtual

Draw the frame.

Slot 8, pure in this class.

Implemented in MetNullRenderer, MetRenderer, and Renderer.

◆ UpdateSimple()

virtual void RendererBase::UpdateSimple ( )
virtual

Advance the renderer by one frame without the full update.

Slot 9, with an empty body in this class.

GameManagerImpl::DrawFrameSimple() is the caller.

Ghidra address:
NTSC-U/C: 0x00139f38
Ghidra address:
PAL: 0x0013a880

Reimplemented in MetRenderer.

◆ DrawSimple()

virtual void RendererBase::DrawSimple ( )
virtual

Draw the frame without the full draw.

Slot 10, with an empty body in this class.

GameManagerImpl::DrawFrameSimple() is the caller.

Ghidra address:
NTSC-U/C: 0x00139f40
Ghidra address:
PAL: 0x0013a888

Reimplemented in MetRenderer.


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