xboard.git
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

8 years agoUpdate ru.po translation
Joshua Pettus [Wed, 20 Apr 2016 20:51:49 +0000]
Update ru.po translation

8 years agoProvide item-by-item description of ICS Chat in texi file
H.G.Muller [Sun, 17 Apr 2016 08:16:26 +0000]
Provide item-by-item description of ICS Chat in texi file

8 years agoProvide help clicks on recently-used-engines menu items
H.G.Muller [Sun, 17 Apr 2016 08:13:38 +0000]
Provide help clicks on recently-used-engines menu items

The items for recently used engines in the Engine menu are now recognized
as such, and will look for help on "Recently Used Engines" rather than
on the item text (which is the engine name).

8 years agoUse missing SVG from parent if -pid name starts with sub_
H.G.Muller [Sun, 17 Apr 2016 08:05:39 +0000]
Use missing SVG from parent if -pid name starts with sub_

If the current piece-image directory's name starts with "sub_", any
pieces not found in it will be searched in the parent directory.
This allows variants that need just a few pieces of a theme changed
to get their own sub_xxx sub-directory within the directory with SVG
images, containing the deviating SVGs. This will work recursively.

8 years agoFix one-click moving with engine-define and wild-card pieces
H.G.Muller [Sun, 17 Apr 2016 07:32:40 +0000]
Fix one-click moving with engine-define and wild-card pieces

In the disambiguation routine wild-card pieces were still treated as
special even when explicit moves were defined for them. In addition,
Disambiguate would try native XBoard piece motion for resolving ambiguous
moves, which is sensible for parsing SAN (which might be saved by an old
version of XBoard), but wrecks one-click moving.

8 years agoImprove resize/co-dragging GTK
H.G.Muller [Mon, 11 Apr 2016 18:44:27 +0000]
Improve resize/co-dragging GTK

The reconfigure event of the main board is not processed directly,
but sets a timeout to call the actual handler, which will be restarted
when new reconfigure events occur during the timeout period. This makes
that the (very timeconsuming) redrawing and moving of all windows
will only be done if the stream of events dries up.
  Unfortunately the ReSize routine called as part of the handling needs
to be interruptable, which can cause recursive calling of the reconfigure
handler. A variable 'busy' would ignore such recursion, but at the price
of missing the interrupting event completely. The attempted fix to set
a new timeout was flawed, as delayedDragTag would not have been cleared
at that point. So we threw it out. Now 'busy' is a counter, which will
remember if there were ignored recursion attempts, and then makes these
into a harmless tail recursion, to do the resize/drag once more, based
on the latest window parameters.

8 years agoFix size collapse to 0 after too-small sizing
H.G.Muller [Sun, 10 Apr 2016 17:42:47 +0000]
Fix size collapse to 0 after too-small sizing

The test for the end of the sizeDefaults list was one off, so that
a too-small size request would be rounded to a size just behind
the table, where there is an all-zero sentinel element.

8 years agoAlso put themes and textures in file chooser GTK
H.G.Muller [Sat, 9 Apr 2016 21:40:54 +0000]
Also put themes and textures in file chooser GTK

The themes and textures folders are now also directly listed amongst
the 'Places' shortcuts in the GTK file chooser.

8 years agoAdd DATADIR as shortcut folder to file chooser
H.G.Muller [Sat, 9 Apr 2016 20:47:18 +0000]
Add DATADIR as shortcut folder to file chooser

The file chooser invoked by a dialog Browse button now puts XBoard's
DATADIR amongst the shortcuts in the 'Places' list, so you can navigate
there with a single mouse click.

8 years agoFix browsing for folders, and allow starting in DATADIR
H.G.Muller [Sat, 9 Apr 2016 18:12:26 +0000]
Fix browsing for folders, and allow starting in DATADIR

The previous path seemed to cause a segfault when browsing for a folder
with an empty text-edit. In addition there existed a bug for browsing
from the Engine Settings dialog, where the value of the option was taken
as a filter. Both are fixed now.
 The Option.textValue field, which for FileName Options holds the filter,
for PatName Options could be NULL or "". The latter is now taken to
mean that browsing should start in DATADIR, and is only used when
browsing for sound files or pieceImageDir with empty pathname field.

8 years agoStart button-activated browse near old field contents GTK
H.G.Muller [Sat, 9 Apr 2016 15:29:12 +0000]
Start button-activated browse near old field contents GTK

