minor change for the dispose exception for disposables.

This commit is contained in:
2019-01-12 23:40:52 -06:00
parent bfdc36a3e2
commit edd2e94a6a
2 changed files with 8 additions and 8 deletions

View File

@@ -29,7 +29,7 @@ namespace RecrownedAthenaeum.Render
public void Begin(bool filled)
{
filling = filled;
if (disposed) throw new ObjectDisposedException(typeof(PrimitiveBatch).Name);
if (disposed) throw new ObjectDisposedException(GetType().Name);
if (began) throw new InvalidOperationException("Cannot begin twice.");
primitiveBatch.Begin(filled ? PrimitiveType.TriangleStrip : PrimitiveType.LineStrip);
began = true;
@@ -37,7 +37,7 @@ namespace RecrownedAthenaeum.Render
public void End()
{
if (disposed) throw new ObjectDisposedException(typeof(PrimitiveBatch).Name);
if (disposed) throw new ObjectDisposedException(GetType().Name);
if (!began) throw new InvalidOperationException("Cannot end before beginning.");
primitiveBatch.End();
began = false;
@@ -55,7 +55,7 @@ namespace RecrownedAthenaeum.Render
/// <param name="rotation">Rotation of rectangle. Default is 0 radians.</param>
public void Rectangle(int x, int y, int width, int height, Color color, double rotation = 0)
{
if (disposed) throw new ObjectDisposedException(typeof(PrimitiveBatch).Name);
if (disposed) throw new ObjectDisposedException(GetType().Name);
if (!began) throw new InvalidOperationException("Renderer must be started by calling Begin.");
Vector2[] corners = new Vector2[4];