xboard.git
7 years agoRemove castling rights from Suicide start position
H.G.Muller [Wed, 1 Feb 2017 12:15:25 +0000]
Remove castling rights from Suicide start position

Suicide was initialized with castling rights, while the move generator
in fact would suppress any castling. The fake rights would appear in FENs,
and break probing of the GUI book.

7 years agoFix e.p. capture in ICS play
H.G.Muller [Tue, 17 Jan 2017 17:53:27 +0000]
Fix e.p. capture in ICS play

The new e.p. rights were not set when the position was obtained
by parsing an ICS board, rather than from applying a move to a previous
position.

7 years agoLet repeated right-clicking upgrade placed piece in Edit Position mode
H.G.Muller [Fri, 13 Jan 2017 13:51:33 +0000]
Let repeated right-clicking upgrade placed piece in Edit Position mode

Right-clicking a square multiple timesin Edit Position mode will now make
it cycle through all pieces defined in the pieceToCharTable.
  When -monoMouse is set a click on an occupied square is interpreted as
a left-click. But an exception is now made for the piece that was just
placed: this will be treated as a right-click, so that this feature is
also accessible in monoMouse mode.

7 years agoFix usage of memory after free in -replace option
H.G.Muller [Fri, 13 Jan 2017 12:26:44 +0000]
Fix usage of memory after free in -replace option

The code for implementing the -replace option was using a string after
its memory was freed, which might not work in all allocation systems.

7 years agoAllow Make Persistent on engine loaded from recent-engine menu
H.G.Muller [Fri, 13 Jan 2017 12:22:27 +0000]
Allow Make Persistent on engine loaded from recent-engine menu

This method of loading an engine from the list was not yet recorded
in the currentEngine[] array.

7 years agoUse feature timeout when starting second engine for analysis
H.G.Muller [Thu, 5 Jan 2017 21:30:41 +0000]
Use feature timeout when starting second engine for analysis

When the second engine gets ivolved in the analysis, but has not been
used before, so that its features are unknown, we now wait for these
features (or time out in case of v1 engines) before initializing the
engine. Without this 'edit' could be used on engines that need 'setboard',
or false 'unsupported variant' errors could arise.

7 years agoFix awareness of settings changed by -firstOption
H.G.Muller [Thu, 5 Jan 2017 16:05:22 +0000]
Fix awareness of settings changed by -firstOption

Options of the type -file and -path that were set through -firstOptions
would not get their 'current value' updated, so that XBoard would not
set them properly on a reload because of reuse=0. In addition the default
value for all option types would be remembered as the value specified
by -firstOptions, rather than the engine default, possibly preventing
their saving on Make Persistent.

7 years agoFix ICS Crazyhouse play
H.G.Muller [Wed, 4 Jan 2017 19:40:08 +0000]
Fix ICS Crazyhouse play

The new way to associate promoted partners to pieces had woken up a latent
bug in the code that determined whether pieces in the ICS board are promoted
Pawns. This led to Pawns appearing out of nowhere on squares evacuated by
white Pawns.

7 years agoMake holdings scrollable
H.G.Muller [Sun, 25 Dec 2016 16:20:30 +0000]
Make holdings scrollable

When the hand size exceeds the number of board ranks R, the holdings will
either display either the first R-1 or last R-1 piece types. The remaining
square will then act as a toggle button between the two states. If there
is indeed material that is not displayed, the toggle square will display
a Prince of the opposite color. (The idea is that themes for games needing
this feature would define this piece as a vertical arrow glyph.)

7 years agoCorrect promotion zone for blacked-out ranks
H.G.Muller [Thu, 22 Dec 2016 20:22:28 +0000]
Correct promotion zone for blacked-out ranks

When the window height has to be larger than the board height, to accomodate
the holdings (as in Wa Shogi), this is done by defining the board height as
large as the holdings size, and blacking out the extra ranks. But when the
depth is calculated as 1/3 of the board height, it should use the real
board height, not the artificially enlarged one.

7 years agoDecouple board height from hand size
H.G.Muller [Thu, 22 Dec 2016 19:28:47 +0000]
Decouple board height from hand size

To make it possible to have holdings larger than the height of the board
window, (of which a selectable subset ca then be displayed), the holdings
size is now referred to a separate variable.

7 years agoGeneralize FEN e.p. field to handle diagonal and triple pushes
H.G.Muller [Tue, 6 Dec 2016 16:19:00 +0000]
Generalize FEN e.p. field to handle diagonal and triple pushes

In Berolina Chess a single square canot unambiguously indicate which
e.p. capture ispossible, as two initial double-pushes could cross over
the same square (and a 4th-rank Pawn could have come from two 2nd-rank
locations). So both the skipped square and the location of the corresponding
e.p.victim have to be mentioned in the e.p. field of a FEN. This is now
supported (in variant Berolina) on both reading and writing.
  In addition, the test for when an e.p. field has to be added is improved.
