]> git.draconx.ca Git - rrace.git/blobdiff - src/x11.c
Right clicking on game area now shows the objective.
[rrace.git] / src / x11.c
index 1bd19c97f158ae01efb79a9c8fafc08805c398a7..3b4818e1f67659a9a8edad9b8971e147c8fab6a2 100644 (file)
--- 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,