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

Event the game passes between a MsgSource and a MsgSink. More...

#include <barstatusmsg.h>

Inheritance diagram for BarStatusMsg:
Collaboration diagram for BarStatusMsg:

Public Types

enum  { kEffectCount = 13 }
 Effect kinds the effect mask records, one bit each. More...
enum  Field { kFieldPlayer = 1 , kFieldEnabled = 2 , kFieldPowerup = 4 , kFieldEffects = 8 }
 Bits of mFlags, one per optional field. More...
typedef std::bitset< kEffectCount > Effects
 One bit per effect kind.

Public Member Functions

 BarStatusMsg (int nBar, int nTrack, Player *pPlayer)
 Report a bar's player, with no other optional field set.
 BarStatusMsg ()
 Start with no optional field set and the effect mask clear.
virtual Message * Clone ()
 Produce a heap copy of this message.
virtual int Type ()
 Report this message's registered identity.
virtual const char * GetName () const
 Report this message's class name.
virtual void PrintExtra (std::ostream &stream) const
 Write the bar, the track, and each set optional field.
int Has (int nField) const
 Report whether one optional field is set.
Player * GetPlayer () const
 Report the player field.
int GetEnabled () const
 Report the enabled field.
int GetPowerup () const
 Report the powerup field.
Effects GetEffects () const
 Report the effect mask.
Public Member Functions inherited from Message
void * operator new (size_t nSize)
 Allocate a message from the tagged heap under the tag MSG.
void operator delete (void *pBlock)
 Release a message to the tagged heap under the tag MSG.
virtual ~Message ()
 Vtable slot 1.
virtual void saveGuts (OBStream &stream) const
 Write this message's payload to an output stream.
virtual void restoreGuts (IBStream &stream)
 Read this message's payload from an input stream.
std::ostream & Print (std::ostream &stream) const
 Write this message to a diagnostic stream as {GetName() PrintExtra()}.

Static Public Member Functions

static Message * New ()
 Build an empty message on the heap for the message registry.
Static Public Member Functions inherited from Message
static Message * NewMessage (int nType)
 Produce a message of the identified class through the factory list.

Public Attributes

int mBar
int mTrack
Player * mPlayer
 The player whose track the bar belongs to.
int mEnabled
 Non-zero when the bar is enabled.
int mRefreshing
 Non-zero when PhraseMgr posted the message while refreshing bars.
int mPowerup
 The powerup kind on the bar.
Effects mEffects
 One bit per effect kind.
int mFlags

Detailed Description

Event the game passes between a MsgSource and a MsgSink.

Its RTTI descriptor is at 0x008ef420. It has Message as its one base. The object is 0x30 bytes and its vtable is at 0x00812660. The members below are the whole of the class. No other routine in the image refers to this type by anything but its vtable.

The payload layout comes from the run of field copies in Clone(). The purpose of each field comes from the PrintExtra() override at 0x003d8670, which streams b#<bar> tr#<track> and then one labelled part per flag set in mFlags: the player's colour name for kFieldPlayer, enabled or disabled for kFieldEnabled, pow:<n> for kFieldPowerup, and effect:<names> for kFieldEffects.

A flagged field is read through an inline getter that runs Has() for its flag and discards the result before the load. Renderer::OnBarStatus() at 0x0042d068 and PrintExtra() both show that shape at every read. Has() is the out-of-line member the getters call, and each getter also has one uncalled out-of-line copy, recorded on its declaration. The bar, the track, mRefreshing, and mFlags are read with no call at all, and the image has no accessor for them. Those four are public.

The destructor at 0x003deee0 is compiler-generated and has no declaration here.

Clone() copies only as far as 0x2c of the 0x30 bytes it allocates, so the remaining 4 are either alignment padding or a field the copy omits.

Member Typedef Documentation

◆ Effects

typedef std::bitset<kEffectCount> BarStatusMsg::Effects

One bit per effect kind.

PrintExtra() streams the mask through std::operator<<() for a thirteen-bit set at 0x003d9690, and on this target the set is one eight-byte word.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Effect kinds the effect mask records, one bit each.

Enumerator
kEffectCount 

◆ Field

Bits of mFlags, one per optional field.

Enumerator
kFieldPlayer 

The player field is set.

kFieldEnabled 

The enabled field is set.

kFieldPowerup 

The powerup field is set.

kFieldEffects 

The effect mask is set.

Constructor & Destructor Documentation

◆ BarStatusMsg() [1/2]

BarStatusMsg::BarStatusMsg ( int nBar,
int nTrack,
Player * pPlayer )
inline

Report a bar's player, with no other optional field set.

Inline, with no address of its own. AxePhraseMaker::StartPhrase() expands it on its stack at 0x0019bdc4. mRefreshing and the effect mask start clear, and mEnabled and mPowerup are left unset.

