@@ -3822,7 +3822,6 @@ pgSurface_Blit(pgSurfaceObject *dstobj, pgSurfaceObject *srcobj,
3822
3822
int result , suboffsetx = 0 , suboffsety = 0 ;
3823
3823
SDL_Rect orig_clip , sub_clip ;
3824
3824
Uint8 alpha ;
3825
- Uint32 key ;
3826
3825
3827
3826
/* passthrough blits to the real surface */
3828
3827
if (((pgSurfaceObject * )dstobj )-> subsurface ) {
@@ -3860,7 +3859,7 @@ pgSurface_Blit(pgSurfaceObject *dstobj, pgSurfaceObject *srcobj,
3860
3859
pgSurface_Prep (srcobj );
3861
3860
3862
3861
if ((blend_flags != 0 && blend_flags != PYGAME_BLEND_ALPHA_SDL2 ) ||
3863
- ((SDL_GetColorKey (src , & key ) == 0 || _PgSurface_SrcAlpha (src ) == 1 ) &&
3862
+ ((SDL_HasColorKey (src ) || _PgSurface_SrcAlpha (src ) == 1 ) &&
3864
3863
/* This simplification is possible because a source subsurface
3865
3864
is converted to its owner with a clip rect and a dst
3866
3865
subsurface cannot be blitted to its owner because the
@@ -3916,8 +3915,7 @@ pgSurface_Blit(pgSurfaceObject *dstobj, pgSurfaceObject *srcobj,
3916
3915
/* Py_END_ALLOW_THREADS */
3917
3916
}
3918
3917
else if (blend_flags != PYGAME_BLEND_ALPHA_SDL2 &&
3919
- !(pg_EnvShouldBlendAlphaSDL2 ()) & &
3920
- SDL_GetColorKey (src , & key ) != 0 &&
3918
+ !(pg_EnvShouldBlendAlphaSDL2 ()) && !SDL_HasColorKey (src ) &&
3921
3919
(PG_SURF_BytesPerPixel (dst ) == 4 ||
3922
3920
PG_SURF_BytesPerPixel (dst ) == 2 ) &&
3923
3921
_PgSurface_SrcAlpha (src ) &&
0 commit comments