Browse Source

tuned moire pattern for LoL Shield

feature/2015
Christian Kroll 11 years ago
parent
commit
8d3a5cfaae
  1. 9
      src/animations/moire.c

9
src/animations/moire.c

@ -25,8 +25,12 @@
void moire(void) void moire(void)
{ {
// add rotating color map // 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}; 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 #else
static unsigned char gradient[NUMPLANE * 2u] = {0}; static unsigned char gradient[NUMPLANE * 2u] = {0};
for (unsigned char i = 1; i <= NUMPLANE; ++i) for (unsigned char i = 1; i <= NUMPLANE; ++i)
@ -34,6 +38,7 @@ void moire(void)
gradient[i] = i; gradient[i] = i;
gradient[(NUMPLANE * 2) - i] = i; gradient[(NUMPLANE * 2) - i] = i;
} }
# define WRAP (2u * NUMPLANE)
#endif #endif
unsigned int cycles = 30000; unsigned int cycles = 30000;
@ -81,7 +86,7 @@ void moire(void)
wait(40); wait(40);
} }
// ensure the color index keeps within bounds // ensure the color index keeps within bounds
color_index %= (2u * NUMPLANE); color_index %= WRAP;
} }
} }

Loading…
Cancel
Save