From efa0c0660b9db3601452b32864d0ef114a72e0ce Mon Sep 17 00:00:00 2001 From: Tomas Gavenciak Date: Mon, 13 Jun 2011 00:56:55 +0200 Subject: [PATCH] Bix fix in pixel value scaling DUH --- pylib/gfxprim/generators/core/make_GP_Convert.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pylib/gfxprim/generators/core/make_GP_Convert.py b/pylib/gfxprim/generators/core/make_GP_Convert.py index 249763d8..41637cac 100644 --- a/pylib/gfxprim/generators/core/make_GP_Convert.py +++ b/pylib/gfxprim/generators/core/make_GP_Convert.py @@ -26,11 +26,11 @@ def core_GP_Pixel_Scale_gen(h): "{% for s1 in range(1,9) %}{% for s2 in range(1,9) %}" "{% if s2>s1 %}" - "#define GP_SCALE_VAL_{{s1}}_{{s2}}(val) ((val) * {{ multcoef(s1, s2) }})\n" + "#define GP_SCALE_VAL_{{s1}}_{{s2}}(val) (((val) * {{ multcoef(s1, s2) }}) >> {{ (-s2) % s1 }})\n" "{% else %}" "#define GP_SCALE_VAL_{{s1}}_{{s2}}(val) ((val) >> {{ s1 - s2 }})\n" "{% endif %}" - "{% endfor %}{% endfor %}", multcoef = lambda s1,s2: hex(sum([1<