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

[pygame] coming breaking rect changes



there's a couple of changes coming for the way a few functions
handle the Rect objects. namely Surface.fill() and display.update().
These two functions are changing the values inside of any Rect
arguments passed in.

i've found this a problem, since i'm passing a Rect for my
sprite to the fill function and suddenly my Rect dimensions
have been changed.

the problem is SDL functions are clipping the rects.

the Surface.blit() function was like this early on, but i
changed it to only return a new Rect with the final results.
i thought Surface.fill() was changed also, but it changing
the input Rect and returning the new results. The
display.update() is also clipping rectangles if needed and
this is also changing any Rects passed in.

i'm changing the Surface.fill() and display.update() functions
to not change the values inside and Rects passed in. i can't
imagine anyone has code out there that is relying on this, so
there shouldn't be any repercussions?

anyways, the whole reason this is even visible to us on the
python side is that the Rect objects store their internal
data the same format as SDL's SDL_Rect objects. this makes
the conversion between them really cheap.

in summary. Surface.fill() is being changed so it works the
same as Surface.blit(). display.update() is being changed so
it doesn't effect any of the inputs (which it shouldn't have
done anyways)


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