]> git.draconx.ca Git - rrace.git/blobdiff - src/x11.c
Reduce the amount of redundant drawing in the game area.
[rrace.git] / src / x11.c
index 95e0cf057646085d502929124552196118fb9b4d..f572616192d6d6400ad95e4c350902d567d09d56 100644 (file)
--- a/src/x11.c
+++ b/src/x11.c
@@ -201,10 +201,11 @@ void x11_redraw_icon(struct app_state *state, Widget shell)
        }
 }
 
-void x11_redraw_game(struct app_state *state)
+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;
        Dimension w, h;
        int i;
 
@@ -212,10 +213,11 @@ void x11_redraw_game(struct app_state *state)
        w /= 5; h /= 5;
 
        for (i = 0; i < 25; i++) {
-               uint_least32_t *gp = state->board.game;
-
-               redraw_tile(state, display, game,
-                           gp[0], gp[1], gp[2],
-                           i%5, i/5, w, h);
+               if (mask & 1) {
+                       redraw_tile(state, display, game,
+                                   gp[0], gp[1], gp[2],
+                                   i%5, i/5, w, h);
+               }
+               mask >>= 1;
        }
 }