aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Common/Audio/SoundEngine.h
diff options
context:
space:
mode:
authorqwasdrizzel <145519042+qwasdrizzel@users.noreply.github.com>2026-03-16 21:44:26 -0500
committerGitHub <noreply@github.com>2026-03-16 21:44:26 -0500
commitce739f6045ec72127491286ea3f3f21e537c1b55 (patch)
treef33bd42a47c1b4a7b2153a7fb77127ee3b407db9 /Minecraft.Client/Common/Audio/SoundEngine.h
parent255a18fe8e9b57377975f82e2b227afe2a12eda0 (diff)
parent5a59f5d146b43811dde6a5a0245ee9875d7b5cd1 (diff)
Merge branch 'smartcmd:main' into main
Diffstat (limited to 'Minecraft.Client/Common/Audio/SoundEngine.h')
-rw-r--r--Minecraft.Client/Common/Audio/SoundEngine.h39
1 files changed, 23 insertions, 16 deletions
diff --git a/Minecraft.Client/Common/Audio/SoundEngine.h b/Minecraft.Client/Common/Audio/SoundEngine.h
index 5bd2fe4b..38d70d41 100644
--- a/Minecraft.Client/Common/Audio/SoundEngine.h
+++ b/Minecraft.Client/Common/Audio/SoundEngine.h
@@ -6,6 +6,12 @@ using namespace std;
#include "miniaudio.h"
+constexpr float SFX_3D_MIN_DISTANCE = 1.0f;
+constexpr float SFX_3D_MAX_DISTANCE = 16.0f;
+constexpr float SFX_3D_ROLLOFF = 0.5f;
+constexpr float SFX_VOLUME_MULTIPLIER = 1.5f;
+constexpr float SFX_MAX_GAIN = 1.5f;
+
enum eMUSICFILES
{
eStream_Overworld_Calm1 = 0,
@@ -108,23 +114,23 @@ class SoundEngine : public ConsoleSoundEngine
static const int MAX_SAME_SOUNDS_PLAYING = 8; // 4J added
public:
SoundEngine();
- virtual void destroy();
+ void destroy() override;
#ifdef _DEBUG
void GetSoundName(char *szSoundName,int iSound);
#endif
- virtual void play(int iSound, float x, float y, float z, float volume, float pitch);
- virtual void playStreaming(const wstring& name, float x, float y , float z, float volume, float pitch, bool bMusicDelay=true);
- virtual void playUI(int iSound, float volume, float pitch);
- virtual void playMusicTick();
- virtual void updateMusicVolume(float fVal);
- virtual void updateSystemMusicPlaying(bool isPlaying);
- virtual void updateSoundEffectVolume(float fVal);
- virtual void init(Options *);
- virtual void tick(shared_ptr<Mob> *players, float a); // 4J - updated to take array of local players rather than single one
- virtual void add(const wstring& name, File *file);
- virtual void addMusic(const wstring& name, File *file);
- virtual void addStreaming(const wstring& name, File *file);
- virtual char *ConvertSoundPathToName(const wstring& name, bool bConvertSpaces=false);
+ void play(int iSound, float x, float y, float z, float volume, float pitch) override;
+ void playStreaming(const wstring& name, float x, float y , float z, float volume, float pitch, bool bMusicDelay=true) override;
+ void playUI(int iSound, float volume, float pitch) override;
+ void playMusicTick() override;
+ void updateMusicVolume(float fVal) override;
+ void updateSystemMusicPlaying(bool isPlaying) override;
+ void updateSoundEffectVolume(float fVal) override;
+ void init(Options *) override;
+ void tick(shared_ptr<Mob> *players, float a) override; // 4J - updated to take array of local players rather than single one
+ void add(const wstring& name, File *file) override;
+ void addMusic(const wstring& name, File *file) override;
+ void addStreaming(const wstring& name, File *file) override;
+ char *ConvertSoundPathToName(const wstring& name, bool bConvertSpaces=false) override;
bool isStreamingWavebankReady(); // 4J Added
int getMusicID(int iDomain);
int getMusicID(const wstring& name);
@@ -138,7 +144,8 @@ private:
#ifdef __PS3__
int initAudioHardware(int iMinSpeakers);
#else
- int initAudioHardware(int iMinSpeakers) { return iMinSpeakers;}
+ int initAudioHardware(int iMinSpeakers) override
+ { return iMinSpeakers;}
#endif
int GetRandomishTrack(int iStart,int iEnd);
@@ -151,7 +158,7 @@ private:
static char m_szSoundPath[];
static char m_szMusicPath[];
static char m_szRedistName[];
- static char *m_szStreamFileA[eStream_Max];
+ static const char *m_szStreamFileA[eStream_Max];
AUDIO_LISTENER m_ListenerA[MAX_LOCAL_PLAYERS];
int m_validListenerCount;