mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-30 17:05:37 +08:00
(WipFormat): tweaked Trace reporting.
This commit is contained in:
parent
08cd673408
commit
4b0f220b5d
@ -70,8 +70,6 @@ namespace GameRes.Formats.Will
|
|||||||
Trace.WriteLine ("unsupported bpp", "WipFormat");
|
Trace.WriteLine ("unsupported bpp", "WipFormat");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (frames > 1)
|
|
||||||
Trace.WriteLine ("Extra frames ignored", "WipFormat");
|
|
||||||
return new WipMetaData
|
return new WipMetaData
|
||||||
{
|
{
|
||||||
Width = width,
|
Width = width,
|
||||||
@ -93,6 +91,8 @@ namespace GameRes.Formats.Will
|
|||||||
public override ImageData Read (Stream file, ImageMetaData info)
|
public override ImageData Read (Stream file, ImageMetaData info)
|
||||||
{
|
{
|
||||||
var meta = (WipMetaData)info;
|
var meta = (WipMetaData)info;
|
||||||
|
if (meta.FrameCount > 1)
|
||||||
|
Trace.WriteLine ("Extra frames ignored", info.FileName);
|
||||||
file.Position = 8 + 24 * meta.FrameCount;
|
file.Position = 8 + 24 * meta.FrameCount;
|
||||||
Color[] palette = null;
|
Color[] palette = null;
|
||||||
if (8 == meta.BPP)
|
if (8 == meta.BPP)
|
||||||
@ -114,11 +114,12 @@ namespace GameRes.Formats.Will
|
|||||||
byte[] raw = reader.Data;
|
byte[] raw = reader.Data;
|
||||||
int size = (int)meta.Width * (int)meta.Height;
|
int size = (int)meta.Width * (int)meta.Height;
|
||||||
byte[] pixels = new byte[size*3];
|
byte[] pixels = new byte[size*3];
|
||||||
|
int dst = 0;
|
||||||
for (int i = 0; i < size; ++i)
|
for (int i = 0; i < size; ++i)
|
||||||
{
|
{
|
||||||
pixels[i*3] = raw[i];
|
pixels[dst++] = raw[i];
|
||||||
pixels[i*3+1] = raw[i+size];
|
pixels[dst++] = raw[i+size];
|
||||||
pixels[i*3+2] = raw[i+size*2];
|
pixels[dst++] = raw[i+size*2];
|
||||||
}
|
}
|
||||||
return ImageData.Create (meta, PixelFormats.Bgr24, null, pixels, (int)meta.Width*3);
|
return ImageData.Create (meta, PixelFormats.Bgr24, null, pixels, (int)meta.Width*3);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user