aboutsummaryrefslogtreecommitdiff
path: root/apps/chess
diff options
context:
space:
mode:
authorMarvin Borner2021-04-27 23:32:05 +0200
committerMarvin Borner2021-04-27 23:32:05 +0200
commit895a58b1b57a0ae8028576404a90f12e0133cf5f (patch)
tree0130860f90ffd69b493f540987dc992257b5f974 /apps/chess
parent51a80930a9bc25fae0728994cab1e0df3b63ef48 (diff)
Chess (-> and libgui) improvements
Diffstat (limited to 'apps/chess')
-rw-r--r--apps/chess/chess.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/chess/chess.c b/apps/chess/chess.c
index a8e5fae..94739ef 100644
--- a/apps/chess/chess.c
+++ b/apps/chess/chess.c
@@ -57,6 +57,8 @@ static vec2 selected = { -1, -1 }; // Selected tile
static void load_image(struct piece *tile)
{
+ assert(gui_clear(win, tile->widget, GUI_LAYER_FG) == EOK);
+
char icon[48] = { 0 };
snprintf(icon, sizeof(icon), "/icons/chess-%s-%d.png", tile->name, TILE);
enum gfx_filter filter = IS_COLOR(tile->piece, BLACK) ? GFX_FILTER_NONE : GFX_FILTER_INVERT;
@@ -90,7 +92,7 @@ static void mouseclick(u32 widget_id, vec2 pos)
strlcpy(clicked_piece->name, selected_piece->name, sizeof(clicked_piece->name));
selected_piece->name[0] = '\0';
- /* assert(gui_fill(win, selected_piece->widget, GUI_LAYER_FG, 0) == EOK); */
+ assert(gui_clear(win, selected_piece->widget, GUI_LAYER_FG) == EOK);
load_image(clicked_piece);
assert(gui_redraw_window(win) == EOK);