From: <pha...@us...> - 2007-08-06 03:11:12
|
Revision: 47 http://chessdrills.svn.sourceforge.net/chessdrills/?rev=47&view=rev Author: phantomfive Date: 2007-08-05 20:11:09 -0700 (Sun, 05 Aug 2007) Log Message: ----------- SetSquare() now works, and the board draws correctly (though ugly) Modified Paths: -------------- base/ChessBoard.h drills/ExampleDrill.cpp gui/MainWindow.cpp Modified: base/ChessBoard.h =================================================================== --- base/ChessBoard.h 2007-08-04 07:03:01 UTC (rev 46) +++ base/ChessBoard.h 2007-08-06 03:11:09 UTC (rev 47) @@ -45,7 +45,7 @@ //removes all pieces and sets the board hilight/colors back to normal void Reset(); - + private: ChessSquare board[8][8]; }; Modified: drills/ExampleDrill.cpp =================================================================== --- drills/ExampleDrill.cpp 2007-08-04 07:03:01 UTC (rev 46) +++ drills/ExampleDrill.cpp 2007-08-06 03:11:09 UTC (rev 47) @@ -37,7 +37,6 @@ tempSquare.piece.color = CLR_WHITE; tempSquare.piece.type = CP_PAWN; SetSquare(theirPawn.col, theirPawn.row, tempSquare ); - //return true because we set up successfully return true; } Modified: gui/MainWindow.cpp =================================================================== --- gui/MainWindow.cpp 2007-08-04 07:03:01 UTC (rev 46) +++ gui/MainWindow.cpp 2007-08-06 03:11:09 UTC (rev 47) @@ -130,9 +130,8 @@ if( NULL != board ){ for(int i=0;i<8;i++){ for(int j=0;j<8;j++){ - const ChessPiece *piece = board->GetPiece((ChessColumn)i,(ChessRow)j); + const ChessPiece *piece = board->GetPiece((ChessColumn)j,(ChessRow)i); ChessColor c = piece->color; - printf("[%d,%d], type %d\n",i,j,piece->type); //find which piece and color switch (piece->type){ case CP_PAWN: img = (c==CLR_WHITE)?&whitePawn: &blackPawn;break; @@ -179,5 +178,7 @@ int id = event.GetId() - ID_SelectDrill1; const char ** menuList = ctl.GetDrillList(); ctl.SwitchToDrill( menuList[id] ); + Refresh(true); +} + -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |