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:
@@ -20,19 +20,20 @@ namespace RecrownedAthenaeum.Render
|
||||
BasicEffect basicEffect;
|
||||
PrimitiveType primitiveType;
|
||||
int verticesPerPrimitive;
|
||||
GraphicsDevice graphicsDevice;
|
||||
GraphicsDevice graphicsDevice = Setup.graphicsDeviceManager.GraphicsDevice;
|
||||
bool began;
|
||||
bool disposed;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a batch used to draw primitives.
|
||||
/// </summary>
|
||||
/// <param name="graphicsDevice">The current graphics device being used.</param>
|
||||
/// <param name="camera">The current camera being used.</param>
|
||||
/// <param name="graphicsDevice">The graphics device used to draw the primitives. Will be using <see cref="Setup"/>'s graphics device from graphics device manager if null. Default is null.</param>
|
||||
/// <param name="verticesPerBatch">The amount of vertices every batch can hold before flushing. Default is 450. Should be changed to be the most optimal number if possible to prevent unnecessary resizing. Especially if using strip primitive types.</param>
|
||||
public PrimitiveBatch(GraphicsDevice graphicsDevice, Camera2D camera, int verticesPerBatch = 500)
|
||||
public PrimitiveBatch(Camera2D camera, GraphicsDevice graphicsDevice = null, int verticesPerBatch = 500)
|
||||
{
|
||||
this.graphicsDevice = graphicsDevice ?? throw new ArgumentNullException("Graphics device can't be null.");
|
||||
if (graphicsDevice != null) this.graphicsDevice = graphicsDevice;
|
||||
if (this.graphicsDevice == null) throw new ArgumentNullException("Graphics device can't be null in setup and argument. One must not be null for use.");
|
||||
basicEffect = new BasicEffect(graphicsDevice);
|
||||
basicEffect.VertexColorEnabled = true;
|
||||
basicEffect.View = camera.Matrix;
|
||||
|
||||
Reference in New Issue
Block a user