From 97a5a97370bc8f4d721791457d551c6bd2b0b67c Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 5 Aug 2017 22:57:40 -0400 Subject: skin loader and ui tint --- ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs | 2 ++ ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'ShiftOS.Frontend/GraphicsSubsystem') diff --git a/ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs b/ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs index 217eb33..2a33331 100644 --- a/ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs +++ b/ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs @@ -168,6 +168,8 @@ namespace ShiftOS.Frontend.GraphicsSubsystem gfx.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; gfx.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality; gfx.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit; + gfx.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceOver; + gfx.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; gfx.DrawString(text, font, System.Drawing.Brushes.Black, new System.Drawing.RectangleF(0, 0, bmp.Width, bmp.Height), sFormat); } diff --git a/ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs b/ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs index 18e924a..dc47e93 100644 --- a/ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs +++ b/ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs @@ -92,7 +92,7 @@ namespace ShiftOS.Frontend.GraphicsSubsystem } } - batch.Draw(_target, new Rectangle(ctrl.X, ctrl.Y, ctrl.Width, ctrl.Height), Color.White); + batch.Draw(_target, new Rectangle(ctrl.X, ctrl.Y, ctrl.Width, ctrl.Height), _game.UITint); } } } @@ -240,6 +240,11 @@ namespace ShiftOS.Frontend.GraphicsSubsystem } + public static void SetUITint(Color color) + { + _game.UITint = color; + } + public static bool ExperimentalEffects = true; @@ -250,10 +255,13 @@ namespace ShiftOS.Frontend.GraphicsSubsystem { if (SkinEngine.LoadedSkin == null) SkinEngine.Init(); + + batch.Draw(SkinTextures["DesktopColor"], new Rectangle(0, 0, Viewport.Width, Viewport.Height), _game.UITint); + graphics.Clear(SkinEngine.LoadedSkin.DesktopColor.ToMonoColor()); if (SkinTextures.ContainsKey("desktopbackground")) { - batch.Draw(SkinTextures["desktopbackground"], new Rectangle(0, 0, Viewport.Width, Viewport.Height), Color.White); + batch.Draw(SkinTextures["desktopbackground"], new Rectangle(0, 0, Viewport.Width, Viewport.Height), _game.UITint); } } -- cgit v1.2.3