@@ -14,24 +14,24 @@ namespace m5avatar {
1414class Effect final : public Drawable {
1515 private:
1616 void drawBubbleMark (M5Canvas *spi, uint32_t x, uint32_t y, uint32_t r,
17- uint32_t color) {
17+ uint16_t color) {
1818 drawBubbleMark (spi, x, y, r, color, 0 );
1919 }
2020
2121 void drawBubbleMark (M5Canvas *spi, uint32_t x, uint32_t y, uint32_t r,
22- uint32_t color, float offset) {
22+ uint16_t color, float offset) {
2323 r = r + floor (r * 0.2 * offset);
2424 spi->drawCircle (x, y, r, color);
2525 spi->drawCircle (x - (r / 4 ), y - (r / 4 ), r / 4 , color);
2626 }
2727
2828 void drawSweatMark (M5Canvas *spi, uint32_t x, uint32_t y, uint32_t r,
29- uint32_t color) {
29+ uint16_t color) {
3030 drawSweatMark (spi, x, y, r, color, 0 );
3131 }
3232
3333 void drawSweatMark (M5Canvas *spi, uint32_t x, uint32_t y, uint32_t r,
34- uint32_t color, float offset) {
34+ uint16_t color, float offset) {
3535 y = y + floor (5 * offset);
3636 r = r + floor (r * 0.2 * offset);
3737 spi->fillCircle (x, y, r, color);
@@ -41,25 +41,25 @@ class Effect final : public Drawable {
4141 }
4242
4343 void drawChillMark (M5Canvas *spi, uint32_t x, uint32_t y, uint32_t r,
44- uint32_t color) {
44+ uint16_t color) {
4545 drawChillMark (spi, x, y, r, color, 0 );
4646 }
4747
4848 void drawChillMark (M5Canvas *spi, uint32_t x, uint32_t y, uint32_t r,
49- uint32_t color, float offset) {
49+ uint16_t color, float offset) {
5050 uint32_t h = r + abs (r * 0.2 * offset);
5151 spi->fillRect (x - (r / 2 ), y, 3 , h / 2 , color);
5252 spi->fillRect (x, y, 3 , h * 3 / 4 , color);
5353 spi->fillRect (x + (r / 2 ), y, 3 , h, color);
5454 }
5555
5656 void drawAngerMark (M5Canvas *spi, uint32_t x, uint32_t y, uint32_t r,
57- uint32_t color, uint32_t bColor) {
57+ uint16_t color, uint32_t bColor) {
5858 drawAngerMark (spi, x, y, r, color, bColor, 0 );
5959 }
6060
6161 void drawAngerMark (M5Canvas *spi, uint32_t x, uint32_t y, uint32_t r,
62- uint32_t color, uint32_t bColor, float offset) {
62+ uint16_t color, uint32_t bColor, float offset) {
6363 r = r + abs (r * 0.4 * offset);
6464 spi->fillRect (x - (r / 3 ), y - r, (r * 2 ) / 3 , r * 2 , color);
6565 spi->fillRect (x - r, y - (r / 3 ), r * 2 , (r * 2 ) / 3 , color);
@@ -68,12 +68,12 @@ class Effect final : public Drawable {
6868 }
6969
7070 void drawHeartMark (M5Canvas *spi, uint32_t x, uint32_t y, uint32_t r,
71- uint32_t color) {
71+ uint16_t color) {
7272 drawHeartMark (spi, x, y, r, color, 0 );
7373 }
7474
7575 void drawHeartMark (M5Canvas *spi, uint32_t x, uint32_t y, uint32_t r,
76- uint32_t color, float offset) {
76+ uint16_t color, float offset) {
7777 r = r + floor (r * 0.4 * offset);
7878 spi->fillCircle (x - r / 2 , y, r / 2 , color);
7979 spi->fillCircle (x + r / 2 , y, r / 2 , color);
@@ -90,8 +90,8 @@ class Effect final : public Drawable {
9090 Effect (const Effect &other) = default ;
9191 Effect &operator =(const Effect &other) = default ;
9292 void draw (M5Canvas *spi, BoundingRect rect, DrawContext *ctx) override {
93- uint32_t primaryColor = ctx->getColorDepth () == 1 ? 1 : ctx->getColorPalette ()->get (COLOR_PRIMARY );
94- uint32_t bgColor = ctx->getColorDepth () == 1 ? ERACER_COLOR : ctx->getColorPalette ()->get (COLOR_BACKGROUND );
93+ uint16_t primaryColor = ctx->getColorDepth () == 1 ? 1 : ctx->getColorPalette ()->get (COLOR_PRIMARY );
94+ uint16_t bgColor = ctx->getColorDepth () == 1 ? ERACER_COLOR : ctx->getColorPalette ()->get (COLOR_BACKGROUND );
9595 float offset = ctx->getBreath ();
9696 Expression exp = ctx->getExpression ();
9797 switch (exp) {
0 commit comments