16 Commits

Author SHA1 Message Date
178f87a79e Patch idea from Debian, but modified considerably in implementation:
introduce a new colour in Slant (COL_FILLEDSQUARE) which is used for
the background of any grid square that has a diagonal line in it.
This makes it easier to spot the one square on a giant board you
forgot to fill in, but on the other hand I found it to look very
strange and disconcerting. So I've set the colour to be identical to
COL_BACKGROUND by default, and users who like the idea can enable it
by environment variable or by local patch.

[originally from svn r8930]
2010-04-25 14:57:20 +00:00
2b06c12728 Keyboard control for Dominosa (patch largely due to James H, though
with considerable meddling from me).

[originally from svn r8788]
2009-12-22 16:47:42 +00:00
cc0f957d82 Patch from James H to add keyboard control in Sixteen and Netslide
(and also belatedly document the keyboard support in Unequal).

[originally from svn r8432]
2009-01-26 19:14:44 +00:00
5ead207060 Patch from James H to centralise some generally useful cursor-
handling functionality into misc.c.

[originally from svn r8176]
2008-09-13 18:26:53 +00:00
ab80d0b7fd Add a new misc.c function needed by Slide's colour setup.
[originally from svn r7552]
2007-05-07 17:50:14 +00:00
af59dcf685 Substantial infrastructure upheaval. I've separated the drawing API
as seen by the back ends from the one implemented by the front end,
and shoved a piece of middleware (drawing.c) in between to permit
interchange of multiple kinds of the latter. I've also added a
number of functions to the drawing API to permit printing as well as
on-screen drawing, and retired print.py in favour of integrated
printing done by means of that API.

The immediate visible change is that print.py is dead, and each
puzzle now does its own printing: where you would previously have
typed `print.py solo 2x3', you now type `solo --print 2x3' and it
should work in much the same way.

Advantages of the new mechanism available right now:
 - Map is now printable, because the new print function can make use
   of the output from the existing game ID decoder rather than me
   having to replicate all those fiddly algorithms in Python.
 - the new print functions can cope with non-initial game states,
   which means each puzzle supporting --print also supports
   --with-solutions.
 - there's also a --scale option permitting users to adjust the size
   of the printed puzzles.

Advantages which will be available at some point:
 - the new API should permit me to implement native printing
   mechanisms on Windows and OS X.

[originally from svn r6190]
2005-08-18 17:50:14 +00:00
8ac92e8607 Two tiny cleanup patches from James H.
[originally from svn r6111]
2005-07-17 14:49:13 +00:00
782a4f3fec Get rid of the malloc in shuffle(), by defining a subfunction
memswap() which declares a fixed-size buffer on the stack and uses
it multiple times if necessary.

[originally from svn r6107]
2005-07-17 12:12:16 +00:00
e12017b291 Another game from James H: `Black Box'.
[originally from svn r6100]
2005-07-17 08:44:18 +00:00
931a7ca45f Cleanups and memory leak fixes from James H.
[originally from svn r6099]
2005-07-16 20:06:37 +00:00
bb63d0d399 Introduce a `shuffle' utility function.
[originally from svn r6090]
2005-07-14 17:37:05 +00:00
753339737e Refactoring from James H: the highlight and lowlight colour setup
common to Fifteen, Sixteen, Twiddle and Pegs is now a utility
function in misc.c.

[originally from svn r6076]
2005-07-06 18:27:40 +00:00
f862a227be `Guess', a Mastermind clone from James Harvey. This checkin also
introduces a few new utility functions in misc.c, one of which is
the bitmap obfuscator from Mines (which has therefore been moved out
of mines.c).

[originally from svn r5992]
2005-06-23 09:14:19 +00:00
aa9a8e8c7e The Windows RNG turns out to only give about 16 bits at a time. This
is (a) pretty feeble, and (b) means that although Net seeds transfer
between platforms and still generate the same game, there's a
suspicious discrepancy in the typical seed _generated_ by each
platform.
I have a better RNG kicking around in this code base already, so
I'll just use it. Each midend has its own random_state, which it
passes to new_game_seed() as required. A handy consequence of this
is that initial seed data is now passed to midend_new(), which means
that new platform implementors are unlikely to forget to seed the
RNG because failure to do so causes a compile error!

[originally from svn r4187]
2004-05-03 09:10:52 +00:00
e8f6124996 Game configuration box for Windows, by constructing the dialog box
right from scratch without the slightest reference to any dialog
templates (meaning that we get to figure out the layout and _then_
choose the window size). I'm rather pleased with that. Also
introduced free_cfg(), which is why this checkin touched gtk.c as
well.

[originally from svn r4184]
2004-05-03 07:52:33 +00:00
fa7ef572c7 Implemented text and clipping primitives in the frontend, and added
two new simple games `fifteen' and `sixteen'.

[originally from svn r4173]
2004-04-29 18:10:22 +00:00