Voir la version compl鋈e : [無ibrary][Aide] Another problem with rotation
I think that the function ulImageSetRotCenter does not work if the image size is odd (i.e. not even). Right now it computes the center as (start + end)/2, but it should compute is as (start + end + 1)/2. Also, the ulLoadImageFilePNG() function crashes if one attempts to put the image into VRAM and there is no space. The other functions, such as the gif ones, will return with an error.
Robert
Thanks for the VRAM allocation thing, I'll check it.
About the rotcenter, I don't know really. You don't have a *good* reason to decide wether it's the right or left pixel that is to be taken in this case. I've decided it's the one to the left (because it's easier), but it's up to you to write your own macro if you want the other solution ;)
I did more testing with both odd and even sized images and using rotation and stretch and found the following:
For odd sized images, no stretch: images appear to wobble the same (small wobble, maybe one pixel) regardless adding 1 to centerX/Y.
For odd sized images, with stretch making image smaller: image does not wobble if you add 1 to center X/Y, but wobbles a lot of you do not add 1 (this was my original condition).
For even sized images, no stretch: image does not wobble if you do not add 1 and does wobble if you add 1 (expected result).
For even sized images with stretch making image smaller: adding 1 does not cause wobbling, but in these cases the edge of the image is sometimes distorted.
So adding 1 in the case of odd images seems to be the best thing to do.
I don't know how the hardware/software works, but generally odd sized images rotate around a actual pixel, while even sized images rotate in the space between two pixels. It looks like the hardware/software on the DS understands this to some degree, but not completely. I do not understand why an unstretched odd size image would wobble.
If anyone is interested I have some test code that shows these issues.
vBulletin® v.3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd. Tous droits r廥erv廥 - Version fran蓷ise vbulletin-fr.org