minor change for the dispose exception for disposables.
This commit is contained in:
@@ -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];
|
||||
|
||||
|
Reference in New Issue
Block a user