@@ -21,9 +21,9 @@ struct RgbfColor : RgbColor {
2121 RgbfColor (uint8_t r, uint8_t g, uint8_t b) : RgbColor(r, g, b) {
2222 Flags = F_NULL;
2323 }
24- RgbfColor (RgbColor rgb, uint f) : RgbColor(rgb) { Flags = f; }
25- RgbfColor (HsbColor hsb, uint f) : RgbColor(hsb) { Flags = f; }
26- RgbfColor (uint8_t h, uint f) : RgbColor(h) { Flags = f; }
24+ RgbfColor (RgbColor rgb, uint32_t f) : RgbColor(rgb) { Flags = f; }
25+ RgbfColor (HsbColor hsb, uint32_t f) : RgbColor(hsb) { Flags = f; }
26+ RgbfColor (uint8_t h, uint32_t f) : RgbColor(h) { Flags = f; }
2727
2828 void changeRgb (RgbColor color) {
2929 R = color.R ;
@@ -56,15 +56,15 @@ struct RgbfColor : RgbColor {
5656 uint8_t getFlags () { return Flags; }
5757
5858protected:
59- uint Flags;
59+ uint32_t Flags;
6060};
6161struct RgbaColor : RgbfColor {
6262 RgbaColor () : RgbfColor() { Alpha = 255 ; };
6363 RgbaColor (RgbColor rgb) : RgbfColor(rgb) { Alpha = 255 ; }
6464 RgbaColor (uint8_t h) : RgbfColor(h) { Alpha = 255 ; }
65- RgbaColor (RgbColor rgb, uint f) : RgbfColor(rgb, f) { Alpha = 255 ; }
66- RgbaColor (HsbColor hsb, uint f) : RgbfColor(hsb, f) { Alpha = 255 ; }
67- RgbaColor (uint8_t h, uint f) : RgbfColor(h, f) { Alpha = 255 ; }
65+ RgbaColor (RgbColor rgb, uint32_t f) : RgbfColor(rgb, f) { Alpha = 255 ; }
66+ RgbaColor (HsbColor hsb, uint32_t f) : RgbfColor(hsb, f) { Alpha = 255 ; }
67+ RgbaColor (uint8_t h, uint32_t f) : RgbfColor(h, f) { Alpha = 255 ; }
6868 // ---------------------
6969 RgbaColor (RgbColor rgb, float a) : RgbfColor(rgb) {
7070 Alpha = (uint8_t )(a * 255 );
@@ -122,7 +122,7 @@ class Animation {
122122protected:
123123 uint16_t phase = 0 ;
124124 bool matrixChanged = false ;
125- uint animationDelay = 100 ;
125+ uint32_t animationDelay = 100 ;
126126 Animation_t animType = KEINE;
127127 uint32_t nextActionTime = 0 ;
128128 uint8_t lastMinute = 100 ;
@@ -198,7 +198,7 @@ class Rain {
198198 }
199199 virtual ~Rain (){};
200200
201- void begin (int frames, int stop, uint8_t helligkeit) {
201+ void begin (int32_t frames, int32_t stop, uint8_t helligkeit) {
202202 white = RgbaColor (helligkeit, 1 .0f );
203203 // white.Lighten(helligkeit);
204204 green = RgbaColor (0 , helligkeit, 0 , 0.5 );
@@ -217,11 +217,11 @@ class Rain {
217217 stopPhase = frames - speedlimit * max_rows;
218218 }
219219
220- RgbaColor get (int r) {
221- int row = (max_rows - 1 - r);
220+ RgbaColor get (int32_t r) {
221+ int32_t row = (max_rows - 1 - r);
222222 // pro Bild laeuft row von (max_rows - 1) runter auf 0
223223
224- int pos = (row + offset) % (deadtime + lifetime);
224+ int32_t pos = (row + offset) % (deadtime + lifetime);
225225
226226 if (row == 0 ) { // letzte row faer dieses Bild
227227 if (phase++ == stopPhase) {
@@ -263,8 +263,8 @@ class Rain {
263263
264264protected:
265265 uint8_t max_rows, max_cols;
266- int speed, speedlimit, offset, lifetime, deadtime;
267- int phase, frames, stopPhase, stopLine, stopTop, stopBottom;
266+ int32_t speed, speedlimit, offset, lifetime, deadtime;
267+ int32_t phase, frames, stopPhase, stopLine, stopTop, stopBottom;
268268 bool stopping;
269269 RgbaColor white = RgbaColor(255 , 255 , 255 , 0.9 );
270270 RgbaColor green = RgbaColor(0 , 255 , 0 , 0.75 );
@@ -282,8 +282,8 @@ class Ball {
282282 }
283283 virtual ~Ball (){};
284284
285- void begin (int row, int column, RgbfColor foreground, RgbfColor background ,
286- int delay) {
285+ void begin (int32_t row, int32_t column, RgbfColor foreground,
286+ RgbfColor background, int32_t delay) {
287287 this ->delay = delay;
288288 y = row << 8 ; // increase precision
289289 r = row;
@@ -300,11 +300,11 @@ class Ball {
300300 // x = 0, y = 0 -> links oben
301301 // x = 10, y = 9 -> rechts unten
302302 // v positiv -> nach unten
303- int move (int timedelta) {
303+ int32_t move (int32_t timedelta) {
304304 if (!end) {
305305 delay -= timedelta;
306306 if (delay <= 0 ) {
307- int _vy = vy;
307+ int32_t _vy = vy;
308308 y += (((g * timedelta) / 1000 ) * timedelta) / 2000 +
309309 (vy * timedelta) / 1000 ;
310310 vy += (g * timedelta) / 1000 ;
@@ -325,13 +325,13 @@ class Ball {
325325 }
326326
327327public:
328- int r, c; // after calling move() r and c contain new actual values
328+ int32_t r, c; // after calling move() r and c contain new actual values
329329 RgbfColor color;
330330
331331protected:
332- int unten;
333- int lastPos;
334- int g, vy, y, end, delay;
332+ int32_t unten;
333+ int32_t lastPos;
334+ int32_t g, vy, y, end, delay;
335335 bool lastDown;
336336 RgbfColor colorForeground, colorBackground;
337337};
@@ -365,7 +365,7 @@ class Snake {
365365 GoToPos *motions;
366366 Coord head;
367367 bool goRight;
368- int index;
368+ int32_t index;
369369 std::queue<Coord> snake;
370370 RgbfColor **work;
371371 RgbfColor **old;
@@ -418,7 +418,7 @@ class Snake {
418418 while (rowCounter-- > 0 ) {
419419 left = max_cols;
420420 right = 0 ;
421- for (int col = 0 ; col < max_cols; col++) {
421+ for (int32_t col = 0 ; col < max_cols; col++) {
422422 if (matrix[row][col].isForeground ()) {
423423 // search for right most foreground
424424 right = col;
@@ -485,7 +485,7 @@ class Firework {
485485 RgbColor colors[3 ];
486486 Icons icons[3 ];
487487 bool mirrored;
488- int maxLayer;
488+ int32_t maxLayer;
489489 uint8_t max_rows, max_cols;
490490
491491public:
@@ -495,7 +495,7 @@ class Firework {
495495 }
496496
497497 // layers must be prepared in ascending order !!!
498- void prepare (int layer, RgbColor &color, Icons icon, bool mirrored) {
498+ void prepare (int32_t layer, RgbColor &color, Icons icon, bool mirrored) {
499499 if (layer == 0 ) {
500500 icons[1 ] = static_cast <Icons>(0 );
501501 icons[2 ] = static_cast <Icons>(0 );
@@ -507,13 +507,13 @@ class Firework {
507507 }
508508
509509 bool getPixel (uint8_t r, uint8_t c, RgbColor &color) {
510- // void Animation::copyBlock(RgbfColor color, uint block, bool fgbg,
510+ // void Animation::copyBlock(RgbfColor color, uint32_t block, bool fgbg,
511511 // bool mirrored,
512512 // bool init) {
513513
514514 if ((r < 10 ) && (r < max_rows) && (c < 11 ) && (c < max_cols)) {
515515 uint16_t pixels = 0 ;
516- for (int layer = 0 ; layer <= maxLayer; layer++) {
516+ for (int32_t layer = 0 ; layer <= maxLayer; layer++) {
517517 if (icons[layer] != static_cast <Icons>(0 )) {
518518 pixels = animation->reverse (
519519 pgm_read_word (&(grafik_11x10[icons[layer]][r])),
0 commit comments