It was still using hard-coded rank numbers, only acting on 2->4 and 7->5
Pawn moves that stayed on the same file. Now it works on any advance of
more than one rank. For pushes of more than one rank the e.p. square is
biased towards the from-square. This makes it possible to distinguish
between a triple and a double-push that end on the same rank.

7 years agoFix recognition of variant seirawan in examined ICS games
H.G.Muller [Tue, 6 Dec 2016 11:46:07 +0000]
Fix recognition of variant seirawan in examined ICS games

The heuristic for guessing the variant when receiving an ICS holdings
command assumed Crazyhouse when the board width was 8, which prevented
correct interpretation of the holdings content. Now presence of H or E
in the holdings alter the guess to Seirawan Chess.

7 years agoImplement check-count field in FENs
H.G.Muller [Mon, 5 Dec 2016 12:22:40 +0000]
Implement check-count field in FENs

A field of the form N+M between e.p. field and ply counter is now associated
with the CHECK_COUNT game state on reading and writing. It is only written
when non-zero (which again should only happen in 3check). In addition a field
of the form +N+M after the full-move number is recognized on reading as the
SCIDB check counter, which indicates checks given.

7 years agoKeep track of number of remaining checks
H.G.Muller [Mon, 5 Dec 2016 11:01:17 +0000]
Keep track of number of remaining checks

Another off-board square is now allocated forkeeping track of the number
of remaining checks each side can suffer before losing. When this double
counter is 0, counting is disabled. Otherwise each check will decrease
the count of the checked side, and when it reaches 0 the check will be
treated as a checkmate. In variant 3check the counters will be initialized
to 3, otherwise to 0.

7 years agoRemeber last-moved piece in only one Board square
H.G.Muller [Mon, 5 Dec 2016 10:15:48 +0000]
Remeber last-moved piece in only one Board square

The amount of game-state data (castling rights, e.p. state...) carried
along in the extra rank above the real board is getting a bit out of hand.
Rather than storing rank and file of the last-moved piece in two separate
off-board squares in that rank, we now combine them into a single number
(which would still allow boards of upto 64 files).

7 years agoFix legality testing with mandatory capture
H.G.Muller [Mon, 5 Dec 2016 08:54:30 +0000]
Fix legality testing with mandatory capture

When a capture was possible in suicide/giveaway/losers, only the board
markers of all non-captures were cleared, but not the legality of the
corresponding destination squares in the array legal[][]. The patch that
forced destinations to be legal when the engine had highlighted them had
therefore broken rejection of illegal non-captures in this case.

7 years agoAdd msimg32 library to makefile.gcc for WinBoard build
H.G.Muller [Fri, 2 Dec 2016 10:16:52 +0000]
Add msimg32 library to makefile.gcc for WinBoard build

The AlphaBlend function would be an undefined reference without this library.

7 years agoFix Game List highlighting (WB)
H.G.Muller [Fri, 2 Dec 2016 08:25:13 +0000]
Fix Game List highlighting (WB)

The binary search for finding the current game amongst the listed ones
in the Game List was not looking in the first 32 displayed entries.

7 years agoAlso allow Make Persist on engines loaded through -fe / -se
H.G.Muller [Fri, 2 Dec 2016 08:09:18 +0000]
Also allow Make Persist on engines loaded through -fe / -se

The options -fe and -se are another way to select engines from the list,
and MakePersistent should also work in this case. So the engine lines
retrieved for the given nicks are now also remembered.

7 years agoReport error when saving of engine settings fails
H.G.Muller [Fri, 2 Dec 2016 08:00:19 +0000]
Report error when saving of engine settings fails

When the current engine was not chosen from the Engine List, or is no
loger in there, we now print a complaint in the message field.

7 years agoRemember engine lines selected in Startup Dialog (WB)
H.G.Muller [Fri, 2 Dec 2016 07:48:20 +0000]
Remember engine lines selected in Startup Dialog (WB)

The comboboxes in the Startup Dialog do contain complete engine lines
from the Engine List, so selecting an engine from there should also allow
use of the Make Persistent button in the Engine Settings dialogs. To this
end the selected lines are now remembered incurrentEngine[].

7 years agoAllow WinBoard to use bitmaps with alpha channel
H.G.Muller [Wed, 30 Nov 2016 21:27:35 +0000]
Allow WinBoard to use bitmaps with alpha channel

When the primary image of a piece (*o.bmp or *s.bmp) has a format with
32 bit/pixel, it is assumed to be in ARGB format, with transparent
background. It is then drawn over the board accordingly by new code
(using the Win API AlphaBlend routine). This code ignores the allWhite
and flipBlack options for the moment.
  The cascade for loading bitmaps has been changed as well: WinBoard
now first tries to load an image with name like piece0_49o.bmp from the
pieceImageDirectory if the traditional name (like p49o.bmp) is not found,
before falling back on built-in images.

7 years agoMake it possible to save XBoard piece images as Windows bitmaps
H.G.Muller [Wed, 30 Nov 2016 16:16:50 +0000]
Make it possible to save XBoard piece images as Windows bitmaps

