[AD] guiproc.c patch, more speed for `dotted_rect'

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


See this patch, the function `dotted_rect' works much faster
in slow computers.

- David A. Capello

davidcapello@xxxxxxxxxx - http://come.to/davidcapello/

diff -Nu --recursive oldallegro/src/guiproc.c newallegro/src/guiproc.c
--- oldallegro/src/guiproc.c	Sat Nov 11 03:30:24 2000
+++ newallegro/src/guiproc.c	Thu Dec 28 23:11:50 2000
@@ -110,10 +110,11 @@
    int x = ((x1+y1) & 1) ? 1 : 0;
    int c;
 
-   for (c=x1; c<=x2; c++) {
+   for (c=x1; c<=x2; c++)
       putpixel(screen, c, y1, (((c+y1) & 1) == x) ? fg : bg);
+
+   for (c=x1; c<=x2; c++)
       putpixel(screen, c, y2, (((c+y2) & 1) == x) ? fg : bg);
-   }
 
    for (c=y1+1; c<y2; c++) {
       putpixel(screen, x1, c, (((c+x1) & 1) == x) ? fg : bg);


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