mirror of
https://github.com/TheRavenwoodArts/LunaLightXMG.git
synced 2026-07-31 00:05:02 -07:00
Bug Fix: Set player positions to snap to integer values to fix pixel distortion.
This commit is contained in:
@@ -61,7 +61,7 @@ namespace LunaLightXMG
|
||||
graphics.PreferredBackBufferHeight = 1080;
|
||||
graphics.ApplyChanges();
|
||||
|
||||
playerInput.HasControl = true; // Do we need this here?
|
||||
playerInput.HasControl = true; // May need to find a new home for this
|
||||
|
||||
base.Initialize();
|
||||
CalculateRenderDestination();
|
||||
@@ -71,10 +71,15 @@ namespace LunaLightXMG
|
||||
{
|
||||
Point size = GraphicsDevice.Viewport.Bounds.Size;
|
||||
|
||||
float scaleX = (float)size.X / renderTarget.Width;
|
||||
float scaleY = (float)size.Y / renderTarget.Height;
|
||||
float scale = Math.Min(scaleX, scaleY);
|
||||
// Calculate the integer scale factor
|
||||
int scaleX = size.X / renderTarget.Width;
|
||||
int scaleY = size.Y / renderTarget.Height;
|
||||
int scale = Math.Min(scaleX, scaleY);
|
||||
|
||||
// Ensure the scale is at least 1
|
||||
scale = Math.Max(scale, 1);
|
||||
|
||||
// Set renderDestination
|
||||
renderDestination.Width = (int)(renderTarget.Width * scale);
|
||||
renderDestination.Height = (int)(renderTarget.Height * scale);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user