A new option -bmpSave N would make XBoard save the images of the first
N pieces of each color, plus the King, as a Windows .bmp file with alpha
channel (32 bits/pixel). This happens in a sub-directory 'bmaps'. After the
black King is saved, XBoard will exit.

7 years agoImplement less kludgy way for conditional string options
H.G.Muller [Wed, 30 Nov 2016 13:46:07 +0000]
Implement less kludgy way for conditional string options

A new option -replace can now define a string, and when the existing value
of the next encountered string option does not exactly match that, the
latter is ignored. The @@@@@ kludge for conditionally replacing empty
strings is removed, as this can now be achieved through -replace "".
The value of -replace is reset to NULL (not ""!) as soon as it has been
used for comparison, irrespective of the result. This makes -replace a
'hyper-volatile' option.
 The conditional setting of UCI2WB as -uxiAdapter in xboard.conf is now
changed to use this mechanism.

7 years agoAdd Tower, Sword and Gnu piece images (WB)
H.G.Muller [Sat, 26 Nov 2016 10:39:24 +0000]
Add Tower, Sword and Gnu piece images (WB)

Bitmaps for the Tower and Sword piece types are added to WinBoard for
size bulky (72x72) and middling (49x49), so the first 26 contiguous pieces
all have built-in images in these sizes. Gnu images are also added.

7 years agoOnly consider kingless positions as in-check in Atomic
H.G.Muller [Sun, 27 Nov 2016 22:35:24 +0000]
Only consider kingless positions as in-check in Atomic

The check test returned 1000 (as special version of TRUE) when there
was no King that could be exposed to capture, under the assumption that
this would mean it had been exploded by the preceding move. But this was
counter-productive in variants without King (such as Horde). So now it
is only done in Atomic Chess, and all other variants return FALSE if there
is nothing on the board that could be checked.

7 years agoImplement understanding of Xiangqi UBB format
H.G.Muller [Sun, 27 Nov 2016 22:19:14 +0000]
Implement understanding of Xiangqi UBB format

Xiangqi games are often distributed in HTMLpages in a compressed format
iterpreted by a viewer script. XBoard's game parser now understands this
format.

7 years agoConfigure XBoard to use UCI2WB as adapter for UCI dialects
H.G.Muller [Sun, 27 Nov 2016 20:57:50 +0000]
Configure XBoard to use UCI2WB as adapter for UCI dialects

The -uxiAdapter option is conditionally set for using UCI2WB in the
master settings file, in a way that would overrule the user settings
only if the latter still has it as an empty string.

7 years agoIntroduce contitional string options
H.G.Muller [Sun, 27 Nov 2016 17:03:51 +0000]
Introduce contitional string options

A string option that specifies a value starting with "@@@@@" (five at signs)
will be treated in a special way: if the current value of this option is
not the empty string, it will not be changed. If it is, it will be set
to the given value after the @@@@@ prefix has been stripped off the latter.
 This is introduced to make it possible to set hitherto unused persistent
options from the master settings file, by includig them in the latter after
the user settigs file was read. Options in this location will overrule
whatever was in the saved settings, effectively making the option volatile
with a new default. But by using the @@@@@ prefix for the value, users
that already have assigned a value to the option will not be affected,
and only for users that were not yet using the option a new value will
be defined for it.

7 years agoFix saving engine settings after registering new engine
H.G.Muller [Sun, 27 Nov 2016 16:30:25 +0000]
Fix saving engine settings after registering new engine

The remebered currentEgine after a new registration through the Load Engine
dialog would be terminated by a linefeed, unlike after loading an engine
that already was in the list. This caused the -firstOptions to be added
on the next line. Now both cases omit the linefeed.

7 years agoImplement saving of (modified) engine settings
H.G.Muller [Sun, 27 Nov 2016 13:47:03 +0000]
Implement saving of (modified) engine settings

The Engine #N Settings dialogs will now have an extra button at the top,
labelled "Make Persistent". Pressing it will 'OK' the dialog, and in
addition will add all non-default settings of the options to the engine
line in the Engine List (-firstChessProgramNames), as a -firstOptions
XBoard option. If such an option is already in the engine line, its value
will be altered to the newly specified settings. The function ResendOptions
was modified to also allow returning the options as a string, rather
than sending them as 'option' commands to the engine.
 Currently this will only work for engines that were loaded through the
Load Engine dialogs, not for those specified with -fcp/scp at startup.
Because the latter need not be in the engine list. The Load Engine
dialogs will make XBoard remember the entire engine line of the engine
that was last loaded, and pressing the button will search a line exactly
like it in the engine list, to add/change its -firstOptions option.
It would fail silently if no such line is found.

7 years agoOnly resend changed options on xreuse restart
H.G.Muller [Sat, 26 Nov 2016 12:56:16 +0000]
Only resend changed options on xreuse restart

For engines that specify reuse=1, a new engine process is started for
every game. This new process is made aware of the option settings as
they were specified by the user during the live of its predecessors.
Now this resending is limited to the options that have different value
from their original default. To achieve that, the default values are
now remembered (in the last 104 bytes of the Option.name buffer, which
was allocated way too large): 4 bytes for integet value, 99 char text.

