From 40f7f76e36bffc200eaab5dbf9c5b01fea2aaeee Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 19 Sep 2016 18:37:09 +0200 Subject: [PATCH] - shellexec: enlarge "icon" --- gfx.c | 40 ++++++++++++++++++++++++++-------------- gfx.h | 1 + 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/gfx.c b/gfx.c index 5d881db..caf0803 100644 --- a/gfx.c +++ b/gfx.c @@ -1,22 +1,33 @@ +#include + #include "shellexec.h" #include "gfx.h" char circle[] = { - 0,2,2,2,2,2,2,2,2,2,2,0, - 2,1,1,1,1,1,1,1,1,1,1,2, - 2,1,1,1,1,1,1,1,1,1,1,2, - 2,1,1,1,1,1,1,1,1,1,1,2, - 2,1,1,1,1,1,1,1,1,1,1,2, - 2,1,1,1,1,1,1,1,1,1,1,2, - 2,1,1,1,1,1,1,1,1,1,1,2, - 2,1,1,1,1,1,1,1,1,1,1,2, - 2,1,1,1,1,1,1,1,1,1,1,2, - 2,1,1,1,1,1,1,1,1,1,1,2, - 2,1,1,1,1,1,1,1,1,1,1,2, - 0,2,2,2,2,2,2,2,2,2,2,0 + 0,0,2,2,2,2,2,2,2,2,2,2,2,2,0,0, + 0,2,1,1,1,1,1,1,1,1,1,1,1,1,2,0, + 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2, + 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2, + 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2, + 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2, + 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2, + 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2, + 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2, + 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2, + 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2, + 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2, + 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2, + 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2, + 0,2,1,1,1,1,1,1,1,1,1,1,1,1,2,0, + 0,0,2,2,2,2,2,2,2,2,2,2,2,2,0,0 }; +size_t GetCircleHeight() +{ + return sqrt(sizeof(circle)); +} + //typedef struct { unsigned char width_lo; unsigned char width_hi; unsigned char height_lo; unsigned char height_hi; unsigned char transp; } IconHeader; void RenderBox(int sx, int sy, int ex, int ey, int rad, int col) @@ -123,9 +134,10 @@ void RenderCircle(int sx, int sy, char col) uint32_t pix = bgra[col]; uint32_t *p = lbb + startx + sx; int s = stride * (starty + sy); + int h = GetCircleHeight(); - for(y = 0; y < 12 * 12; y += 12, s += stride) - for(x = 0; x < 12; x++) + for(y = 0; y < h * h; y += h, s += stride) + for(x = 0; x < h; x++) switch(circle[x + y]) { case 1: *(p + x + s) = pix; break; case 2: *(p + x + s) = 0xFFFFFFFF; break; diff --git a/gfx.h b/gfx.h index 7005ba4..35539bc 100644 --- a/gfx.h +++ b/gfx.h @@ -3,6 +3,7 @@ void RenderBox(int sx, int sy, int ex, int ey, int mode, int color); void RenderCircle(int sx, int sy, char type); +size_t GetCircleHeight(); //void PaintIcon(char *filename, int x, int y, unsigned char offset); #endif -- 2.39.5