Re: [AD] Patch for two new entries to GFX_VTABLE

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


--- src/blit.c 2001/11/06 15:30:46 1.9
+++ src/blit.c 2001/11/08 03:57:29
@@ -785,9 +785,11 @@
 {
    BLIT_CLIP();

-   if (!(is_video_bitmap(dest) && is_video_bitmap(src)) &&
-       (src->vtable->color_depth != dest->vtable->color_depth)) {
+   if (src->vtable->color_depth != dest->vtable->color_depth) {
       /* need to do a color conversion */
+      if (dest->vtable->blit_between_formats)
+         dest->vtable->blit_between_formats(src, dest, s_x, s_y, d_x, d_y,
w, h);
+      else
       blit_between_formats(src, dest, s_x, s_y, d_x, d_y, w, h);
    }
    else if (is_same_bitmap(src, dest)) {


Why did you remove the (!(is_video_bitmap(dest) && is_video_bitmap(src))
condition ? The whole if/then/else chain is modified.
I suppose you want to do your own color conversion for video bitmaps only.
Why not rather hook the blit_to_self() method of the vtable ?

--- src/rotate.c 2001/11/06 15:30:46 1.9
+++ src/rotate.c 2001/11/08 03:57:31
@@ -795,10 +795,15 @@
 {
    fixed xs[4], ys[4];

+   if (bmp->vtable->pivot_scaled_sprite_flip) {
+      bmp->vtable->pivot_scaled_sprite_flip(bmp, sprite, x, y, cx, cy,
angle, scale, v_flip);
+   }
+   else {
    _rotate_scale_flip_coordinates(sprite->w << 16, sprite->h << 16,
       x, y, cx, cy, angle, scale, scale,
       FALSE, v_flip, xs, ys);
    _parallelogram_map_standard(bmp, sprite, xs, ys);
+   }
 }

This one looks ok, except that since the new method is a replacement for
_pivot_scaled_sprite_flip() in rotate.c, it should be invoked wherever
_pivot_scaled_sprite_flip() is invoked, not inside
_pivot_scaled_sprite_flip() itself.

--
Eric Botcazou
ebotcazou@xxxxxxxxxx



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