aboutsummaryrefslogtreecommitdiff
path: root/tracks.c (follow)
Commit message (Collapse)AuthorAge
...
* tracks: Roughly double the thickness of the "no track" crossesIan Jackson2017-09-29
| | | | | | | | | | | | The default of 1/30 is rather thin, and probably wasn't chosen deliberately (since it was just inherited from the default 1-pixel line width, and the preferred tile size). Thicker crosses stand out more and make play easier. Use 1/16 since it's a rounder number than 1/15 :-). Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* tracks: Scale thickness of "no track here" crossesIan Jackson2017-09-29
| | | | | | | | | | Simply replace the calls to draw_line with calls to draw_thick_line. We need to choose a thickness parameter. The preferred tile size is 30, and the "draw_line" function draws a 1-pixel line, so the thickness right now is 1/30 the tile size, at the preferred size. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Rework the preset menu system to permit submenus.Simon Tatham2017-04-26
| | | | | | | | | | | | | | | | | | | | To do this, I've completely replaced the API between mid-end and front end, so any downstream front end maintainers will have to do some rewriting of their own (sorry). I've done the necessary work in all five of the front ends I keep in-tree here - Windows, GTK, OS X, Javascript/Emscripten, and Java/NestedVM - and I've done it in various different styles (as each front end found most convenient), so that should provide a variety of sample code to show downstreams how, if they should need it. I've left in the old puzzle back-end API function to return a flat list of presets, so for the moment, all the puzzle backends are unchanged apart from an extra null pointer appearing in their top-level game structure. In a future commit I'll actually use the new feature in a puzzle; perhaps in the further future it might make sense to migrate all the puzzles to the new API and stop providing back ends with two alternative ways of doing things, but this seemed like enough upheaval for one day.
* Clarify conditions to avoid compiler errorsKhem Raj2016-12-06
| | | | | | | | | | Fix errors pointed out by clang error: logical not is only applied to the left hand side of this bitwise operator [-Werror,-Wlogical-not-parentheses] | if (only_immutable && !copy->flags[i] & FLAG_IMMUTABLE) continue; | ^ Signed-off-by: Khem Raj <raj.khem@gmail.com>
* Tracks: fix further completion-checking loopholes.Simon Tatham2016-02-26
| | | | | | | | | | | | A user pointed out that Tracks could sometimes flash for completion when there wasn't even a full path from A to B! And it looks as if that wasn't even a mistake I introduced with the loop-checking revamp this week. Now I _think_ it's complete: we set ret=FALSE in check_completion wherever we also produce an error highlight, and also whenever there is no path connecting A with B. And if there is a path connecting A with B, then any square not on the path becomes an error highlight.
* Tracks: tighten up a small loophole in completion checking.Simon Tatham2016-02-24
| | | | | | | | If you had a single connected path linking the source to the destination but _also_ had a spurious edge elsewhere in the grid, then the spurious edge would be highlighted as an error, but it wouldn't inhibit declaring the game complete and showing the victory flash.
* Tracks: use the new findloop for loop detection.Simon Tatham2016-02-24
| | | | | | | Tracks's previous loop detector was very basic, and only bothered to highlight one loop, even if the player managed to create more than one at a time. Now we highlight all of them.
* Fix premature completion flash in Tracks.Simon Tatham2015-10-23
| | | | | | | | | | | | | Commit 44e2690ab loosened check_completion's idea of what made a square count as 'having track in it' for purposes of checking violations of the row/column counts. Unfortunately, that loosened notion also applied to the check for the game being complete - so the game would announce a win as soon as you had every square shaded, even if you hadn't actually laid all the exact track positions down. Now we separately count up the number of track-ish squares and the number of fully completed ones, and use the former for error checking and the latter for completion checking.
* Highlight clue errors in Tracks in some more situations.Jonas Kölker2015-10-21
| | | | | | | | | - Count any square as having a track either if the square is marked as such (rendered as a different background), or if at least one adjacent edge is marked as containing a segment of train track (rendered as train tracks if they're placed, else as an '='). - Do the same counting in rows and columns.
* New puzzle from James Harvey: 'Tracks'.Simon Tatham2015-02-08