Build 0.18.0.0

This commit is contained in:
Markus Isberg
2022-05-13 00:55:52 +09:00
parent 15d18e6ff6
commit 7547a9b78a
218 changed files with 3881 additions and 2192 deletions
@@ -39,9 +39,8 @@ namespace Barotrauma
get { return texture != null && !cannotBeLoaded; }
}
public Sprite(Sprite other) : this(other.texture, other.sourceRect, other.offset, other.rotation)
public Sprite(Sprite other) : this(other.texture, other.sourceRect, other.offset, other.rotation, other.FilePath.Value)
{
FilePath = other.FilePath;
Compress = other.Compress;
size = other.size;
effects = other.effects;
@@ -58,6 +57,17 @@ namespace Barotrauma
rotation = newRotation;
FilePath = ContentPath.FromRaw(path);
AddToList(this);
if (!string.IsNullOrEmpty(path))
{
Identifier fullPath = Path.GetFullPath(path).CleanUpPathCrossPlatform(correctFilenameCase: false).ToIdentifier();
lock (list)
{
if (!textureRefCounts.TryAdd(fullPath, new TextureRefCounter { RefCount = 1, Texture = texture }))
{
textureRefCounts[fullPath].RefCount++;
}
}
}
}
partial void LoadTexture(ref Vector4 sourceVector, ref bool shouldReturn)