use null propagation in Client.EmuHawk
This commit is contained in:
parent
a8a4f981a9
commit
c7ed6015a2
|
@ -319,8 +319,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
refGraphics = Graphics.FromImage(tw.SDBitmap);
|
||||
}
|
||||
|
||||
if (MyBufferedGraphics != null)
|
||||
MyBufferedGraphics.Dispose();
|
||||
MyBufferedGraphics?.Dispose();
|
||||
MyBufferedGraphics = Gdi.MyBufferedGraphicsContext.Allocate(refGraphics, r);
|
||||
//MyBufferedGraphics.Graphics.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighSpeed;
|
||||
|
||||
|
|
|
@ -522,8 +522,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
var sw = shader.Opaque as ShaderWrapper;
|
||||
sw.bytecode.Dispose();
|
||||
if (sw.ps != null) sw.ps.Dispose();
|
||||
if (sw.vs != null) sw.vs.Dispose();
|
||||
sw.ps?.Dispose();
|
||||
sw.vs?.Dispose();
|
||||
}
|
||||
|
||||
class UniformWrapper
|
||||
|
|
|
@ -53,8 +53,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
if (_retain)
|
||||
{
|
||||
//TODO - frugalize me
|
||||
if (rt != null)
|
||||
rt.Dispose();
|
||||
rt?.Dispose();
|
||||
rt = GL.CreateRenderTarget(Width, Height);
|
||||
rt.Bind();
|
||||
}
|
||||
|
|
|
@ -53,9 +53,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
public void DiscardSamples()
|
||||
{
|
||||
buffer.Clear();
|
||||
|
||||
if (BaseSoundProvider != null)
|
||||
BaseSoundProvider.DiscardSamples();
|
||||
BaseSoundProvider?.DiscardSamples();
|
||||
}
|
||||
|
||||
/// <exception cref="InvalidOperationException"><see cref="BaseSoundProvider"/>.<see cref="ISoundProvider.SyncMode"/> is not <see cref="SyncSoundMode.Async"/></exception>
|
||||
|
|
|
@ -94,10 +94,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
_resampleBuffer = new short[0];
|
||||
_resampleLengthRoundingError = 0.0;
|
||||
|
||||
if (BaseSoundProvider != null)
|
||||
{
|
||||
BaseSoundProvider.DiscardSamples();
|
||||
}
|
||||
BaseSoundProvider?.DiscardSamples();
|
||||
}
|
||||
|
||||
private void ResetBuffer()
|
||||
|
|
|
@ -335,8 +335,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
foreach (var fr in FirmwareDatabase.FirmwareRecords)
|
||||
{
|
||||
var ri = Manager.Resolve(fr);
|
||||
if (ri == null) continue;
|
||||
if (ri.KnownFirmwareFile == null) continue;
|
||||
if (ri?.KnownFirmwareFile == null) continue;
|
||||
if (ri.UserSpecified) continue;
|
||||
|
||||
string fpTarget = PathManager.StandardFirmwareName(ri.KnownFirmwareFile.RecommendedName);
|
||||
|
|
Loading…
Reference in New Issue