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

[pygame] Heh, I should have listened to Pete



Well, after looking at aliens.py and relooking at the sForzando drawing 
functions, the answer came to me in the shower.  Pete is right; sForzando, 
does redraw the whole scene each frame; just not the way I thought it did and 
not in a way I thought would be bad.

Here's the way it works (in beta-0.1):
Each CCNode keeps an internal "cache" surface which contains a picture of all 
its child Nodes.  Things on the cache are only redrawn when they need to be 
(i.e. when they move).  This works, and keeps redrawing WITHIN THE CCNODE to 
a minimum.

But... when CCNodes draw themselves onto an external surface, they simply 
blit their own surface, along with the cache.  This means that in fact, they 
ARE redrawing the whole scene, every frame; just with one big blit as opposed 
to many small blits.

I feel dumb.

The good news is, we already have most of the framework in place to support a 
REAL dirty rectangle system, and I should be able to add one in with not too 
much effort.  Expect a bugfix-release either today or tomorrow.

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