summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-03-25 20:59:48 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2016-03-25 20:59:48 +0000
commit094924f7f882da1f32395d4c982db6ad8e0f609f (patch)
tree3ac981b470108286e36f7b48a261e8a149e22b7b
parent39fbae3c61cc2d78ac5e7c5c471d161fafd53400 (diff)
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>
-rw-r--r--tools/cursor.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/cursor.c b/tools/cursor.c
index 6f4e3f8c..6a2438ad 100644
--- a/tools/cursor.c
+++ b/tools/cursor.c
@@ -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;