X-Git-Url: https://git.draconx.ca/gitweb/rrace.git/blobdiff_plain/ee68c7cd53763caeb44de97f1036ebaf014a7292..831e44784dc638f4025269f5a4217ada98602eda:/src/motif_ui.c diff --git a/src/motif_ui.c b/src/motif_ui.c index 127de06..fefcfed 100644 --- a/src/motif_ui.c +++ b/src/motif_ui.c @@ -323,6 +323,8 @@ static void game_expose(Widget w, void *data, void *cb_data) { XmDrawingAreaCallbackStruct *cbs = cb_data; XExposeEvent *e = &cbs->event->xexpose; + struct app_state *state = data; + uint_least32_t *gp = state->board.game; Dimension width, height; uint_fast32_t mask; @@ -330,8 +332,15 @@ static void game_expose(Widget w, void *data, void *cb_data) if (!(width /= 5) || !(height /= 5)) return; - mask = expose_mask(e->x, e->y, e->width, e->height, width, height); - x11_redraw_game(data, mask); + /* + * Only draw exposed nonempty tiles; exposed areas are filled with the + * background automatically and thus exposed empty spaces don't need + * to be drawn again. + */ + mask = gp[0] | gp[1] | gp[2]; + mask &= expose_mask(e->x, e->y, e->width, e->height, width, height); + + x11_redraw_game(state, mask); } static void goal_expose(Widget w, void *data, void *cb_data)