tools/cursor: Print an ASCII representation as well

Show the ASCII outline of the cursor as well as the image stored in the
PNG.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2016-03-25 20:59:48 +00:00
parent 39fbae3c61
commit 094924f7f8
1 changed files with 16 additions and 0 deletions

View File

@ -61,6 +61,22 @@ int main(int argc, char **argv)
cur->width, cur->height,
cur->xhot, cur->yhot);
if (1) {
int x, y;
src = cur->pixels;
for (y = 0; y < cur->height; y++) {
for (x = 0; x < cur->width; x++) {
if (x == cur->xhot && y == cur->yhot)
printf("+");
else
printf("%c", *src ? *src >> 24 >= 127 ? 'x' : '.' : ' ');
src++;
}
printf("\n");
}
}
file = fopen("cursor.png", "wb");
if (file == NULL)
return 2;