Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
TFT_eSPI
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
TFT_eSPI
Commits
479bff49
Commit
479bff49
authored
Feb 03, 2023
by
Bodmer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Related to #2376
Make sure palette space deleted.
parent
80912d07
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
Extensions/Sprite.cpp
Extensions/Sprite.cpp
+7
-7
No files found.
Extensions/Sprite.cpp
View file @
479bff49
...
@@ -223,6 +223,8 @@ void* TFT_eSprite::callocSprite(int16_t w, int16_t h, uint8_t frames)
...
@@ -223,6 +223,8 @@ void* TFT_eSprite::callocSprite(int16_t w, int16_t h, uint8_t frames)
***************************************************************************************/
***************************************************************************************/
void
TFT_eSprite
::
createPalette
(
uint16_t
colorMap
[],
uint8_t
colors
)
void
TFT_eSprite
::
createPalette
(
uint16_t
colorMap
[],
uint8_t
colors
)
{
{
if
(
!
_created
)
return
;
if
(
colorMap
==
nullptr
)
if
(
colorMap
==
nullptr
)
{
{
// Create a color map using the default FLASH map
// Create a color map using the default FLASH map
...
@@ -249,6 +251,8 @@ void TFT_eSprite::createPalette(uint16_t colorMap[], uint8_t colors)
...
@@ -249,6 +251,8 @@ void TFT_eSprite::createPalette(uint16_t colorMap[], uint8_t colors)
***************************************************************************************/
***************************************************************************************/
void
TFT_eSprite
::
createPalette
(
const
uint16_t
colorMap
[],
uint8_t
colors
)
void
TFT_eSprite
::
createPalette
(
const
uint16_t
colorMap
[],
uint8_t
colors
)
{
{
if
(
!
_created
)
return
;
if
(
colorMap
==
nullptr
)
if
(
colorMap
==
nullptr
)
{
{
// Create a color map using the default FLASH map
// Create a color map using the default FLASH map
...
@@ -305,13 +309,9 @@ void* TFT_eSprite::setColorDepth(int8_t b)
...
@@ -305,13 +309,9 @@ void* TFT_eSprite::setColorDepth(int8_t b)
else
if
(
b
>
1
)
_bpp
=
4
;
else
if
(
b
>
1
)
_bpp
=
4
;
else
_bpp
=
1
;
else
_bpp
=
1
;
// Can't change an existing sprite's colour depth so delete it
// Can't change an existing sprite's colour depth so delete and create a new one
if
(
_created
)
free
(
_img8_1
);
if
(
_created
)
{
deleteSprite
();
// If it existed, re-create the sprite with the new colour depth
if
(
_created
)
{
_created
=
false
;
return
createSprite
(
_dwidth
,
_dheight
);
return
createSprite
(
_dwidth
,
_dheight
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment