From ceffdd6bbf4a5fcb53a3a9fda47b17c17684c8ff Mon Sep 17 00:00:00 2001 From: Hans-Gert Dahmen Date: Fri, 28 Oct 2011 23:42:20 +0000 Subject: [PATCH] added number of rounds specifier for matrix, updated default profiles --- animations/config.in | 3 ++- animations/matrix.c | 34 ++++++++++++++++++++-------------- profiles/borg-16 | 5 ++++- profiles/borg-ls | 2 ++ 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/animations/config.in b/animations/config.in index 9e988b3..5892009 100644 --- a/animations/config.in +++ b/animations/config.in @@ -18,7 +18,8 @@ comment "Animations" endmenu dep_bool_menu "Matrix" ANIMATION_MATRIX $RANDOM_SUPPORT - int "Number of streamers" STREAMER_NUM 30 + int "Number of streamers" MATRIX_STREAMER_NUM 30 + int "Run for this number of rounds" MATRIX_CYCLES 500 endmenu dep_bool "Random Bright" ANIMATION_RANDOM_BRIGHT $RANDOM_SUPPORT diff --git a/animations/matrix.c b/animations/matrix.c index afa7a49..d2c2b85 100644 --- a/animations/matrix.c +++ b/animations/matrix.c @@ -1,10 +1,16 @@ #include "../config.h" -#include +#include #include "../random/prng.h" #include "../pixel.h" #include "../util.h" +#ifndef MATRIX_CYCLES + #define MATRIX_CYCLES 500 +#endif +#ifndef MATRIX_STREAMER_NUM + #define MATRIX_STREAMER_NUM 30 +#endif typedef struct{ pixel start; @@ -31,8 +37,8 @@ inline static void set_bright(pixel_matrix_t *matrix, uint8_t x, uint8_t y, uint } void matrix() { - unsigned int counter = 500; /* run 500 cycles */ - streamer streamers[STREAMER_NUM]; + unsigned int counter = MATRIX_CYCLES; + streamer streamers[MATRIX_STREAMER_NUM]; pixel_matrix_t matrix_bright; unsigned char x, y; unsigned char index = 0; @@ -45,10 +51,10 @@ void matrix() { for(x=0;x (get_bright(&matrix_bright, str.start.x, str.start.y+j)<<6) ){ set_bright(&matrix_bright, str.start.x, str.start.y+j, bright>>6); - + } } bright-=((bright>>5)*str.decay); } - + str.len+=str.speed/2; streamers[i] = str; if(!draw){ @@ -70,25 +76,25 @@ void matrix() { } streamer_num--; i--; - } + } } - + for(y=NUM_ROWS;y--;) for(x=NUM_COLS;x--;){ setpixel((pixel){x,y}, get_bright(&matrix_bright,x,y)); } - + unsigned char nsc; for(nsc=0;nsc<6;nsc++){ - if(streamer_numNUM_ROWS-1) sy=0; streamers[streamer_num] = (streamer){{random8()%NUM_COLS, sy}, 0, (random8()%8)+12, index++,(random8()%16)+3}; - streamer_num++; + streamer_num++; } } - wait(60); - + wait(60); + } } diff --git a/profiles/borg-16 b/profiles/borg-16 index b7ea2d9..3fee42c 100644 --- a/profiles/borg-16 +++ b/profiles/borg-16 @@ -83,11 +83,14 @@ FEUER_N=5 FEUER_DIV=44 FEUER_DELAY=50 ANIMATION_MATRIX=y -STREAMER_NUM=30 +MATRIX_STREAMER_NUM=30 +MATRIX_CYCLES=500 ANIMATION_RANDOM_BRIGHT=y # ANIMATION_STONEFLY is not set # ANIMATION_FLYINGDOTS is not set ANIMATION_GAMEOFLIFE=y +GOL_DELAY=30 +GOL_CYCLES=180 # ANIMATION_BREAKOUT is not set # ANIMATION_MHERWEG is not set # ANIMATION_LTN_ANT is not set diff --git a/profiles/borg-ls b/profiles/borg-ls index accb094..5230f8e 100644 --- a/profiles/borg-ls +++ b/profiles/borg-ls @@ -80,6 +80,8 @@ ANIMATION_RANDOM_BRIGHT=y # ANIMATION_STONEFLY is not set # ANIMATION_FLYINGDOTS is not set ANIMATION_GAMEOFLIFE=y +GOL_DELAY=30 +GOL_CYCLES=180 # ANIMATION_BREAKOUT is not set # ANIMATION_MHERWEG is not set # ANIMATION_LTN_ANT is not set