simon [Mon, 16 Aug 2004 12:23:56 +0000 (12:23 +0000)]
Added a help file, mostly thanks to Jacob.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4460
cda61777-01e9-0310-a592-
d414129be87e
simon [Fri, 30 Jul 2004 12:16:57 +0000 (12:16 +0000)]
Failed to connect up the `destroy' signal in error_box(), causing
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.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4376
cda61777-01e9-0310-a592-
d414129be87e
simon [Mon, 5 Jul 2004 10:32:26 +0000 (10:32 +0000)]
HACKING should be in .cvsignore.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4322
cda61777-01e9-0310-a592-
d414129be87e
simon [Wed, 26 May 2004 09:07:14 +0000 (09:07 +0000)]
Richard B's utterly evil `netslide': cross between Net and Sixteen.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4257
cda61777-01e9-0310-a592-
d414129be87e
simon [Mon, 24 May 2004 13:07:28 +0000 (13:07 +0000)]
Added the beginnings of a hacking guide.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4255
cda61777-01e9-0310-a592-
d414129be87e
simon [Sat, 22 May 2004 13:08:18 +0000 (13:08 +0000)]
makedist.sh should be silent.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4240
cda61777-01e9-0310-a592-
d414129be87e
simon [Sat, 22 May 2004 13:07:23 +0000 (13:07 +0000)]
Fix a memory leak.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4239
cda61777-01e9-0310-a592-
d414129be87e
simon [Thu, 20 May 2004 08:22:49 +0000 (08:22 +0000)]
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.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4234
cda61777-01e9-0310-a592-
d414129be87e
simon [Wed, 19 May 2004 11:57:09 +0000 (11:57 +0000)]
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! :-)
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4231
cda61777-01e9-0310-a592-
d414129be87e
simon [Wed, 12 May 2004 18:54:16 +0000 (18:54 +0000)]
Fix `visible' calculation (again).
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4223
cda61777-01e9-0310-a592-
d414129be87e
simon [Wed, 12 May 2004 18:53:47 +0000 (18:53 +0000)]
Ahem. Seed validation was completely broken.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4222
cda61777-01e9-0310-a592-
d414129be87e
simon [Wed, 12 May 2004 18:45:11 +0000 (18:45 +0000)]
During redraws, I now do corner analysis centrally, which enables me
to maintain the `visible' array accurately and hence actually switch
it on. This prevents us having to redraw the entire playing area on
any move, which means really big grids are now sensibly playable
without display lag.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4221
cda61777-01e9-0310-a592-
d414129be87e
simon [Wed, 12 May 2004 18:28:11 +0000 (18:28 +0000)]
Remove vestigial code from the previous attempt at clever grid
generation. Grid generation should now be orders of magnitude faster
at large sizes.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4220
cda61777-01e9-0310-a592-
d414129be87e
simon [Wed, 12 May 2004 12:33:03 +0000 (12:33 +0000)]
Fiddle with the coordinate system to see if I can improve user
experience.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4219
cda61777-01e9-0310-a592-
d414129be87e
simon [Wed, 12 May 2004 12:32:27 +0000 (12:32 +0000)]
Flash on completion. Two people actually complained! :-)
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4218
cda61777-01e9-0310-a592-
d414129be87e
simon [Tue, 11 May 2004 23:22:08 +0000 (23:22 +0000)]
Missing draw_update call.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4216
cda61777-01e9-0310-a592-
d414129be87e
simon [Tue, 11 May 2004 19:32:05 +0000 (19:32 +0000)]
Rename the Windows Net executable, due to its clash with the system
net.exe.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4215
cda61777-01e9-0310-a592-
d414129be87e
simon [Tue, 11 May 2004 19:24:22 +0000 (19:24 +0000)]
Now we have the UI abstraction, use it to implement keyboard control
in Net.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4214
cda61777-01e9-0310-a592-
d414129be87e
simon [Tue, 11 May 2004 18:46:36 +0000 (18:46 +0000)]
And I _always_ forget to clear the background when first drawing the
display of a new game, so I'll add it to nullgame.c and hope that
makes me remember it next time!
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4213
cda61777-01e9-0310-a592-
d414129be87e
simon [Tue, 11 May 2004 18:46:10 +0000 (18:46 +0000)]
Cosmetic fixes for Windows.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4212
cda61777-01e9-0310-a592-
d414129be87e
simon [Tue, 11 May 2004 18:37:20 +0000 (18:37 +0000)]
Don't rush move animation to a conclusion on a subsequent keypress
unless there's actual activity happening as a result of the move.
Net animations were tending to get rushed to conclusion by the mouse
button release now that it's being reported to the mid-end.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4211
cda61777-01e9-0310-a592-
d414129be87e
simon [Tue, 11 May 2004 18:32:48 +0000 (18:32 +0000)]
We should turn off the dragging variables in the UI _whenever_
`enddrag' is TRUE, not just when the end of the drag was within a
sensible range.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4210
cda61777-01e9-0310-a592-
d414129be87e
simon [Tue, 11 May 2004 18:29:49 +0000 (18:29 +0000)]
Rectangles is now actually playable, since I've used the new UI
feature to arrange a mechanism that allows you to draw a whole
rectangle at a time by dragging rather than having to click each
edge individually.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4209
cda61777-01e9-0310-a592-
d414129be87e
simon [Tue, 11 May 2004 17:45:45 +0000 (17:45 +0000)]
Oops - missed a bit in the GTK front end :-)
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4208
cda61777-01e9-0310-a592-
d414129be87e
simon [Tue, 11 May 2004 17:44:30 +0000 (17:44 +0000)]
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.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4207
cda61777-01e9-0310-a592-
d414129be87e
simon [Tue, 11 May 2004 17:06:50 +0000 (17:06 +0000)]
Added a new game, `Rectangles', taken from nikoli.co.jp.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4206
cda61777-01e9-0310-a592-
d414129be87e
simon [Tue, 4 May 2004 11:20:47 +0000 (11:20 +0000)]
Forgot to initialise the font variables in the Windows frontend structure.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4200
cda61777-01e9-0310-a592-
d414129be87e
simon [Tue, 4 May 2004 10:24:08 +0000 (10:24 +0000)]
Forgot to set up the initial value of checkboxes.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4199
cda61777-01e9-0310-a592-
d414129be87e
simon [Tue, 4 May 2004 09:56:38 +0000 (09:56 +0000)]
dupstr() should take a const char *. In particular, this allows
compilation under GTK 2.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4198
cda61777-01e9-0310-a592-
d414129be87e
simon [Tue, 4 May 2004 09:18:33 +0000 (09:18 +0000)]
Net puzzles more than 32 tiles wide weren't working properly due to
me testing the wrong variables for clicks on the tile border...
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4197
cda61777-01e9-0310-a592-
d414129be87e
simon [Tue, 4 May 2004 08:33:28 +0000 (08:33 +0000)]
Peter Maydell points out that the README misspells `Makefile' as
`Makefile.gtk'.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4196
cda61777-01e9-0310-a592-
d414129be87e
simon [Tue, 4 May 2004 08:28:47 +0000 (08:28 +0000)]
Uninitialised variable caused ultra-wide windows. Silly.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4195
cda61777-01e9-0310-a592-
d414129be87e
simon [Mon, 3 May 2004 13:07:43 +0000 (13:07 +0000)]
Add a README.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4194
cda61777-01e9-0310-a592-
d414129be87e
simon [Mon, 3 May 2004 13:03:12 +0000 (13:03 +0000)]
Shell script to prepare a source distribution archive.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4193
cda61777-01e9-0310-a592-
d414129be87e
simon [Mon, 3 May 2004 12:48:13 +0000 (12:48 +0000)]
Add a licence file.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4192
cda61777-01e9-0310-a592-
d414129be87e
simon [Mon, 3 May 2004 12:12:30 +0000 (12:12 +0000)]
Redraws during undo in Sixteen had been broken by my faffing about
with last_movement_sense (which was necessary to fix the animation
when the grid was only 2 squares wide in either dimension). Movement
sense is now inverted if the move being animated is an undo.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4191
cda61777-01e9-0310-a592-
d414129be87e
simon [Mon, 3 May 2004 09:43:08 +0000 (09:43 +0000)]
GTK and Windows appear to handle timers very differently:
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.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4189
cda61777-01e9-0310-a592-
d414129be87e
simon [Mon, 3 May 2004 09:19:34 +0000 (09:19 +0000)]
Make Return and Escape work reliably in GTK dialog boxes.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4188
cda61777-01e9-0310-a592-
d414129be87e
simon [Mon, 3 May 2004 09:10:52 +0000 (09:10 +0000)]
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!
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4187
cda61777-01e9-0310-a592-
d414129be87e
simon [Mon, 3 May 2004 08:51:31 +0000 (08:51 +0000)]
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.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4186
cda61777-01e9-0310-a592-
d414129be87e
simon [Mon, 3 May 2004 07:56:23 +0000 (07:56 +0000)]
`Fifteen' was getting the parity wrong on any size of board where
the top left and bottom right corners didn't have the same
chessboard colour.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4185
cda61777-01e9-0310-a592-
d414129be87e
simon [Mon, 3 May 2004 07:52:33 +0000 (07:52 +0000)]
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.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4184
cda61777-01e9-0310-a592-
d414129be87e
simon [Sun, 2 May 2004 10:43:46 +0000 (10:43 +0000)]
`BOOLEAN' is a term already used by Win32. Bah. Change terminology.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4183
cda61777-01e9-0310-a592-
d414129be87e
simon [Sat, 1 May 2004 11:32:12 +0000 (11:32 +0000)]
Configuration dialog box, on the GTK front end only as yet.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4182
cda61777-01e9-0310-a592-
d414129be87e
simon [Sat, 1 May 2004 08:58:48 +0000 (08:58 +0000)]
Remove arbitrary restriction on Net minimum game size. (Awww, cute
2x2! Cuter 2x1!)
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4181
cda61777-01e9-0310-a592-
d414129be87e
simon [Sat, 1 May 2004 07:53:53 +0000 (07:53 +0000)]
Wrap the status bar in a viewport, to avoid it expanding if the text
doesn't fit in it. This not only looked ugly, but caused unnecessary
calls to configure_area() and kept destroying the pixmap.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4180
cda61777-01e9-0310-a592-
d414129be87e
simon [Sat, 1 May 2004 07:32:09 +0000 (07:32 +0000)]
The cube was being drawn slightly differently on the top and left
rows, because the coordinates were crossing one or other axis at
that point and so the lower coordinate was being rounded up while
the upper one was rounded down. Judicious use of floor() fixes it.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4179
cda61777-01e9-0310-a592-
d414129be87e
simon [Fri, 30 Apr 2004 10:17:22 +0000 (10:17 +0000)]
Keep the status bar in better sync with the game display.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4177
cda61777-01e9-0310-a592-
d414129be87e
simon [Fri, 30 Apr 2004 10:14:55 +0000 (10:14 +0000)]
We were forgetting to count the final move.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4176
cda61777-01e9-0310-a592-
d414129be87e
simon [Fri, 30 Apr 2004 10:11:53 +0000 (10:11 +0000)]
Incorrect placing of the polyhedron sometimes left it on a blue
square. Oops.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4175
cda61777-01e9-0310-a592-
d414129be87e
simon [Thu, 29 Apr 2004 19:23:08 +0000 (19:23 +0000)]
Added a status bar.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4174
cda61777-01e9-0310-a592-
d414129be87e
simon [Thu, 29 Apr 2004 18:10:22 +0000 (18:10 +0000)]
Implemented text and clipping primitives in the frontend, and added
two new simple games `fifteen' and `sixteen'.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4173
cda61777-01e9-0310-a592-
d414129be87e
simon [Thu, 29 Apr 2004 09:15:42 +0000 (09:15 +0000)]
`There's always one'. Add nullgame to .cvsignore.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4170
cda61777-01e9-0310-a592-
d414129be87e
simon [Thu, 29 Apr 2004 08:37:19 +0000 (08:37 +0000)]
Add a template file defining the null game.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4169
cda61777-01e9-0310-a592-
d414129be87e
simon [Wed, 28 Apr 2004 18:43:50 +0000 (18:43 +0000)]
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.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4168
cda61777-01e9-0310-a592-
d414129be87e
simon [Wed, 28 Apr 2004 17:46:04 +0000 (17:46 +0000)]
Have each game declare a name which is used for window titles etc.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4167
cda61777-01e9-0310-a592-
d414129be87e
simon [Wed, 28 Apr 2004 17:42:32 +0000 (17:42 +0000)]
Shift-click is equivalent to middle-click. This is mostly for
Windows users who may not have a middle button at all, but I've
replicated it in GTK to maintain cross-platform consistency.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4166
cda61777-01e9-0310-a592-
d414129be87e
simon [Wed, 28 Apr 2004 17:37:13 +0000 (17:37 +0000)]
Fix zillions of MSVC compiler warnings. Sigh.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4165
cda61777-01e9-0310-a592-
d414129be87e
simon [Wed, 28 Apr 2004 17:21:57 +0000 (17:21 +0000)]
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.)
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4162
cda61777-01e9-0310-a592-
d414129be87e
simon [Wed, 28 Apr 2004 12:39:39 +0000 (12:39 +0000)]
Add .map and .rsp files to .cvsignore.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4160
cda61777-01e9-0310-a592-
d414129be87e
simon [Wed, 28 Apr 2004 12:34:37 +0000 (12:34 +0000)]
More robust timer handling in GTK: never create a new timer when one
is already active.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4159
cda61777-01e9-0310-a592-
d414129be87e
simon [Wed, 28 Apr 2004 12:07:15 +0000 (12:07 +0000)]
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.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4158
cda61777-01e9-0310-a592-
d414129be87e
simon [Tue, 27 Apr 2004 22:49:21 +0000 (22:49 +0000)]
A-_ha_! The Windows Rectangle() call appears to get uppity if asked
to draw a 1x1 rectangle, presumably on the grounds that that's
beneath its dignity and you ought to be using SetPixel() instead. So
now I do, and now Net actually looks exactly the same on Windows and
GTK. Woo!
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4157
cda61777-01e9-0310-a592-
d414129be87e
simon [Tue, 27 Apr 2004 20:51:08 +0000 (20:51 +0000)]
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.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4156
cda61777-01e9-0310-a592-
d414129be87e
simon [Tue, 27 Apr 2004 19:01:49 +0000 (19:01 +0000)]
Stop the user being able to resize the window.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4155
cda61777-01e9-0310-a592-
d414129be87e
simon [Tue, 27 Apr 2004 17:44:30 +0000 (17:44 +0000)]
Implemented Cube, in a sufficiently general way that it also handles
the tetrahedron, octahedron and icosahedron.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4151
cda61777-01e9-0310-a592-
d414129be87e
simon [Mon, 26 Apr 2004 17:10:44 +0000 (17:10 +0000)]
Further general development. Net is now playable, though
configuration is absent as yet.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4145
cda61777-01e9-0310-a592-
d414129be87e
simon [Sun, 25 Apr 2004 20:15:22 +0000 (20:15 +0000)]
General further development. Sketched out the mid-end, added more
GTK code, rudiments of event passing.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4141
cda61777-01e9-0310-a592-
d414129be87e
simon [Sun, 25 Apr 2004 14:45:22 +0000 (14:45 +0000)]
Beginnings of a GTK framework. (And I do mean _beginnings_; it opens
a window and that's about it.)
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4139
cda61777-01e9-0310-a592-
d414129be87e
simon [Sun, 25 Apr 2004 14:27:58 +0000 (14:27 +0000)]
Initial checkin of a portable framework for writing small GUI puzzle
games.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4138
cda61777-01e9-0310-a592-
d414129be87e