aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
* Work around an annoying GTK behaviour I noticed the other day on mySimon Tatham2012-11-20
| | | | | | | | | | | | | | | | Ubuntu 12.04 machine. What seems to happen is that we set up a window containing a menu bar, a drawing area and a status bar, and set the size of the drawing area; then the window is displayed _without_ the menu bar; then we reduce the drawing area's size request to (1,1) to let the user resize the window smaller; and now GTK gets round to constructing the menu bar, and the drawing area helpfully shrinks a bit to make room for it. My fix is to set a 'shrink pending' flag instead of shrinking the drawing area's size request, and defer the actual shrink operation until the menu bar and status bar are both present. [originally from svn r9711]
* A user points out that I could usefully clarify the Undead clueSimon Tatham2012-11-03
| | | | | | semantics when a reflected sight-line crosses the same monster twice. [originally from svn r9694]
* Remove an unused variable spotted by gcc 4.6.3.Simon Tatham2012-10-07
| | | | [originally from svn r9682]
* New puzzle! 'Unruly', contributed by Lennard Sprong, is anSimon Tatham2012-10-07
| | | | | | implementation of a puzzle usually called 'Tohu wa Vohu'. [originally from svn r9680]
* Make indentation consistent. (Somehow I forgot to do this before ISimon Tatham2012-09-10
| | | | | | originally committed the puzzle, as I usually do.) [originally from svn r9660]
* Forgot to add the new 'const' in the unfinished subdirectory. Oops.Simon Tatham2012-09-10
| | | | [originally from svn r9659]
* Oops, forgot to initialise changed_ascii on all paths in r9657.Simon Tatham2012-09-09
| | | | | [originally from svn r9658] [r9657 == 3b250baa02a7332510685948bf17576c397b8ceb]
* New rule: interpret_move() is passed a pointer to the game_drawstateSimon Tatham2012-09-09
| | | | | | | | | | | | | | | | basically just so that it can divide mouse coordinates by the tile size, but is definitely not expected to _write_ to it, and it hadn't previously occurred to me that anyone might try. Therefore, interpret_move() now gets a pointer to a _const_ game_drawstate instead of a writable one. All existing puzzles cope fine with this API change (as long as the new const qualifier is also added to a couple of subfunctions to which interpret_move delegates work), except for the just-committed Undead, which somehow had ds->ascii and ui->ascii the wrong way round but is otherwise unproblematic. [originally from svn r9657]
* Minor tweaks to Undead docs.Jacob Nevins2012-09-09
| | | | [originally from svn r9656]
* New puzzle! Contributed by Steffen Bauer, an implementation ofSimon Tatham2012-09-08
| | | | | | | | 'Haunted Mirror Maze', a game involving placing ghosts, zombies and vampires in a grid so that the right numbers of them are visible along sight-lines reflected through multiple mirrors. [originally from svn r9652]
* For the convenience of Linux package maintainers, add to Makefile.gtkSimon Tatham2012-08-17
| | | | | | | | | | | | | and Makefile.doc a command-line parameter 'BINPREFIX' which will be prepended to all the game binary names. E.g. 'make BINPREFIX=sgt-' and 'make BINPREFIX=sgt- install', and correspondingly 'make -f Makefile.doc BINPREFIX=sgt-'. Also included in this commit by mistake, changes to singles.c to add \n to the end of all its debug() statements. I meant to commit that separately. Oops. [originally from svn r9606]
* Fix implicit split to @_. Also add 'use warnings', which would haveSimon Tatham2012-08-17
| | | | | | spotted it for me. [originally from svn r9605]
* Don't fail an assertion when setting up the provided clues at theSimon Tatham2012-07-29
| | | | | | | start of the solver, if they contradict each other. (Could trigger on user-provided grids.) [originally from svn r9594]
* Vary the behaviour of Mines's solve function depending on whether theSimon Tatham2012-06-10
| | | | | | | | | | | | | | | | | user is already in the 'dead' state when they press it. If so, we reveal the rest of the mines in the grid as if it were the Windows Minesweeper 'you lose' display, which provides information showing what the user got wrong. (Otherwise they have to repeatedly flick back and forth between Solve and Undo if they want to work out which flag they placed wrongly.) If you press Solve while alive, however, the existing behaviour remains unchanged. (This feature was suggested by Clive Jones a couple of weeks after I first wrote Mines, and I've finally got round to doing it!) [originally from svn r9561]
* Fix a bug introduced by r9495 in which we try to write temporary NULsSimon Tatham2012-06-06
| | | | | | | | | into a string which is usually a read-only string literal. Instead, copy each segment into writable memory as we need it, and free it afterwards. [originally from svn r9558] [r9495 == d0ff371b144d4bfe3cbfb062388347c08e431393]
* Add a hacky environment variable that lets me arrange a soak-test of aSimon Tatham2012-06-01
| | | | | | | | | | | | solver I've just modified, by forcing every game generation to be instantly followed by an attempt to re-solve the same game _description_ without the aux_info. I've hacked similar changes in to midend.c several times in the last couple of months for one reason or another, and it's about time I arranged not to have to recompile to do it! [originally from svn r9549]
* Remove the speed optimisation in the stage 3 solver which makes theSimon Tatham2012-06-01
| | | | | | | | | | | | | | | | | | | | | | first loop only handle rightward or downward bridges (on the basis that that way every bridge is looked at once rather than twice). This seems to be breaking in the wake of recent changes to the solver, in cases such as when island A is left of island B and has enough other outgoing edges that only one bridge remains to potentially go to B, but B is as yet unconstrained. In this situation the only code which is able to adjust the maximum bridge count for that edge is the stage 3 solver (nothing else calls solve_join with is_max true), but it will only do so if it _tries_ putting two bridges there and finds it impossible, and when it starts from island A it won't even try. Game ID which was insoluble just before this commit: 15x15m2:2a4d3b3c2h2d2a2a3c3w4a3m1d1a4a5a2d4d6e4q3e6a2a1e1b2g3a3o2g1d32l4b2c3a4c2b22l4a This probably means I've done something else in recent checkins which was not in accordance with the original solver design. However, this fix will do for the moment. [originally from svn r9548]
* Another uninitialised-variable fix, this one pointing out a real bug.Simon Tatham2012-06-01
| | | | | | | Simplest fix is to just remove the 'n' parameter from solve_island_subgroup, replacing it with a robust island_countbridges. [originally from svn r9547]
* Add pointless initialisations to placate a gcc warning.Simon Tatham2012-06-01
| | | | | | | | | (I'm confident these can't happen. maxb is initialised whenever we break from the first loop with y < h, and when we don't break from that loop the second loop which uses maxb is run zero times. But gcc can't work that out, sigh.) [originally from svn r9546]
* Write a comment outlining a design for a rewritten faster solver.Simon Tatham2012-05-31
| | | | [originally from svn r9544]
* Bridges solver enhancement. In the stage 3 solver, we were consideringSimon Tatham2012-05-31
| | | | | | | | | | | | | | | the possibility that an island might form an isolated subgraph by connecting to one of its neighbours (and, if so, reducing the maximum bridge count in that direction so that some bridge would have to go elsewhere), but we were not also considering the possibility that it might form an isolated subgraph by connecting to _more_ than one of its neighbours. For instance, if you have a 3 adjacent to a 1, a 2 and something else, then at least one bridge must go to the something-else. Previously insoluble test case: 10x10m2:a2b4a5a2a2a1ga2d3b33a3a4c2aa3e1a22b2a4b4aa3b1a2b33a1e3aa2a1a2c23a3a3a4a2a [originally from svn r9543]
* Bridges solver fix: in map_update_possibles, collect values fromSimon Tatham2012-05-31
| | | | | | maxh/maxv for squares between islands as well as on islands. [originally from svn r9542]
* Patch from Jonas Koelker to improve Filling's error highlighting: asSimon Tatham2012-05-14
| | | | | | | | | well as marking a region as wrong if it has too many squares for the number written in it, this patch now causes a region to be marked wrong if it has too few squares _and no liberties_, so that it can't just be one the user is intending to enlarge later. [originally from svn r9534]
* Patch from Jonas Koelker for the developer docs, fixing a couple ofSimon Tatham2012-05-14
| | | | | | | editing errors and adding some comments about the necessary order of midend operations called by a front end. [originally from svn r9533]
* GNUstep compatibility: ensure both endpoints are actually drawn bySimon Tatham2012-05-06
| | | | | | | draw_line, by the brute-force method of explicitly plotting them in addition to the GUI's line-drawing operation. [originally from svn r9505]
* GNUstep compatibility: add a missing #include.Simon Tatham2012-05-06
| | | | [originally from svn r9504]
* GNUstep compatibility: avoid attempting blitter_save with a partiallySimon Tatham2012-05-06
| | | | | | | | out-of-bounds rectangle. Instead, take the intersection of the rectangle with the window boundary and do a smaller operation on what's left. [originally from svn r9503]
* GNUstep compatibility: stop using the API feature isFlipped/setFlippedSimon Tatham2012-05-06
| | | | | | | | | | | | | | | to translate y-coordinates from the default of up-from-bottom to the down-from-top expected by these puzzles, because it doesn't work right on GNUstep. Instead, we run the API in its default mode (probably a more robust choice anyway) and translate coordinates manually in the front end. In the process, I've separated the processButton: method into one for mouse buttons and one for keys, since that was the easiest way to ensure the coordinates passed to the mid-end for the latter are -1,-1 _after_ translation rather than before. [originally from svn r9502]
* GNUstep compatibility: remove an unused variable which the compilerSimon Tatham2012-05-06
| | | | | | warned about. [originally from svn r9501]
* GNUstep compatibility: comment out some API calls that GNUstepSimon Tatham2012-05-06
| | | | | | apparently doesn't have. Fortunately they were optional anyway. [originally from svn r9500]
* GNUstep compatibility: spell null selectors "NULL", not "nil".Simon Tatham2012-05-06
| | | | [originally from svn r9499]
* Add a section to mkfiles.pl to build a makefile that compiles the OS XSimon Tatham2012-05-06
| | | | | | | | | front end using GNUstep, yielding a Unix program built from the same code. Should make it easier to check OS X behaviour without having to move as far as a Mac :-) However, it doesn't compile as is, so I'll apply fixes to the code until it does. [originally from svn r9498]
* Stop using the deprecated NSString stringWithCString: methods.Simon Tatham2012-05-06
| | | | [originally from svn r9495]
* Update the OS X makefile so I can build on Lion. Regrettably thatSimon Tatham2012-05-06
| | | | | | means I have to withdraw support for OS X 10.3 and PPC. [originally from svn r9494]
* Permit users to reconfigure the default setting for each puzzle usingSimon Tatham2012-04-10
| | | | | | another of those hacky environment variables. [originally from svn r9455]
* Add a difficulty exception to prevent Pearl spinning forever whenSimon Tatham2012-04-08
| | | | | | asked to generate a 5x5 Tricky puzzle. (Debian bug #667963) [originally from svn r9454]
* Typo fix from Helge Kreutzmann, forwarded from Debian.Simon Tatham2012-04-08
| | | | [originally from svn r9453]
* Increase by 1 pixel the clip rectangle used to draw and erase theSimon Tatham2012-04-08
| | | | | | | Black Box finish button. Like the Guess blitter, it was assuming non-expansion of circles. [originally from svn r9452]
* Swap a 'max' for a 'min', fixing an out-of-range colour componentSimon Tatham2012-04-08
| | | | | | being passed to the front end. [originally from svn r9451]
* Increase by 1 in every direction the size of the blitter used to saveSimon Tatham2012-04-08
| | | | | | | | the background under a Guess coloured peg in mid-drag. Currently it assumes the circle doesn't extend into the next pixel, which the docs for draw_circle warn might happen due to antialiasing. [originally from svn r9450]
* Add an explicit -lm to the link lines in Makefile.gtk, after two usersSimon Tatham2012-04-07
| | | | | | | | | reported on the same day that this is now necessary since up-to-date GNU tools won't consider it sufficient to have libm be a dependency of other explicitly referenced libraries if you're directly referring to the contents of libm yourself. [originally from svn r9448]
* Fix redundant redrawing in Pegs. Apparently it has always redrawnSimon Tatham2012-04-07
| | | | | | | | | every single peg and hole on the board, every time it did any kind of redraw at all, because I forgot to update the array in the drawstate indicating the last-drawn state of each position. And nobody's noticed until now! [originally from svn r9447]
* Change some instances of 'print $thing' to 'print $thing || ""', toSimon Tatham2012-04-07
| | | | | | prevent annoying Perl warnings when $thing is undefined. [originally from svn r9446]
* Error checking in Pattern, which was until now the only remaining gameSimon Tatham2012-04-06
| | | | | | | | | | | | | | | that _ought_ to have it but did not. I've tried to implement it before and found that the most obvious approach was so effective as to constitute a spoiler, so this is a deliberately weakened approach which in a bit of play-testing seems to be a more sensible balance. It won't necessarily tell you at the very instant you put a foot wrong, but it will at least ensure that (my usual minimum standard) once you've filled in the whole grid you will either have seen a victory flash, or an error indicator showing you why not. [originally from svn r9445]
* Comment the Mac build out of Buildscr, since I no longer have aSimon Tatham2012-04-03
| | | | | | working Mac and hence can't build it any more. [originally from svn r9442]
* Patch from Jonas Koelker to add keyboard control support to Pearl.Simon Tatham2012-02-19
| | | | [originally from svn r9411]
* Tweak a conditional expression in pearl.c to work around a display bugSimon Tatham2012-02-17
| | | | | | | | | | in the Java build - which turns out to be a JVM bug in OpenJDK 6, causing the NestedVM rendition of the expression (i==1?3:4) to be mis-JITed. OpenJDK 7 appears not to do that any more, but this equivalent (for these purposes) rephrasing should perturb the code just enough to dodge the problem. [originally from svn r9408]
* Fix one-character typo in r9405 which was breaking right-clicks.Simon Tatham2012-02-13
| | | | | [originally from svn r9406] [r9405 == 0c13787c2a17adc891f8e47c06b259f80bc8251a]
* David Nickerson reports odd behaviour involving a drag start pointSimon Tatham2012-02-08
| | | | | | | | | | persisting between separate mouse actions. Revamp all uses of the ndragcoords field in an attempt to stamp that out: we now distinguish between active drags (>0), a valid click but no drag yet (0), and a totally invalid situation in which all mouse activity will be ignored until the next fresh attempt (-1). [originally from svn r9405]
* Correct kdiff setting.Simon Tatham2012-02-02
| | | | [originally from svn r9403]