Fixed client compilation errors

This commit is contained in:
juanjp600
2017-06-14 18:24:11 -03:00
parent 96b08ed8aa
commit e4a878113f
9 changed files with 10 additions and 54 deletions
+1 -32
View File
@@ -5,39 +5,8 @@ using Microsoft.Xna.Framework.Graphics;
namespace Barotrauma
{
class SpriteSheet : Sprite
partial class SpriteSheet : Sprite
{
private Rectangle[] sourceRects;
public int FrameCount
{
get { return sourceRects.Length; }
}
public SpriteSheet(XElement element, string path = "", string file = "")
: base(element, path, file)
{
int columnCount = Math.Max(ToolBox.GetAttributeInt(element, "columns", 1), 1);
int rowCount = Math.Max(ToolBox.GetAttributeInt(element, "rows", 1), 1);
sourceRects = new Rectangle[rowCount * columnCount];
int cellWidth = SourceRect.Width / columnCount;
int cellHeight = SourceRect.Height / rowCount;
for (int x = 0; x < columnCount; x++)
{
for (int y = 0; y < rowCount; y++)
{
sourceRects[x + y * columnCount] = new Rectangle(x * cellWidth, y * cellHeight, cellWidth, cellHeight);
}
}
origin = ToolBox.GetAttributeVector2(element, "origin", new Vector2(0.5f, 0.5f));
origin.X = origin.X * cellWidth;
origin.Y = origin.Y * cellHeight;
}
public override void Draw(SpriteBatch spriteBatch, Vector2 pos, Color color, Vector2 origin, float rotate, Vector2 scale, SpriteEffects spriteEffect = SpriteEffects.None, float? depth = default(float?))
{
if (texture == null) return;