+ /* Basic unantialiased Bresenham line algorithm */
+ int lg_delta, sh_delta, cycle, lg_step, sh_step;
+ Uint32 color = SDL_MapRGBA(screen->format, r, g, b, a);
+
+ lg_delta = x2 - x1;
+ sh_delta = y2 - y1;
+ lg_step = SGN(lg_delta);
+ lg_delta = ABS(lg_delta);
+ sh_step = SGN(sh_delta);
+ sh_delta = ABS(sh_delta);
+ if (sh_delta < lg_delta)
+ {
+ cycle = lg_delta >> 1;
+ while (x1 != x2)
+ {
+ drawpixel(x1, y1, color);
+ cycle += sh_delta;
+ if (cycle > lg_delta)
+ {
+ cycle -= lg_delta;
+ y1 += sh_step;
+ }
+ x1 += lg_step;
+ }
+ drawpixel(x1, y1, color);
+ }
+ cycle = sh_delta >> 1;
+ while (y1 != y2)
+ {
+ drawpixel(x1, y1, color);
+ cycle += lg_delta;
+ if (cycle > sh_delta)
+ {
+ cycle -= sh_delta;
+ x1 += lg_step;
+ }
+ y1 += sh_step;
+ }
+ drawpixel(x1, y1, color);
+#ifndef NOOPENGL