X-Git-Url: http://git.draconx.ca/gitweb/rrace.git/blobdiff_plain/b39d19918b63b80d1f3b068d158fe43415b9d1b6..3ac1945c3a0006d33a90a0c2dbee2f2e96e8907d:/src/x11.c?ds=sidebyside diff --git a/src/x11.c b/src/x11.c index f572616..caf3518 100644 --- a/src/x11.c +++ b/src/x11.c @@ -134,7 +134,7 @@ redraw_goal_tile(struct app_state *state, Display *display, Drawable d, 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); @@ -142,8 +142,20 @@ void x11_redraw_goal(struct app_state *state) 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 */