Browse Source

garland: fix issue with division by zero in first scene setup

pull/2600/head
Dmitry Blinov 5 months ago
parent
commit
d3a26172c0
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      code/espurna/garland/scene.h

+ 3
- 3
code/espurna/garland/scene.h View File

@ -32,9 +32,9 @@ public:
void setAnim(Anim* anim) { _anim = anim; }
bool finishedAnimCycle() { return _anim ? _anim->finishedycle() : true; }
unsigned long getAvgCalcTime() { return sum_calc_time / calc_num; }
unsigned long getAvgPixlTime() { return sum_pixl_time / pixl_num; }
unsigned long getAvgShowTime() { return sum_show_time / show_num; }
unsigned long getAvgCalcTime() { return calc_num > 0 ? sum_calc_time / calc_num : 0; }
unsigned long getAvgPixlTime() { return pixl_num > 0 ? sum_pixl_time / pixl_num : 0; }
unsigned long getAvgShowTime() { return show_num > 0 ? sum_show_time / show_num : 0; }
int getNumShows() { return numShows; }
byte getBrightness() { return brightness; }
void setBrightness(byte value) { brightness = value; }


Loading…
Cancel
Save