Skip to content

Commit

Permalink
#MINOR
Browse files Browse the repository at this point in the history
Fixed spritebatch to draw sprites as PointClamp instead of LinearClamp
  • Loading branch information
DanielMcAssey committed Jan 14, 2015
1 parent 85aa562 commit 59081d5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
16 changes: 11 additions & 5 deletions SolarFusion/SolarFusion/SolarFusion/Core/Level/LevelManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@ public LevelTilemap CurrentGameMap
public bool Debug
{
get { return this.mDebugEnabled; }
set { this.mDebugEnabled = value; }
set {
#if DEBUG
this.mDebugEnabled = value;
#else
this.mDebugEnabled = false;
#endif
}
}
#endregion
// !Properties
Expand Down Expand Up @@ -408,7 +414,7 @@ public void Draw(SpriteBatch _sb)
//Create a mask for the occlusion ray
this._obj_graphics.SetRenderTarget(this._obj_scene);
this._obj_graphics.Clear(Color.White);
_sb.Begin(SpriteSortMode.Immediate, BlendState.NonPremultiplied, SamplerState.LinearClamp, null, null, null, this._obj_camera.calculateTransform());
_sb.Begin(SpriteSortMode.Immediate, BlendState.NonPremultiplied, SamplerState.PointClamp, null, null, null, this._obj_camera.calculateTransform());
this.DrawLevel(_sb);
this._obj_player.Draw(_sb);
_sb.End();
Expand All @@ -421,7 +427,7 @@ public void Draw(SpriteBatch _sb)
//Draw Scene in Colour
this._obj_graphics.SetRenderTarget(this._obj_scene);
this._obj_graphics.Clear(this._effect_sky_color); //Background Colour
_sb.Begin(SpriteSortMode.Immediate, BlendState.NonPremultiplied, SamplerState.LinearClamp, null, null, null, this._obj_camera.calculateTransform());
_sb.Begin(SpriteSortMode.Immediate, BlendState.NonPremultiplied, SamplerState.PointClamp, null, null, null, this._obj_camera.calculateTransform());
this.DrawLevel(_sb);
foreach (uint goID in this._obj_entitymanager.QueryRegion(bounds)) //Checks what objects are in the calculated boundry.
{
Expand All @@ -439,12 +445,12 @@ public void Draw(SpriteBatch _sb)
this._obj_graphics.Clear(Color.Black);

//Draw the post processing effects
_sb.Begin(SpriteSortMode.BackToFront, BlendState.Additive, SamplerState.LinearClamp, null, null, null, this._obj_camera.calculateTransform());
_sb.Begin(SpriteSortMode.BackToFront, BlendState.Additive, SamplerState.PointClamp, null, null, null, this._obj_camera.calculateTransform());
_sb.Draw(this._obj_ppmanager.mScene, new Rectangle((int)(this._obj_camera.Position.X - (this._obj_viewport.Width / 2)), 0, this._obj_graphics.Viewport.Width, this._obj_graphics.Viewport.Height), Color.White);
_sb.Draw(this._obj_scene, new Rectangle((int)(this._obj_camera.Position.X - (this._obj_viewport.Width / 2)), 0, this._obj_graphics.Viewport.Width, this._obj_graphics.Viewport.Height), Color.White);
_sb.End();

_sb.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend, SamplerState.LinearClamp, null, null, null, this._obj_camera.calculateTransform());
_sb.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, this._obj_camera.calculateTransform());
this._obj_player.Draw(_sb);
this._obj_gui.Draw(_sb);
_sb.End();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public override void render()

if (this.mPlayerSelectIndex < this._obj_availablePlayers.Length && this._obj_availablePlayers[this.mPlayerSelectIndex] != null)
{
this.ScreenManager.SpriteBatch.Begin();
this.ScreenManager.SpriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, RasterizerState.CullNone);
this._obj_availablePlayers[this.mPlayerSelectIndex].Draw(this.ScreenManager.SpriteBatch);
this.ScreenManager.SpriteBatch.End();
}
Expand Down
12 changes: 2 additions & 10 deletions SolarFusion/SolarFusion/SolarFusion/Core/SysConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,11 @@ namespace SolarFusion.Core
public class SysConfig
{
//General Configuration
public const string CONFIG_GAME_BUILD = "1.0-beta-branch";
public const string CONFIG_GAME_BUILD_TYPE = "BETA";
public const string CONFIG_GAME_BUILD = "0.1.1-proto-branch";
public const string CONFIG_GAME_BUILD_TYPE = "PROTOTYPE";
public const string CONFIG_GAME_NAME_CLEAN = "Jumpista";
public const string CONFIG_GAME_NAME = CONFIG_GAME_NAME_CLEAN + " - " + CONFIG_GAME_BUILD_TYPE + " Build (" + CONFIG_GAME_BUILD + ")";

//Debug Settings
public const string CONFIG_DEBUG_TEAMCITY_BUILD_CONFIG = "xna_4-[Win32|X360]";
public const string CONFIG_DEBUG_TEAMCITY_BUILD_AGENT_SERVER = "glokon-s03";
public const string CONFIG_DEBUG_TEAMCITY_KEY = "HwF0r58n8VmVPWoR8G3c9S9qWWB117NL";
public const string CONFIG_DEBUG_JIRA = "jira.blackholedev.net";
public const string CONFIG_DEBUG_JIRA_METHOD = "POST";
public const string CONFIG_DEBUG_JIRA_KEY = "pAG7zeZ16AY1Ht3924QsC1rup8T3x8pC";

//Directory Mappings
public const string CONFIG_CONTENT_ROOT = "Content";
public const string CONFIG_DATA_DIR_SHADERS = "Core/Shaders/";
Expand Down

0 comments on commit 59081d5

Please sign in to comment.