[AD] Fix for C version of draw_trans_sprite

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


I switched to using the C sprite routines after getting strange crashes in
the assembler versions - anyway, I noticed that the draw_trans_sprite
doesn't work as it should (the transparent pixels turn to pink).

Starting on line 511 of cspr.h:  (allegro 4.1.7), the fix:

 for (x = w - 1; x >= 0; INC_PIXEL_PTR(s), INC_PIXEL_PTR(d), x--) {
    unsigned long c = GET_MEMORY_PIXEL(s);
+     if (!IS_SPRITE_MASK(src, c)) {
      c = DTS_BLEND(blender, GET_MEMORY_PIXEL(d), c);
      PUT_MEMORY_PIXEL(d, c);
+     }
 }

cheers,
chris






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