@@ -640,7 +640,11 @@ surface_init(pgSurfaceObject *self, PyObject *args, PyObject *kwds)
640640 pix = pgSurface_AsSurface (pg_GetDefaultWindowSurface ())-> format ;
641641 else {
642642 pix = & default_format ;
643+ #if SDL_VERSION_ATLEAST (3 , 0 , 0 )
644+ pix -> bits_per_pixel = 32 ;
645+ #else
643646 pix -> BitsPerPixel = 32 ;
647+ #endif
644648 pix -> Amask = 0 ;
645649 pix -> Rmask = 0xFF0000 ;
646650 pix -> Gmask = 0xFF00 ;
@@ -1534,9 +1538,14 @@ surf_convert(pgSurfaceObject *self, PyObject *args)
15341538 PyExc_ValueError ,
15351539 "invalid argument specifying new format to convert to" );
15361540 }
1541+ #if SDL_VERSION_ATLEAST (3 , 0 , 0 )
1542+ format .bits_per_pixel = (Uint8 )bpp ;
1543+ format .bytes_per_pixel = (bpp + 7 ) / 8 ;
1544+ #else
15371545 format .BitsPerPixel = (Uint8 )bpp ;
15381546 format .BytesPerPixel = (bpp + 7 ) / 8 ;
1539- if (format .BitsPerPixel > 8 )
1547+ #endif
1548+ if (PG_FORMAT_BitsPerPixel ((& format )) > 8 )
15401549 /* Allow a 8 bit source surface with an empty palette to be
15411550 * converted to a format without a palette (pygame-ce issue
15421551 * #146). If the target format has a non-NULL palette pointer
@@ -1545,8 +1554,8 @@ surf_convert(pgSurfaceObject *self, PyObject *args)
15451554 */
15461555 format .palette = NULL ;
15471556 if (SDL_ISPIXELFORMAT_INDEXED (SDL_MasksToPixelFormatEnum (
1548- format . BitsPerPixel , format .Rmask , format . Gmask ,
1549- format .Bmask , format .Amask ))) {
1557+ PG_FORMAT_BitsPerPixel (( & format )) , format .Rmask ,
1558+ format .Gmask , format . Bmask , format .Amask ))) {
15501559 if (SDL_ISPIXELFORMAT_INDEXED (surf -> format -> format )) {
15511560 SDL_SetPixelFormatPalette (& format , surf -> format -> palette );
15521561 }
@@ -2434,8 +2443,7 @@ surf_get_flags(PyObject *self, PyObject *_null)
24342443 if ((sdl_flags & SDL_RLEACCEL ))
24352444 flags |= PGS_RLEACCEL ;
24362445 if (is_window_surf ) {
2437- if (window_flags & SDL_WINDOW_FULLSCREEN_DESKTOP ||
2438- window_flags & SDL_WINDOW_FULLSCREEN )
2446+ if (window_flags & PG_WINDOW_FULLSCREEN_INCLUSIVE )
24392447 flags |= PGS_FULLSCREEN ;
24402448 if (window_flags & SDL_WINDOW_OPENGL )
24412449 flags |= PGS_OPENGL ;
0 commit comments