fbsplash enhancement - text rendering, animations...

Denys Vlasenko vda.linux at googlemail.com
Wed Sep 23 23:55:36 UTC 2009


On Tuesday 01 September 2009 13:06, Jiří Gabriel wrote:
> Hello.
> I use the BusyBox in embedded kiosk like system. Whole system is 
> running on framebuffer interface. Graphical boot is very useful for 
> me, but the color depth is only 16bpp and unusable therefore I 
> started to modifying fbsplash for other resolutions and other 
> capabilities using text rendering patch from mailing lists. Only one
> size of font, special font generating and hardcoding into 
> application is very unusable for many people. The psf consolefonts 
> is available and usable... 
> After finish all my modifications to fbsplash it is now usable for 
> me, and I hope for others to, but there may be a small problem the 
> file is now too big (7k) for BusyBox.

Wow.

> In any case if you or somebody else are interested you can download 
> it from http://tykef.havlinda.net/programovani/fbsplash. You find 
> there source, description and example of using this applet.

The patch needs to be rediffed so that it is an ordinary unidiff,
without these lines with leading '!'.

Some places need some polishing with indentation and style.
This does not look right:

!                       }
!               } else {
!                 if (fp == stdin && feof(fp)) break; // stdin closed END
!               }
!               if (tim.tv_usec == 0) {  // timeout - anime
!                       tim.tv_usec = 100000;
!                   if (bounce_x >= 0) {
!                   bounce_x += 5;
!                   if (bounce_x > 160) bounce_x = 0;
!                       if (bounce_x > 80)
!                           fb_drawnbar(160 - bounce_x,180 - bounce_x);
!                 else
!                     fb_drawnbar(bounce_x, bounce_x + 20);
!                   }
! #if ENABLE_FEATURE_FBSPLASH_SPRITES
!                   if (spa != NULL && anim_t != 0) {
!                           --anim_now;
!                       if (anim_now <= 0) {
!                               anim_now = anim_t; // wait
!                               if (anim_n < anim_m) {
!                                       anim_p++;
!                                       if (anim_p > anim_m) anim_p = anim_n;
!                               } else {
!                                       anim_p--;
!                                       if (anim_p < anim_m) anim_p = anim_n;
!                               }
!                               fb_putanim(anim_x,anim_y,anim_p,spa);
!                       }
!             }
  #endif
                }
        }


Here, style is not consistent at all:

!               if (num != 0 && fgets(num_buf,sizeof(num_buf) - 1,fp) != NULL) {
!                       num_buf[sizeof(num_buf) - 1]=0;
!                       num=strlen(num_buf) - 1;
!                       if (num >= 0 && num_buf[num]==10) num_buf[num]=0;
!                       if (strncmp(num_buf, "exit", 4) == 0) {


You may free(NULL) without checking:

! #if ENABLE_FEATURE_FBSPLASH_SPRITES
!       if (spa != NULL) free(spa);
! #endif


Are you willing to submit it for inclusion?
--
vda


More information about the busybox mailing list