Skip to content

Commit

Permalink
fixed camera_example's image loader
Browse files Browse the repository at this point in the history
  • Loading branch information
Alec Goebel committed Apr 7, 2012
1 parent 93e2269 commit 108c6fd
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions samplecode/camera_example/gamelib/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ def load(self, name, colorkey=None):
if name not in self._images:
path = os.path.join(DATA_DIR, "images", name) + ".bmp"
image = pygame.image.load(path).convert()
if colorkey:
if colorkey == -1:
colorkey = image.get_at((0,0))
image.set_colorkey(colorkey)

self._images[name] = image

return self._images[name].convert()
image = self._images[name].convert()
if colorkey:
if colorkey == -1:
colorkey = image.get_at((0,0))
image.set_colorkey(colorkey)


return image

0 comments on commit 108c6fd

Please sign in to comment.