(AutoEntry.DetectFileType): changed arguments.

This commit is contained in:
morkt 2016-01-31 06:20:34 +04:00
parent 9b6c4ddff0
commit 6d508f8595

View File

@ -57,12 +57,11 @@ namespace GameRes.Formats
public static AutoEntry Create (ArcView file, long offset, string base_name) public static AutoEntry Create (ArcView file, long offset, string base_name)
{ {
return new AutoEntry (base_name, () => DetectFileType (file, offset)) { Offset = offset }; return new AutoEntry (base_name, () => DetectFileType (file.View.ReadUInt32 (offset))) { Offset = offset };
} }
public static IResource DetectFileType (ArcView file, long offset) public static IResource DetectFileType (uint signature)
{ {
uint signature = file.View.ReadUInt32 (offset);
if (0 == signature) return null; if (0 == signature) return null;
// resolve some special cases first // resolve some special cases first
if (s_OggFormat.Value.Signature == signature) if (s_OggFormat.Value.Signature == signature)