X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=args.h;h=147f8bb1ecc83203a8554dd18ba529c7deed7bb7;hb=08aa97a16435e4569975d203c7e1f3050b207d8a;hp=6e3c3aca06b8abd30c99351960bd8ebe6b235d92;hpb=395642a0ccce8adbc55d4c8ff58780ab07c12813;p=xboard.git diff --git a/args.h b/args.h index 6e3c3ac..147f8bb 100644 --- a/args.h +++ b/args.h @@ -215,6 +215,8 @@ ArgDescriptor argDescriptors[] = { { "pixmap", ArgFilename, (void *) &appData.pixmapDirectory, FALSE, INVALID }, { "bitmapDirectory", ArgFilename, (void *) &appData.bitmapDirectory, XBOARD, (ArgIniType) "" }, { "bm", ArgFilename, (void *) &appData.bitmapDirectory, FALSE, INVALID }, + { "pngDirectory", ArgFilename, (void *) &appData.pngDirectory, XBOARD, (ArgIniType) "" }, + { "png", ArgFilename, (void *) &appData.pngDirectory, FALSE, INVALID }, { "soundDirectory", ArgFilename, (void *) &appData.soundDirectory, XBOARD, (ArgIniType) "" }, { "msLoginDelay", ArgInt, (void *) &appData.msLoginDelay, XBOARD, (ArgIniType) MS_LOGIN_DELAY }, { "pasteSelection", ArgBoolean, (void *) &appData.pasteSelection, XBOARD, (ArgIniType) FALSE }, @@ -230,7 +232,7 @@ ArgDescriptor argDescriptors[] = { { "td", ArgFloat, (void *) &appData.timeDelay, FALSE, INVALID }, { "timeControl", ArgString, (void *) &appData.timeControl, TRUE, (ArgIniType) TIME_CONTROL }, { "tc", ArgString, (void *) &appData.timeControl, FALSE, INVALID }, - { "timeIncrement", ArgFloat, (void *) &appData.timeIncrement, TRUE, INVALID }, + { "timeIncrement", ArgFloat, (void *) &appData.timeIncrement, FALSE, INVALID }, { "inc", ArgFloat, (void *) &appData.timeIncrement, FALSE, INVALID }, { "internetChessServerMode", ArgBoolean, (void *) &appData.icsActive, FALSE, INVALID }, { "ics", ArgTrue, (void *) &appData.icsActive, FALSE, (ArgIniType) FALSE }, @@ -1274,7 +1276,7 @@ InitAppData(char *lpCmdLine) // float: casting to int is not harmless, so default cannot be contained in table appData.timeDelay = TIME_DELAY; - appData.timeIncrement = TIME_INCREMENT; + appData.timeIncrement = -314159; // some complex, platform-dependent stuff that could not be handled from table SetDefaultTextAttribs(); @@ -1289,8 +1291,8 @@ InitAppData(char *lpCmdLine) if(appData.viewer && appData.viewerOptions[0]) ParseArgsFromString(appData.viewerOptions); if(appData.tourney && appData.tourneyOptions[0]) ParseArgsFromString(appData.tourneyOptions); - chessProgram = GetEngineLine(firstEngineLine, 0) || GetEngineLine(secondEngineLine, 1); - appData.icsActive = GetEngineLine(icsNick, 10); + chessProgram |= GetEngineLine(firstEngineLine, 0) || GetEngineLine(secondEngineLine, 1); + appData.icsActive |= GetEngineLine(icsNick, 10); /* [HGM] make sure board size is acceptable */ if(appData.NrFiles > BOARD_FILES || @@ -1342,6 +1344,12 @@ InitAppData(char *lpCmdLine) if (appData.icsActive || appData.noChessProgram) { chessProgram = FALSE; /* not local chess program mode */ } + if(appData.timeIncrement == -314159) { // new storage mechanism of (mps,inc) in use and no -inc on command line + if(appData.movesPerSession <= 0) { // new encoding of incremental mode + appData.timeIncrement = -appData.movesPerSession/1000.; + } else appData.timeIncrement = -1; + } + if(appData.movesPerSession <= 0) appData.movesPerSession = MOVES_PER_SESSION; // mps <= 0 is invalid in any case /* Open startup dialog if needed */ if ((!appData.noChessProgram && !chessProgram && !appData.icsActive) || @@ -1387,6 +1395,7 @@ SaveSettings(char* name) FILE *f; ArgDescriptor *ad; char dir[MSG_SIZ], buf[MSG_SIZ]; + int mps = appData.movesPerSession; if (!MainWindowUp()) return; @@ -1425,6 +1434,8 @@ SaveSettings(char* name) // [HGM] in WB we have to copy sound names to appData first ExportSounds(); + if(appData.timeIncrement >= 0) appData.movesPerSession = -1000*appData.timeIncrement; // kludge to store mps & inc as one + for (ad = argDescriptors; ad->argName != NULL; ad++) { if (!ad->save) continue; switch (ad->argType) { @@ -1506,6 +1517,7 @@ SaveSettings(char* name) } } fclose(f); + appData.movesPerSession = mps; } Boolean