本文整理汇总了C++中PCZone::setPortalsUpdated方法的典型用法代码示例。如果您正苦于以下问题:C++ PCZone::setPortalsUpdated方法的具体用法?C++ PCZone::setPortalsUpdated怎么用?C++ PCZone::setPortalsUpdated使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PCZone
的用法示例。
在下文中一共展示了PCZone::setPortalsUpdated方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: destroyAntiPortal
/** Delete a anti portal instance by name */
void PCZSceneManager::destroyAntiPortal(const String& portalName)
{
// find the anti portal from the master portal list
AntiPortal* p;
AntiPortal* thePortal = 0;
AntiPortalList::iterator it = mAntiPortals.begin();
while (it != mAntiPortals.end())
{
p = *it;
if (p->getName() == portalName)
{
thePortal = p;
// erase entry in the master list
mAntiPortals.erase(it);
break;
}
it++;
}
if (thePortal)
{
// remove the Portal from it's home zone
PCZone* homeZone = thePortal->getCurrentHomeZone();
if (homeZone)
{
// inform zone of portal change
homeZone->setPortalsUpdated(true);
homeZone->_removeAntiPortal(thePortal);
}
// delete the portal instance
OGRE_DELETE thePortal;
}
}
示例2: destroyPortal
// delete a portal instance by pointer
void PCZSceneManager::destroyPortal(Portal * p)
{
// remove the portal from it's target portal
Portal * targetPortal = p->getTargetPortal();
if (targetPortal)
{
targetPortal->setTargetPortal(0); // the targetPortal will still have targetZone value, but targetPortal will be invalid
}
// remove the Portal from it's home zone
PCZone * homeZone = p->getCurrentHomeZone();
if (homeZone)
{
// inform zone of portal change. Do here since PCZone is abstract
homeZone->setPortalsUpdated(true);
homeZone->_removePortal(p);
}
// remove the portal from the master portal list
PortalList::iterator it = std::find( mPortals.begin(), mPortals.end(), p );
if (it != mPortals.end())
{
mPortals.erase(it);
}
// delete the portal instance
OGRE_DELETE p;
}