changeset 58:04e83cf43329

Add convert_alpha to load_image
author Neil Muller <drnlmuller@gmail.com>
date Sun, 03 Apr 2011 21:41:43 +0200
parents e545236dd8f4
children 1be1ca704346
files skaapsteker/data.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/skaapsteker/data.py	Sun Apr 03 21:40:30 2011 +0200
+++ b/skaapsteker/data.py	Sun Apr 03 21:41:43 2011 +0200
@@ -11,6 +11,7 @@
 import os
 
 import pygame.image
+import pygame.display
 
 
 data_py = os.path.abspath(os.path.dirname(__file__))
@@ -36,5 +37,7 @@
 def load_image(filename):
     if filename not in IMAGES:
         IMAGES[filename] = pygame.image.load(load(filename))
+        if pygame.display.get_init():
+            IMAGES[filename] = IMAGES[filename].convert_alpha(pygame.display.get_surface())
     return IMAGES[filename]