+#include <math.h>
+
#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)
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;