- Timestamp:
- 03/31/06 17:29:32 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/BBCBillboardCloudUVMapper.cpp
r709 r721 14 14 BillboardCloudUVMapper::~BillboardCloudUVMapper() 15 15 { 16 clear();16 shutdown(); 17 17 } 18 18 … … 21 21 } 22 22 23 void BillboardCloudUVMapper::clear() 24 { 25 Ogre::LogManager::getSingleton().logMessage("Init.BSP:" + Ogre::StringConverter::toString(getNumBsp())); 26 23 void BillboardCloudUVMapper::shutdown() 24 { 27 25 while (getNumBsp() > 0) 28 26 { … … 30 28 } 31 29 32 Ogre::LogManager::getSingleton().logMessage("Clear.BSP:" + Ogre::StringConverter::toString(getNumBsp())); 33 34 Ogre::LogManager::getSingleton().logMessage("Init.CL:" + Ogre::StringConverter::toString(getNumClusterLists())); 35 36 //while (getNumClusterLists() > 0) 37 //{ 38 // removeBsp(getNumClusterLists()-1); 39 //} 40 mClusterLists.clear(); 41 42 Ogre::LogManager::getSingleton().logMessage("Clear.CL:" + Ogre::StringConverter::toString(getNumClusterLists())); 30 while (getNumClusterLists() > 0) 31 { 32 removeClusterList(getNumClusterLists()-1); 33 } 43 34 } 44 35 … … 82 73 void BillboardCloudUVMapper::removeClusterList(unsigned int iClusterList) 83 74 { 84 //mClusterLists.erase(mClusterLists.begin() + iClusterList); 75 IMG::ClusterList *clusterList = mClusterLists[iClusterList]; 76 mClusterLists.erase(mClusterLists.begin() + iClusterList); 77 delete clusterList; 85 78 } 86 79 … … 142 135 "," + Ogre::StringConverter::toString(max[1]-min[1]) + ")"); 143 136 144 SubEntity *subEntity;137 SubEntityPtr subEntity; 145 138 146 139 Ogre::Vector2 texCoords01,texCoords02,texCoords03,texCoords04; … … 160 153 { 161 154 Ogre::LogManager::getSingleton().logMessage("DontMerge"); 162 subEntity = subEntity =mBillboardCloud->getEntity()->getSubEntity(iBillboardGroup);155 subEntity = mBillboardCloud->getEntity()->getSubEntity(iBillboardGroup); 163 156 164 157 // Face A … … 285 278 void BillboardCloudUVMapper::addTextureInBsp(unsigned int iBillboardGroup, unsigned int iBillboard) 286 279 { 287 IMG::NodeBsp *nodeDest;280 IMG::NodeBspPtr nodeDest; 288 281 IMG::Cluster cluster; 289 282 Ogre::LogManager::getSingleton().logMessage("w:" + Ogre::StringConverter::toString(mTextureWidth)); … … 304 297 for (unsigned int iBillboard = 0; iBillboard < mBillboardCloud->getNumBillboards(); iBillboard++) 305 298 { 306 Billboard *billboard = mBillboardCloud->getBillboard(iBillboard);307 EntityCluster *entityCluster = billboard->getBillboardClusterData()->getEntityCluster();299 BillboardPtr billboard = mBillboardCloud->getBillboard(iBillboard); 300 EntityClusterPtr entityCluster = billboard->getBillboardClusterData()->getEntityCluster(); 308 301 309 302 if (entityCluster->getNumEntitiesClusterData() > 0) … … 313 306 if (!enabledTextureCoordSet) 314 307 { 315 SubEntity *subEntity = mBillboardCloud->getEntity()->getSubEntity(0);308 SubEntityPtr subEntity = mBillboardCloud->getEntity()->getSubEntity(0); 316 309 subEntity->addTextureCoordSet(2); 317 310 subEntity->enableVertexColours(true); … … 323 316 if (groupedBillboards) 324 317 { 325 SubEntity *subEntity = mBillboardCloud->getEntity()->getSubEntity(numGeneratedBillboardClouds);318 SubEntityPtr subEntity = mBillboardCloud->getEntity()->getSubEntity(numGeneratedBillboardClouds); 326 319 subEntity->addTextureCoordSet(2); 327 320 subEntity->enableVertexColours(true); … … 355 348 unsigned int iBillboardGroup; 356 349 for (iBillboardGroup = 0; iBillboardGroup < numBillboardGroups; iBillboardGroup++) 357 { 358 359 IMG::NodeBsp *node = new IMG::NodeBsp; 350 { 360 351 IMG::Bsp *bsp = new IMG::Bsp(); 361 IMG::Box2d *box = new IMG::Box2d;362 352 IMG::ClusterList *clusterList = new IMG::ClusterList(); 363 364 box->SetBoundBox(0, 0, mTextureAtlasWidth, mTextureAtlasHeight); 365 node-> SetBound(box);353 IMG::NodeBspPtr node = IMG::NodeBspPtr(new IMG::NodeBsp); 354 355 node->GetBound()->SetBoundBox(0, 0, mTextureAtlasWidth, mTextureAtlasHeight); 366 356 bsp->SetRoot(node); 357 367 358 addBsp(bsp); 368 359 addClusterList(clusterList); … … 375 366 Ogre::LogManager::getSingleton().logMessage("id:" + Ogre::StringConverter::toString(mBillboardCloud->getBillboard(iBillboard)->getBillboardHandle())); 376 367 377 BillboardClusterData *billboardClusterData = mBillboardCloud->getBillboard(iBillboard)->getBillboardClusterData() ;368 BillboardClusterData *billboardClusterData = mBillboardCloud->getBillboard(iBillboard)->getBillboardClusterData().get(); 378 369 379 370 if (billboardClusterData != NULL) 380 371 { 381 372 Ogre::LogManager::getSingleton().logMessage("billboardData"); 382 EntityCluster *entityCluster = billboardClusterData->getEntityCluster();373 EntityClusterPtr entityCluster = billboardClusterData->getEntityCluster(); 383 374 if (entityCluster->getNumEntitiesClusterData() > 0) 384 375 {
Note: See TracChangeset
for help on using the changeset viewer.