<feed xmlns='http://www.w3.org/2005/Atom'>
<title>puzzles/flood.c, branch master</title>
<subtitle>My sgt-puzzles tree</subtitle>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/puzzles/'/>
<entry>
<title>Add more configuration parameter lower-bound checks.</title>
<updated>2024-07-31T22:29:00+00:00</updated>
<author>
<name>Franklin Wei</name>
<email>franklin@rockbox.org</email>
</author>
<published>2024-07-21T22:54:43+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/puzzles/commit/?id=af3ab1cc5dae69917f921c959e1105491fecdab7'/>
<id>af3ab1cc5dae69917f921c959e1105491fecdab7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Flood: fix interpret_move() return value for CURSOR_SELECT2</title>
<updated>2023-08-14T00:55:42+00:00</updated>
<author>
<name>Ben Harris</name>
<email>bjh21@bjh21.me.uk</email>
</author>
<published>2023-08-14T00:55:42+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/puzzles/commit/?id=899c7c41efb2bcc8da8121cc7a8f4fccf5eb9b1e'/>
<id>899c7c41efb2bcc8da8121cc7a8f4fccf5eb9b1e</id>
<content type='text'>
If there's no solution in progress, it should return MOVE_NO_EFFECT,
not MOVE_UNUSED.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If there's no solution in progress, it should return MOVE_NO_EFFECT,
not MOVE_UNUSED.
</pre>
</div>
</content>
</entry>
<entry>
<title>Flood: correctly handle clicks that only hide cursor</title>
<updated>2023-08-14T00:49:24+00:00</updated>
<author>
<name>Ben Harris</name>
<email>bjh21@bjh21.me.uk</email>
</author>
<published>2023-08-14T00:49:24+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/puzzles/commit/?id=462a5450c6bd7d96a6051b37ceef1fd63426ddf8'/>
<id>462a5450c6bd7d96a6051b37ceef1fd63426ddf8</id>
<content type='text'>
If you clicked somewhere that had no effect (outside the grid or on a
square matching the colour of the top-left corner), interpret_move()
would return MOVE_NO_EFFECT (previously NULL) even though it had unset
ui-&gt;cursor.  So the keyboard cursor would remain visible until the
next window resize (or similar) when it would vanish.  Now
interpret_move() correctly returns MOVE_UI_UPDATE in these cases, so
the cursor vanishes immediately.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If you clicked somewhere that had no effect (outside the grid or on a
square matching the colour of the top-left corner), interpret_move()
would return MOVE_NO_EFFECT (previously NULL) even though it had unset
ui-&gt;cursor.  So the keyboard cursor would remain visible until the
next window resize (or similar) when it would vanish.  Now
interpret_move() correctly returns MOVE_UI_UPDATE in these cases, so
the cursor vanishes immediately.
</pre>
</div>
</content>
</entry>
<entry>
<title>Distinguish MOVE_UNUSED from MOVE_NO_EFFECT in Flood</title>
<updated>2023-08-14T00:46:20+00:00</updated>
<author>
<name>Ben Harris</name>
<email>bjh21@bjh21.me.uk</email>
</author>
<published>2023-08-14T00:46:20+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/puzzles/commit/?id=3c6493e7b363400479fc163970acd930b0f5db59'/>
<id>3c6493e7b363400479fc163970acd930b0f5db59</id>
<content type='text'>
Clicking outside the grid hides the keyboard cursor, so it's not
MOVE_UNUSED like it usually is.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Clicking outside the grid hides the keyboard cursor, so it's not
MOVE_UNUSED like it usually is.
</pre>
</div>
</content>
</entry>
<entry>
<title>Flood: use move_cursor() for cursor movement</title>
<updated>2023-08-13T15:44:24+00:00</updated>
<author>
<name>Ben Harris</name>
<email>bjh21@bjh21.me.uk</email>
</author>
<published>2023-08-09T19:34:50+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/puzzles/commit/?id=2b6c6dce34b9867fd18faed4ca9be6caf4e45bf5'/>
<id>2b6c6dce34b9867fd18faed4ca9be6caf4e45bf5</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Flood: don't draw zero-width tile separators</title>
<updated>2023-07-30T16:16:36+00:00</updated>
<author>
<name>Ben Harris</name>
<email>bjh21@bjh21.me.uk</email>
</author>
<published>2023-07-30T16:16:36+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/puzzles/commit/?id=29eaa8f55c7b9cc960afa4327a7ce977e6637e9c'/>
<id>29eaa8f55c7b9cc960afa4327a7ce977e6637e9c</id>
<content type='text'>
Flood's draw_tile() extravagantly uses up to eight rectangles to draw
separators around each tile.  This could be substantially improved,
but a particularly low-hanging optimisation is not do draw them when
the separator width is zero.

This at least means that Flood completes its initial drawing on my
test KaiOS device.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Flood's draw_tile() extravagantly uses up to eight rectangles to draw
separators around each tile.  This could be substantially improved,
but a particularly low-hanging optimisation is not do draw them when
the separator width is zero.

