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

Icon of the power-up a player holds, with its name. More...

#include <hudpowerup.h>

Public Types

enum  Icon {
  kIconAutocatcher = 0 , kIconSlowdown = 1 , kIconBumper = 2 , kIconCrippler = 3 ,
  kIconFreestyle = 4 , kIconMultiplier = 5 , kNumIcons = 6
}
 The icons, the indices of mIcons. More...

Public Member Functions

 HudPowerup (int nIndex, RndView *pHudView)
 Construct an empty icon of a player.
void Reset ()
 Empty the icon and move it out of sight at once.
void ShowPowerup (int nPowerup)
 Show the icon and the name of a power-up, or empty the icon.
void Poll (float fDelta, float fUnused, float fDeltaTicks)
 Advance the slide, and show the icon while it is not out of sight.
void UpdateSlide ()
 Slide the icon into view when a power-up is held and the icon is enabled, and out of sight otherwise.
void SetEnabled (int nEnabled)

Static Public Attributes

static constexpr float kHiddenFrame = 480.0f
 The frame of the slide at which the icon is out of sight.

Detailed Description

Icon of the power-up a player holds, with its name.

The class is not polymorphic and emits no RTTI. The object is 0x40 bytes. The icon slides out of sight while the player holds no power-up. In the tutorial the icon does not slide.

Member Enumeration Documentation

◆ Icon

The icons, the indices of mIcons.

Enumerator
kIconAutocatcher 

<hud> pup auto<n>.view.

kIconSlowdown 

<hud> pup slow<n>.view.

kIconBumper 

<hud> pup bump<n>.view.

kIconCrippler 

<hud> pup crip<n>.view.

kIconFreestyle 

<hud> pup free<n>.view.

kIconMultiplier 

<hud> pup mult<n>.view.

kNumIcons 

The number of icons.

Constructor & Destructor Documentation

◆ HudPowerup()

HudPowerup::HudPowerup ( int nIndex,
RndView * pHudView )

Construct an empty icon of a player.

The scene objects are <hud> pup<n>.mesh, <hud> pup<n>.view, <hud> pup<n> name.txt, the six icon views, and the slide <hud> pup<n> hide.tnm. An online game uses the HUD1 objects and draws the icon into the letterboxed view of its player.

Parameters
nIndexThe number of the icon, from 0.
pHudViewThe view of the head-up display.
Ghidra address:
NTSC-U/C: 0x001bc730
Ghidra address:
PAL: 0x001c54d0

Member Function Documentation

◆ Reset()

void HudPowerup::Reset ( )

Empty the icon and move it out of sight at once.

Ghidra address:
NTSC-U/C: 0x001bcd68
Ghidra address:
PAL: 0x001c5b08

◆ ShowPowerup()

void HudPowerup::ShowPowerup ( int nPowerup)

Show the icon and the name of a power-up, or empty the icon.

Parameters
nPowerupThe power-up, one of GameLogic::Powerup.
Ghidra address:
NTSC-U/C: 0x001bcdb8
Ghidra address:
PAL: 0x001c5b58

◆ Poll()

void HudPowerup::Poll ( float fDelta,
float fUnused,
float fDeltaTicks )

Advance the slide, and show the icon while it is not out of sight.

Parameters
fDeltaThe time since the last poll, or 0 to take it from fDeltaTicks.
fUnusedNot read.
fDeltaTicksThe ticks since the last poll.
Ghidra address:
NTSC-U/C: 0x001bcfb0
Ghidra address:
PAL: 0x001c5d50

◆ UpdateSlide()

void HudPowerup::UpdateSlide ( )

Slide the icon into view when a power-up is held and the icon is enabled, and out of sight otherwise.

Ghidra address:
NTSC-U/C: 0x001bd038
Ghidra address:
PAL: 0x001c5dd8

◆ SetEnabled()

void HudPowerup::SetEnabled ( int nEnabled)
inline
Parameters
nEnabledWhether the icon may slide into view.

Member Data Documentation

◆ kHiddenFrame

float HudPowerup::kHiddenFrame = 480.0f
staticconstexpr

The frame of the slide at which the icon is out of sight.


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