sarbian/DDSLoader

TR DDS Loader

Closed this issue · 5 comments

Hi, I've implemented my DDS loader inside TextureReplacer now that I've seen how an image loader can be done, by your example.
https://github.com/ducakar/TextureReplacer/blob/master/TextureReplacer/DDS.cs

It can also load non-compressed DDS files and is better compliant to specifications on MSDN (e.g. it reads number of mipmaps only when image actually has them and doesn't assume it's zero otherwise). It's based on C++ code from my 3D engine: https://github.com/ducakar/openzone/blob/master/src/ozEngine/GL.cc

You can merge its code into your DDSLoader if you wish.

Thanks for the info :)
We may have to find a way to avoid more than one DDS loader at the time. Having only one mod load the DDS may be better.

There's no problem with multiple DDS loaders. I launched KSP with DDSLoader and TR and everything loaded OK. Even non-compressed DDS. First, DDSLoader failed to load it and then TR loaded it successfully. It seems multiple loaders for the same extensions can be registered at once and are used in alphabetical order (I guess).

Sure they work, but you don't really know which one loaded the texture and if one support more thing or has less bug than the other you may get unexpected result.

OK, I won't add DDS to TR then.

And one more thing: have you checked your DDSLoader on non-compressed files? You replaced pixelSize with dds_pxlf_dwRGBBitCount but the first is pixel size in BYTES and the other one in bits.

Err. Thanks, I should not code when I m so tired ....