94 Commits

Author SHA1 Message Date
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
2ac017b62c Fix for the grid generation in the presence of particularly strange
grid types.

[originally from svn r8750]
2009-11-16 21:21:00 +00:00
cfdba00313 More defensive-coding fixes from James H.
[originally from svn r8605]
2009-07-01 22:01:21 +00:00
4ecc4f92d8 Patch from Mark Wooding (though somewhat tampered with by me): have
Loopy mark LINE_NO grid edges with very faint lines, instead of
leaving them totally undrawn. Helps in complex grid types where the
line layout isn't entirely obvious to a player not already familiar
with it. Disableable by setting LOOPY_FAINT_LINES=n in the
environment, just in case anyone turns out to seriously dislike it.
(You could probably disable it via LOOPY_COLOUR_6 too, but you'd
have to know the exact shade of your background to get that right.)

[originally from svn r8597]
2009-06-21 13:24:48 +00:00
fee17c3704 Patch from Lambros to make the Normal difficulty level easier, since
people have generally seemed to think Loopy is one of the more
difficult puzzles in the collection. There's a new level called
Tricky, between Normal and Hard, which is equivalent to the old
Normal.

[originally from svn r8398]
2009-01-07 23:07:11 +00:00
d9e39add3a Standalone solver for Loopy. Bit half-hearted, since the solver
doesn't have diagnostics embedded and the ASCII formatter can't
print non-square puzzles anyway; but it can grade difficulty, which
is what I most immediately want it for.

[originally from svn r8397]
2009-01-07 21:55:21 +00:00
f4bd45e7b9 Patch from Lambros to improve the generality of path-generation. In
particular, Great Hexagonal tilings previously had virtually every
(if not _actually_ every) hexagon on the inside of the path, and now
don't.

[originally from svn r8277]
2008-11-04 21:39:59 +00:00
734dc80c53 Lambros points out that trying to generate a 3x3 Cairo Easy grid
spins forever, but observes that raising the limit to 4x4 across all
grid types is not good for the complex grids like great-hexagonal.
Introduce per-grid minimum sizes using mad macro trickery.

(In fact, for each grid type I've put in a minimum size which _both_
dimensions must equal or exceed, plus another minimum size which _at
least one_ must equal or exceed; that permits both 3x4 and 4x3 Cairo
while disallowing 3x3.)

[originally from svn r8191]
2008-09-18 18:19:55 +00:00
ef6166e198 Patch from Lambros implementing error highlighting in Loopy.
[originally from svn r8190]
2008-09-18 15:33:13 +00:00
4cfec3765a Cosmetic: fix mismatch between game_compute_size() and game_redraw()
(was causing unwanted "drop-shadow" type effect).

[originally from svn r8186]
2008-09-16 23:51:57 +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
acf5c55d35 Patch from James H to make new-Loopy port more easily.
[originally from svn r8174]
2008-09-10 21:44:23 +00:00
018fa4053d Having played new-Loopy a bit recently, I've had occasion to think a
bit harder about advanced solver techniques. Expand the comment at
the top of the file.

[originally from svn r8167]
2008-09-07 10:02:40 +00:00
4033458aff How did I manage to check this in without actually trying to build
on Windows at all?! Fix some departures from the C standard, mostly
declaring variables after a statement has already been issued in the
same block. MSVC is picky about this where gcc is forgiving, and TBH
I'd change the latter given the choice.

[originally from svn r8166]
2008-09-07 08:35:52 +00:00
f38b711c73 Completely re-engineered version of Loopy, courtesy of Lambros
Lambrou. Now capable of handling triangular and hexagonal grids as
well as square ones, and then a number of semiregular plane tilings
and duals of semiregular ones. In fact, most of the solver code
supports an _arbitrary_ planar graph (well, provided both the graph
and its dual have no self-edges), so it could easily be extended
further with only a little more effort.

[originally from svn r8162]
2008-09-06 15:19:47 +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
519b7de973 A user points out that Loopy's solver relies on elements of the
`clues' array being able to be -1, so we must explicitly declare it
as `signed char' or it will break on platforms whose default char is
unsigned.

