This commit is contained in:
parent
8bcee1871f
commit
205a0df842
@ -3,7 +3,7 @@
|
||||
#include <Arduino.h>
|
||||
#define FASTLED_INTERNAL
|
||||
#include <FastLED.h>
|
||||
#include "prototypes.h"
|
||||
#include "settings.h"
|
||||
|
||||
//#define DEBUG // Uncomment this to enable Debug messages via Serial and, if enabled, MQTT.
|
||||
//#define CONFIG_USABLE // Uncomment this by removing the // at the beginning!
|
||||
|
@ -75,7 +75,7 @@ bool Animation::_load_from_file(const char* filename) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (file.available() != size - 6) {
|
||||
if (file.available() < 0 || file.available() + 6 != size) {
|
||||
LOGln("Animation * Expected file to have %d bytes available, but found %d bytes available.", size - 6, file.available());
|
||||
file.close();
|
||||
return false;
|
||||
|
@ -42,13 +42,13 @@ void Window::clear(CRGB* color) {
|
||||
}
|
||||
|
||||
void Window::drawText(Font* font, uint16_t x, uint16_t y, String text, CRGB* color) {
|
||||
for (int i=0; i<text.length(); i++) {
|
||||
drawChar(font, (x+(i*(font->width + 1))<<8), (y<<8), text[i], color);
|
||||
for (uint16_t i=0; i<text.length(); i++) {
|
||||
drawChar(font, (x+((i*(font->width + 1))<<8)), (y<<8), text[i], color);
|
||||
}
|
||||
}
|
||||
|
||||
void Window::drawSubText(Font* font, accum88 x, accum88 y, String text, CRGB* color) {
|
||||
for (int i=0; i<text.length(); i++) {
|
||||
for (uint16_t i=0; i<text.length(); i++) {
|
||||
drawChar(font, x+(i*((font->width + 1)<<8)), y, text[i], color);
|
||||
}
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ RandomMatrixEffect::RandomMatrixEffect() {
|
||||
RainbowMatrixEffect::RainbowMatrixEffect() {
|
||||
// No need to initialize _columns, because that will have been done by ctor of MatrixEffect.
|
||||
for (int i=0; i<window->width; i++) {
|
||||
delete columns[i];
|
||||
delete _columns[i];
|
||||
_columns[i] = new RainbowMatrixEffectColumn(window, MatrixEffectColumn::DIR_SOUTH);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user