forked from mirror/openmw-tes3mp
Bug #416: Workaround for page flipping problem
This commit is contained in:
parent
1d926816b5
commit
83b6fcf22e
2 changed files with 17 additions and 3 deletions
|
@ -72,6 +72,10 @@ namespace MWGui
|
||||||
|
|
||||||
void LoadingScreen::loadingOn()
|
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.
|
// 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.
|
// 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 :/
|
// 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);
|
mWindow->setVSyncEnabled(false);
|
||||||
#endif
|
#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);
|
setVisible(true);
|
||||||
|
|
||||||
if (mFirstLoad)
|
if (mFirstLoad)
|
||||||
|
|
|
@ -214,12 +214,13 @@ namespace MWWorld
|
||||||
|
|
||||||
void Scene::changeCell (int X, int Y, const ESM::Position& position, bool adjustPlayerPos)
|
void Scene::changeCell (int X, int Y, const ESM::Position& position, bool adjustPlayerPos)
|
||||||
{
|
{
|
||||||
mRendering.enableTerrain(true);
|
|
||||||
Nif::NIFFile::CacheLock cachelock;
|
Nif::NIFFile::CacheLock cachelock;
|
||||||
|
|
||||||
Loading::Listener* loadingListener = MWBase::Environment::get().getWindowManager()->getLoadingScreen();
|
Loading::Listener* loadingListener = MWBase::Environment::get().getWindowManager()->getLoadingScreen();
|
||||||
Loading::ScopedLoad load(loadingListener);
|
Loading::ScopedLoad load(loadingListener);
|
||||||
|
|
||||||
|
mRendering.enableTerrain(true);
|
||||||
|
|
||||||
std::string loadingExteriorText = "#{sLoadingMessage3}";
|
std::string loadingExteriorText = "#{sLoadingMessage3}";
|
||||||
loadingListener->setLabel(loadingExteriorText);
|
loadingListener->setLabel(loadingExteriorText);
|
||||||
|
|
||||||
|
@ -364,11 +365,11 @@ namespace MWWorld
|
||||||
Nif::NIFFile::CacheLock lock;
|
Nif::NIFFile::CacheLock lock;
|
||||||
MWBase::Environment::get().getWorld ()->getFader ()->fadeOut(0.5);
|
MWBase::Environment::get().getWorld ()->getFader ()->fadeOut(0.5);
|
||||||
|
|
||||||
mRendering.enableTerrain(false);
|
|
||||||
|
|
||||||
Loading::Listener* loadingListener = MWBase::Environment::get().getWindowManager()->getLoadingScreen();
|
Loading::Listener* loadingListener = MWBase::Environment::get().getWindowManager()->getLoadingScreen();
|
||||||
Loading::ScopedLoad load(loadingListener);
|
Loading::ScopedLoad load(loadingListener);
|
||||||
|
|
||||||
|
mRendering.enableTerrain(false);
|
||||||
|
|
||||||
std::string loadingInteriorText = "#{sLoadingMessage2}";
|
std::string loadingInteriorText = "#{sLoadingMessage2}";
|
||||||
loadingListener->setLabel(loadingInteriorText);
|
loadingListener->setLabel(loadingInteriorText);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue