summaryrefslogtreecommitdiff
path: root/apps/plugins/goban/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/goban/board.c')
-rw-r--r--apps/plugins/goban/board.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/apps/plugins/goban/board.c b/apps/plugins/goban/board.c
index bc6c5347dc..c36fcc56e9 100644
--- a/apps/plugins/goban/board.c
+++ b/apps/plugins/goban/board.c
@@ -55,7 +55,13 @@ static int flood_fill_helper (unsigned short pos, unsigned char orig_color,
55 55
56/* these aren't "board marks" in the marks on the SGF sense, they are used 56/* these aren't "board marks" in the marks on the SGF sense, they are used
57 internally to mark already visited points and the like (such as when 57 internally to mark already visited points and the like (such as when
58 doing liberty counting for groups) */ 58 doing liberty counting for groups)
59
60 We avoid having to clear the entire array every time by storing the
61 "current_mark" number and defining marked as "== current_mark". We
62 still need to clear the whole array once per "cycle" though, or we'd get
63 false positives sometimes
64 */
59static void 65static void
60setup_marks (void) 66setup_marks (void)
61{ 67{
@@ -92,13 +98,10 @@ is_marked (unsigned short pos)
92void 98void
93clear_board (void) 99clear_board (void)
94{ 100{
95 unsigned int i, x, y; 101 unsigned int x, y;
96 102
97 /* for the borders */ 103 /* for the borders */
98 for (i = 0; i < (2 + MAX_BOARD_SIZE) * (2 + MAX_BOARD_SIZE); ++i) 104 rb->memset(board_data, INVALID, sizeof(board_data));
99 {
100 board_data[i] = INVALID;
101 }
102 105
103 /* now make the actual board part */ 106 /* now make the actual board part */
104 for (y = 0; y < board_height; ++y) 107 for (y = 0; y < board_height; ++y)