7 years agoFix storage of values of engine string options
H.G.Muller [Sat, 26 Nov 2016 11:33:54 +0000]
Fix storage of values of engine string options

Originally all option definitions given in option features were stored
in a static array of generous size (MSG_SIZ). But this was changed to
allocated memory for not wasting space on unused option slots. The allocated
memory wasonly large enough to hold the default value of the option,
which could very well be an empty string. Changing the option setting
to a longer strig would then produce memory corruption through buffer overrun.
Now the memory allocated for option features is again at least MSG_SIZ.

7 years agoFix bug in storing time of first move
H.G.Muller [Fri, 25 Nov 2016 21:59:35 +0000]
Fix bug in storing time of first move

TwoMachinesEvent() reset the clocks for re-calculating time odds (as the
first engine would play white, while any previous Reset() would have
assumed it played black). But it did not save the start time in the
tmeReamaining array. Actually TwoMachinesEvent() was not supposed to
unconditionally reset the clocks, and this bug was introduced when the
ResetClocks was moved out of the conditional, separating it from saving
the start times. It is nowput back inside the conditional, but the
condition is now also incorporating the case TwoMachineEvent() was called
at the start of a game (i.e. no moves done). When used to resume a game
in progress it keeps the existing clocks (except for engines that do not
support time/otim).

7 years agoImprove identification of e.p. victim
H.G.Muller [Thu, 24 Nov 2016 18:47:46 +0000]
Improve identification of e.p. victim

The move generator now generates e.p. moves of default Pawns based on
the file of the skipped square of the previous multi-push, rather than
the e.p. rights (which were set only if ApplyMove suspects an e.p. capture
is actually possible, which might not be the case when opponent Pawns do
not capture as expected). A standard Pawn capturing to an empty square
will now always capture the previously multi-pushed Pawn. Only if there
is none it will guess where the victim should be based on FIDE rules,
and would not capture any non-Pawns in that location.
  This heuristic should work for default Pawns against any other kind
of Pawn. The existence of e.p. rights might not be recognized when
comparing positions, however, so that rep draws could be declared after
a two-fold repetition.

7 years agoTreat Betza-defined e.p. capture
H.G.Muller [Wed, 23 Nov 2016 16:46:20 +0000]
Treat Betza-defined e.p. capture

Pieces with redefined moves that include an e.p. capture will now
not be subject to the heuristic that deletes a suspected e.p. victim
during board update (which was only applied to Pawns and Lances).
When they move to the e.p. square (still set by Pawn or Lance multi-
pushes in the old hard-coded way), this will remove the last-moved piece
(which created those e.p. rights).

7 years agoDetect breaking of input pipe from engines (GTK)
H.G.Muller [Wed, 23 Nov 2016 14:17:03 +0000]
Detect breaking of input pipe from engines (GTK)

In the GTK version the input events were not set up to trigger when
the pipe broke, which led to delayed detection of crashing engines.

7 years agoObey -firstFeatures option at startup
H.G.Muller [Wed, 23 Nov 2016 14:13:40 +0000]
Obey -firstFeatures option at startup

The -firstFeatures, which are supposed to overrule features of the first
engine, were ignored when this engine was loaded at startup.

7 years agoupdates NEWS, Changelog, DIFFSTAT and SHORTLOG
Arun Persaud [Mon, 1 Aug 2016 03:53:21 +0000]
updates NEWS, Changelog, DIFFSTAT and SHORTLOG

7 years agoupdated po/pot files
Arun Persaud [Mon, 1 Aug 2016 03:46:54 +0000]
updated po/pot files

7 years agonew version number for release 4.9.1
Arun Persaud [Mon, 1 Aug 2016 03:45:22 +0000]
new version number for release 4.9.1

7 years agoFix crash when logging out from ICS
H.G.Muller [Thu, 28 Jul 2016 17:49:02 +0000]
Fix crash when logging out from ICS

The patch that sent "logout" to the ICS on a fatal error backfired when
the 'fatal error' was a disconnect, and caused a crash on Mac. We now
suppress sending of this "logout" command in the disconnect case,
communicated in a kludgy way (by requesting exit status 6666).

7 years agoDefer book faking input move until ping balance
H.G.Muller [Thu, 28 Jul 2016 12:24:27 +0000]
Defer book faking input move until ping balance

The use of ping after editing a position had broken the book handling:
'go' would be sent in the same batch of commands as this 'ping', so that
in case of a book hit the book move selected on behalf of the engine
would be fed back to XBoard before the engine had the opportunity to
restore the ping balanceby sending 'pong'. Now the book move is fed
through ScheduleDelayedEvent(DeferredBookMove) rather than instantly,
when a MachineWhite/BlackEvent sets the engine playing.

7 years agoFix setting up btm positions with 'edit'
H.G.Muller [Tue, 26 Jul 2016 20:04:14 +0000]
Fix setting up btm positions with 'edit'

