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:
@@ -24,15 +24,17 @@ namespace RecrownedAthenaeum.Camera
|
||||
/// </summary>
|
||||
public Matrix Matrix { get; private set; }
|
||||
|
||||
private GraphicsDevice graphicsDevice;
|
||||
private GraphicsDevice graphicsDevice = Setup.graphicsDeviceManager.GraphicsDevice;
|
||||
|
||||
/// <summary>
|
||||
/// Constructs 2D camera.
|
||||
/// </summary>
|
||||
/// <param name="graphicsDevice">The graphics device to use.</param>
|
||||
public Camera2D(GraphicsDevice graphicsDevice)
|
||||
/// <param name="graphicsDevice">The graphics device to use. Will use graphics device from <see cref="Setup"/>'s graphics device manager if this is null which it is by default.</param>
|
||||
public Camera2D(GraphicsDevice graphicsDevice = null)
|
||||
{
|
||||
this.graphicsDevice = graphicsDevice;
|
||||
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.");
|
||||
|
||||
Zoom = 1f;
|
||||
Position.X = this.graphicsDevice.Viewport.Width * 0.5f;
|
||||
Position.Y = this.graphicsDevice.Viewport.Height * 0.5f;
|
||||
|
Reference in New Issue
Block a user