(d9829ac) v0.9.4.0
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user