Re: [AD] Serious Bugs in the DJGPP port of ALLEGRO in 4.1.17

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


On Monday 10 January 2005 22:46, Marcio Afonso Arimura Fialho wrote:
> I've managed to correct most of these problems, and
> the library doesn't seems to crash anymore. The diff
> patches and error reports are attached.

I've commited the attached patch. This is mostly identical to your original 
patch, except for formatting. I've worked around the triangle problem in 
the VBE/AF driver in a different way: it was supposed to return a value 
when the hardware accelerated driver didn't work (because of clipping), so 
the software driver could be used. This is different from the way the 
other gfx vtable functions work, so that's why I changed this originally. 
Apparently I missed the VBE/AF driver.
I've worked around this in this patch by calling the software renderer 
directly from the accelerated renderer if the triangle is clipped.

Note that I haven't done any extensive tests on this, which are in order 
before 4.1.18 goes out.

Evert
? keyboard.dat
? language.dat
? src/fonttxt.c
Index: src/dos/dmouse.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/dos/dmouse.c,v
retrieving revision 1.7
diff -u -p -r1.7 dmouse.c
--- src/dos/dmouse.c	4 Dec 2004 13:24:16 -0000	1.7
+++ src/dos/dmouse.c	16 Jan 2005 12:13:29 -0000
@@ -126,6 +126,7 @@ MOUSE_DRIVER mousedrv_int33 =
    int33_set_speed,
    int33_get_mickeys,
    NULL,
+   NULL,
    NULL
 };
 
@@ -152,6 +153,7 @@ MOUSE_DRIVER mousedrv_polling =
    int33_set_speed,
    int33_get_mickeys,
    NULL,
+   NULL,
    NULL
 };
 
@@ -176,6 +178,7 @@ MOUSE_DRIVER mousedrv_winnt =
    int33_set_speed,
    int33_get_mickeys,
    NULL,
+   NULL,
    NULL
 };
 
Index: src/dos/vesa.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/dos/vesa.c,v
retrieving revision 1.19
diff -u -p -r1.19 vesa.c
--- src/dos/vesa.c	16 Oct 2004 19:45:31 -0000	1.19
+++ src/dos/vesa.c	16 Jan 2005 12:13:31 -0000
@@ -88,6 +88,7 @@ GFX_DRIVER gfx_vesa_2b = 
    NULL, NULL, NULL, NULL,       /* no hardware cursor */
    NULL,                         /* no drawing mode hook */
    NULL, NULL,                   /* no state saving */
+   NULL,
    vesa_fetch_mode_list,         /* aye! */
    0, 0, FALSE, 0, 0, 0, 0, FALSE
 };
@@ -111,6 +112,7 @@ GFX_DRIVER gfx_vesa_2l = 
    NULL, NULL, NULL, NULL,       /* no hardware cursor */
    NULL,                         /* no drawing mode hook */
    NULL, NULL,                   /* no state saving */
+   NULL,
    vesa_fetch_mode_list,         /* aye! */
    0, 0, FALSE, 0, 0, 0, 0, FALSE
 };
@@ -136,6 +138,7 @@ GFX_DRIVER gfx_vesa_3 = 
    NULL, NULL, NULL, NULL,       /* no hardware cursor */
    NULL,                         /* no drawing mode hook */
    NULL, NULL,                   /* no state saving */
+   NULL,
    vesa_fetch_mode_list,         /* aye! */
    0, 0, FALSE, 0, 0, 0, 0, FALSE
 };
Index: src/misc/modex.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/misc/modex.c,v
retrieving revision 1.31
diff -u -p -r1.31 modex.c
--- src/misc/modex.c	9 Nov 2004 18:51:09 -0000	1.31
+++ src/misc/modex.c	16 Jan 2005 12:13:32 -0000
@@ -205,6 +205,7 @@ GFX_DRIVER gfx_xtended =
    NULL, NULL, NULL, NULL,       /* no hardware cursor */
    NULL,                         /* no drawing mode hook */
    NULL, NULL,                   /* no state saving */
