haven't checked in Makefile changes to enable this, but I'll at
least fix the specific problems it found when enabled as a one-off.
[originally from svn r5902]
puzzle of a different size to be redrawn before the pixmap is
resized, and since backends never redraw already-drawn stuff this is
a problem. Was biting me when I entered a Mines game ID of a
different size than the current settings into the Specific box.
[originally from svn r5872]
between on the one hand generating indeterminate game descriptions
awaiting the initial click, and on the other hand generating
concrete ones which have had their initial click. This makes `mines
--generate' do something useful.
[originally from svn r5869]
indicates whether a particular game state should have the timer
going (for Mines the initial indeterminate state does not have this
property, and neither does a dead or won state); a midend function
that optionally (on request from the game) prepends a timer to the
front of the status bar text; some complicated midend timing code.
It's not great. It's ugly; it's probably slightly inaccurate; it's
got no provision for anyone but the game author decreeing whether a
game is timed or not. But Mines can't be taken seriously without a
timer, so it's a start.
[originally from svn r5866]
(Adding modifier+cursors handling has had minor knock-on effects on the other
puzzles, so that they can continue to ignore modifiers.)
(An unfortunate side effect of this is some artifacts in exterior barrier
drawing; notably, a disconnected corner can now appear at the corner of the
grid under some circumstances. I haven't found a satisfactory way round
this yet.)
[originally from svn r5844]
cross-platform, and rename the environment variables so that they
follow the puzzle name. Should allow a static environment
configuration for each puzzle. Also introduced a <game>_PRESETS
variable for people whose favourite configuration isn't on the Type
menu by default.
[originally from svn r5801]
particularly useful keypress, particularly given how easy it is to
confuse it with `Redo'. So both r and ^R are now Redo, and Restart
is relegated to being a menu-only option.
[originally from svn r5796]
rather than literal grid descriptions, which has always faintly
annoyed me because it makes it impossible to type in a grid from
another source. However, Gareth pointed out that short random-seed
game descriptions are useful, because you can read one out to
someone else without having to master the technology of cross-
machine cut and paste, or you can have two people enter the same
random seed simultaneously in order to race against each other to
complete the same puzzle. So both types of game ID seem to have
their uses.
Therefore, here's a reorganisation of the whole game ID concept.
There are now two types of game ID: one has a parameter string then
a hash then a piece of arbitrary random seed text, and the other has
a parameter string then a colon then a literal game description. For
most games, the latter is identical to the game IDs that were
previously valid; for Net and Netslide, old game IDs must be
translated into new ones by turning the colon into a hash, and
there's a new descriptive game ID format.
Random seed IDs are not guaranteed to be portable between software
versions (this is a major reason why I added version reporting
yesterday). Descriptive game IDs have a longer lifespan.
As an added bonus, I've removed the sections of documentation
dealing with game parameter encodings not shown in the game ID
(Rectangles expansion factor, Solo symmetry and difficulty settings
etc), because _all_ parameters must be specified in a random seed ID
and therefore users can easily find out the appropriate parameter
string for any settings they have configured.
[originally from svn r5788]
ends. Versioning will be done solely by Subversion revision number,
since development on these puzzles is very incremental and gradual
and there don't tend to be obvious points to place numbered
releases.
[originally from svn r5781]
keypad. The reason it doesn't is because front ends were carefully
translating the numeric keypad into 8-way directional keys for the
benefit of Cube. Therefore, a policy change:
- front ends process the numeric keypad by sending MOD_NUM_KEYPAD |
'3' and similar
- front ends running on a platform with Num Lock SHOULD do this
_irrespective_ of the state of Num Lock
- back ends do whatever they see fit with numeric keypad keys.
Result: the numeric keypad now works in Solo, and also works in OS X
Cube (which it previously didn't because I forgot to implement that
bit of the front end!).
[originally from svn r5774]
various things:
- if you haven't fully understood what a game is about, it gives
you an immediate example of a puzzle plus its solution so you can
understand it
- in some games it's useful to compare your solution with the real
one and see where you made a mistake
- in the rearrangement games (Fifteen, Sixteen, Twiddle) it's handy
to be able to get your hands on a pristine grid quickly so you
can practise or experiment with manoeuvres on it
- it provides a good way of debugging the games if you think you've
encountered an unsolvable grid!
[originally from svn r5731]
constructed at the same time as an internally generated game seed,
so that it can preserve any interesting information known by the
program at generation time but not physically contained within the
text of the game seed itself. (Such as, for example, the solution.)
Currently not used for anything yet, but it will be.
[originally from svn r5729]
as text. This is used by front ends to implement copy-to-clipboard.
Currently the function does nothing (and is disabled) in every game
except Solo, but it's a start.
[originally from svn r5724]
puzzle, to make it construcct puzzle IDs and output them on stdout.
Also checked in print.py, a script which reads puzzle IDs on stdin
and produces PostScript output. With these, you can generate pages
of Pattern, Rectangles and Solo puzzles to take on trains with you.
[originally from svn r5707]
builds better:
- the GTK makefile now defines $(GTK_CONFIG) which you can
override, so you can build for GTK 2 with no makefile-editing
simply by running `make GTK_CONFIG="pkg_config gtk+-2.0"'
- we use Pango to find appropriate fonts, which means the text in
the puzzles actually (gasp!) adapts its size to the
circumstances. Unfortunately, I've been unable to do this
portably without depending on _either_ a Pango function that
isn't present in older versions _or_ the underlying window system
being X11; I'd appreciate someone doing better.
[originally from svn r5693]
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]
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]
might run again in mid-shutdown and cause chaos, if you hit `q' in
the middle of an animated sequence such as the Net finishing flash.
[originally from svn r4525]
gtk_main_quit not to get called, with the result that the whole game
ended up running one gtk_main level lower down. This meant that
final dialog box processing was not performed, so that (for example)
selecting 1x1 in Net, hitting OK and getting an error box, then
selecting a different size and hitting OK again failed to change to
the new size.
[originally from svn r4376]
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]
specifically, the elapsed time between calls varies much more with
GTK than it does under Windows. Therefore, I now take my own time
readings on every timer call, and this appears to have made the
animations run at closer to the same speed between platforms. Having
done that, I decided some of them were at the _wrong_ speed, and
fiddled with each game's timings as well.
[originally from svn r4189]
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]
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]
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]
doesn't fit in it. This not only looked ugly, but caused unnecessary
calls to configure_area() and kept destroying the pixmap.
[originally from svn r4180]
Windows users who may not have a middle button at all, but I've
replicated it in GTK to maintain cross-platform consistency.
[originally from svn r4166]
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]
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]