From ed7afd2fa1f53b4942e40df41be5e0ad9dd2b670 Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Thu, 20 Feb 2020 16:39:12 -0500 Subject: [PATCH] TextureRef: make Get a property rather than a function GitOrigin-RevId: a36369c33b0c23859768c7bd7b1548b7d834cbb3 --- Shared/Player.cs | 2 +- Shared/Scene.cs | 4 ++-- Shared/Textures.cs | 4 ++-- Shared/World.cs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Shared/Player.cs b/Shared/Player.cs index 4e75110..059ca16 100644 --- a/Shared/Player.cs +++ b/Shared/Player.cs @@ -237,7 +237,7 @@ namespace SemiColinGames { Vector2 spriteCenter = new Vector2(spriteWidth / 2, spriteHeight / 2 + spriteCenterYOffset); SpriteEffects effect = Facing == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - spriteBatch.Draw(Textures.Player.Get(), position.ToVector2(), textureSource, Color.White, 0f, + spriteBatch.Draw(Textures.Player.Get, position.ToVector2(), textureSource, Color.White, 0f, spriteCenter, Vector2.One, effect, 0f); } } diff --git a/Shared/Scene.cs b/Shared/Scene.cs index 4ecd1ef..70aa027 100644 --- a/Shared/Scene.cs +++ b/Shared/Scene.cs @@ -60,10 +60,10 @@ namespace SemiColinGames { float xScale = 1f / 16; for (int i = 0; i < Textures.Backgrounds.Length; i++) { - int yOffset = Textures.Backgrounds[i].Get().Height - camera.Height - 24; + int yOffset = Textures.Backgrounds[i].Get.Height - camera.Height - 24; Rectangle bgSource = new Rectangle( (int) (camera.Left * xScale), yOffset, camera.Width, camera.Height); - spriteBatch.Draw(Textures.Backgrounds[i].Get(), bgTarget, bgSource, Color.White); + spriteBatch.Draw(Textures.Backgrounds[i].Get, bgTarget, bgSource, Color.White); xScale *= 2; } spriteBatch.End(); diff --git a/Shared/Textures.cs b/Shared/Textures.cs index ed4b76e..a444c99 100644 --- a/Shared/Textures.cs +++ b/Shared/Textures.cs @@ -22,8 +22,8 @@ namespace SemiColinGames { this.contentPath = contentPath; } - public Texture2D Get() { - return texture; + public Texture2D Get { + get { return texture; } } private void Load(ContentManager content) { diff --git a/Shared/World.cs b/Shared/World.cs index 3e4b9a9..c5bc187 100644 --- a/Shared/World.cs +++ b/Shared/World.cs @@ -75,7 +75,7 @@ namespace SemiColinGames { public void Draw(SpriteBatch spriteBatch) { spriteBatch.Draw( - Terrain.Texture.Get(), Position.Location.ToVector2(), Terrain.TextureSource, Color.White); + Terrain.Texture.Get, Position.Location.ToVector2(), Terrain.TextureSource, Color.White); } }