Ian wrote:One for harry .. since I don't have a great deal of understanding in exactly how this code works.
Thanks Ian, gonna double check again that case.
Yes, it's an endian swap. The XOR was used in the original code for both 8 and 16 bit textures. But when I swapped the numbers directly in the decode array (8x8) I removed the XOR for 16 bit textures.
However, for some reason, I had to keep it for 8 bit textures. So I tried to just replicate the same logic used for 16 bit ones while being cautious for out of bound array index. Evidently something slipped off (these "distraction" errors keep on haunting me)...
Ian wrote:I am guessing the code maybe should be something like this?
Yeah that should be correct code wise. Or if you want to be verbose and maintain indentation:
- Code: Select all
byte1 = texData[decode8x1[(yy^1) * tileX + ((xx + 1)^1)] / 2] >> 8;
byte2 = texData[decode8x1[(yy^1) * tileX + ((xx + 1)^1)] / 2] & 0xFF;
I'm going to check the visual results and keep you informed.
P.S.
Hey Ian, what's that AMD program you used to check the single texture mips?