The kludge to put black on move through a2a3 only works when there is
a (normally moving) Pawn on a2. Otherwise the 'black' command has to be
used. But this did take the engine out of force mode. So now we send
another 'force' command after this 'black'.

7 years agoFix bare King adjudication
H.G.Muller [Fri, 22 Jul 2016 07:12:36 +0000]
Fix bare King adjudication

The increase of the number of piece types to 66 gave the BlackKing code
131, wich is > 127, so that using a signed char for it makes it < 0.
This cause the black King in the adjudication code to be seen as a white
piece. When black then checkmates with 2 pieces, only 1 piece is seen
(Q), and then assumed to be a bare King! Now the piece value is passed
through an (int) to prevent this.

7 years agoFix check testing in games without King
H.G.Muller [Sun, 17 Jul 2016 21:53:17 +0000]
Fix check testing in games without King

A position without King was always considered as in check (because of
Atomic), which is rather illogical and undesirable in games where no
King participates (as it makes every move illegal).

7 years agoFix disambiguating Pawn moves in Xiangqi
H.G.Muller [Sun, 17 Jul 2016 21:14:10 +0000]
Fix disambiguating Pawn moves in Xiangqi

When multiple Pawns can go to the same square a move written as to-square
only is interpreted as the forward push, rather than a sideway move.

7 years agoFix King leaving Palace in Xiangqi
H.G.Muller [Sun, 17 Jul 2016 21:06:19 +0000]
Fix King leaving Palace in Xiangqi

The rewrite of the move generator had overlooked this.

7 years agoFix compile error Xaw build
H.G.Muller [Mon, 16 May 2016 20:21:36 +0000]
Fix compile error Xaw build

The variable initialSquareSize was not defined in the Xaw build,
and now has been moved to dialogs.h (which is part of both builds).

7 years agoupdates NEWS, Changelog, DIFFSTAT and SHORTLOG
Arun Persaud [Sun, 15 May 2016 17:15:38 +0000]
updates NEWS, Changelog, DIFFSTAT and SHORTLOG

7 years agoupdated po/pot files
Arun Persaud [Sun, 15 May 2016 17:05:40 +0000]
updated po/pot files

7 years agonew version number for release 4.9.0
Arun Persaud [Sun, 15 May 2016 17:03:04 +0000]
new version number for release 4.9.0

7 years agoForgotten header for previous patch
H.G.Muller [Thu, 12 May 2016 13:49:26 +0000]
Forgotten header for previous patch

8 years agoAbbreviate DATADIR to ~~ while saving XB themes
H.G.Muller [Tue, 10 May 2016 19:52:56 +0000]
Abbreviate DATADIR to ~~ while saving XB themes

The path name of theme files is typically quite long in XBoard, where
installed data is very deep in the file-system tree. This path is now
recognized, and replacend by its abbreviation ~~ when storing a theme
in the -themeNames option.

8 years agoFix crash on too-long theme definitions
H.G.Muller [Tue, 10 May 2016 18:46:49 +0000]
Fix crash on too-long theme definitions

Long file names for texture and pieces could make theme definitions
so long as to overflow the buffers used to hold them. The buffer
size is now doubled.

8 years agoFix debris after click-click explosion near board edge
H.G.Muller [Tue, 10 May 2016 18:29:37 +0000]
Fix debris after click-click explosion near board edge

The redrawn grid was not exposed for board edges a knight's jump
away from an explosion square after a click-click capture in variant
atomic. This was due to the smartness in preventing overlapping
exposures of neighboring square, deferring the task to expose the grid
to squares that were beyond the edge. Now all squares in the explosion
range are exposed including grid.

8 years agoFix highlights clearing when highlight last move off
H.G.Muller [Tue, 10 May 2016 18:26:56 +0000]
Fix highlights clearing when highlight last move off

When moves are not highlighted, the selected piece still is. But
this highlight should be erased after the move.

