mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-11 20:11:18 +03:00
Improve and fix crash in SoundSystemWindows
Add 3D Sound Listener, Fix crash when DirectSound fails to initialize. Add second argument to setListenerAngle. Implement setListenerAngle and setListenerPos in Minecraft.cpp (Is this a good place to put it?)
This commit is contained in:
@@ -527,6 +527,15 @@ void Minecraft::tick()
|
||||
{
|
||||
m_pTextures->tick();
|
||||
m_pParticleEngine->tick();
|
||||
|
||||
#ifndef ORIGINAL_CODE
|
||||
if (m_pMobPersp)
|
||||
{
|
||||
m_pSoundEngine->m_soundSystem.setListenerPos(m_pMobPersp->m_pos.x, m_pMobPersp->m_pos.y, m_pMobPersp->m_pos.z);
|
||||
m_pSoundEngine->m_soundSystem.setListenerAngle(m_pMobPersp->m_yaw, m_pMobPersp->m_pitch);
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
if (field_D14)
|
||||
|
||||
@@ -17,9 +17,15 @@ void SoundSystem::setListenerPos(float x, float y, float z)
|
||||
{
|
||||
}
|
||||
|
||||
void SoundSystem::setListenerAngle(float f)
|
||||
#ifndef ORIGINAL_CODE
|
||||
void SoundSystem::setListenerAngle(float yaw, float pitch)
|
||||
{
|
||||
}
|
||||
#else
|
||||
void SoundSystem::setListenerAngle(float yaw)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
void SoundSystem::load(const std::string& sound)
|
||||
{
|
||||
|
||||
@@ -16,7 +16,11 @@ class SoundSystem
|
||||
public:
|
||||
virtual bool isAvailable();
|
||||
virtual void setListenerPos(float x, float y, float z);
|
||||
virtual void setListenerAngle(float f);
|
||||
#ifndef ORIGINAL_CODE
|
||||
virtual void setListenerAngle(float yaw, float pitch);
|
||||
#else
|
||||
virtual void setListenerAngle(float yaw);
|
||||
#endif
|
||||
virtual void load(const std::string& sound);
|
||||
virtual void play(const std::string& sound);
|
||||
virtual void pause(const std::string& sound);
|
||||
|
||||
Reference in New Issue
Block a user