mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 16:29:55 +00:00
Fix MyGUI rendering not taking DataVariance of textures into account
This commit is contained in:
parent
52a4456cf7
commit
d432a3ed08
1 changed files with 9 additions and 1 deletions
|
@ -401,6 +401,9 @@ void RenderManager::destroyVertexBuffer(MyGUI::IVertexBuffer *buffer)
|
|||
|
||||
void RenderManager::begin()
|
||||
{
|
||||
mDrawable->clear();
|
||||
// variance will be recomputed based on textures being rendered in this frame
|
||||
mDrawable->setDataVariance(osg::Object::STATIC);
|
||||
}
|
||||
|
||||
void RenderManager::doRender(MyGUI::IVertexBuffer *buffer, MyGUI::ITexture *texture, size_t count)
|
||||
|
@ -410,7 +413,11 @@ void RenderManager::doRender(MyGUI::IVertexBuffer *buffer, MyGUI::ITexture *text
|
|||
batch.mVertexBuffer = static_cast<OSGVertexBuffer*>(buffer)->getBuffer();
|
||||
batch.mArray = static_cast<OSGVertexBuffer*>(buffer)->getArray();
|
||||
if (texture)
|
||||
{
|
||||
batch.mTexture = static_cast<OSGTexture*>(texture)->getTexture();
|
||||
if (batch.mTexture->getDataVariance() == osg::Object::DYNAMIC)
|
||||
mDrawable->setDataVariance(osg::Object::DYNAMIC); // only for this frame, reset in begin()
|
||||
}
|
||||
|
||||
mDrawable->addBatch(batch);
|
||||
}
|
||||
|
@ -433,8 +440,9 @@ void RenderManager::update()
|
|||
|
||||
void RenderManager::collectDrawCalls()
|
||||
{
|
||||
mDrawable->clear();
|
||||
begin();
|
||||
onRenderToTarget(this, mUpdate);
|
||||
end();
|
||||
|
||||
mUpdate = false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue