From 1eeb21c155882497f7b0f76b0fbdc84a13e1f4ab Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Tue, 6 Jan 2009 16:32:42 +0000 Subject: [PATCH] [fixed-to-float.sh] COGL_FIXED_FROM_INT wasn't casting to a float It's necissary to replace COGL_FIXED_FROM_INT with a (float) cast otherwise the replacement maths may end up with integer rounding errors. This was causing text to not be displayed due to the texture coordinate calculation always rounding to (0,0) --- fixed-to-float.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fixed-to-float.sh b/fixed-to-float.sh index a38f3363c..61088b23b 100755 --- a/fixed-to-float.sh +++ b/fixed-to-float.sh @@ -34,7 +34,7 @@ sed -i 's/#define DET2X(a,b,c,d).*/#define DET2X(a,b,c,d) ((a * d) - (b * c))/ #we get some redundant brackets like this, but C's automatic type promotion #works out fine for most cases... find ./clutter -iname '*.[ch]' -exec sed -i 's/COGL_FIXED_TO_INT//g' {} \; -find ./clutter -iname '*.[ch]' -exec sed -i 's/COGL_FIXED_FROM_INT//g' {} \; +find ./clutter -iname '*.[ch]' -exec sed -i 's/COGL_FIXED_FROM_INT /(float)/g' {} \; find ./clutter -iname '*.[ch]' -exec sed -i 's/COGL_FIXED_TO_FLOAT//g' {} \; find ./clutter -iname '*.[ch]' -exec sed -i 's/COGL_FIXED_FROM_FLOAT//g' {} \; find ./clutter -iname '*.[ch]' -exec sed -i 's/COGL_FIXED_TO_DOUBLE /(double)/g' {} \;