From d1215a57167f15a55c079cf6e0fb5d4b066ac8fd Mon Sep 17 00:00:00 2001 From: rcoh Date: Wed, 22 Dec 2010 15:07:19 -0500 Subject: Done with pixel regions, with demo in behaviors/AllPixelsLeft.py. Need to finish up support for multiple mappers. --- pixelmappers/SimpleMapper.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'pixelmappers') diff --git a/pixelmappers/SimpleMapper.py b/pixelmappers/SimpleMapper.py index 6b414ea..bc51cf9 100644 --- a/pixelmappers/SimpleMapper.py +++ b/pixelmappers/SimpleMapper.py @@ -19,8 +19,10 @@ class SimpleMapper(PixelMapper): eventLocation = eventLocation.replace('{y}', 'pixel.location[1]') for pixel in screen: try: - pixelValid = sum(eval(eventLocation)) == len(eventLocation) - ret.append((pixel, 1)) + pixelValid = sum(eval(eventLocation)) == len(eval(eventLocation)) #TODO: some + #optimizations possible. This might be slow in the long run + if pixelValid: + ret.append((pixel, 1)) except: raise Exception('Bad event condition') return ret -- cgit v1.2.3