Пример #1
0
bool MCCachedImageRep::GetGeometry(uindex_t &r_width, uindex_t &r_height)
{
	if (m_have_geometry || CalculateGeometry(m_width, m_height))
	{
		m_have_geometry = true;
		r_width = m_width;
		r_height = m_height;

		return true;
	}

	return false;
}
Пример #2
0
/* 
 * Function: DrawBoard
 * -------------------
 * Exported function to draw a new board.  Sets up named colors, draws the yellow
 * border, draws the empty cubes, the labels on the scoreboard, and resets scores
 * to zero and words lists to empty.
 */
void DrawBoard(int numRows, int numCols)
{
    if (numRows < 0 || numRows > MAX_DIMENSION || numCols < 0 || numCols > MAX_DIMENSION)
	Error("DrawBoard called with invalid dimensions.");
		
    SetWindowTitle("Welcome to Boggle!");
    InitColors();
    CalculateGeometry(numRows, numCols);
	
    // Draws a filled rect underneath cubes in the oh-so-familiar yellow color
    FillBox(gState.board.x, gState.board.y, gState.board.w, gState.board.h, 0.5, "Board Color");
    DrawEmptyCubes();
    DrawPlayerLabel(Human, "Me");
    DrawPlayerLabel(Computer, "Computer");
}