X-Git-Url: http://git.draconx.ca/gitweb/rrace.git/blobdiff_plain/683027f82849ca96cf424ffff699ab57e119f051..26fb4b6902a32be6e9f504bee44724a0dd4292f7:/src/x11.c?ds=inline diff --git a/src/x11.c b/src/x11.c index 1bd19c9..3b4818e 100644 --- a/src/x11.c +++ b/src/x11.c @@ -247,13 +247,21 @@ void x11_redraw_game(struct app_state *state, uint_fast32_t mask) { Display *display = XtDisplay(state->goal); Window game = XtWindow(state->game); - uint_least32_t *gp = state->board.game; + uint_least32_t buf[3], *gp = state->board.game; Dimension w, h; int i; XtVaGetValues(state->game, XtNwidth, &w, XtNheight, &h, (char *)NULL); w /= 5; h /= 5; + if (state->view_goal_on_game) { + for (i = 0; i < 3; i++) { + buf[i] = state->board.goal[i]; + buf[i] = (gp[i] & ~GOAL_MASK) | (buf[i] << GOAL_SHIFT); + } + gp = buf; + } + for (i = 0; i < 25; i++) { if (mask & 1) { redraw_tile(state, display, game,