X-Git-Url: https://git.ucc.asn.au/?p=progcomp2012.git;a=blobdiff_plain;f=judge%2Fmanager%2Fstratego.cpp;fp=judge%2Fmanager%2Fstratego.cpp;h=e7cf60ac8b50573d98d3cfce3a7961ae01852404;hp=410b70a29116c32828069680997ce964466cdafd;hb=78293905481ab7a67e773d05350da29940a58ea6;hpb=b8c7f4f923794d4e64b73f4dacf3a21b4102bf81 diff --git a/judge/manager/stratego.cpp b/judge/manager/stratego.cpp index 410b70a..e7cf60a 100644 --- a/judge/manager/stratego.cpp +++ b/judge/manager/stratego.cpp @@ -14,12 +14,9 @@ int Piece::maxUnits[] = {0,0,1,1,8,5,4,4,4,3,2,1,1,6,0}; - +#ifdef BUILD_GRAPHICS Piece::TextureManager Piece::textures; - - - Piece::TextureManager::~TextureManager() { Array::Iterator i(*this); @@ -41,7 +38,7 @@ Texture & Piece::TextureManager::operator[](const LUint & at) } return *(Array::operator[](at)); } - +#endif //BUILD_GRAPHICS /** * Gets the type of a piece, based off a character token @@ -197,7 +194,7 @@ void Board::PrintPretty(FILE * stream, const Piece::Colour & reveal) } - +#ifdef BUILD_GRAPHICS /** * Draw the board state to graphics * @param reveal - Pieces matching this colour will be revealed. If Piece::BOTH, all pieces will be revealed @@ -206,6 +203,7 @@ void Board::PrintPretty(FILE * stream, const Piece::Colour & reveal) */ void Board::Draw(const Piece::Colour & reveal, bool showRevealed) { + if (!Graphics::Initialised()) { fprintf(stderr, "ERROR - Board::Draw called whilst graphics disabled!!!\n"); @@ -256,6 +254,7 @@ void Board::Draw(const Piece::Colour & reveal, bool showRevealed) Graphics::UpdateScreen(); } +#endif //BUILD_GRAPHICS /** * Adds a piece to the board