Customize chessboard w/ colored squares highlighting control

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

Customize chessboard w/ colored squares highlighting control

Postby karmikovic » 04 Feb 2020, 23:02

Hello everyone,
I am new to these forums. My goal is to get help or tips on what must be done to customize winboard so that areas under white control will be one color and areas under black control will be another color.

Does anyone have a link to the winboard source? Also what file should be edited, and/or examples of code to get such desired behavior?

Any help would be greatly appreciated!
karmikovic
 
Posts: 2
Joined: 30 Jan 2020, 18:18

Re: Customize chessboard w/ colored squares highlighting con

Postby karmikovic » 04 Feb 2020, 23:14

I am under the assumption that winboard is a collective of components, one of which (for chess) is xboard. I downloaded xboard snapshot from here: http://hgm.nubati.net/cgi-bin/gitweb.cg ... a=shortlog, (the most recent version dated 2016-06-04) and unzipped the tar.gz.

I am assuming the file needing editing for my goal of colored squares highlighting control would be found within xboard, is this right?
karmikovic
 
Posts: 2
Joined: 30 Jan 2020, 18:18

Re: Customize chessboard w/ colored squares highlighting con

Postby H.G.Muller » 17 Feb 2020, 21:39

Sorry for the late reply; I overlooked your posting until now.

That tar ball contains both the source code of XBoard and WinBoard. These share a lot of code, the so-called 'back-end', most source files in the root directory. But there are various 'front-ends', one for Windows, in the winboard directory, and two for Linux / OSX, in the gtk and xaw directories. To compile WinBoard you would go to the winboard folder and run "make -f makefile.gcc" there. This would combine the winboard/*.c files with the back-end *.c files in the root into a single Windows .exe file.

The function that draws the board is DrawPosition() in the file winboard/winboard.c. This calls DrawBoardOnDC(), which in a loop over squares at some point calculates a square_color as 0 or 1. This is passed to DrawPieceOnDC() to specify whether the background color should be the lightSquareColor or dakSquareColor.
User avatar
H.G.Muller
 
Posts: 3208
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 3 guests