X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2Fgfxutil.c;h=259b56df444f26437bad98da460dc0d254d6249f;hp=37eb4c5ea12d2fcb244836615f4c4ea949bb4c08;hb=59c564d8a2077ce90e7c83fdb276b80c9bfa238c;hpb=e7220b01f07d1df5a45fe7c83608d4157881956a diff --git a/src/gfxutil.c b/src/gfxutil.c index 37eb4c5..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; } @@ -215,3 +216,28 @@ void convimg_rgb24_rgb16(uint16_t *dest, unsigned char *src, int xsz, int ysz) *dest++ = PACK_RGB16(r, g, b); } } + +void blitfb(uint16_t *dest, uint16_t *src, int width, int height, int pitch_pix) +{ + int i; + for(i=0; i