Submarine preview window with a preview image & some extra information of the subs

This commit is contained in:
Joonas Rikkonen
2018-01-17 17:01:44 +02:00
parent 8544dea9db
commit f5dbbf0735
11 changed files with 338 additions and 59 deletions
@@ -43,7 +43,6 @@ namespace Barotrauma
{
try
{
using (Stream fileStream = File.OpenRead(path))
{
var texture = Texture2D.FromStream(_graphicsDevice, fileStream);
@@ -54,10 +53,24 @@ namespace Barotrauma
}
catch (Exception e)
{
DebugConsole.ThrowError("Loading texture \""+path+"\" failed!", e);
DebugConsole.ThrowError("Loading texture \"" + path + "\" failed!", e);
return null;
}
}
public static Texture2D FromStream(Stream fileStream, bool preMultiplyAlpha = true)
{
try
{
var texture = Texture2D.FromStream(_graphicsDevice, fileStream);
texture = PreMultiplyAlpha(texture);
return texture;
}
catch (Exception e)
{
DebugConsole.ThrowError("Loading texture from stream failed!", e);
return null;
}
}
private static Texture2D PreMultiplyAlpha(Texture2D texture)