1476 Commits

Author SHA1 Message Date
07906104a2 GTK 3 prep: use gtk_radio_menu_item_get_group().
Replaces the previous deprecated spelling. We now build cleanly with
-DGTK_DISABLE_DEPRECATED.
2015-10-03 16:07:04 +01:00
2c1b00086d GTK 3 prep: use GtkComboBox for drop-down lists.
The previous GtkOptionMenu was long since deprecated.
2015-10-03 16:07:04 +01:00
71c7bcd981 GTK 3 prep: use the glib names for base object types. 2015-10-03 16:07:04 +01:00
0dc2fd1ea3 GTK 3 prep: use GTK_KEY_* constants. 2015-10-03 16:07:04 +01:00
238cd9dc83 GTK 3 prep: use accessors instead of direct field access.
We now build cleanly with -DGSEAL_ENABLE.
2015-10-03 16:07:04 +01:00
7242dcc4ef Fix packing direction of config boxes.
We were packing the GtkTable into the dialog's content area using
gtk_box_pack_end, which had the slightly silly effect that resizing
the config box vertically would keep all the controls aligned to the
_bottom_ rather than the top.
2015-10-03 16:07:04 +01:00
8b491946ef Don't refresh backing store on a no-op configure event.
Sometimes, we can get a "configure_area" event telling us that the
drawing area has changed size to the same size it already was. This
can happen when we change puzzle presets in a way that doesn't change
the size, and also sometimes seems to happen as a side effect of
changing the text in the status line.

In that situation, it's a waste of effort - and can cause visible
on-screen flicker - to throw away the window's backing image and
pixmap and regenerate them from scratch. So now we detect a non-resize
and avoid doing all that.

The only thing we retain unconditionally in configure_area is the
midend_force_redraw, because that's the place where a puzzle redraw is
forced when changing presets or loading a new game.
2015-10-03 16:07:01 +01:00
f9027226a0 Enforce more than one dot in Galaxies puzzles.
At minimum size (3x3) Galaxies can generate a pre-solved single dot
game.

You have to add and remove a line to get the victory flash which is a
bit weird, so just prevent this.
2015-09-26 20:02:02 +01:00
ba9e0d586e Fix OS X build failure due to a deprecated method.
Apple upgraded me to Xcode 7 yesterday, and now [NSString cString]
gives a deprecation warning, which -Werror turns into a full-on build
failure. Explicitly specify an encoding.

(I mention in a comment that there's an alternative piece of API that
I possibly ought to be using instead, but until I make a concrete
decision about where my backwards compatibility threshold is, I'll
leave it as it is for the moment.)
2015-09-18 12:20:32 +01:00
eda5a86787 Implement osx_draw_thick_line 2015-09-02 22:24:47 +01:00
6f5386c4b9 Typo in the OS X Info plist 2015-08-25 20:01:37 +01:00
dd9e24a42f emcc frontend: stop indiscriminately squashing mouseups.
The mouseup listener was calling event.preventDefault(), as part of
the mechanism for making mouse clicks and drags on the puzzle's resize
handle have resizing effects _instead_ of the normal browser
behaviour. However, calling event.preventDefault() on _every_ mouseup,
rather than just the ones associated with the resize handle, was
overkill, and I've recently noticed that it's breaking attempts to
select from the game type dropdown by clicking the mouse. So now I'm
only calling preventDefault() on the mouseups that I have reason to
think are actually relevant to what I'm trying to do.

(I don't know why I've only just noticed this. I suppose a change of
behaviour between Firefox versions is the most likely cause.)
2015-08-14 19:42:42 +01:00
c296301a06 Replace a TCHAR with a WCHAR.
MultiByteToWideChar expects a WCHAR[256] output buffer if you pass it
an output length of 256. TCHAR[256] is entirely the wrong size, though
for some reason Visual Studio seems not to have thrown a compile error
pointing that out.

