Original Post
Is anyone intimately familiar with DX texture compression? I need to know exactly how they bytes in the image are arranged as I want to be able to flip an image once I have loaded it into memory. I am manually loading an image from a DDS file (stored in DXT1 format) and I attemp to flip the image like so:
linesize = size/height;
char *line = (char *)malloc(linesize);
char *top = image;
char *bottom = image + (linesize*(height-1));
for (int i = 0; i < (height >> 1)-1; i++)
{
memcpy(line, top, linesize);
memcpy(top, bottom, linesize);
memcpy(bottom, line, linesize);
top += linesize;
bottom -= linesize;
}
delete [] line;
Where size is the number of bytes in that specifc image (which is separate from its mipmaps).
This produces a rather bizarre images, where it looks like four vertical "stripes" of the image (as if the image was divided into 4 equal sized chunks) are ordered wrong.
Anyone know where I can get some good technical documents on the S3TC/DXTC format? Google points me to some nonexistant S3.com websites and the DXTC documentation in MSDN is fairly sparse.
Thanks,
Jason A.
---
I write code.
DelphiGL (http://delphigl.cfxweb.net)