X-Git-Url: https://git.ucc.asn.au/?p=progcomp2012.git;a=blobdiff_plain;f=manager%2Fstratego.cpp;fp=manager%2Fstratego.cpp;h=f2df0ffc29719cda5a4e91b4e129580e4b2b5237;hp=ed38e356ebf2924da05980b586fa07d74acf66c6;hb=17a20de4017ccfadef219d830a28ecccfe6f5106;hpb=2120cc40abf9e3fd763c84a1e09b61064bb40be6 diff --git a/manager/stratego.cpp b/manager/stratego.cpp index ed38e35..f2df0ff 100644 --- a/manager/stratego.cpp +++ b/manager/stratego.cpp @@ -202,7 +202,7 @@ void Board::PrintPretty(FILE * stream, const Piece::Colour & reveal) * Draw the board state to graphics * @param reveal - Pieces matching this colour will be revealed. All others will be shown as blank coloured squares. */ -void Board::Draw(const Piece::Colour & reveal) +void Board::Draw(const Piece::Colour & reveal, bool showRevealed) { if (!Graphics::Initialised()) { @@ -223,7 +223,8 @@ void Board::Draw(const Piece::Colour & reveal) //Don't display anything } - else if (piece->colour != Piece::NONE && (piece->colour == reveal || reveal == Piece::BOTH)) + else if ((piece->colour != Piece::NONE && (piece->colour == reveal || reveal == Piece::BOTH)) + || (piece->beenRevealed && showRevealed)) { //Display the piece Piece::textures[(int)(piece->type)].DrawColour(x*32,y*32,0,1, Piece::GetGraphicsColour(piece->colour)); @@ -360,6 +361,9 @@ MovementResult Board::MovePiece(int x, int y, const Direction & direction, int m } else if (defender->colour != target->colour) { + defender->beenRevealed = true; + target->beenRevealed = true; + Piece::Type defenderType = defender->type; Piece::Type attackerType = target->type;