simon-git: puzzles (main): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Sat Jan 8 14:56:20 GMT 2022


TL;DR:
  efbb2e3 Mosaic: fix encoding of aggressiveness in game params.
  cb6cead windows.c: fix some mis-indented pieces of code.
  6a4209b Windows: reinstate SetWindowPos in check_window_size.

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:           2022-01-08 14:56:20

commit efbb2e3a31b16d34e060de633c5083c662a9ddac
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=efbb2e3a31b16d34e060de633c5083c662a9ddac;hp=1600818848fc99eb53e0de240670b598ac490fdc
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Jan 8 14:24:20 2022 +0000

    Mosaic: fix encoding of aggressiveness in game params.
    
    The default setting for 'aggressiveness' is true. But the extra suffix
    to specify it in the full version of the encoded game params was being
    set if aggressiveness _was_ true, not if it was false. Result: round
    trip encode/decode of a non-aggressive configuration fails, because
    the encoded string has no aggressiveness suffix, and the decoder
    interprets that as going back into aggressive mode.
    
    Pulled out the default setting into a #define which is checked
    consistently in both locations.

 mosaic.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

commit cb6cead7a905eeb00b861f45e6f2c3f0cc60105d
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=cb6cead7a905eeb00b861f45e6f2c3f0cc60105d;hp=efbb2e3a31b16d34e060de633c5083c662a9ddac
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Jan 8 14:27:07 2022 +0000

    windows.c: fix some mis-indented pieces of code.
    
    I happened to run across one of these on my way somewhere else and
    thought I'd fix it in passing.

 windows.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

commit 6a4209b17875f5cfd2b37178e15c2aa2839c0d8d
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=6a4209b17875f5cfd2b37178e15c2aa2839c0d8d;hp=cb6cead7a905eeb00b861f45e6f2c3f0cc60105d
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Jan 8 14:43:01 2022 +0000

    Windows: reinstate SetWindowPos in check_window_size.
    
    The purpose of check_window_size is to be run after we try to resize
    the puzzle window, decide whether the window size needs a further
    update, and if so, make it. But the SetWindowPos call that actually
    made the update (triggered by the subroutine check_window_resize
    returning true to indicate that a change was needed) had mysteriously
    gone missing.
    
    An example case where this goes wrong: start up a puzzle at a game
    size large enough to need a tile size smaller than default. Then
    change the setting to one so small that the menu bar is now the
    limiting factor on how small the window can be. (For example, changing
    Mosaic from its 50x50 preset to 3x3, if your monitor isn't so huge
    that the former fits.) The window comes out the wrong size, and with
    this SetWindowPos reinstated, now it gets corrected.
    
    What seems to have happened was that the SetWindowPos was originally
    under #ifndef _WIN32_WCE, i.e. we only want to do it on desktop
    Windows, not on CE. Then commit 39d299f579da3e9 (introducing manual
    window resizing in the Windows front end) moved the call into a
    different function, and in the process, accidentally reversed the
    sense of the #ifdef. And then commit 39d299f579da3e9 (removing the
    bit-rotted Windows CE support completely) removed it, along with
    everything else under #ifndef _WIN32_WCE!
    
    It was originally supposed to be _enabled_ on desktop Windows, not
    disabled. So I've put it back now.

 windows.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)



More information about the tartarus-commits mailing list