if (*y < minY) *y = minY;\r
}\r
\r
+VOID\r
+LoadLogo(ChessProgramState *cps, int n)\r
+{\r
+ if( appData.logo[n] && appData.logo[n][0] != NULLCHAR) {\r
+ cps->programLogo = LoadImage( 0, appData.logo[n], IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE );\r
+\r
+ if (cps->programLogo == NULL && appData.debugMode) {\r
+ fprintf( debugFP, "Unable to load logo bitmap '%s'\n", appData.logo[n] );\r
+ }\r
+ } else if(appData.autoLogo) {\r
+ if(appData.firstDirectory && appData.directory[n][0]) {\r
+ char buf[MSG_SIZ];\r
+ snprintf(buf, MSG_SIZ, "%s/logo.bmp", appData.directory[n]);\r
+ cps->programLogo = LoadImage( 0, buf, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE ); \r
+ }\r
+ }\r
+}\r
+\r
BOOL\r
InitInstance(HINSTANCE hInstance, int nCmdShow, LPSTR lpCmdLine)\r
{\r
}\r
\r
/* [HGM] logo: Load logos if specified (must be done before InitDrawingSizes) */\r
- if( appData.firstLogo && appData.firstLogo[0] != NULLCHAR) {\r
- first.programLogo = LoadImage( 0, appData.firstLogo, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE );\r
-\r
- if (first.programLogo == NULL && appData.debugMode) {\r
- fprintf( debugFP, "Unable to load logo bitmap '%s'\n", appData.firstLogo );\r
- }\r
- } else if(appData.autoLogo) {\r
- if(appData.firstDirectory && appData.firstDirectory[0]) {\r
- char buf[MSG_SIZ];\r
- snprintf(buf, MSG_SIZ, "%s/logo.bmp", appData.firstDirectory);\r
- first.programLogo = LoadImage( 0, buf, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE ); \r
- }\r
- }\r
+ LoadLogo(&first, 0);\r
\r
if( appData.secondLogo && appData.secondLogo[0] != NULLCHAR) {\r
second.programLogo = LoadImage( 0, appData.secondLogo, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE );\r
* dir relative to the directory WinBoard loaded from. */\r
GetCurrentDirectory(MSG_SIZ, buf);\r
SetCurrentDirectory(installDir);\r
+ // kludgey way to update logos in tourney, as long as back-end can't do it\r
+ if(!strcmp(cmdLine, first.program)) LoadLogo(&first, 0); else\r
+ if(!strcmp(cmdLine, second.program)) LoadLogo(&second, 1);\r
SetCurrentDirectory(dir);\r
\r
/* Now create the child process. */\r