Advances fpchess up to being able to draw the board and tiles, and adds the tile images.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1324 8e941d3f-bd1b-0410-a28a-d453659cc2b4
@ -5,8 +5,8 @@ unit chessdrawer;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Controls, Graphics, LCLType,
|
||||
//
|
||||
Classes, SysUtils, Controls, Graphics, LCLType, IntfGraphics, fpimage,
|
||||
Math,
|
||||
chessgame, chessconfig;
|
||||
|
||||
type
|
||||
@ -15,17 +15,21 @@ type
|
||||
|
||||
TChessDrawer = class(TCustomControl)
|
||||
private
|
||||
imgBoard,
|
||||
imgWPawn, imgWKnight, imgWBishop, imgWRook, imgWQueen, imgWKing,
|
||||
imgBPawn, imgBKnight, imgBBishop, imgBRook, imgBQueen, imgBKing:
|
||||
TPortableNetworkGraphic;
|
||||
imgBoard, imgWPawn, imgWKnight, imgWBishop, imgWRook, imgWQueen,
|
||||
imgWKing, imgBPawn, imgBKnight, imgBBishop, imgBRook, imgBQueen,
|
||||
imgBKing: TPortableNetworkGraphic;
|
||||
{ bmpBoard, bmpWPawn, bmpWKnight, bmpWBishop, bmpWRook, bmpWQueen,
|
||||
bmpWKing, bmpBPawn, bmpBKnight, bmpBBishop, bmpBRook, bmpBQueen,
|
||||
bmpBKing: TBitmap;}
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
procedure EraseBackground(DC: HDC); override;
|
||||
procedure Paint; override;
|
||||
procedure DrawToCanvas(ACanvas: TCanvas);
|
||||
procedure DrawChessTile(ACanvas: TCanvas; ACol, ARow: Integer;
|
||||
ATile: TChessTile);
|
||||
procedure DrawImageWithTransparentColor(
|
||||
ADest: TLazIntfImage; const ADestX, ADestY: Integer; AColor: TFPColor;
|
||||
AImage: TFPImageBitmap);
|
||||
function GetChessTileImage(ATile: TChessTile): TPortableNetworkGraphic;
|
||||
procedure LoadImages();
|
||||
end;
|
||||
|
||||
@ -51,6 +55,20 @@ begin
|
||||
imgBRook := TPortableNetworkGraphic.Create;
|
||||
imgBQueen := TPortableNetworkGraphic.Create;
|
||||
imgBKing := TPortableNetworkGraphic.Create;
|
||||
|
||||
{ bmpBoard := TBitmap.Create;
|
||||
bmpWPawn := TBitmap.Create;
|
||||
bmpWKnight := TBitmap.Create;
|
||||
bmpWBishop := TBitmap.Create;
|
||||
bmpWRook := TBitmap.Create;
|
||||
bmpWQueen := TBitmap.Create;
|
||||
bmpWKing := TBitmap.Create;
|
||||
bmpBPawn := TBitmap.Create;
|
||||
bmpBKnight := TBitmap.Create;
|
||||
bmpBBishop := TBitmap.Create;
|
||||
bmpBRook := TBitmap.Create;
|
||||
bmpBQueen := TBitmap.Create;
|
||||
bmpBKing := TBitmap.Create; }
|
||||
end;
|
||||
|
||||
procedure TChessDrawer.EraseBackground(DC: HDC);
|
||||
@ -61,7 +79,7 @@ end;
|
||||
|
||||
procedure TChessDrawer.Paint;
|
||||
var
|
||||
x, y: Integer;
|
||||
x, y: integer;
|
||||
Bitmap: TBitmap;
|
||||
begin
|
||||
Bitmap := TBitmap.Create;
|
||||
@ -77,45 +95,96 @@ begin
|
||||
Bitmap.Free;
|
||||
end;
|
||||
|
||||
// inherited Paint;
|
||||
// inherited Paint;
|
||||
end;
|
||||
|
||||
procedure TChessDrawer.DrawToCanvas(ACanvas: TCanvas);
|
||||
var
|
||||
col, row: Integer;
|
||||
col, row: integer;
|
||||
lIntfImage: TLazIntfImage;
|
||||
lTmpBmp: TBitmap;
|
||||
lTileBmp: TPortableNetworkGraphic;
|
||||
X, Y: integer;
|
||||
begin
|
||||
// First draw the board
|
||||
ACanvas.Draw(0, 0, imgBoard);
|
||||
lIntfImage := TLazIntfImage.Create(0, 0);
|
||||
lTmpBmp := TBitmap.Create;
|
||||
try
|
||||
// First draw the board
|
||||
lIntfImage.LoadFromBitmap(imgBoard.Handle, 0{bmpBoard.MaskHandle});
|
||||
|
||||
// Now all pieces
|
||||
for col := 1 to 8 do
|
||||
for row := 1 to 8 do
|
||||
DrawChessTile(ACanvas, col, row, vChessGame.Board[col][row]);
|
||||
// Now all pieces
|
||||
for col := 1 to 8 do
|
||||
for row := 1 to 8 do
|
||||
begin
|
||||
lTileBmp := GetChessTileImage(vChessGame.Board[col][row]);
|
||||
if lTileBmp = nil then Continue;
|
||||
|
||||
X := (col - 1) * INT_CHESSTILE_SIZE;
|
||||
Y := (8 - row) * INT_CHESSTILE_SIZE;
|
||||
|
||||
DrawImageWithTransparentColor(lIntfImage, X, Y, FPCOLOR_TRANSPARENT_TILE, lTileBmp);
|
||||
end;
|
||||
|
||||
lTmpBmp.LoadFromIntfImage(lIntfImage);
|
||||
ACanvas.Draw(0, 0, lTmpBmp);
|
||||
finally
|
||||
lTmpBmp.Free;
|
||||
lIntfImage.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TChessDrawer.DrawChessTile(ACanvas: TCanvas; ACol, ARow: Integer;
|
||||
ATile: TChessTile);
|
||||
procedure TChessDrawer.DrawImageWithTransparentColor(ADest: TLazIntfImage;
|
||||
const ADestX, ADestY: Integer; AColor: TFPColor; AImage: TFPImageBitmap);
|
||||
var
|
||||
X, Y: Integer;
|
||||
x, y, CurX, CurY: Integer;
|
||||
CurColor: TFPColor;
|
||||
IntfImage: TLazIntfImage;
|
||||
lDrawWidth, lDrawHeight: Integer;
|
||||
begin
|
||||
if ATile = ctEmpty then Exit;
|
||||
IntfImage := TLazIntfImage.Create(0,0);
|
||||
try
|
||||
IntfImage.LoadFromBitmap(AImage.Handle, AImage.MaskHandle);
|
||||
|
||||
X := (ACol - 1) * INT_CHESSTILE_SIZE;
|
||||
Y := (8 - ARow) * INT_CHESSTILE_SIZE;
|
||||
// Take care not to draw outside the destination area
|
||||
lDrawWidth := Min(ADest.Width - ADestX, AImage.Width);
|
||||
lDrawHeight := Min(ADest.Height - ADestY, AImage.Height);
|
||||
for y := 0 to lDrawHeight - 1 do
|
||||
begin
|
||||
for x := 0 to lDrawWidth - 1 do
|
||||
begin
|
||||
CurX := ADestX + x;
|
||||
CurY := ADestY + y;
|
||||
|
||||
// Never draw outside the destination
|
||||
if (CurX < 0) or (CurY < 0) then Continue;
|
||||
|
||||
// CurColor := IntfImage.Colors[x, y]; // Just for debugging
|
||||
if IntfImage.Colors[x, y].Green <> AColor.Green then
|
||||
ADest.Colors[CurX, CurY] := IntfImage.Colors[x, y];
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
IntfImage.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TChessDrawer.GetChessTileImage(ATile: TChessTile): TPortableNetworkGraphic;
|
||||
begin
|
||||
case ATile of
|
||||
ctWPawn: ACanvas.Draw(X, Y, imgWPawn);
|
||||
ctWKnight: ACanvas.Draw(X, Y, imgWKnight);
|
||||
ctWBishop: ACanvas.Draw(X, Y, imgWBishop);
|
||||
ctWRook: ACanvas.Draw(X, Y, imgWRook);
|
||||
ctWQueen: ACanvas.Draw(X, Y, imgWQueen);
|
||||
ctWKing: ACanvas.Draw(X, Y, imgWKing);
|
||||
ctBPawn: ACanvas.Draw(X, Y, imgBPawn);
|
||||
ctBKnight: ACanvas.Draw(X, Y, imgBKnight);
|
||||
ctBBishop: ACanvas.Draw(X, Y, imgBBishop);
|
||||
ctBRook: ACanvas.Draw(X, Y, imgBRook);
|
||||
ctBQueen: ACanvas.Draw(X, Y, imgBQueen);
|
||||
ctBKing: ACanvas.Draw(X, Y, imgBKing);
|
||||
ctWPawn: Result := imgWPawn;
|
||||
ctWKnight: Result := imgWKnight;
|
||||
ctWBishop: Result := imgWBishop;
|
||||
ctWRook: Result := imgWRook;
|
||||
ctWQueen: Result := imgWQueen;
|
||||
ctWKing: Result := imgWKing;
|
||||
ctBPawn: Result := imgBPawn;
|
||||
ctBKnight: Result := imgBKnight;
|
||||
ctBBishop: Result := imgBBishop;
|
||||
ctBRook: Result := imgBRook;
|
||||
ctBQueen: Result := imgBQueen;
|
||||
ctBKing: Result := imgBKing;
|
||||
else
|
||||
Result := nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -125,7 +194,7 @@ var
|
||||
begin
|
||||
lDir := vChessConfig.GetCurrentSkinDir();
|
||||
|
||||
imgBoard.LoadFromFile(lDir + 'board.png');
|
||||
imgBoard.LoadFromFile(lDir + 'base.png');
|
||||
imgWPawn.LoadFromFile(lDir + 'wpawn.png');
|
||||
imgWKnight.LoadFromFile(lDir + 'wknight.png');
|
||||
imgWBishop.LoadFromFile(lDir + 'wbishop.png');
|
||||
@ -138,6 +207,18 @@ begin
|
||||
imgBRook.LoadFromFile(lDir + 'brook.png');
|
||||
imgBQueen.LoadFromFile(lDir + 'bqueen.png');
|
||||
imgBKing.LoadFromFile(lDir + 'bking.png');
|
||||
|
||||
{ bmpWKnight.Assign(imgWKnight);
|
||||
bmpWKnight.Assign(imgWBishop);
|
||||
bmpWKnight.Assign(imgWRook);
|
||||
bmpWKnight.Assign(imgWQueen);
|
||||
bmpWKnight.Assign(imgWKing);
|
||||
bmpWKnight.Assign(imgBPawn);
|
||||
bmpWKnight.Assign(imgBKnight);
|
||||
bmpWKnight.Assign(imgBBishop);
|
||||
bmpWKnight.Assign(imgBRook);
|
||||
bmpWKnight.Assign(imgBQueen);
|
||||
bmpWKnight.Assign(imgBKing); }
|
||||
end;
|
||||
|
||||
end.
|
||||
|
@ -5,7 +5,7 @@ unit chessgame;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils;
|
||||
Classes, SysUtils, fpimage;
|
||||
|
||||
const
|
||||
colA = 1;
|
||||
@ -17,8 +17,10 @@ const
|
||||
colG = 7;
|
||||
colH = 8;
|
||||
|
||||
INT_CHESSTILE_SIZE = 20;
|
||||
INT_CHESSBOARD_SIZE = 200;
|
||||
INT_CHESSTILE_SIZE = 40;
|
||||
INT_CHESSBOARD_SIZE = 40 * 8;
|
||||
|
||||
FPCOLOR_TRANSPARENT_TILE: TFPColor = (Red: $0000; Green: $8000; Blue: $8000; Alpha: alphaOpaque); //colTeal
|
||||
|
||||
type
|
||||
|
||||
|
@ -31,12 +31,12 @@
|
||||
<PackageName Value="LCL"/>
|
||||
</Item1>
|
||||
</RequiredPackages>
|
||||
<Units Count="25">
|
||||
<Units Count="30">
|
||||
<Unit0>
|
||||
<Filename Value="fpchess.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="fpchess"/>
|
||||
<UsageCount Value="32"/>
|
||||
<UsageCount Value="33"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="mainform.pas"/>
|
||||
@ -46,9 +46,9 @@
|
||||
<UnitName Value="mainform"/>
|
||||
<EditorIndex Value="0"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="56"/>
|
||||
<CursorPos X="45" Y="72"/>
|
||||
<UsageCount Value="32"/>
|
||||
<TopLine Value="52"/>
|
||||
<CursorPos X="24" Y="70"/>
|
||||
<UsageCount Value="33"/>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
</Unit1>
|
||||
@ -164,9 +164,9 @@
|
||||
<IsVisibleTab Value="True"/>
|
||||
<EditorIndex Value="3"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="74"/>
|
||||
<CursorPos X="3" Y="80"/>
|
||||
<UsageCount Value="30"/>
|
||||
<TopLine Value="197"/>
|
||||
<CursorPos X="36" Y="221"/>
|
||||
<UsageCount Value="31"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit16>
|
||||
<Unit17>
|
||||
@ -222,9 +222,9 @@
|
||||
<UnitName Value="chessgame"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="13"/>
|
||||
<CursorPos X="22" Y="21"/>
|
||||
<UsageCount Value="22"/>
|
||||
<TopLine Value="1"/>
|
||||
<CursorPos X="41" Y="23"/>
|
||||
<UsageCount Value="23"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit23>
|
||||
<Unit24>
|
||||
@ -233,132 +233,177 @@
|
||||
<UnitName Value="chessconfig"/>
|
||||
<EditorIndex Value="2"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="22"/>
|
||||
<TopLine Value="18"/>
|
||||
<CursorPos X="13" Y="39"/>
|
||||
<UsageCount Value="22"/>
|
||||
<UsageCount Value="23"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit24>
|
||||
<Unit25>
|
||||
<Filename Value="..\..\..\lazarussvn\lcl\graphics.pp"/>
|
||||
<UnitName Value="Graphics"/>
|
||||
<EditorIndex Value="6"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="217"/>
|
||||
<CursorPos X="12" Y="232"/>
|
||||
<UsageCount Value="11"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit25>
|
||||
<Unit26>
|
||||
<Filename Value="..\..\..\lazarussvn\lcl\intfgraphics.pas"/>
|
||||
<UnitName Value="IntfGraphics"/>
|
||||
<EditorIndex Value="4"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="3455"/>
|
||||
<CursorPos X="1" Y="3483"/>
|
||||
<UsageCount Value="10"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit26>
|
||||
<Unit27>
|
||||
<Filename Value="..\..\..\lazarus29\fpc\2.4.3\source\packages\fcl-image\src\fpimage.pp"/>
|
||||
<UnitName Value="FPimage"/>
|
||||
<EditorIndex Value="5"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="10"/>
|
||||
<CursorPos X="25" Y="31"/>
|
||||
<UsageCount Value="10"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit27>
|
||||
<Unit28>
|
||||
<Filename Value="..\..\..\fpcsvn\packages\fcl-image\src\fpcolors.inc"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="1"/>
|
||||
<CursorPos X="15" Y="10"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit28>
|
||||
<Unit29>
|
||||
<Filename Value="..\..\..\lazarussvn\lcl\interfaces\win32\win32wsbuttons.pp"/>
|
||||
<UnitName Value="Win32WSButtons"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="296"/>
|
||||
<CursorPos X="1" Y="313"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit29>
|
||||
</Units>
|
||||
<JumpHistory Count="30" HistoryIndex="29">
|
||||
<Position1>
|
||||
<Filename Value="chessconfig.pas"/>
|
||||
<Caret Line="16" Column="38" TopLine="1"/>
|
||||
<Filename Value="chessdrawer.pas"/>
|
||||
<Caret Line="108" Column="1" TopLine="100"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="chessdrawer.pas"/>
|
||||
<Caret Line="19" Column="28" TopLine="4"/>
|
||||
<Caret Line="110" Column="1" TopLine="100"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="chessgame.pas"/>
|
||||
<Caret Line="21" Column="28" TopLine="12"/>
|
||||
<Filename Value="chessdrawer.pas"/>
|
||||
<Caret Line="113" Column="1" TopLine="100"/>
|
||||
</Position3>
|
||||
<Position4>
|
||||
<Filename Value="chessgame.pas"/>
|
||||
<Caret Line="24" Column="28" TopLine="7"/>
|
||||
<Filename Value="chessdrawer.pas"/>
|
||||
<Caret Line="114" Column="1" TopLine="100"/>
|
||||
</Position4>
|
||||
<Position5>
|
||||
<Filename Value="chessgame.pas"/>
|
||||
<Caret Line="82" Column="11" TopLine="61"/>
|
||||
<Filename Value="chessdrawer.pas"/>
|
||||
<Caret Line="116" Column="1" TopLine="100"/>
|
||||
</Position5>
|
||||
<Position6>
|
||||
<Filename Value="chessgame.pas"/>
|
||||
<Caret Line="24" Column="62" TopLine="13"/>
|
||||
<Filename Value="chessdrawer.pas"/>
|
||||
<Caret Line="117" Column="1" TopLine="100"/>
|
||||
</Position6>
|
||||
<Position7>
|
||||
<Filename Value="chessgame.pas"/>
|
||||
<Caret Line="71" Column="8" TopLine="59"/>
|
||||
<Filename Value="chessdrawer.pas"/>
|
||||
<Caret Line="119" Column="1" TopLine="100"/>
|
||||
</Position7>
|
||||
<Position8>
|
||||
<Filename Value="mainform.pas"/>
|
||||
<Caret Line="70" Column="28" TopLine="49"/>
|
||||
<Filename Value="chessdrawer.pas"/>
|
||||
<Caret Line="120" Column="1" TopLine="100"/>
|
||||
</Position8>
|
||||
<Position9>
|
||||
<Filename Value="mainform.pas"/>
|
||||
<Caret Line="71" Column="28" TopLine="50"/>
|
||||
<Filename Value="chessdrawer.pas"/>
|
||||
<Caret Line="122" Column="1" TopLine="100"/>
|
||||
</Position9>
|
||||
<Position10>
|
||||
<Filename Value="mainform.pas"/>
|
||||
<Caret Line="70" Column="28" TopLine="49"/>
|
||||
<Filename Value="chessdrawer.pas"/>
|
||||
<Caret Line="123" Column="1" TopLine="100"/>
|
||||
</Position10>
|
||||
<Position11>
|
||||
<Filename Value="mainform.pas"/>
|
||||
<Caret Line="71" Column="28" TopLine="50"/>
|
||||
<Filename Value="chessdrawer.pas"/>
|
||||
<Caret Line="110" Column="61" TopLine="94"/>
|
||||
</Position11>
|
||||
<Position12>
|
||||
<Filename Value="mainform.pas"/>
|
||||
<Caret Line="72" Column="28" TopLine="51"/>
|
||||
<Filename Value="chessdrawer.pas"/>
|
||||
<Caret Line="123" Column="29" TopLine="102"/>
|
||||
</Position12>
|
||||
<Position13>
|
||||
<Filename Value="mainform.pas"/>
|
||||
<Caret Line="71" Column="28" TopLine="50"/>
|
||||
<Filename Value="..\..\..\lazarussvn\lcl\intfgraphics.pas"/>
|
||||
<Caret Line="3485" Column="1" TopLine="3480"/>
|
||||
</Position13>
|
||||
<Position14>
|
||||
<Filename Value="mainform.pas"/>
|
||||
<Caret Line="70" Column="28" TopLine="49"/>
|
||||
<Filename Value="..\..\..\lazarussvn\lcl\intfgraphics.pas"/>
|
||||
<Caret Line="3488" Column="1" TopLine="3480"/>
|
||||
</Position14>
|
||||
<Position15>
|
||||
<Filename Value="mainform.pas"/>
|
||||
<Caret Line="71" Column="28" TopLine="50"/>
|
||||
<Filename Value="..\..\..\lazarussvn\lcl\intfgraphics.pas"/>
|
||||
<Caret Line="3486" Column="1" TopLine="3480"/>
|
||||
</Position15>
|
||||
<Position16>
|
||||
<Filename Value="mainform.pas"/>
|
||||
<Caret Line="72" Column="28" TopLine="51"/>
|
||||
<Filename Value="..\..\..\lazarussvn\lcl\intfgraphics.pas"/>
|
||||
<Caret Line="3485" Column="1" TopLine="3480"/>
|
||||
</Position16>
|
||||
<Position17>
|
||||
<Filename Value="mainform.pas"/>
|
||||
<Caret Line="73" Column="28" TopLine="52"/>
|
||||
<Filename Value="..\..\..\lazarussvn\lcl\intfgraphics.pas"/>
|
||||
<Caret Line="3481" Column="27" TopLine="3475"/>
|
||||
</Position17>
|
||||
<Position18>
|
||||
<Filename Value="chessgame.pas"/>
|
||||
<Caret Line="41" Column="20" TopLine="28"/>
|
||||
<Filename Value="..\..\..\lazarussvn\lcl\intfgraphics.pas"/>
|
||||
<Caret Line="3492" Column="3" TopLine="3481"/>
|
||||
</Position18>
|
||||
<Position19>
|
||||
<Filename Value="mainform.pas"/>
|
||||
<Caret Line="60" Column="53" TopLine="52"/>
|
||||
<Filename Value="..\..\..\lazarussvn\lcl\intfgraphics.pas"/>
|
||||
<Caret Line="35" Column="42" TopLine="22"/>
|
||||
</Position19>
|
||||
<Position20>
|
||||
<Filename Value="chessgame.pas"/>
|
||||
<Caret Line="108" Column="34" TopLine="96"/>
|
||||
<Filename Value="chessdrawer.pas"/>
|
||||
<Caret Line="28" Column="15" TopLine="21"/>
|
||||
</Position20>
|
||||
<Position21>
|
||||
<Filename Value="chessgame.pas"/>
|
||||
<Caret Line="75" Column="9" TopLine="63"/>
|
||||
<Filename Value="chessdrawer.pas"/>
|
||||
<Caret Line="131" Column="1" TopLine="112"/>
|
||||
</Position21>
|
||||
<Position22>
|
||||
<Filename Value="chessdrawer.pas"/>
|
||||
<Caret Line="20" Column="42" TopLine="13"/>
|
||||
<Caret Line="8" Column="73" TopLine="1"/>
|
||||
</Position22>
|
||||
<Position23>
|
||||
<Filename Value="chessdrawer.pas"/>
|
||||
<Caret Line="19" Column="20" TopLine="7"/>
|
||||
<Caret Line="131" Column="15" TopLine="102"/>
|
||||
</Position23>
|
||||
<Position24>
|
||||
<Filename Value="chessconfig.pas"/>
|
||||
<Caret Line="17" Column="28" TopLine="4"/>
|
||||
<Filename Value="chessdrawer.pas"/>
|
||||
<Caret Line="121" Column="21" TopLine="110"/>
|
||||
</Position24>
|
||||
<Position25>
|
||||
<Filename Value="chessdrawer.pas"/>
|
||||
<Caret Line="25" Column="22" TopLine="12"/>
|
||||
<Caret Line="32" Column="24" TopLine="9"/>
|
||||
</Position25>
|
||||
<Position26>
|
||||
<Filename Value="chessdrawer.pas"/>
|
||||
<Caret Line="131" Column="1" TopLine="117"/>
|
||||
<Caret Line="185" Column="29" TopLine="171"/>
|
||||
</Position26>
|
||||
<Position27>
|
||||
<Filename Value="chessdrawer.pas"/>
|
||||
<Caret Line="9" Column="5" TopLine="1"/>
|
||||
<Caret Line="71" Column="38" TopLine="111"/>
|
||||
</Position27>
|
||||
<Position28>
|
||||
<Filename Value="chessdrawer.pas"/>
|
||||
<Caret Line="103" Column="39" TopLine="91"/>
|
||||
<Caret Line="113" Column="70" TopLine="99"/>
|
||||
</Position28>
|
||||
<Position29>
|
||||
<Filename Value="chessdrawer.pas"/>
|
||||
<Caret Line="124" Column="6" TopLine="112"/>
|
||||
<Caret Line="119" Column="21" TopLine="105"/>
|
||||
</Position29>
|
||||
<Position30>
|
||||
<Filename Value="chessdrawer.pas"/>
|
||||
<Caret Line="136" Column="31" TopLine="120"/>
|
||||
<Caret Line="106" Column="36" TopLine="99"/>
|
||||
</Position30>
|
||||
</JumpHistory>
|
||||
</ProjectOptions>
|
||||
|
@ -18,10 +18,8 @@ object formChess: TformChess
|
||||
TabOrder = 0
|
||||
TabStop = True
|
||||
object pageStart: TUNBPage
|
||||
Left = 0
|
||||
Height = 300
|
||||
Top = 0
|
||||
Width = 240
|
||||
ClientWidth = 240
|
||||
ClientHeight = 300
|
||||
object Label1: TLabel
|
||||
Left = 0
|
||||
Height = 32
|
||||
@ -72,7 +70,7 @@ object formChess: TformChess
|
||||
end
|
||||
object editPlayerName: TLabeledEdit
|
||||
Left = 104
|
||||
Height = 22
|
||||
Height = 21
|
||||
Top = 80
|
||||
Width = 120
|
||||
EditLabel.AnchorSideLeft.Control = editPlayerName
|
||||
@ -80,10 +78,10 @@ object formChess: TformChess
|
||||
EditLabel.AnchorSideTop.Side = asrCenter
|
||||
EditLabel.AnchorSideRight.Control = editPlayerName
|
||||
EditLabel.AnchorSideBottom.Control = editPlayerName
|
||||
EditLabel.Left = 22
|
||||
EditLabel.Height = 17
|
||||
EditLabel.Left = 40
|
||||
EditLabel.Height = 14
|
||||
EditLabel.Top = 83
|
||||
EditLabel.Width = 79
|
||||
EditLabel.Width = 61
|
||||
EditLabel.Caption = 'Player Name'
|
||||
EditLabel.ParentColor = False
|
||||
LabelPosition = lpLeft
|
||||
@ -91,9 +89,9 @@ object formChess: TformChess
|
||||
end
|
||||
object Label6: TLabel
|
||||
Left = 21
|
||||
Height = 17
|
||||
Height = 14
|
||||
Top = 112
|
||||
Width = 52
|
||||
Width = 43
|
||||
Caption = 'Start as:'
|
||||
ParentColor = False
|
||||
end
|
||||
@ -102,7 +100,7 @@ object formChess: TformChess
|
||||
Height = 21
|
||||
Top = 111
|
||||
Width = 120
|
||||
ItemHeight = 0
|
||||
ItemHeight = 13
|
||||
ItemIndex = 0
|
||||
Items.Strings = (
|
||||
'White'
|
||||
@ -113,10 +111,8 @@ object formChess: TformChess
|
||||
end
|
||||
end
|
||||
object pageConfigConnection: TUNBPage
|
||||
Left = 0
|
||||
Height = 300
|
||||
Top = 0
|
||||
Width = 240
|
||||
ClientWidth = 240
|
||||
ClientHeight = 300
|
||||
object Label3: TLabel
|
||||
Left = 0
|
||||
Height = 32
|
||||
@ -180,10 +176,8 @@ object formChess: TformChess
|
||||
end
|
||||
end
|
||||
object pageConnecting: TUNBPage
|
||||
Left = 0
|
||||
Height = 300
|
||||
Top = 0
|
||||
Width = 240
|
||||
ClientWidth = 240
|
||||
ClientHeight = 300
|
||||
object Label4: TLabel
|
||||
Left = 0
|
||||
Height = 32
|
||||
@ -205,10 +199,8 @@ object formChess: TformChess
|
||||
end
|
||||
end
|
||||
object pageGame: TUNBPage
|
||||
Left = 0
|
||||
Height = 300
|
||||
Top = 0
|
||||
Width = 240
|
||||
ClientWidth = 240
|
||||
ClientHeight = 300
|
||||
object Label5: TLabel
|
||||
Left = 0
|
||||
Height = 32
|
||||
|
@ -56,7 +56,7 @@ procedure TformChess.HandleMainScreenButton(Sender: TObject);
|
||||
begin
|
||||
if Sender = btnSinglePlayer then
|
||||
begin
|
||||
notebookMain.PageIndex := 2;
|
||||
notebookMain.PageIndex := 3;
|
||||
vChessGame.StartNewGame(comboStartColor.ItemIndex);
|
||||
end
|
||||
else if Sender = btnDirectComm then notebookMain.PageIndex := 1;
|
||||
@ -67,7 +67,7 @@ begin
|
||||
// Creation of internal components
|
||||
vChessDrawer := TChessDrawer.Create(Self);
|
||||
vChessDrawer.Parent := pageGame;
|
||||
vChessDrawer.Top := 20;
|
||||
vChessDrawer.Top := 50;
|
||||
vChessDrawer.Left := 20;
|
||||
vChessDrawer.Height := INT_CHESSBOARD_SIZE;
|
||||
vChessDrawer.Width := INT_CHESSBOARD_SIZE;
|
||||
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 12 KiB |
BIN
applications/fpchess/skins/classic/bbishop.png
Normal file
After Width: | Height: | Size: 457 B |
BIN
applications/fpchess/skins/classic/bking.png
Normal file
After Width: | Height: | Size: 510 B |
BIN
applications/fpchess/skins/classic/bknight.png
Normal file
After Width: | Height: | Size: 458 B |
BIN
applications/fpchess/skins/classic/bpawn.png
Normal file
After Width: | Height: | Size: 315 B |
BIN
applications/fpchess/skins/classic/bqueen.png
Normal file
After Width: | Height: | Size: 443 B |
BIN
applications/fpchess/skins/classic/brook.png
Normal file
After Width: | Height: | Size: 343 B |
BIN
applications/fpchess/skins/classic/wbishop.png
Normal file
After Width: | Height: | Size: 505 B |
BIN
applications/fpchess/skins/classic/wking.png
Normal file
After Width: | Height: | Size: 517 B |
BIN
applications/fpchess/skins/classic/wknight.png
Normal file
After Width: | Height: | Size: 479 B |
BIN
applications/fpchess/skins/classic/wpawn.png
Normal file
After Width: | Height: | Size: 361 B |
BIN
applications/fpchess/skins/classic/wqueen.png
Normal file
After Width: | Height: | Size: 550 B |
BIN
applications/fpchess/skins/classic/wrook.png
Normal file
After Width: | Height: | Size: 379 B |