From: H.G. Muller Date: Thu, 29 Nov 2012 19:25:35 +0000 (+0100) Subject: Load opponent logo based on handle in ICS play (WB) X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=1ca090e2fb7babbd670f629292137eb0cc890e89;p=xboard.git 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. --- 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]);