summaryrefslogtreecommitdiff
path: root/Gfx.cpp
diff options
context:
space:
mode:
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];