Unstable v0.1300.0.0 (February 19th 2021)
This commit is contained in:
@@ -19,6 +19,8 @@ namespace Barotrauma
|
||||
private set;
|
||||
}
|
||||
|
||||
private static volatile bool cancelAll = false;
|
||||
|
||||
public static void Init(GraphicsDevice graphicsDevice, bool needsBmp = false)
|
||||
{
|
||||
_graphicsDevice = graphicsDevice;
|
||||
@@ -36,6 +38,11 @@ namespace Barotrauma
|
||||
});
|
||||
}
|
||||
|
||||
public static void CancelAll()
|
||||
{
|
||||
cancelAll = true;
|
||||
}
|
||||
|
||||
private static byte[] CompressDxt5(byte[] data, int width, int height)
|
||||
{
|
||||
using (System.IO.MemoryStream mstream = new System.IO.MemoryStream())
|
||||
@@ -220,6 +227,7 @@ namespace Barotrauma
|
||||
Texture2D tex = null;
|
||||
CrossThread.RequestExecutionOnMainThread(() =>
|
||||
{
|
||||
if (cancelAll) { return; }
|
||||
tex = new Texture2D(_graphicsDevice, width, height, mipmap, format);
|
||||
tex.SetData(textureData);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user