Luanti 5.16.0-dev
Loading...
Searching...
No Matches
SoundMaker Class Reference

#include <sound_maker.h>

Collaboration diagram for SoundMaker:

Public Member Functions

 SoundMaker (ISoundManager *sound, const NodeDefManager *ndef)
void registerReceiver (MtEventManager *mgr)
void update (f32 dtime, bool makes_footstep_sound, const SoundSpec &sound_footstep)

Public Attributes

SoundSpec m_player_leftpunch_sound
SoundSpec m_player_leftpunch_sound2
SoundSpec m_player_rightpunch_sound

Private Member Functions

void playPlayerStep ()
void playPlayerJump ()

Static Private 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)

Private Attributes

ISoundManagerm_sound
const NodeDefManagerm_ndef
float m_player_step_timer = 0.0f
float m_player_jump_timer = 0.0f
bool makes_footstep_sound = true
SoundSpec m_player_step_sound

Constructor & Destructor Documentation

◆ SoundMaker()

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

References m_ndef, and m_sound.

Referenced by cameraPunchLeft(), cameraPunchRight(), nodeDug(), playerDamage(), playerFallingDamage(), playerJump(), playerRegainGround(), and viewBobbingStep().

Here is the caller graph for this function:

Member Function Documentation

◆ cameraPunchLeft()

void SoundMaker::cameraPunchLeft ( MtEvent * e,
void * data )
staticprivate

References SoundMaker(), 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()

void SoundMaker::cameraPunchRight ( MtEvent * e,
void * data )
staticprivate

References SoundMaker(), 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()

void SoundMaker::nodeDug ( MtEvent * e,
void * data )
staticprivate

References SoundMaker(), 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()

void SoundMaker::playerDamage ( MtEvent * e,
void * data )
staticprivate

References SoundMaker(), 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()

void SoundMaker::playerFallingDamage ( MtEvent * e,
void * data )
staticprivate

References SoundMaker(), 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()

void SoundMaker::playerJump ( MtEvent * e,
void * data )
staticprivate

References SoundMaker(), and playPlayerJump().

Referenced by registerReceiver().

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

◆ playerRegainGround()

void SoundMaker::playerRegainGround ( MtEvent * e,
void * data )
staticprivate

References SoundMaker(), and playPlayerStep().

Referenced by registerReceiver().

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

◆ playPlayerJump()

void SoundMaker::playPlayerJump ( )
private

References m_player_jump_timer, and m_sound.

Referenced by playerJump().

Here is the caller graph for this function:

◆ playPlayerStep()

void SoundMaker::playPlayerStep ( )
private

References m_player_step_sound, m_player_step_timer, m_sound, and makes_footstep_sound.

Referenced by playerRegainGround(), and viewBobbingStep().

Here is the caller graph for this function:

◆ registerReceiver()

◆ update()

void SoundMaker::update ( f32 dtime,
bool makes_footstep_sound,
const SoundSpec & sound_footstep )

◆ viewBobbingStep()

void SoundMaker::viewBobbingStep ( MtEvent * e,
void * data )
staticprivate

References SoundMaker(), and 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 SoundMaker(), and nodeDug().

◆ m_player_jump_timer

float SoundMaker::m_player_jump_timer = 0.0f
private

Referenced by playPlayerJump(), and update().

◆ m_player_leftpunch_sound

SoundSpec SoundMaker::m_player_leftpunch_sound

Referenced by cameraPunchLeft().

◆ m_player_leftpunch_sound2

SoundSpec SoundMaker::m_player_leftpunch_sound2

Referenced by cameraPunchLeft().

◆ m_player_rightpunch_sound

SoundSpec SoundMaker::m_player_rightpunch_sound

Referenced by cameraPunchRight().

◆ m_player_step_sound

SoundSpec SoundMaker::m_player_step_sound
private

Referenced by playPlayerStep(), and update().

◆ m_player_step_timer

float SoundMaker::m_player_step_timer = 0.0f
private

Referenced by playPlayerStep(), and update().

◆ m_sound

◆ makes_footstep_sound

bool SoundMaker::makes_footstep_sound = true
private

Referenced by playPlayerStep(), and update().


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