return redraw_tile(state, display, d, gp[0], gp[1], gp[2], x, y, w, h);
}
-void x11_redraw_goal(struct app_state *state)
+void x11_redraw_goal(struct app_state *state, uint_fast32_t mask)
{
Display *display = XtDisplay(state->goal);
Window window = XtWindow(state->goal);
int i;
XtVaGetValues(state->goal, XmNwidth, &w, XmNheight, &h, (char *)NULL);
- for (i = 0; i < 9; i++)
- redraw_goal_tile(state, display, window, i%3, i/3, w/3, h/3);
+ for (i = 0; i < 9; i++) {
+ int x = i%3, y = i/3;
+
+ if (mask & 1) {
+ redraw_goal_tile(state, display, window,
+ x, y, w/3, h/3);
+ }
+
+ /*
+ * Goal bitmaps have a gap of 2 tiles between each row.
+ * This funny shift will accomodate that.
+ */
+ mask >>= 1|x;
+ }
}
/* Render the goal area as the window's icon */