--- usplash-theme-ubuntu.c.orig 2007-01-05 12:30:15.000000000 +0200 +++ usplash-theme-ubuntu.c 2007-01-05 14:12:06.000000000 +0200 @@ -269,28 +269,40 @@ void t_clear_progressbar_16(struct uspla void t_draw_progressbar(struct usplash_theme *theme, int percentage) { int w = (pixmap_throbber_back.width * percentage / 100); - usplash_put(theme->progressbar_x, theme->progressbar_y, &pixmap_throbber_back); - if(percentage == 0) - return; - if(percentage < 0) - usplash_put_part(theme->progressbar_x - w, theme->progressbar_y, pixmap_throbber_back.width + w, - pixmap_throbber_back.height, &pixmap_throbber_fore, -w, 0); - else - usplash_put_part(theme->progressbar_x, theme->progressbar_y, w, pixmap_throbber_back.height, - &pixmap_throbber_fore, 0, 0); + void *left, *right; + if (percentage >= 0) { + left = &pixmap_throbber_fore; + right = &pixmap_throbber_back; + } else { + left = &pixmap_throbber_back; + right = &pixmap_throbber_fore; + w *= -1; + } + usplash_put_part(theme->progressbar_x, theme->progressbar_y, + w, pixmap_throbber_back.height, + left, 0, 0); + usplash_put_part(theme->progressbar_x + w, theme->progressbar_y, + pixmap_throbber_back.width - w, pixmap_throbber_back.height, + right, w, 0); } void t_draw_progressbar_16(struct usplash_theme *theme, int percentage) { int w = (pixmap_throbber_back_16.width * percentage / 100); - usplash_put(theme->progressbar_x, theme->progressbar_y, &pixmap_throbber_back_16); - if (percentage == 0) - return; - if (percentage < 0) - usplash_put_part(theme->progressbar_x - w, theme->progressbar_y, pixmap_throbber_back_16.width + w, - pixmap_throbber_back_16.height, &pixmap_throbber_fore_16, -w, 0); - else - usplash_put_part(theme->progressbar_x, theme->progressbar_y, w, pixmap_throbber_back_16.height, - &pixmap_throbber_fore_16, 0, 0); + void *left, *right; + if (percentage >= 0) { + left = &pixmap_throbber_fore_16; + right = &pixmap_throbber_back_16; + } else { + left = &pixmap_throbber_back_16; + right = &pixmap_throbber_fore_16; + w *= -1; + } + usplash_put_part(theme->progressbar_x, theme->progressbar_y, + w, pixmap_throbber_back_16.height, + left, 0, 0); + usplash_put_part(theme->progressbar_x + w, theme->progressbar_y, + pixmap_throbber_back_16.width - w, pixmap_throbber_back_16.height, + right, w, 0); } void t_animate_step(struct usplash_theme* theme, int pulsating) {