mirror of
https://github.com/crskycode/GARbro.git
synced 2024-10-23 07:38:16 +08:00
(PicFormat): read image coordinates.
This commit is contained in:
parent
ce7a34648d
commit
372a1336da
@ -2,7 +2,7 @@
|
|||||||
//! \date Thu Apr 16 16:03:19 2015
|
//! \date Thu Apr 16 16:03:19 2015
|
||||||
//! \brief GsPack image format implementation.
|
//! \brief GsPack image format implementation.
|
||||||
//
|
//
|
||||||
// Copyright (C) 2015 by morkt
|
// Copyright (C) 2015-2016 by morkt
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
// of this software and associated documentation files (the "Software"), to
|
// of this software and associated documentation files (the "Software"), to
|
||||||
@ -69,16 +69,19 @@ namespace GameRes.Formats.Gs
|
|||||||
info.Width = input.ReadUInt32();
|
info.Width = input.ReadUInt32();
|
||||||
info.Height = input.ReadUInt32();
|
info.Height = input.ReadUInt32();
|
||||||
info.BPP = input.ReadInt32();
|
info.BPP = input.ReadInt32();
|
||||||
|
if (info.HeaderSize >= 0x2C)
|
||||||
|
{
|
||||||
|
input.ReadInt32();
|
||||||
|
info.OffsetX = input.ReadInt32();
|
||||||
|
info.OffsetY = input.ReadInt32();
|
||||||
|
}
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ImageData Read (Stream stream, ImageMetaData info)
|
public override ImageData Read (Stream stream, ImageMetaData info)
|
||||||
{
|
{
|
||||||
var meta = info as PicMetaData;
|
var meta = (PicMetaData)info;
|
||||||
if (null == meta)
|
|
||||||
throw new ArgumentException ("PicFormat.Read should be supplied with PicMetaData", "info");
|
|
||||||
|
|
||||||
stream.Position = meta.HeaderSize;
|
stream.Position = meta.HeaderSize;
|
||||||
using (var input = new LzssStream (stream, LzssMode.Decompress, true))
|
using (var input = new LzssStream (stream, LzssMode.Decompress, true))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user