diff --git a/include/pbsplash.h b/include/pbsplash.h index b855f28..99a496f 100644 --- a/include/pbsplash.h +++ b/include/pbsplash.h @@ -10,6 +10,6 @@ struct col { }; }; -void animate_frame(int frame, int w, int h, long dpi); +void animate_frame(int frame, int w, int y_off, long dpi); #endif diff --git a/src/animate.c b/src/animate.c index 99e46b5..9f03a66 100644 --- a/src/animate.c +++ b/src/animate.c @@ -8,18 +8,18 @@ struct col color = { .r = 255, .g = 255, .b = 255, .a = 255 }; #define PI 3.1415926535897932384626433832795 -#define n_circles 5 +#define n_circles 3 -#define speed 3 +#define speed 5 void circles_wave(int frame, int w, int y_off, long dpi) { unsigned int t_col = tfb_make_color(color.r, color.g, color.b); int f = frame * speed; - int rad = (int)(dpi * 4 / 96.0); - int dist = rad * 4; - int amplitude = rad * 2; + int rad = (int)(dpi * 3 / 96.0); + int dist = rad * 3; + int amplitude = rad * 1; int left = (w / 2) - (dist * (n_circles - 1) / 2.0); for (unsigned int i = 0; i < n_circles; i++) { @@ -28,11 +28,11 @@ void circles_wave(int frame, int w, int y_off, long dpi) int y = y_off + offset * amplitude; tfb_fill_rect(x - rad - 1, y_off - amplitude - rad, rad * 2 + 2, amplitude * 2 + rad * 2 + 1, tfb_black); - tfb_fill_circle(x, y, rad, t_col); + tfb_draw_circle(x, y, rad, t_col); } } -void animate_frame(int frame, int w, int h, long dpi) +void animate_frame(int frame, int w, int y_off, long dpi) { - circles_wave(frame, w, h * 0.75, dpi); + circles_wave(frame, w, y_off, dpi); } diff --git a/src/pbsplash.c b/src/pbsplash.c index 573ea66..81e6304 100644 --- a/src/pbsplash.c +++ b/src/pbsplash.c @@ -364,7 +364,7 @@ int main(int argc, char **argv) &textHeight); int tx = screenWidth / 2.f - textWidth / 2.f; - int ty = y + image_h + textHeight * 0.5f + MM_TO_PX(dpi, 2); + int ty = y + image_h + textHeight * 0.5f + MM_TO_PX(dpi, 20); draw_text(font, message, tx, ty, textWidth, textHeight, fontsz, tfb_gray); @@ -375,8 +375,9 @@ int main(int argc, char **argv) int frame = 0; int tty = open(active_tty, O_RDWR); + float y_off = y + image_h + MM_TO_PX(dpi, 5); while (!terminate) { - animate_frame(frame++, screenWidth, screenHeight, dpi); + animate_frame(frame++, screenWidth, y_off, dpi); tfb_flush_fb(); }