diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2025-04-29 19:26:03 -0400 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2025-04-29 19:26:03 -0400 |
| commit | 48f7025ef20fad882d5496807ba9e2a93b781f22 (patch) | |
| tree | 8c1f749fe866e6d116c6c65e2bbb125456ab3695 | |
| parent | 0e48f9ed9065ecf58944caa770f72d72f8a6dbe6 (diff) | |
| download | volute-48f7025ef20fad882d5496807ba9e2a93b781f22.zip | |
allocate icon texture for canvas
| -rw-r--r-- | renderer.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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++; } |