From 12a1ade9ef51026646f52a01dcdaecc6bc1c453b Mon Sep 17 00:00:00 2001 From: Yukai Li Date: Wed, 17 Feb 2021 13:04:53 -0700 Subject: [PATCH] Tweak PSMCT32 conversion to match with PC version --- LibDgf.Graphics/TxmConversion.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/LibDgf.Graphics/TxmConversion.cs b/LibDgf.Graphics/TxmConversion.cs index 71ecf8c..ad9abf8 100644 --- a/LibDgf.Graphics/TxmConversion.cs +++ b/LibDgf.Graphics/TxmConversion.cs @@ -134,7 +134,7 @@ namespace LibDgf.Graphics bw.Write(pixel.R); bw.Write(pixel.G); bw.Write(pixel.B); - bw.Write((byte)((pixel.A + 1) >> 1)); + bw.Write(pixel.A); // Should be halved, but full range is used on PC } else { @@ -239,8 +239,9 @@ namespace LibDgf.Graphics byte r = br.ReadByte(); byte g = br.ReadByte(); byte b = br.ReadByte(); - int a = br.ReadByte() * 2; - if (a > 255) a = 255; + //int a = br.ReadByte() * 2; + //if (a > 255) a = 255; + byte a = br.ReadByte(); // Should be doubled, but full scale is used on PC row[x] = new Rgba32(r, g, b, (byte)a); } }