fixed bugs, added progress bar, and more
[dosdemo] / src / gfxutil.c
index 37eb4c5..a8d7edc 100644 (file)
@@ -1,3 +1,4 @@
+#include <string.h>
 #include "gfxutil.h"
 #include "demo.h"
 
@@ -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<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;
+       }
+
+}