Skip to content

mvr2s does incorrect rounding of negative numbers

It seems the rounding in mvr2s, used for output conversion to 16 bit integers, it rounding incorrectly for negative numbers. It should consider the sign of the value when adding 0.5f.

It looks like this:

temp = (float) floor( temp + 0.5f );

Should it not be this?

temp = (float) floor( temp + sign(temp)*0.5f );

It may explain some differences between e.g. the external renderer and the TD standalone renderer which does the rounding differently.