Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //int blockWidth = width / blockSizeX; // width of image in blocks
- //int blockHeight = height / blockSizeY; // height of image in blocks
- int blockWidth = (width + (blockSizeX - 1)) / blockSizeX; // width of image in blocks
- int blockHeight = (height + (blockSizeY - 1)) / (blockSizeY - 1); // height of image in blocks
- // Term "GOB" means "group of bytes". bytes_per_gob_y affects only gobOffset value.
- int gobs_per_block_x = (blockWidth * bytesPerBlock + 63) / 64;
- int bytes_per_gob_x = 64;
- int multi = height / width;
- int bytes_per_gob_y = 8 * multi;
- /*if (blockSizeX == 1 && blockSizeY == 1)
- {
- // Uncompressed tiled texture
- bytes_per_gob_y = 16;
- if (blockHeight < 128) bytes_per_gob_y = 8;
- //?? didn't find when to switch to value 8 (but it seems code works well anyway)
- }*/
- int gob_bytes = bytes_per_gob_x * bytes_per_gob_y; // usually has value 512
- // Smaller textures has different memory layout
- /*if (blockHeight < 64) bytes_per_gob_y = 4;
- if (blockHeight < 32) bytes_per_gob_y = 2;
- if (blockHeight < 16) bytes_per_gob_y = 1;*/
- // Smaller textures has different memory layout
- if (blockHeight < 48) bytes_per_gob_y = 4;
- if (blockHeight < 24) bytes_per_gob_y = 2;
- if (blockHeight < 16) bytes_per_gob_y = 1;
- ////////......////////
- if (swzAddr >= dataSize)
- return true;
Advertisement
Add Comment
Please, Sign In to add comment