Windows. Everything now is implemented in Windows. ;-) (Okay, just the drawing stuff. And defnititely nothing by Microsoft.)

This commit is contained in:
2019-06-11 19:48:09 +02:00
parent 9acdc42dc3
commit 83254f2eaa
25 changed files with 223 additions and 223 deletions

View File

@ -9,7 +9,7 @@ MatrixEffectColumn::MatrixEffectColumn(Window* win, int xPos) : MatrixEffectColu
window = win;
x = xPos;
start();
y = random8(0, win->h);
y = random8(0, window->height);
}
void MatrixEffectColumn::start() {
@ -21,16 +21,18 @@ void MatrixEffectColumn::start() {
void MatrixEffectColumn::advance() {
y++;
if (y-length > window->h) running = false;
if (y-length > window->height) running = false;
}
void MatrixEffectColumn::draw() {
for(int i=0; i<length; i++) {
CRGB color;
if (i==0) {
setPixel(*window, x, y-i, CRGB(255, 255, 255));
color = CRGB(255, 255, 255);
} else {
setPixel(*window, x, y-i, ColorFromPalette((CRGBPalette16)palette_matrix, 255 * (length - i) / length));
color = ColorFromPalette((CRGBPalette16)palette_matrix, 255 * (length - i) / length);
}
window->setPixel(x, y-i, &color);
}
}
@ -53,10 +55,10 @@ void MatrixEffectColumn::loop() {
boolean MatrixEffect::can_be_shown_with_clock() { return true; };
MatrixEffect::MatrixEffect() {
for (int i=0; i<LED_WIDTH; i++) columns[i] = MatrixEffectColumn(&window, i);
for (int i=0; i<LED_WIDTH; i++) columns[i] = MatrixEffectColumn(window, i);
}
void MatrixEffect::loop() {
clear(window);
for (int i=0; i<LED_WIDTH; i++) columns[i].loop();
window->clear();
for (int i=0; i<window->width; i++) columns[i].loop();
}