479 Commits

Author SHA1 Message Date
f8d1183c7a I arranged that dying after the game was already completed didn't
increment the deaths counter. In doing so, I incorrectly handled the
borderline case, so that a death incurred _in the act_ of collecting
the final gem also didn't increment the deaths counter. Now it does.

[originally from svn r6277]
2005-09-06 22:28:04 +00:00
aec9667f00 Take the Windows taskbar into account when deciding on the maximum
size of the puzzle window. This has involved some _completely
stupid_ window manipulation: in order to figure out in advance how
big I want my main window to be, I first have to _create_ the status
bar so I know how tall it is; but since I can't reparent it into my
main window after I've created it, I then have to throw that status
bar away and create a new one. *sigh*

[originally from svn r6276]
2005-09-06 18:49:18 +00:00
7096df54de Various patches from Ben H: a fix for an outdated comment, a couple
of spurious ps_printf() arguments removed, and an error check in the
`make install' target.

[originally from svn r6275]
2005-09-05 17:21:05 +00:00
56ff3647e2 I've dithered a bit in the past about whether or not it's allowable
to call game_set_size() twice on the same drawstate. Finally, a
definite decision: it isn't. Accordingly, midend.c arranges never to
do so, the devel docs state that puzzles may enforce by assertion
that it never happens, and the four puzzles which care (i.e. use
blitters) do so.

[originally from svn r6274]
2005-09-05 17:18:03 +00:00
fd1735170e Patch from Ton van Overbeek to fix a small memory leak in
midend_solve().

[originally from svn r6271]
2005-09-04 12:53:27 +00:00
fe65b2efbd Patch from Ton van Overbeek to correct Loopy's misplaced line ends
at small tile sizes.

[originally from svn r6270]
2005-09-04 12:46:19 +00:00
dd7c1c983c Another global environment-variable override across all games. This
one is <game>_TILESIZE, adjusting the game's default size. I
anticipate that this will probably _mostly_ be useful for debugging.

[originally from svn r6269]
2005-09-04 12:40:23 +00:00
6ee8a4d71e Couple of minor updates to restore accuracy.
[originally from svn r6268]
2005-09-04 12:31:04 +00:00
41b9855da9 Patches from James H. The usual stuff (memory leak fixes and 16-bit
cleanliness), plus he's enlarged the pencil-mark circles from
TILESIZE/8 to TILESIZE/7. Makes no difference at all (thanks to
integer division) when TILESIZE is the default of 20, but presumably
helps at some other tile sizes. Fine by me.

[originally from svn r6265]
2005-09-03 18:32:58 +00:00
d7c12b3122 Someone points out that the Solo text formatter would be a lot
better if it marked empty cells with something other than a space.
So here's a three-bit change to turn it into a dot :-)

[originally from svn r6261]
2005-09-02 13:40:16 +00:00
8d4b62c9bd Stop Light Up from eating system keypresses, which it was previously
doing whenever the cursor was active.

[originally from svn r6258]
2005-09-01 17:25:06 +00:00
bd5606ae74 Optimiser placation.
[originally from svn r6257]
2005-09-01 12:17:14 +00:00
643f468255 Palm fixes for Loopy from James H: a #ifdef SLOW_SYSTEM, and an
int/long fix.

[originally from svn r6256]
2005-09-01 12:00:55 +00:00
04e26aaa7b James H's memory leak fixes to Inertia.
[originally from svn r6255]
2005-09-01 11:59:51 +00:00
94b36c11e0 James H has implemented a new `Tricky' difficulty level in Light Up:
a non-recursive level above Easy, which therefore moves the
recursive Hard mode further up still. Play-testing suggests that in
fact Tricky is often _harder_ than the old Hard mode, since the
latter had limited depth of recursion and would therefore spot
complex deductions only if it happened to start a recursion on the
right square; Tricky may be limited in the sophistication of its
complex deductions, but it never misses one, so its puzzles tend to
be hard all over.

