forked from mirror/openmw-tes3mp
Merge pull request #35 from OpenMW/master
Add OpenMW commits from 2nd week of August
This commit is contained in:
commit
3c6710a7b5
7 changed files with 32 additions and 8 deletions
|
@ -147,6 +147,7 @@ namespace MWRender
|
|||
|
||||
CharacterPreview::~CharacterPreview ()
|
||||
{
|
||||
mCamera->removeChildren(0, mCamera->getNumChildren());
|
||||
mViewer->getSceneData()->asGroup()->removeChild(mCamera);
|
||||
}
|
||||
|
||||
|
|
|
@ -107,6 +107,10 @@ namespace MWRender
|
|||
|
||||
GlobalMap::~GlobalMap()
|
||||
{
|
||||
for (CameraVector::iterator it = mCamerasPendingRemoval.begin(); it != mCamerasPendingRemoval.end(); ++it)
|
||||
removeCamera(*it);
|
||||
for (CameraVector::iterator it = mActiveCameras.begin(); it != mActiveCameras.end(); ++it)
|
||||
removeCamera(*it);
|
||||
}
|
||||
|
||||
void GlobalMap::render (Loading::Listener* loadingListener)
|
||||
|
@ -507,7 +511,8 @@ namespace MWRender
|
|||
void GlobalMap::cleanupCameras()
|
||||
{
|
||||
for (CameraVector::iterator it = mCamerasPendingRemoval.begin(); it != mCamerasPendingRemoval.end(); ++it)
|
||||
mRoot->removeChild(*it);
|
||||
removeCamera(*it);
|
||||
|
||||
mCamerasPendingRemoval.clear();
|
||||
|
||||
for (ImageDestVector::iterator it = mPendingImageDest.begin(); it != mPendingImageDest.end();)
|
||||
|
@ -524,4 +529,10 @@ namespace MWRender
|
|||
it = mPendingImageDest.erase(it);
|
||||
}
|
||||
}
|
||||
|
||||
void GlobalMap::removeCamera(osg::Camera *cam)
|
||||
{
|
||||
cam->removeChildren(0, cam->getNumChildren());
|
||||
mRoot->removeChild(cam);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,6 +56,8 @@ namespace MWRender
|
|||
*/
|
||||
void cleanupCameras();
|
||||
|
||||
void removeCamera(osg::Camera* cam);
|
||||
|
||||
/**
|
||||
* Mark a camera for cleanup in the next update. For internal use only.
|
||||
*/
|
||||
|
|
|
@ -88,9 +88,9 @@ LocalMap::LocalMap(osgViewer::Viewer* viewer)
|
|||
LocalMap::~LocalMap()
|
||||
{
|
||||
for (CameraVector::iterator it = mActiveCameras.begin(); it != mActiveCameras.end(); ++it)
|
||||
mRoot->removeChild(*it);
|
||||
removeCamera(*it);
|
||||
for (CameraVector::iterator it = mCamerasPendingRemoval.begin(); it != mCamerasPendingRemoval.end(); ++it)
|
||||
mRoot->removeChild(*it);
|
||||
removeCamera(*it);
|
||||
}
|
||||
|
||||
const osg::Vec2f LocalMap::rotatePoint(const osg::Vec2f& point, const osg::Vec2f& center, const float angle)
|
||||
|
@ -275,6 +275,12 @@ osg::ref_ptr<osg::Texture2D> LocalMap::getFogOfWarTexture(int x, int y)
|
|||
return found->second.mFogOfWarTexture;
|
||||
}
|
||||
|
||||
void LocalMap::removeCamera(osg::Camera *cam)
|
||||
{
|
||||
cam->removeChildren(0, cam->getNumChildren());
|
||||
mRoot->removeChild(cam);
|
||||
}
|
||||
|
||||
void LocalMap::markForRemoval(osg::Camera *cam)
|
||||
{
|
||||
CameraVector::iterator found = std::find(mActiveCameras.begin(), mActiveCameras.end(), cam);
|
||||
|
@ -293,11 +299,7 @@ void LocalMap::cleanupCameras()
|
|||
return;
|
||||
|
||||
for (CameraVector::iterator it = mCamerasPendingRemoval.begin(); it != mCamerasPendingRemoval.end(); ++it)
|
||||
{
|
||||
(*it)->removeChildren(0, (*it)->getNumChildren());
|
||||
(*it)->setGraphicsContext(NULL);
|
||||
mRoot->removeChild(*it);
|
||||
}
|
||||
removeCamera(*it);
|
||||
|
||||
mCamerasPendingRemoval.clear();
|
||||
}
|
||||
|
|
|
@ -63,6 +63,8 @@ namespace MWRender
|
|||
|
||||
osg::ref_ptr<osg::Texture2D> getFogOfWarTexture (int x, int y);
|
||||
|
||||
void removeCamera(osg::Camera* cam);
|
||||
|
||||
/**
|
||||
* Indicates a camera has been queued for rendering and can be cleaned up in the next frame. For internal use only.
|
||||
*/
|
||||
|
|
|
@ -443,11 +443,13 @@ void Water::updateWaterMaterial()
|
|||
{
|
||||
if (mReflection)
|
||||
{
|
||||
mReflection->removeChildren(0, mReflection->getNumChildren());
|
||||
mParent->removeChild(mReflection);
|
||||
mReflection = NULL;
|
||||
}
|
||||
if (mRefraction)
|
||||
{
|
||||
mRefraction->removeChildren(0, mRefraction->getNumChildren());
|
||||
mParent->removeChild(mRefraction);
|
||||
mRefraction = NULL;
|
||||
}
|
||||
|
@ -572,11 +574,13 @@ Water::~Water()
|
|||
|
||||
if (mReflection)
|
||||
{
|
||||
mReflection->removeChildren(0, mReflection->getNumChildren());
|
||||
mParent->removeChild(mReflection);
|
||||
mReflection = NULL;
|
||||
}
|
||||
if (mRefraction)
|
||||
{
|
||||
mRefraction->removeChildren(0, mRefraction->getNumChildren());
|
||||
mParent->removeChild(mRefraction);
|
||||
mRefraction = NULL;
|
||||
}
|
||||
|
|
|
@ -412,6 +412,8 @@ void RenderManager::initialise()
|
|||
|
||||
void RenderManager::shutdown()
|
||||
{
|
||||
mGuiRoot->removeChildren(0, mGuiRoot->getNumChildren());
|
||||
mSceneRoot->removeChild(mGuiRoot);
|
||||
}
|
||||
|
||||
MyGUI::IVertexBuffer* RenderManager::createVertexBuffer()
|
||||
|
|
Loading…
Reference in a new issue