diff --git a/Blarg.GameFramework.SDL2/Input/SDLKeyMapper.cs b/Blarg.GameFramework.SDL2/Input/SDLKeyMapper.cs index f661cdf..4edcc10 100644 --- a/Blarg.GameFramework.SDL2/Input/SDLKeyMapper.cs +++ b/Blarg.GameFramework.SDL2/Input/SDLKeyMapper.cs @@ -6,7 +6,7 @@ namespace Blarg.GameFramework.Input { public static class SDLKeyMapper { - static IDictionary _mapping = new Dictionary(); + static Dictionary _mapping = new Dictionary(); static SDLKeyMapper() { diff --git a/Blarg.GameFramework.SDL2/Input/SDLKeyboard.cs b/Blarg.GameFramework.SDL2/Input/SDLKeyboard.cs index 04fdecd..706ca05 100644 --- a/Blarg.GameFramework.SDL2/Input/SDLKeyboard.cs +++ b/Blarg.GameFramework.SDL2/Input/SDLKeyboard.cs @@ -8,7 +8,7 @@ namespace Blarg.GameFramework.Input { bool[] _keys; bool[] _lockedKeys; - IList _listeners; + List _listeners; public SDLKeyboard() { diff --git a/Blarg.GameFramework.SDL2/Input/SDLMouse.cs b/Blarg.GameFramework.SDL2/Input/SDLMouse.cs index 4f0c227..cf196e3 100644 --- a/Blarg.GameFramework.SDL2/Input/SDLMouse.cs +++ b/Blarg.GameFramework.SDL2/Input/SDLMouse.cs @@ -8,7 +8,7 @@ namespace Blarg.GameFramework.Input { bool[] _buttons; bool[] _lockedButtons; - IList _listeners; + List _listeners; public SDLMouse() { diff --git a/Blarg.GameFramework/Graphics/BillboardSpriteBatch.cs b/Blarg.GameFramework/Graphics/BillboardSpriteBatch.cs index d58575d..2a057b3 100644 --- a/Blarg.GameFramework/Graphics/BillboardSpriteBatch.cs +++ b/Blarg.GameFramework/Graphics/BillboardSpriteBatch.cs @@ -39,7 +39,7 @@ namespace Blarg.GameFramework.Graphics Vector3 _yAxis = Vector3.YAxis; Vector3 _up = Vector3.Up; - public GraphicsDevice GraphicsDevice { get; private set; } + public readonly GraphicsDevice GraphicsDevice; public BillboardSpriteBatch(GraphicsDevice graphicsDevice) { diff --git a/Blarg.GameFramework/Graphics/BlendState.cs b/Blarg.GameFramework/Graphics/BlendState.cs index 92a7089..1e7222c 100644 --- a/Blarg.GameFramework/Graphics/BlendState.cs +++ b/Blarg.GameFramework/Graphics/BlendState.cs @@ -26,9 +26,9 @@ namespace Blarg.GameFramework.Graphics public static readonly BlendState Opaque; public static readonly BlendState AlphaBlend; - public bool Blending { get; set; } - public BlendFactor SourceBlendFactor { get; set; } - public BlendFactor DestinationBlendFactor { get; set; } + public bool Blending; + public BlendFactor SourceBlendFactor; + public BlendFactor DestinationBlendFactor; static BlendState() { diff --git a/Blarg.GameFramework/Graphics/Camera.cs b/Blarg.GameFramework/Graphics/Camera.cs index e05d952..c3ee7c5 100644 --- a/Blarg.GameFramework/Graphics/Camera.cs +++ b/Blarg.GameFramework/Graphics/Camera.cs @@ -4,18 +4,18 @@ namespace Blarg.GameFramework.Graphics { public class Camera { - private ViewContext _viewContext; - private float _nearHeight; - private float _nearWidth; + ViewContext _viewContext; + float _nearHeight; + float _nearWidth; - public Frustum Frustum { get; private set; } - public Matrix4x4 LookAt { get; private set; } - public Matrix4x4 Projection { get; private set; } - public Vector3 Forward { get; private set; } - public Vector3 Up { get; private set; } + public readonly Frustum Frustum; + public Matrix4x4 LookAt; + public Matrix4x4 Projection; + public Vector3 Forward; + public Vector3 Up; - public Vector3 Orientation { get; set; } - public Vector3 Position { get; set; } + public Vector3 Orientation; + public Vector3 Position; public int ViewportWidth { get; private set; } public int ViewportHeight { get; private set; } diff --git a/Blarg.GameFramework/Graphics/Framebuffer.cs b/Blarg.GameFramework/Graphics/Framebuffer.cs index de5432e..c6cae23 100644 --- a/Blarg.GameFramework/Graphics/Framebuffer.cs +++ b/Blarg.GameFramework/Graphics/Framebuffer.cs @@ -22,11 +22,11 @@ namespace Blarg.GameFramework.Graphics public class Framebuffer : GraphicsContextResource { - private int _fixedWidth; - private int _fixedHeight; - private IDictionary _attachedTextures; - private IDictionary _attachedRenderbuffers; - private ViewContext _attachedViewContext; + int _fixedWidth; + int _fixedHeight; + Dictionary _attachedTextures; + Dictionary _attachedRenderbuffers; + ViewContext _attachedViewContext; public int ID { get; private set; } diff --git a/Blarg.GameFramework/Graphics/Frustum.cs b/Blarg.GameFramework/Graphics/Frustum.cs index f980f63..7a623de 100644 --- a/Blarg.GameFramework/Graphics/Frustum.cs +++ b/Blarg.GameFramework/Graphics/Frustum.cs @@ -14,8 +14,8 @@ namespace Blarg.GameFramework.Graphics public class Frustum { - private ViewContext _viewContext; - private Plane[] _planes = new Plane[6]; + ViewContext _viewContext; + Plane[] _planes = new Plane[6]; public Frustum(ViewContext viewContext) { diff --git a/Blarg.GameFramework/Graphics/GeometryDebugRenderer.cs b/Blarg.GameFramework/Graphics/GeometryDebugRenderer.cs index c34ea47..2b1b81d 100644 --- a/Blarg.GameFramework/Graphics/GeometryDebugRenderer.cs +++ b/Blarg.GameFramework/Graphics/GeometryDebugRenderer.cs @@ -4,15 +4,15 @@ namespace Blarg.GameFramework.Graphics { public class GeometryDebugRenderer { - private const int DefaultVerticesAmount = 4096; + const int DefaultVerticesAmount = 4096; - private VertexBuffer _vertices; - private RenderState _renderState; - private Color _color1; - private Color _color2; - private bool _hasBegunRendering; + VertexBuffer _vertices; + RenderState _renderState; + Color _color1; + Color _color2; + bool _hasBegunRendering; - public GraphicsDevice GraphicsDevice { get; private set; } + public readonly GraphicsDevice GraphicsDevice; public GeometryDebugRenderer(GraphicsDevice graphicsDevice) { diff --git a/Blarg.GameFramework/Graphics/GraphicsContextResource.cs b/Blarg.GameFramework/Graphics/GraphicsContextResource.cs index d5dbe33..c8d1ec5 100644 --- a/Blarg.GameFramework/Graphics/GraphicsContextResource.cs +++ b/Blarg.GameFramework/Graphics/GraphicsContextResource.cs @@ -6,7 +6,7 @@ namespace Blarg.GameFramework.Graphics { public const string LOG_TAG = "GRAPHICS_RESOURCE"; - public GraphicsDevice GraphicsDevice { get; private set; } + public readonly GraphicsDevice GraphicsDevice; public bool IsReleased { get; private set; } public GraphicsContextResource() diff --git a/Blarg.GameFramework/Graphics/GraphicsDevice.cs b/Blarg.GameFramework/Graphics/GraphicsDevice.cs index 5a5663c..170b52a 100644 --- a/Blarg.GameFramework/Graphics/GraphicsDevice.cs +++ b/Blarg.GameFramework/Graphics/GraphicsDevice.cs @@ -12,25 +12,25 @@ namespace Blarg.GameFramework.Graphics { const string LOG_TAG = "GRAPHICS"; - private const int MaxTextureUnits = 8; - private const int MaxGpuAttributeSlots = 8; - private const int SolidColorTextureWidth = 8; - private const int SolidColorTextureHeight = 8; + const int MaxTextureUnits = 8; + const int MaxGpuAttributeSlots = 8; + const int SolidColorTextureWidth = 8; + const int SolidColorTextureHeight = 8; - private IList _managedResources; - private IDictionary _solidColorTextures; - private VertexBuffer _boundVertexBuffer; - private IndexBuffer _boundIndexBuffer; - private Texture[] _boundTextures; - private Renderbuffer _boundRenderbuffer; - private Framebuffer _boundFramebuffer; - private Shader _boundShader; - private bool _isShaderVertexAttribsSet; - private Stack _enabledVertexAttribIndices; - private ViewContext _defaultViewContext; - private ViewContext _activeViewContext; - private TextureParameters _currentTextureParams; - private TextureParameters _solidColorTextureParams; + List _managedResources; + Dictionary _solidColorTextures; + VertexBuffer _boundVertexBuffer; + IndexBuffer _boundIndexBuffer; + Texture[] _boundTextures; + Renderbuffer _boundRenderbuffer; + Framebuffer _boundFramebuffer; + Shader _boundShader; + bool _isShaderVertexAttribsSet; + Stack _enabledVertexAttribIndices; + ViewContext _defaultViewContext; + ViewContext _activeViewContext; + TextureParameters _currentTextureParams; + TextureParameters _solidColorTextureParams; public ScreenOrientation ScreenOrientation { get; private set; } diff --git a/Blarg.GameFramework/Graphics/Helpers/FlatWireframeGrid.cs b/Blarg.GameFramework/Graphics/Helpers/FlatWireframeGrid.cs index 132807e..51d80f8 100644 --- a/Blarg.GameFramework/Graphics/Helpers/FlatWireframeGrid.cs +++ b/Blarg.GameFramework/Graphics/Helpers/FlatWireframeGrid.cs @@ -10,7 +10,7 @@ namespace Blarg.GameFramework.Graphics.Helpers public int Width { get; private set; } public int Height { get; private set; } - public GraphicsDevice GraphicsDevice { get; private set; } + public readonly GraphicsDevice GraphicsDevice; public FlatWireframeGrid(GraphicsDevice graphicsDevice, int width, int height) { diff --git a/Blarg.GameFramework/Graphics/Image.cs b/Blarg.GameFramework/Graphics/Image.cs index 7bf814c..7833bbe 100644 --- a/Blarg.GameFramework/Graphics/Image.cs +++ b/Blarg.GameFramework/Graphics/Image.cs @@ -5,7 +5,7 @@ namespace Blarg.GameFramework.Graphics { public partial class Image { - private byte[] _pixels; + byte[] _pixels; public int Pitch { get; private set; } public int Width { get; private set; } diff --git a/Blarg.GameFramework/Graphics/IndexBuffer.cs b/Blarg.GameFramework/Graphics/IndexBuffer.cs index 4fa8e20..0b14e6a 100644 --- a/Blarg.GameFramework/Graphics/IndexBuffer.cs +++ b/Blarg.GameFramework/Graphics/IndexBuffer.cs @@ -4,7 +4,7 @@ namespace Blarg.GameFramework.Graphics { public class IndexBuffer : BufferObject { - private ushort[] _buffer; + ushort[] _buffer; public int CurrentPosition { get; private set; } diff --git a/Blarg.GameFramework/Graphics/RenderState.cs b/Blarg.GameFramework/Graphics/RenderState.cs index 815e395..cd714a8 100644 --- a/Blarg.GameFramework/Graphics/RenderState.cs +++ b/Blarg.GameFramework/Graphics/RenderState.cs @@ -39,11 +39,11 @@ namespace Blarg.GameFramework.Graphics NoCulling.FaceCulling = false; } - public bool DepthTesting { get; set; } - public DepthFunc DepthFunc { get; set; } - public bool FaceCulling { get; set; } - public CullMode FaceCullingMode { get; set; } - public float LineWidth { get; set; } + public bool DepthTesting; + public DepthFunc DepthFunc; + public bool FaceCulling; + public CullMode FaceCullingMode; + public float LineWidth; public RenderState() { diff --git a/Blarg.GameFramework/Graphics/Shader.cs b/Blarg.GameFramework/Graphics/Shader.cs index 8adaf8e..e41376b 100644 --- a/Blarg.GameFramework/Graphics/Shader.cs +++ b/Blarg.GameFramework/Graphics/Shader.cs @@ -69,16 +69,16 @@ namespace Blarg.GameFramework.Graphics // Might be worthwhile to populate them via the uniform/attribute // location value (same ordering) assuming the location value isn't // some weird large number sometimes... that if it's zero-based in all cases - private ShaderUniform[] _uniforms; - private ShaderAttribute[] _attributes; - private ShaderAttributeMapInfo[] _attributeMapping; - private ShaderCachedUniform[] _cachedUniforms; + ShaderUniform[] _uniforms; + ShaderAttribute[] _attributes; + ShaderAttributeMapInfo[] _attributeMapping; + ShaderCachedUniform[] _cachedUniforms; - private string _inlineVertexShaderSource; - private string _inlineFragmentShaderSource; + string _inlineVertexShaderSource; + string _inlineFragmentShaderSource; - private string _cachedVertexShaderSource; - private string _cachedFragmentShaderSource; + string _cachedVertexShaderSource; + string _cachedFragmentShaderSource; public int ProgramID { get; private set; } public int VertexShaderID { get; private set; } diff --git a/Blarg.GameFramework/Graphics/SpriteBatch.cs b/Blarg.GameFramework/Graphics/SpriteBatch.cs index ce9f2d5..8779320 100644 --- a/Blarg.GameFramework/Graphics/SpriteBatch.cs +++ b/Blarg.GameFramework/Graphics/SpriteBatch.cs @@ -28,7 +28,7 @@ namespace Blarg.GameFramework.Graphics bool _hasBegunRendering; Color _defaultSpriteColor = Color.White; - public GraphicsDevice GraphicsDevice { get; private set; } + public readonly GraphicsDevice GraphicsDevice; public SpriteBatch(GraphicsDevice graphicsDevice) { diff --git a/Blarg.GameFramework/Graphics/SpriteFont.cs b/Blarg.GameFramework/Graphics/SpriteFont.cs index f7ee89a..2afb5ca 100644 --- a/Blarg.GameFramework/Graphics/SpriteFont.cs +++ b/Blarg.GameFramework/Graphics/SpriteFont.cs @@ -5,12 +5,12 @@ namespace Blarg.GameFramework.Graphics { public class SpriteFont : GraphicsContextResource { - private static StringBuilder _buffer = new StringBuilder(8192); + static StringBuilder _buffer = new StringBuilder(8192); public const int LowGlyphAscii = 32; public const int HighGlyphAscii = 127; - private TextureAtlas _glyphs; + readonly TextureAtlas _glyphs; public int Size { get; private set; } public int LetterHeight { get; private set; } diff --git a/Blarg.GameFramework/Graphics/SpriteShader.cs b/Blarg.GameFramework/Graphics/SpriteShader.cs index 0db1554..5d56660 100644 --- a/Blarg.GameFramework/Graphics/SpriteShader.cs +++ b/Blarg.GameFramework/Graphics/SpriteShader.cs @@ -5,7 +5,7 @@ namespace Blarg.GameFramework.Graphics { public abstract class SpriteShader : StandardShader { - protected string TextureHasAlphaOnlyUniformName { get; set; } + protected string TextureHasAlphaOnlyUniformName; protected SpriteShader(GraphicsDevice graphicsDevice) : base(graphicsDevice) diff --git a/Blarg.GameFramework/Graphics/StandardShader.cs b/Blarg.GameFramework/Graphics/StandardShader.cs index 47f667b..4d14406 100644 --- a/Blarg.GameFramework/Graphics/StandardShader.cs +++ b/Blarg.GameFramework/Graphics/StandardShader.cs @@ -5,8 +5,8 @@ namespace Blarg.GameFramework.Graphics { public abstract class StandardShader : Shader { - protected string ModelViewMatrixUniformName { get; set; } - protected string ProjectionMatrixUniformName { get; set; } + protected string ModelViewMatrixUniformName; + protected string ProjectionMatrixUniformName; protected StandardShader(GraphicsDevice graphicsDevice) : base(graphicsDevice) diff --git a/Blarg.GameFramework/Graphics/Texture.cs b/Blarg.GameFramework/Graphics/Texture.cs index 7de7e85..2a50fa1 100644 --- a/Blarg.GameFramework/Graphics/Texture.cs +++ b/Blarg.GameFramework/Graphics/Texture.cs @@ -13,7 +13,7 @@ namespace Blarg.GameFramework.Graphics public class Texture : GraphicsContextResource { - private TextureParameters _textureParams; + TextureParameters _textureParams; public int ID { get; private set; } public int Width { get; private set; } diff --git a/Blarg.GameFramework/Graphics/TextureAtlas.cs b/Blarg.GameFramework/Graphics/TextureAtlas.cs index 00a5a01..0091b96 100644 --- a/Blarg.GameFramework/Graphics/TextureAtlas.cs +++ b/Blarg.GameFramework/Graphics/TextureAtlas.cs @@ -7,7 +7,7 @@ namespace Blarg.GameFramework.Graphics { public const float TexCoordEdgeBleedOffset = 0.02f; - private Texture _texture; + Texture _texture; public int Width { get; protected set; } public int Height { get; protected set; } diff --git a/Blarg.GameFramework/Graphics/TextureParameters.cs b/Blarg.GameFramework/Graphics/TextureParameters.cs index f34a684..60ab8da 100644 --- a/Blarg.GameFramework/Graphics/TextureParameters.cs +++ b/Blarg.GameFramework/Graphics/TextureParameters.cs @@ -30,10 +30,10 @@ namespace Blarg.GameFramework.Graphics public static readonly TextureParameters Default; public static readonly TextureParameters Pixelated; - public MinificationFilter MinFilter { get; set; } - public MagnificationFilter MagFilter { get; set; } - public WrapMode WrapS { get; set; } - public WrapMode WrapT { get; set; } + public MinificationFilter MinFilter; + public MagnificationFilter MagFilter; + public WrapMode WrapS; + public WrapMode WrapT; static TextureParameters() { diff --git a/Blarg.GameFramework/Graphics/VertexBuffer.cs b/Blarg.GameFramework/Graphics/VertexBuffer.cs index ebbc0b3..63b5504 100644 --- a/Blarg.GameFramework/Graphics/VertexBuffer.cs +++ b/Blarg.GameFramework/Graphics/VertexBuffer.cs @@ -11,9 +11,9 @@ namespace Blarg.GameFramework.Graphics public int size; } - private float[] _buffer; - private int _standardVertexAttribs; - private AttributeInfo[] _attributes; + float[] _buffer; + int _standardVertexAttribs; + AttributeInfo[] _attributes; public int CurrentPosition { get; private set; } public int ElementWidth { get; private set; } diff --git a/Blarg.GameFramework/Graphics/VertexLerpShader.cs b/Blarg.GameFramework/Graphics/VertexLerpShader.cs index 2748082..3d8bcf7 100644 --- a/Blarg.GameFramework/Graphics/VertexLerpShader.cs +++ b/Blarg.GameFramework/Graphics/VertexLerpShader.cs @@ -5,7 +5,7 @@ namespace Blarg.GameFramework.Graphics { public abstract class VertexLerpShader : StandardShader { - protected string LerpUniformName { get; set; } + protected string LerpUniformName; protected VertexLerpShader(GraphicsDevice graphicsDevice) : base(graphicsDevice) diff --git a/Blarg.GameFramework/Graphics/VertexSkinningShader.cs b/Blarg.GameFramework/Graphics/VertexSkinningShader.cs index 6b72ea8..a64425f 100644 --- a/Blarg.GameFramework/Graphics/VertexSkinningShader.cs +++ b/Blarg.GameFramework/Graphics/VertexSkinningShader.cs @@ -5,8 +5,8 @@ namespace Blarg.GameFramework.Graphics { public abstract class VertexSkinningShader : StandardShader { - protected string JointPositionsUniformName { get; set; } - protected string JointRotationsUniformName { get; set; } + protected string JointPositionsUniformName; + protected string JointRotationsUniformName; protected VertexSkinningShader(GraphicsDevice graphicsDevice) : base(graphicsDevice) diff --git a/Blarg.GameFramework/Graphics/ViewContext.cs b/Blarg.GameFramework/Graphics/ViewContext.cs index b655b49..2d1889a 100644 --- a/Blarg.GameFramework/Graphics/ViewContext.cs +++ b/Blarg.GameFramework/Graphics/ViewContext.cs @@ -5,15 +5,15 @@ namespace Blarg.GameFramework.Graphics { public class ViewContext { - private GraphicsDevice _graphicsDevice; - private Rect _viewport; - private bool _viewportIsFixedSize; - private ScreenOrientation _screenOrientation; - private Camera _camera; - private bool _isUsingDefaultCamera; + readonly GraphicsDevice _graphicsDevice; + Rect _viewport; + bool _viewportIsFixedSize; + ScreenOrientation _screenOrientation; + Camera _camera; + bool _isUsingDefaultCamera; - private Matrix4x4 _modelViewMatrix; - private Matrix4x4 _projectionMatrix; + Matrix4x4 _modelViewMatrix; + Matrix4x4 _projectionMatrix; public int ViewportTop { get { return _viewport.Top; } } public int ViewportLeft { get { return _viewport.Left; } } diff --git a/Blarg.GameFramework/Math/Matrix3x3.cs b/Blarg.GameFramework/Math/Matrix3x3.cs index 6c6589a..33e10cb 100644 --- a/Blarg.GameFramework/Math/Matrix3x3.cs +++ b/Blarg.GameFramework/Math/Matrix3x3.cs @@ -16,15 +16,15 @@ namespace Blarg.GameFramework public float M23; public float M33; - private const int _11 = 0; - private const int _12 = 3; - private const int _13 = 6; - private const int _21 = 1; - private const int _22 = 4; - private const int _23 = 7; - private const int _31 = 2; - private const int _32 = 5; - private const int _33 = 8; + const int _11 = 0; + const int _12 = 3; + const int _13 = 6; + const int _21 = 1; + const int _22 = 4; + const int _23 = 7; + const int _31 = 2; + const int _32 = 5; + const int _33 = 8; public float Determinant { diff --git a/Blarg.GameFramework/Math/Matrix4x4.cs b/Blarg.GameFramework/Math/Matrix4x4.cs index 4a0e738..a398e14 100644 --- a/Blarg.GameFramework/Math/Matrix4x4.cs +++ b/Blarg.GameFramework/Math/Matrix4x4.cs @@ -23,22 +23,22 @@ namespace Blarg.GameFramework public float M34; public float M44; - private const int _11 = 0; - private const int _12 = 4; - private const int _13 = 8; - private const int _14 = 12; - private const int _21 = 1; - private const int _22 = 5; - private const int _23 = 9; - private const int _24 = 13; - private const int _31 = 2; - private const int _32 = 6; - private const int _33 = 10; - private const int _34 = 14; - private const int _41 = 3; - private const int _42 = 7; - private const int _43 = 11; - private const int _44 = 15; + const int _11 = 0; + const int _12 = 4; + const int _13 = 8; + const int _14 = 12; + const int _21 = 1; + const int _22 = 5; + const int _23 = 9; + const int _24 = 13; + const int _31 = 2; + const int _32 = 6; + const int _33 = 10; + const int _34 = 14; + const int _41 = 3; + const int _42 = 7; + const int _43 = 11; + const int _44 = 15; public float Determinant {