From 203cb64a03055541e8f696f72442562db762cd60 Mon Sep 17 00:00:00 2001 From: morkt Date: Fri, 29 Jul 2016 06:52:11 +0400 Subject: [PATCH] (SgxFormat): fixed GRX interpreter. --- ArcFormats/UMeSoft/ImageGRX.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ArcFormats/UMeSoft/ImageGRX.cs b/ArcFormats/UMeSoft/ImageGRX.cs index 31860db6..e69d74e4 100644 --- a/ArcFormats/UMeSoft/ImageGRX.cs +++ b/ArcFormats/UMeSoft/ImageGRX.cs @@ -308,17 +308,22 @@ namespace GameRes.Formats.UMeSoft var info = base.ReadMetaData (stream) as GrxMetaData; if (null == info) return null; - if (info.AlphaOffset > 0) - info.AlphaOffset += offset; - return new SgxMetaData { GrxOffset = offset, GrxInfo = info }; + return new SgxMetaData + { + Width = info.Width, + Height = info.Height, + BPP = info.BPP, + GrxOffset = offset, + GrxInfo = info + }; } } public override ImageData Read (Stream stream, ImageMetaData info) { var meta = (SgxMetaData)info; - stream.Position = meta.GrxOffset; - return base.Read (stream, meta.GrxInfo); + using (var grx = new StreamRegion (stream, meta.GrxOffset, true)) + return base.Read (grx, meta.GrxInfo); } } }