aboutsummaryrefslogtreecommitdiffstats
path: root/renderer.c
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2025-04-29 19:26:03 -0400
committerSam Anthony <sam@samanthony.xyz>2025-04-29 19:26:03 -0400
commit48f7025ef20fad882d5496807ba9e2a93b781f22 (patch)
tree8c1f749fe866e6d116c6c65e2bbb125456ab3695 /renderer.c
parent0e48f9ed9065ecf58944caa770f72d72f8a6dbe6 (diff)
downloadvolute-48f7025ef20fad882d5496807ba9e2a93b781f22.zip
allocate icon texture for canvas
Diffstat (limited to 'renderer.c')
-rw-r--r--renderer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/renderer.c b/renderer.c
index e832c81..72b30b7 100644
--- a/renderer.c
+++ b/renderer.c
@@ -415,9 +415,12 @@ r_add_canvas(const char *bg_img_path) {
Canvas *c;
expect(canvas_list.idx < CANVASLIST_SIZE);
+ expect(icon_list.idx < ICONLIST_SIZE);
c = &canvas_list.items[canvas_list.idx];
+ c->icon_id = icon_list.idx;
+
c->bg = IMG_Load(bg_img_path);
if (!c->bg) {
fprintf(stderr, "failed to load %s: %s\n", bg_img_path, SDL_GetError());
@@ -439,6 +442,7 @@ r_add_canvas(const char *bg_img_path) {
return -1;
}
+ icon_list.idx++;
return canvas_list.idx++;
}