177 Commits

Author SHA1 Message Date
b10be2b32a The #definition of COMBINED was done very badly: it was a piece of
platform-dependent code in puzzles.h (ick), which in turn depended
on the magic symbol MAC_OS_X being defined by mkfiles.pl itself
(yuck). Suddenly realised I can do much better simply by putting it
in an OS X makefile extras section in Recipe, and removing both
previous hacks. Much nicer.

[originally from svn r5191]
2005-01-24 12:09:51 +00:00
11dad948a3 Initial checkin of a Mac OS X port of puzzles, using Cocoa. All
puzzles are compiled together into a single monolithic application
which allows you to select each one from one of its menus.

[originally from svn r5173]
2005-01-22 18:34:18 +00:00
a99de1be8f Arrange that we really _can_ compile all the puzzles into a single
binary if we choose: fix bugs in cube.c and sixteen.c that manifest
when compiled that way, and introduce list.c which provides a global
list of all the available puzzles.

[originally from svn r5169]
2005-01-22 15:29:01 +00:00
cc54553226 Rather than each game backend file exporting a whole load of
functions and a couple of variables, now each one exports a single
structure containing a load of function pointers and said variables.
This should make it easy to support platforms on which it's sensible
to compile all the puzzles into a single monolithic application. The
two existing platforms are still one-binary-per-game.

[originally from svn r5126]
2005-01-17 13:48:57 +00:00
46fa25240e Add a jumble' key (J') to Net, which scrambles the positions of all unlocked
tiles randomly. (Rachel asked for this; it's been being tested for a good few
months now, and Simon didn't care either way, so in it goes :)

As part of this, the front end can now be asked to provide a random random
seed (IYSWIM).

[originally from svn r5019]
2004-12-22 19:27:26 +00:00
daac529a9e After discussion with Simon, the game redraw functions are now passed a new
argument `dir' which tells them whether this redraw is due to an undo, rather
than have them second-guess it from game state.
Note that none of the actual games yet take advantage of this; so it hasn't
been tested in anger (although it has been inspected by debugging).

[originally from svn r4469]
2004-08-16 16:29:54 +00:00
137c1d7bbd Added a help file, mostly thanks to Jacob.
[originally from svn r4460]
2004-08-16 12:23:56 +00:00
61f08e7634 Now that we have string-encodable game parameters, let's support a
command-line argument which is either a set of parameters or a
params+seed game ID.

[originally from svn r4234]
2004-05-20 08:22:49 +00:00
350683b253 Introduce routines in each game module to encode a set of game
parameters as a string, and decode it again. This is used in
midend.c to prepend the game parameters to the game seed, so that
copying out of the Specific box is sufficient to completely specify
the game you were playing.
Throughout development of these games I have referred to `seed'
internally, and `game ID' externally. Now there's a measurable
difference between them! :-)

[originally from svn r4231]
2004-05-19 11:57:09 +00:00
180802b362 Framework alteration: we now support a `game_ui' structure in
addition to the `game_state'. The new structure is intended to
contain ephemeral data pertaining to the game's user interface
rather than the actual game: things stored in the UI structure are
not restored in an Undo, for example.
make_move() is passed the UI to modify as it wishes; it is now
allowed to return the _same_ game_state it was passed, to indicate
that although no move has been made there has been a UI operation
requiring a redraw.

[originally from svn r4207]
2004-05-11 17:44:30 +00:00
2f999a9a59 dupstr() should take a const char *. In particular, this allows
compilation under GTK 2.

[originally from svn r4198]
2004-05-04 09:56:38 +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
6e42ddd31b Implement selection of game seeds, by reusing the config box
mechanism I've just invented (the midend handles the standard game
selection configuration). Each game is now required to validate its
own seed data before attempting to base a game on it and potentially
confusing itself.

[originally from svn r4186]
2004-05-03 08:51:31 +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
ee17149822 `BOOLEAN' is a term already used by Win32. Bah. Change terminology.
[originally from svn r4183]
2004-05-02 10:43:46 +00:00
44ff00665b Configuration dialog box, on the GTK front end only as yet.
[originally from svn r4182]
2004-05-01 11:32:12 +00:00
a8c8237bd0 Added a status bar.
[originally from svn r4174]
2004-04-29 19:23:08 +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
d396382abd Add a new game concept called a `flash'. This is a graphical effect
taking non-zero time, which is triggered by the making of a move and
is _not_ hurried to its conclusion by the start of the next move (so
the game redraw function is expected to be able to draw it in
parallel with continuing moves). The only thing that prematurely
terminates a flash is the start of a fresh flash. In particular,
this concept is used to display the completion flash in Net, because
at least _my_ playing instincts make me lock every piece I've
unambiguously placed, and hence the last turn move is instantly
followed by a lock move which was previously suppressing the
completion flash.

[originally from svn r4168]
2004-04-28 18:43:50 +00:00
64e6afdeed Have each game declare a name which is used for window titles etc.
[originally from svn r4167]
2004-04-28 17:46:04 +00:00
56a59e2e51 Introduce diagonal movement keys on the numeric keypad, and use them
as an alternative control method in Cube. (This was a bit of hassle
in the Windows front end; I also introduced a debugging framework
and made TranslateMessage conditional.)

[originally from svn r4162]
2004-04-28 17:21:57 +00:00
3d8e7585b7 Add a menu bar, in both Windows and GTK. In particular, game modules
are now expected to provide a list of `presets' (game_params plus a
name) which are selectable from the menu. This means I can play
both Octahedron and Cube without recompiling in between :-)
While I'm here, also enabled a Cygwin makefile, which Just Worked.

[originally from svn r4158]
2004-04-28 12:07:15 +00:00
c866e24f9a Most of a Windows front end. Something's not _quite_ right in the
GDI - there are blobs in the middle of powered lines in Net. But
it's 99% there now.

[originally from svn r4156]
2004-04-27 20:51:08 +00:00
d99e217cfb Implemented Cube, in a sufficiently general way that it also handles
the tetrahedron, octahedron and icosahedron.

[originally from svn r4151]
2004-04-27 17:44:30 +00:00
9867234e70 Further general development. Net is now playable, though
configuration is absent as yet.

[originally from svn r4145]
2004-04-26 17:10:44 +00:00
a87bb05760 General further development. Sketched out the mid-end, added more
GTK code, rudiments of event passing.

[originally from svn r4141]
2004-04-25 20:15:22 +00:00
96dbb537ee Initial checkin of a portable framework for writing small GUI puzzle
games.

[originally from svn r4138]
2004-04-25 14:27:58 +00:00