Not Posting Means Something Something...
by shinali
Just means I've been busy. I've figured out how XNB files are structured. Thankfully the aforementioned person that extracted LA Noire files help me by giving his source code (I've asked for an alias/name so I can properly credit him). It turns out it does use the LZX algorithm with some presets, save that blocks are preceded by a short that represents their size (as another that can also repre...
Just means I've been busy.
I've figured out how XNB files are structured. Thankfully the aforementioned person that extracted LA Noire files help me by giving his source code (I've asked for an alias/name so I can properly credit him). It turns out it does use the LZX algorithm with some presets, save that blocks are preceded by a short that represents their size (as another that can also represent both block size and output frame size). I've been using it as a reference implementation as I write it in C#, and got to the point where we were writing the same exact output... for one file.
I've tried to put in my decoding algorithm into MonoXNA but it wasn't decoding Bastion's textures right at all. I've extracted it from the package and ran it through the C++ reference implementation of the decoder, which seemed to spit out a correct decompressed XNB. I ran it through my C# implementation and out came a mess. It's not as bad as it sounds, at least I know the reference implementation is working.
I have to admit, I'd have a much better time writing the decoder in C++. Not just because I can copy the code over, but once you get the hang of memory management and use pointers/super memory tricks constantly for the past four years, anything that takes that away feels like you're handicapped. Not saying this is a bad thing, there are needs for languages that can produce safe code.
I'll be debugging it soon. It's the worst thing when you have two separate IDEs and you're constantly look back and forth between them to see if variables remain the same. It doesn't help that I don't have a complete grasp of the LZX algorithm. Perhaps it'll help when I get on my Windows machine and use Visual Studio again.