mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-15 00:40:02 +00:00
Fix the frameNumber not being incremented in certain frames
This commit is contained in:
parent
0210b87ffc
commit
6e69808129
@ -282,7 +282,13 @@ namespace MWGui
|
|||||||
MWBase::Environment::get().getInputManager()->update(0, true, true);
|
MWBase::Environment::get().getInputManager()->update(0, true, true);
|
||||||
|
|
||||||
//osg::Timer timer;
|
//osg::Timer timer;
|
||||||
mViewer->frame(mViewer->getFrameStamp()->getSimulationTime());
|
// at the time this function is called we are in the middle of a frame,
|
||||||
|
// so out of order calls are necessary to get a correct frameNumber for the next frame.
|
||||||
|
// refer to the advance() and frame() order in Engine::go()
|
||||||
|
mViewer->eventTraversal();
|
||||||
|
mViewer->updateTraversal();
|
||||||
|
mViewer->renderingTraversals();
|
||||||
|
mViewer->advance(mViewer->getFrameStamp()->getSimulationTime());
|
||||||
//std::cout << "frame took " << timer.time_m() << std::endl;
|
//std::cout << "frame took " << timer.time_m() << std::endl;
|
||||||
|
|
||||||
//if (mViewer->getIncrementalCompileOperation())
|
//if (mViewer->getIncrementalCompileOperation())
|
||||||
|
@ -859,7 +859,13 @@ namespace MWGui
|
|||||||
mMessageBoxManager->onFrame(0.f);
|
mMessageBoxManager->onFrame(0.f);
|
||||||
MWBase::Environment::get().getInputManager()->update(0, true, false);
|
MWBase::Environment::get().getInputManager()->update(0, true, false);
|
||||||
|
|
||||||
mViewer->frame(mViewer->getFrameStamp()->getSimulationTime());
|
// at the time this function is called we are in the middle of a frame,
|
||||||
|
// so out of order calls are necessary to get a correct frameNumber for the next frame.
|
||||||
|
// refer to the advance() and frame() order in Engine::go()
|
||||||
|
mViewer->eventTraversal();
|
||||||
|
mViewer->updateTraversal();
|
||||||
|
mViewer->renderingTraversals();
|
||||||
|
mViewer->advance(mViewer->getFrameStamp()->getSimulationTime());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1756,7 +1762,13 @@ namespace MWGui
|
|||||||
{
|
{
|
||||||
MWBase::Environment::get().getInputManager()->update(0, true, false);
|
MWBase::Environment::get().getInputManager()->update(0, true, false);
|
||||||
|
|
||||||
mViewer->frame(mViewer->getFrameStamp()->getSimulationTime());
|
// at the time this function is called we are in the middle of a frame,
|
||||||
|
// so out of order calls are necessary to get a correct frameNumber for the next frame.
|
||||||
|
// refer to the advance() and frame() order in Engine::go()
|
||||||
|
mViewer->eventTraversal();
|
||||||
|
mViewer->updateTraversal();
|
||||||
|
mViewer->renderingTraversals();
|
||||||
|
mViewer->advance(mViewer->getFrameStamp()->getSimulationTime());
|
||||||
}
|
}
|
||||||
mVideoWidget->stop();
|
mVideoWidget->stop();
|
||||||
|
|
||||||
|
@ -521,10 +521,18 @@ namespace MWRender
|
|||||||
osg::ref_ptr<NotifyDrawCompletedCallback> callback (new NotifyDrawCompletedCallback);
|
osg::ref_ptr<NotifyDrawCompletedCallback> callback (new NotifyDrawCompletedCallback);
|
||||||
rttCamera->setFinalDrawCallback(callback);
|
rttCamera->setFinalDrawCallback(callback);
|
||||||
|
|
||||||
mViewer->frame(mViewer->getFrameStamp()->getSimulationTime());
|
// at the time this function is called we are in the middle of a frame,
|
||||||
|
// so out of order calls are necessary to get a correct frameNumber for the next frame.
|
||||||
|
// refer to the advance() and frame() order in Engine::go()
|
||||||
|
mViewer->eventTraversal();
|
||||||
|
mViewer->updateTraversal();
|
||||||
|
mViewer->renderingTraversals();
|
||||||
|
|
||||||
callback->waitTillDone();
|
callback->waitTillDone();
|
||||||
|
|
||||||
|
// now that we've "used up" the current frame, get a fresh framenumber for the next frame() following after the screenshot is completed
|
||||||
|
mViewer->advance(mViewer->getFrameStamp()->getSimulationTime());
|
||||||
|
|
||||||
rttCamera->removeChildren(0, rttCamera->getNumChildren());
|
rttCamera->removeChildren(0, rttCamera->getNumChildren());
|
||||||
rttCamera->setGraphicsContext(NULL);
|
rttCamera->setGraphicsContext(NULL);
|
||||||
mRootNode->removeChild(rttCamera);
|
mRootNode->removeChild(rttCamera);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user