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

Re: [pygame] SDL vs. Pygame: Alpha Differences



Hi,

maybe I could put in a new blit mode for you before this release... if
it can't be done already.

Can you describe what you want?  I'm still not clear on it.

Do you want this?
DR, DG, DB, DA = SR, SG, SB, DA


On 12/24/06, Kamilche <kamilche@xxxxxxxxxxxx> wrote:
Brian Fisher wrote:
> On 12/23/06, Kamilche <kamilche@xxxxxxxxxxxx> wrote:
>>
> ... I dug up the thing you posted before (where you move the mouse
> around) and modified it to use that thing as the 3rd method (when you
> are in the lower third of the screen) and it seems to work.
>

Thanks for modifying that example. I see this is a variant on the other
technique that was posted, but involves a couple more blits to preserve
the alpha. I was trying to avoid all these extra blits to preserve the
alpha, as it slows down nighttime by quite a lot.

I was hoping the new blit flags on Pygame 1.8 would help me here -
that's why I was eager to try it out! But my initial testing came up
with the same results - all those extra blits to not overwrite the
destination alpha.

Basically - I would dearly love a single blit from one picture to
another, to NOT modify the destination alpha, without require extra
blits or manipulation, but I guess that's not available.

The speed hit on preserving that alpha is significant enough, I believe
I will just have to let the nighttime modify the entire background,
instead of only the landscaping.

I did think of one technique not mentioned tho! One of my variants
blitted the night to the entire screen, then used Numeric to strip out
the pixels where it was equal to the nighttime color. Boy, that one was
slower than my existing method!

--Kamilche