aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Patch from Chris Emerson to add a status bar to Rectangles. ApartSimon Tatham2005-06-10
| | | | | | | | | from saying `Auto-solved' or `Completed', the main function of the status bar is to track the current size of a rectangle you're dragging out, which makes life much easier when trying to count up large rectangles in 19x19 mode. [originally from svn r5937]
* GDK 2.6, in its doubtless infinite wisdom, has decided thatSimon Tatham2005-06-09
| | | | | | | | | | gdk_font_from_description() will no longer even _try_ to return a font matching the specified Pango font description; instead it will return `fixed' no matter what you do. Therefore, I've had to switch to using Pango proper for Puzzles text rendering, rather than just using Pango for font selection. [originally from svn r5936]
* Remove debug output.Jacob Nevins2005-06-08
| | | | [originally from svn r5926]
* Add Windows help topicJacob Nevins2005-06-07
| | | | [originally from svn r5923]
* Tweaks and more complete documentation for Same Game.Jacob Nevins2005-06-07
| | | | [originally from svn r5922]
* Integer overflow in game_size(). Oops.Simon Tatham2005-06-07
| | | | [originally from svn r5921]
* Chris Emerson points out that gtk_window_resize() isn't in GTK 1.2.Simon Tatham2005-06-07
| | | | | | Work around it the same way I did in PuTTY. [originally from svn r5920]
* James Harvey's patch to support keyboard control in Same Game.Simon Tatham2005-06-07
| | | | [originally from svn r5919]
* Forgot to add Same Game to the big list for OS X.Simon Tatham2005-06-07
| | | | [originally from svn r5918]
* James Harvey (again) points out an array underrun in the newSimon Tatham2005-06-07
| | | | | | clash-checking code in Solo. (valgrind confirms it.) [originally from svn r5916]
* Another James Harvey patch. This one introduces a new button codeSimon Tatham2005-06-07
| | | | | | | | | | | called `CURSOR_SELECT', intended for platforms which have a fire button to go with their cursor keys. (Apparently some Palms do.) CURSOR_SELECT is not bound to anything on any of the current three platforms, and therefore no game may rely on it being available. This checkin adds it in Net as a synonym for 'a', the keyboard-based rotate-left command. [originally from svn r5915]
* James Harvey has contributed an implementation of `Same Game', alsoSimon Tatham2005-06-07
| | | | | | known as ksame (KDE) and Same GNOME (GNOME). [originally from svn r5914]
* All the games in this collection have always defined their graphicsSimon Tatham2005-06-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | in terms of a constant TILE_SIZE (or equivalent). Here's a surprisingly small patch which switches this constant into a run-time variable. The only observable behaviour change should be on Windows, which physically does not permit the creation of windows larger than the screen; if you try to create a puzzle (Net makes this plausible) large enough to encounter this restriction, the Windows front end should automatically re-adjust the puzzle's tile size so that it does fit within the available space. On GTK, I haven't done this, on the grounds that X _does_ permit windows larger than the screen, and many X window managers already provide the means to navigate around such a window. Gareth said he'd rather navigate around a huge Net window than have it shrunk to fit on one screen. I'm uncertain that this makes sense for all puzzles - Pattern in particular strikes me as something that might be better off shrunk to fit - so I may have to change policy later or make it configurable. On OS X, I also haven't done automatic shrinkage to fit on one screen, largely because I didn't have the courage to address the question of multiple monitors and what that means for the entire concept :-) [originally from svn r5913]
* Introduce a new game backend function (there seem to have been a lotSimon Tatham2005-06-06
| | | | | | | | | | | | | | | | | | | of these recently) whose job is to update a game_ui to be consistent with a new game_state. This is called by midend.c in every situation where the current game_state changes _other_ than as a result of make_move (Undo, Redo, Restart, Solve). The introduction of this function allows a game_ui to contain information about selections or highlights within a game_state which simply wouldn't make sense when transferred to another game_state. In particular, I've used it to fix a subtle bug in Solo whereby, although you couldn't right-click to pencil-mode highlight a filled square, you could _get_ a pencil-mode highlight in a filled square if you used Undo and Redo. (Undo to before the square was filled, right-click to highlight it, then Redo. Alternatively, left-click and clear the square, right-click to highlight it, then Undo.) [originally from svn r5912]
* Small UI bug: LEFT_RELEASEs were being thrown away completely ifSimon Tatham2005-06-04
| | | | | | | | their coordinates were outside the playing area. Clearly no actual move should be made in that situation, but we do at least need to sort out any highlighted squares from the prior dragging operations. [originally from svn r5911]
* Revamp pencil mark placement and sizing. Pencil marks are now sizedSimon Tatham2005-06-04
| | | | | | | | | | | | and positioned according to how many there are in the cell, rather than how many distinct digits there are in the entire puzzle. This means that 4x4 Solo can now be played with pencil marks without _too_ much difficulty; the marks will still get a bit crowded if you have more than 12 in the same square, but with luck that shouldn't happen often, and as long as you're down in the 2-9 range things should be entirely legible. [originally from svn r5909]
* James Harvey requested that puzzles not use DEBUG as a preprocessorSimon Tatham2005-06-04
| | | | | | | | | symbol for enabling diagnostics, presumably because in his Palm port it means something else as well. He sent this patch to switch Net and Netslide over to using GENERATION_DIAGNOSTICS, in the fashion of the newer games. [originally from svn r5908]
* Colin Watson suggests that Alt-click (or Option-click) couldSimon Tatham2005-06-03
| | | | | | | | | | | | usefully be equivalent to right-clicking on platforms other than OS X; in particular, it's useful if you're running Linux on Apple hardware such as PowerBook which inherently has only one button. So here's the fix for GTK, and Windows as well (the latter for completeness and consistency, not because I can actually think of any reason somebody might be running Windows on one-button hardware). [originally from svn r5907]
* Unique solubility in Mines means that you can massively increase theSimon Tatham2005-06-03
| | | | | | | | | | | mine density without (as you would with a conventional random grid generator) rendering the game completely unplayable. High mine densities are really good fun, and the point of the presets menu is to provide people with pre-tested good settings and things they might not have thought to try for themselves; so here are three additional presets with high densities. [originally from svn r5906]
* Standalone compilation mode which turns mines.c into a littleSimon Tatham2005-06-02
| | | | | | | | | | utility to convert descriptive game IDs containing mine bitmaps between obfuscated and cleartext. Might be handy for anyone planning to design custom levels to send to friends (mines spelling out `Happy Birthday', that sort of thing), as someone suggested to me today :-) [originally from svn r5903]
* Fix various departures from C found by `gcc -ansi -pedantic'. ISimon Tatham2005-06-02
| | | | | | | 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]
* min()/max() macros conflict with ones defined by Windows (or at least MinGW)Jacob Nevins2005-06-01
| | | | | | | headers; but MIN()/MAX() conflict with glib. Let's keep the lower-case ones, and assume that any provided by the system have the obvious semantics. [originally from svn r5900]
* Fix Richard's patch so that it's actually C :-/Simon Tatham2005-06-01
| | | | [originally from svn r5899]
* Another highlighting patch from Richard Boulton: immediately flagSimon Tatham2005-06-01
| | | | | | | | | | any actual clashes (duplicate numbers in a row, column or block) in red. This is a non-privileged deduction: it doesn't compare against a known solution or consult a solver. It simply indicates reasons why (no superset of) the current grid would cause the completion flash to go off. [originally from svn r5898]
* Miscellaneous fixes from James Harvey's PalmOS porting work:Simon Tatham2005-06-01
| | | | | | | | | | | | | | | | | | | | - fixed numerous memory leaks (not Palm-specific) - corrected a couple of 32-bit-int assumptions (vital for Palm but generally a good thing anyway) - lifted a few function pointer types into explicit typedefs (neutral for me but convenient for the source-munging Perl scripts he uses to deal with Palm code segment rules) - lifted a few function-level static arrays into global static arrays (neutral for me but apparently works round a Palm tools bug) - a couple more presets in Rectangles (so that Palm, or any other slow platform which can't handle the larger sizes easily, can still have some variety available) - in Solo, arranged a means of sharing scratch space between calls to nsolve to prevent a lot of redundant malloc/frees (gives a 10% speed increase even on existing platforms) [originally from svn r5897]
* Arrange that random seeds are as harmonised as they can reasonablySimon Tatham2005-06-01
| | | | | | be between interactive and batch use. [originally from svn r5896]
* I've proved that a grid dimension of 2 is capable of irretrievablySimon Tatham2005-06-01
| | | | | | | | | hanging the grid generator and that there's no way to fix it. Therefore, lower limit of 3 squares in each direction, which will upset envelope-pushers everywhere but doesn't destroy any actually interesting puzzles. [originally from svn r5895]
* Gareth points out that the recess highlights around the outside ofSimon Tatham2005-06-01
| | | | | | | the grid, in all games that have them, are drawn incorrectly when the grid is not square. Fixed. [originally from svn r5893]
* Patches from Richard B for Solo:Simon Tatham2005-06-01
| | | | | | | | | | | | | - prevent highlighting a clue square at all - enable easier switching between highlight types by not requiring a left-click highlight to be left-click-cancelled before right-clicking, and vice versa - fix bit-rot in -DSTANDALONE_SOLVER Also one of mine: - replicate Richard's -DSTANDALONE_SOLVER fix in Pattern, where it was also broken. [originally from svn r5892]
* Chris Emerson observed the same status-bar flicker under GTK as ISimon Tatham2005-06-01
| | | | | | | did under Windows, so here's his patch (blatantly copied from my own fix in windows.c :-). [originally from svn r5891]
* Typo in click bounds checking.Simon Tatham2005-06-01
| | | | [originally from svn r5890]
* Better mouse button handling in Mines:Simon Tatham2005-05-31
| | | | | | | | | | | | | - middle button now also triggers the clear-around-square action - a special-case handler in midend_process_key() arranges that the left button always trumps the right button if both are pressed together, meaning that Windows Minesweeper players used to pressing L+R to clear around a square should still be able to do so without any strange behaviour. (The latter touches all game backends, yet again, to add a field to the game structure which is zero in everything except Mines.) [originally from svn r5888]
* Bah, and remove the TODO item. As usual.Simon Tatham2005-05-31
| | | | [originally from svn r5887]
* Now _this_ is what Undo ought to be doing in a Minesweeper clone.Simon Tatham2005-05-31
| | | | | | | | | | | | | | | | | Rather than revealing the entire mine layout when you die, we now only reveal the one mine that killed you. You can then Undo and continue playing, without having spoiled the rest of the grid for yourself. The number of times you've died is counted in the status line (and is not reduced by Undo :-). Amusingly, I think this in itself is quite a good way of dealing with ambiguous sections in a Minesweeper grid: they no longer _completely_ spoil your enjoyment of the game, because you can still play the remainder of the grid even if you haven't got a completely clean sweep. Just my luck that I should invent the idea when I've already arranged for ambiguous sections to be absent :-) [originally from svn r5886]
* Aha! It turns out, after a bit of failure-mode profiling, that whenSimon Tatham2005-05-31
| | | | | | | | | | | | the Mines unique grid generator fails at high mine densities it is _almost always_ for the same reason, and it also turns out that this reason is one which can be addressed. So here's an enhancement to mineperturb() which enables Mines to generate a grid at (as far as I can tell) any mine density you like, up to and including w*h-9 mines. At densities of 1 in 2 or thereabouts the grids start to look rather strange, but it can at least generate them without hanging. [originally from svn r5885]
* valgrind spotted this array underrun. I wonder if this might haveSimon Tatham2005-05-31
| | | | | | been causing some of Verity's nonreproducible weirdnesses. [originally from svn r5884]
* Oops! A trivial typo in obfuscate_bitmap() made the obfuscationSimon Tatham2005-05-31
| | | | | | | | | | | | | | function rather less uniform-looking than I'd intended. I _thought_ it looked a bit fishy, but had assumed it was just the human tendency to see patterns where none exist. Now fixed, and some real test vectors confirm that this time the obfuscation function is actually what I intended it to be. This means that all masked game IDs generated before this revision are now invalid. That's a shame, but the game is only a day old and I think I can reasonably justify it as teething trouble. [originally from svn r5883]
* `Solve' operation is relatively simple in Mines.Simon Tatham2005-05-31
| | | | [originally from svn r5882]
* Apparently a number of Windows programs like to use ^Y as a keyboardSimon Tatham2005-05-31
| | | | | | shortcut for Redo. I wasn't doing anything else with it, so why not? [originally from svn r5880]
* Document the mouse control method for Cube.Jacob Nevins2005-05-31
| | | | [originally from svn r5879]
* Move definition of PI into puzzles.h. If nothing else, the definition in cube.cJacob Nevins2005-05-31
| | | | | | had a typo :) [originally from svn r5878]
* Mouse-based interface for Cube: you left-click anywhere on the gridSimon Tatham2005-05-31
| | | | | | | | | | | | | | | and it moves the polyhedron in the general direction of the mouse pointer. (I had this in my initial throwaway Python implementation of this game, but never reimplemented it in this version. It's harder with triangles, but not too much harder.) Since the logical-to-physical coordinate mapping in Cube is dynamically computed, this has involved an interface change which touches all puzzles: make_move() is now passed a pointer to the game_drawstate, which it may of course completely ignore if it wishes. [originally from svn r5877]
* Emma Garside suggested that it would be nice to have a differentSimon Tatham2005-05-31
| | | | | | | | | | background colour for covered and uncovered squares in Mines, since otherwise you have to distinguish them by the edge highlights alone. So here one is; it's not _very_ different (it just looked odd if it was any darker than this), but anyone who wants a bigger difference can reconfigure it using the MINES_COLOUR_1 environment variable. [originally from svn r5876]
* Improved the limited shuffle mechanism in Sixteen and Twiddle. TheySimon Tatham2005-05-31
| | | | | | | | | | | | | | | | | | | | | | | were already making sure that no shuffle move was the precise inverse of the previous one, or contributed to repeating the previous one so many times as to turn it into effectively fewer moves (doing the same rotation three times in Twiddle, or shifting a row by more than half its length in Sixteen). However, they were only checking against the _last_ move, which meant that in any situation where there were completely disjoint move spaces (4x4n2 Twiddle, or any Sixteen at all) it was still possible to have A then B then inv(A) occurring in the shuffle, leading to an unnecessarily easy game. Now both shuffle routines keep separate track of all _non-overlapping_ recent moves, and will avoid inverting any move which hasn't had another move overlap it since it was made. This should reduce the incidence of too-easy limited shuffle games, although it can't be prevented _entirely_ (since, if nothing else, it's always possible to increase the shuffle limit past the maximum group radius). [originally from svn r5875]
* Fix a couple of robustness issues.Simon Tatham2005-05-31
| | | | [originally from svn r5873]
* GTK misfires timers at inconvenient moments, sometimes causing a newSimon Tatham2005-05-31
| | | | | | | | | 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]
* Chris's patch to stop Mines depending on char being signed.Simon Tatham2005-05-30
| | | | [originally from svn r5871]
* Added an `interactive' flag to new_game_desc(), which toggles MinesSimon Tatham2005-05-30
| | | | | | | | | 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]
* `Copy' operation for Mines.Simon Tatham2005-05-30
| | | | [originally from svn r5868]
* Constrain mine count to be at most the largest number of mines weSimon Tatham2005-05-30
| | | | | | can guarantee to fit into the grid! [originally from svn r5867]