use using declarations in Client.EmuHawk

This commit is contained in:
adelikat 2020-02-28 11:20:05 -06:00
parent 4bf463a2fc
commit a8a4f981a9
3 changed files with 12 additions and 16 deletions

View File

@ -163,8 +163,8 @@ namespace BizHawk.Client.EmuHawk
public Texture2d LoadTexture(Stream stream)
{
using (var bmp = new BitmapBuffer(stream, new BitmapLoadOptions()))
return (this as IGL).LoadTexture(bmp);
using var bmp = new BitmapBuffer(stream, new BitmapLoadOptions());
return (this as IGL).LoadTexture(bmp);
}
public Texture2d CreateTexture(int width, int height)

View File

@ -685,14 +685,14 @@ namespace BizHawk.Client.EmuHawk
public Texture2d LoadTexture(sd.Bitmap bitmap)
{
using (var bmp = new BitmapBuffer(bitmap, new BitmapLoadOptions()))
return (this as IGL).LoadTexture(bmp);
using var bmp = new BitmapBuffer(bitmap, new BitmapLoadOptions());
return (this as IGL).LoadTexture(bmp);
}
public Texture2d LoadTexture(Stream stream)
{
using (var bmp = new BitmapBuffer(stream, new BitmapLoadOptions()))
return (this as IGL).LoadTexture(bmp);
using var bmp = new BitmapBuffer(stream, new BitmapLoadOptions());
return (this as IGL).LoadTexture(bmp);
}
public Texture2d CreateTexture(int width, int height)
@ -984,9 +984,5 @@ namespace BizHawk.Client.EmuHawk
{
dev.EndScene();
}
} //class IGL_SlimDX
}

View File

@ -481,14 +481,14 @@ namespace BizHawk.Client.EmuHawk
public Texture2d LoadTexture(sd.Bitmap bitmap)
{
using (var bmp = new BitmapBuffer(bitmap, new BitmapLoadOptions()))
return (this as IGL).LoadTexture(bmp);
using var bmp = new BitmapBuffer(bitmap, new BitmapLoadOptions());
return (this as IGL).LoadTexture(bmp);
}
public Texture2d LoadTexture(Stream stream)
{
using(var bmp = new BitmapBuffer(stream,new BitmapLoadOptions()))
return (this as IGL).LoadTexture(bmp);
using var bmp = new BitmapBuffer(stream,new BitmapLoadOptions());
return (this as IGL).LoadTexture(bmp);
}
public Texture2d CreateTexture(int width, int height)
@ -601,8 +601,8 @@ namespace BizHawk.Client.EmuHawk
public Texture2d LoadTexture(string path)
{
using (var fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read))
return (this as IGL).LoadTexture(fs);
using var fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read);
return (this as IGL).LoadTexture(fs);
}
public Matrix4 CreateGuiProjectionMatrix(int w, int h)