From 8d3a5cfaae974703dee8e70117a0442aaecb24ff Mon Sep 17 00:00:00 2001 From: Christian Kroll Date: Sat, 17 May 2014 16:08:40 +0200 Subject: [PATCH] tuned moire pattern for LoL Shield --- src/animations/moire.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/animations/moire.c b/src/animations/moire.c index 16b0ef8..5d47cd6 100644 --- a/src/animations/moire.c +++ b/src/animations/moire.c @@ -25,8 +25,12 @@ void moire(void) { // add rotating color map -#if NUMPLANE == 3 +#if NUMPLANE == 3 && NUM_COLS == 16 && NUM_ROWS == 16 static unsigned char const gradient[] = {0, 1, 2, 3, 2, 1}; +# define WRAP 6u +#elif NUMPLANE == 3 && NUM_COLS == 14 && NUM_ROWS == 9 + static unsigned char const gradient[] = {0, 1, 1, 2, 2, 3, 3, 2, 2, 1, 1}; +# define WRAP 11u #else static unsigned char gradient[NUMPLANE * 2u] = {0}; for (unsigned char i = 1; i <= NUMPLANE; ++i) @@ -34,6 +38,7 @@ void moire(void) gradient[i] = i; gradient[(NUMPLANE * 2) - i] = i; } +# define WRAP (2u * NUMPLANE) #endif unsigned int cycles = 30000; @@ -81,7 +86,7 @@ void moire(void) wait(40); } // ensure the color index keeps within bounds - color_index %= (2u * NUMPLANE); + color_index %= WRAP; } }