On Tue, 2009-06-02 at 17:15 +0100, Emmanuele Bassi wrote:
> On Tue, 2009-06-02 at 10:05 -0600, Srinivasa Ragavan wrote:
>
> > If the resolution of the background image isn't same as of the screen size,
> > currently the image is tiled. Just made it scale.
> > Patch attached with this mail.
>
> quick review:
>
> + gint bw, bh;
>
> + bw = cogl_texture_get_width (tex); /* base texture width */
> + bh = cogl_texture_get_height (tex); /* base texture height */
>
> no; cogl_texture_get_width()/get_height() return a float:
>
> so this bit:
>
> + /* no comment */
> + if ((float)bw/bh < (float)aw/ah)
> + {
> + /* fit width */
> + v = (((float)ah * bw) / ((float)aw * bh)) / 2;
> + tx1 = 0;
> + tx2 = 1;
> + ty1 = (0.5 - v);
> + ty2 = (0.5 + v);
> + } else {
> + /* fit height */
> + v = (((float)aw * bh) / ((float)ah * bw)) / 2;
> + tx1 = (0.5 - v);
> + tx2 = (0.5 + v);
> + ty1 = 0;
> + ty2 = 1;
> + }
>
> can loose all the casting to float.
Well, that and doing (float)/(int) results in an integer division, you
need to cast the denominator in a division don't you?
--Chris
_______________________________________________
Moblin dev Mailing List
[email protected]
To manage or unsubscribe from this mailing list visit:
https://lists.moblin.org/mailman/listinfo/dev or your user account on
http://moblin.org once logged in.
For more information on the Moblin Developer Mailing lists visit:
http://moblin.org/community/mailing-lists