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); }
/******** * Animate the spinner * helper function to aid in animation of spinner */ void spinner(struct usplash_theme* theme) { current_step = current_step + 1; int x0 = (spinner_part_width * current_step) - spinner_part_width; int y0 = 0; // if current step > number of images in the spinner, then reset to beginning (at end or circular spinner) if(current_step >= spinner_num_steps) { current_step = 0; } // call usplash_put_part for the small or large spinner image usplash_put_part(spinner_x, spinner_y, spinner_part_width, spinner_height, &pixmap_xbmc_spinner, x0, y0); }
void t_animate_step_16(struct usplash_theme* theme, int pulsating) { static int pulsate_step = 0; static int pulse_width = 28; static int step_width = 2; static int num_steps = 0; int x1; num_steps = (pixmap_throbber_fore.width - pulse_width)/2; if (pulsating) { t_draw_progressbar_16(theme, 0); if(pulsate_step < num_steps/2+1) x1 = 2 * step_width * pulsate_step; else x1 = pixmap_throbber_fore.width - pulse_width - 2 * step_width * (pulsate_step - num_steps/2+1); usplash_put_part(theme->progressbar_x + x1, theme->progressbar_y, pulse_width, pixmap_throbber_fore_16.height, &pixmap_throbber_fore_16, x1, 0); pulsate_step = (pulsate_step + 1) % num_steps; } }