Skip to content

Commit

Permalink
Fixed a regression introduced in 1.35.1, causing PNG normal maps to b…
Browse files Browse the repository at this point in the history
…e generated with empty mipmaps.
  • Loading branch information
gotmachine committed May 16, 2024
1 parent 1d15409 commit 441f2d7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion GameData/KSPCommunityFixes/KSPCommunityFixes.version
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
1 change: 1 addition & 0 deletions KSPCommunityFixes/Performance/FastLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions KSPCommunityFixes/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 441f2d7

Please sign in to comment.