linuxgurugamer / ksp_toolbar

Common API for GUI toolbars in KSP
BSD 2-Clause "Simplified" License
13 stars 14 forks source link

Fix fuzzy textures in GameDatabase #14

Closed cake-pie closed 5 years ago

cake-pie commented 5 years ago

GameDatabase has all textures that haven't been hidden from it (by putting images in PluginData). Fix the fuzzy textures in GameDatabase once, and use that henceforth, instead of reading from file at every scene change, with texture discarded without proper destruction afterwards.

LoadImageFromFile() retained for textures that have been deliberately hidden in PluginData folders. This approach should now be discouraged as it still suffers the abovementioned pitfalls.

Avoid creating blank texture unnecessarily in GetTexture().

Use unBlur's LoadDDS instead: has DXT1, 3 & 5 support, uses pure BinaryReader approach so no juggling or copying of byte[]s, and might as well conserve code since the dependency also provides same function.

Fix #13 regression introduced by 0fc6d5b6fc19445f2563e6376062dcfca5e0c588

linuxgurugamer commented 5 years ago

Thank you, I'll be updating the ToolbarControl with these same changes