26 Commits

Author SHA1 Message Date
73daff3937 Changed my mind about midend_is_solved: I've now reprototyped it as
midend_status(), and given it three return codes for win, (permanent)
loss and game-still-in-play. Depending on what the front end wants to
use it for, it may find any or all of these three states worth
distinguishing from each other.

(I suppose a further enhancement might be to add _non_-permanent loss
as a fourth distinct status, to describe situations in which you can't
play further without pressing Undo but doing so is not completely
pointless. That might reasonably include dead-end situations in Same
Game and Pegs, and blown-self-up situations in Mines and Inertia.
However, I haven't done this at present.)

[originally from svn r9179]
2011-06-19 13:43:35 +00:00
2efc77d2fd Fix warnings generated by gcc 4.6.0 about variables set but not
thereafter read. Most of these changes are just removal of pointless
stuff or trivial reorganisations; one change is actually substantive,
and fixes a bug in Keen's clue selection (the variable 'bad' was
unreferenced not because I shouldn't have set it, but because I
_should_ have referenced it!).

[originally from svn r9164]
2011-05-04 18:22:14 +00:00
980880be1f Add a function to every game backend which indicates whether a game
state is in a solved position, and a midend function wrapping it.

(Or, at least, a situation in which further play is pointless. The
point is, given that game state, would it be a good idea for a front
end that does that sort of thing to proactively provide the option to
start a fresh game?)

[originally from svn r9140]
2011-04-02 16:19:12 +00:00
9f96c12e9f Fix from James H: in printing mode, the shared code between drawing
and printing must avoid referring to stuff in the game_drawstate,
since the game_drawstate isn't a real one.

[originally from svn r8851]
2010-01-18 21:23:26 +00:00
97477f0916 Patches from Frode Austvik to modify the effects of the mouse
buttons in several games if STYLUS_BASED is defined: in games where
you can set a puzzle element to 'on', 'off' or 'not yet set', when
it's hard to mimic a second mouse button, it's better to have the
one 'button' cycle between all three states rather than from 'on'
back to 'unset'.

[originally from svn r8784]
2009-12-17 18:16:42 +00:00
4f6e48e6be Add a couple of missing checks in validate_desc(), without which
bogus game IDs were getting as far as new_game() and failing
assertions.

[originally from svn r8655]
2009-09-16 12:57:07 +00:00
466c398a00 Minor rewording and typo-correction.
[originally from svn r8654]
2009-09-16 11:06:02 +00:00
ddfa693b0f Aha, I've managed to prove that my inadequate error highlighting is
actually just about adequate after all. Large comment added
containing some discussion and the proof.

[originally from svn r8653]
2009-09-16 10:57:11 +00:00
84d012998f Error-highlighted trees look nicer with a different-coloured trunk.
Also added a comment worrying about the universality of my error
highlighting mechanism.

[originally from svn r8647]
2009-09-13 14:43:21 +00:00
e2522c2897 Tweak to the promptness of error highlighting display.
[originally from svn r8645]
2009-09-12 12:54:49 +00:00
1b927c77b7 About time I got round to this: error highlighting for Tents.
[originally from svn r8644]
2009-09-12 12:30:43 +00:00
767ec24009 Patch from Mark Wooding: one-pixel fix to the alignment of the
bottom and right edges of the Tents keyboard cursor.

[originally from svn r8598]
2009-06-21 13:28:43 +00:00
28acb0ebdc Keyboard cursor support for Tents, from James H.
[originally from svn r8416]
2009-01-16 18:50:22 +00:00
fe1b91ac49 Since the lack of this has caused portability issues in the past:
add "-ansi -pedantic" to the main Unix makefile, and clean up a few
minor problems pointed out thereby.

[originally from svn r8175]
2008-09-13 18:25:19 +00:00
a7431c0b7c New infrastructure feature. Games are now permitted to be
_conditionally_ able to format the current puzzle as text to be sent
to the clipboard. For instance, if a game were to support playing on
a square grid and on other kinds of grid such as hexagonal, then it
might reasonably feel that only the former could be sensibly
rendered in ASCII art; so it can now arrange for the "Copy" menu
item to be greyed out depending on the game_params.

To do this I've introduced a new backend function
(can_format_as_text_now()), and renamed the existing static backend
field "can_format_as_text" to "can_format_as_text_ever". The latter
will cause compile errors for anyone maintaining a third-party front
end; if any such person is reading this, I apologise to them for the
inconvenience, but I did do it deliberately so that they'd know to
update their front end.

As yet, no checked-in game actually uses this feature; all current
games can still either copy always or copy never.

[originally from svn r8161]
2008-09-06 09:27:56 +00:00
15f70f527a Dariusz Olszewski's changes to support compiling for PocketPC. This
is mostly done with ifdefs in windows.c; so mkfiles.pl generates a
new makefile (Makefile.wce) and Recipe enables it, but it's hardly
any different from Makefile.vc apart from a few definitions at the
top of the files.

Currently the PocketPC build is not enabled in the build script, but
with any luck I'll be able to do so reasonably soon.

[originally from svn r7337]
2007-02-26 20:35:47 +00:00
7b1f7d3e01 HTML Help support for Puzzles, with the same kind of automatic
fallback behaviour as PuTTY's support.

[originally from svn r7009]
2006-12-24 15:56:47 +00:00
5e28f1a971 Fix segfault in Tents' printing.
[originally from svn r6422]
2005-10-22 18:18:21 +00:00
eb2013efc0 Cleanup: it was absolutely stupid for game_wants_statusbar() to be a
function, since it took no parameters by which to vary its decision,
and in any case it's hard to imagine a game which only
_conditionally_ wants a status bar. Changed it into a boolean data
field in the backend structure.

[originally from svn r6417]
2005-10-22 16:52:16 +00:00
40fcf516f4 Cleanup: remove the game_state parameter to game_colours(). No game
was actually using it, and also it wasn't being called again for
different game states or different game parameters, so it would have
been a mistake to depend on anything in that game state. Games are
now expected to commit in advance to a single fixed list of all the
colours they will ever need, which was the case in practice already
and simplifies any later port to a colour-poor platform. Also this
change has removed a lot of unnecessary faff from midend_colours().

[originally from svn r6416]
2005-10-22 16:44:38 +00:00
b7f192eea3 Cleanup: the `mouse_priorities' field in the back end has been a
more general-purpose flags word for some time now. Rename it to
`flags'.

[originally from svn r6414]
2005-10-22 16:35:23 +00:00
6ea453c95f Miscellaneous fixes. Correct a comparison of y with w causing
assertion failures in portrait-type grids; retire an unused array in
the game generation function (my original generation strategy needed
it, but the final one didn't); correct a typo; further restrict the
generable sizes of game and include a special case for 4x4dt to
prevent a tight loop.

[originally from svn r6405]
2005-10-17 18:41:05 +00:00
5f16a29d4c Janes H provides a small workaround for a Palm tools bug.
[originally from svn r6403]
2005-10-15 16:03:14 +00:00
3bee86241c Small error in solver diagnostics.
[originally from svn r6402]
2005-10-15 15:01:40 +00:00
e841ab4367 Revamp of the control mechanism to permit drag- as well as
click-based control. Only used for right-dragging to clear a large
area to NONTENT.

[originally from svn r6400]
2005-10-14 12:23:41 +00:00
669bb81f08 New puzzle: `Tents'. Requires a potentially shared algorithms module
maxflow.c. Also in this checkin, fixes to the OS X and GTK back ends
to get ALIGN_VNORMAL right. This is the first time I've used it! :-)

[originally from svn r6390]
2005-10-13 18:30:24 +00:00