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

Replace old hack with SDL_HasSurfaceRLE #2920

Closed
Starbuck5 opened this issue Jun 11, 2024 · 1 comment · Fixed by #2922
Closed

Replace old hack with SDL_HasSurfaceRLE #2920

Starbuck5 opened this issue Jun 11, 2024 · 1 comment · Fixed by #2922
Labels
Code quality/robustness Code quality and resilience to changes Surface pygame.Surface

Comments

@Starbuck5
Copy link
Member

In surface.c we have the function pg_HasSurfaceRLE, which accesses SDL internals my mimicking one of their structs, to get access to whether the surface has RLE or not.

SDL 2.0.14 had a new function SDL_HasSurfaceRLE that seems to do the same thing, but with less code on our end. This will be necessary for SDL3 support, as the internal structures are even more hidden in SDL3.

Wrinkle is that we still support down to SDL 2.0.10.

Possible path: use the old code if below 2.0.14, use the new code if at or above 2.0.14 (including SDL3)

@Starbuck5 Starbuck5 added Code quality/robustness Code quality and resilience to changes Surface pygame.Surface labels Jun 11, 2024
@Starbuck5
Copy link
Member Author

Wow, igordsm actually set this up already in the form of PG_SurfaceHasRLE in #2491

@Starbuck5 Starbuck5 linked a pull request Jun 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code quality/robustness Code quality and resilience to changes Surface pygame.Surface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant