pygame / pygame / display.py

Diff from to

pygame/display.py

 
 from SDL import *
 import pygame.base
+import pygame.pkgdata
 import pygame.surface
 
 _display_surface = None
 _icon_was_set = 0
+_icon_defaultname = 'pygame_icon.bmp'
 
 def __PYGAMEinit__():
     pygame.base.register_quit(_display_autoquit)
     else:
         _display_surface = pygame.surface.Surface(surf=surf)
 
-    if sys.platform != 'darwin' and False: # XXX
+    if sys.platform != 'darwin':
         if not _icon_was_set:
-            iconsurf = _display_resource(_icon_defaultname)
-            SDL_SetColorKey(iconsurf.surf, SDL_SRCCOLORKEY, 0)
-            _do_set_icon(iconsurf)
+            file = pygame.pkgdata.getResource(_icon_defaultname)
+            iconsurf = pygame.image.load(file)
+            SDL_SetColorKey(iconsurf._surf, SDL_SRCCOLORKEY, 0)
+            set_icon(iconsurf)
 
     return _display_surface
 
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.