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
27657bcb
Unverified
Commit
27657bcb
authored
Sep 07, 2020
by
Bodmer
Committed by
GitHub
Sep 07, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #741 from QrackEE/fix/ambigous_pushSprite
Resolve ambigous pushSprite(int int int) methods
parents
731228d1
ddf03d43
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
Extensions/Sprite.cpp
Extensions/Sprite.cpp
+7
-7
Extensions/Sprite.h
Extensions/Sprite.h
+1
-1
No files found.
Extensions/Sprite.cpp
View file @
27657bcb
...
...
@@ -739,22 +739,22 @@ void TFT_eSprite::pushSprite(int32_t x, int32_t y, uint16_t transp)
// 4bpp -> 4bpp (note: color translation depends on the 2 sprites pallet colors)
// 1bpp -> 1bpp (note: color translation depends on the 2 sprites bitmap colors)
bool
TFT_eSprite
::
pushSprite
(
TFT_eSprite
*
spr
,
int32_t
x
,
int32_t
y
)
bool
TFT_eSprite
::
pushSprite
(
TFT_eSprite
&
spr
,
int32_t
x
,
int32_t
y
)
{
if
(
!
_created
)
return
false
;
if
(
!
spr
->
created
())
return
false
;
if
(
!
spr
.
created
())
return
false
;
// Check destination sprite compatibility
int8_t
ds_bpp
=
spr
->
getColorDepth
();
int8_t
ds_bpp
=
spr
.
getColorDepth
();
if
(
_bpp
==
16
&&
ds_bpp
!=
16
&&
ds_bpp
!=
8
)
return
false
;
if
(
_bpp
==
8
)
return
false
;
if
(
_bpp
==
4
&&
ds_bpp
!=
4
)
return
false
;
if
(
_bpp
==
1
&&
ds_bpp
!=
1
)
return
false
;
bool
oldSwapBytes
=
spr
->
getSwapBytes
();
spr
->
setSwapBytes
(
false
);
spr
->
pushImage
(
x
,
y
,
_dwidth
,
_dheight
,
_img
);
spr
->
setSwapBytes
(
oldSwapBytes
);
bool
oldSwapBytes
=
spr
.
getSwapBytes
();
spr
.
setSwapBytes
(
false
);
spr
.
pushImage
(
x
,
y
,
_dwidth
,
_dheight
,
_img
);
spr
.
setSwapBytes
(
oldSwapBytes
);
return
true
;
}
...
...
Extensions/Sprite.h
View file @
27657bcb
...
...
@@ -135,7 +135,7 @@ class TFT_eSprite : public TFT_eSPI {
// Push the sprite to another sprite, this fn calls pushImage() in the destination sprite class.
// >>>>>> Using a transparent color is not supported at the moment <<<<<<
bool
pushSprite
(
TFT_eSprite
*
spr
,
int32_t
x
,
int32_t
y
);
bool
pushSprite
(
TFT_eSprite
&
spr
,
int32_t
x
,
int32_t
y
);
// Push a windowed area of the sprite to the TFT at tx, ty
bool
pushSprite
(
int32_t
tx
,
int32_t
ty
,
int32_t
sx
,
int32_t
sy
,
int32_t
sw
,
int32_t
sh
);
...
...
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