--- trunk/busybox/patches/busybox-1.19.0-fbsplash-tykef-1.0.patch 2011/09/05 17:48:40 1516 +++ trunk/busybox/patches/busybox-1.19.0-fbsplash-tykef-1.0.patch 2011/09/05 21:30:02 1517 @@ -58,7 +58,7 @@ default n # doesn't build on Ubuntu 8.04 diff -Naur busybox-1.19.0/miscutils/fbsplash.c busybox-1.19.0-magellan/miscutils/fbsplash.c --- busybox-1.19.0/miscutils/fbsplash.c 2011-08-11 02:23:58.000000000 +0200 -+++ busybox-1.19.0-magellan/miscutils/fbsplash.c 2011-09-05 21:00:45.000000000 +0200 ++++ busybox-1.19.0-magellan/miscutils/fbsplash.c 2011-09-06 01:04:13.000000000 +0200 @@ -1,6 +1,7 @@ /* vi: set sw=4 ts=4: */ /* @@ -425,7 +425,7 @@ close(fbfd); } -@@ -140,142 +407,50 @@ +@@ -140,142 +407,60 @@ /** @@ -565,6 +565,16 @@ + fb_sprite(G.nbar_posx + w0 + w1, G.nbar_posy, w0 + w1, w2, G.spb1, 0); // right "empty" area } ++static struct sprite *fb_newsprite(int pw, int ph, int scrx, int scry) { ++ struct sprite *s; ++ s=xmalloc(sizeof(struct sprite) + ++ ph * pw * G.bytes_per_pixel); ++ s->w = pw; ++ s->h = ph; ++ s->bw = pw * G.bytes_per_pixel; ++ if (scrx >= 0) fb_getsprite(scrx, scry, s); // read ++ return s; ++} /** - * Draw image from PPM file @@ -600,7 +610,7 @@ /* Parse ppm header: * - Magic: two characters "P6". * - Whitespace (blanks, TABs, CRs, LFs). -@@ -289,53 +464,721 @@ +@@ -289,55 +474,723 @@ * - A raster of Width * Height pixels in triplets of rgb * in pure binary by 1 or 2 bytes. (we support only 1 byte) */ @@ -689,12 +699,12 @@ + p->buftail = i; + } else { + p->buftail = 0; - } ++ } + while (p->buftail < (p->sizx * 3)) { + i=read(p->fd, &(p->buf[p->buftail]), (p->sizx * 3) - p->buftail); + if (i < 0) return NULL; + p->buftail += i; -+ } + } + p->bufhead = p->sizx * 3; + return &(p->buf[0]); +} @@ -778,13 +788,11 @@ + sprpix += G.bytes_per_pixel; + } + } - pixel += 3; ++ pixel += 3; + rgbpix += G.bytes_per_pixel; - } ++ } + fb_putpixrow(G.x0,j + G.y0,width,rgbline); - } -- free(pixline); -- fclose(theme_file); ++ } + free(rgbline); + ppm_close(ppm); + // recalc cfg if centered image @@ -828,7 +836,7 @@ + thispix = makecol(pixel[0],pixel[1],pixel[2]); + } + memcpy(rgbpix,&thispix,G.bytes_per_pixel); -+ pixel += 3; + pixel += 3; + rgbpix += G.bytes_per_pixel; + } + } @@ -837,8 +845,8 @@ +readsprites_out: + if (s != NULL) free(s); + return NULL; - } - ++} ++ +#define fb_putanim(x,y,n,s) fb_sprite(x + G.x0,y + G.y0,s->h * n,s->h,s,0) +#endif + @@ -931,7 +939,7 @@ + g = GF.glyphs + GF.ud.entries[i].fontpos * GF.charsize; + break; + } -+ } + } +#endif + } + *s=c; @@ -971,11 +979,13 @@ + fb_putpixel(nXPos + x, nYPos + y,thispix); + } + } -+ } -+} -+ -+ -+/** + } +- free(pixline); +- fclose(theme_file); + } + + + /** + * Draws a string on framebuffer. + * \param *strString pointer to the string. + */ @@ -1354,10 +1364,12 @@ +} +#endif // FONTLOAD +#endif // TEXT - - /** ++ ++/** * Parse configuration file -@@ -347,6 +1190,9 @@ + * \param *cfg_filename name of the configuration file + */ +@@ -347,6 +1200,9 @@ "BAR_WIDTH\0" "BAR_HEIGHT\0" "BAR_LEFT\0" "BAR_TOP\0" "BAR_R\0" "BAR_G\0" "BAR_B\0" @@ -1367,7 +1379,7 @@ #if DEBUG "DEBUG\0" #endif -@@ -354,15 +1200,15 @@ +@@ -354,15 +1210,15 @@ char *token[2]; parser_t *parser = config_open2(cfg_filename, xfopen_stdin); while (config_read(parser, token, 2, 2, "#=", @@ -1386,7 +1398,7 @@ G.bdebug_messages = val; if (G.bdebug_messages) G.logfile_fd = xfopen_for_write("/tmp/fbsplash.log"); -@@ -376,11 +1222,24 @@ +@@ -376,11 +1232,24 @@ int fbsplash_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int fbsplash_main(int argc UNUSED_PARAM, char **argv) { @@ -1414,7 +1426,7 @@ INIT_G(); -@@ -388,9 +1247,19 @@ +@@ -388,9 +1257,19 @@ fb_device = "/dev/fb0"; cfg_filename = NULL; fifo_filename = NULL; @@ -1435,7 +1447,7 @@ // parse configuration file if (cfg_filename) init(cfg_filename); -@@ -406,8 +1275,20 @@ +@@ -406,8 +1285,20 @@ full_write(STDOUT_FILENO, "\033[?25l", 6); } @@ -1456,7 +1468,7 @@ if (!fifo_filename) return EXIT_SUCCESS; -@@ -424,31 +1305,137 @@ +@@ -424,31 +1315,137 @@ // when last writer closes input end. // The simplest way is to open fifo for writing too // and become an additional writer :)