Also in this checkin, a new source file `nullfe.c', containing all
the annoying stub functions required to make command-line solvers
link successfully. James wrote this for (the new) lightupsolver, and
I've used it to simplify the other stand-alone solvers.

[originally from svn r6254]
2005-09-01 11:57:56 +00:00
6992530a85 Ability to drag pencil marks around.
[originally from svn r6250]
2005-08-31 19:27:41 +00:00
c70312f8a8 Terribly cunning approach to making the pencil marks look nicer,
thanks to Gareth.

[originally from svn r6248]
2005-08-31 17:34:47 +00:00
7b08221952 Debian requires -lm, where Red Hat didn't.
[originally from svn r6247]
2005-08-31 16:59:51 +00:00
068a092cd5 Ahem; forgot about recursion. Recursive solving now shows its
working as well.

[originally from svn r6245]
2005-08-31 12:43:14 +00:00
f2ff444fca Now that Map has some seriously complex deductions, it's about time
it had a command-line solver. In order to do this, I've had to
expose the internal region numbering because the solver has to have
some way to state which region it means; and in any case it's also
useful to have human-visible region numbering so that two people can
discuss a puzzle they're solving together. So pressing L during play
now toggles the display of region numbers; and `mapsolver' uses
those same numbers when showing its working and its solutions.

[originally from svn r6244]
2005-08-31 12:17:01 +00:00
121f664b62 Forcing chains in Map give rise to a new `Hard' difficulty level.
Also implemented the Map analogue of Solo's pencil marks, to make
this mode more playable.

[originally from svn r6240]
2005-08-30 19:42:45 +00:00
e7a02ae333 Implemented a couple more reasoning modes for Extreme difficulty
level: positional set elimination (which is so obvious I really
should have thought of it myself, though it's tricky to spot) and
forcing chains (which are a type of one-level proof by
contradiction, findable through a simple breadth-first search
without requiring recursion, but so ludicrously powerful that they
are able to solve _two thirds_ of grids that the pre-Extreme Solo
generated and rated as Unreasonable).

Of course this makes Unreasonable mode harder still...

[originally from svn r6239]
2005-08-30 17:44:18 +00:00
948c33c5a9 Backspace and Delete keys now function like Space in Solo.
[originally from svn r6237]
2005-08-29 11:12:05 +00:00
4d6c8c7337 Typo in comment :-)
[originally from svn r6236]
2005-08-29 09:14:35 +00:00
ea9142fbda Ahem. The region density at which things start to get hairy is 2/3
of the grid area, not 3/2!

[originally from svn r6235]
2005-08-29 09:05:35 +00:00
2c85fd3530 Aesthetic improvements to the Map error indicators:
- the exclamation mark was a bit dot-heavy
 - allowing the indicator to be placed at a grid point as well as
   half way between two grid points allows some much more natural
   positioning.

[originally from svn r6234]
2005-08-29 08:57:45 +00:00
2975ae2811 Unreasonable mode for Map.
[originally from svn r6229]
2005-08-28 14:29:19 +00:00
e483fc513b Error highlighting in Map.
[originally from svn r6228]
2005-08-28 13:53:07 +00:00
8f46a30e69 There seems to be some odd behaviour when GTK is asked to draw an
outline polygon with a clipping rectangle active. I don't know or
care whether this is GTK or my X server or what, but I'm working
around it by drawing the lines myself, which seems to sort it out.

[originally from svn r6227]
2005-08-28 13:52:58 +00:00
1d0573109c HACKING.but -> devel.but
[originally from svn r6226]
2005-08-28 09:35:55 +00:00
389397eed6 Fix array bounds violation in the solver. Oops.
[originally from svn r6225]
2005-08-27 09:53:38 +00:00
8c547d5320 OS X seems particularly picky about possibly uninitialised
variables. Placate its optimiser (again).

[originally from svn r6223]
2005-08-27 09:35:14 +00:00
622a5ff678 New puzzle: `Inertia', originally written for Windows by Ben
Olmstead and reimplemented with the help of his source code which he
was kind enough to release into the public domain.

