From 1ca090e2fb7babbd670f629292137eb0cc890e89 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Thu, 29 Nov 2012 20:25:35 +0100 Subject: [PATCH] Load opponent logo based on handle in ICS play (WB) The logos for handles on FICS are sought in folder logos\freeches.org\*.bmp, etc. If no logo for the handle is found there, the logo of the ICS is displayed as usual. --- winboard/winboard.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/winboard/winboard.c b/winboard/winboard.c index cc4b5a9..88092ac 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -1006,8 +1006,14 @@ LoadLogo(ChessProgramState *cps, int n, Boolean ics) } } else if(appData.autoLogo) { if(ics) { // [HGM] logo: in ICS mode second can be used for ICS - sprintf(buf, "logos\\%s.bmp", appData.icsHost); - cps->programLogo = LoadImage( 0, buf, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE ); + char *opponent = ""; + if(gameMode == IcsPlayingWhite) opponent = gameInfo.black; + if(gameMode == IcsPlayingBlack) opponent = gameInfo.white; + sprintf(buf, "logos\\%s\\%s.bmp", appData.icsHost, opponent); + if(!*opponent || !(cps->programLogo = LoadImage( 0, buf, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE ))) { + sprintf(buf, "logos\\%s.bmp", appData.icsHost); + cps->programLogo = LoadImage( 0, buf, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE ); + } } else if(appData.directory[n] && appData.directory[n][0]) { SetCurrentDirectory(appData.directory[n]); -- 1.7.0.4