[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pygame] transform fixes



i was able to get some fixes for the recently popular, 
pygame.transform.rotate() function. first, an easy one. if the image 
being rotated had pixel alphas, the rotate should have been setting the 
alpha to black in the 'newly exposed" areas. it is now properly doing this.

the other more difficult problem with the rotation is it is getting 
pixels "off-by-one" in many cases. well the good news is i was able to 
fix most of the problem (woohoo!). it actually is a lot better now than 
it used to be, but it still isn't 100% accurate. you can still find it 
off by a little bit in some of the rotations, but much better than it 
was before.

any further improvements to fix the transform.rotate will probably not 
be coming from me. the code is at the limit of this poor pygame 
maintainers understanding. fortunately, if there's anyone out there with 
a nack for this sort of programming, it is fairly easy to follow, take a 
peek at the cvs code (rotation is the second function in the file).
http://pygame.org/cgi-bin/cvsweb-1.80.cgi/games/pygame/src/transform.c?rev=1.15&content-type=text/x-cvsweb-markup

as for the rotozoom function, unfortunately this is quite the beast. it 
sounds promising that the maintainer of the SDL_rotozoom library will 
try to fix the code. when that happens i'll update pygame's rotozoom to 
match. i've already made some small fixes to the rotozoom code, but for 
the most part it comes 'as-is'. i'd sure like it to be working better 
though!

i just doublechecked with the transform.flip functions, and they are 
indeed working the way i expect them to. flip(img, 1, 0) flips the image 
left-to-right on the x-axis. and flip(img, 0, 1) flips the image 
top-to-bottom on the y-axis.

i also went through the documentation and cleaned up the errors and 
ambiguities recently spotted :]

everyone feel free to let me know if this covers everything, or if there 
are still issues that need to be looked at.


____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org