Re: [AD] Patch for rotate.c

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


David A. Capello wrote:
This patch fix a ugly error when you rotate a sprite over a
non-clipped bitmap

You are right, if we are going to clip against the right edge, this is the correct way to do it. However...

If you compile the test with the current Allegro version you can see:

  Moving the sprite to the:
  - left side: all work fine
  - right side: some extra pixels appears in the left side
  - top side and bottom side: SEG FAULT

The segmentation fault is correct (because we desactivate the
clipping), but the extra pixels that appears in left side when we
rotate a sprite over the right side, that is bad.

As far as I understand, the behavior is undefined when drawing outside an unclipped bitmap, so strictly speaking I think the extra pixels are as OK as the SEGFAULT. In both cases, the user did an error by disabling clipping and then drawing outside the bitmap. Wouldn't it be better to insert an ASSERT(), than to allow the user to do the error?

Whether we use your patch or insert ASSERTs, the same can be done for top and bottom clipping too.

/Sven




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