}
int
-WaitForSecond(DelayedEventCallback retry)
+WaitForEngine(ChessProgramState *cps, DelayedEventCallback retry)
{
- if (second.pr == NULL) {
- StartChessProgram(&second);
- if (second.protocolVersion == 1) {
+ char buf[MSG_SIZ];
+ if (cps->pr == NULL) {
+ StartChessProgram(cps);
+ if (cps->protocolVersion == 1) {
retry();
} else {
/* kludge: allow timeout for initial "feature" command */
FreezeUI();
- DisplayMessage("", _("Starting second chess program"));
+ snprintf(buf, MSG_SIZ, _("Starting %s chess program"), cps->which);
+ DisplayMessage("", buf);
ScheduleDelayedEvent(retry, FEATURE_TIMEOUT);
}
return 1;
TruncateGame(); // [HGM] vari: MachineWhite and MachineBlack do this...
ResurrectChessProgram(); /* in case first program isn't running */
- if(WaitForSecond(TwoMachinesEventIfReady)) return;
+ if(WaitForEngine(&second, TwoMachinesEventIfReady)) return;
if(first.lastPing != first.lastPong) { // [HGM] wait till we are sure first engine has set up position
DisplayMessage("", _("Waiting for first chess program"));
ScheduleDelayedEvent(TwoMachinesEvent, 10);
void TypeInDoneEvent P((char *move));
void InitPosition P((int redraw));
void NewSettingEvent P((int option, int *feature, char *command, int value));
-int WaitForSecond P((DelayedEventCallback x));
void SettingsMenuIfReady P((void));
void DoEcho P((void));
void DontEcho P((void));
extern int opponentKibitzes; // used by wengineo.c
extern int errorExitStatus;\r
void SettingsPopUp P((ChessProgramState *cps)); // [HGM] really in front-end, but CPS not known in frontend.h
+int WaitForEngine P((ChessProgramState *cps, DelayedEventCallback x));
#endif /* _BACKEND */
\r
case IDM_Engine2Options:\r
savedHwnd = hwnd;\r
- if(WaitForSecond(SettingsMenuIfReady)) break;\r
+ if(WaitForEngine(&second, SettingsMenuIfReady)) break;\r
EngineOptionsPopup(hwnd, &second);\r
break;\r
\r