This at least means that Flood completes its initial drawing on my
test KaiOS device.
</pre>
</div>
</content>
</entry>
<entry>
<title>Rename UI_UPDATE as MOVE_UI_UPDATE</title>
<updated>2023-06-10T23:33:27+00:00</updated>
<author>
<name>Ben Harris</name>
<email>bjh21@bjh21.me.uk</email>
</author>
<published>2023-06-04T17:42:58+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/puzzles/commit/?id=a9af3fda1d784c42d486a019a0a4e947f762af70'/>
<id>a9af3fda1d784c42d486a019a0a4e947f762af70</id>
<content type='text'>
All the other constants named UI_* are special key names that can be
passed to midend_process_key(), but UI_UPDATE is a special return value
from the back-end interpret_move() function instead.  This renaming
makes the distinction clear and provides a naming convention for future
special return values from interpret_move().
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
All the other constants named UI_* are special key names that can be
passed to midend_process_key(), but UI_UPDATE is a special return value
from the back-end interpret_move() function instead.  This renaming
makes the distinction clear and provides a naming convention for future
special return values from interpret_move().
</pre>
</div>
</content>
</entry>
<entry>
<title>New backend functions: get_prefs and set_prefs.</title>
<updated>2023-04-23T12:25:06+00:00</updated>
<author>
<name>Simon Tatham</name>
<email>anakin@pobox.com</email>
</author>
<published>2023-04-21T14:50:05+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/puzzles/commit/?id=0058331aeb027f7441a04d99cc7c1e445bd896d9'/>
<id>0058331aeb027f7441a04d99cc7c1e445bd896d9</id>
<content type='text'>
These are similar to the existing pair configure() and custom_params()
in that get_prefs() returns an array of config_item describing a set
of dialog-box controls to present to the user, and set_prefs()
receives the same array with answers filled in and implements the
answers. But where configure() and custom_params() operate on a
game_params structure, the new pair operate on a game_ui, and are
intended to permit GUI configuration of all the settings I just moved
into that structure.

However, nothing actually _calls_ these routines yet. All I've done in
this commit is to add them to 'struct game' and implement them for the
functions that need them.

Also, config_item has new fields, permitting each config option to
define a machine-readable identifying keyword as well as the
user-facing description. For options of type C_CHOICES, each choice
also has a keyword. These keyword fields are only defined at all by
the new get_prefs() function - they're left uninitialised in existing
uses of the dialog system. The idea is to use them when writing out
the user's preferences into a configuration file on disk, although I
haven't actually done any of that work in this commit.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These are similar to the existing pair configure() and custom_params()
in that get_prefs() returns an array of config_item describing a set
of dialog-box controls to present to the user, and set_prefs()
receives the same array with answers filled in and implements the
answers. But where configure() and custom_params() operate on a
game_params structure, the new pair operate on a game_ui, and are
intended to permit GUI configuration of all the settings I just moved
into that structure.

However, nothing actually _calls_ these routines yet. All I've done in
this commit is to add them to 'struct game' and implement them for the
functions that need them.

Also, config_item has new fields, permitting each config option to
define a machine-readable identifying keyword as well as the
user-facing description. For options of type C_CHOICES, each choice
also has a keyword. These keyword fields are only defined at all by
the new get_prefs() function - they're left uninitialised in existing
uses of the dialog system. The idea is to use them when writing out
the user's preferences into a configuration file on disk, although I
haven't actually done any of that work in this commit.
</pre>
</div>
</content>
</entry>
<entry>
<title>Pass a game_ui to compute_size, print_size and print.</title>
<updated>2023-04-21T15:18:04+00:00</updated>
<author>
<name>Simon Tatham</name>
<email>anakin@pobox.com</email>
</author>
<published>2023-04-21T14:30:41+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/puzzles/commit/?id=a4fca3286f3aa630a3641e50a8e1f44ab1504a29'/>
<id>a4fca3286f3aa630a3641e50a8e1f44ab1504a29</id>
<content type='text'>
I'm about to move some of the bodgy getenv-based options so that they
become fields in game_ui. So these functions, which could previously
access those options directly via getenv, will now need to be given a
game_ui where they can look them up.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I'm about to move some of the bodgy getenv-based options so that they
become fields in game_ui. So these functions, which could previously
access those options directly via getenv, will now need to be given a
game_ui where they can look them up.
</pre>
</div>
</content>
</entry>
<entry>
<title>Make encode_ui() and decode_ui() optional in back-ends</title>
<updated>2023-04-08T19:08:16+00:00</updated>
<author>
<name>Ben Harris</name>
<email>bjh21@bjh21.me.uk</email>
</author>
<published>2023-02-13T22:41:40+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/puzzles/commit/?id=418cb3a5671404d2d91bf221887df2be2ae2654f'/>
<id>418cb3a5671404d2d91bf221887df2be2ae2654f</id>
<content type='text'>
The majority of back-ends define encode_ui() to return NULL and
decode_ui() to do nothing.  This commit allows them to instead specify
the relevant function pointers as NULL, in which case the mid-end won't
try to call them.

I'm planning to add a parameter to decode_ui(), and if I'm going to have
to touch every back-end's version of decode_ui(), I may as well ensure
that most of them never need to be touched again.  And obviously
encode_ui() should go the same way for symmetry.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The majority of back-ends define encode_ui() to return NULL and
decode_ui() to do nothing.  This commit allows them to instead specify
the relevant function pointers as NULL, in which case the mid-end won't
try to call them.

I'm planning to add a parameter to decode_ui(), and if I'm going to have
to touch every back-end's version of decode_ui(), I may as well ensure
that most of them never need to be touched again.  And obviously
encode_ui() should go the same way for symmetry.
</pre>
</div>
</content>
</entry>
</feed>
