X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2Fgfxutil.c;h=259b56df444f26437bad98da460dc0d254d6249f;hp=cb51780ce37dfdb4b39f0a993010f08a9636e9c5;hb=2ee531a10bad1036d2279f9b626da72e345a3b37;hpb=a563d2f0efaa980af0f0b39cdf1c9115fed99d00 diff --git a/src/gfxutil.c b/src/gfxutil.c index cb51780..259b56d 100644 --- a/src/gfxutil.c +++ b/src/gfxutil.c @@ -1,3 +1,4 @@ +#include #include "gfxutil.h" #include "demo.h" @@ -100,7 +101,7 @@ void draw_line(int x0, int y0, int x1, int y1, unsigned short color) int i, dx, dy, x_inc, y_inc, error; unsigned short *fb = fb_pixels; - fb += y0 * fb_width + x0; + fb += y0 * FB_WIDTH + x0; dx = x1 - x0; dy = y1 - y0; @@ -112,9 +113,9 @@ void draw_line(int x0, int y0, int x1, int y1, unsigned short color) dx = -dx; } if(dy >= 0) { - y_inc = fb_width; + y_inc = FB_WIDTH; } else { - y_inc = -fb_width; + y_inc = -FB_WIDTH; dy = -dy; } @@ -149,20 +150,21 @@ void draw_line(int x0, int y0, int x1, int y1, unsigned short color) int sum = sptr[0] * (rad + 1); \ int count = (rad * 2 + 1) << 8; \ int midsize = w - rad * 2; \ + int firstpix = sptr[0]; \ int lastpix = sptr[pstep * (w - 1)]; \ /* add up the contributions for the -1 pixel */ \ for(j=0; j