(Pb3Reader.Unpack): throw InvalidEncryptionScheme on unknown type id.

This commit is contained in:
morkt 2015-12-12 18:18:10 +04:00
parent 6099177363
commit 6613f11461

View File

@ -113,11 +113,15 @@ namespace GameRes.Formats.Purple
{ {
switch (m_info.Type) switch (m_info.Type)
{ {
default: throw new InvalidEncryptionScheme();
case 1: UnpackV1(); break; case 1: UnpackV1(); break;
case 5: UnpackV5(); break; case 5: UnpackV5(); break;
case 8: case 8:
case 6: UnpackV6(); break; case 6: UnpackV6(); break;
default: throw new NotSupportedException(string.Format ("PB3 v{0} images not supported", m_info.Type)); case 2:
case 3:
case 4:
case 7: throw new NotSupportedException(string.Format ("PB3 v{0} images not supported", m_info.Type));
// V3 is pain in the ass to implement, machine code is full of unrolled loops resulting in a // V3 is pain in the ass to implement, machine code is full of unrolled loops resulting in a
// thousands lines of spaghetti code. // thousands lines of spaghetti code.
} }