|
resonance 1.0.1
|
Event the game passes between a MsgSource and a MsgSink. More...
#include <barstatusmsg.h>


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 |
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.
| 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.
| enum BarStatusMsg::Field |
|
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.
| nBar | The bar. |
| nTrack | The track. |
| pPlayer | The player whose track the bar belongs to. |
|
inline |
Start with no optional field set and the effect mask clear.
Inline, with no address of its own. New() expands it.
|
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.
|
virtual |
Produce a heap copy of this message.
Implements Message.
|
virtual |
Report this message's registered identity.
Implements Message.
|
virtual |
Report this message's class name.
Implements Message.
|
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.
| stream | The stream to write to. |
Reimplemented from Message.
| int BarStatusMsg::Has | ( | int | nField | ) | const |
Report whether one optional field is set.
| nField | The Field bit to test. |
|
inline |
Report the player field.
|
inline |
Report the enabled field.
|
inline |
Report the powerup field.
|
inline |
Report the effect mask.
| int BarStatusMsg::mBar |
The bar the status describes. +0x04
| int BarStatusMsg::mTrack |
The track the status describes. +0x08
| 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.
| int BarStatusMsg::mEnabled |
Non-zero when the bar is enabled.
+0x10
PhraseMgr::PostBarStatusMsg() writes it on its stack build. GetEnabled() is the reader.
| 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().
| int BarStatusMsg::mPowerup |
The powerup kind on the bar.
+0x18
PhraseMgr::PostBarStatusMsg() writes it on its stack build. GetPowerup() is the reader.
| Effects BarStatusMsg::mEffects |
One bit per effect kind.
+0x20
PhraseMgr::PostBarStatusMsg() writes it on its stack build. GetEffects() is the reader.
| int BarStatusMsg::mFlags |
The Field bits of the fields that are set. +0x28