Merge pull request #59 from YeLikesss/master

[Musica] Fix SqzFile Parser
This commit is contained in:
Crsky 2024-12-03 19:28:27 +08:00 committed by GitHub
commit 9cb5ec89b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -34,11 +34,13 @@ namespace GameRes.Formats.Musica
internal class SqzArchive : ArcFile
{
public readonly ImageMetaData Info;
public readonly int FPS;
public SqzArchive (ArcView arc, ArchiveFormat impl, ICollection<Entry> dir, ImageMetaData info)
public SqzArchive (ArcView arc, ArchiveFormat impl, ICollection<Entry> dir, ImageMetaData info, int fps)
: base (arc, impl, dir)
{
Info = info;
FPS = fps;
}
}
@ -53,7 +55,7 @@ namespace GameRes.Formats.Musica
public override ArcFile TryOpen (ArcView file)
{
int count = file.View.ReadInt32 (0x10) * 2;
int count = file.View.ReadInt32 (4);
if (!IsSaneCount (count))
return null;
@ -62,8 +64,8 @@ namespace GameRes.Formats.Musica
Width = file.View.ReadUInt32 (8),
Height = file.View.ReadUInt32 (0xC),
BPP = 32,
// BPP = file.View.ReadInt32 (4),
};
int fps = file.View.ReadInt32(0x10);
var base_name = Path.GetFileNameWithoutExtension (file.Name);
uint index_offset = 0x14;
var dir = new List<Entry> (count);
@ -80,7 +82,7 @@ namespace GameRes.Formats.Musica
dir.Add (entry);
index_offset += 8;
}
return new SqzArchive (file, this, dir, info);
return new SqzArchive (file, this, dir, info, fps);
}
public override IImageDecoder OpenImage (ArcFile arc, Entry entry)