Parameters
nBarThe bar.
nTrackThe track.
pPlayerThe player whose track the bar belongs to.

◆ BarStatusMsg() [2/2]

BarStatusMsg::BarStatusMsg ( )
inline

Start with no optional field set and the effect mask clear.

Inline, with no address of its own. New() expands it.

Member Function Documentation

◆ New()

Message * BarStatusMsg::New ( )
static

Build an empty message on the heap for the message registry.

Allocates 0x30 bytes under the tag MSG. The unit's static initialiser registers it.

Returns
The new message.
Ghidra address:
NTSC-U/C: 0x003d7440
Ghidra address:
PAL: 0x0040f340

◆ Clone()

virtual Message * BarStatusMsg::Clone ( )
virtual

Produce a heap copy of this message.

Returns
The copy.
Ghidra address:
NTSC-U/C: 0x003defd0
Ghidra address:
PAL: 0x00417428

Implements Message.

◆ Type()

virtual int BarStatusMsg::Type ( )
virtual

Report this message's registered identity.

Returns
g_nBarStatusMsgType.
Ghidra address:
NTSC-U/C: 0x003df050
Ghidra address:
PAL: 0x004174a8

Implements Message.

◆ GetName()

virtual const char * BarStatusMsg::GetName ( ) const
virtual

Report this message's class name.

Returns
The literal BarStatusMsg.
Ghidra address:
NTSC-U/C: 0x003df060
Ghidra address:
PAL: 0x004174b8

Implements Message.

◆ PrintExtra()

virtual void BarStatusMsg::PrintExtra ( std::ostream & stream) const
virtual

Write the bar, the track, and each set optional field.

Streams b#<bar> tr#<track>, then the player's colour name, enabled or disabled, pow:<powerup>, and effect:<mask> for each Field bit set in mFlags.

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x003d8670
Ghidra address:
PAL: 0x00410a68

Reimplemented from Message.

◆ Has()

int BarStatusMsg::Has ( int nField) const

Report whether one optional field is set.

Parameters
nFieldThe Field bit to test.
Returns
1 when the bit is set in mFlags, and 0 otherwise.
Ghidra address:
NTSC-U/C: 0x003df1f8
Ghidra address:
PAL: 0x00417650

◆ GetPlayer()

Player * BarStatusMsg::GetPlayer ( ) const
inline

Report the player field.

Returns
The player whose track the bar belongs to.
Ghidra address:
NTSC-U/C: 0x003df130
Ghidra address:
PAL: 0x00417588

◆ GetEnabled()

int BarStatusMsg::GetEnabled ( ) const
inline

Report the enabled field.

Returns
Non-zero when the bar is enabled.
Ghidra address:
NTSC-U/C: 0x003df160
Ghidra address:
PAL: 0x004175b8

◆ GetPowerup()

int BarStatusMsg::GetPowerup ( ) const
inline

Report the powerup field.

Returns
The powerup kind on the bar.
Ghidra address:
NTSC-U/C: 0x003df190
Ghidra address:
PAL: 0x004175e8

◆ GetEffects()

Effects BarStatusMsg::GetEffects ( ) const
inline

Report the effect mask.

Returns
One bit per effect kind.
Ghidra address:
NTSC-U/C: 0x003df1c0
Ghidra address:
PAL: 0x00417618

Member Data Documentation

◆ mBar

int BarStatusMsg::mBar

The bar the status describes. +0x04

◆ mTrack

int BarStatusMsg::mTrack

The track the status describes. +0x08

◆ mPlayer

Player* BarStatusMsg::mPlayer

The player whose track the bar belongs to.

+0x0c

PhraseMgr::PostBarStatusMsg() at 0x001bb9f8 writes it on its stack build. GetPlayer() is the reader.

◆ mEnabled

int BarStatusMsg::mEnabled

Non-zero when the bar is enabled.

+0x10

PhraseMgr::PostBarStatusMsg() writes it on its stack build. GetEnabled() is the reader.

◆ mRefreshing

int BarStatusMsg::mRefreshing

Non-zero when PhraseMgr posted the message while refreshing bars.

+0x14

PhraseMgr::PostBarStatusMsg() copies its mRefreshing here, and Renderer::OnBarStatus() passes it to AppTunnel::OnBarChanged().

◆ mPowerup

int BarStatusMsg::mPowerup

The powerup kind on the bar.

+0x18

PhraseMgr::PostBarStatusMsg() writes it on its stack build. GetPowerup() is the reader.

◆ mEffects

Effects BarStatusMsg::mEffects

One bit per effect kind.

+0x20

PhraseMgr::PostBarStatusMsg() writes it on its stack build. GetEffects() is the reader.

◆ mFlags

int BarStatusMsg::mFlags

The Field bits of the fields that are set. +0x28


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