Thanks to Jason Hood for spotting this.
2015-08-01 11:14:30 +01:00
5e1c335eea Solo, Undead: support 'm' to fill in all pencils.
Keen, Towers and Unequal (and Group) already have this feature in
common: pressing m while no square is selected, causes a full set of
pencil marks to be filled in for every square without a real number/
letter/whatever in it. Solo and Undead share the basic UI principles
(left-click to select a square then type a thing to go in it, vs
right-click to select a square then type things to pencil-mark in it),
but did not have that same feature. Now they do.
2015-07-13 19:06:53 +01:00
aa1a9375be Fix redrawing of Undead 'done' clues after a resize.
The is_hint_stale() function has the side effect of copying a path
hint's new colour-relevant information into the game_drawstate, where
draw_path_hint will then use it. But it returns TRUE early in some
situations, notably !ds->started, which can happen after the actual
game start if the window is resized and a fresh drawstate is created.

This patch, thanks to Chris Boyle, fixes it by eliminating the early
returns from is_hint_stale - the return value is unchanged, but now
the side effects happen reliably.
2015-07-05 21:57:38 +01:00
f306b9db55 Magnets: you can now mark clues as done 2015-06-10 21:58:59 +01:00
ecbf5f627f Removed an extra layer of complexity for count colors 2015-06-10 21:58:59 +01:00
92635a2f9d Factored out some of the color logic for the clues 2015-06-10 21:58:59 +01:00
26b5e2c6bf Removed DS_FULL (it wasn't used) 2015-06-10 21:58:59 +01:00
6bbfa6fe28 Updated name/size of clues_done in Towers 2015-05-26 22:04:47 +01:00
f0750894ff Undead: you can now mark clues as done 2015-05-26 22:04:35 +01:00
c3285318e6 Reworked draw_path_hint 2015-05-26 22:04:25 +01:00
9def49ae9a Factored out a portion of game_redraw 2015-05-26 22:04:16 +01:00
486d2c8a76 Towers: you can now mark clues done 2015-05-22 08:18:53 +01:00
7c52202bc4 Split out the text color portion of draw_tile 2015-05-22 08:18:45 +01:00
a614347a3e Cleaned up execute_move a little 2015-05-22 08:18:33 +01:00
80c1a69329 Add the 'make test' target to Makefile.am too.
Now I don't have to annoyingly switch over to the GTK makefile.
2015-05-18 16:41:06 +01:00
fb0ff8c338 Add sorting-order buttons to the benchmark output.
Since I'm committed to HTML5ish Javascript already, that shouldn't be
too much of an inconvenience.
2015-05-18 16:39:12 +01:00
894921015d Move the benchmarking logic out into a script.
It's a pain having it in a rule in Makefile.gtk, which isn't even the
recommended makefile these days - it can't be re-run conveniently, and
there's no way to parametrise it. Now it can be run no matter which
makefile you're using, and it lets you narrow down to a subset of
games (though not presets). Other options could easily be added.
2015-05-18 16:17:49 +01:00
f49c7f530c Handle replacing an existing arrow 2015-05-11 11:05:36 +01:00
3627111c52 Fix the extra arrow hanging around while moving the opposite existing arrow 2015-05-11 11:05:36 +01:00
bef1b2c59b Mark some arguments constant 2015-05-11 10:46:12 +01:00
3768ed65f2 Fix the issue with adding only one arrow when the other end was already white 2015-05-11 10:46:12 +01:00
83318d4218 Add/remove the opposite arrow when you let go 2015-05-11 10:46:12 +01:00
4fa5df1cba Draw the opposite arrow only while dragging 2015-05-11 10:15:02 +01:00
774395d373 Moved all function declarations to the top of the file 2015-05-11 10:14:57 +01:00
155607b768 Use the game_state and space typedefs 2015-05-11 10:14:53 +01:00
6684bec60c Always use ret instead of state in execute_move 2015-05-11 10:14:48 +01:00
7cf1e1f83e Fixed a typo in a comment 2015-05-11 10:14:44 +01:00
52a0f3c32a Special-case right-dragging of a numbered cell off the grid.
Chris Boyle reports that if you right-drag a numbered cell off the
grid, _all_ numbered cells (except the immutable initial clues) get
reset to blank, because this is treated as an attempt to erase a whole
chain of linked cells (of the form a,a+1,...,a_k) and the cells with
definite numbers are all treated as 'chain 0'.

In that situation, I now substitute the same behaviour you'd get by
left-dragging the numbered cell off the board, i.e. erase _just_ that
cell and not the whole of the rest of the puzzle.

(The previous unintended behaviour was a UI action you surely never
want - and Chris also reports that due to the Android front end's way
of representing right-drags, it's especially easy to hit by mistake.)
2015-05-09 15:38:48 +01:00
7f64f4a50e Sort out abs/fabs confusion.
My Mac has just upgraded itself to include a version of clang which
warns if you use abs() on a floating-point value, or fabs() on an
integer. Fixed the two occurrences that came up in this build (and
which were actual build failures, because of -Werror), one in each
direction.

I think both were benign. The potentially dangerous one was using abs
in place of fabs in grid_find_incentre(), because that could actually
lose precision, but I think that function had plenty of precision to
spare (grid point separation being of the order of tens of pixels) so
nothing should have gone seriously wrong with the old code.
2015-04-10 07:58:26 +01:00
10460d1bc7 Add Tracks to the automake makefile's "install" target.
Each game's .R file should append the binary to $(GAMES) in both the
'am' and 'gtk' makefiles, but presumably due to copy-and-paste from an
out-of-date version, tracks.R only did 'gtk'.

Also clarified CHECKLST.txt in the hope that I won't miss that again.
2015-03-25 18:23:39 +00:00
195217a480 Fix a compile warning on ARM.
Aapo Rantalainen points out that comparing 'char c' against zero gives
rise to gcc's "comparison is always false" warning, which escalates to
an error under -Werror.

This is one of those situations where the warning is doing more harm
than good, but here's a rephrasing which casts to unsigned so that
both negative numbers and positive out-of-range ones can be caught by
the same comparison.
2015-03-24 19:20:03 +00:00
05b533d1f8 Update README after the switch to autoconf.
A user just pointed out that it still (and now falsely) claims that
mkfiles.pl directly generates a usable Unix Makefile.
2015-03-15 08:50:53 +00:00
ffe0aa6a11 Fix a build failure on x32 (time_t printfs).
As that architecture has 64-bit time_t but only 32-bit longs, printf format
causes a warning.  Enter -Werror...
2015-03-09 18:03:20 +00:00
f1e68fb516 Turn <image> tag into <img>.
Not sure how I managed to write the former by mistake, but I didn't
notice because browsers didn't immediately complain. Still, James
Harvey points out, it ought to be turned into the actually
standards-compliant spelling of the tag. Ahem.
2015-02-08 22:52:20 +00:00
362bf8d450 New puzzle from James Harvey: 'Tracks'. 2015-02-08 16:23:32 +00:00
bd0a357047 Remove a lingering bashism in makedist.sh.
A load of source files in the icons subdirectory were being left out
of the distribution tarball because I tried to include them using a
combined wildcard and bash brace expansion - but makedist cites
/bin/sh, so can't get away with bashisms. Expanded the braces.
2015-01-17 08:49:28 +00:00
cca302c01b Improve the Flood solver.
Previously it simply chose every move based on the static evaluation
function 'minimise the pair (longest shortest-path to any square,
number of squares at that distance)'. Now it looks three moves ahead
recursively, and I've also adjusted the evaluation function to tie-
break based on the number of squares brought to distance zero (i.e.
actually in control).

The result isn't an unconditional improvement on the old solver; in a
test run based on 'flood --generate 1000 12x12c6m0#12345' I found that
57 out of 1000 grids tested now had longer solutions. However, about
three quarters had shorter ones, and solutions are more than a move
shorter on average.
2015-01-15 20:36:19 +00:00
202e7fecfd Remove some lingering HTML markup.
It was getting conscientiously escaped by the new webpage.pl :-) but
in any case it's better to have the puzzle descriptions be plain text
usable in any context.
2015-01-13 20:59:54 +00:00