Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
SoundMaker Class Reference
+ Collaboration diagram for SoundMaker:

Public Member Functions

 SoundMaker (ISoundManager *sound, const NodeDefManager *ndef)
 
void playPlayerStep ()
 
void playPlayerJump ()
 
void registerReceiver (MtEventManager *mgr)
 
void step (float dtime)
 

Static Public Member Functions

static void viewBobbingStep (MtEvent *e, void *data)
 
static void playerRegainGround (MtEvent *e, void *data)
 
static void playerJump (MtEvent *e, void *data)
 
static void cameraPunchLeft (MtEvent *e, void *data)
 
static void cameraPunchRight (MtEvent *e, void *data)
 
static void nodeDug (MtEvent *e, void *data)
 
static void playerDamage (MtEvent *e, void *data)
 
static void playerFallingDamage (MtEvent *e, void *data)
 

Public Attributes

bool makes_footstep_sound = true
 
float m_player_step_timer = 0.0f
 
float m_player_jump_timer = 0.0f
 
SoundSpec m_player_step_sound
 
SoundSpec m_player_leftpunch_sound
 
SoundSpec m_player_leftpunch_sound2
 
SoundSpec m_player_rightpunch_sound
 

Private Attributes

ISoundManagerm_sound
 
const NodeDefManagerm_ndef
 

Constructor & Destructor Documentation

◆ SoundMaker()

SoundMaker::SoundMaker ( ISoundManager * sound,
const NodeDefManager * ndef )
inline

Member Function Documentation

◆ cameraPunchLeft()

static void SoundMaker::cameraPunchLeft ( MtEvent * e,
void * data )
inlinestatic

References m_player_leftpunch_sound, m_player_leftpunch_sound2, m_sound, and ISoundManager::playSound().

Referenced by registerReceiver().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cameraPunchRight()

static void SoundMaker::cameraPunchRight ( MtEvent * e,
void * data )
inlinestatic

References m_player_rightpunch_sound, m_sound, and ISoundManager::playSound().

Referenced by registerReceiver().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nodeDug()

static void SoundMaker::nodeDug ( MtEvent * e,
void * data )
inlinestatic

References NodeDefManager::get(), m_ndef, m_sound, NodeDugEvent::n, ISoundManager::playSound(), and ContentFeatures::sound_dug.

Referenced by registerReceiver().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ playerDamage()

static void SoundMaker::playerDamage ( MtEvent * e,
void * data )
inlinestatic

References m_sound, and ISoundManager::playSound().

Referenced by registerReceiver().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ playerFallingDamage()

static void SoundMaker::playerFallingDamage ( MtEvent * e,
void * data )
inlinestatic

References m_sound, and ISoundManager::playSound().

Referenced by registerReceiver().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ playerJump()

static void SoundMaker::playerJump ( MtEvent * e,
void * data )
inlinestatic

References playPlayerJump().

Referenced by registerReceiver().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ playerRegainGround()

static void SoundMaker::playerRegainGround ( MtEvent * e,
void * data )
inlinestatic

References playPlayerStep().

Referenced by registerReceiver().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ playPlayerJump()

void SoundMaker::playPlayerJump ( )
inline

References m_player_jump_timer, m_sound, and ISoundManager::playSound().

Referenced by playerJump().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ playPlayerStep()

void SoundMaker::playPlayerStep ( )
inline

References SoundSpec::exists(), m_player_step_sound, m_player_step_timer, m_sound, makes_footstep_sound, and ISoundManager::playSound().

Referenced by playerRegainGround(), and viewBobbingStep().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ registerReceiver()

void SoundMaker::registerReceiver ( MtEventManager * mgr)
inline

References MtEvent::CAMERA_PUNCH_LEFT, MtEvent::CAMERA_PUNCH_RIGHT, cameraPunchLeft(), cameraPunchRight(), MtEvent::NODE_DUG, nodeDug(), MtEvent::PLAYER_DAMAGE, MtEvent::PLAYER_FALLING_DAMAGE, MtEvent::PLAYER_JUMP, MtEvent::PLAYER_REGAIN_GROUND, playerDamage(), playerFallingDamage(), playerJump(), playerRegainGround(), MtEventManager::reg(), MtEvent::VIEW_BOBBING_STEP, and viewBobbingStep().

Referenced by Game::initSound().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ step()

void SoundMaker::step ( float dtime)
inline

References m_player_jump_timer, and m_player_step_timer.

Referenced by Game::updateSound().

+ Here is the caller graph for this function:

◆ viewBobbingStep()

static void SoundMaker::viewBobbingStep ( MtEvent * e,
void * data )
inlinestatic

References playPlayerStep().

Referenced by registerReceiver().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_ndef

const NodeDefManager* SoundMaker::m_ndef
private

Referenced by nodeDug().

◆ m_player_jump_timer

float SoundMaker::m_player_jump_timer = 0.0f

Referenced by playPlayerJump(), and step().

◆ m_player_leftpunch_sound

SoundSpec SoundMaker::m_player_leftpunch_sound

◆ m_player_leftpunch_sound2

SoundSpec SoundMaker::m_player_leftpunch_sound2

◆ m_player_rightpunch_sound

SoundSpec SoundMaker::m_player_rightpunch_sound

◆ m_player_step_sound

SoundSpec SoundMaker::m_player_step_sound

◆ m_player_step_timer

float SoundMaker::m_player_step_timer = 0.0f

Referenced by playPlayerStep(), and step().

◆ m_sound

◆ makes_footstep_sound

bool SoundMaker::makes_footstep_sound = true

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