simon-git: puzzles (main): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Wed Jul 31 23:32:01 BST 2024
TL;DR:
894115a Add STRIP_BUTTON_MODIFIERS() macro to refactor modifier flag stripping.
3f8ef29 midend_process_key: allow Shift+Tab to pass through to the backend.
b50a958 GTK: Handle Shift+Tab properly.
c010ca1 Untangle: add cursor control interface.
5de69c2 Refactor `button & ~MOD_MASK' as `STRIP_BUTTON_MODIFIERS(button)'.
a2f7f96 Rename memswap() to swap_regions(). Consolidate duplicate implementations.
af3ab1c Add more configuration parameter lower-bound checks.
c70878c Fix typo in developer docs for request_keys().
6b453e4 Filling: turn printv() into a macro, and only for STANDALONE_SOLVER builds.
72ff127 Map: add user preference to draw larger stipple marks.
62c0e0d Palisade: add double-resolution cursor mode.
Repository: https://git.tartarus.org/simon/puzzles.git
On the web: https://git.tartarus.org/?p=simon/puzzles.git
Branch updated: main
Committer: Simon Tatham <anakin at pobox.com>
Date: 2024-07-31 23:32:01
commit 894115ad3db62b7baa5707cc287c9ab251acc2a7
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=894115ad3db62b7baa5707cc287c9ab251acc2a7;hp=fd304c53cc45dc05b3f95c20a466e20a7e1c9194
Author: Franklin Wei <franklin at rockbox.org>
Date: Sun Jul 21 04:36:30 2024 -0400
Add STRIP_BUTTON_MODIFIERS() macro to refactor modifier flag stripping.
There are many places in the code which use the (x & ~MOD_MASK) idiom. This
new macro makes possible their refactoring in the future.
puzzles.h | 1 +
1 file changed, 1 insertion(+)
commit 3f8ef290786fbaf7b9ec200a2fd598eb324c6b0c
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=3f8ef290786fbaf7b9ec200a2fd598eb324c6b0c;hp=894115ad3db62b7baa5707cc287c9ab251acc2a7
Author: Franklin Wei <franklin at rockbox.org>
Date: Sun Jul 21 04:49:06 2024 -0400
midend_process_key: allow Shift+Tab to pass through to the backend.
Previously, a button code of ('\t' | MOD_SHFT) from a frontend would have
the MOD_SHFT flag stripped by midend_process_key, resulting in a bare '\t'
passed to the backend. Now, this combination is allowed to pass through to
the backend. This will be used in the keyboard interface to Untangle, which
I'm about to add.
devel.but | 6 +++---
midend.c | 12 +++++++-----
2 files changed, 10 insertions(+), 8 deletions(-)
commit b50a95807ab1248c68b213cc9c2b43ea0bbce0f5
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=b50a95807ab1248c68b213cc9c2b43ea0bbce0f5;hp=3f8ef290786fbaf7b9ec200a2fd598eb324c6b0c
Author: Franklin Wei <franklin at rockbox.org>
Date: Sun Jul 21 04:55:01 2024 -0400
GTK: Handle Shift+Tab properly.
According to
https://mail.gnome.org/archives/gtk-list/1999-August/msg00145.html
pressing Shift+Tab generates a special keyval of ISO_Left_Tab, without
a GDK_SHIFT_MASK applied. We now handle this case so that the midend
receives ('\t' | MOD_SHFT) as intended. This will be used by the
upcoming Untangle keyboard interface.
gtk.c | 5 +++++
1 file changed, 5 insertions(+)
commit c010ca122f8e5a9b9828a846cbbc0d32de489b20
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=c010ca122f8e5a9b9828a846cbbc0d32de489b20;hp=b50a95807ab1248c68b213cc9c2b43ea0bbce0f5
Author: Franklin Wei <franklin at rockbox.org>
Date: Sun Jul 21 05:32:09 2024 -0400
Untangle: add cursor control interface.
The cursor keys navigate amongst the points. CURSOR_SELECT toggles dragging;
CURSOR_SELECT2 and the Tab key cycle through the points.
The cursor navigation scheme jumps to the nearest point within the quadrant
of the cursor direction; this seems to yield fairly intuitive gameplay.
Unfortunately, the "quadrant-nearest-neighbors" digraph produced by this
scheme is not necessarily fully reciprocal; that is, pressing opposite
cursor keys in sequence does not always return to the original point. There
doesn't seem to be any immediately obvious way around this.
As for connectivity (i.e. whether all points are reachable from any given
point), I could not find a counterexample, but I don't yet have a formal
proof that this is the case in general. Hence, I've added the ability to
cycle through all the points with Tab. (This will probably also be useful
in conjunction with the "Numbers" point drawing preference.)
puzzles.but | 5 ++
untangle.c | 245 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
2 files changed, 240 insertions(+), 10 deletions(-)
commit 5de69c22b0ff037f648a740a7c01869e78587df2
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=5de69c22b0ff037f648a740a7c01869e78587df2;hp=c010ca122f8e5a9b9828a846cbbc0d32de489b20
Author: Franklin Wei <franklin at rockbox.org>
Date: Sun Jul 21 18:06:37 2024 -0400
Refactor `button & ~MOD_MASK' as `STRIP_BUTTON_MODIFIERS(button)'.
This refactors all instances of bitwise-ANDs with `~MOD_MASK'. There is
a handful of more complex instances I left unchanged (in cube.c, midend.c,
and twiddle.c), since those AND with `~MOD_MASK | MOD_NUM_KEYPAD' or
similar. I don't think it's worth writing a macro for those cases.
Also document this new macro's usage in devel.but.
bridges.c | 2 +-
devel.but | 12 ++++++++++--
fifteen.c | 2 +-
filling.c | 2 +-
keen.c | 2 +-
loopy.c | 2 +-
midend.c | 6 ++++--
net.c | 2 +-
netslide.c | 2 +-
palisade.c | 2 +-
pattern.c | 2 +-
pearl.c | 2 +-
rect.c | 2 +-
sixteen.c | 2 +-
solo.c | 2 +-
tents.c | 2 +-
towers.c | 2 +-
unequal.c | 2 +-
unfinished/group.c | 2 +-
unruly.c | 2 +-
20 files changed, 32 insertions(+), 22 deletions(-)
commit a2f7f962ced158dbceebbfc0c3dfbbc58b119e55
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=a2f7f962ced158dbceebbfc0c3dfbbc58b119e55;hp=5de69c22b0ff037f648a740a7c01869e78587df2
Author: Franklin Wei <franklin at rockbox.org>
Date: Sun Jul 21 18:33:01 2024 -0400
Rename memswap() to swap_regions(). Consolidate duplicate implementations.
C99 reserves the mem* namespace for future expansion. Some Rockbox
targets had issues with memswap() conflicting with another definition,
so fix that.
devel.but | 7 +++++++
misc.c | 4 ++--
puzzles.h | 6 ++++++
sort.c | 20 +-------------------
4 files changed, 16 insertions(+), 21 deletions(-)
commit af3ab1cc5dae69917f921c959e1105491fecdab7
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=af3ab1cc5dae69917f921c959e1105491fecdab7;hp=a2f7f962ced158dbceebbfc0c3dfbbc58b119e55
Author: Franklin Wei <franklin at rockbox.org>
Date: Sun Jul 21 18:54:43 2024 -0400
Add more configuration parameter lower-bound checks.
blackbox.c | 2 ++
flood.c | 2 +-
mines.c | 2 ++
netslide.c | 2 ++
pattern.c | 2 ++
sixteen.c | 3 ++-
twiddle.c | 2 ++
7 files changed, 13 insertions(+), 2 deletions(-)
commit c70878c4adde680fc569ff9ab75e49581c907fa5
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=c70878c4adde680fc569ff9ab75e49581c907fa5;hp=af3ab1cc5dae69917f921c959e1105491fecdab7
Author: Franklin Wei <franklin at rockbox.org>
Date: Sun Jun 28 22:41:29 2020 -0400
Fix typo in developer docs for request_keys().
"point"->"pointer".
devel.but | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
commit 6b453e4e984c1d881c431265eb3cd9b43688721f
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=6b453e4e984c1d881c431265eb3cd9b43688721f;hp=c70878c4adde680fc569ff9ab75e49581c907fa5
Author: Franklin Wei <franklin at rockbox.org>
Date: Sun Jul 21 19:12:13 2024 -0400
Filling: turn printv() into a macro, and only for STANDALONE_SOLVER builds.
This was breaking Rockbox builds due to the lack of vprintf().
filling.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
commit 72ff1274046a3b79a9724075633fac261cc1f924
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=72ff1274046a3b79a9724075633fac261cc1f924;hp=6b453e4e984c1d881c431265eb3cd9b43688721f
Author: Franklin Wei <franklin at rockbox.org>
Date: Sun Jul 21 19:26:13 2024 -0400
Map: add user preference to draw larger stipple marks.
This is useful on smaller screens, where the default-size pencil marks may
be too small to be visible by default.
map.c | 23 +++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)
commit 62c0e0dcc9e7e250f1936b107e5b76e881b69496
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=62c0e0dcc9e7e250f1936b107e5b76e881b69496;hp=72ff1274046a3b79a9724075633fac261cc1f924
Author: Franklin Wei <franklin at rockbox.org>
Date: Tue Jul 23 05:49:04 2024 -0400
Palisade: add double-resolution cursor mode.
This adds a "half-grid" cursor mode, settable via a preference, which
doubles the resolution of the keyboard cursor, so that it can be over a
square center, vertex, or edge. The cursor select buttons then toggle the
edge directly under the cursor.
There are two advantages to this new behavior. First, the game can now be
played with only the cursor keys, doing away with the need to hold Control
or Shift, which are not currently emulated on Rockbox. And second, the new
interface is arguably more discoverable than the legacy mode,
which is still retained as a user preference.
palisade.c | 174 +++++++++++++++++++++++++++++++++++++++++++++++++++++-------
puzzles.but | 20 +++++--
2 files changed, 170 insertions(+), 24 deletions(-)
More information about the tartarus-commits
mailing list