X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwinboard.c;h=1c41752fdb4f59b4bb47ebbf55a06378190f3ecc;hb=4d54c79829d19389bcb7fa5000f76cfe7a0aaf36;hp=df3a37fb9b932fc80ba866bd4779653efa773d37;hpb=74506c0e852b35465c651f331e010ca7e60e7dd3;p=xboard.git diff --git a/winboard/winboard.c b/winboard/winboard.c index df3a37f..1c41752 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -5,7 +5,7 @@ * Massachusetts. * * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, - * 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. + * 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. * * Enhancements Copyright 2005 Alessandro Scotti * @@ -296,7 +296,7 @@ int dialogItems[][42] = { OPT_ChooseTellColor, OPT_ChooseChallengeColor, OPT_ChooseRequestColor, OPT_ChooseSeekColor, OPT_ChooseNormalColor, OPT_ChooseBackgroundColor, OPT_DefaultColors, OPT_DontColorize, IDC_Boxes, GPB_Colors, GPB_Premove, - GPB_General, GPB_Alarm }, + GPB_General, GPB_Alarm, OPT_AutoCreate }, { DLG_BoardOptions, IDOK, IDCANCEL, OPT_SizeTiny, OPT_SizeTeeny, OPT_SizeDinky, OPT_SizePetite, OPT_SizeSlim, OPT_SizeSmall, OPT_SizeMediocre, OPT_SizeMiddling, OPT_SizeAverage, OPT_SizeModerate, OPT_SizeMedium, OPT_SizeBulky, OPT_SizeLarge, @@ -1063,6 +1063,7 @@ InitInstance(HINSTANCE hInstance, int nCmdShow, LPSTR lpCmdLine) if (SearchPath(NULL, "WinBoard.exe", NULL, MSG_SIZ, installDir, &filepart)) { *filepart = NULLCHAR; + SetCurrentDirectory(installDir); } else { GetCurrentDirectory(MSG_SIZ, installDir); } @@ -1279,6 +1280,7 @@ ParseFontName(char *name, MyFontParams *mfp) p = q + 1; } else { q = mfp->faceName; + while (*p && !isdigit(*p)) { *q++ = *p++; if (q - mfp->faceName >= sizeof(mfp->faceName)) @@ -3351,7 +3353,7 @@ DrawBackgroundOnDC(HDC hdc) HDC tmphdc; HBITMAP hbm; static char oldBorder[MSG_SIZ]; - int w = 600, h = 600; + int w = 600, h = 600, mode; if(strcmp(appData.border, oldBorder)) { // load new one when old one no longer valid strncpy(oldBorder, appData.border, MSG_SIZ-1); @@ -3367,8 +3369,10 @@ DrawBackgroundOnDC(HDC hdc) w = bi.bmWidth; h = bi.bmHeight; } + mode = SetStretchBltMode(hdc, COLORONCOLOR); StretchBlt(hdc, boardRect.left, boardRect.top, boardRect.right - boardRect.left, boardRect.bottom - boardRect.top, tmphdc, 0, 0, w, h, SRCCOPY); + SetStretchBltMode(hdc, mode); SelectObject(tmphdc, hbm); DeleteDC(tmphdc); } @@ -4254,6 +4258,7 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) } shiftKey = GetKeyState(VK_SHIFT) < 0; // [HGM] remember last shift status + controlKey = GetKeyState(VK_CONTROL) < 0; // [HGM] remember last shift status switch (message) { case WM_LBUTTONDOWN: @@ -4676,7 +4681,6 @@ WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) FILE *f; UINT number; char fileTitle[MSG_SIZ]; - char buf[MSG_SIZ]; static SnapData sd; static int peek=0;