Stopped AWC files from being compressed on import

This commit is contained in:
dexy 2020-02-10 22:24:51 +11:00
parent 5e46e85b9e
commit 6df258225e

View File

@ -1624,6 +1624,7 @@ namespace CodeWalker.GameFiles
bool isrpf = false; bool isrpf = false;
bool isawc = false;
uint hdr = 0; uint hdr = 0;
if (len >= 16) if (len >= 16)
{ {
@ -1655,16 +1656,20 @@ namespace CodeWalker.GameFiles
{ {
isrpf = true; isrpf = true;
} }
if (namel.EndsWith(".awc"))
{
isawc = true;
}
if (entry == null) if (entry == null)
{ {
//no RSC7 header present, import as a binary file. //no RSC7 header present, import as a binary file.
var compressed = isrpf ? data : CompressBytes(data); var compressed = (isrpf||isawc) ? data : CompressBytes(data);
var bentry = new RpfBinaryFileEntry(); var bentry = new RpfBinaryFileEntry();
bentry.EncryptionType = 0;//TODO: binary encryption bentry.EncryptionType = 0;//TODO: binary encryption
bentry.IsEncrypted = false; bentry.IsEncrypted = false;
bentry.FileUncompressedSize = (uint)data.Length; bentry.FileUncompressedSize = (uint)data.Length;
bentry.FileSize = isrpf ? 0 : (uint)compressed.Length; bentry.FileSize = (isrpf||isawc) ? 0 : (uint)compressed.Length;
if (bentry.FileSize > 0xFFFFFF) if (bentry.FileSize > 0xFFFFFF)
{ {
bentry.FileSize = 0; bentry.FileSize = 0;