+#include <string.h>
#include "gfxutil.h"
#include "demo.h"
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;
dx = -dx;
}
if(dy >= 0) {
- y_inc = fb_width;
+ y_inc = FB_WIDTH;
} else {
- y_inc = -fb_width;
+ y_inc = -FB_WIDTH;
dy = -dy;
}
*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<height; i++) {
+ memcpy(dest, src, width * 2);
+ dest += 320;
+ src += pitch_pix;
+ }
+}
+
+void blitfb_key(uint16_t *dest, uint16_t *src, int width, int height, int pitch_pix, uint16_t key)
+{
+ int i, j, dadv = 320 - width;
+
+ for(i=0; i<height; i++) {
+ for(j=0; j<width; j++) {
+ uint16_t scol = *src++;
+ if(scol != key) *dest = scol;
+ dest++;
+ }
+ dest += dadv;
+ }
+
+}