(d9829ac) v0.9.4.0

This commit is contained in:
Regalis
2019-10-24 18:05:42 +02:00
parent 9aa12bcac2
commit b39922a074
319 changed files with 12516 additions and 6815 deletions
@@ -80,16 +80,7 @@ namespace Barotrauma
{
int width = 0; int height = 0; int channels = 0;
byte[] textureData = null;
Task loadTask = Task.Run(() =>
{
textureData = Texture2D.TextureDataFromStream(fileStream, out width, out height, out channels);
});
bool success = loadTask.Wait(10000);
if (!success)
{
DebugConsole.ThrowError("Failed to load texture data from " + (path ?? "stream") + ": timed out");
return null;
}
textureData = Texture2D.TextureDataFromStream(fileStream, out width, out height, out channels);
if (preMultiplyAlpha)
{
PreMultiplyAlpha(ref textureData);
@@ -104,6 +95,10 @@ namespace Barotrauma
}
catch (Exception e)
{
#if WINDOWS
if (e is SharpDX.SharpDXException) { throw; }
#endif
DebugConsole.ThrowError("Loading texture from stream failed!", e);
return null;
}