Release v0.15.12.0
This commit is contained in:
@@ -41,21 +41,13 @@ namespace Barotrauma
|
||||
public Sprite(Texture2D texture, Rectangle? sourceRectangle, Vector2? newOffset, float newRotation = 0.0f, string path = null)
|
||||
{
|
||||
this.texture = texture;
|
||||
|
||||
sourceRect = sourceRectangle ?? new Rectangle(0, 0, texture.Width, texture.Height);
|
||||
|
||||
offset = newOffset ?? Vector2.Zero;
|
||||
|
||||
size = new Vector2(sourceRect.Width, sourceRect.Height);
|
||||
|
||||
origin = Vector2.Zero;
|
||||
|
||||
effects = SpriteEffects.None;
|
||||
|
||||
rotation = newRotation;
|
||||
|
||||
FilePath = path;
|
||||
|
||||
AddToList(this);
|
||||
}
|
||||
|
||||
@@ -85,7 +77,7 @@ namespace Barotrauma
|
||||
EnsureLazyLoaded(isAsync: true);
|
||||
}
|
||||
|
||||
public void EnsureLazyLoaded(bool isAsync=false)
|
||||
public void EnsureLazyLoaded(bool isAsync = false)
|
||||
{
|
||||
if (!LazyLoad || texture != null || cannotBeLoaded || loadingAsync) { return; }
|
||||
loadingAsync = isAsync;
|
||||
@@ -177,7 +169,7 @@ namespace Barotrauma
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugConsole.ThrowError("Sprite \"" + file + "\" not found!");
|
||||
DebugConsole.ThrowError($"Sprite \"{file}\" not found! {Environment.StackTrace.CleanupStackTrace()}");
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -382,7 +374,7 @@ namespace Barotrauma
|
||||
{
|
||||
foreach (Sprite s in LoadedSprites)
|
||||
{
|
||||
if (s.FullPath == FullPath) return;
|
||||
if (s.FullPath == FullPath) { return; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user