lavat

Un fork de lavat pour pouvoir y ajouter des titres - retour accueil

git clone git://bebou.netlib.re/lavat
Log | Files | Refs | README | LICENSE |

commit f1cfe6bab6f4e3762b1a0e29122f318741984deb
parent 17c79557bce8f7160cbc50d945cd67472ac76f3a
Auteurice: AngelJumbo <anarjumb@gmail.com>
Date:   Sat, 26 Nov 2022 23:22:57 -0500

More speed values

Diffstat:
MREADME.md | 2+-
Mlavat.c | 11++++++-----
2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md @@ -24,7 +24,7 @@ Usage: lavat [OPTIONS] OPTIONS: -c <COLOR> Set color. Available colours: red, blue, yellow, green, cyan and magenta. Besides those colors the default one is the normal foreground of your terminal. - -s <SPEED> Set the speed, from 1 to 5. (default 1) + -s <SPEED> Set the speed, from 1 to 10. (default 5) -r <RADIUS> Set the radius of the metaballs, from 1 to 10. (default: 5) -R <RIM> Set a rim for each metaball, sizes from 1 to 5.(default: none) This option does not work with the default color. diff --git a/lavat.c b/lavat.c @@ -18,7 +18,7 @@ static char *custom = NULL; static short color = TB_DEFAULT; static short color2 = TB_DEFAULT; static int nballs = 10; -static short speedMult = 1; +static short speedMult = 5; static short rim = 0; static short contained = 0; static float radius = 100; @@ -47,7 +47,8 @@ int main(int argc, char *argv[]) { int maxX = tb_width(); int maxY = tb_height() * 2; - int speed = (((1 / (float)(maxX + maxY)) * 5000000) + 50000) / speedMult; + speedMult = 11 - speedMult; + int speed = (((1 / (float)(maxX + maxY)) * 1000000) + 10000) * speedMult; radius = (radius * radius + (float)(maxX * maxY)) / 15000; int margin = contained ? radius * 10 : 0; @@ -191,8 +192,8 @@ int parse_options(int argc, char *argv[]) { break; case 's': speedMult = atoi(optarg); - if (speedMult > 5 || speedMult <= 0) { - printf("Invalid speed, only values between 1 and 5 are allowed\n"); + if (speedMult > 10 || speedMult <= 0) { + printf("Invalid speed, only values between 1 and 10 are allowed\n"); return 0; } break; @@ -250,7 +251,7 @@ void print_help() { "green, cyan and magenta. \n" " Besides those colors the default one is the normal" " foreground of your terminal.\n" - " -s <SPEED> Set the speed, from 1 to 5. (default 1)\n" + " -s <SPEED> Set the speed, from 1 to 10. (default 5)\n" " -r <RADIUS> Set the radius of the metaballs, from 1 to 10. " "(default: 5)\n" " -R <RIM> Set a rim for each metaball, sizes from 1 to 5."