本文整理汇总了C++中ogre::MeshPtr::unload方法的典型用法代码示例。如果您正苦于以下问题:C++ MeshPtr::unload方法的具体用法?C++ MeshPtr::unload怎么用?C++ MeshPtr::unload使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::MeshPtr
的用法示例。
在下文中一共展示了MeshPtr::unload方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoReload
void OLMeshTracker::DoReload(Ogre::MeshPtr meshP) {
if (!m_shouldQueueMeshOperations) {
ReloadMeshQm* rmq = new ReloadMeshQm(10, meshP);
rmq->Process();
delete(rmq);
return;
}
LGLOCK_ALOCK trackerLock;
meshP->unload(); // DEBUG
trackerLock.Lock(MeshTrackerLock);
// check to see if in unloaded list, if so, remove it and claim success
Ogre::String meshName = meshP->getName();
GenericQm* reloadEntry = m_meshesToLoad->Find(meshName);
if (reloadEntry != NULL) {
// if already being loaded, we're done
LG::Log("OLMeshTracker::DoReload: asked to reload but already loading: %s", meshName.c_str());
trackerLock.Unlock();
return;
}
// add this to the loading list
LG::Log("OLMeshTracker::DoReload: queuing reloading: %s", meshName.c_str());
ReloadMeshQm* rmq = new ReloadMeshQm(10, meshP);
m_meshesToLoad->AddLast(rmq);
trackerLock.Unlock();
LGLOCK_NOTIFY_ALL(MeshTrackerLock);
/* OLD CODE
// for the moment, don't do anything fancy
if (meshP->isLoaded()) {
meshP->reload();
}
UpdateSceneNodesForMesh(meshP);
// do we need to call update on all scene nodes that use this mesh?
*/
}
示例2: MakeUnLoadedLocked
// Call for an unload when list is already locked
void OLMeshTracker::MakeUnLoadedLocked(Ogre::String meshName, Ogre::String stringParam, Ogre::Entity* entityParam) {
// see if in the loading list. Remove if there.
GenericQm* loadEntry = m_meshesToLoad->Find(meshName);
if (loadEntry != NULL) {
loadEntry->Abort();
m_meshesToLoad->Remove(meshName);
}
// see if in the serialize list. Mark for unload if it's there
GenericQm* serialEntry = m_meshesToSerialize->Find(meshName);
if (serialEntry != NULL) {
serialEntry->stringParam = "unload";
}
else {
Ogre::MeshPtr meshP = Ogre::MeshManager::getSingleton().getByName(meshName);
if (!meshP.isNull()) {
if (meshP.useCount() == 1) {
meshP->unload();
}
else {
LG::Log("OLMeshTracker::MakeUnLoaded: Didn't unload mesh because count = %d", meshP.useCount());
}
}
}
}