wavelength 1.0.0
Loading...
Searching...
No Matches
Ramp Class Referenceabstract

Value that moves linearly to a target over song ticks, applied in steps by a scheduled command. More...

#include <ramp.h>

Inheritance diagram for Ramp:

Public Member Functions

 Ramp (Scheduler *pScheduler, float fValue)
 Construct a ramp that holds a value.
virtual ~Ramp ()
 Stop the ramp.
virtual void Apply (float fValue, int nTick)=0
 Apply a new value.
void MoveTo (int nTicks, int nStepTicks, float fTarget)
 Move from the current value to a target.
void Move (int nTicks, int nStepTicks, float fFrom, float fTarget)
 Move from one value to another.
void Stop ()
 Withdraw the next step, leaving the value where it is.
float GetValue () const
 Report the current value.

Detailed Description

Value that moves linearly to a target over song ticks, applied in steps by a scheduled command.

The RTTI includes the class name. A derived class supplies Apply(), which receives each new value. Only the members its callers here use are declared.

Constructor & Destructor Documentation

◆ Ramp()

Ramp::Ramp ( Scheduler * pScheduler,
float fValue )

Construct a ramp that holds a value.

Parameters
pSchedulerThe scheduler the steps are queued on.
fValueThe starting value.
Ghidra address:
NTSC-U/C: 0x002817f8
Ghidra address:
PAL: 0x0028b0f8

◆ ~Ramp()

virtual Ramp::~Ramp ( )
virtual

Stop the ramp.

Ghidra address:
NTSC-U/C: 0x00281880
Ghidra address:
PAL: 0x0028b180

Member Function Documentation

◆ Apply()

virtual void Ramp::Apply ( float fValue,
int nTick )
pure virtual

Apply a new value.

Parameters
fValueThe value.
nTickThe song tick the value applies at.

Implemented in GameLogic::SpeedRamp, Mixer::VolumeRamp, and MixTrack::VolumeRamp.

◆ MoveTo()

void Ramp::MoveTo ( int nTicks,
int nStepTicks,
float fTarget )

Move from the current value to a target.

Parameters
nTicksThe ticks the move lasts. Zero applies the target at once.
nStepTicksThe ticks between steps.
fTargetThe target.
Ghidra address:
NTSC-U/C: 0x002818e8
Ghidra address:
PAL: 0x0028b1e8

◆ Move()

void Ramp::Move ( int nTicks,
int nStepTicks,
float fFrom,
float fTarget )

Move from one value to another.

A move of no ticks, or between equal values, applies the target at once.

Parameters
nTicksThe ticks the move lasts.
nStepTicksThe ticks between steps.
fFromThe starting value.
fTargetThe target.
Ghidra address:
NTSC-U/C: 0x00281910
Ghidra address:
PAL: 0x0028b210

◆ Stop()

void Ramp::Stop ( )

Withdraw the next step, leaving the value where it is.

Ghidra address:
NTSC-U/C: 0x002819f0
Ghidra address:
PAL: 0x0028b2f0

◆ GetValue()

float Ramp::GetValue ( ) const

Report the current value.

Returns
The value.
Ghidra address:
NTSC-U/C: 0x00281a28
Ghidra address:
PAL: 0x0028b328

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