meh2481 / wfLZEx

Simple image-decompressing program for WayForward's .anb format used in their game DuckTales: Remastered
Do What The F*ck You Want To Public License
13 stars 5 forks source link

How does it work? #11

Closed MiloCharmingMagician closed 2 years ago

MiloCharmingMagician commented 2 years ago

Is it 64x64 tiles to put together the tex and anb files? can you add a option so I export the raw image rgba data as png files? thanks. 001

meh2481 commented 2 years ago

I think a very old version of the program (that I no longer have I don't think) had an option to not stitch animation frames together. I removed the option because it's pretty useless without it; there's no real rhyme or reason to how the images are split into segments, and there's a lot of off-by-one errors you can run into if you do it incorrectly. The image rectangle and UV data are stored within the .anb file, so it makes sense to go ahead and unscramble each image as you go. I'm pretty sure the .tex files have no such slicing and scrambling of images.

MiloCharmingMagician commented 2 years ago

It was done to save space & memory Is what I know

MiloCharmingMagician commented 2 years ago

I think a very old version of the program (that I no longer have I don't think) had an option to not stitch animation frames together. I removed the option because it's pretty useless without it; there's no real rhyme or reason to how the images are split into segments, and there's a lot of off-by-one errors you can run into if you do it incorrectly. The image rectangle and UV data are stored within the .anb file, so it makes sense to go ahead and unscramble each image as you go. I'm pretty sure the .tex files have no such slicing and scrambling of images.

Do you have the code of the tex decompress tool? I want to get the raw tiles from the tex files

meh2481 commented 2 years ago

I don't think I saved the source code for the tex decompress tool (beyond the exe that I've included in every release; just use that), but the code is basically just lines 448-584 of main.cpp with any multiplication logic removed. The texture format has remained basically unchanged for a while now.

MiloCharmingMagician commented 2 years ago

I don't think I saved the source code for the tex decompress tool (beyond the exe that I've included in every release; just use that), but the code is basically just lines 448-584 of main.cpp with any multiplication logic removed. The texture format has remained basically unchanged for a while now.

I got some good news for you I know the full texture format struct texHeader { uint format; uint width; uint height; uint mipLevels; uint mipOffsets[4]; uchar data[]; };

meh2481 commented 2 years ago

Yes, that's... almost exactly what I have in main.cpp too.

I'm closing this issue now as there doesn't seem to be anything relevant you're requesting me to do.