(3dc4135ce) v0.9.5.1

This commit is contained in:
Regalis
2019-11-21 18:22:25 +01:00
parent b39922a074
commit 5c95c53118
287 changed files with 12655 additions and 5048 deletions
@@ -57,13 +57,13 @@ namespace Barotrauma
});
}
public static Texture2D FromFile(string path, bool preMultiplyAlpha = true)
public static Texture2D FromFile(string path, bool preMultiplyAlpha = true, bool mipmap=false)
{
try
{
using (Stream fileStream = File.OpenRead(path))
{
return FromStream(fileStream, preMultiplyAlpha, path);
return FromStream(fileStream, preMultiplyAlpha, path, mipmap);
}
}
@@ -74,7 +74,7 @@ namespace Barotrauma
}
}
public static Texture2D FromStream(Stream fileStream, bool preMultiplyAlpha = true, string path=null)
public static Texture2D FromStream(Stream fileStream, bool preMultiplyAlpha = true, string path=null, bool mipmap=false)
{
try
{
@@ -88,7 +88,7 @@ namespace Barotrauma
Texture2D tex = null;
CrossThread.RequestExecutionOnMainThread(() =>
{
tex = new Texture2D(_graphicsDevice, width, height);
tex = new Texture2D(_graphicsDevice, width, height, mipmap, SurfaceFormat.Color);
tex.SetData(textureData);
});
return tex;