removed fractures of old disposal implementation that is no longer needed.

This commit is contained in:
Harrison Deng 2019-01-26 23:23:16 -06:00
parent d1d9b1ad55
commit 96dbb7df6b

View File

@ -13,7 +13,6 @@ namespace RecrownedAthenaeum.Render
/// The <see cref="PrimitiveBatch"/> used. Needs to be disposed. /// The <see cref="PrimitiveBatch"/> used. Needs to be disposed.
/// </summary> /// </summary>
public readonly PrimitiveBatch primitiveBatch; public readonly PrimitiveBatch primitiveBatch;
private bool disposed;
private bool began; private bool began;
private bool filling; private bool filling;
@ -33,7 +32,6 @@ namespace RecrownedAthenaeum.Render
public void Begin(bool filled) public void Begin(bool filled)
{ {
filling = filled; filling = filled;
if (disposed) throw new ObjectDisposedException(GetType().Name);
if (began) throw new InvalidOperationException("Cannot begin twice."); if (began) throw new InvalidOperationException("Cannot begin twice.");
primitiveBatch.Begin(filled ? PrimitiveType.TriangleStrip : PrimitiveType.LineStrip); primitiveBatch.Begin(filled ? PrimitiveType.TriangleStrip : PrimitiveType.LineStrip);
began = true; began = true;
@ -44,7 +42,6 @@ namespace RecrownedAthenaeum.Render
/// </summary> /// </summary>
public void End() public void End()
{ {
if (disposed) throw new ObjectDisposedException(GetType().Name);
if (!began) throw new InvalidOperationException("Cannot end before beginning."); if (!began) throw new InvalidOperationException("Cannot end before beginning.");
primitiveBatch.End(); primitiveBatch.End();
began = false; began = false;
@ -62,7 +59,6 @@ namespace RecrownedAthenaeum.Render
/// <param name="rotation">Rotation of rectangle. Default is 0 radians.</param> /// <param name="rotation">Rotation of rectangle. Default is 0 radians.</param>
public void DrawRectangle(int x, int y, int width, int height, Color color, double rotation = 0) public void DrawRectangle(int x, int y, int width, int height, Color color, double rotation = 0)
{ {
if (disposed) throw new ObjectDisposedException(GetType().Name);
if (!began) throw new InvalidOperationException("Renderer must be started by calling Begin."); if (!began) throw new InvalidOperationException("Renderer must be started by calling Begin.");
Vector2[] corners = new Vector2[4]; Vector2[] corners = new Vector2[4];