本文整理汇总了C++中Town::initGraphics方法的典型用法代码示例。如果您正苦于以下问题:C++ Town::initGraphics方法的具体用法?C++ Town::initGraphics怎么用?C++ Town::initGraphics使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Town
的用法示例。
在下文中一共展示了Town::initGraphics方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initGraphics
// -----------------------------------------------------------------
// Name : initGraphics
// -----------------------------------------------------------------
void Map::initGraphics(DisplayEngine * pDisplay)
{
FREE(m_pTileGeometry);
QuadData tilequad(0.0f, 1.0f, 0.0f, 1.0f, "maptile init texture", pDisplay);
m_pTileGeometry = new GeometryQuads(&tilequad, VB_Static);
assert(m_pTiles != NULL);
for (u16 x = 0; x < m_iWidth; x++)
{
for (u16 y = 0; y < m_iHeight; y++)
{
m_pTiles[x][y]->initGraphics(m_pTileGeometry, pDisplay);
setTileMask(x, y);
Town * pTown = (Town*) m_pTiles[x][y]->getFirstMapObject(GOTYPE_TOWN);
if (pTown != NULL)
pTown->initGraphics(pDisplay);
Temple * pTemple = (Temple*) m_pTiles[x][y]->getFirstMapObject(GOTYPE_TEMPLE);
if (pTemple != NULL)
pTemple->initGraphics(pDisplay);
}
}
FREE(m_pEmptyMapGeometry);
QuadData mapquad(0.0f, (float) m_iWidth, 0.0f, (float) m_iHeight, "map", pDisplay);
m_pEmptyMapGeometry = new GeometryQuads(&mapquad, VB_Static);
FREE(m_pTombGeometry);
QuadData quad(0.0f, 0.4f, 0.0f, 0.4f, "skull", pDisplay);
m_pTombGeometry = new GeometryQuads(&quad, VB_Static);
FREE(m_pFoeBannerGeometry);
QuadData quad2(0.0f, 0.3f, 0.0f, 0.3f, "attack_icon", pDisplay);
m_pFoeBannerGeometry = new GeometryQuads(&quad2, VB_Static);
FREE(m_pCountUnitsBgGeometry1L);
QuadData quad3(0.0f, 0.4f, 0.0f, 0.3f, "bg-shadowed", pDisplay);
m_pCountUnitsBgGeometry1L = new GeometryQuads(&quad3, VB_Static);
FREE(m_pCountUnitsBgGeometry2L);
QuadData quad4(0.0f, 0.4f, 0.0f, 0.6f, "bg-shadowed", pDisplay);
m_pCountUnitsBgGeometry2L = new GeometryQuads(&quad4, VB_Static);
}