From e6c70d43a0ae365c3aa63cd9ec45a19faf73bebb Mon Sep 17 00:00:00 2001 From: Alessandro Proto Date: Sat, 25 Feb 2023 09:55:26 +0100 Subject: [PATCH] "Smart" border color --- Capy64/Capy64.cs | 3 ++- Capy64/Core/Drawing.cs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Capy64/Capy64.cs b/Capy64/Capy64.cs index 5951ab3..341968d 100644 --- a/Capy64/Capy64.cs +++ b/Capy64/Capy64.cs @@ -53,6 +53,7 @@ public class Capy64 : Game, IGame public Eventing.EventEmitter EventEmitter { get; private set; } public DiscordIntegration Discord { get; set; } + public Color BorderColor { get; set; } = Color.Black; public Borders Borders = new() { Top = 0, @@ -220,7 +221,7 @@ public class Capy64 : Game, IGame protected override void Draw(GameTime gameTime) { SpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp); - GraphicsDevice.Clear(new Color(0x11, 0x11, 0x11)); + GraphicsDevice.Clear(BorderColor); SpriteBatch.DrawRectangle(renderTarget.Bounds.Location.ToVector2() + new Vector2(Borders.Left, Borders.Top), new Size2(renderTarget.Bounds.Width * Scale, renderTarget.Bounds.Height * Scale), Color.Black, Math.Min(renderTarget.Bounds.Width, renderTarget.Bounds.Height), 0); diff --git a/Capy64/Core/Drawing.cs b/Capy64/Core/Drawing.cs index ce4e6ec..c331993 100644 --- a/Capy64/Core/Drawing.cs +++ b/Capy64/Core/Drawing.cs @@ -184,6 +184,7 @@ public class Drawing : IDisposable public void Clear(Color? color = default) { Color finalColor = color ?? Color.Black; + Capy64.Instance.BorderColor = finalColor; _graphicsDevice.Clear(finalColor); }