mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-24 03:44:13 +08:00
use TgaStream.Create where appropriate.
This commit is contained in:
parent
abe08cd457
commit
3a6f30f316
@ -175,13 +175,7 @@ namespace GameRes.Formats.Ags
|
|||||||
using (var reader = new CgFormat.Reader (input, info, key_frame))
|
using (var reader = new CgFormat.Reader (input, info, key_frame))
|
||||||
{
|
{
|
||||||
reader.Unpack();
|
reader.Unpack();
|
||||||
var header = new byte[0x12];
|
return TgaStream.Create (info, reader.Data);
|
||||||
header[2] = 2;
|
|
||||||
LittleEndian.Pack ((ushort)info.Width, header, 0xc);
|
|
||||||
LittleEndian.Pack ((ushort)info.Height, header, 0xe);
|
|
||||||
header[0x10] = 24;
|
|
||||||
header[0x11] = 0x20;
|
|
||||||
return new PrefixStream (header, new MemoryStream (reader.Data));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ namespace GameRes.Formats.CatSystem
|
|||||||
offset += section_size;
|
offset += section_size;
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
if (dir.Count < 2)
|
if (dir.Count < 1)
|
||||||
return null;
|
return null;
|
||||||
return new ArcFile (file, this, dir);
|
return new ArcFile (file, this, dir);
|
||||||
}
|
}
|
||||||
@ -89,16 +89,7 @@ namespace GameRes.Formats.CatSystem
|
|||||||
using (var reader = new Hg3Reader (input, info))
|
using (var reader = new Hg3Reader (input, info))
|
||||||
{
|
{
|
||||||
var pixels = reader.Unpack();
|
var pixels = reader.Unpack();
|
||||||
var header = new byte[0x12];
|
return TgaStream.Create (info, pixels, reader.Flipped);
|
||||||
header[2] = 2;
|
|
||||||
LittleEndian.Pack ((short)info.OffsetX, header, 8);
|
|
||||||
LittleEndian.Pack ((short)info.OffsetY, header, 0xa);
|
|
||||||
LittleEndian.Pack ((ushort)info.Width, header, 0xc);
|
|
||||||
LittleEndian.Pack ((ushort)info.Height, header, 0xe);
|
|
||||||
header[0x10] = (byte)info.BPP;
|
|
||||||
if (!reader.Flipped)
|
|
||||||
header[0x11] = 0x20;
|
|
||||||
return new PrefixStream (header, new MemoryStream (pixels));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -96,16 +96,7 @@ namespace GameRes.Formats.ShiinaRio
|
|||||||
using (var input = arc.File.CreateStream (0, (uint)arc.File.MaxOffset))
|
using (var input = arc.File.CreateStream (0, (uint)arc.File.MaxOffset))
|
||||||
using (var reader = new S25Format.Reader (input, info))
|
using (var reader = new S25Format.Reader (input, info))
|
||||||
{
|
{
|
||||||
var pixels = reader.Unpack();
|
return TgaStream.Create (info, reader.Unpack());
|
||||||
var header = new byte[0x12];
|
|
||||||
header[2] = 2;
|
|
||||||
LittleEndian.Pack ((short)info.OffsetX, header, 8);
|
|
||||||
LittleEndian.Pack ((short)info.OffsetY, header, 0xa);
|
|
||||||
LittleEndian.Pack ((ushort)info.Width, header, 0xc);
|
|
||||||
LittleEndian.Pack ((ushort)info.Height, header, 0xe);
|
|
||||||
header[0x10] = 32;
|
|
||||||
header[0x11] = 0x20;
|
|
||||||
return new PrefixStream (header, new MemoryStream (pixels));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user