Follow-up Comment #3, bug #10709 (project wormux):
I think the correct solution would be to:
- correct Sprite::GetSizeMax (and therefore GetHeight and GetWidth)
- do proper rounding there. For instance, instead of:
return static_cast<uint>(frame_height_pix * (scale_y>0?scale_y:-scale_y));
have:
return static_cast<uint>(fabsf(frame_height_pix*scale_y)+0.5f);
(hoping nobody screws rounding mode in our back, but we are not that low
level).
On most architectures, floats' MSB is for sign, so getting absolute value is
just a matter of bitmasking. And (scale_y>0?scale_y:-scale_y) is code
pessimization instead of optimization.
_______________________________________________________
Reply to this item at:
<http://gna.org/bugs/?10709>
_______________________________________________
Message posté via/par Gna!
http://gna.org/
_______________________________________________
Wormux-gna mailing list
[email protected]
https://mail.gna.org/listinfo/wormux-gna