+   NULL,                         /* AL_METHOD(void, set_blender_mode, (int mode, int r, int g, int b, int a)); */
    xtended_fetch_mode_list,
    640, 400,
    TRUE,
Index: src/misc/vbeaf.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/misc/vbeaf.c,v
retrieving revision 1.20
diff -u -p -r1.20 vbeaf.c
--- src/misc/vbeaf.c	16 Oct 2004 19:45:32 -0000	1.20
+++ src/misc/vbeaf.c	16 Jan 2005 12:13:35 -0000
@@ -107,7 +107,7 @@ static void vbeaf_vline_a(BITMAP *bmp, i
 static void vbeaf_vline_b(BITMAP *bmp, int x, int y1, int y2, int color);
 static void vbeaf_line(BITMAP *bmp, int x1, int y1, int x2, int y2, int color);
 static void vbeaf_rectfill(BITMAP *bmp, int x1, int y1, int x2, int y2, int color);
-static int  vbeaf_triangle(BITMAP *bmp, int x1, int y1, int x2, int y2, int x3, int y3, int color);
+static void vbeaf_triangle(BITMAP *bmp, int x1, int y1, int x2, int y2, int x3, int y3, int color);
 static void vbeaf_draw_glyph(BITMAP *bmp, AL_CONST FONT_GLYPH *glyph, int x, int y, int color, int bg);
 static void vbeaf_draw_sprite(BITMAP *bmp, BITMAP *sprite, int x, int y);
 static void vbeaf_blit_from_memory(BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height);
@@ -2535,23 +2535,31 @@ static void vbeaf_rectfill(BITMAP *bmp, 
 /* vbeaf_triangle:
  *  Hardware accelerated triangle drawing function.
  */
-static int vbeaf_triangle(BITMAP *bmp, int x1, int y1, int x2, int y2, int x3, int y3, int color)
+static void vbeaf_triangle(BITMAP *bmp, int x1, int y1, int x2, int y2, int x3, int y3, int color)
 {
    AF_TRAP trap;
 
    /* bounding box test */
    if (bmp->clip) {
-      if ((x1 < bmp->cl) || (x2 < bmp->cl) || (x3 < bmp->cl))
-	 return ((x1 < bmp->cl) && (x2 < bmp->cl) && (x3 < bmp->cl));
-
-      if ((y1 < bmp->ct) || (y2 < bmp->ct) || (y3 < bmp->ct))
-	 return ((y1 < bmp->ct) && (y2 < bmp->ct) && (y3 < bmp->ct));
+      if ((x1 < bmp->cl) || (x2 < bmp->cl) || (x3 < bmp->cl)) {
+         _soft_triangle(bmp, x1, y1, x2, y2, x3, y3, color);
+	 return;
+      }
+      
+      if ((y1 < bmp->ct) || (y2 < bmp->ct) || (y3 < bmp->ct)) {
+         _soft_triangle(bmp, x1, y1, x2, y2, x3, y3, color);
+	 return;
+      }
 
-      if ((x1 >= bmp->cr) || (x2 >= bmp->cr) || (x3 >= bmp->cr))
-	 return ((x1 >= bmp->cr) && (x2 >= bmp->cr) && (x3 >= bmp->cr));
+      if ((x1 >= bmp->cr) || (x2 >= bmp->cr) || (x3 >= bmp->cr)) {
+         _soft_triangle(bmp, x1, y1, x2, y2, x3, y3, color);
+	 return;
+      }
 
-      if ((y1 >= bmp->cb) || (y2 >= bmp->cb) || (y3 >= bmp->cb))
-	 return ((y1 >= bmp->cb) && (y2 >= bmp->cb) && (y3 >= bmp->cb));
+      if ((y1 >= bmp->cb) || (y2 >= bmp->cb) || (y3 >= bmp->cb)) {
+         _soft_triangle(bmp, x1, y1, x2, y2, x3, y3, color);
+	 return;
+      }
    }
 
    /* sort along the vertical axis */


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