RE: [AD] some small patches

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


On Fri, 2002-11-01 at 12:22, Elias Pschernig wrote:
> > 
> > Why would it ? Enabling clip with null surface would do it, wouldn't
> > it ?
> > 
> 
> Yes, of course. But I was thinking, there is a reason why this was
> disallowed. I'll try removing the checks and see if it crashes :)
> 

Hm, I see.. in this case, this is simply a bug. This voids my docs
patch. Setting the clipping rectangle already works, just not to the
right and to the bottom - the following patch aims at fixing it:

--
Elias Pschernig

Index: src/graphics.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/graphics.c,v
retrieving revision 1.44
diff -u -r1.44 graphics.c
--- src/graphics.c	9 Oct 2002 06:14:57 -0000	1.44
+++ src/graphics.c	1 Nov 2002 11:46:36 -0000
@@ -1405,8 +1405,8 @@
    y2++;
 
    bitmap->clip = TRUE;
-   bitmap->cl = MID(0, x1, bitmap->w-1);
-   bitmap->ct = MID(0, y1, bitmap->h-1);
+   bitmap->cl = MID(0, x1, bitmap->w);
+   bitmap->ct = MID(0, y1, bitmap->h);
    bitmap->cr = MID(0, x2, bitmap->w);
    bitmap->cb = MID(0, y2, bitmap->h);
 


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