MatrixEffect now uses dynamically allocated memory.
This commit is contained in:
@ -55,10 +55,18 @@ 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);
|
||||
}
|
||||
|
||||
void MatrixEffect::start() {
|
||||
_columns = new MatrixEffectColumn[LED_WIDTH];
|
||||
for (int i=0; i<LED_WIDTH; i++) _columns[i] = MatrixEffectColumn(window, i);
|
||||
}
|
||||
|
||||
void MatrixEffect::stop() {
|
||||
delete[] _columns;
|
||||
}
|
||||
|
||||
void MatrixEffect::loop() {
|
||||
window->clear();
|
||||
for (int i=0; i<window->width; i++) columns[i].loop();
|
||||
for (int i=0; i<window->width; i++) _columns[i].loop();
|
||||
}
|
||||
|
Reference in New Issue
Block a user