mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-11 19:53:52 +00:00
Fix sound settings not applying (#664)
* Fix sound settings not applying * Remove my AllocConsole * Forgot this printf
This commit is contained in:
parent
e2b8699ba5
commit
5cbdf27b46
1 changed files with 6 additions and 15 deletions
|
|
@ -260,7 +260,7 @@ void SoundEngine::updateMiniAudio()
|
|||
continue;
|
||||
}
|
||||
|
||||
float finalVolume = s->info.volume;
|
||||
float finalVolume = s->info.volume * m_MasterEffectsVolume;
|
||||
if (finalVolume > 1.0f)
|
||||
finalVolume = 1.0f;
|
||||
|
||||
|
|
@ -967,14 +967,8 @@ void SoundEngine::playMusicTick()
|
|||
// AP - moved to a separate function so it can be called from the mixer callback on Vita
|
||||
void SoundEngine::playMusicUpdate()
|
||||
{
|
||||
//return;
|
||||
static bool firstCall = true;
|
||||
static float fMusicVol = 0.0f;
|
||||
if( firstCall )
|
||||
{
|
||||
fMusicVol = getMasterMusicVolume();
|
||||
firstCall = false;
|
||||
}
|
||||
fMusicVol = getMasterMusicVolume();
|
||||
|
||||
switch(m_StreamState)
|
||||
{
|
||||
|
|
@ -1242,7 +1236,7 @@ void SoundEngine::playMusicUpdate()
|
|||
|
||||
ma_sound_set_pitch(&m_musicStream, m_StreamingAudioInfo.pitch);
|
||||
|
||||
float finalVolume = m_StreamingAudioInfo.volume * m_MasterMusicVolume;
|
||||
float finalVolume = m_StreamingAudioInfo.volume * getMasterMusicVolume();
|
||||
|
||||
ma_sound_set_volume(&m_musicStream, finalVolume);
|
||||
ma_result startResult = ma_sound_start(&m_musicStream);
|
||||
|
|
@ -1370,14 +1364,11 @@ void SoundEngine::playMusicUpdate()
|
|||
}
|
||||
|
||||
// volume change required?
|
||||
if (fMusicVol != getMasterMusicVolume())
|
||||
if (m_musicStreamActive)
|
||||
{
|
||||
if (m_musicStreamActive)
|
||||
{
|
||||
float finalVolume = m_StreamingAudioInfo.volume * fMusicVol;
|
||||
float finalVolume = m_StreamingAudioInfo.volume * fMusicVol;
|
||||
|
||||
ma_sound_set_volume(&m_musicStream, finalVolume);
|
||||
}
|
||||
ma_sound_set_volume(&m_musicStream, finalVolume);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue