altos/draw: Add logo
[fw/altos] / src / draw / ao_line.c
index ed1fc21c89b38c592f841543316816a6a34823e9..318f101e05b4edaadb93891bfdb9f69174d1248f 100644 (file)
@@ -12,7 +12,6 @@
  * General Public License for more details.
  */
 
-#include "ao.h"
 #include "ao_draw.h"
 #include "ao_draw_int.h"
 
@@ -80,12 +79,12 @@ ao_bres(const struct ao_bitmap      *dst_bitmap,
        if (signdx < 0)
                mask0 = ao_right(1, AO_UNIT - 1);
 
-       if (signdy < 0)
-               stride = -stride;
-
        dst = dst + y1 * stride + (x1 >> AO_SHIFT);
        mask = ao_right(1, x1 & AO_MASK);
 
+       if (signdy < 0)
+               stride = -stride;
+
        while (len--) {
                /* clip each point */
 
@@ -159,28 +158,28 @@ ao_clip_line(struct ao_cc *c, struct ao_cbox *b)
        /* Clip major axis */
        if (c->major < b->maj1) {
                if (c->sign_major <= 0)
-                       return FALSE;
+                       return false;
                adjust_major = b->maj1 - c->major;
        } else if (c->major >= b->maj2) {
                if (c->sign_major >= 0)
-                       return FALSE;
+                       return false;
                adjust_major = c->major - (b->maj2-1);
        }
 
        /* Clip minor axis */
        if (c->minor < b->min1) {
                if (c->sign_minor <= 0)
-                       return FALSE;
+                       return false;
                adjust_minor = b->min1 - c->minor;
        } else if (c->minor >= b->min2) {
                if (c->sign_minor >= 0)
-                       return FALSE;
+                       return false;
                adjust_minor = c->minor - (b->min2-1);
        }
 
        /* If unclipped, we're done */
        if (adjust_major == 0 && adjust_minor == 0)
-               return TRUE;
+               return true;
 
        /* See how much minor adjustment would happen during
         * a major clip. This is a bit tricky because line drawing
@@ -208,7 +207,7 @@ ao_clip_line(struct ao_cc *c, struct ao_cbox *b)
        c->major += c->sign_major * adjust_major;
        c->minor += c->sign_minor * adjust_minor;
 
-       return TRUE;
+       return true;
 }
 
 void
@@ -276,8 +275,8 @@ ao_line(const struct ao_bitmap      *dst,
        e3 = e2 - e1;
        e = e - e1;
 
-       clip_1.first = TRUE;
-       clip_2.first = FALSE;
+       clip_1.first = true;
+       clip_2.first = false;
        clip_2.e = clip_1.e = e;
        clip_2.e1 = clip_1.e1 = e1;
        clip_2.e3 = clip_1.e3 = e3;