1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-08-13 16:53:59 -04:00

pyMML: Fix issue with color.

This commit is contained in:
Merlijn Wajer 2010-12-23 17:18:35 +01:00
parent 8e0e86e7d6
commit 285be4b6ed

View File

@ -98,9 +98,11 @@ class Color(object):
ret = self._mc.dll.find_color_spiral(self._cli, byref(x), byref(y), ret = self._mc.dll.find_color_spiral(self._cli, byref(x), byref(y),
col, *box) col, *box)
else: else:
ret = self._mc.dll.find_color_spiral_tolerance(self._cli, byref(x), pass
byref(y), col, *box, # FIXME
tol) # ret = self._mc.dll.find_color_spiral_tolerance(self._cli, byref(x),
# byref(y), col, *box,
# tol)
if ret is RESULT_OK: if ret is RESULT_OK:
return (x, y) return (x, y)
elif ret is RESULT_ERROR: elif ret is RESULT_ERROR:
@ -115,12 +117,16 @@ class Color(object):
""" """
x, y = (c_int(-1), c_int(-1)) x, y = (c_int(-1), c_int(-1))
if tol is 0: if tol is 0:
ret = self._mc.dll.find_colored_area(self._cli, byref(x), byref(y), pass
col, *box, min_a) # FIXME
# ret = self._mc.dll.find_colored_area(self._cli, byref(x), byref(y),
# col, *box, min_a)
else: else:
ret = self._mc.dll.find_colored_area_tolerance(self._cli, byref(x), pass
byref(y), col, *box, # FIXME
min_a, tol) # ret = self._mc.dll.find_colored_area_tolerance(self._cli, byref(x),
# byref(y), col, *box,
# min_a, tol)
if ret is RESULT_OK: if ret is RESULT_OK:
return (x, y) return (x, y)
elif ret is RESULT_ERROR: elif ret is RESULT_ERROR:
@ -136,8 +142,10 @@ class Color(object):
if tol is 0: if tol is 0:
ret = self._mc.dll.count_color(self._cli, count, col, *box) ret = self._mc.dll.count_color(self._cli, count, col, *box)
else: else:
ret = self._mc.dll.count_color_tolerance(self._cli, count, col, pass
*box, tol) # FIXME
# ret = self._mc.dll.count_color_tolerance(self._cli, count, col,
# *box, tol)
if ret is RESULT_OK: if ret is RESULT_OK:
return count return count
elif ret is RESULT_ERROR: elif ret is RESULT_ERROR:
@ -255,4 +263,4 @@ class Color(object):
self._mc.dll.get_tolerance_speed_2_modifiers.restype = c_int self._mc.dll.get_tolerance_speed_2_modifiers.restype = c_int
self._mc.dll.get_tolerance_speed_2_modifiers.argtypes = [c_ulong, self._mc.dll.get_tolerance_speed_2_modifiers.argtypes = [c_ulong,
PINTEGER, PINTEGER,
PINTEGER] PINTEGER]