[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Pygame alpha blits and self blitting



Haha - it's funny you bring this up Lenard. I was one of the advocates of raising an exception, and the reason I felt that way was because it was crashing in windows but not other platforms, and I felt that in the interest of being a good cross-platform library pygame should restrict users from doing operations that won't work on one of the platforms on the other platforms.

...but then after some detective work, you figured out the cause of the crash was actually the gcc compiler on i386 architectures had changed behavior to not clear the direction flag for inline assembly. The fix for that is in SVN SDL, and now you build your prebuilts off of SVN SDL to include that fix, right?

My point is, the reason why I advocated raising an exception are gone (i.e. the windows crashing is fixed), so I personally think that should be off the table.

I'd say making the blit work as expected with a special case would be great.

However I also am in favor of an explicit scroll routine (on the surface probably?) - largely because blitting a surface to itself with colorkey (or alpha for that matter) would definitely be the wrong way to scroll the surface and an explicit scroll would not be succeptible to accidentally having such features on, not to mention being more readable.

On Fri, Feb 13, 2009 at 1:14 PM, Lenard Lindstrom <len-l@xxxxxxxxx> wrote:
Hi everyone,

While checking out Mozilla bug 19 (*) I found that blitting a surface with colorkey to itself causes repetition of the source image. I have attached an example. This is a known problem with copy algorithms. SDL blits have special code to handle it. Pygame's blits do not. The concerns over self blits were discussed in the bug 19 related thread (**), but I could find no conclusion as to whether to support it or raise an exception and provide explicit scroll routines instead. Pygame has many special case blit loops to be considered.

Lenard

(*) http://pygame.motherhamster.org/bugzilla/show_bug.cgi?id=19
(**) http://thread.gmane.org/gmane.comp.python.pygame/15390/focus=15407

--
Lenard Lindstrom
<len-l@xxxxxxxxx>