Adjustments
This commit is contained in:
parent
b9b198cccb
commit
6137bddb0d
@ -24,6 +24,8 @@ namespace FirstPlugin
|
|||||||
public string FilePath { get; set; }
|
public string FilePath { get; set; }
|
||||||
public IFileInfo IFileInfo { get; set; }
|
public IFileInfo IFileInfo { get; set; }
|
||||||
|
|
||||||
|
static bool shownOodleError = false;
|
||||||
|
|
||||||
public Dictionary<string, string> CategoryLookup
|
public Dictionary<string, string> CategoryLookup
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
@ -843,6 +845,15 @@ namespace FirstPlugin
|
|||||||
Padding = reader.ReadUInt32();
|
Padding = reader.ReadUInt32();
|
||||||
ulong FileOffset = reader.ReadUInt64();
|
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))
|
using (reader.TemporarySeek((long)FileOffset, SeekOrigin.Begin))
|
||||||
{
|
{
|
||||||
if (Type == CompressionType.Lz4)
|
if (Type == CompressionType.Lz4)
|
||||||
@ -852,7 +863,7 @@ namespace FirstPlugin
|
|||||||
}
|
}
|
||||||
else if (Type == CompressionType.None)
|
else if (Type == CompressionType.None)
|
||||||
FileData = reader.ReadBytes((int)DecompressedFileSize);
|
FileData = reader.ReadBytes((int)DecompressedFileSize);
|
||||||
else if (Type == CompressionType.Oodle)
|
else if (Type == CompressionType.Oodle && !shownOodleError)
|
||||||
{
|
{
|
||||||
FileData = reader.ReadBytes((int)CompressedFileSize);
|
FileData = reader.ReadBytes((int)CompressedFileSize);
|
||||||
FileData = STLibraryCompression.Type_Oodle.Decompress(FileData, (int)DecompressedFileSize);
|
FileData = STLibraryCompression.Type_Oodle.Decompress(FileData, (int)DecompressedFileSize);
|
||||||
|
@ -717,11 +717,6 @@ namespace Toolbox.Library.IO
|
|||||||
{
|
{
|
||||||
public static byte[] Decompress(byte[] data, int decompressedSize)
|
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);
|
return Toolbox.Library.Compression.Oodle.Decompress(data, decompressedSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user