It seems that this tool needs to be adjusted to 16x. Or unrelated headers?
View attachment 242040
Ok. So it seems those are defined dimensions, but because of swizzling this example is not possible to work, so real dimensions are slightly higher to match some factor that must be (x is integer)
=2^x, x>=4
(so it can be 16, 32, 64, etc)
So if defined width is 2211, then it's either 2224 (2211/16 = 138,**, so 16*139=2224) or 2240 (for 32 and 64)
It can be easily checked by comparing sizes of outputted dds by rawtex and tex file. Just delete headers in both files and if dimensions are correct, then sizes must be identical.
So correct c++ function would be:
Code:
int factor = 16
int defined_dimrnsion = 2211
int real_dimension = factor*((int)ceil(defined_dimension/factor))
ceil (from ceiling) in c++ always rounds higher while "round" does not
