summaryrefslogtreecommitdiff
path: root/Gfx.cpp
diff options
context:
space:
mode:
authorXaviDCR92 <xavi.dcr@gmail.com>2017-03-09 23:59:53 +0100
committerXaviDCR92 <xavi.dcr@gmail.com>2017-03-09 23:59:53 +0100
commitf416816883545433ea33ca410983371e657dba18 (patch)
tree1c8682679b1c67261447570c4f66d0d8919bdc00 /Gfx.cpp
parent8ec41b4410aba535008daf991ea59a8740951d44 (diff)
downloadpocketempires-f416816883545433ea33ca410983371e657dba18.tar.gz
* Nearest unit and/or building is found (no sqrt method used).
* Preliminar unit/building selection algorithm. * Added cursor onscreen. - Removed old Peasant sprites. Only 2 sprites needed!
Diffstat (limited to 'Gfx.cpp')
-rw-r--r--Gfx.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/Gfx.cpp b/Gfx.cpp
index 469ddd7..e291213 100644
--- a/Gfx.cpp
+++ b/Gfx.cpp
@@ -28,12 +28,16 @@ void GfxDrawSprite(TYPE_SPRITE * ptrSprite)
{
if(GfxIsSpriteInsideScreenArea(ptrSprite) == true)
{
+ int8_t orig_color = gb.display.getColor();
+
gb.display.setColor(ptrSprite->color, GFX_WHITE);
gb.display.drawBitmap( ptrSprite->x,
ptrSprite->y,
ptrSprite->Data,
ptrSprite->rotation,
ptrSprite->flip );
+
+ gb.display.setColor(orig_color);
}
}
@@ -170,6 +174,26 @@ void GfxPrintText(const char * str, uint8_t x, uint8_t y)
GfxPrintTextFont(str, font3x5, x, y);
}
+void GfxDrawCircle(uint16_t x, uint16_t y, uint8_t radius, int8_t color)
+{
+ if(GfxIsInsideScreenArea(x, y, radius, radius) == true)
+ {
+ int8_t orig_color = gb.display.getColor();
+ gb.display.setColor(color);
+ gb.display.drawCircle(x, y, radius);
+ gb.display.setColor(orig_color);
+ }
+}
+
+void GfxDrawRectangle(uint8_t x, uint8_t y, uint8_t w, uint8_t h, int8_t color)
+{
+ int8_t orig_color = gb.display.getColor();
+
+ gb.display.setColor(color);
+ gb.display.fillRect(x, y, w, h);
+ gb.display.setColor(orig_color);
+}
+
void GfxShowResources(TYPE_RESOURCES * ptrResources)
{
char str[8];