diff --git a/BizHawk.Client.Common/rewind/Rewinder.cs b/BizHawk.Client.Common/rewind/Rewinder.cs index 46cbd58c92..d65582965e 100644 --- a/BizHawk.Client.Common/rewind/Rewinder.cs +++ b/BizHawk.Client.Common/rewind/Rewinder.cs @@ -31,17 +31,17 @@ namespace BizHawk.Client.Common public float FullnessRatio { - get { return _rewindBuffer != null ? _rewindBuffer.FullnessRatio : 0; } + get { return _rewindBuffer?.FullnessRatio ?? 0; } } public int Count { - get { return _rewindBuffer != null ? _rewindBuffer.Count : 0; } + get { return _rewindBuffer?.Count ?? 0; } } public long Size { - get { return _rewindBuffer != null ? _rewindBuffer.Size : 0; } + get { return _rewindBuffer?.Size ?? 0; } } public bool HasBuffer @@ -116,10 +116,7 @@ namespace BizHawk.Client.Common private void DoMessage(string message) { - if (MessageCallback != null) - { - MessageCallback(message); - } + MessageCallback?.Invoke(message); } private void SetRewindParams(bool enabled, int frequency) diff --git a/BizHawk.Client.EmuHawk/Sound/Output/DirectSoundSoundOutput.cs b/BizHawk.Client.EmuHawk/Sound/Output/DirectSoundSoundOutput.cs index ec1a19b549..42af277c0e 100644 --- a/BizHawk.Client.EmuHawk/Sound/Output/DirectSoundSoundOutput.cs +++ b/BizHawk.Client.EmuHawk/Sound/Output/DirectSoundSoundOutput.cs @@ -103,7 +103,7 @@ namespace BizHawk.Client.EmuHawk _lastWriteTime = 0; _lastWriteCursor = 0; - _deviceBuffer.Play(0, SlimDX.DirectSound.PlayFlags.Looping); + _deviceBuffer.Play(0, PlayFlags.Looping); } public void StopSound() diff --git a/BizHawk.Client.EmuHawk/Sound/Output/OpenALSoundOutput.cs b/BizHawk.Client.EmuHawk/Sound/Output/OpenALSoundOutput.cs index 4a24bb4d82..263a18c5be 100644 --- a/BizHawk.Client.EmuHawk/Sound/Output/OpenALSoundOutput.cs +++ b/BizHawk.Client.EmuHawk/Sound/Output/OpenALSoundOutput.cs @@ -86,7 +86,7 @@ namespace BizHawk.Client.EmuHawk currentSamplesPlayed = 0; } int samplesAwaitingPlayback = _currentSamplesQueued - currentSamplesPlayed; - int samplesNeeded = (int)Math.Max(BufferSizeSamples - samplesAwaitingPlayback, 0); + int samplesNeeded = Math.Max(BufferSizeSamples - samplesAwaitingPlayback, 0); if (isInitializing || detectedUnderrun) { _sound.HandleInitializationOrUnderrun(detectedUnderrun, ref samplesNeeded); diff --git a/BizHawk.Client.EmuHawk/UpdateChecker.cs b/BizHawk.Client.EmuHawk/UpdateChecker.cs index 5c7ba68c14..6b61290213 100644 --- a/BizHawk.Client.EmuHawk/UpdateChecker.cs +++ b/BizHawk.Client.EmuHawk/UpdateChecker.cs @@ -134,9 +134,9 @@ namespace BizHawk.Client.EmuHawk private static void OnCheckComplete() { - CheckComplete(null, EventArgs.Empty); + CheckComplete?.Invoke(null, EventArgs.Empty); } - public static event EventHandler CheckComplete = delegate { }; + public static event EventHandler CheckComplete; } }