ref: bbce1ac136fe3e7acb049571287295301c22cbbb
parent: 85447376e6315272dda68941ced6167d88a0a858
author: sirjofri <sirjofri@sirjofri.de>
date: Sun Apr 6 13:25:25 EDT 2025
adds loading cursor
--- a/map.c
+++ b/map.c
@@ -2,6 +2,7 @@
#include <libc.h>
#include <draw.h>
#include <event.h>
+#include <cursor.h>
#include <plumb.h>
#include <keyboard.h>
#include <nate/nate.h>
@@ -35,6 +36,19 @@
sysfatal("/mnt/map does not exist: %r");
}
+Cursor loadingcursor = {
+ -8, -8,
+ 0x00, 0x00, 0x00, 0x00, 0x07, 0xc0, 0x0f, 0xb0,
+ 0x1f, 0xb8, 0x1f, 0x78, 0x3f, 0x7c, 0x3e, 0xfc,
+ 0x3e, 0x0c, 0x3f, 0xfc, 0x1f, 0xf8, 0x1f, 0xf8,
+ 0x0f, 0xf0, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00,
+
+ 0x07, 0xe0, 0x1f, 0xf8, 0x38, 0x3c, 0x70, 0x4e,
+ 0x60, 0x46, 0xe0, 0x87, 0xc0, 0x83, 0xc1, 0x03,
+ 0xc1, 0xf3, 0xc0, 0x03, 0xe0, 0x07, 0x60, 0x06,
+ 0x70, 0x0e, 0x3c, 0x3c, 0x1f, 0xf8, 0x07, 0xe0,
+};
+
Image *cwhite;
Image *cgreen;
Image *cred;
@@ -231,6 +245,8 @@
rendergeojson(currentloc);
unlockmapimage();
+ esetcursor(nil);
+
qlock(&shouldredrawl);
shouldredraw++;
qunlock(&shouldredrawl);
@@ -240,6 +256,7 @@
redrawmap(void)
{
if (needsrequestimage) {
+ esetcursor(&loadingcursor);
requestimage(currentloc, imageupdated);
needsrequestimage = 0;
return;
--
⑨