Changeset 161:500c5a68607c


Ignore:
Timestamp:
Sep 2, 2013, 10:52:22 PM (7 years ago)
Author:
Stefano Rivera <stefano@…>
Branch:
default
Message:

Skip loading images before the display is initialized (so the level editor can start again)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/resources.py

    r54 r161  
    11import os
     2import sys
    23
    34from pkg_resources import resource_filename
     
    5455            image = pygame.image.load(fn)
    5556            if self.CONVERT_ALPHA:
     57                if not pygame.display.get_init():
     58                    print >> sys.stderr, ("Display not initialized, "
     59                                          "image '%s' not loaded."
     60                                          % os.path.join(*path))
     61                    return
    5662                image = image.convert_alpha(pygame.display.get_surface())
    5763            self._cache[path] = image
Note: See TracChangeset for help on using the changeset viewer.