3.0.6.2 - Fix backwards compatability build introduced in 3.0.6.1

This commit is contained in:
Halgari 2023-01-28 15:05:06 -07:00
parent bafbb75d4a
commit 3587b188e0
4 changed files with 31 additions and 5 deletions

View File

@ -1,8 +1,12 @@
### Changelog
#### Version - 3.0.6.2 - 1/28/2023
* Add fallback for DDS compression when installing older lists. This should keep older DDS files from not being compressed without any mipmaps at all.
*
#### Version - 3.0.6.1 - 1/28/2023
* Game support:
* Added Mount & Blade II: Bennerlord support (Steam,GOG)
* Added Mount & Blade II: Bennerlord support (Steam,GOG)
* Fixed BA2 files not being compressed properly due to MipMaps not being detected properly
#### Version - 3.0.6.0 - 1/21/2023

View File

@ -46,8 +46,9 @@ public class FileLoadingTests : IAsyncDisposable
{
foreach (var imageLoader in _imageLoaders)
{
var inputFile = "TestData/test-dxt5.dds".ToRelativePath().RelativeTo(KnownFolders.EntryPoint);
var baseState =
await imageLoader.Load("TestData/test-dxt5.dds".ToRelativePath().RelativeTo(KnownFolders.EntryPoint));
await imageLoader.Load(inputFile);
var state = await imageLoader.Load("TestData".ToRelativePath().Combine(file)
.RelativeTo(KnownFolders.EntryPoint));
@ -58,6 +59,9 @@ public class FileLoadingTests : IAsyncDisposable
new Digest { Coefficients = baseState.PerceptualHash.Data },
new Digest { Coefficients = state.PerceptualHash.Data }),
1.0);
await using var outFile = _tmp.CreateFile();
await imageLoader.Recompress(inputFile, 64, 64, 0, DXGI_FORMAT.BC7_UNORM, outFile, CancellationToken.None);
}
}

View File

@ -101,7 +101,7 @@ public class CrossPlatformImageLoader : IImageLoader
GenerateMipMaps = true,
Format = ToCompressionFormat(format),
FileFormat = OutputFileFormat.Dds,
MaxMipMapLevel = mipMaps
MaxMipMapLevel = mipMaps != 0 ? mipMaps : -1
}
};

View File

@ -83,11 +83,29 @@ public class TexConvImageLoader : IImageLoader
public async Task ConvertImage(AbsolutePath from, AbsolutePath toFolder, int w, int h, int mipMaps, DXGI_FORMAT format, Extension fileFormat)
{
// User isn't renaming the file, so we don't have to create a temporary folder
object[] args;
if (mipMaps != 0)
{
args = new object[]
{
from, "-ft", fileFormat.ToString()[1..], "-f", format, "-o", toFolder, "-w", w, "-h", h, "-m", mipMaps,
"-if", "CUBIC", "-singleproc"
};
}
else
{
args = new object[]
{
from, "-ft", fileFormat.ToString()[1..], "-f", format, "-o", toFolder, "-w", w, "-h", h,
"-if", "CUBIC", "-singleproc"
};
}
// User isn't renaming the file, so we don't have to create a temporary folder
var ph = new ProcessHelper
{
Path = @"Tools\texconv.exe".ToRelativePath().RelativeTo(KnownFolders.EntryPoint),
Arguments = new object[] {from, "-ft", fileFormat.ToString()[1..], "-f", format, "-o", toFolder, "-w", w, "-h", h, "-m", mipMaps, "-if", "CUBIC", "-singleproc"},
Arguments = args,
ThrowOnNonZeroExitCode = true,
LogError = true
};