diff options
Diffstat (limited to 'renderer.c')
| -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++; } |