wavelength 1.0.0
Loading...
Searching...
No Matches
FreestylePacket Class Reference

Packet that reports a freestyle player's button and stick to the other consoles. More...

#include <freestylepacket.h>

Inheritance diagram for FreestylePacket:
Collaboration diagram for FreestylePacket:

Public Member Functions

 ~FreestylePacket () override=default
 Destroy the object.
 FreestylePacket ()
 Construct an inactive packet.
 FreestylePacket (bool bActive, int nButton, float fX, float fY)
 Construct a packet for a freestyle player.
void * operator new (size_t nSize)
 Allocate a packet, billed to the class name.
void operator delete (void *pBlock)
 Release a packet.
Message * Clone () override
 Produce a heap copy of this packet.
int Type () override
 Report this packet's registered identity.
const char * GetName () const override
 Report this packet's class name.
void saveGuts (BinStream &stream) const override
 Write the state and the button, then each stick position in fixed point, in one half-word.
void restoreGuts (BinStream &stream) override
 Read the half-word saveGuts() writes back into the fields.
void PrintExtra (PrnStream &stream) const override
 Write the state, the button, and the stick position.
int GetActive () const
int GetButton () const
float GetX () const
float GetY () const
Public Member Functions inherited from ExternalPacket
 ExternalPacket (unsigned char nFlags=0, int nReceiver=kAllPeers)
 Construct a packet from an unset sender.
int Route () override
 Report that a received packet goes to the sink of TheNetTransport.
Public Member Functions inherited from Packet
void PrintExtra (PrnStream &stream) const override
 Write the sender and the receiver that are set, as from: and to:.
unsigned char GetFlags () const
int GetReceiver () const
int GetSender () const
void SetSender (int nSender)
Public Member Functions inherited from Message
virtual ~Message ()
 Vtable slot 1.
virtual ~Message ()
virtual void Unused1 ()
 Not called by the control.

Static Public Member Functions

static Message * New ()
 Produce a default-constructed packet on the heap.
static int Quantize (float fValue, int nBits)
 Convert a value from -1 to 1 to a signed fixed-point value.
static float Dequantize (int nValue, int nBits)
 Convert a signed fixed-point value back to a value from -1 to 1.
Static Public Member Functions inherited from Message
static Message * NewMessage (int nType)
 Produce a message of the identified class through the factory list.

Additional Inherited Members

Public Types inherited from Packet
enum  RouteFlag { kRouteTransport = 1 , kRouteLaunchpad = 2 }
 Bits of Route(). More...
Static Public Attributes inherited from Packet
static constexpr int kUnset = -2
 Value of mSender and mReceiver that marks the member as unset.
static constexpr int kAllPeers = -1
 Value of mReceiver that addresses every peer.
static constexpr unsigned char kFlagOrdered = 1
 Bit of mFlags that LaunchpadRT::Send() turns into the second delivery bit of the session library.
static constexpr unsigned char kFlagGuaranteed = 2
 Bit of mFlags that NetTransport::Send() turns into its guaranteed delivery bit.
Protected Member Functions inherited from Packet
 Packet (unsigned char nFlags, int nReceiver)
 Construct a packet from an unset sender.

Detailed Description

Packet that reports a freestyle player's button and stick to the other consoles.

The RTTI records the class as deriving from ExternalPacket. The members Clone(), Type(), and GetName() are inline.

Constructor & Destructor Documentation

◆ ~FreestylePacket()

FreestylePacket::~FreestylePacket ( )
overridedefault

Destroy the object.

Ghidra address:
NTSC-U/C: 0x0034b8d0
Ghidra address:
PAL: 0x003b8d00

◆ FreestylePacket() [1/2]

FreestylePacket::FreestylePacket ( )
inline

Construct an inactive packet.

Inline. New() expands it.

◆ FreestylePacket() [2/2]

FreestylePacket::FreestylePacket ( bool bActive,
int nButton,
float fX,
float fY )
inline

Construct a packet for a freestyle player.

Inline. FreestyleTrack::SendUpdate() expands it on its stack.

Parameters
bActiveWhether the player is playing freestyle.
nButtonThe button pressed.
fXThe stick's horizontal position.
fYThe stick's vertical position.

Member Function Documentation

◆ New()

Message * FreestylePacket::New ( )
static

Produce a default-constructed packet on the heap.

Returns
The packet.
Ghidra address:
NTSC-U/C: 0x00123140
Ghidra address:
PAL: 0x001248c0

◆ operator new()

void * FreestylePacket::operator new ( size_t nSize)
inline

Allocate a packet, billed to the class name.

Parameters
nSizeThe object size the compiler supplies.
Returns
The block.

◆ operator delete()

void FreestylePacket::operator delete ( void * pBlock)
inline

Release a packet.

Parameters
pBlockThe block.

◆ Clone()

Message * FreestylePacket::Clone ( )
inlineoverridevirtual

Produce a heap copy of this packet.

Returns
The copy.
Ghidra address:
NTSC-U/C: 0x0034b970
Ghidra address:
PAL: 0x003b8da0

Implements Message.

◆ Type()

int FreestylePacket::Type ( )
inlineoverridevirtual

Report this packet's registered identity.

Returns
g_nFreestylePacketType.
Ghidra address:
NTSC-U/C: 0x0034b9f8
Ghidra address:
PAL: 0x003b8e28

Implements Message.

◆ GetName()

const char * FreestylePacket::GetName ( ) const
inlineoverridevirtual

Report this packet's class name.

Returns
The literal FreestylePacket.
Ghidra address:
NTSC-U/C: 0x0034ba08
Ghidra address:
PAL: 0x003b8e38

Implements Message.

◆ saveGuts()

void FreestylePacket::saveGuts ( BinStream & stream) const
overridevirtual

Write the state and the button, then each stick position in fixed point, in one half-word.

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

Reimplemented from Message.

◆ restoreGuts()

void FreestylePacket::restoreGuts ( BinStream & stream)
overridevirtual

Read the half-word saveGuts() writes back into the fields.

Parameters
streamThe stream to read from.
Ghidra address:
NTSC-U/C: 0x0014fb68
Ghidra address:
PAL: 0x001514c8

Reimplemented from Message.

◆ PrintExtra()

void FreestylePacket::PrintExtra ( PrnStream & stream) const
overridevirtual

Write the state, the button, and the stick position.

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

Reimplemented from Message.

◆ Quantize()

int FreestylePacket::Quantize ( float fValue,
int nBits )
static

Convert a value from -1 to 1 to a signed fixed-point value.

The name is inferred.

Parameters
fValueThe value.
nBitsThe width of the result, sign included.
Returns
The fixed-point value, rounded.
Ghidra address:
NTSC-U/C: 0x0014fa28
Ghidra address:
PAL: 0x00151388

◆ Dequantize()

float FreestylePacket::Dequantize ( int nValue,
int nBits )
static

Convert a signed fixed-point value back to a value from -1 to 1.

The name is inferred.

Parameters
nValueThe fixed-point value.
nBitsThe width of the value, sign included.
Returns
The value.
Ghidra address:
NTSC-U/C: 0x0014fa68
Ghidra address:
PAL: 0x001513c8

◆ GetActive()

int FreestylePacket::GetActive ( ) const
inline
Returns
Whether the player is playing freestyle.

◆ GetButton()

int FreestylePacket::GetButton ( ) const
inline
Returns
The button pressed.

◆ GetX()

float FreestylePacket::GetX ( ) const
inline
Returns
The stick's horizontal position.

◆ GetY()

float FreestylePacket::GetY ( ) const
inline
Returns
The stick's vertical position.

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