[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#186916: Updated pygame



reassign 186916 python-pygame
retitle 186916 Setting some SDL flags crashes pygame on 64 bits arches

Le ven 18/04/2003 à 11:38, Kalle Olavi Niemitalo a écrit :
> I think this means:
> 
> * SDL_FULLSCREEN should be mapped to the same value as
>   0x80000000: that is, -2147483648 on 32-bit and 2147483648 on
>   64-bit platforms.

Indeed.

> * Code that decodes bit masks passed from Python should ignore
>   the high bits that Python does not attempt to preserve.
>   In pygame, mode_ok() should decode the value as a long int
>   so that the exception will not occur.

Then I guess this patch should be enough (the extra bits should be
trutcated) :

--- display.c.old       2003-04-23 19:22:09.000000000 +0200
+++ display.c   2003-04-23 19:46:09.000000000 +0200
@@ -601,12 +601,13 @@
  
 static PyObject* mode_ok(PyObject* self, PyObject* args)
 {
-       int flags=SDL_SWSURFACE, depth=0;
+       long flags=SDL_SWSURFACE;
+       int depth=0;
        int w, h;
  
        VIDEO_INIT_CHECK();
  
-       if(!PyArg_ParseTuple(args, "(ii)|ii", &w, &h, &flags, &depth))
+       if(!PyArg_ParseTuple(args, "(ii)|li", &w, &h, &flags, &depth))
                return NULL;
        if(!depth)
                depth = SDL_GetVideoInfo()->vfmt->BitsPerPixel;

Can you canfirm this works on alpha ? Of course, this would have to be
applied to set_mode as well, and maybe to other routines.

Regards,
-- 
 .''`.           Josselin Mouette        /\./\
: :' :           josselin.mouette@ens-lyon.org
`. `'                        joss@debian.org
  `-  Debian GNU/Linux -- The power of freedom

Attachment: signature.asc
Description: PGP signature


Reply to: