Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBruno Coudoin <bcoudoin@src.gnome.org>2003-06-27 17:26:30 (GMT)
committer Bruno Coudoin <bcoudoin@src.gnome.org>2003-06-27 17:26:30 (GMT)
commit0cd493055d0807fec810cf997617820a33eb003a (patch)
tree38afbd073a0295fb9d37784a1a02b1b0e731ca65 /src
parent935cc77c6cf836e036493be2b4c41b732c43d2f6 (diff)
release 3.2 fixed bug with gnuchess above 5.05 and 5.06 with these
release 3.2 fixed bug with gnuchess above 5.05 and 5.06 with these gnuchess, gcompris was not able to play chess. Simon Waters <Simon@wretched.demon.co.uk> who maintains gnuchess tell me it should be fixed in 5.07
Diffstat (limited to 'src')
-rw-r--r--src/boards/chess.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/boards/chess.c b/src/boards/chess.c
index 7497d10..6221231 100644
--- a/src/boards/chess.c
+++ b/src/boards/chess.c
@@ -395,7 +395,7 @@ static GnomeCanvasItem *chess_create_item(GnomeCanvasGroup *parent)
gshort rank;
gboolean white_side = TRUE;
guint empty_case = 0;
-
+ gboolean need_slash = TRUE;
boardRootItem = GNOME_CANVAS_GROUP(
gnome_canvas_item_new (gnome_canvas_root(gcomprisBoard->canvas),
@@ -430,12 +430,13 @@ static GnomeCanvasItem *chess_create_item(GnomeCanvasGroup *parent)
}
}
- /* Enter the gnuchessx edit mode */
+ /* Enter the gnuchess edit mode */
write_child (write_chan, "force\n");
write_child (write_chan, "new\n");
write_child (write_chan, "setboard ");
empty_case = 0;
+ need_slash = FALSE;
/* Display the pieces */
for (rank = 8; rank >= 1; rank--) {
@@ -459,9 +460,16 @@ static GnomeCanvasItem *chess_create_item(GnomeCanvasGroup *parent)
temp = san;
square_to_ascii (&temp, square);
// printf ( "%c%s\n", piece_to_ascii(piece), san);
+
+ if(need_slash)
+ {
+ write_child (write_chan, "/");
+ need_slash = FALSE;
+ }
+
if(piece!=NONE)
{
-
+
if(white_side && BPIECE(piece) ||
!white_side && WPIECE(piece))
{
@@ -487,7 +495,7 @@ static GnomeCanvasItem *chess_create_item(GnomeCanvasGroup *parent)
empty_case=0;
- write_child (write_chan, "/");
+ need_slash = TRUE;
}
temp = san;
@@ -525,7 +533,7 @@ static GnomeCanvasItem *chess_create_item(GnomeCanvasGroup *parent)
}
/* Quit the gnuchessx edit mode */
- write_child (write_chan, " w KQkq - 0 1\n");
+ write_child (write_chan, " w KQkq\n");
display_white_turn(TRUE);