aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Add WinHelp topic.Jacob Nevins2005-07-04
| | | | [originally from svn r6056]
* There's always one. Forgot to add Pegs to `make install'.Simon Tatham2005-07-04
| | | | [originally from svn r6054]
* Documentation for Pegs.Simon Tatham2005-07-04
| | | | [originally from svn r6053]
* Peg Solitaire implementation, complete with a random boardSimon Tatham2005-07-04
| | | | | | | generator. The generator is lacking in almost any kind of finesse, but it produces puzzles which at least _I_ find plausibly puzzling. [originally from svn r6052]
* Document keyboard controls for FlipJacob Nevins2005-07-04
| | | | [originally from svn r6051]
* Fix bounds checking for Flip cursor control.Jacob Nevins2005-07-04
| | | | [originally from svn r6050]
* James H's patch for a keyboard-controlled cursor in Flip.Simon Tatham2005-07-03
| | | | [originally from svn r6049]
* Allow game backends to use even special keystrokes such as N and Q;Simon Tatham2005-07-03
| | | | | | | | | | | | | they will only be processed as special by the midend if unwanted by the backend. This causes 5x5 Solo to become just about playable, because you can now click in a square and type `n'. However, typing `n' when a square is not selected will revert to the normal behaviour of starting a new game. (This isn't particularly ideal, I know, but it's better than nothing.) [originally from svn r6048]
* draw_polygon() and draw_circle() have always had a portabilitySimon Tatham2005-07-03
| | | | | | | | | | | | | | | | | | | constraint: because some front ends interpret `draw filled shape' to mean `including its boundary' while others interpret it to mean `not including its boundary' (and X seems to vacillate between the two opinions as it moves around the shape!), you MUST NOT draw a filled shape only. You can fill in one colour and outline in another, you can fill or outline in the same colour, or you can just outline, but just filling is a no-no. This leads to a _lot_ of double calls to these functions, so I've changed the interface. draw_circle() and draw_polygon() now each take two colour arguments, a fill colour (which can be -1 for none) and an outline colour (which must be valid). This should simplify code in the game back ends, while also reducing the possibility for coding error. [originally from svn r6047]
* James Harvey points out that entering an invalid game ID can affectSimon Tatham2005-07-01
| | | | | | | | | | the current midend state even if you don't subsequently enter a valid one. Reorganise midend_game_id_int() so that (just like midend_deserialise()) it does all its error checking before altering anything in the midend's persistent data, so that it either succeeds completely or fails before doing anything at all. [originally from svn r6045]
* Prevent drags from being started outside the playing area, which wasSimon Tatham2005-06-30
| | | | | | | | causing invalid move descriptions to be returned from interpret_move() and then failing an assertion when execute_move() refused them. [originally from svn r6044]
* Preset names retrieved from the environment must be dupstr()ed. HowSimon Tatham2005-06-30
| | | | | | | did I miss this before? It just caused a segfault for me, which is entirely fair enough, but I've no idea why it didn't fail before! [originally from svn r6043]
* Load and Save are now supported on all three desktop platforms, andSimon Tatham2005-06-30
| | | | | | | documented. (This means the GTK temporary dependency on an environment variable is now gone.) [originally from svn r6042]
* General robustness patch from James Harvey:Simon Tatham2005-06-30
| | | | | | | | | | | | | - most game_size() functions now work in doubles internally and round to nearest, meaning that they have less tendency to try to alter a size they returned happily from a previous call - couple of fiddly fixes (memory leaks, precautionary casts in printf argument lists) - midend_deserialise() now constructs an appropriate drawstate, which I can't think how I overlooked myself since I _thought_ I went through the entire midend structure field by field! [originally from svn r6041]
* Attempting to begin a drag from (i.e. just click on) the hint pegsSimon Tatham2005-06-30
| | | | | | | for a past guess caused strangeness up to and including segfault, thanks to bad bounds checking. Well spotted John Sullivan. [originally from svn r6040]
* Add a cast whose absence was causing a (-Werror-exacerbated) compileSimon Tatham2005-06-29
| | | | | | warning on OS X. [originally from svn r6037]
* Validation of random-state-type game descriptions was broken. ThisSimon Tatham2005-06-29
| | | | | | | meant that a Mines game saved before the first click had taken place could not be successfully reloaded. [originally from svn r6036]
* When serialising this game, it's probably better to keep theSimon Tatham2005-06-29
| | | | | | half-finished guess in the game_ui rather than throwing it away. [originally from svn r6033]
* Make peg removal accessible from the keyboard.Jacob Nevins2005-06-28
| | | | [originally from svn r6032]
* New {en,de}code_ui functions should be static. Oops.Simon Tatham2005-06-28
| | | | [originally from svn r6031]
* Actually implemented the serialise/deserialise functions inSimon Tatham2005-06-28
| | | | | | | | | | | | midend.c. Also I've added an experimental front end in gtk.c only: `Save' and `Load' options on the Game menu, which don't even show up unless you define the magic environment variable PUZZLES_EXPERIMENTAL_SAVE. Once I'm reasonably confident that the whole edifice is plausibly stable, I'll take that out and turn it into a supported feature (and also implement it in OS X and Windows and write documentation). [originally from svn r6030]
* More serialisation changes: the game_aux_info structure has now beenSimon Tatham2005-06-28
| | | | | | | | | | | | retired, and replaced with a simple string. Most of the games which use it simply encode the string in the same way that the Solve move will also be encoded, i.e. solve_game() simply returns dupstr(aux_info). Again, this is a better approach than writing separate game_aux_info serialise/deserialise functions because doing it this way is self-testing (the strings are created and parsed during the course of any Solve operation at all). [originally from svn r6029]
* Rogue diagnostic!Simon Tatham2005-06-28
| | | | [originally from svn r6028]
* Move a rogue declaration to the top of its block.Simon Tatham2005-06-28
| | | | [originally from svn r6027]
* Another function pair required for serialisation; these ones saveSimon Tatham2005-06-28
| | | | | | | | | | | and restore anything vitally important in the game_ui. Most of the game_ui is expected to be stuff about cursor positions and currently active mouse drags, so it absolutely _doesn't_ want to be preserved over a serialisation; but one or two things would be disorienting or outright wrong to reset, such as the Net origin position and the Mines death counter. [originally from svn r6026]
* Annoying special cases for Mines.Simon Tatham2005-06-28
| | | | | | | | | | | | | | | | Firstly, the `Restart' function now reconstructs an initial game state from the game description rather than dup_game(states[0]). This means that Restart in a game of Mines restarts to just _after_ the initial click, so you can resume the puzzle-solving part without having to remember where you placed that click. Secondly, the midend now contains a second `private' game desc, which is guaranteed to actually reconstruct the initial game_state correctly (which Mines's publicly visible game descs tend not to, since they describe a state which has already had the first click). This should make serialising of Mines more sensible. [originally from svn r6025]
* Re-architecting of the game backend interface. make_move() has beenSimon Tatham2005-06-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | split into two functions. The first, interpret_move(), takes all the arguments that make_move() used to get and may have the usual side effects of modifying the game_ui, but instead of returning a modified game_state it instead returns a string description of the move to be made. This string description is then passed to a second function, execute_move(), together with an input game_state, which is responsible for actually producing the new state. (solve_game() also returns a string to be passed to execute_move().) The point of this is to work towards being able to serialise the whole of a game midend into a byte stream such as a disk file, which will eventually support save and load functions in the desktop puzzles, as well as restoring half-finished games after a quit and restart in James Harvey's Palm port. Making each game supply a convert-to-string function for its game_state format would have been an unreliable way to do this, since those functions would not have been used in normal play, so they'd only have been tested when you actually tried to save and load - a recipe for latent bugs if ever I heard one. This way, you won't even be able to _make_ a move if execute_move() doesn't work properly, which means that if you can play a game at all I can have pretty high confidence that serialising it will work first time. This is only the groundwork; there will be more checkins to come on this theme. But the major upheaval should now be done, and as far as I can tell everything's still working normally. [originally from svn r6024]
* Fix GTK casts to restore correct compilation on GTK 2.0 after r6022.Simon Tatham2005-06-26
| | | | | [originally from svn r6023] [r6022 == e1c84c9a4ea9e74c128c28a77ea08336350991e3]
* Under Gtk 1.2 (at least on Debian woody), a config or preset change that wouldJacob Nevins2005-06-26
| | | | | | | | otherwise not cause the window size to change caused it to become very small indeed. This change from Simon fixes that behaviour; I haven't tested it with Gtk 2. [originally from svn r6022]
* Add debugging support.Jacob Nevins2005-06-25
| | | | [originally from svn r6018]
* Further additions to the Guess docs.Jacob Nevins2005-06-25
| | | | [originally from svn r6014]
* Make the keyboard-control cursors visible whenever a keyboard control isJacob Nevins2005-06-25
| | | | | | activated. [originally from svn r6013]
* The AngleArc() function that was being used to draw circles on Windows turnsJacob Nevins2005-06-25
| | | | | | | out to be unsupported on the Win9x/Me series. Use Arc() instead (tested on Win98 and Win2K). [originally from svn r6012]
* Couple of presets.Simon Tatham2005-06-24
| | | | [originally from svn r6011]
* More patches from James Harvey: enforce a maximum brightness in theSimon Tatham2005-06-24
| | | | | | | | | background colour (to ensure white pegs show up against it), and convert the keyboard-control cursor into a rectangle when it's over the hint pegs (otherwise it looks rather silly for numbers of pegs above 4). [originally from svn r6010]
* Fix another display/UI glitch which triggered if you filled a rowSimon Tatham2005-06-24
| | | | | | | | (so that the hint pegs lit up as `ready') and then pressed Undo: the markable flag would remain set and the redrawing wouldn't darken the pegs again. [originally from svn r6009]
* Turn off the keyboard-control cursor when the user reverts to mouseSimon Tatham2005-06-24
| | | | | | control. [originally from svn r6008]
* Change the preprocessor symbol `DEBUG' to `DEBUGGING', since theSimon Tatham2005-06-24
| | | | | | former is automatically defined by Cygwin. [originally from svn r6007]
* My background-erasing changes in r5996/r5997 caused trouble with theSimon Tatham2005-06-24
| | | | | | | | | | | | | | | keyboard-control cursors, and when I tried to fix those more wallpaper bubbles popped up elsewhere. Here's what I think is a proper fix: a comprehensive overhaul of the redraw code such that, instead of tracking the cursor positions explicitly in the drawstate, we instead track for each peg position whether or not a cursor is currently displayed at that position. So cursor erasing and cursor drawing become part of the main draw loop rather than a separate bit on the end. [originally from svn r6006] [r5996 == 3d58feb561ef09cf977f710d69a3562529e23f0f] [r5997 == a46e3266558eaf5cd18ac2a6322af65c196c3655]
* Array overflow fix from James Harvey.Simon Tatham2005-06-23
| | | | [originally from svn r6005]
* Make the `hold marker' in Guess accessible from the keyboard (`H' key, for wantJacob Nevins2005-06-23
| | | | | | of a better idea). [originally from svn r6004]
* Factual and other corrections/additions to the Guess docs.Jacob Nevins2005-06-23
| | | | [originally from svn r6003]
* Reinstate WinHelp topic now we have a manual chapter.Jacob Nevins2005-06-23
| | | | [originally from svn r6002]
* Credit James Harvey.Simon Tatham2005-06-23
| | | | [originally from svn r6000]
* James Harvey's extensions to Guess: a couple of extra game settingsSimon Tatham2005-06-23
| | | | | | plus a manual chapter. [originally from svn r5999]
* And forgot to add guess to the Unix make install target! I need a list.Simon Tatham2005-06-23
| | | | [originally from svn r5998]
* Bah, not good enough. Extend those background erases by one moreSimon Tatham2005-06-23
| | | | | | pixel. [originally from svn r5997]
* Erase backgrounds when drawing over an existing circle, for theSimon Tatham2005-06-23
| | | | | | | benefit of antialiasing platforms such as OS X. Also in this checkin, fiddle with svn:ignore (there's a new puzzle binary). [originally from svn r5996]
* Allow dragging of coloured pegs from previous guesses. AlsoSimon Tatham2005-06-23
| | | | | | | | | | | | reorganise the colours so there are fewer of those terribly computery cyan and magenta shades, and more good old-fashioned colours with simple names like orange and purple. Finally, change the `right place' marking peg colour from red to black, in line with at least _my_ old Mastermind set (I faintly suspect red marker pegs of being an Americanism) and also so that the marker pegs and the coloured pegs have no colours in common. [originally from svn r5995]
* Must outline as well as filling circles, because not all platformsSimon Tatham2005-06-23
| | | | | | can be guaranteed to draw bare filled shapes the same way. [originally from svn r5994]