(IafFormat): image variation.

This commit is contained in:
morkt 2016-09-02 09:37:56 +04:00
parent 40c7cbfe6a
commit 983d49346e
2 changed files with 26 additions and 17 deletions

View File

@ -52,42 +52,48 @@ namespace GameRes.Formats.Triangle
var header = new byte[0x14];
if (12 != stream.Read (header, 0, 12))
return null;
int data_offset;
int packed_size0 = LittleEndian.ToInt32 (header, 0);
int packed_size1 = LittleEndian.ToInt32 (header, 1);
int x, y, packed_size, unpacked_size;
int data_offset, packed_size, unpacked_pos;
int tail_size = 0;
if (5+packed_size1+0x14 == stream.Length)
{
packed_size = packed_size1;
data_offset = 5;
stream.Seek (-0x14, SeekOrigin.End);
if (0x14 != stream.Read (header, 0, 0x14))
return null;
x = LittleEndian.ToInt32 (header, 0);
y = LittleEndian.ToInt32 (header, 4);
unpacked_size = LittleEndian.ToInt32 (header, 0x10);
tail_size = 0x14;
unpacked_pos = 0x10;
}
else if (5+packed_size1+0xC == stream.Length)
{
packed_size = packed_size1;
data_offset = 5;
tail_size = 12;
unpacked_pos = 8;
}
else if (4+packed_size0+0xC == stream.Length)
{
packed_size = packed_size0;
data_offset = 4;
stream.Seek (-12, SeekOrigin.End);
if (12 != stream.Read (header, 0, 12))
return null;
x = LittleEndian.ToInt32 (header, 0);
y = LittleEndian.ToInt32 (header, 4);
unpacked_size = LittleEndian.ToInt32 (header, 8);
tail_size = 12;
unpacked_pos = 8;
}
else
{
packed_size = (int)stream.Length-12;
data_offset = 12;
x = LittleEndian.ToInt32 (header, 0);
y = LittleEndian.ToInt32 (header, 4);
unpacked_size = LittleEndian.ToInt32 (header, 8);
unpacked_pos = 8;
}
if (tail_size > 0)
{
stream.Seek (-tail_size, SeekOrigin.End);
if (tail_size != stream.Read (header, 0, tail_size))
return null;
}
int x = LittleEndian.ToInt32 (header, 0);
int y = LittleEndian.ToInt32 (header, 4);
if (Math.Abs (x) > 4096 || Math.Abs (y) > 4096)
return null;
int unpacked_size = LittleEndian.ToInt32 (header, unpacked_pos);
int pack_type = (unpacked_size >> 30) & 3;
if (3 == pack_type)
return null;

View File

@ -512,6 +512,7 @@ Zettai Joshi Ryouiki!<br/>
<tr class="odd"><td>*.eri<br/>*.mio</td><td><tt>Entis\x1a</tt></td><td>No</td></tr>
<tr><td>*.saf</td><td>-</td><td>No</td><td>Lune</td><td>Rinkan Gakuen</td></tr>
<tr class="odd"><td>*.arc+*.ari</td><td><tt>WFL1</tt></td><td>No</td><td rowspan="2">KaGuYa</td><td rowspan="2">
Bishoku<br/>
Dungeon Crusaderz ~Tales of Demon Eater~<br/>
Dungeon Crusaderz 2 ~Eigou no Rakudo~<br/>
Inkou Haden Amatsu ~Hakudaku no Juin~<br/>
@ -643,6 +644,7 @@ Zettai★Maou ~Boku no Mune-kyun Gakuen Saga~<br/>
</td></tr>
<tr><td>*.sud</td><td>-</td><td>No</td><td rowspan="3">Triangle</td><td rowspan="3">
Kourin Tenshi En Ciel Rena<br/>
Mahou Senshi Princess Tear<br/>
Mahou Senshi Sweet Knights ~Heroine Ryoujoku Shirei~<br/>
Mamagoto<br/>
Monster Park ~Bakemono ni Miirareshi Hime~<br/>
@ -843,6 +845,7 @@ Verdia Gensoukyoku<br/>
Wondering Repair!<br/>
</td></tr>
<tr><td>*.pac</td><td>-</td><td>No</td><td>Tmr-Hiro ADV System</td><td>
Dennou Shinpan Kisaragi Sanjikan<br/>
Gokkun Athlete! Kyonyuu Medalist no Oshaburi Kyouka Gasshuku<br/>
Hitozuma Sakunyuu Hyakkaten<br/>
Mai Miko Moe<br/>