Commits

Anonymous committed 5d67d71

Support 8 bit source in blend blit; blit_blends example seems to work now.

  • Participants
  • Parent commits 27e83cb
  • Branches ctypes-soc

Comments (0)

Files changed (1)

File pygame/surface.py

     dstrect.w = w
     dstrect.h = h
 
+    # New to Pygame-ctypes
+    assert dst.format.BytesPerPixel > 1
+    if src.format.BytesPerPixel == 1:
+        # XXX easy way out; could be faster using array module
+        src = SDL_ConvertSurface(src, dst.format, 0)
+        free_src = True
+
     # Mmm, fun times...
     srcRmask = src.format.Rmask
     srcGmask = src.format.Gmask
     SDL_UnlockSurface(dst)
     SDL_UnlockSurface(src)
 
+    if free_src:
+        SDL_FreeSurface(src)
+
     return 0
 
 def _ptr_add(ptr, offset, offset_type):