diff --git a/README.rst b/README.rst index 17f16f6b8a..fbec4c55a7 100644 --- a/README.rst +++ b/README.rst @@ -140,7 +140,7 @@ Dependency versions: +----------+------------------------+ | CPython | >= 3.8 (Or use PyPy3) | +----------+------------------------+ -| SDL | >= 2.0.9 | +| SDL | >= 2.0.10 | +----------+------------------------+ | SDL_mixer| >= 2.0.4 | +----------+------------------------+ diff --git a/docs/readmes/README.es.rst b/docs/readmes/README.es.rst index d654bc8a75..3d28d81015 100644 --- a/docs/readmes/README.es.rst +++ b/docs/readmes/README.es.rst @@ -118,7 +118,7 @@ Versiones de dependencia: +----------+-----------------------------+ | CPython | >= 3.8 (Ou utiliser PyPy3) | +----------+-----------------------------+ -| SDL | >= 2.0.9 | +| SDL | >= 2.0.10 | +----------+-----------------------------+ | SDL_mixer| >= 2.0.4 | +----------+-----------------------------+ diff --git a/docs/readmes/README.fa.rst b/docs/readmes/README.fa.rst index 009bf34748..ecb21f484f 100644 --- a/docs/readmes/README.fa.rst +++ b/docs/readmes/README.fa.rst @@ -190,7 +190,7 @@ Dependencies (وابستگی ها) +----------+------------------------+ | CPython | >= 3.8 (Or use PyPy3) | +----------+------------------------+ -| SDL | >= 2.0.9 | +| SDL | >= 2.0.10 | +----------+------------------------+ | SDL_mixer| >= 2.0.4 | +----------+------------------------+ diff --git a/docs/readmes/README.fr.rst b/docs/readmes/README.fr.rst index 32eb32aea0..8843c071c2 100644 --- a/docs/readmes/README.fr.rst +++ b/docs/readmes/README.fr.rst @@ -147,7 +147,7 @@ Versions des dépendances: +----------+-----------------------------+ | CPython | >= 3.8 (Ou utiliser PyPy3) | +----------+-----------------------------+ -| SDL | >= 2.0.9 | +| SDL | >= 2.0.10 | +----------+-----------------------------+ | SDL_mixer| >= 2.0.4 | +----------+-----------------------------+ diff --git a/docs/readmes/README.zh-cn.rst b/docs/readmes/README.zh-cn.rst index 1f56f3fcdb..01a732f032 100644 --- a/docs/readmes/README.zh-cn.rst +++ b/docs/readmes/README.zh-cn.rst @@ -109,7 +109,7 @@ pygame显然依赖于SDL和Python。此外pygame还嵌入了几个较小的库 +----------+------------------------+ | CPython | >= 3.8 (或 PyPy3) | +----------+------------------------+ -| SDL | >= 2.0.9 | +| SDL | >= 2.0.10 | +----------+------------------------+ | SDL_mixer| >= 2.0.4 | +----------+------------------------+ diff --git a/src_c/pgcompat_rect.h b/src_c/pgcompat_rect.h index 94561abf38..643059dfcb 100644 --- a/src_c/pgcompat_rect.h +++ b/src_c/pgcompat_rect.h @@ -3,19 +3,6 @@ #include -#if !(SDL_VERSION_ATLEAST(2, 0, 10)) -typedef struct SDL_FRect { - float x, y; - float w, h; -} SDL_FRect; - -typedef struct SDL_FPoint { - float x; - float y; -} SDL_FPoint; - -#endif /* !(SDL_VERSION_ATLEAST(2, 0, 10)) */ - /* SDL 2.0.22 provides some utility functions for FRects */ #if !(SDL_VERSION_ATLEAST(2, 0, 22)) diff --git a/src_c/surface.c b/src_c/surface.c index 3df91cd570..6b535198e9 100644 --- a/src_c/surface.c +++ b/src_c/surface.c @@ -263,39 +263,6 @@ pg_DisplayFormat(SDL_Surface *surface); static int _PgSurface_SrcAlpha(SDL_Surface *surf); -#if !SDL_VERSION_ATLEAST(2, 0, 10) -static Uint32 -pg_map_rgb(SDL_Surface *surf, Uint8 r, Uint8 g, Uint8 b) -{ - /* SDL_MapRGB() returns wrong values for color keys - for indexed formats since since alpha = 0 */ - Uint32 key; - if (!surf->format->palette) - return SDL_MapRGB(surf->format, r, g, b); - if (!SDL_GetColorKey(surf, &key)) { - Uint8 keyr, keyg, keyb; - SDL_GetRGB(key, surf->format, &keyr, &keyg, &keyb); - if (r == keyr && g == keyg && b == keyb) - return key; - } - else - SDL_ClearError(); - return SDL_MapRGBA(surf->format, r, g, b, SDL_ALPHA_OPAQUE); -} - -static Uint32 -pg_map_rgba(SDL_Surface *surf, Uint8 r, Uint8 g, Uint8 b, Uint8 a) -{ - if (!surf->format->palette) - return SDL_MapRGBA(surf->format, r, g, b, a); - return pg_map_rgb(surf, r, g, b); -} -#else /* SDL_VERSION_ATLEAST(2, 0, 10) */ -#define pg_map_rgb(surf, r, g, b) SDL_MapRGB((surf)->format, (r), (g), (b)) -#define pg_map_rgba(surf, r, g, b, a) \ - SDL_MapRGBA((surf)->format, (r), (g), (b), (a)) -#endif /* SDL_VERSION_ATLEAST(2, 0, 10) */ - static PyGetSetDef surface_getsets[] = { {"_pixels_address", (getter)surf_get_pixels_address, NULL, "pixel buffer address (readonly)", NULL}, @@ -976,7 +943,7 @@ surf_map_rgb(PyObject *self, PyObject *args) SURF_INIT_CHECK(surf) - color = pg_map_rgba(surf, rgba[0], rgba[1], rgba[2], rgba[3]); + color = SDL_MapRGBA(surf->format, rgba[0], rgba[1], rgba[2], rgba[3]); return PyLong_FromLong(color); } @@ -1604,7 +1571,7 @@ surf_convert(pgSurfaceObject *self, PyObject *args) } if (has_colorkey) { - colorkey = pg_map_rgba(newsurf, key_r, key_g, key_b, key_a); + colorkey = SDL_MapRGBA(newsurf->format, key_r, key_g, key_b, key_a); if (SDL_SetColorKey(newsurf, SDL_TRUE, colorkey) != 0) { PyErr_SetString(pgExc_SDLError, SDL_GetError()); SDL_FreeSurface(newsurf);