@@ -1544,7 +1544,7 @@ surf_set_alpha(pgSurfaceObject *self, PyObject *args)
1544
1544
bool success =
1545
1545
PG_SetSurfaceRLE (surf , (flags & PGS_RLEACCEL ) ? SDL_TRUE : SDL_FALSE );
1546
1546
/* HACK HACK HACK */
1547
- // TODO: SDL3: figure out how to port this or if it's relevant to SDL3.
1547
+ // TODO SDL3: figure out how to port this or if it's relevant to SDL3.
1548
1548
#if !SDL_VERSION_ATLEAST (3 , 0 , 0 )
1549
1549
if ((surf -> flags & SDL_RLEACCEL ) && (!(flags & PGS_RLEACCEL ))) {
1550
1550
/* hack to strip SDL_RLEACCEL flag off surface immediately when
@@ -3019,6 +3019,8 @@ surf_get_flags(PyObject *self, PyObject *_null)
3019
3019
if (PG_SurfaceHasRLE (surf )) {
3020
3020
flags |= PGS_RLEACCELOK ;
3021
3021
}
3022
+ // TODO SDL3: figure out how to properly emulate SDL2 check/relevance
3023
+ // Current implementation is just a placeholder.
3022
3024
#if SDL_VERSION_ATLEAST (3 , 0 , 0 )
3023
3025
if (SDL_SurfaceHasRLE (surf )) {
3024
3026
flags |= PGS_RLEACCEL ;
@@ -4379,8 +4381,8 @@ surf_get_pixels_address(PyObject *self, PyObject *closure)
4379
4381
}
4380
4382
4381
4383
static int
4382
- surface_do_overlap (SDL_Surface * src , SDL_Rect * srcrect , SDL_Rect * srcclip ,
4383
- SDL_Surface * dst , SDL_Rect * dstrect )
4384
+ surface_do_overlap (SDL_Surface * src , SDL_Rect * srcrect , SDL_Surface * dst ,
4385
+ SDL_Rect * dstrect , SDL_Rect * clip )
4384
4386
{
4385
4387
Uint8 * srcpixels ;
4386
4388
Uint8 * dstpixels ;
@@ -4414,23 +4416,23 @@ surface_do_overlap(SDL_Surface *src, SDL_Rect *srcrect, SDL_Rect *srcclip,
4414
4416
}
4415
4417
4416
4418
/* clip the destination rectangle against the clip rectangle */
4417
- x = srcclip -> x - dstx ;
4419
+ x = clip -> x - dstx ;
4418
4420
if (x > 0 ) {
4419
4421
w -= x ;
4420
4422
dstx += x ;
4421
4423
srcx += x ;
4422
4424
}
4423
- x = dstx + w - srcclip -> x - srcclip -> w ;
4425
+ x = dstx + w - clip -> x - clip -> w ;
4424
4426
if (x > 0 ) {
4425
4427
w -= x ;
4426
4428
}
4427
- y = srcclip -> y - dsty ;
4429
+ y = clip -> y - dsty ;
4428
4430
if (y > 0 ) {
4429
4431
h -= y ;
4430
4432
dsty += y ;
4431
4433
srcy += y ;
4432
4434
}
4433
- y = dsty + h - srcclip -> y - srcclip -> h ;
4435
+ y = dsty + h - clip -> y - clip -> h ;
4434
4436
if (y > 0 ) {
4435
4437
h -= y ;
4436
4438
}
@@ -4468,12 +4470,12 @@ pgSurface_Blit(pgSurfaceObject *dstobj, pgSurfaceObject *srcobj,
4468
4470
SDL_Surface * dst = pgSurface_AsSurface (dstobj );
4469
4471
SDL_Surface * subsurface = NULL ;
4470
4472
int result , suboffsetx = 0 , suboffsety = 0 ;
4471
- SDL_Rect orig_clip , sub_clip , srcclip ;
4473
+ SDL_Rect orig_clip , sub_clip , dstclip ;
4472
4474
#if !SDL_VERSION_ATLEAST (3 , 0 , 0 )
4473
4475
Uint8 alpha ;
4474
4476
#endif
4475
4477
4476
- if (!PG_GetSurfaceClipRect (src , & srcclip )) {
4478
+ if (!PG_GetSurfaceClipRect (dst , & dstclip )) {
4477
4479
PyErr_SetString (pgExc_SDLError , SDL_GetError ());
4478
4480
return 0 ;
4479
4481
}
@@ -4521,7 +4523,7 @@ pgSurface_Blit(pgSurfaceObject *dstobj, pgSurfaceObject *srcobj,
4521
4523
owner is locked.
4522
4524
*/
4523
4525
dst -> pixels == src -> pixels && srcrect != NULL &&
4524
- surface_do_overlap (src , srcrect , & srcclip , dst , dstrect ))) {
4526
+ surface_do_overlap (src , srcrect , dst , dstrect , & dstclip ))) {
4525
4527
/* Py_BEGIN_ALLOW_THREADS */
4526
4528
result = pygame_Blit (src , srcrect , dst , dstrect , blend_flags );
4527
4529
/* Py_END_ALLOW_THREADS */
0 commit comments