From 441f2d7e0ab844cbc3bd86ef2c5410c245f08cb9 Mon Sep 17 00:00:00 2001 From: gotmachine <24925209+gotmachine@users.noreply.github.com> Date: Thu, 16 May 2024 19:41:25 +0200 Subject: [PATCH] Fixed a regression introduced in 1.35.1, causing PNG normal maps to be generated with empty mipmaps. --- GameData/KSPCommunityFixes/KSPCommunityFixes.version | 2 +- KSPCommunityFixes/Performance/FastLoader.cs | 1 + KSPCommunityFixes/Properties/AssemblyInfo.cs | 4 ++-- README.md | 3 +++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/GameData/KSPCommunityFixes/KSPCommunityFixes.version b/GameData/KSPCommunityFixes/KSPCommunityFixes.version index 2fe3508..f619582 100644 --- a/GameData/KSPCommunityFixes/KSPCommunityFixes.version +++ b/GameData/KSPCommunityFixes/KSPCommunityFixes.version @@ -2,7 +2,7 @@ "NAME": "KSPCommunityFixes", "URL": "https://raw.githubusercontent.com/KSPModdingLibs/KSPCommunityFixes/master/GameData/KSPCommunityFixes/KSPCommunityFixes.version", "DOWNLOAD": "https://github.com/KSPModdingLibs/KSPCommunityFixes/releases", - "VERSION": {"MAJOR": 1, "MINOR": 35, "PATCH": 1, "BUILD": 0}, + "VERSION": {"MAJOR": 1, "MINOR": 35, "PATCH": 2, "BUILD": 0}, "KSP_VERSION": {"MAJOR": 1, "MINOR": 12, "PATCH": 5}, "KSP_VERSION_MIN": {"MAJOR": 1, "MINOR": 8, "PATCH": 0}, "KSP_VERSION_MAX": {"MAJOR": 1, "MINOR": 12, "PATCH": 5} diff --git a/KSPCommunityFixes/Performance/FastLoader.cs b/KSPCommunityFixes/Performance/FastLoader.cs index f7256b3..f26b41a 100644 --- a/KSPCommunityFixes/Performance/FastLoader.cs +++ b/KSPCommunityFixes/Performance/FastLoader.cs @@ -1659,6 +1659,7 @@ private static Texture2D BitmapToCompressedNormalMapFast(Texture2D original, boo // Unity can't convert NPOT textures to DXT5 with mipmaps if (StaticHelpers.IsPowerOfTwo(normalMap.width) && StaticHelpers.IsPowerOfTwo(normalMap.height)) { + normalMap.Apply(true); // needed to generate mipmaps, must be done before compression normalMap.Compress(false); normalMap.Apply(true, makeNoLongerReadable); } diff --git a/KSPCommunityFixes/Properties/AssemblyInfo.cs b/KSPCommunityFixes/Properties/AssemblyInfo.cs index 30e9b29..4d1d068 100644 --- a/KSPCommunityFixes/Properties/AssemblyInfo.cs +++ b/KSPCommunityFixes/Properties/AssemblyInfo.cs @@ -30,7 +30,7 @@ // Revision // [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.35.1.0")] +[assembly: AssemblyFileVersion("1.35.2.0")] -[assembly: KSPAssembly("KSPCommunityFixes", 1, 35, 1)] +[assembly: KSPAssembly("KSPCommunityFixes", 1, 35, 2)] [assembly: KSPAssemblyDependency("MultipleModulePartAPI", 1, 0, 0)] diff --git a/README.md b/README.md index 89d8097..f6d141d 100644 --- a/README.md +++ b/README.md @@ -190,6 +190,9 @@ If doing so in the `Debug` configuration and if your KSP install is modified to ### Changelog +##### 1.35.2 +- **FastLoader** : Fixed a regression introduced in 1.35.1, causing PNG normal maps to be generated with empty mipmaps. + ##### 1.35.1 - **FastLoader** : fixed the PNG loader behavior not being similiar as in stock. It was wrongly generating mipmaps, notably resulting in NPOT textures not showing when texture quality wasn't set to full resolution ([see issue #224](https://github.com/KSPModdingLibs/KSPCommunityFixes/issues/224)). - **FastLoader** : fixed cached PNG textures loading not using the data loaded by the threaded reader, but instead reading the file again synchronously (!). Unsurprisingly, fixing that is massively improving texture loading time.