Commits

Anonymous committed 5d06d97

testoverlay2 endian fix for powerpc. Significant image corruption remains
(unrelated)

Comments (0)

Files changed (3)

     - Use RTLD_GLOBAL to workaround ctypes on Panther bug
     - Connect to window manager before SDL_Init(SDL_INIT_VIDEO) 
         - requires PyObjC
+ - Added SDL.endian submodule
 
 SDL-ctypes 0.04
 ---------------
 SetCaption unicode
 byte swapping in array, esp for audio
 endian check, e.g. for overlay and gl tests
-glitch in upper-left corner of testoverlay2
+glitch in upper-left corner of testoverlay2 on linux; on ppc os x large
+  corruption in top half
 
 SDL_syswm.h - platform dependent
 
         format = SDL_PixelFormat()
         format.BitsPerPixel = 32
         format.BytesPerPixel = 4
-        format.Rshift = 0 # TODO big endian
-        format.Gshift = 8
-        format.Bshift = 16
+        if SDL_BYTEORDER == SDL_LIL_ENDIAN:
+            format.Rshift = 0
+            format.Gshift = 8
+            format.Bshift = 16
+        else:
+            format.Rshift = 24
+            format.Gshift = 16
+            format.Bshift = 8
         format.Rmask = 0xff << format.Rshift
         format.Gmask = 0xff << format.Gshift
         format.Bmask = 0xff << format.Bshift