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