Skip to content
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

Port last SDL_CreateRGBSurface calls to SDL3-safe PG_CreateSurface #2501

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

Starbuck5
Copy link
Member

@Starbuck5 Starbuck5 commented Oct 5, 2023

The surface_init one could be refactored to push the mask->pixelformat conversion to only when it's actually parsing out masks from the user, and have the format live as a pixelformat most of the time. But that would be a more complex and risky diff than this one, so lets stay the course for now.

I removed _raise_create_surface_error because it's no longer useful. It caught a case emitted internally by SDL_CreateRGBSurface when it converts masks to pixelformat, now that we do that ourselves we can directly set ValueError there. As for it's use in subsurface, the format will never be invalid there because it comes from already initialized surfaces-- therefore there's no point with a possible ValueError about masks.

@Starbuck5 Starbuck5 requested a review from a team as a code owner October 5, 2023 05:30
@Starbuck5 Starbuck5 added the sdl3 label Oct 5, 2023
@Starbuck5 Starbuck5 added the Surface pygame.Surface label Oct 5, 2023
Copy link
Member

@ankith26 ankith26 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the PR 🎉

@ankith26 ankith26 added this to the 2.4.0 milestone Oct 5, 2023
Copy link
Member

@MyreMylar MyreMylar left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@MyreMylar MyreMylar merged commit 1e1ac59 into pygame-community:main Oct 5, 2023
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sdl3 Surface pygame.Surface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants