minor and mostly unnecessary "cleanups"

This commit is contained in:
Gered 2013-08-22 19:15:02 -04:00
parent 42d98d4261
commit ec724c78e5
29 changed files with 117 additions and 117 deletions

View file

@ -6,7 +6,7 @@ namespace Blarg.GameFramework.Input
{ {
public static class SDLKeyMapper public static class SDLKeyMapper
{ {
static IDictionary<SDL.SDL_Scancode, Key> _mapping = new Dictionary<SDL.SDL_Scancode, Key>(); static Dictionary<SDL.SDL_Scancode, Key> _mapping = new Dictionary<SDL.SDL_Scancode, Key>();
static SDLKeyMapper() static SDLKeyMapper()
{ {

View file

@ -8,7 +8,7 @@ namespace Blarg.GameFramework.Input
{ {
bool[] _keys; bool[] _keys;
bool[] _lockedKeys; bool[] _lockedKeys;
IList<IKeyboardListener> _listeners; List<IKeyboardListener> _listeners;
public SDLKeyboard() public SDLKeyboard()
{ {

View file

@ -8,7 +8,7 @@ namespace Blarg.GameFramework.Input
{ {
bool[] _buttons; bool[] _buttons;
bool[] _lockedButtons; bool[] _lockedButtons;
IList<IMouseListener> _listeners; List<IMouseListener> _listeners;
public SDLMouse() public SDLMouse()
{ {

View file

@ -39,7 +39,7 @@ namespace Blarg.GameFramework.Graphics
Vector3 _yAxis = Vector3.YAxis; Vector3 _yAxis = Vector3.YAxis;
Vector3 _up = Vector3.Up; Vector3 _up = Vector3.Up;
public GraphicsDevice GraphicsDevice { get; private set; } public readonly GraphicsDevice GraphicsDevice;
public BillboardSpriteBatch(GraphicsDevice graphicsDevice) public BillboardSpriteBatch(GraphicsDevice graphicsDevice)
{ {

View file

@ -26,9 +26,9 @@ namespace Blarg.GameFramework.Graphics
public static readonly BlendState Opaque; public static readonly BlendState Opaque;
public static readonly BlendState AlphaBlend; public static readonly BlendState AlphaBlend;
public bool Blending { get; set; } public bool Blending;
public BlendFactor SourceBlendFactor { get; set; } public BlendFactor SourceBlendFactor;
public BlendFactor DestinationBlendFactor { get; set; } public BlendFactor DestinationBlendFactor;
static BlendState() static BlendState()
{ {

View file

@ -4,18 +4,18 @@ namespace Blarg.GameFramework.Graphics
{ {
public class Camera public class Camera
{ {
private ViewContext _viewContext; ViewContext _viewContext;
private float _nearHeight; float _nearHeight;
private float _nearWidth; float _nearWidth;
public Frustum Frustum { get; private set; } public readonly Frustum Frustum;
public Matrix4x4 LookAt { get; private set; } public Matrix4x4 LookAt;
public Matrix4x4 Projection { get; private set; } public Matrix4x4 Projection;
public Vector3 Forward { get; private set; } public Vector3 Forward;
public Vector3 Up { get; private set; } public Vector3 Up;
public Vector3 Orientation { get; set; } public Vector3 Orientation;
public Vector3 Position { get; set; } public Vector3 Position;
public int ViewportWidth { get; private set; } public int ViewportWidth { get; private set; }
public int ViewportHeight { get; private set; } public int ViewportHeight { get; private set; }

View file

@ -22,11 +22,11 @@ namespace Blarg.GameFramework.Graphics
public class Framebuffer : GraphicsContextResource public class Framebuffer : GraphicsContextResource
{ {
private int _fixedWidth; int _fixedWidth;
private int _fixedHeight; int _fixedHeight;
private IDictionary<FramebufferTextureFormat, Texture> _attachedTextures; Dictionary<FramebufferTextureFormat, Texture> _attachedTextures;
private IDictionary<FramebufferRenderbufferFormat, Renderbuffer> _attachedRenderbuffers; Dictionary<FramebufferRenderbufferFormat, Renderbuffer> _attachedRenderbuffers;
private ViewContext _attachedViewContext; ViewContext _attachedViewContext;
public int ID { get; private set; } public int ID { get; private set; }

View file

@ -14,8 +14,8 @@ namespace Blarg.GameFramework.Graphics
public class Frustum public class Frustum
{ {
private ViewContext _viewContext; ViewContext _viewContext;
private Plane[] _planes = new Plane[6]; Plane[] _planes = new Plane[6];
public Frustum(ViewContext viewContext) public Frustum(ViewContext viewContext)
{ {

View file

@ -4,15 +4,15 @@ namespace Blarg.GameFramework.Graphics
{ {
public class GeometryDebugRenderer public class GeometryDebugRenderer
{ {
private const int DefaultVerticesAmount = 4096; const int DefaultVerticesAmount = 4096;
private VertexBuffer _vertices; VertexBuffer _vertices;
private RenderState _renderState; RenderState _renderState;
private Color _color1; Color _color1;
private Color _color2; Color _color2;
private bool _hasBegunRendering; bool _hasBegunRendering;
public GraphicsDevice GraphicsDevice { get; private set; } public readonly GraphicsDevice GraphicsDevice;
public GeometryDebugRenderer(GraphicsDevice graphicsDevice) public GeometryDebugRenderer(GraphicsDevice graphicsDevice)
{ {

View file

@ -6,7 +6,7 @@ namespace Blarg.GameFramework.Graphics
{ {
public const string LOG_TAG = "GRAPHICS_RESOURCE"; public const string LOG_TAG = "GRAPHICS_RESOURCE";
public GraphicsDevice GraphicsDevice { get; private set; } public readonly GraphicsDevice GraphicsDevice;
public bool IsReleased { get; private set; } public bool IsReleased { get; private set; }
public GraphicsContextResource() public GraphicsContextResource()

View file

@ -12,25 +12,25 @@ namespace Blarg.GameFramework.Graphics
{ {
const string LOG_TAG = "GRAPHICS"; const string LOG_TAG = "GRAPHICS";
private const int MaxTextureUnits = 8; const int MaxTextureUnits = 8;
private const int MaxGpuAttributeSlots = 8; const int MaxGpuAttributeSlots = 8;
private const int SolidColorTextureWidth = 8; const int SolidColorTextureWidth = 8;
private const int SolidColorTextureHeight = 8; const int SolidColorTextureHeight = 8;
private IList<GraphicsContextResource> _managedResources; List<GraphicsContextResource> _managedResources;
private IDictionary<int, Texture> _solidColorTextures; Dictionary<int, Texture> _solidColorTextures;
private VertexBuffer _boundVertexBuffer; VertexBuffer _boundVertexBuffer;
private IndexBuffer _boundIndexBuffer; IndexBuffer _boundIndexBuffer;
private Texture[] _boundTextures; Texture[] _boundTextures;
private Renderbuffer _boundRenderbuffer; Renderbuffer _boundRenderbuffer;
private Framebuffer _boundFramebuffer; Framebuffer _boundFramebuffer;
private Shader _boundShader; Shader _boundShader;
private bool _isShaderVertexAttribsSet; bool _isShaderVertexAttribsSet;
private Stack<int> _enabledVertexAttribIndices; Stack<int> _enabledVertexAttribIndices;
private ViewContext _defaultViewContext; ViewContext _defaultViewContext;
private ViewContext _activeViewContext; ViewContext _activeViewContext;
private TextureParameters _currentTextureParams; TextureParameters _currentTextureParams;
private TextureParameters _solidColorTextureParams; TextureParameters _solidColorTextureParams;
public ScreenOrientation ScreenOrientation { get; private set; } public ScreenOrientation ScreenOrientation { get; private set; }

View file

@ -10,7 +10,7 @@ namespace Blarg.GameFramework.Graphics.Helpers
public int Width { get; private set; } public int Width { get; private set; }
public int Height { 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) public FlatWireframeGrid(GraphicsDevice graphicsDevice, int width, int height)
{ {

View file

@ -5,7 +5,7 @@ namespace Blarg.GameFramework.Graphics
{ {
public partial class Image public partial class Image
{ {
private byte[] _pixels; byte[] _pixels;
public int Pitch { get; private set; } public int Pitch { get; private set; }
public int Width { get; private set; } public int Width { get; private set; }

View file

@ -4,7 +4,7 @@ namespace Blarg.GameFramework.Graphics
{ {
public class IndexBuffer : BufferObject<ushort> public class IndexBuffer : BufferObject<ushort>
{ {
private ushort[] _buffer; ushort[] _buffer;
public int CurrentPosition { get; private set; } public int CurrentPosition { get; private set; }

View file

@ -39,11 +39,11 @@ namespace Blarg.GameFramework.Graphics
NoCulling.FaceCulling = false; NoCulling.FaceCulling = false;
} }
public bool DepthTesting { get; set; } public bool DepthTesting;
public DepthFunc DepthFunc { get; set; } public DepthFunc DepthFunc;
public bool FaceCulling { get; set; } public bool FaceCulling;
public CullMode FaceCullingMode { get; set; } public CullMode FaceCullingMode;
public float LineWidth { get; set; } public float LineWidth;
public RenderState() public RenderState()
{ {

View file

@ -69,16 +69,16 @@ namespace Blarg.GameFramework.Graphics
// Might be worthwhile to populate them via the uniform/attribute // Might be worthwhile to populate them via the uniform/attribute
// location value (same ordering) assuming the location value isn't // location value (same ordering) assuming the location value isn't
// some weird large number sometimes... that if it's zero-based in all cases // some weird large number sometimes... that if it's zero-based in all cases
private ShaderUniform[] _uniforms; ShaderUniform[] _uniforms;
private ShaderAttribute[] _attributes; ShaderAttribute[] _attributes;
private ShaderAttributeMapInfo[] _attributeMapping; ShaderAttributeMapInfo[] _attributeMapping;
private ShaderCachedUniform[] _cachedUniforms; ShaderCachedUniform[] _cachedUniforms;
private string _inlineVertexShaderSource; string _inlineVertexShaderSource;
private string _inlineFragmentShaderSource; string _inlineFragmentShaderSource;
private string _cachedVertexShaderSource; string _cachedVertexShaderSource;
private string _cachedFragmentShaderSource; string _cachedFragmentShaderSource;
public int ProgramID { get; private set; } public int ProgramID { get; private set; }
public int VertexShaderID { get; private set; } public int VertexShaderID { get; private set; }

View file

@ -28,7 +28,7 @@ namespace Blarg.GameFramework.Graphics
bool _hasBegunRendering; bool _hasBegunRendering;
Color _defaultSpriteColor = Color.White; Color _defaultSpriteColor = Color.White;
public GraphicsDevice GraphicsDevice { get; private set; } public readonly GraphicsDevice GraphicsDevice;
public SpriteBatch(GraphicsDevice graphicsDevice) public SpriteBatch(GraphicsDevice graphicsDevice)
{ {

View file

@ -5,12 +5,12 @@ namespace Blarg.GameFramework.Graphics
{ {
public class SpriteFont : GraphicsContextResource 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 LowGlyphAscii = 32;
public const int HighGlyphAscii = 127; public const int HighGlyphAscii = 127;
private TextureAtlas _glyphs; readonly TextureAtlas _glyphs;
public int Size { get; private set; } public int Size { get; private set; }
public int LetterHeight { get; private set; } public int LetterHeight { get; private set; }

View file

@ -5,7 +5,7 @@ namespace Blarg.GameFramework.Graphics
{ {
public abstract class SpriteShader : StandardShader public abstract class SpriteShader : StandardShader
{ {
protected string TextureHasAlphaOnlyUniformName { get; set; } protected string TextureHasAlphaOnlyUniformName;
protected SpriteShader(GraphicsDevice graphicsDevice) protected SpriteShader(GraphicsDevice graphicsDevice)
: base(graphicsDevice) : base(graphicsDevice)

View file

@ -5,8 +5,8 @@ namespace Blarg.GameFramework.Graphics
{ {
public abstract class StandardShader : Shader public abstract class StandardShader : Shader
{ {
protected string ModelViewMatrixUniformName { get; set; } protected string ModelViewMatrixUniformName;
protected string ProjectionMatrixUniformName { get; set; } protected string ProjectionMatrixUniformName;
protected StandardShader(GraphicsDevice graphicsDevice) protected StandardShader(GraphicsDevice graphicsDevice)
: base(graphicsDevice) : base(graphicsDevice)

View file

@ -13,7 +13,7 @@ namespace Blarg.GameFramework.Graphics
public class Texture : GraphicsContextResource public class Texture : GraphicsContextResource
{ {
private TextureParameters _textureParams; TextureParameters _textureParams;
public int ID { get; private set; } public int ID { get; private set; }
public int Width { get; private set; } public int Width { get; private set; }

View file

@ -7,7 +7,7 @@ namespace Blarg.GameFramework.Graphics
{ {
public const float TexCoordEdgeBleedOffset = 0.02f; public const float TexCoordEdgeBleedOffset = 0.02f;
private Texture _texture; Texture _texture;
public int Width { get; protected set; } public int Width { get; protected set; }
public int Height { get; protected set; } public int Height { get; protected set; }

View file

@ -30,10 +30,10 @@ namespace Blarg.GameFramework.Graphics
public static readonly TextureParameters Default; public static readonly TextureParameters Default;
public static readonly TextureParameters Pixelated; public static readonly TextureParameters Pixelated;
public MinificationFilter MinFilter { get; set; } public MinificationFilter MinFilter;
public MagnificationFilter MagFilter { get; set; } public MagnificationFilter MagFilter;
public WrapMode WrapS { get; set; } public WrapMode WrapS;
public WrapMode WrapT { get; set; } public WrapMode WrapT;
static TextureParameters() static TextureParameters()
{ {

View file

@ -11,9 +11,9 @@ namespace Blarg.GameFramework.Graphics
public int size; public int size;
} }
private float[] _buffer; float[] _buffer;
private int _standardVertexAttribs; int _standardVertexAttribs;
private AttributeInfo[] _attributes; AttributeInfo[] _attributes;
public int CurrentPosition { get; private set; } public int CurrentPosition { get; private set; }
public int ElementWidth { get; private set; } public int ElementWidth { get; private set; }

View file

@ -5,7 +5,7 @@ namespace Blarg.GameFramework.Graphics
{ {
public abstract class VertexLerpShader : StandardShader public abstract class VertexLerpShader : StandardShader
{ {
protected string LerpUniformName { get; set; } protected string LerpUniformName;
protected VertexLerpShader(GraphicsDevice graphicsDevice) protected VertexLerpShader(GraphicsDevice graphicsDevice)
: base(graphicsDevice) : base(graphicsDevice)

View file

@ -5,8 +5,8 @@ namespace Blarg.GameFramework.Graphics
{ {
public abstract class VertexSkinningShader : StandardShader public abstract class VertexSkinningShader : StandardShader
{ {
protected string JointPositionsUniformName { get; set; } protected string JointPositionsUniformName;
protected string JointRotationsUniformName { get; set; } protected string JointRotationsUniformName;
protected VertexSkinningShader(GraphicsDevice graphicsDevice) protected VertexSkinningShader(GraphicsDevice graphicsDevice)
: base(graphicsDevice) : base(graphicsDevice)

View file

@ -5,15 +5,15 @@ namespace Blarg.GameFramework.Graphics
{ {
public class ViewContext public class ViewContext
{ {
private GraphicsDevice _graphicsDevice; readonly GraphicsDevice _graphicsDevice;
private Rect _viewport; Rect _viewport;
private bool _viewportIsFixedSize; bool _viewportIsFixedSize;
private ScreenOrientation _screenOrientation; ScreenOrientation _screenOrientation;
private Camera _camera; Camera _camera;
private bool _isUsingDefaultCamera; bool _isUsingDefaultCamera;
private Matrix4x4 _modelViewMatrix; Matrix4x4 _modelViewMatrix;
private Matrix4x4 _projectionMatrix; Matrix4x4 _projectionMatrix;
public int ViewportTop { get { return _viewport.Top; } } public int ViewportTop { get { return _viewport.Top; } }
public int ViewportLeft { get { return _viewport.Left; } } public int ViewportLeft { get { return _viewport.Left; } }

View file

@ -16,15 +16,15 @@ namespace Blarg.GameFramework
public float M23; public float M23;
public float M33; public float M33;
private const int _11 = 0; const int _11 = 0;
private const int _12 = 3; const int _12 = 3;
private const int _13 = 6; const int _13 = 6;
private const int _21 = 1; const int _21 = 1;
private const int _22 = 4; const int _22 = 4;
private const int _23 = 7; const int _23 = 7;
private const int _31 = 2; const int _31 = 2;
private const int _32 = 5; const int _32 = 5;
private const int _33 = 8; const int _33 = 8;
public float Determinant public float Determinant
{ {

View file

@ -23,22 +23,22 @@ namespace Blarg.GameFramework
public float M34; public float M34;
public float M44; public float M44;
private const int _11 = 0; const int _11 = 0;
private const int _12 = 4; const int _12 = 4;
private const int _13 = 8; const int _13 = 8;
private const int _14 = 12; const int _14 = 12;
private const int _21 = 1; const int _21 = 1;
private const int _22 = 5; const int _22 = 5;
private const int _23 = 9; const int _23 = 9;
private const int _24 = 13; const int _24 = 13;
private const int _31 = 2; const int _31 = 2;
private const int _32 = 6; const int _32 = 6;
private const int _33 = 10; const int _33 = 10;
private const int _34 = 14; const int _34 = 14;
private const int _41 = 3; const int _41 = 3;
private const int _42 = 7; const int _42 = 7;
private const int _43 = 11; const int _43 = 11;
private const int _44 = 15; const int _44 = 15;
public float Determinant public float Determinant
{ {