Add image of ducky to WinBoard
authorH.G.Muller <hgm@hgm-xboard.(none)>
Sun, 6 Nov 2022 11:35:12 +0000 (12:35 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Sun, 6 Nov 2022 11:35:12 +0000 (12:35 +0100)
Duck Chess needs to display a duck for a DarkSquare.

winboard/bitmaps/ducky33.bmp [new file with mode: 0644]
winboard/bitmaps/ducky49.bmp [new file with mode: 0644]
winboard/bitmaps/ducky72.bmp [new file with mode: 0644]
winboard/winboard.c
winboard/winboard.rc

diff --git a/winboard/bitmaps/ducky33.bmp b/winboard/bitmaps/ducky33.bmp
new file mode 100644 (file)
index 0000000..28a32f7
Binary files /dev/null and b/winboard/bitmaps/ducky33.bmp differ
diff --git a/winboard/bitmaps/ducky49.bmp b/winboard/bitmaps/ducky49.bmp
new file mode 100644 (file)
index 0000000..2749791
Binary files /dev/null and b/winboard/bitmaps/ducky49.bmp differ
diff --git a/winboard/bitmaps/ducky72.bmp b/winboard/bitmaps/ducky72.bmp
new file mode 100644 (file)
index 0000000..98d9d41
Binary files /dev/null and b/winboard/bitmaps/ducky72.bmp differ
index 5235ca0..e7542ad 100644 (file)
@@ -2342,7 +2342,7 @@ ResizeBoard(int newSizeX, int newSizeY, int flags)
   recurse--;\r
 }\r
 \r
-\r
+static HBITMAP ducky;\r
 extern Boolean twoBoards, partnerUp; // [HGM] dual\r
 \r
 VOID\r
@@ -2769,6 +2769,7 @@ InitDrawingSizes(BoardSize boardSize, int flags)
     pieceBitmap[0][WhiteGnu] = DoLoadBitmap(hInst, "gnu", squareSize, "s");\r
     pieceBitmap[1][WhiteGnu] = DoLoadBitmap(hInst, "gnu", squareSize, "o");\r
     pieceBitmap[2][WhiteGnu] = DoLoadBitmap(hInst, "gnu", squareSize, "w");\r
+    if(gameInfo.variant == VariantDuck) { char name[20]; sprintf(name, " ducky%d", squareSize); ducky = LoadBitmap(hInst, name); }\r
 \r
     if(gameInfo.variant == VariantShogi && BOARD_HEIGHT != 7) { /* promoted Gold representations (but not in Tori!)*/\r
       pieceBitmap[0][WhiteCannon] = DoLoadBitmap(hInst, "wp", squareSize, "s");\r
@@ -3607,8 +3608,13 @@ DrawBoardOnDC(HDC hdc, Board board, HDC tmphdc)
             DisplayHoldingsCount(hdc, x, y, flipView, (int) board[row][column]);\r
       else if( column == BOARD_RGHT) /* right align */\r
             DisplayHoldingsCount(hdc, x, y, !flipView, (int) board[row][column]);\r
-      else if( piece == DarkSquare) DisplayHoldingsCount(hdc, x, y, 0, 0);\r
-      else\r
+      else if( piece == DarkSquare) {\r
+            if(gameInfo.variant == VariantDuck && ducky) {\r
+                 HBITMAP oldBitmap = SelectObject(tmphdc, ducky);\r
+                 BitBlt( hdc, x, y, squareSize, tmphdc, 0, 0, SRCPAINT );\r
+                 SelectObject(tmphdc, oldBitmap);\r
+            } else DisplayHoldingsCount(hdc, x, y, 0, 0);\r
+      } else\r
       if (appData.monoMode) {\r
         if (piece == EmptySquare) {\r
           BitBlt(hdc, x, y, squareSize, squareSize, 0, 0, 0,\r
index 2042dcc..91ddc7f 100644 (file)
@@ -2131,6 +2131,9 @@ A64S                    BITMAP  MOVEABLE PURE   "bitmaps/a64s.bmp"
 L64S                    BITMAP  MOVEABLE PURE   "bitmaps/l64s.bmp"\r
 C64S                    BITMAP  MOVEABLE PURE   "bitmaps/c64s.bmp"\r
 CV64S                   BITMAP  MOVEABLE PURE   "bitmaps/cv64s.bmp"\r
+DUCKY33                 BITMAP  MOVEABLE PURE   "bitmaps/ducky33.bmp"\r
+DUCKY49                 BITMAP  MOVEABLE PURE   "bitmaps/ducky49.bmp"\r
+DUCKY72                 BITMAP  MOVEABLE PURE   "bitmaps/ducky72.bmp"\r
 \r
 SP58O                   BITMAP  MOVEABLE PURE   "shogibitmaps/sp58o.bmp"\r
 SN58O                   BITMAP  MOVEABLE PURE   "shogibitmaps/sn58o.bmp"\r