cleaned up pipeline code for atlas

This commit is contained in:
Harrison Deng 2018-12-05 15:18:22 -06:00
parent 4136b1ca22
commit dde2c3dadf
3 changed files with 10 additions and 12 deletions

View File

@ -21,6 +21,7 @@ namespace RecrownedAthenaeum.Pipeline.TextureAtlas
{
atlas = JsonConvert.DeserializeObject<TextureAtlasData>(stream.ReadToEnd());
}
context.AddDependency(atlas.textureName);
return atlas;
}
}

View File

@ -20,16 +20,15 @@ namespace RecrownedAthenaeum.Pipeline.TextureAtlas
string serialized = JsonConvert.SerializeObject(input);
byte[] bytes = Encoding.UTF8.GetBytes(serialized);
MemoryStream outStream = new MemoryStream();
GZipStream gZStream = new GZipStream(outStream, CompressionLevel.Optimal);
gZStream.Write(bytes, 0, bytes.Length);
byte[] compressed = outStream.ToArray();
gZStream.Dispose();
outStream.Dispose();
return compressed;
using (MemoryStream outStream = new MemoryStream())
{
using (GZipStream gZipStream = new GZipStream(outStream, CompressionLevel.Optimal))
{
gZipStream.Write(bytes, 0, bytes.Length);
byte[] compressed = outStream.ToArray();
return compressed;
}
}
}
}
}

View File

@ -41,8 +41,6 @@ namespace RecrownedAthenaeum.DataTypes
public void Draw(SpriteBatch batch, Rectangle destination)
{
Rectangle sourceRectangle;
Rectangle drawnRectangle;