Added setup system. Changed reader and writer for texture atlas and nine patch to have image and serialized data be in same file. Some refactors occurred as well.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using RecrownedAthenaeum.Camera;
|
||||
using System;
|
||||
|
||||
namespace RecrownedAthenaeum.Render
|
||||
@@ -8,10 +7,10 @@ namespace RecrownedAthenaeum.Render
|
||||
/// <summary>
|
||||
/// Renders rectangles using the <see cref="PrimitiveBatch"/>.
|
||||
/// </summary>
|
||||
public class RectangleRenderer : IDisposable
|
||||
public class RectangleRenderer
|
||||
{
|
||||
/// <summary>
|
||||
/// The <see cref="PrimitiveBatch"/> used.
|
||||
/// The <see cref="PrimitiveBatch"/> used. Needs to be disposed.
|
||||
/// </summary>
|
||||
public readonly PrimitiveBatch primitiveBatch;
|
||||
private bool disposed;
|
||||
@@ -27,16 +26,6 @@ namespace RecrownedAthenaeum.Render
|
||||
this.primitiveBatch = primitiveBatch;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a rectangle renderer.
|
||||
/// </summary>
|
||||
/// <param name="graphicsDevice">The graphics device used to create the <see cref="PrimitiveBatch"/></param>
|
||||
/// <param name="camera">The camera containing the matrix to be used for the transformations.</param>
|
||||
public RectangleRenderer(GraphicsDevice graphicsDevice, Camera2D camera) : this(new PrimitiveBatch(graphicsDevice, camera, 4))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Begins the render batch.
|
||||
/// </summary>
|
||||
@@ -98,40 +87,5 @@ namespace RecrownedAthenaeum.Render
|
||||
primitiveBatch.AddVertex(corners[3], color);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to dispose of this object.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
if (disposed) throw new ObjectDisposedException(typeof(PrimitiveBatch).Name);
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An overridable of disposable.
|
||||
/// </summary>
|
||||
/// <param name="disposing">Only true when called by user code dispose. Destructor calling this results in false.</param>
|
||||
public virtual void Dispose(bool disposing)
|
||||
{
|
||||
disposed = true;
|
||||
if (!disposed && disposing)
|
||||
{
|
||||
disposed = true;
|
||||
if (primitiveBatch != null)
|
||||
{
|
||||
primitiveBatch.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Destructor.
|
||||
/// </summary>
|
||||
~RectangleRenderer ()
|
||||
{
|
||||
Dispose(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user