From 1928d5e45965a1aa36201bcc9f8b100262b847c1 Mon Sep 17 00:00:00 2001 From: OptimShi Date: Mon, 19 Dec 2022 00:12:17 -0700 Subject: [PATCH] Better handling of Surface.Type = BASE1_SOLID (solid color surfaces) (#68) * Updated to .NET6, so compatible with ACE. Handled solid color surfaces better * Update appveyor.yml Co-authored-by: Ty Conner --- ACViewer/ACViewer.csproj | 2 +- ACViewer/ACViewer.csproj.user | 9 +++++++++ ACViewer/Render/TextureCache.cs | 6 ++++-- appveyor.yml | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 ACViewer/ACViewer.csproj.user diff --git a/ACViewer/ACViewer.csproj b/ACViewer/ACViewer.csproj index 036212f..40cf9cf 100644 --- a/ACViewer/ACViewer.csproj +++ b/ACViewer/ACViewer.csproj @@ -2,7 +2,7 @@ WinExe - net5.0-windows + net6.0-windows true diff --git a/ACViewer/ACViewer.csproj.user b/ACViewer/ACViewer.csproj.user new file mode 100644 index 0000000..20706fa --- /dev/null +++ b/ACViewer/ACViewer.csproj.user @@ -0,0 +1,9 @@ + + + + + + Component + + + \ No newline at end of file diff --git a/ACViewer/Render/TextureCache.cs b/ACViewer/Render/TextureCache.cs index e06fea4..42636ea 100644 --- a/ACViewer/Render/TextureCache.cs +++ b/ACViewer/Render/TextureCache.cs @@ -453,8 +453,10 @@ public static Texture2D Get(uint fileID, Dictionary textureChanges = var r = (surface.ColorValue >> 16) & 0xFF; var g = (surface.ColorValue >> 8) & 0xFF; var b = surface.ColorValue & 0xFF; - a = 0; - swatch.SetDataAsync(new Microsoft.Xna.Framework.Color[] { new Microsoft.Xna.Framework.Color(r, g, b, a) }); + + if (surface.Translucency == 1) a = 0; + + swatch.SetDataAsync(new Microsoft.Xna.Framework.Color[] { new Microsoft.Xna.Framework.Color(Convert.ToByte(r), Convert.ToByte(g), Convert.ToByte(b), Convert.ToByte(a)) }); return swatch; } diff --git a/appveyor.yml b/appveyor.yml index 8497ffe..3eeba72 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,7 +5,7 @@ branches: only: - master skip_tags: true -image: Visual Studio 2019 +image: Visual Studio 2022 configuration: - Release - Debug