From 5b845d39404ace572a216cbde1beb26f33595372 Mon Sep 17 00:00:00 2001 From: Tomas Frydrych Date: Tue, 29 May 2007 07:26:32 +0000 Subject: [PATCH] fix z_camera calcualtion in gles/cogl --- ChangeLog | 6 ++++++ clutter/cogl/gles/cogl.c | 11 ++--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6b2c54d9f..af3fa1b85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-05-29 Tomas Frydrych + + * clutter/cogl/gles/cogl.c: + (cogl_setup_viewport): + Fixed z_camera calculation. + 2007-05-28 Matthew Allum * clutter/clutter-texture.c: (clutter_texture_unrealize): diff --git a/clutter/cogl/gles/cogl.c b/clutter/cogl/gles/cogl.c index fa8b2c0c9..7d08dc11a 100644 --- a/clutter/cogl/gles/cogl.c +++ b/clutter/cogl/gles/cogl.c @@ -530,16 +530,9 @@ cogl_setup_viewport (guint w, /* camera distance from screen, 0.5 * tan (FOV) */ #define DEFAULT_Z_CAMERA 0.866025404f - z_camera = clutter_tani (fovy) << 1; + z_camera = clutter_tani (fovy) >> 1; - /* - printf("%i vs %i\n", - CLUTTER_FLOAT_TO_FIXED(DEFAULT_Z_CAMERA), - clutter_tani (fovy) << 1); - */ - - GE( glTranslatex (-1 << 15, -1 << 15, /*-z_camera*/ - -CLUTTER_FLOAT_TO_FIXED(DEFAULT_Z_CAMERA))); + GE( glTranslatex (-1 << 15, -1 << 15, -z_camera)); GE( glScalex ( CFX_ONE / width, -CFX_ONE / height,