lbry-android-sdk/p4a/pythonforandroidold/recipes/pygame/patches/fix-surface-access.patch
2022-12-02 15:15:34 -05:00

37 lines
1.2 KiB
Diff

--- pygame-1.9.1release/src/surface.c.orig 2012-01-06 15:05:14.457829356 +0100
+++ pygame-1.9.1release/src/surface.c 2012-01-06 15:05:26.009829217 +0100
@@ -1722,7 +1722,7 @@
{
SDL_Surface *surf = PySurface_AsSurface (self);
/* Need to use 64bit vars so this works on 64 bit pythons. */
- Uint64 r, g, b, a;
+ unsigned long r, g, b, a;
if (!PyArg_ParseTuple (args, "(kkkk)", &r, &g, &b, &a))
return NULL;
@@ -1734,10 +1734,12 @@
printf("what are: %d, %d, %d, %d\n", surf->format->Rmask, surf->format->Gmask, surf->format->Bmask, surf->format->Amask);
*/
- surf->format->Rmask = (Uint32)r;
- surf->format->Gmask = (Uint32)g;
- surf->format->Bmask = (Uint32)b;
- surf->format->Amask = (Uint32)a;
+ SDL_PixelFormat *spf = surf->format;
+
+ spf->Rmask = (Uint32)r;
+ spf->Gmask = (Uint32)g;
+ spf->Bmask = (Uint32)b;
+ spf->Amask = (Uint32)a;
Py_RETURN_NONE;
}
@@ -1762,7 +1764,7 @@
surf_set_shifts (PyObject *self, PyObject *args)
{
SDL_Surface *surf = PySurface_AsSurface (self);
- Uint64 r, g, b, a;
+ unsigned long r, g, b, a;
if (!PyArg_ParseTuple (args, "(kkkk)", &r, &g, &b, &a))
return NULL;