8 years agoFix redrawing of pieces dragged off board (bug #47888)
H.G.Muller [Tue, 10 May 2016 17:42:09 +0000]
Fix redrawing of pieces dragged off board (bug #47888)

The board was not redrawn after a piece was dragged off board,
leaving the piece 'invisibly' in its original position, and also
leaving the target squares marked.

8 years agoDescribe new Edit menu items in texi file
H.G.Muller [Mon, 9 May 2016 05:36:39 +0000]
Describe new Edit menu items in texi file

8 years agoAdd Mute all Sounds menu XB
H.G.Muller [Mon, 9 May 2016 05:08:18 +0000]
Add Mute all Sounds menu XB

XBoard now also has a menu item to mute all sounds (except the Play
button in the Sounds dialog) at the topof the Options menu, like WinBoard.

8 years agoDescribe use of blue highlights in protocol specs
H.G.Muller [Sun, 8 May 2016 18:04:36 +0000]
Describe use of blue highlights in protocol specs

The function of 'blue' markers, and the role of the 'choice' command
in this is explained in the CECP specs.

8 years agoFix forgetting 'choice' command after promotion
H.G.Muller [Sun, 8 May 2016 17:35:10 +0000]
Fix forgetting 'choice' command after promotion

The promotion restriction specified by a 'choice' command is now reset
at the start of every new move, so that future promotion moves won't
use it too. In addition,the 'choice' command is ignored when legality
testing is on.

8 years agoFix description of Tournament Options in texi file
H.G.Muller [Sun, 8 May 2016 12:39:18 +0000]
Fix description of Tournament Options in texi file

Some headers were not exactly equal to the dialog texts because of typos,
frustrating the help clicks. And matchPause was not described at all.

8 years agoFix multi-leg promotions
H.G.Muller [Sat, 7 May 2016 21:33:35 +0000]
Fix multi-leg promotions

Two-leg promotions were sent as gibberish to the engine (and thus
rejected). It was also pretty annoying that XBoard's own idea of
what should be promotions was still applied even when highlighting
denied promotions (because the zone was different than assumed, or
a promotion-on-entry rule applies). Now the legality markers from
the GUI move generator are different from the red and yellow markers
from an engine highlight command, and the latter are taken as a denial
of promotion, and will suppress it.

8 years agoErase markers before processing highlight FEN
H.G.Muller [Sat, 7 May 2016 20:10:34 +0000]
Erase markers before processing highlight FEN

Markers from the Betza generator were only half-heartedly erased when
a color-FEN camein through a highlight command, because FENs tend to
skip empty squares in stretches. This was already fixed for the legal[][]
array, but now it is fixed for the markers itself as well.

8 years agoFix saving of piece colors as part of theme
H.G.Muller [Sat, 7 May 2016 10:13:09 +0000]
Fix saving of piece colors as part of theme

The wrong condition was used for deciding of whether the piece-color
settings were relevant for a theme definition.

8 years agoAllow engine to force user to make non-standard promotion
H.G.Muller [Sat, 7 May 2016 10:06:51 +0000]
Allow engine to force user to make non-standard promotion

The engine can now force an unexpected promotion on moves entered
by the user, by marking the to-square of such a move in blue.
Releasing a piece on such a blue square will then defer further
processing of the move (after having send the 'put' command to the
engine) until reception of a 'choice' command to specify what the
piece should promote to. This solves problems in Maka Dai Dai Shogi,
where a piece capturing a contageous piece would only be allowed to
promote to its normal promoted form if the to-square was marked in
purple (offering a P / +P toggle).

8 years agoFix saving theme
H.G.Muller [Fri, 6 May 2016 05:42:55 +0000]
Fix saving theme

The option -trueColors is now saved with the theme settings when a
pieceImageDirectory was given in XBoard, and the piece colors are
saved when this option is off even with a piece directory. The square
colors are now also saved when useBooardTextures is on, but the textures
are transparent. For this the transparency also had to be made visible in
the WinBoard front end, (by moving the flags for it to backend.c), but
always stay at the default 0 there.

8 years agoFix deferral on sweep promotions
H.G.Muller [Wed, 4 May 2016 13:18:34 +0000]
Fix deferral on sweep promotions

When a sweep in the to-square due to a highlight-induced promotion
had left the original piece as choice, the piece would be considered
to promote to itself (i.e. the move would get the promoChar for its
piece type), rather than to not promote at all. Some engines choked
on this (HaChu). Now such a move is not considered a promotion.

8 years agoImplement -showMoveTime option
H.G.Muller [Sun, 1 May 2016 19:41:40 +0000]
Implement -showMoveTime option

A persistent option -showMoveTime can cause the time thought so far
on the current move to be displayed in the clock field, behind the
time left on the clock, in parentheses.

8 years agoPrevent crash on help-click for engine without manual
H.G.Muller [Fri, 29 Apr 2016 14:16:52 +0000]
Prevent crash on help-click for engine without manual

The error message of "man w xxx" when no man entry for xxx exists
appears on stderr, which is not caught by popen(). As a result the
path to the man file gets set to an empty string, and saveStrCpy
is not so save that it can copy an empty string, but quits XBoard
through an ASSERT in that case.

8 years agoAllow engine to specify holdings larger than board height
H.G.Muller [Thu, 28 Apr 2016 12:36:54 +0000]
Allow engine to specify holdings larger than board height

On reception of a 'setup' command we now automatically increase the
number of board ranks to the holdings size if the latter is larger,
but remember the number of added 'dead ranks'. When parsing a FEN these
ranks are blacked out, and on generating a FEN they are ignored. This
makes FENs behave like the board was not enlarged.

8 years agoImplement two-kanji -inscriptions
H.G.Muller [Thu, 28 Apr 2016 11:24:19 +0000]
Implement two-kanji -inscriptions

When the -inscriptions option specifies a UTF8 string that starts with
the character '2', it will assume the symbols that follow have to be
drawn on the pieces in (vertically stacked) pairs of somewhat smaller
size than it would use for single-character inscriptions. An optional
'1' at the start of the string could be used as an escape to be used
when the first character we want to inscribe would be a '2'.

8 years agoPrevent sending empty line to engine after multi-leg move
H.G.Muller [Wed, 27 Apr 2016 20:22:35 +0000]
Prevent sending empty line to engine after multi-leg move

As the pmoves are stored internally with a linefeed suffixed to them,
this linefeed was mistaken for a promotion character in the multi-leg
printing formats, and led to an extra empty line being sent to the
engine on non-promotion multi-leg moves. Now a linefeed is replaced
by a null character before sending the move.

8 years agoFix piece commands for promoted pieces
H.G.Muller [Wed, 27 Apr 2016 18:34:45 +0000]
Fix piece commands for promoted pieces

The flexible partner assignment had broken the code for 'piece'
commands defining the moves for these pieces, as the promotion
partner was still calculated the old way.

8 years agoFix dragged piece during promotion popup
H.G.Muller [Mon, 25 Apr 2016 16:31:22 +0000]
Fix dragged piece during promotion popup

When dragging to a promotion square, the piece would keep 'hanging'
in the release position while the promotion popup was shown.
(This usually covered it, but not always.) As after a choice is made
the move will be animated, it was more logical to put it back on the
from-square.

8 years agoAdd option -pgnTimeLeft to print clocks in extended PGN info
H.G.Muller [Sun, 24 Apr 2016 20:34:06 +0000]
Add option -pgnTimeLeft to print clocks in extended PGN info

When set a persistent option -pgnTimeLeft makes XBoard save the time
left after the move in the score/depth comments, rather than the time
thought about the move. A leading sign will allow the reader to
distinguish the two. The time is always printed in integer seconds.

8 years agoFix EOF detection in PGN parser
H.G.Muller [Sun, 24 Apr 2016 19:10:06 +0000]
Fix EOF detection in PGN parser

The result of fgetc was stored in a (char) before comparing it with EOF,
which fails badly if the char is not signed.

8 years agoAlter piece images in Spartan Chess
H.G.Muller [Sun, 24 Apr 2016 18:53:47 +0000]
Alter piece images in Spartan Chess

The Captain of Spartain Chess is now represented by the new Tower piece,
so that the Crowned Rook pictogram can be (and is) used for the General,
for better uniformity with other variants.

8 years agoRegularize Chu-Shogi piece assignment
H.G.Muller [Sun, 24 Apr 2016 18:30:38 +0000]
Regularize Chu-Shogi piece assignment

The pieces in Chu Shogi have been reassigned to other internal codes,
so that juggling of images in variant cu is no longer needed. This
became possible by the flexible assignment of promotion partners.
It makes it easier to use Chu Shogi as parent variant without having
to worry about a non-stadard meaning of the -pieceToCharTable.
The built-in move generator had to be changed to work for the new
assignment.

8 years agoAllow group specification in ArgInstall options
H.G.Muller [Sun, 24 Apr 2016 12:00:50 +0000]
Allow group specification in ArgInstall options

The option that add a line to the existing multi-line options
(e.g. -installTheme which adds to -themeNames) now can specify the
line should be added within a group, by prefixing the line with
"# GROUPNAME\n" (where \ and n separate characters). If a group of
that name already exists, the line to add  is insert immediately after
the group header line. If not, the group is created, by adding both the
group header line and the line to add, as well as an "# end" line to
terminate the group.

8 years agoSave programStartTime in settings file rather than save time
H.G.Muller [Sun, 24 Apr 2016 10:30:14 +0000]
Save programStartTime in settings file rather than save time

The -saveDate time stamp is used to decide whether XBoard has seen
options added to the master settings file before. But it looks only
to the master settings file at stratup. So when we save settings we
now put XBoards startup time as -saveDte in it, so that installs
when XBoard was already running would still find their way into the
user settings file.

8 years agoAlso supply shortcut for start directory in GTK file chooser
H.G.Muller [Fri, 22 Apr 2016 09:37:58 +0000]
Also supply shortcut for start directory in GTK file chooser

The first shortcut entry in the Places list is now created for the
directory in which XBoard started (which is $CHESSDIR if that was set).
This is suppressed if it would be a user home directory, as this would
already be in the list by default.

8 years agoFix rounding when sizing 1x1 textures
H.G.Muller [Fri, 22 Apr 2016 07:33:23 +0000]
Fix rounding when sizing 1x1 textures

When 1x1 textures were sized to the actual square size, this could lead
to bitmaps that were 1 pixel too small, presumably because of rounding.
We now add 0.99 pixel to the desired size of the texture image before
calculating the scaling factor (in floating arithmetic) that has to be
passed to the cairo scaling routine, and this seems to solve the problem.

8 years agoLimit prefilling with color to textures with alpha channel
H.G.Muller [Thu, 21 Apr 2016 21:11:25 +0000]
Limit prefilling with color to textures with alpha channel

When loading and preparing a texture we now test the format, and if
the image has an alpha channel we stay on the save side, and always
color the squares before drawing the texture. Only when the format
is not ARGB32 we skip the color fill. (And the default textures
do not have an alpha channel, so at least there no time will be
wasted on pointless color fills.)

8 years agoFix confinement of Advisor in Xiangqi
H.G.Muller [Thu, 21 Apr 2016 20:47:18 +0000]
Fix confinement of Advisor in Xiangqi

Ever since the move-generator rewrite the Advisor could leave the Palace!
Now it can only move in XQ as a normal Ferz when on the board axis, and
everywhere els it can only move to the axis one square from the edge.
This does not generalize in a natural way to larger boards or larger
Palaces.

8 years agoAllow transparency in board textures
H.G.Muller [Thu, 21 Apr 2016 20:14:00 +0000]
Allow transparency in board textures

Rather than coloring the square evenly OR rendering a board texture
cutout we now always do both. Drawing the color will then erase anything
that was on the square before, which is expected behavior, and will then
remain visible where the texture is transparent. Before any transparency
in the texture would leave the old square content (pieces, arrows,
markers) visible.

8 years agoMake EditTags dialog non-wrapping
H.G.Muller [Thu, 21 Apr 2016 17:09:00 +0000]
Make EditTags dialog non-wrapping

As the data edited with this dialog (PGN tags, engine list, theme list,
book moves, ICS menu definition) is always tabular, wrapping the lines
is just confusing, and it is better to have an automatic hscroll in case
the lines are too long to fit.

8 years agoMake preview message in file-chooser title bar a bit clearer
H.G.Muller [Thu, 21 Apr 2016 17:02:05 +0000]
Make preview message in file-chooser title bar a bit clearer

8 years agoAllow skipping to secondary series in -inscriptions string
H.G.Muller [Thu, 21 Apr 2016 11:51:08 +0000]
Allow skipping to secondary series in -inscriptions string

A slash in the UTF8 string of the -inscriptions option now will start
the inscriptions of the pieces from the secondary series. This allows
writing -incription values that will remain valid wehen new pieces would
be added to the end of the primary series.

8 years agoCommit forgotten prototype
H.G.Muller [Thu, 21 Apr 2016 09:44:32 +0000]
Commit forgotten prototype

8 years agoAdd menu item for editing ICS text menu
H.G.Muller [Thu, 21 Apr 2016 08:03:12 +0000]
Add menu item for editing ICS text menu

An item Edit ICS Menu was added in the View menu, and will pop up
the Edit Tags dialog for editing the -icsMenu option that determines
how the ICS Text Menu will look.

8 years agoAdd Edit Themes List menu item XB
H.G.Muller [Thu, 21 Apr 2016 07:26:39 +0000]
Add Edit Themes List menu item XB

The Edit Tags dialog is now also used for editing the -themeName list,
with a menu item in the View menu to pop it up.

8 years agoMake preview resistent to nothing being selected
H.G.Muller [Wed, 20 Apr 2016 21:56:31 +0000]
Make preview resistent to nothing being selected

The name of the selected file could be a null pointer, and ScaleOnePiece
does not like that for a pieceImageDirectory.

8 years agoAdd option -jewelled to decide which King is a Zebra XB
H.G.Muller [Wed, 20 Apr 2016 12:44:13 +0000]
Add option -jewelled to decide which King is a Zebra XB

A new volatile option -jewelled is added, with default value -1.
When it is set to 0 the King image will be replaced by the Zebra image,
when it is 1 the same thing will happen to the black King. This color
testing will be done before the swapping of colors ordered by -flipBlack,
so that the color rather than the side of the (possibly flipped) board
decides which King is displayed as Zebra. (While the board side determines
whether a white or black Zebra will then be used in -flibBlack mode).
Shogi themes can use this by providing a Jewelled General as Zebra (a piece
that was not used in any Shogi variant).

8 years agoPoint out preview in title of file chooser GTK
H.G.Muller [Wed, 20 Apr 2016 09:51:56 +0000]
Point out preview in title of file chooser GTK

8 years agoFix sizing problem in i3wm tiling window manager GTK
H.G.Muller [Wed, 20 Apr 2016 09:31:35 +0000]
Fix sizing problem in i3wm tiling window manager GTK

Apparently i3wm creates a window of different size than the requested one
without sending a configure-event that would allow XBoard to adapt its
board size. This is now fixed by triggering a first configure-event by
hand. The first resize had to no longer be suppressed to make this work.
(This was not needed anymore anyway, as the board size is now protected
during clock resize.) The -fixedSize option had also to be fixed.

8 years agoLet file chooser show preview of textures on board
H.G.Muller [Tue, 19 Apr 2016 18:49:03 +0000]
Let file chooser show preview of textures on board

When browsing for a board texture or piece theme, selecting a file in
the browser will now cause immediate display of the board with that
texture or theme, which will revert if you cancel the choice. Or when
you accept the choice, but cancel the Board dialog.

8 years agoRenamed shogi jewled pieces to zebra
Joshua Pettus [Thu, 21 Apr 2016 03:49:26 +0000]
Renamed shogi jewled pieces to zebra