The file chooser activated by Browse buttons for filling a File or Path
text edit started in the last directory it visited for that file type.
But for the initial browse after startup it started in the current
directory. Now it starts in the directory derived from the filaname
currently in the text edit, if there is one, and only in the last-
visited directory for the file type if the text-edit was empty.

8 years agoExtend full-board textures by periodic tiling (XB)
H.G.Muller [Sat, 9 Apr 2016 14:30:20 +0000]
Extend full-board textures by periodic tiling (XB)

Texture images with an -NxM suffix to their name are scaled to match
that number of squares before cutting squares out of them. But if the
actual board was larger than NxM the remaining squares fell outside the
image and remained white. Now the cutting area is mapped back into
the image, effectively behaving as if it is periodically tiling the
entire plane.

8 years agoMention support for Arena960 protocol with USI/UCCI checkbox WB
H.G.Muller [Thu, 7 Apr 2016 20:14:54 +0000]
Mention support for Arena960 protocol with USI/UCCI checkbox WB

Normally the -uxiAdapter option would be configured to use UCI2WB,
and in the binary distribution of WinBoard it certainly will be.
As UCI2WB now supports the UCI dialect Arena uses to play Chess960,
people can use the USI/UCCI checkbox also for Chess960 engines that
use that protocol, and the checkbox label now points that out.

8 years agoFinish castling and e.p. rights for Edit Position
H.G.Muller [Thu, 7 Apr 2016 17:34:20 +0000]
Finish castling and e.p. rights for Edit Position

In stead of faking rights based on corner positioning of Rooks and
e-file King, EditPositionDone now interprets the rightsBoard that
recorded 'promotion clicks' on King, Rooks or Pawns to toggle their
rights. This rightsBoard is initialized from the castling rights in
the position that is being edited, and the clear and piece-pallette
boards now also set these castling rights correctly.

8 years agoDescribe Common Engine dialog item-by-item in texi file
H.G.Muller [Wed, 6 Apr 2016 16:22:46 +0000]
Describe Common Engine dialog item-by-item in texi file

This had not been done yet, so that help clicks in the dialog did
not retrieve any help.

8 years agoFix history/eng.out font setting on sizing and other bug
H.G.Muller [Wed, 6 Apr 2016 14:44:13 +0000]
Fix history/eng.out font setting on sizing and other bug

The coord font was set with the historyFont value, and when a valid
font was taken from the fontTable, fontIsSet was not set.

8 years agoApply fonts in 'other windows' after sizing
H.G.Muller [Wed, 6 Apr 2016 14:08:24 +0000]
Apply fonts in 'other windows' after sizing

8 years agoStore fonts changed by font dialog in fonts table
H.G.Muller [Wed, 6 Apr 2016 13:45:11 +0000]
Store fonts changed by font dialog in fonts table

The fonts table holds fonts per type and size that should be saved
in the settings file because they were either read from it, or explicitly
specified by the user on the command line. This now also holds for
fonts altered through the Fonts dialog, without waiting for the saving
of settings, because by that time the boardSize might already be different.

8 years agoOnly save fonts that are not defaults
H.G.Muller [Wed, 6 Apr 2016 12:38:43 +0000]
Only save fonts that are not defaults

When the font in use is a (size-adapted) default, we don't save
it in the settings file.

8 years agoConditionally replace 'other-window' fonts on sizing
H.G.Muller [Wed, 6 Apr 2016 12:25:19 +0000]
Conditionally replace 'other-window' fonts on sizing

Fonts not used in the main window (i.e. other than clock, coord and
message) are now also adjusted on sizing, but not when this would
mean replacing an explicitly specified font by a default one.
If we size to a boardSize for which a font was specified earlier,
we always switch to the latter, and if we were merely using the
default font for the old size we switch to the default font for
the new size rather than keeping it.

8 years agoReset fontIsSet when sizing causes change to default font
H.G.Muller [Wed, 6 Apr 2016 12:08:49 +0000]
Reset fontIsSet when sizing causes change to default font

The array fontIsSet now tracks whether the fonts in actual use are
from a (possibly size-adapted) default, or were specified by an option
(also through a fontIsValid entry in the fontsTable) or the Fonts dialog.
For changing a font on sizing a subroutine is now used.

8 years agoFix bold button fix
H.G.Muller [Wed, 6 Apr 2016 12:08:23 +0000]
Fix bold button fix