[originally from svn r6222]
2005-08-27 09:21:22 +00:00
067f06053c Trivial doc changes after recent prolificacy.
[originally from svn r6220]
2005-08-26 19:44:25 +00:00
d6163f9976 Memory leak and type safety fixes from James H.
[originally from svn r6219]
2005-08-25 18:14:54 +00:00
2520b86965 Phil Bordelon points out that the general convention is to orient
rectangular presets in a portrait fashion.

[originally from svn r6217]
2005-08-25 08:07:44 +00:00
163d62b07f Mike points out that I made an error in one of the presets...
[originally from svn r6216]
2005-08-25 07:57:58 +00:00
c564df0828 Over-enthusiastic assertion introduced in the printing revamp was
causing Mines to crash one second after starting a game. Oops.

[originally from svn r6214]
2005-08-24 22:13:43 +00:00
5dc47a7ba1 Optimiser placation for OS X gcc.
[originally from svn r6212]
2005-08-24 21:44:54 +00:00
c9b47daf1b New puzzle: Loopy', an implementation of Nikoli's Slither Link' or
`Loop the Loop' puzzle. Contributed by Mike Pinna.

[originally from svn r6211]
2005-08-24 21:32:54 +00:00
c6fa81bfc0 Minor update to Solo's documentation due to Extreme mode.
[originally from svn r6210]
2005-08-24 17:49:52 +00:00
99f8178aab Brand new difficulty level in Solo. The other day Gareth and I
independently discovered an advanced reasoning technique in Map, and
then it occurred to me that since Solo can also be considered as a
graph-colouring game the same technique ought to be applicable. And
it is; so here's a new difficulty level, `Extreme', which sits just
above Advanced. Grids graded `Extreme' by new-Solo will of course
fall into old-Solo's `Unreasonable' category (since they're not
soluble using the old set of non-recursive methods). A brief and
unscientific experiment suggests that about one in six Unreasonable
grids generated by old-Solo are classified Extreme by the new
solver; so the remaining Unreasonable mode (now containing a subset
of the grids it used to) hasn't actually become much harder.

[originally from svn r6209]
2005-08-24 17:32:39 +00:00
d558bb240a Don't report an error when loading a saved game from the command
line unless there really _is_ an error!

[originally from svn r6203]
2005-08-23 12:49:21 +00:00
196695afdf James H points out a rogue fprintf in Net's print routine.
[originally from svn r6202]
2005-08-22 22:58:19 +00:00
fb6e7f1a8b Memory leak in the new printing stuff, plus a couple of comment
corrections.

[originally from svn r6199]
2005-08-22 18:46:38 +00:00
b0614e6da8 `Solve' operation on an already solved map without an aux_info was
returning NULL due to no moves being required, leading to a strange
error message. Trivial fix.

[originally from svn r6198]
2005-08-22 09:27:52 +00:00
cd76bfb25f *blinks* I apparently didn't try _building_ the OS X port since the
printing upheaval. I could have sworn I had. Oh well; small errors
fixed.

[originally from svn r6197]
2005-08-21 10:55:17 +00:00
c136c3dde9 Retire redundant print_line_width() in Net: a relic from a failed
printing strategy, irrelevant to the one which worked.

[originally from svn r6194]
2005-08-20 15:49:43 +00:00
3bfb9b108e Native Windows printing support, using the infrastructure I put in
place in r6190. I'm quite pleased that I didn't have to modify the
printing infrastructure _at all_ to make this work; the only source
change required outside windows.c was the addition of a trivial
utility function midend_get_params(), and that was for the benefit
of bulk puzzle generation rather than anything to do with actual
printing.

As far as I can tell, all printable puzzles now print almost
indistinguishably from the way they print under Unix. If you look
closely the font is slightly different, and the Windows standard
hatching doesn't seem to be quite as nice as the kind I did by hand
in ps.c (and, particularly annoyingly, hatched areas don't show up
at all for me when I print to a file and use gv, though they come
out fine on the printer itself); but it's all there, and it all
works.

[originally from svn r6193]
[r6190 == af59dcf6858264103bbc621761feee3aed5aaf2a]
2005-08-20 15:48:55 +00:00
cf224a6556 Richard B points out a cut and paste error.
[originally from svn r6192]
2005-08-19 12:29:08 +00:00