/*
* Slide puzzle core game logic
- * 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
*/
int_fast32_t game_finish(struct board *board);
+/*
+ * Constructs a new set of game bitmaps into buf, with tiles in the
+ * objective area replaced by the goal tile colours, and returns buf.
+ */
+static inline uint_least32_t *
+game_overlay_goal(struct board *board, uint_least32_t *buf)
+{
+ int i;
+
+ for (i = 0; i < 3; i++) {
+ buf[i] = (unsigned long)board->goal[i] << GOAL_SHIFT;
+ buf[i] = (buf[i] & GOAL_MASK) | (board->game[i] & ~GOAL_MASK);
+ }
+
+ return buf;
+}
+
#endif