[AD] subbitmap issues

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


On 2002-05-09, Lennart Steinke <steinke@xxxxxxxxxx> wrote:
> Peter, could you also assert if x,y  are >= w,h of the parent?

This is what I feel like doing for 4.2.  For 4.0, I'd like to put in
the ASSERTs, but leave the if's as they are for compatibility.
Objections?

--- graphics.c.~1.36.~  Thu May  9 21:15:28 2002
+++ graphics.c  Sun May 12 09:41:15 2002
@@ -916,16 +916,9 @@
    BITMAP *bitmap;
    int i;

+   ASSERT(parent);
+   ASSERT((x >= 0) && (y >= 0) && (x < parent->w) && (y < parent->h));
    ASSERT((width > 0) && (height > 0));
-
-   if (!parent)
-      return NULL;
-
-   if (x < 0)
-      x = 0;
-
-   if (y < 0)
-      y = 0;

    if (x+width > parent->w)
       width = parent->w-x;



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