resonance 1.0.1
Loading...
Searching...
No Matches
MsgSource Class Reference

Sender of engine messages, which stores the list of sinks that receive them. More...

#include <msgsource.h>

Inheritance diagram for MsgSource:

Public Member Functions

virtual ~MsgSource ()
virtual void AddSink (MsgSink *pSink)
 Register a sink, ignoring a sink that is already registered.
virtual void RemoveSink (MsgSink *pSink)
 Unregister the first occurrence of a sink.
void Send (Message *pMsg) const
 Deliver a message to every registered sink, in registration order.
void ClearSinks ()
 Unregister every sink.

Public Attributes

int mGraphBuilt
 A word no member of this class reads.

Detailed Description

Sender of engine messages, which stores the list of sinks that receive them.

Its RTTI descriptor is at 0x0086f6b0. It has no base. One data word sits ahead of the vector. The compiler places the vptr after both at +0x10, and the subobject is 0x14 bytes. Around thirty classes derive from it, among them Player, InputMap, Renderer, and MsgQueue. MsgQueue derives from both this class and MsgSink, and its MsgSink subobject therefore sits at +0x14.

The vector is three pointers, measured from the destructor and from both accessors: +0x04 start, +0x08 finish, +0x0c end of storage. Every operation on it is inlined apart from the reallocating half of push_back() at 0x00549e08. The vector is private. Only members of this class address it.

The class declares no constructor, and the two the compiler generates are emitted once each, in the Gamer unit. The default constructor at 0x00115cc0 empties the vector and writes the vptr, and AutoRiffer, AxeFX, and the other derived constructors call it. The copy constructor at 0x00115860 copies the word at +0x00 and the vector.

Constructor & Destructor Documentation

◆ ~MsgSource()

virtual MsgSource::~MsgSource ( )
virtual
Ghidra address:
NTSC-U/C: 0x0054a168
Ghidra address:
PAL: 0x0058a698

Member Function Documentation

◆ AddSink()

virtual void MsgSource::AddSink ( MsgSink * pSink)
virtual

Register a sink, ignoring a sink that is already registered.

Parameters
pSinkThe sink to register.
Ghidra address:
NTSC-U/C: 0x0054a270
Ghidra address:
PAL: 0x0058a7a0

Reimplemented in LocalPlayer.

◆ RemoveSink()

virtual void MsgSource::RemoveSink ( MsgSink * pSink)
virtual

Unregister the first occurrence of a sink.

A sink that is not registered is ignored.

Parameters
pSinkThe sink to unregister.
Ghidra address:
NTSC-U/C: 0x0054a2f0
Ghidra address:
PAL: 0x0058a820

Reimplemented in LocalPlayer.

◆ Send()

void MsgSource::Send ( Message * pMsg) const

Deliver a message to every registered sink, in registration order.

The member is not virtual. This class's own table is at 0x008299f0 and runs to its terminator after RemoveSink(), and every one of the hundreds of call sites is a direct call. The table at 0x00829b18, recorded here previously, belongs to the MsgSource subobject of MsgQueue rather than to this class. The conclusion holds for either table, because neither has a further entry.

The loop reloads the vector's finish pointer on each iteration. A sink that registers a further sink while receiving the message is therefore still included. Delivery to one sink goes through MsgSink::Dispatch(), table slot 2.

Parameters
pMsgThe message to deliver.
Ghidra address:
NTSC-U/C: 0x0054a370
Ghidra address:
PAL: 0x0058a8a0

◆ ClearSinks()

void MsgSource::ClearSinks ( )

Unregister every sink.

GrooveWorld::DestroyGraphs() at 0x0018da60 calls it. An identical copy sits at 0x001fedb0.

Ghidra address:
NTSC-U/C: 0x0054a218
Ghidra address:
PAL: 0x0058a748

Member Data Documentation

◆ mGraphBuilt

int MsgSource::mGraphBuilt

A word no member of this class reads.

+0x00

Public because GrooveWorld::BuildGraphs() stores 1 into it on the new InputMap at 0x0018ce18, and the image has no accessor.


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