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
{
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()
{

View file

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

View file

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

View file

@ -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)
{

View file

@ -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()
{

View file

@ -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; }

View file

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

View file

@ -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)
{

View file

@ -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)
{

View file

@ -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()

View file

@ -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<GraphicsContextResource> _managedResources;
private IDictionary<int, Texture> _solidColorTextures;
private VertexBuffer _boundVertexBuffer;
private IndexBuffer _boundIndexBuffer;
private Texture[] _boundTextures;
private Renderbuffer _boundRenderbuffer;
private Framebuffer _boundFramebuffer;
private Shader _boundShader;
private bool _isShaderVertexAttribsSet;
private Stack<int> _enabledVertexAttribIndices;
private ViewContext _defaultViewContext;
private ViewContext _activeViewContext;
private TextureParameters _currentTextureParams;
private TextureParameters _solidColorTextureParams;
List<GraphicsContextResource> _managedResources;
Dictionary<int, Texture> _solidColorTextures;
VertexBuffer _boundVertexBuffer;
IndexBuffer _boundIndexBuffer;
Texture[] _boundTextures;
Renderbuffer _boundRenderbuffer;
Framebuffer _boundFramebuffer;
Shader _boundShader;
bool _isShaderVertexAttribsSet;
Stack<int> _enabledVertexAttribIndices;
ViewContext _defaultViewContext;
ViewContext _activeViewContext;
TextureParameters _currentTextureParams;
TextureParameters _solidColorTextureParams;
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 Height { get; private set; }
public GraphicsDevice GraphicsDevice { get; private set; }
public readonly GraphicsDevice GraphicsDevice;
public FlatWireframeGrid(GraphicsDevice graphicsDevice, int width, int height)
{

View file

@ -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; }

View file

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

View file

@ -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()
{

View file

@ -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; }

View file

@ -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)
{

View file

@ -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; }

View file

@ -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)

View file

@ -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)

View file

@ -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; }

View file

@ -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; }

View file

@ -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()
{

View file

@ -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; }

View file

@ -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)

View file

@ -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)

View file

@ -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; } }

View file

@ -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
{

View file

@ -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
{