From cfcb9c6632767c89f2960fa3b19dce785cbf7abc Mon Sep 17 00:00:00 2001 From: Bodmer Date: Wed, 5 Aug 2020 23:13:59 +0100 Subject: [PATCH] Revert "Elimnate some warnings #702" This reverts commit 31125ca5ac859e141af0a37a06dda816ba9f3ca0. --- Extensions/Sprite.cpp | 52 +++++++++++++++++++++---------------------- Extensions/Sprite.h | 14 ++++++------ 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/Extensions/Sprite.cpp b/Extensions/Sprite.cpp index a8bd4f3..26f2296 100644 --- a/Extensions/Sprite.cpp +++ b/Extensions/Sprite.cpp @@ -33,8 +33,8 @@ TFT_eSprite::TFT_eSprite(TFT_eSPI *tft) _xptr = 0; // pushColor coordinate _yptr = 0; - _xPivot = 0; - _yPivot = 0; + _xpivot = 0; + _ypivot = 0; _colorMap = nullptr; @@ -69,8 +69,8 @@ void* TFT_eSprite::createSprite(int16_t w, int16_t h, uint8_t frames) _sh = h; _scolor = TFT_BLACK; - _xPivot = w/2; - _yPivot = h/2; + _xpivot = w/2; + _ypivot = h/2; _img8 = (uint8_t*) callocSprite(w, h, frames); _img8_1 = _img8; @@ -397,8 +397,8 @@ void TFT_eSprite::deleteSprite(void) ***************************************************************************************/ void TFT_eSprite::setPivot(int16_t x, int16_t y) { - _xPivot = x; - _yPivot = y; + _xpivot = x; + _ypivot = y; } @@ -408,7 +408,7 @@ void TFT_eSprite::setPivot(int16_t x, int16_t y) ***************************************************************************************/ int16_t TFT_eSprite::getPivotX(void) { - return _xPivot; + return _xpivot; } @@ -418,7 +418,7 @@ int16_t TFT_eSprite::getPivotX(void) ***************************************************************************************/ int16_t TFT_eSprite::getPivotY(void) { - return _yPivot; + return _ypivot; } @@ -442,8 +442,8 @@ bool TFT_eSprite::pushRotated(int16_t angle, int32_t transp) uint16_t sline_buffer[max_x - min_x + 1]; - int32_t xt = min_x - _tft->_xPivot; - int32_t yt = min_y - _tft->_yPivot; + int32_t xt = min_x - _tft->_xpivot; + int32_t yt = min_y - _tft->_ypivot; uint32_t xe = _dwidth << FP_SCALE; uint32_t ye = _dheight << FP_SCALE; uint32_t tpcolor = transp; // convert to unsigned @@ -454,8 +454,8 @@ bool TFT_eSprite::pushRotated(int16_t angle, int32_t transp) // Scan destination bounding box and fetch transformed pixels from source Sprite for (int32_t y = min_y; y <= max_y; y++, yt++) { int32_t x = min_x; - uint32_t xs = (_cosra * xt - (_sinra * yt - (_xPivot << FP_SCALE)) + (1 << (FP_SCALE - 1))); - uint32_t ys = (_sinra * xt + (_cosra * yt + (_yPivot << FP_SCALE)) + (1 << (FP_SCALE - 1))); + uint32_t xs = (_cosra * xt - (_sinra * yt - (_xpivot << FP_SCALE)) + (1 << (FP_SCALE - 1))); + uint32_t ys = (_sinra * xt + (_cosra * yt + (_ypivot << FP_SCALE)) + (1 << (FP_SCALE - 1))); while ((xs >= xe || ys >= ye) && x < max_x) { x++; xs += _cosra; ys += _sinra; } if (x == max_x) continue; @@ -513,8 +513,8 @@ bool TFT_eSprite::pushRotated(TFT_eSprite *spr, int16_t angle, int32_t transp) uint16_t sline_buffer[max_x - min_x + 1]; - int32_t xt = min_x - spr->_xPivot; - int32_t yt = min_y - spr->_yPivot; + int32_t xt = min_x - spr->_xpivot; + int32_t yt = min_y - spr->_ypivot; uint32_t xe = _dwidth << FP_SCALE; uint32_t ye = _dheight << FP_SCALE; uint32_t tpcolor = transp>>8 | transp<<8; // convert to unsigned swapped bytes @@ -525,8 +525,8 @@ bool TFT_eSprite::pushRotated(TFT_eSprite *spr, int16_t angle, int32_t transp) // Scan destination bounding box and fetch transformed pixels from source Sprite for (int32_t y = min_y; y <= max_y; y++, yt++) { int32_t x = min_x; - uint32_t xs = (_cosra * xt - (_sinra * yt - (_xPivot << FP_SCALE)) + (1 << (FP_SCALE - 1))); - uint32_t ys = (_sinra * xt + (_cosra * yt + (_yPivot << FP_SCALE)) + (1 << (FP_SCALE - 1))); + uint32_t xs = (_cosra * xt - (_sinra * yt - (_xpivot << FP_SCALE)) + (1 << (FP_SCALE - 1))); + uint32_t ys = (_sinra * xt + (_cosra * yt + (_ypivot << FP_SCALE)) + (1 << (FP_SCALE - 1))); while ((xs >= xe || ys >= ye) && x < max_x) { x++; xs += _cosra; ys += _sinra; } if (x == max_x) continue; @@ -563,13 +563,13 @@ bool TFT_eSprite::getRotatedBounds(int16_t angle, int16_t *min_x, int16_t *min_y int16_t *max_x, int16_t *max_y) { // Get the bounding box of this rotated source Sprite relative to Sprite pivot - getRotatedBounds(angle, width(), height(), _xPivot, _yPivot, min_x, min_y, max_x, max_y); + getRotatedBounds(angle, width(), height(), _xpivot, _ypivot, min_x, min_y, max_x, max_y); // Move bounding box so source Sprite pivot coincides with TFT pivot - *min_x += _tft->_xPivot; - *max_x += _tft->_xPivot; - *min_y += _tft->_yPivot; - *max_y += _tft->_yPivot; + *min_x += _tft->_xpivot; + *max_x += _tft->_xpivot; + *min_y += _tft->_ypivot; + *max_y += _tft->_ypivot; // Return if bounding box is outside of TFT area if (*min_x > _tft->width()) return false; @@ -595,13 +595,13 @@ bool TFT_eSprite::getRotatedBounds(TFT_eSprite *spr, int16_t angle, int16_t *min int16_t *max_x, int16_t *max_y) { // Get the bounding box of this rotated source Sprite relative to Sprite pivot - getRotatedBounds(angle, width(), height(), _xPivot, _yPivot, min_x, min_y, max_x, max_y); + getRotatedBounds(angle, width(), height(), _xpivot, _ypivot, min_x, min_y, max_x, max_y); // Move bounding box so source Sprite pivot coincides with destination Sprite pivot - *min_x += spr->_xPivot; - *max_x += spr->_xPivot; - *min_y += spr->_yPivot; - *max_y += spr->_yPivot; + *min_x += spr->_xpivot; + *max_x += spr->_xpivot; + *min_y += spr->_ypivot; + *max_y += spr->_ypivot; // Test only to show bounding box // spr->fillSprite(TFT_BLACK); diff --git a/Extensions/Sprite.h b/Extensions/Sprite.h index 5282bbf..723b557 100644 --- a/Extensions/Sprite.h +++ b/Extensions/Sprite.h @@ -9,7 +9,7 @@ class TFT_eSprite : public TFT_eSPI { public: - explicit TFT_eSprite(TFT_eSPI *tft); + TFT_eSprite(TFT_eSPI *tft); ~TFT_eSprite(void); // Create a sprite of width x height pixels, return a pointer to the RAM area @@ -167,15 +167,15 @@ class TFT_eSprite : public TFT_eSPI { uint8_t _bpp; // bits per pixel (1, 8 or 16) uint16_t *_img; // pointer to 16 bit sprite - uint8_t *_img8; // pointer to 8 bit sprite frame 1 or frame 2 - uint8_t *_img4; // pointer to 4 bit sprite (uses color map) - uint8_t *_img8_1; // pointer to frame 1 - uint8_t *_img8_2; // pointer to frame 2 + uint8_t *_img8; // pointer to 8 bit sprite + uint8_t *_img4; // pointer to 4 bit sprite (uses color map) + uint8_t *_img8_1; // pointer to frame 1 + uint8_t *_img8_2; // pointer to frame 2 uint16_t *_colorMap; // color map: 16 entries, used with 4 bit color map. - int16_t _xPivot; // x pivot point coordinate - int16_t _yPivot; // y pivot point coordinate + int16_t _xpivot; // x pivot point coordinate + int16_t _ypivot; // y pivot point coordinate int32_t _sinra; int32_t _cosra;