26
26
#ifndef _PYGAME_INTERNAL_H
27
27
#define _PYGAME_INTERNAL_H
28
28
29
+ #include <stdbool.h>
30
+
29
31
#include "pgplatform.h"
30
32
/*
31
33
If PY_SSIZE_T_CLEAN is defined before including Python.h, length is a
86
88
#define PG_GetSurfacePalette SDL_GetSurfacePalette
87
89
#define PG_SurfaceMapRGBA (surf , r , g , b , a ) \
88
90
SDL_MapSurfaceRGBA(surf, r, g, b, a)
89
- #define PG_GetSurfaceClipRect ( surf , rect ) SDL_GetSurfaceClipRect(surf, rect)
91
+ #define PG_GetSurfaceClipRect SDL_GetSurfaceClipRect
90
92
91
93
#define PG_SurfaceHasRLE SDL_SurfaceHasRLE
92
94
@@ -109,12 +111,7 @@ PG_UnlockMutex(SDL_mutex *mutex)
109
111
return 0 ;
110
112
}
111
113
112
- /* Emulating SDL2 SDL_FillRect API. In SDL3, it returns -1 on failure. */
113
- static inline int
114
- PG_FillRect (SDL_Surface * dst , const SDL_Rect * rect , Uint32 color )
115
- {
116
- return SDL_FillSurfaceRect (dst , rect , color ) ? 0 : -1 ;
117
- }
114
+ #define PG_FillRect SDL_FillSurfaceRect
118
115
119
116
#define PG_SURF_BitsPerPixel (surf ) SDL_BITSPERPIXEL(surf->format)
120
117
#define PG_SURF_BytesPerPixel (surf ) SDL_BYTESPERPIXEL(surf->format)
@@ -192,10 +189,10 @@ PG_UnlockMutex(SDL_mutex *mutex)
192
189
return SDL_UnlockMutex (mutex );
193
190
}
194
191
195
- static inline int
192
+ static inline bool
196
193
PG_FillRect (SDL_Surface * dst , const SDL_Rect * rect , Uint32 color )
197
194
{
198
- return SDL_FillRect (dst , rect , color );
195
+ return SDL_FillRect (dst , rect , color ) != -1 ;
199
196
}
200
197
201
198
#define PG_SURF_BitsPerPixel (surf ) surf->format->BitsPerPixel
0 commit comments