Changed TextureLoader.PreMultiplyAlpha return type to void

This commit is contained in:
juanjp600
2018-09-10 18:09:26 -03:00
parent 89c8de8b27
commit ae70b973dd
@@ -46,7 +46,7 @@ namespace Barotrauma
using (Stream fileStream = File.OpenRead(path)) using (Stream fileStream = File.OpenRead(path))
{ {
var texture = Texture2D.FromStream(_graphicsDevice, fileStream); var texture = Texture2D.FromStream(_graphicsDevice, fileStream);
texture = PreMultiplyAlpha(texture); PreMultiplyAlpha(texture);
return texture; return texture;
} }
@@ -63,7 +63,7 @@ namespace Barotrauma
try try
{ {
var texture = Texture2D.FromStream(_graphicsDevice, fileStream); var texture = Texture2D.FromStream(_graphicsDevice, fileStream);
texture = PreMultiplyAlpha(texture); PreMultiplyAlpha(texture);
return texture; return texture;
} }
catch (Exception e) catch (Exception e)
@@ -73,7 +73,7 @@ namespace Barotrauma
} }
} }
private static Texture2D PreMultiplyAlpha(Texture2D texture) private static void PreMultiplyAlpha(Texture2D texture)
{ {
// Setup a render target to hold our final texture which will have premulitplied alpha values // Setup a render target to hold our final texture which will have premulitplied alpha values
using (RenderTarget2D renderTarget = new RenderTarget2D(_graphicsDevice, texture.Width, texture.Height)) using (RenderTarget2D renderTarget = new RenderTarget2D(_graphicsDevice, texture.Width, texture.Height))
@@ -104,8 +104,6 @@ namespace Barotrauma
_graphicsDevice.Textures[0] = null; _graphicsDevice.Textures[0] = null;
texture.SetData(data); texture.SetData(data);
} }
return texture;
} }