当前位置: 首页>>代码示例>>C++>>正文


C++ Town::initGraphics方法代码示例

本文整理汇总了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);
}
开发者ID:jotak,项目名称:shahnarman,代码行数:39,代码来源:Map.cpp


注:本文中的Town::initGraphics方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。