@@ -1497,8 +1497,6 @@ surf_set_alpha(pgSurfaceObject *self, PyObject *args)
1497
1497
PyObject * alpha_obj = NULL , * intobj = NULL ;
1498
1498
Uint8 alpha ;
1499
1499
int result , alphaval = 255 ;
1500
- SDL_Rect sdlrect ;
1501
- SDL_Surface * surface ;
1502
1500
1503
1501
if (!PyArg_ParseTuple (args , "|Oi" , & alpha_obj , & flags )) {
1504
1502
return NULL ;
@@ -1548,24 +1546,24 @@ surf_set_alpha(pgSurfaceObject *self, PyObject *args)
1548
1546
SDL_SetSurfaceRLE (surf , (flags & PGS_RLEACCEL ) ? SDL_TRUE : SDL_FALSE );
1549
1547
1550
1548
/* HACK HACK HACK */
1551
- #if SDL_VERSION_ATLEAST (3 , 0 , 0 )
1552
- if (SDL_SurfaceHasRLE (surf ) && (!(flags & PGS_RLEACCEL )))
1553
- #else
1554
- if ((surf -> flags & SDL_RLEACCEL ) && (!(flags & PGS_RLEACCEL )))
1555
- #endif
1556
- {
1549
+ // TODO: SDL3: figure out how to port this or if it's relevant to SDL3.
1550
+ #if !SDL_VERSION_ATLEAST (3 , 0 , 0 )
1551
+ if ((surf -> flags & SDL_RLEACCEL ) && (!(flags & PGS_RLEACCEL ))) {
1557
1552
/* hack to strip SDL_RLEACCEL flag off surface immediately when
1558
1553
it is not requested */
1554
+ SDL_Rect sdlrect ;
1559
1555
sdlrect .x = 0 ;
1560
1556
sdlrect .y = 0 ;
1561
1557
sdlrect .h = 0 ;
1562
1558
sdlrect .w = 0 ;
1563
1559
1564
- surface = PG_CreateSurface (1 , 1 , PG_SURF_FORMATENUM (surf ));
1560
+ SDL_Surface * surface =
1561
+ PG_CreateSurface (1 , 1 , PG_SURF_FORMATENUM (surf ));
1565
1562
1566
1563
SDL_LowerBlit (surf , & sdlrect , surface , & sdlrect );
1567
1564
SDL_FreeSurface (surface );
1568
1565
}
1566
+ #endif
1569
1567
/* HACK HACK HACK */
1570
1568
if (result == 0 ) {
1571
1569
result = !PG_SetSurfaceAlphaMod (surf , alpha );
0 commit comments