1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-31 21:45:33 +00:00

Bug #416: Workaround for page flipping problem

This commit is contained in:
scrawl 2014-03-05 22:24:05 +01:00
parent 1d926816b5
commit 83b6fcf22e
2 changed files with 17 additions and 3 deletions

View file

@ -72,6 +72,10 @@ namespace MWGui
void LoadingScreen::loadingOn()
{
// Early-out if already on
if (mRectangle->getVisible())
return;
// Temporarily turn off VSync, we want to do actual loading rather than waiting for the screen to sync.
// Threaded loading would be even better, of course - especially because some drivers force VSync to on and we can't change it.
// In Ogre 1.8, the swapBuffers argument is useless and setVSyncEnabled is bugged with GLX, nothing we can do :/
@ -80,6 +84,15 @@ namespace MWGui
mWindow->setVSyncEnabled(false);
#endif
if (!mFirstLoad)
{
// When the loading screen is updated, we will disable render target clearing and only draw the loading bar itself.
// But if using page flipping, this can cause jitteriness as it will alternate between the last two rendered frames.
// Even though we attempt to disable vsync above, this may not work if it's forced on the driver level.
// Therefore render the same frame twice before activating the loading bar.
mWindow->update();
}
setVisible(true);
if (mFirstLoad)

View file

@ -214,12 +214,13 @@ namespace MWWorld
void Scene::changeCell (int X, int Y, const ESM::Position& position, bool adjustPlayerPos)
{
mRendering.enableTerrain(true);
Nif::NIFFile::CacheLock cachelock;
Loading::Listener* loadingListener = MWBase::Environment::get().getWindowManager()->getLoadingScreen();
Loading::ScopedLoad load(loadingListener);
mRendering.enableTerrain(true);
std::string loadingExteriorText = "#{sLoadingMessage3}";
loadingListener->setLabel(loadingExteriorText);
@ -364,11 +365,11 @@ namespace MWWorld
Nif::NIFFile::CacheLock lock;
MWBase::Environment::get().getWorld ()->getFader ()->fadeOut(0.5);
mRendering.enableTerrain(false);
Loading::Listener* loadingListener = MWBase::Environment::get().getWindowManager()->getLoadingScreen();
Loading::ScopedLoad load(loadingListener);
mRendering.enableTerrain(false);
std::string loadingInteriorText = "#{sLoadingMessage2}";
loadingListener->setLabel(loadingInteriorText);