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

Re: [pygame] Bliting clip semantics



Arguably, the best solution for laaarge numbers of sprites is to use
some kind of space partitioning scheme to keep the checking code fast
and also not force sdl to try to render everything either.  Once you
get to this level of optimization, things can get a little hard to
deal with.

In the original case, checking before blitting is probably overkill,
and slower to boot.

On Wed, Feb 18, 2009 at 4:52 PM, Zack Schilling
<zack.schilling@xxxxxxxxx> wrote:
> I found that for a large number (100+) of small sprites, blitting everything
> and letting the blit function figure out if things are onscreen is much
> faster than coding up checks in python, especially if the checks go down to
> the pixel level for sprites partially offscreen.
>
> -Zack
>
>
> On Feb 17, 2009, at 10:49 PM, Hugo Arts wrote:
>
>> you can blit something that is not on the screen or even half on the
>> screen without problems. It will work as expected
>>
>> On Tue, Feb 17, 2009 at 8:55 AM, Daniel Mateos <daniel@xxxxxxxxx> wrote:
>>>
>>> Hey All,
>>>
>>> I was just wondering if i can count on Surface.blit dealing with stuff i
>>> pass it that has co-ords greater than its drawable area like say i pass
>>> a rect of [200, 195, 10, 10] to a surface of size [200, 200].
>>>
>>> I ask because i notice it is working right now as expected with a
>>> function i use that only roughly checks if something is on the screen or
>>> not before it is blited and im not sure if i should bother to make it
>>> more accurate.
>>>
>>> Daniel
>>>
>
>