Re: [AD] possible bug in draw_sprite_h_flip C version while clipping

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


Thank you for your bug report,

Cool Bool wrote:

The sprite does not clip right,
I think sxbeg and w are not calculated right, I have included my unoptimized
fix. The code below shows what I mean.

Can you explain in words what is wrong? I looked at the code
between your commments "possible bug here" and "fix", and I
don't see anything wrong:
 - sxbeg is the clipped left coordinate in the source sprite
 - dxbeg is the clipped left coordinate in the dest bitmap
 - w is the clipped right coordinate in the source sprite
   minus sxbeg.

 draw_sprite_h_flipc(buffer, bmp, bmp->w/-2, bmp->h+10);

What do you expect to happen and what happens instead? What
is the width, height, and color depth of bmp?

Note that most platforms use assembler to draw sprites, in
the file src/i386/ispr8.s. The C code is just a fallback for
platforms that don't have an asm implementation. Which
compiler are you using?

Sven



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