aboutsummaryrefslogtreecommitdiffstats
path: root/src/gdisp/gdisp.c
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2013-10-24 13:59:03 +1000
committerinmarket <andrewh@inmarket.com.au>2013-10-24 13:59:03 +1000
commit21afd2b8f19d522fab6b78670bf1afcf11388cd5 (patch)
treed165d1d08929b42cd2469a26f560558375c9d320 /src/gdisp/gdisp.c
parent452cfc1b1351e8070ed609d84cae0249411a236b (diff)
downloaduGFX-21afd2b8f19d522fab6b78670bf1afcf11388cd5.tar.gz
uGFX-21afd2b8f19d522fab6b78670bf1afcf11388cd5.tar.bz2
uGFX-21afd2b8f19d522fab6b78670bf1afcf11388cd5.zip
Created a crude auto-scaling logo (for startup)
Diffstat (limited to 'src/gdisp/gdisp.c')
-rw-r--r--src/gdisp/gdisp.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/src/gdisp/gdisp.c b/src/gdisp/gdisp.c
index fdda1cff..263e882d 100644
--- a/src/gdisp/gdisp.c
+++ b/src/gdisp/gdisp.c
@@ -510,7 +510,41 @@ static void line_clip(GDisplay *g) {
#if GDISP_STARTUP_LOGO_TIMEOUT > 0
static void StatupLogoDisplay(GDisplay *g) {
- gdispGFillArea(g, g->g.Width/4, g->g.Height/4, g->g.Width/2, g->g.Height/2, Blue);
+ coord_t x, y, w;
+ const coord_t * p;
+ static const coord_t blks[] = {
+ // u
+ 2, 6, 1, 10,
+ 3, 11, 4, 1,
+ 6, 6, 1, 6,
+ // G
+ 8, 0, 1, 12,
+ 9, 0, 6, 1,
+ 9, 11, 6, 1,
+ 14, 6, 1, 5,
+ 12, 6, 2, 1,
+ // F
+ 16, 0, 1, 12,
+ 17, 0, 6, 1,
+ 17, 6, 3, 1,
+ // X
+ 22, 6, 7, 1,
+ 24, 0, 1, 6,
+ 22, 7, 1, 5,
+ 28, 0, 1, 6,
+ 26, 7, 1, 5,
+ };
+
+ // Get a starting position and a scale
+ // Work on a 8x16 grid for each char, 4 chars (uGFX) in 1 line, using half the screen
+ w = g->g.Width/(8*4*2);
+ if (!w) w = 1;
+ x = (g->g.Width - (8*4)*w)/2;
+ y = (g->g.Height - (16*1)*w)/2;
+
+ // Simple but crude!
+ for(p = blks; p < blks+sizeof(blks)/sizeof(blks[0]); p+=4)
+ gdispGFillArea(g, x+p[0]*w, y+p[1]*w, p[2]*w, p[3]*w, Blue);
}
#endif