From 48f7025ef20fad882d5496807ba9e2a93b781f22 Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Tue, 29 Apr 2025 19:26:03 -0400 Subject: allocate icon texture for canvas --- renderer.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'renderer.c') 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++; } -- cgit v1.2.3