From 588392561ee7fad1e1dc85a22954976292c46ff9 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Wed, 5 Aug 2015 22:40:40 +0200 Subject: [PATCH] Let color of inscription depend on piece ID Only shogi-promoted piece types (with ID defined as +) will get their inscription rendered in red. --- backend.h | 1 + draw.c | 2 +- moves.h | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend.h b/backend.h index 40e32a4..4a2ef33 100644 --- a/backend.h +++ b/backend.h @@ -217,6 +217,7 @@ void ics_printf P((char *format, ...)); int GetEngineLine P((char *nick, int engine)); void AddGameToBook P((int always)); void FlushBook P((void)); +char PieceToChar P((ChessSquare p)); char *StrStr P((char *string, char *match)); char *StrCaseStr P((char *string, char *match)); diff --git a/draw.c b/draw.c index a3edf78..2419576 100644 --- a/draw.c +++ b/draw.c @@ -803,7 +803,7 @@ InscribeKanji (ChessSquare piece, int x, int y) strncpy(buf, p, 10); for(q=buf; (*++q & 0xC0) == 0x80;); *q = NULLCHAR; - DrawText(buf, x, y, (n > WhiteLion ? -2 : -1) - black); + DrawText(buf, x, y, (PieceToChar(n) == '+' ? -2 : -1) - black); } void diff --git a/moves.h b/moves.h index 3c35232..aeb6307 100644 --- a/moves.h +++ b/moves.h @@ -55,7 +55,6 @@ extern ChessSquare PromoPiece P((ChessMove moveType)); extern ChessMove PromoCharToMoveType P((int whiteOnMove, int promoChar)); -extern char PieceToChar P((ChessSquare p)); extern char PieceSuffix P((ChessSquare p)); extern ChessSquare CharToPiece P((int c)); extern int PieceToNumber P((ChessSquare p)); -- 1.7.0.4