cleaned up pipeline code for atlas
This commit is contained in:
parent
4136b1ca22
commit
dde2c3dadf
@ -21,6 +21,7 @@ namespace RecrownedAthenaeum.Pipeline.TextureAtlas
|
|||||||
{
|
{
|
||||||
atlas = JsonConvert.DeserializeObject<TextureAtlasData>(stream.ReadToEnd());
|
atlas = JsonConvert.DeserializeObject<TextureAtlasData>(stream.ReadToEnd());
|
||||||
}
|
}
|
||||||
|
context.AddDependency(atlas.textureName);
|
||||||
return atlas;
|
return atlas;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,16 +20,15 @@ namespace RecrownedAthenaeum.Pipeline.TextureAtlas
|
|||||||
string serialized = JsonConvert.SerializeObject(input);
|
string serialized = JsonConvert.SerializeObject(input);
|
||||||
byte[] bytes = Encoding.UTF8.GetBytes(serialized);
|
byte[] bytes = Encoding.UTF8.GetBytes(serialized);
|
||||||
|
|
||||||
MemoryStream outStream = new MemoryStream();
|
using (MemoryStream outStream = new MemoryStream())
|
||||||
GZipStream gZStream = new GZipStream(outStream, CompressionLevel.Optimal);
|
{
|
||||||
|
using (GZipStream gZipStream = new GZipStream(outStream, CompressionLevel.Optimal))
|
||||||
gZStream.Write(bytes, 0, bytes.Length);
|
{
|
||||||
|
gZipStream.Write(bytes, 0, bytes.Length);
|
||||||
byte[] compressed = outStream.ToArray();
|
byte[] compressed = outStream.ToArray();
|
||||||
|
|
||||||
gZStream.Dispose();
|
|
||||||
outStream.Dispose();
|
|
||||||
return compressed;
|
return compressed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -41,8 +41,6 @@ namespace RecrownedAthenaeum.DataTypes
|
|||||||
|
|
||||||
public void Draw(SpriteBatch batch, Rectangle destination)
|
public void Draw(SpriteBatch batch, Rectangle destination)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
Rectangle sourceRectangle;
|
Rectangle sourceRectangle;
|
||||||
Rectangle drawnRectangle;
|
Rectangle drawnRectangle;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user