本文整理汇总了C++中Terrain::SetSharedIB方法的典型用法代码示例。如果您正苦于以下问题:C++ Terrain::SetSharedIB方法的具体用法?C++ Terrain::SetSharedIB怎么用?C++ Terrain::SetSharedIB使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Terrain
的用法示例。
在下文中一共展示了Terrain::SetSharedIB方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TerrainTileCacheItem
Terrain * TerrainLattice::LoadTerrain(int index)
{
int indexX, indexY;
Terrain *pTerrain = NULL;
if(GetXYFromTileID(index, &indexX, &indexY))
{
pTerrain = m_pLoader->LoadTerrainAt( NULL, indexX, indexY, m_useGeoMipmap);
pair<TerrainTileCacheMap_type::iterator, bool> res = m_pCachedTerrains.insert(pair<int, TerrainTileCacheItem>(index, TerrainTileCacheItem(pTerrain)));
if(res.second ==false)
{
/// replace the old object, if the terrain already exist
OUTPUT_LOG("replacing old tile, this is really unexpected\n");
SAFE_DELETE((*(res.first)).second.pTerrain);
(*(res.first)).second.pTerrain = pTerrain;
}
if(pTerrain)
{
pTerrain->OnLoad();
//GeoMipmapCode
if(m_useGeoMipmap)
{
pTerrain->SetSharedIB(m_pIndices);
pTerrain->SetSharedIndexInfoGroup(&m_geoMipmapIndices);
}
}
}
return pTerrain;
}