@@ -1562,11 +1562,11 @@ surf_set_alpha(pgSurfaceObject *self, PyObject *args)
15621562 }
15631563 /* HACK HACK HACK */
15641564 if (result == 0 ) {
1565- result = SDL_SetSurfaceAlphaMod (surf , alpha );
1565+ result = ! PG_SetSurfaceAlphaMod (surf , alpha );
15661566 }
15671567 pgSurface_Unprep (self );
15681568
1569- if (result == -1 ) {
1569+ if (result != 0 ) {
15701570 return RAISE (pgExc_SDLError , SDL_GetError ());
15711571 }
15721572
@@ -1590,7 +1590,7 @@ surf_get_alpha(pgSurfaceObject *self, PyObject *_null)
15901590 Py_RETURN_NONE ;
15911591 }
15921592
1593- if (SDL_GetSurfaceAlphaMod (surf , & alpha ) != 0 ) {
1593+ if (! PG_GetSurfaceAlphaMod (surf , & alpha )) {
15941594 return RAISE (pgExc_SDLError , SDL_GetError ());
15951595 }
15961596
@@ -3245,13 +3245,13 @@ surf_subsurface(PyObject *self, PyObject *args)
32453245 }
32463246 SDL_FreePalette (pal );
32473247 }
3248- if (SDL_GetSurfaceAlphaMod (surf , & alpha ) != 0 ) {
3248+ if (! PG_GetSurfaceAlphaMod (surf , & alpha )) {
32493249 PyErr_SetString (pgExc_SDLError , SDL_GetError ());
32503250 SDL_FreeSurface (sub );
32513251 return NULL ;
32523252 }
32533253 if (alpha != 255 ) {
3254- if (SDL_SetSurfaceAlphaMod (sub , alpha ) != 0 ) {
3254+ if (! PG_SetSurfaceAlphaMod (sub , alpha )) {
32553255 PyErr_SetString (pgExc_SDLError , SDL_GetError ());
32563256 SDL_FreeSurface (sub );
32573257 return NULL ;
@@ -4515,7 +4515,7 @@ pgSurface_Blit(pgSurfaceObject *dstobj, pgSurfaceObject *srcobj,
45154515 /* can't blit alpha to 8bit, crashes SDL */
45164516 else if (PG_SURF_BytesPerPixel (dst ) == 1 &&
45174517 (SDL_ISPIXELFORMAT_ALPHA (PG_SURF_FORMATENUM (src )) ||
4518- ((SDL_GetSurfaceAlphaMod (src , & alpha ) == 0 && alpha != 255 )))) {
4518+ ((PG_GetSurfaceAlphaMod (src , & alpha ) && alpha != 255 )))) {
45194519 /* Py_BEGIN_ALLOW_THREADS */
45204520 if (PG_SURF_BytesPerPixel (src ) == 1 ) {
45214521 result = pygame_Blit (src , srcrect , dst , dstrect , 0 );
0 commit comments