Commits

Anonymous committed d4c1a98

Fixed unset colorkey with Surface.set_colorkey

Comments (0)

Files changed (2)

+Pygame-ctypes 0.10
+------------------
+ - Fixed unset colorkey with Surface.set_colorkey
+
 Pygame-ctypes 0.09
 ------------------
  - pygame.mixer.Channel.get/set_endevent fixed

pygame/surface.py

         if surf.flags & SDL_OPENGL:
             raise pygame.base.error, 'Cannot call on OPENGL surfaces'
 
+        if color is None:
+            SDL_SetColorKey(surf, 0, 0)
+            return
+
         rgba = pygame.base._rgba_from_obj(color)
         if rgba:
             color = SDL_MapRGBA(surf.format, rgba[0], rgba[1], rgba[2], rgba[3])
         if color and type(color) not in (int, long):
             raise 'invalid color argument'
-        if color is not None:
-            flags |= SDL_SRCCOLORKEY
 
+        flags |= SDL_SRCCOLORKEY
         SDL_SetColorKey(surf, flags, color)
         
     def get_colorkey(self):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.