Re: [AD] Patch for two new entries to GFX_VTABLE |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
Eric Botcazou wrote:
--- 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.
Not really, this just undoes an old patch I submitted a while ago, which was a hack for AllegroGL. The condition up there should never be met in regular Allegro programs - you can't have video bitmaps of a different color depth than the screen bitmap. However, in AllegroGL you can, so my previous patch inhibited the color conversion for that case. Now that we have a vtable entry for converting in between color formats, I can easily do everything needed from within AllegroGL.
I suppose you want to do your own color conversion for video bitmaps only.
Like I said, that can't happen ;)If you want to do memory bitmap -> video bitmap conversion (or inversely), then nothing has changed - the regular blit_between_formats gets called.
Why not rather hook the blit_to_self() method of the vtable ?
Because video bitmaps are not necessairly part of the screen (AllegroGL) ;) [snip]
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.
Ok, I'll submit a replacement patch. -- - Robert J Ohannessian "Microsoft code is probably O(n^20)" (my CS prof) http://pages.infinit.net/voidstar/
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |