1
0
mirror of synced 2024-11-27 17:00:50 +01:00

Adjustments

This commit is contained in:
KillzXGaming 2022-02-22 20:05:54 -05:00
parent b9b198cccb
commit 6137bddb0d
2 changed files with 12 additions and 6 deletions

View File

@ -24,6 +24,8 @@ namespace FirstPlugin
public string FilePath { get; set; }
public IFileInfo IFileInfo { get; set; }
static bool shownOodleError = false;
public Dictionary<string, string> CategoryLookup
{
get {
@ -843,6 +845,15 @@ namespace FirstPlugin
Padding = reader.ReadUInt32();
ulong FileOffset = reader.ReadUInt64();
if (Type == CompressionType.Oodle)
{
if (!shownOodleError && !File.Exists($"{Runtime.ExecutableDir}\\oo2core_6_win64.dll"))
{
MessageBox.Show("'oo2core_6_win64.dll' not found in the executable folder! User must provide their own copy!");
shownOodleError = true;
}
}
using (reader.TemporarySeek((long)FileOffset, SeekOrigin.Begin))
{
if (Type == CompressionType.Lz4)
@ -852,7 +863,7 @@ namespace FirstPlugin
}
else if (Type == CompressionType.None)
FileData = reader.ReadBytes((int)DecompressedFileSize);
else if (Type == CompressionType.Oodle)
else if (Type == CompressionType.Oodle && !shownOodleError)
{
FileData = reader.ReadBytes((int)CompressedFileSize);
FileData = STLibraryCompression.Type_Oodle.Decompress(FileData, (int)DecompressedFileSize);

View File

@ -717,11 +717,6 @@ namespace Toolbox.Library.IO
{
public static byte[] Decompress(byte[] data, int decompressedSize)
{
if (!File.Exists($"{Runtime.ExecutableDir}\\oo2core_6_win64.dll"))
{
MessageBox.Show("'oo2core_6_win64.dll' not found in the executable folder! User must provide their own copy!");
return data;
}
return Toolbox.Library.Compression.Oodle.Decompress(data, decompressedSize);
}