]> git.draconx.ca Git - rrace.git/blobdiff - src/curses.c
Fix bitmap generation in goal overlay feature.
[rrace.git] / src / curses.c
index f66589eab3dac2fac9ae85f993eded99259f375f..c0f4265e25fc98054f947cce25290b227e941ab6 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Curses UI for slide puzzle game
- * Copyright © 2022 Nick Bowler
+ * Copyright © 2022-2023 Nick Bowler
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -156,13 +156,8 @@ static void curs_redraw_game(struct app_state *state, uint_fast32_t mask)
        if (mask == -1)
                redraw_area_border(state->gamewin, 2, 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;
-       }
+       if (state->view_goal_on_game)
+               gp = game_overlay_goal(&state->board, buf);
 
        for (i = 0; i < 25; i++) {
                if (mask & 1) {