chiark / gitweb /
sgt-puzzles.git
20 years agoThe Windows RNG turns out to only give about 16 bits at a time. This
Simon Tatham [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!

[originally from svn r4187]

20 years agoImplement selection of game seeds, by reusing the config box
Simon Tatham [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.

[originally from svn r4186]

20 years ago`Fifteen' was getting the parity wrong on any size of board where
Simon Tatham [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.

[originally from svn r4185]

20 years agoGame configuration box for Windows, by constructing the dialog box
Simon Tatham [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.

[originally from svn r4184]

20 years ago`BOOLEAN' is a term already used by Win32. Bah. Change terminology.
Simon Tatham [Sun, 2 May 2004 10:43:46 +0000 (10:43 +0000)]
`BOOLEAN' is a term already used by Win32. Bah. Change terminology.

[originally from svn r4183]

20 years agoConfiguration dialog box, on the GTK front end only as yet.
Simon Tatham [Sat, 1 May 2004 11:32:12 +0000 (11:32 +0000)]
Configuration dialog box, on the GTK front end only as yet.

[originally from svn r4182]

20 years agoRemove arbitrary restriction on Net minimum game size. (Awww, cute
Simon Tatham [Sat, 1 May 2004 08:58:48 +0000 (08:58 +0000)]
Remove arbitrary restriction on Net minimum game size. (Awww, cute
2x2! Cuter 2x1!)

[originally from svn r4181]

20 years agoWrap the status bar in a viewport, to avoid it expanding if the text
Simon Tatham [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.

[originally from svn r4180]

20 years agoThe cube was being drawn slightly differently on the top and left
Simon Tatham [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.

[originally from svn r4179]

20 years agoKeep the status bar in better sync with the game display.
Simon Tatham [Fri, 30 Apr 2004 10:17:22 +0000 (10:17 +0000)]
Keep the status bar in better sync with the game display.

[originally from svn r4177]

20 years agoWe were forgetting to count the final move.
Simon Tatham [Fri, 30 Apr 2004 10:14:55 +0000 (10:14 +0000)]
We were forgetting to count the final move.

[originally from svn r4176]

20 years agoIncorrect placing of the polyhedron sometimes left it on a blue
Simon Tatham [Fri, 30 Apr 2004 10:11:53 +0000 (10:11 +0000)]
Incorrect placing of the polyhedron sometimes left it on a blue
square. Oops.

[originally from svn r4175]

20 years agoAdded a status bar.
Simon Tatham [Thu, 29 Apr 2004 19:23:08 +0000 (19:23 +0000)]
Added a status bar.

[originally from svn r4174]

20 years agoImplemented text and clipping primitives in the frontend, and added
Simon Tatham [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'.

[originally from svn r4173]

20 years ago`There's always one'. Add nullgame to .cvsignore.
Simon Tatham [Thu, 29 Apr 2004 09:15:42 +0000 (09:15 +0000)]
`There's always one'. Add nullgame to .cvsignore.

[originally from svn r4170]

20 years agoAdd a template file defining the null game.
Simon Tatham [Thu, 29 Apr 2004 08:37:19 +0000 (08:37 +0000)]
Add a template file defining the null game.

[originally from svn r4169]

20 years agoAdd a new game concept called a `flash'. This is a graphical effect
Simon Tatham [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.

[originally from svn r4168]

20 years agoHave each game declare a name which is used for window titles etc.
Simon Tatham [Wed, 28 Apr 2004 17:46:04 +0000 (17:46 +0000)]
Have each game declare a name which is used for window titles etc.

[originally from svn r4167]

20 years agoShift-click is equivalent to middle-click. This is mostly for
Simon Tatham [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.

[originally from svn r4166]

20 years agoFix zillions of MSVC compiler warnings. Sigh.
Simon Tatham [Wed, 28 Apr 2004 17:37:13 +0000 (17:37 +0000)]
Fix zillions of MSVC compiler warnings. Sigh.

[originally from svn r4165]

20 years agoIntroduce diagonal movement keys on the numeric keypad, and use them
Simon Tatham [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.)

[originally from svn r4162]

20 years agoAdd .map and .rsp files to .cvsignore.
Simon Tatham [Wed, 28 Apr 2004 12:39:39 +0000 (12:39 +0000)]
Add .map and .rsp files to .cvsignore.

[originally from svn r4160]

20 years agoMore robust timer handling in GTK: never create a new timer when one
Simon Tatham [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.

[originally from svn r4159]

20 years agoAdd a menu bar, in both Windows and GTK. In particular, game modules
Simon Tatham [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.

[originally from svn r4158]

20 years agoA-_ha_! The Windows Rectangle() call appears to get uppity if asked
Simon Tatham [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!

[originally from svn r4157]

20 years agoMost of a Windows front end. Something's not _quite_ right in the
Simon Tatham [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.

[originally from svn r4156]

20 years agoStop the user being able to resize the window.
Simon Tatham [Tue, 27 Apr 2004 19:01:49 +0000 (19:01 +0000)]
Stop the user being able to resize the window.

[originally from svn r4155]

20 years agoImplemented Cube, in a sufficiently general way that it also handles
Simon Tatham [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.

[originally from svn r4151]

20 years agoFurther general development. Net is now playable, though
Simon Tatham [Mon, 26 Apr 2004 17:10:44 +0000 (17:10 +0000)]
Further general development. Net is now playable, though
configuration is absent as yet.

[originally from svn r4145]

20 years agoGeneral further development. Sketched out the mid-end, added more
Simon Tatham [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.

[originally from svn r4141]

20 years agoBeginnings of a GTK framework. (And I do mean _beginnings_; it opens
Simon Tatham [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.)

[originally from svn r4139]

20 years agoInitial checkin of a portable framework for writing small GUI puzzle
Simon Tatham [Sun, 25 Apr 2004 14:27:58 +0000 (14:27 +0000)]
Initial checkin of a portable framework for writing small GUI puzzle
games.

[originally from svn r4138]