X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=pgntags.c;h=f13eb963cd7dacdb7e30fe2dea6a3a0c560f2b80;hb=f0f8c2c30e7f5696c8f1d4a8a97f22da5987de92;hp=74e449567306e3be12b3740b077a77255d789630;hpb=c37d45adc7d98a702a7459ccdc0ac23df01a476e;p=xboard.git diff --git a/pgntags.c b/pgntags.c index 74e4495..f13eb96 100644 --- a/pgntags.c +++ b/pgntags.c @@ -114,8 +114,11 @@ ParsePGNTag (char *tag, GameInfo *gameInfo) success = TRUE; } else if (StrCaseCmp(name, "Variant") == 0) { /* xboard-defined extension */ + success = StrSavePtr(value, &gameInfo->variantName) != NULL; gameInfo->variant = StringToVariant(value); - success = TRUE; + } else if (StrCaseCmp(name, "VariantMen") == 0) { + /* for now ignore this tag, as we have no method yet */ + /* for assigning the pieces to XBoard pictograms */ } else if (StrCaseCmp(name, PGN_OUT_OF_BOOK) == 0) { /* [AS] Out of book annotation */ success = StrSavePtr(value, &gameInfo->outOfBook) != NULL; @@ -144,6 +147,7 @@ ParsePGNTag (char *tag, GameInfo *gameInfo) void PrintPGNTags (FILE *fp, GameInfo *gameInfo) { + char *p; fprintf(fp, "[Event \"%s\"]\n", gameInfo->event ? gameInfo->event : "?"); fprintf(fp, "[Site \"%s\"]\n", gameInfo->site ? gameInfo->site : "?"); fprintf(fp, "[Date \"%s\"]\n", gameInfo->date ? gameInfo->date : "?"); @@ -159,6 +163,8 @@ PrintPGNTags (FILE *fp, GameInfo *gameInfo) fprintf(fp, "[TimeControl \"%s\"]\n", gameInfo->timeControl); if (gameInfo->variant != VariantNormal) fprintf(fp, "[Variant \"%s\"]\n", VariantName(gameInfo->variant)); + if (*(p = CollectPieceDescriptors())) + fprintf(fp, "[VariantMen \"%s\"]\n", p); if (gameInfo->extraTags) fputs(gameInfo->extraTags, fp); }