int CTextRenderer::CGlyphCache::NewBlock(ivec2 Granularity)
{
	int MaxNumBlock = (m_Width * m_Height) / (m_PPB * m_PPB);
	
	if(MaxNumBlock <= m_Blocks.size())
		IncreaseCache();
	
	int BlockId = m_Blocks.size();
	m_Blocks.add(CBlock());
	CBlock* pBlock = &m_Blocks[BlockId];
	
	pBlock->m_Granularity = Granularity;
	pBlock->m_Size = 0;
	
	int NumGlyphX = m_GPB/Granularity.x;
	int NumGlyphY = m_GPB/Granularity.y;
	pBlock->m_MaxSize = NumGlyphX * NumGlyphY;
	
	return BlockId;
}
Esempio n. 2
0
CRussiaGame::CRussiaGame(LPCTSTR m_lpszClass, LPCTSTR m_lpszName) : CWnd(m_lpszClass, m_lpszName)
{
	nNum = 0;
	m_iNextShapID = 0;
	score = 0;
	for (int i = 0; i < 12; i++)
	{
		for (int j = 0; j < 20; j++)
		{
			m_iMap[i][j] = 0;
		}
	}
 	m_blockModeArray[0] =  CBlock(CBlockPoint(4, 0), CBlockPoint(5, 0), CBlockPoint(6, 0), CBlockPoint(7, 0));
 	m_blockModeArray[1] =  CBlock(CBlockPoint(5, 0), CBlockPoint(6, 0), CBlockPoint(5, 1), CBlockPoint(6, 1));
 	m_blockModeArray[2] =  CBlock(CBlockPoint(5, 0), CBlockPoint(4, 1), CBlockPoint(5, 1), CBlockPoint(6, 1));
 	m_blockModeArray[3] =  CBlock(CBlockPoint(4, 0), CBlockPoint(5, 0), CBlockPoint(5, 1), CBlockPoint(6, 1));
 	m_blockModeArray[4] =  CBlock(CBlockPoint(5, 0), CBlockPoint(6, 0), CBlockPoint(4, 1), CBlockPoint(5, 1));
 	m_blockModeArray[5] =  CBlock(CBlockPoint(4, 0), CBlockPoint(4, 1), CBlockPoint(5, 1), CBlockPoint(6, 1));
 	m_blockModeArray[6] =  CBlock(CBlockPoint(6, 0), CBlockPoint(4, 1), CBlockPoint(5, 1), CBlockPoint(6, 1));
	m_currentBlock = m_blockModeArray[0];
	
}