From 49d7f79ce5f49c3fdeb4453aeba709bf61fe158f Mon Sep 17 00:00:00 2001 From: Meerkov Date: Wed, 28 Sep 2016 21:48:35 -0700 Subject: [PATCH] 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. --- BizHawk.Client.EmuHawk/MainForm.cs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index b600429f96..9a0d7477b5 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -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) {