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

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

#include <catchmsg.h>

Inheritance diagram for CatchMsg:
Collaboration diagram for CatchMsg:

Public Member Functions

 CatchMsg ()
 Construct a message with the payload unset.
 CatchMsg (int nTick, int nTrack, int nGem, int nHit, Player *pPlayer, int nCaught, int nTotal)
 Report a caught or missed gem.
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.
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 PrintExtra (std::ostream &stream) const
 Write this message's payload to a stream.
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 ()
 Produce a default-constructed message on the heap.
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 mTick = kTickInfinity
int mTrack
int mGem
int mHit
Player * mPlayer
int mCaught
int mTotal

Detailed Description

Event the game passes between a MsgSource and a MsgSink.

Its RTTI descriptor is at 0x00901e00. It has Message as its one base. The object is 0x20 bytes and its vtable is at 0x007e0a28. The allocation in New() and the allocation in Clone() report the same size.

The payload layout comes from the run of field copies in Clone(). Every member is public because code outside the class reads it directly with no accessor in the image. AppTunnel's catch handler at 0x00447938 reads mGem and mPlayer, and Overlay::OnCatch() at 0x0041fed8 reads the rest. Overlay compares mPlayer with HudTrack::mPlayer, draws the catch progress from mCaught over mTotal, converts mTick to a bar by the 1920 ticks of a bar before looking mTrack up, and resets its miss count when mHit is set.

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

Constructor & Destructor Documentation

◆ CatchMsg() [1/2]

CatchMsg::CatchMsg ( )
inline

Construct a message with the payload unset.

Inline. New() expands it. A declaration is required because the class declares a second constructor.

◆ CatchMsg() [2/2]

CatchMsg::CatchMsg ( int nTick,
int nTrack,
int nGem,
int nHit,
Player * pPlayer,
int nCaught,
int nTotal )
inline

Report a caught or missed gem.

Inline, with no address of its own. Catcher expands it on its stack for a miss in MissGem() at 0x001abf08 and PostCatchMsg() at 0x001ac470, and for a catch in CatchGem() at 0x001ac208 and SimulateRemoteGem() at 0x001ad004. The seven arguments are the seven members in declaration order.

Parameters
nTickThe scheduler time of the gem.
nTrackThe track the gem lies on.
nGemThe gem.
nHitNon-zero for a caught gem, zero for a miss.
pPlayerThe catching player.
nCaughtThe gems caught so far in the phrase, or zero.
nTotalThe gems the phrase requires, or zero.

Member Function Documentation

◆ New()

Message * CatchMsg::New ( )
static

Produce a default-constructed message on the heap.

The translation unit at 0x003d9818 registers this factory against identity 408.

Returns
The message.
Ghidra address:
NTSC-U/C: 0x003d75c0
Ghidra address:
PAL: 0x0040f4c0

◆ Clone()

virtual Message * CatchMsg::Clone ( )
virtual

Produce a heap copy of this message.

Returns
The copy.
Ghidra address:
NTSC-U/C: 0x001b1068
Ghidra address:
PAL: 0x001b6e18

Implements Message.

◆ Type()

virtual int CatchMsg::Type ( )
virtual

Report this message's registered identity.

Returns
g_nCatchMsgType.
Ghidra address:
NTSC-U/C: 0x001b10e0
Ghidra address:
PAL: 0x001b6e90

Implements Message.

◆ GetName()

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

Report this message's class name.

Returns
The literal CatchMsg.
Ghidra address:
NTSC-U/C: 0x001b10f0
Ghidra address:
PAL: 0x001b6ea0

Implements Message.

Member Data Documentation

◆ mTick

int CatchMsg::mTick = kTickInfinity

The scheduler time of the gem. +0x04

◆ mTrack

int CatchMsg::mTrack

The track the gem lies on. +0x08

◆ mGem

int CatchMsg::mGem

The gem, used by AppTunnel as the lane. +0x0c

◆ mHit

int CatchMsg::mHit

Non-zero for a caught gem, zero for a miss. +0x10

◆ mPlayer

Player* CatchMsg::mPlayer

The catching player. +0x14

◆ mCaught

int CatchMsg::mCaught

The gems caught so far in the phrase. +0x18

◆ mTotal

int CatchMsg::mTotal

The gems the phrase requires. +0x1c


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