[PATCH] change set_answer to only load images if they aren't
Christopher Schmidt
crschmidt at metacarta.com
Mon Aug 20 09:47:15 EDT 2007
already the same as the current image.
---
tile.py | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
c8ed735b21c763a2dd0f236ab3439e79a138edb7
diff --git a/tile.py b/tile.py
index da05bbd..edb7206 100644
--- a/tile.py
+++ b/tile.py
@@ -65,11 +65,9 @@ class Tile(object):
"""set the answer"""
self.answer = answer
self.font = font
- self.image_name = image_name
- self.image = None
- if image_name:
- self.answer = image_name
+ if image_name and self.image_name != image_name:
self.image_name = image_name
+ self.answer = image_name
self.image = load_image(self.image_name,1)
scale_x = float(self.width )/float(self.image.get_rect().width)
scale_y = float(self.height)/float(self.image.get_rect().height)
--
1.2.4
--y0ulUmNC+osPPQO6--
More information about the Games
mailing list