This commit is contained in:
@ -3,34 +3,34 @@
|
||||
#include "config.h"
|
||||
|
||||
SingleDynamicEffect::SingleDynamicEffect() {
|
||||
init();
|
||||
init();
|
||||
}
|
||||
|
||||
void SingleDynamicEffect::init() {
|
||||
for (int i=0; i<tile_count; i++) tiles[i] = CHSV(baseHue + random8(64), 180, 255);
|
||||
for (int i=0; i<tile_count; i++) tiles[i] = CHSV(baseHue + random8(64), 180, 255);
|
||||
}
|
||||
|
||||
void SingleDynamicEffect::loop() {
|
||||
EVERY_N_MILLISECONDS( EFFECT_SINGLE_DYNAMIC_LOOP_TIME ) {
|
||||
tiles[random8(tile_count)] = CHSV(baseHue + random8(64), 180, 255);
|
||||
}
|
||||
this->draw();
|
||||
EVERY_N_MILLISECONDS( EFFECT_SINGLE_DYNAMIC_LOOP_TIME ) {
|
||||
tiles[random8(tile_count)] = CHSV(baseHue + random8(64), 180, 255);
|
||||
}
|
||||
this->draw();
|
||||
}
|
||||
|
||||
void SingleDynamicEffect::draw() {
|
||||
for (int x=0; x<window.w; x++) for (int y=0; y<window.h; y++) {
|
||||
int index = y/2 * window.w/2 + x/2;
|
||||
setPixel(window, x, y, tiles[index]);
|
||||
}
|
||||
for (int x=0; x<window.w; x++) for (int y=0; y<window.h; y++) {
|
||||
int index = y/2 * window.w/2 + x/2;
|
||||
setPixel(window, x, y, tiles[index]);
|
||||
}
|
||||
}
|
||||
|
||||
boolean SingleDynamicEffect::can_be_shown_with_clock() {
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void MultiDynamicEffect::loop() {
|
||||
EVERY_N_MILLISECONDS( EFFECT_MULTI_DYNAMIC_LOOP_TIME ) {
|
||||
for (int i=0; i<tile_count; i++) tiles[i] = CHSV(baseHue + random8(64), 180, 255);
|
||||
}
|
||||
this->draw();
|
||||
EVERY_N_MILLISECONDS( EFFECT_MULTI_DYNAMIC_LOOP_TIME ) {
|
||||
for (int i=0; i<tile_count; i++) tiles[i] = CHSV(baseHue + random8(64), 180, 255);
|
||||
}
|
||||
this->draw();
|
||||
}
|
||||
|
Reference in New Issue
Block a user