Reduce redundant attenuation code in main loop

This simplifies the code for setting the attenuation by setting it to 0,
and moving all the checks that change it next to each other.
This commit is contained in:
Meerkov 2016-09-28 21:48:35 -07:00
parent cd46188efe
commit 49d7f79ce5
1 changed files with 5 additions and 12 deletions

View File

@ -2729,9 +2729,7 @@ namespace BizHawk.Client.EmuHawk
bool isRewinding = suppressCaptureRewind = Rewind(ref runFrame, currentTimestamp);
float atten = Global.Config.SoundVolume / 100.0f;
if (!Global.Config.SoundEnabledNormal)
atten = 0;
float atten = 0;
var coreskipaudio = false;
if (runFrame || force)
@ -2803,12 +2801,11 @@ namespace BizHawk.Client.EmuHawk
}
CaptureRewind(suppressCaptureRewind);
if (Global.Config.SoundEnabledNormal)
atten = Global.Config.SoundVolume / 100.0f;
if (!_runloopFrameadvance)
{
}
else if (!Global.Config.MuteFrameAdvance)
if (_runloopFrameadvance && !Global.Config.MuteFrameAdvance)
{
atten = 0;
}
@ -2891,10 +2888,6 @@ namespace BizHawk.Client.EmuHawk
}
}
}
else
{
atten = 0;
}
if (Global.ClientControls["Rewind"] || PressRewind)
{