about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-08-10 22:46:51 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-08-10 22:46:51 -0700
commit34d3cb48e9e66d7c2281ea68bf0da294e376663d (patch)
tree6421e04012ba94b7a0e65ad8cfda46b750441921
parent76eceb2ca3efb63a8978da15257438ed0b02a867 (diff)
downloadmu-34d3cb48e9e66d7c2281ea68bf0da294e376663d.tar.gz
.
-rw-r--r--browse-slack/environment.mu4
-rw-r--r--browse-slack/main.mu6
2 files changed, 7 insertions, 3 deletions
diff --git a/browse-slack/environment.mu b/browse-slack/environment.mu
index 123e3803..9d2ca460 100644
--- a/browse-slack/environment.mu
+++ b/browse-slack/environment.mu
@@ -60,7 +60,9 @@ fn render-item screen: (addr screen), _item: (addr item), _users: (addr array us
   var author-offset/ecx: (offset user) <- compute-offset users, author-index
   var author/ecx: (addr user) <- index users, author-offset
   # author avatar
-  var author-avatar/ebx: (addr image) <- get author, avatar
+  var author-avatar-ah/eax: (addr handle image) <- get author, avatar
+  var _author-avatar/eax: (addr image) <- lookup *author-avatar-ah
+  var author-avatar/ebx: (addr image) <- copy _author-avatar
   {
     compare author-avatar, 0
     break-if-=
diff --git a/browse-slack/main.mu b/browse-slack/main.mu
index 8ceb117f..d0eb3ed8 100644
--- a/browse-slack/main.mu
+++ b/browse-slack/main.mu
@@ -8,7 +8,7 @@ type user {
   id: (handle array byte)
   name: (handle array byte)
   real-name: (handle array byte)
-  avatar: image
+  avatar: (handle image)
 }
 
 type item {
@@ -234,7 +234,9 @@ fn parse-user record: (addr stream byte), _users: (addr array user), user-idx: i
   {
     compare c, 0x5d/close-bracket
     break-if-=
-    var dest/eax: (addr image) <- get user, avatar
+    var dest-ah/eax: (addr handle image) <- get user, avatar
+    allocate dest-ah
+    var dest/eax: (addr image) <- lookup *dest-ah
     initialize-image dest, record
   }
 }