Skip to content

Commit

Permalink
Base SDL3: shrink diff a bit more
Browse files Browse the repository at this point in the history
  • Loading branch information
Starbuck5 committed Nov 2, 2024
1 parent 9acf2ef commit 42940ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
6 changes: 2 additions & 4 deletions src_c/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -2080,15 +2080,13 @@ PG_PixelFormatEnum pg_default_convert_format = 0;
static PG_PixelFormatEnum
pg_GetDefaultConvertFormat(void)
{
#if SDL_VERSION_ATLEAST(3, 0, 0)
if (pg_default_screen) {
#if SDL_VERSION_ATLEAST(3, 0, 0)
return pg_default_screen->surf->format;
}
#else
if (pg_default_screen) {
return pg_default_screen->surf->format->format;
}
#endif
}
return pg_default_convert_format;
}

Expand Down
9 changes: 1 addition & 8 deletions src_c/surface.c
Original file line number Diff line number Diff line change
Expand Up @@ -1589,11 +1589,7 @@ pg_DisplayFormat(SDL_Surface *surface)
" or Window.get_surface().");
return NULL;
}
#if SDL_VERSION_ATLEAST(3, 0, 0)
return SDL_ConvertSurface(surface, default_format);
#else
return SDL_ConvertSurfaceFormat(surface, default_format, 0);
#endif
return PG_ConvertSurfaceFormat(surface, default_format);
}

static SDL_Surface *
Expand All @@ -1616,9 +1612,6 @@ pg_DisplayFormatAlpha(SDL_Surface *surface)
#endif
case SDL_PIXELFORMAT_ABGR1555:
case SDL_PIXELFORMAT_BGR565:
pfe = SDL_PIXELFORMAT_ABGR8888;
break;

case PG_PIXELFORMAT_XBGR8888:
case SDL_PIXELFORMAT_ABGR8888:
pfe = SDL_PIXELFORMAT_ABGR8888;
Expand Down

0 comments on commit 42940ba

Please sign in to comment.