diff options
| author | Jacob Nevins <jacobn@chiark.greenend.org.uk> | 2018-09-23 16:36:30 +0100 |
|---|---|---|
| committer | Jacob Nevins <jacobn@chiark.greenend.org.uk> | 2018-09-23 16:36:30 +0100 |
| commit | d8d506455ebe69888dcc4759eb9fc787bfe29ad9 (patch) | |
| tree | f1fd2cea02068a4c01a49cebb0a30a9880f1ba85 /net.c | |
| parent | cafa36b0e3121efb83b9b02f60ea2f35194b98b0 (diff) | |
| download | puzzles-d8d506455ebe69888dcc4759eb9fc787bfe29ad9.zip puzzles-d8d506455ebe69888dcc4759eb9fc787bfe29ad9.tar.gz puzzles-d8d506455ebe69888dcc4759eb9fc787bfe29ad9.tar.bz2 puzzles-d8d506455ebe69888dcc4759eb9fc787bfe29ad9.tar.xz | |
Net: highlight more errors in locked tiles.
If a locked tile has an edge pointing at a barrier, or at another
locked tile without a matching edge, colour that edge red.
Diffstat (limited to 'net.c')
| -rw-r--r-- | net.c | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -2915,7 +2915,25 @@ static void game_redraw(drawing *dr, game_drawstate *ds, } if (t & d) { - int edgeval = (t & ERR(d) ? 3 : t & ACTIVE ? 2 : 1); + int edgeval; + + /* Highlight as an error any edge in a locked tile that + * is adjacent to a lack-of-edge in another locked tile, + * or to a barrier */ + if (t & LOCKED) { + if (barrier(state, gx, gy) & d) { + t |= ERR(d); + } else { + int ox, oy, t2; + OFFSET(ox, oy, gx, gy, d, state); + t2 = tile(state, ox, oy); + if ((t2 & LOCKED) && !(t2 & F(d))) { + t |= ERR(d); + } + } + } + + edgeval = (t & ERR(d) ? 3 : t & ACTIVE ? 2 : 1); todraw(ds, dx, dy) |= edgeval << (TILE_WIRE_SHIFT + dsh*2); if (!(gx == tx && gy == ty)) { todraw(ds, dx + X(d), dy + Y(d)) |= |