本文整理汇总了C++中MapTree::loadMap方法的典型用法代码示例。如果您正苦于以下问题:C++ MapTree::loadMap方法的具体用法?C++ MapTree::loadMap怎么用?C++ MapTree::loadMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MapTree
的用法示例。
在下文中一共展示了MapTree::loadMap方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _loadMap
bool VMapManager::_loadMap(const char* pBasePath, unsigned int pMapId, int x, int y, bool pForceTileLoad)
{
bool result = false;
std::string dirFileName;
if(pForceTileLoad || iMapsSplitIntoTiles.containsKey(pMapId))
{
dirFileName = getDirFileName(pMapId,x,y);
}
else
{
dirFileName = getDirFileName(pMapId);
}
MapTree* instanceTree;
if(!iInstanceMapTrees.containsKey(pMapId))
{
instanceTree = new MapTree(pBasePath);
iInstanceMapTrees.set(pMapId, instanceTree);
}
else
instanceTree = iInstanceMapTrees.get(pMapId);
unsigned int mapTileIdent = MAP_TILE_IDENT(x,y);
result = instanceTree->loadMap(dirFileName, mapTileIdent);
if(!result) // remove on fail
{
if(instanceTree->size() == 0)
{
iInstanceMapTrees.remove(pMapId);
delete instanceTree;
}
}
return(result);
}
示例2: loadMap
int VMapManager::loadMap(const char* pBasePath, unsigned int pMapId, int x, int y)
{
bool result = false;
std::string dirFileName;
if( pMapId >= MAX_MAPS )
return false;
if( IsTileMap( pMapId ) )
dirFileName = getDirFileName( pMapId, x, y );
else
dirFileName = getDirFileName( pMapId );
MapTree* instanceTree = m_maps[pMapId];
if( instanceTree == NULL )
{
instanceTree = new MapTree( pBasePath );
m_maps[pMapId] = instanceTree;
}
unsigned int mapTileIdent = MAP_TILE_IDENT(x,y);
result = instanceTree->loadMap(dirFileName, mapTileIdent);
if(!result) // remove on fail
{
if(instanceTree->size() == 0)
{
m_maps[pMapId] = NULL;
delete instanceTree;
}
}
return(result);
}