-
-
Notifications
You must be signed in to change notification settings - Fork 185
A few surface.c SDL3 fixes #3344
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
A few surface.c SDL3 fixes #3344
Conversation
if (!PG_GetSurfaceClipRect(surf, &clip_rect)) { | ||
return RAISE(pgExc_SDLError, SDL_GetError()); | ||
} | ||
|
||
SDL_Rect surf_rect = {0, 0, surf->w, surf->h}; | ||
|
||
// In SDL3, SDL_IntersectRect is renamed to SDL_GetRectIntersection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following this comment, should branching be made to use the correct name? should a macro be made? There are roughly 6 usages of this function in the codebase, in pygame._sdl2 aswell.
I guess you didn't change it here because it is out of scope from surface-only related fixes, do you plan on fixing it in another PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably covered by SDL_ENABLE_OLD_NAMES
already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is covered by old names, yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, and my comment is just for info. Thanks :)
There was a problem hiding this 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 🥳
This PR is more low hanging fruit towards porting surface.c to SDL3.
The remaining complex things in this file are
I have patches staged that get those items to compile as well, but they are more complex or provisional (in the case of RLEACCEL). So I will open them in future PRs.