+2008-11-24 Neil Roberts <neil@linux.intel.com>
+
+ * clutter/cogl/gl/cogl-texture.c (cogl_texture_polygon): Fix the
+ equation for calculating texture coordinates when using sliced
+ textures. This became broken in revision 3520.
+
2008-11-21 Neil Roberts <neil@linux.intel.com>
Bug 1270 - Update to mingw-cross-compile.sh
gboolean use_color)
{
CoglTexture *tex;
- int i, x, y;
+ int i, x, y, tex_num;
GLuint gl_handle;
CoglTexSliceSpan *y_span, *x_span;
gulong enable_flags;
GL_CLAMP_TO_BORDER) );
}
- i = 0;
+ tex_num = 0;
/* Render all of the slices with the full geometry but use a
transparent border color so that any part of the texture not
{
x_span = &g_array_index (tex->slice_x_spans, CoglTexSliceSpan, x);
- gl_handle = g_array_index (tex->slice_gl_handles, GLuint, i++);
+ gl_handle = g_array_index (tex->slice_gl_handles, GLuint, tex_num++);
/* Convert the vertices into an array of GLfloats ready to pass to
OpenGL */
p->v[0] = CFX_F(vertices[i].x);
p->v[1] = CFX_F(vertices[i].y);
p->v[2] = CFX_F(vertices[i].z);
- p->t[0] = CFX_F(vertices[i].tx
- * (x_span->size - x_span->waste) / x_span->size);
- p->t[1] = CFX_F(vertices[i].ty
- * (y_span->size - y_span->waste) / y_span->size);
+ p->t[0] = CFX_F((vertices[i].tx
+ - (COGL_FIXED_FROM_INT (x_span->start)
+ / tex->bitmap.width))
+ * tex->bitmap.width / x_span->size);
+ p->t[1] = CFX_F((vertices[i].ty
+ - (COGL_FIXED_FROM_INT (y_span->start)
+ / tex->bitmap.height))
+ * tex->bitmap.height / y_span->size);
p->c[0] = cogl_color_get_red_byte(&vertices[i].color);
p->c[1] = cogl_color_get_green_byte(&vertices[i].color);
p->c[2] = cogl_color_get_blue_byte(&vertices[i].color);