Windows. Everything now is implemented in Windows. ;-) (Okay, just the drawing stuff. And defnititely nothing by Microsoft.)
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user