8000 Change opaque surface test to use SDL_ISPIXELFORMAT_ALPHA() macro by MyreMylar · Pull Request #2269 · pygame/pygame · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Change opaque surface test to use SDL_ISPIXELFORMAT_ALPHA() macro #2269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 30, 2020

Conversation

MyreMylar
Copy link
Contributor

This is because if a destination surface has no pixel alpha and surface alpha is set on it it's blend mode will no longer be SDL_BLENDMODE_NONE.

However, we still want to treat it as an opaque destination surface from the blitter's perspective because it will have 0 pixel alpha and we can't use the optimised 'no surface alpha' blitter which assumes two surfaces with pixel alpha to do it's thing.

This fixes the menu bug in FlyBoy.

MyreMylar added 3 commits October 28, 2020 19:43
This is because if a destination surface has no pixel alpha and surface
alpha is set on it it's blend mode will no longer be SDL_BLENDMODE_NONE.
However, we still want to treat it as an opaque surface because it will
have 0 pixel alpha and we can't use the optimised 'no surface alpha'
blitter which assumes two surfaces with pixel alpha.
Fails prior to this PR, passes afterwards.
Previously they were sent to SDL 2 but I think it's more proper
just to do them more slowly with our alpha blitter. Shouldn't
effect many blits anyway as self blits are rare. I previously
excluded them just because the crash the SSE 2 versions which
wasn't a good reason.
Copy link
Member
@illume illume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@illume illume merged commit 0e0c686 into main Oct 30, 2020
@illume illume deleted the blitter-bug-fix branch October 30, 2020 19:40
@illume illume added the Surface pygame.Surface label Aug 21, 2021
@illume illume added this to the 2.0.1 milestone Aug 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Surface pygame.Surface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0