Index: ogl_bitmap.c =================================================================== --- ogl_bitmap.c (revision 15577) +++ ogl_bitmap.c (working copy) @@ -1,5 +1,5 @@ /* ______ ___ ___ - * /\ _ \ /\_ \ /\_ \ + * /\ _ \ /\_ \ /\_ \ * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___ * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\ * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \ @@ -200,8 +200,8 @@ float sx, float sy, float sw, float sh, int flags) { - float tex_l, tex_t, tex_r, tex_b, w, h, tex_w, tex_h; - float dw = sw, dh = sh; + double tex_l, tex_t, tex_r, tex_b, w, h, true_w, true_h; + double dw = sw, dh = sh; ALLEGRO_BITMAP_EXTRA_OPENGL *ogl_bitmap = bitmap->extra; ALLEGRO_OGL_BITMAP_VERTEX *verts; ALLEGRO_DISPLAY *disp = al_get_current_display(); @@ -222,13 +222,13 @@ w = bitmap->w; h = bitmap->h; - tex_w = 1.0 / ogl_bitmap->true_w; - tex_h = 1.0 / ogl_bitmap->true_h; + true_w = ogl_bitmap->true_w; + true_h = ogl_bitmap->true_h; - tex_l += sx * tex_w; - tex_t -= sy * tex_h; - tex_r -= (w - sx - sw) * tex_w; - tex_b += (h - sy - sh) * tex_h; + tex_l += sx / true_w; + tex_t -= sy / true_h; + tex_r -= (w - sx - sw) / true_w; + tex_b += (h - sy - sh) / true_h; verts[0].x = 0; verts[0].y = dh; @@ -519,10 +519,10 @@ } } - ogl_bitmap->left = 0; - ogl_bitmap->right = (float) w / ogl_bitmap->true_w; - ogl_bitmap->top = (float) h / ogl_bitmap->true_h; - ogl_bitmap->bottom = 0; + ogl_bitmap->left = 0.5 / ogl_bitmap->true_w; + ogl_bitmap->right = (float)(w-0.5) / ogl_bitmap->true_w; + ogl_bitmap->top = (float)(h-0.5) / ogl_bitmap->true_h; + ogl_bitmap->bottom = 0.5 / ogl_bitmap->true_h; return true; }