diff --git a/Nez.Portable/Core.cs b/Nez.Portable/Core.cs index 8f916d638..b4c5f04df 100644 --- a/Nez.Portable/Core.cs +++ b/Nez.Portable/Core.cs @@ -149,7 +149,7 @@ public Core(int width = 1280, int height = 720, bool isFullScreen = false, strin SynchronizeWithVerticalRetrace = true, #if MONOGAME_38 HardwareModeSwitch = hardwareModeSwitch, - PreferHalfPixelOffset = true + PreferHalfPixelOffset = false #endif }; graphicsManager.DeviceReset += OnGraphicsDeviceReset; diff --git a/Nez.Portable/Graphics/Batcher/Batcher.cs b/Nez.Portable/Graphics/Batcher/Batcher.cs index 472834671..177150024 100644 --- a/Nez.Portable/Graphics/Batcher/Batcher.cs +++ b/Nez.Portable/Graphics/Batcher/Batcher.cs @@ -69,10 +69,7 @@ public class Batcher : GraphicsResource #region static variables and constants - - /// if true, the older FNA half-pixel offset will be used when creating the ortho matrix. Autoset to true for FNA. - public static bool UseFnaHalfPixelMatrix = false; - + const int MAX_SPRITES = 2048; const int MAX_VERTICES = MAX_SPRITES * 4; const int MAX_INDICES = MAX_SPRITES * 6; @@ -83,10 +80,6 @@ public class Batcher : GraphicsResource static readonly short[] _indexData = GenerateIndexArray(); #endregion - - #if FNA - static Batcher() => UseFnaHalfPixelMatrix = true; - #endif public Batcher(GraphicsDevice graphicsDevice) { @@ -1065,19 +1058,10 @@ void PrepRenderState() var viewport = GraphicsDevice.Viewport; // inlined CreateOrthographicOffCenter - if (UseFnaHalfPixelMatrix) - { - _projectionMatrix.M11 = (float)(2.0 / (double)(viewport.Width / 2 * 2 - 1)); - _projectionMatrix.M22 = (float)(-2.0 / (double)(viewport.Height / 2 * 2 - 1)); - } - else - { - _projectionMatrix.M11 = (float)(2.0 / (double)viewport.Width); - _projectionMatrix.M22 = (float)(-2.0 / (double)viewport.Height); - } - - _projectionMatrix.M41 = -1 - 0.5f * _projectionMatrix.M11; - _projectionMatrix.M42 = 1 - 0.5f * _projectionMatrix.M22; + _projectionMatrix.M11 = (float)(2.0 / (double)viewport.Width); + _projectionMatrix.M22 = (float)(-2.0 / (double)viewport.Height); + _projectionMatrix.M41 = -1; + _projectionMatrix.M42 = 1; Matrix.Multiply(ref _transformMatrix, ref _projectionMatrix, out _matrixTransformMatrix); _spriteEffect.SetMatrixTransform(ref _matrixTransformMatrix);