(DatOpener): define signatures in constructor.

This commit is contained in:
morkt 2015-03-26 06:54:12 +04:00
parent 9ae74ce5bb
commit cc297869e5

View File

@ -78,13 +78,11 @@ namespace GameRes.Formats.BlackRainbow
public DatOpener () public DatOpener ()
{ {
Extensions = new string[] { "dat", "pak" }; Extensions = new string[] { "dat", "pak" };
Signatures = new uint[] { 2u, 4u, 5u };
} }
public override ArcFile TryOpen (ArcView file) public override ArcFile TryOpen (ArcView file)
{ {
uint sig = file.View.ReadUInt32 (0);
if (sig != 2 && sig != 4 && sig != 5)
return null;
int count = file.View.ReadInt32 (8); int count = file.View.ReadInt32 (8);
if (count <= 0 || count > 0x1ffff) if (count <= 0 || count > 0x1ffff)
return null; return null;