[originally from svn r7636]
2007-07-05 18:57:50 +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
cb57de3e44 Patch from James H which shouldn't change the functionality of
Loopy, but makes it build more sensibly on the Palm.

[originally from svn r7114]
2007-01-15 20:21:57 +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
e08948a7ea Small printing fix from Gary Wong. Shows up when printing with
solutions: the rightmost and lowermost lines of the grid never get
solution lines drawn on them.

[originally from svn r7003]
2006-12-21 17:11:56 +00:00
13a9cb0bea James H's Palm-compatibility updates to the latest Loopy changes,
working around bugs in the Palm compiler and removing Palm-
incompatible diagnostics such as fprintf.

[originally from svn r6889]
2006-11-01 13:25:25 +00:00
b9547673c6 Mike Pinna has done some major reworking of the Loopy solver, giving
rise to a new Hard difficulty level.

[originally from svn r6880]
2006-10-28 15:38:53 +00:00
197e262ba6 Cleanup patch from Ben Hutchings, fixing some odd-looking range
checks. He thinks they were harmless (due to being followed by other
range checks in RIGHTOF_DOT and friends) but it clearly can't hurt
to fix them anyway.

[originally from svn r6709]
2006-05-20 11:54:21 +00:00
877900f58a Patch from Ben Hutchings to prevent memory leakage during Loopy game
generation.

[originally from svn r6708]
2006-05-20 11:52:22 +00:00
ac027d9d08 Revert a change in an assertion made in r6299. It was right the
first time, and now has a comment explaining why!

[originally from svn r6511]
[r6299 == c389f623f66fe5296f7ef5c66d88884607b82cff]
2006-01-05 09:40:51 +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
29afca3ef9 loopy_diffnames[] isn't used, and provokes a warning on OS X.
[originally from svn r6389]
2005-10-13 18:27:57 +00:00
8a8474a311 Use game_set_size() to set up the temporary drawstate in
game_print(), wherever feasible. This fixes a specific bug in Loopy
(James H's new field ds->linewidth wasn't being set up, leading to
corrupted print output), but I've made the change in all affected
files because it also seems like a generally good idea to encourage
it for future games, to prevent other problems of this type.

There is one slight snag, which is that Map _can't_ do this because
its game_set_size() also initialises a blitter. I could fix this by
abstracting the common parts of Map's game_set_size() out into a
subfunction called by game_set_size() and also called directly by
game_print(); alternatively, I could introduce a means of
determining whether a `drawing *' was for screen or printing use.
Not sure which yet.

[originally from svn r6340]
2005-09-23 12:50:51 +00:00
71966d06a2 Bug fix from James H: prevent LINEWIDTH ever reaching zero.
[originally from svn r6331]
2005-09-18 17:00:07 +00:00
c8145f3bba Another optimisation patch from Mike, which (among other things)
eliminates gratuitous duplication of the solver state every time it
goes round the main loop, in favour of the usual type of
`done_something' flag.

[originally from svn r6322]
2005-09-18 12:09:16 +00:00
8730242870 Optimisation patch from Mike: remember which squares we've entirely
finished dealing with, and don't do them again on the next loop.

[originally from svn r6312]
2005-09-15 18:09:27 +00:00
a5891971c1 Patch from Mike: fix an array indexing error in the clue
highlighting, and adjust the presets.

[originally from svn r6303]
2005-09-13 18:34:12 +00:00
c389f623f6 Patch from Mike:
- remove the backtracking `Hard' level, on the grounds that it was
   incredibly slow and not really usable.
 - introduce an `Easy' difficulty level below the standard one; many
   people seem to find this puzzle unusually hard, so an easy level
   is particularly helpful.
 - highlight unfulfillable clue squares (but not yet any other types
   of obvious error).

[originally from svn r6299]
2005-09-12 17:13:26 +00:00
f71630073f Minor improvement to initial loop generation.
[originally from svn r6292]
2005-09-11 18:05:23 +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
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
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
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