Re: [AD] Logic in al_draw_bitmap_region

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


I think the same applies to other functions. Patch below.

Pete

Index: src/bitmap_new.c
===================================================================
--- src/bitmap_new.c    (revision 10086)
+++ src/bitmap_new.c    (working copy)
@@ -381,12 +381,13 @@
    ALLEGRO_BITMAP *dest = al_get_target_bitmap();

    if ((bitmap->flags & ALLEGRO_MEMORY_BITMAP) ||
-       (dest->flags & ALLEGRO_MEMORY_BITMAP))
+       (dest->flags & ALLEGRO_MEMORY_BITMAP) ||
+       (!al_is_compatible_bitmap(bitmap)))
    {
       _al_draw_scaled_bitmap_memory(bitmap, sx, sy, sw, sh,
          dx, dy, dw, dh, flags);
    }
-   else if (al_is_compatible_bitmap(bitmap)) {
+   else {
       bitmap->vt->draw_scaled_bitmap(bitmap, sx, sy, sw, sh,
          dx, dy, dw, dh, flags);
    }
@@ -416,12 +417,13 @@

    /* If one is a memory bitmap, do memory blit */
    if ((bitmap->flags & ALLEGRO_MEMORY_BITMAP) ||
-       (dest->flags & ALLEGRO_MEMORY_BITMAP))
+       (dest->flags & ALLEGRO_MEMORY_BITMAP) ||
+       (!al_is_compatible_bitmap(bitmap)))
    {
       _al_draw_rotated_bitmap_memory(bitmap, cx, cy,
          dx, dy, angle, flags);
    }
-   else if (al_is_compatible_bitmap(bitmap)) {
+   else {
       bitmap->vt->draw_rotated_bitmap(bitmap, cx, cy, dx, dy, angle, flags);
    }
 }
@@ -452,13 +454,14 @@
    ALLEGRO_BITMAP *dest = al_get_target_bitmap();

    /* If one is a memory bitmap, do memory blit */
-   if ((bitmap->flags & ALLEGRO_MEMORY_BITMAP) ||
-       (dest->flags & ALLEGRO_MEMORY_BITMAP))
+    if ((bitmap->flags & ALLEGRO_MEMORY_BITMAP) ||
+       (dest->flags & ALLEGRO_MEMORY_BITMAP) ||
+       (!al_is_compatible_bitmap(bitmap)))
    {
       _al_draw_rotated_scaled_bitmap_memory(bitmap, cx, cy,
          dx, dy, xscale, yscale, angle, flags);
    }
-   else if (al_is_compatible_bitmap(bitmap)) {
+   else {
       bitmap->vt->draw_rotated_scaled_bitmap(bitmap, cx, cy,
          dx, dy, xscale, yscale, angle, flags);
    }




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/