1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-01 23:45:31 +00:00
This commit is contained in:
scrawl 2012-09-13 00:21:58 +02:00
parent a96ed6ac61
commit 2f0b47fc38
8 changed files with 30 additions and 21 deletions

View file

@ -218,6 +218,7 @@ namespace MWBase
virtual void executeInConsole (const std::string& path) = 0;
virtual void setLoadingProgress (const std::string& stage, int depth, int current, int total) = 0;
virtual void loadingDone() = 0;
};
}

View file

@ -80,11 +80,7 @@ namespace MWGui
mTotalRefsLoading = total;
}
if (mTotalCellsLoading == 0)
{
loadingOff();
return;
}
assert (mTotalCellsLoading != 0);
float refProgress;
if (mTotalRefsLoading <= 1)
@ -101,11 +97,6 @@ namespace MWGui
float progress = (float(mCurrentCellLoading)+refProgress) / float(mTotalCellsLoading);
assert(progress <= 1 && progress >= 0);
if (progress >= 1)
{
loadingOff();
return;
}
mLoadingText->setCaption(stage + "... ");
mProgressBar->setProgressPosition (static_cast<size_t>(progress * 1000));
@ -138,13 +129,14 @@ namespace MWGui
if (!hasCompositor)
{
mWindow->getViewport(0)->setClearEveryFrame(false);
//mWindow->getViewport(0)->setClearEveryFrame(false);
}
else
{
if (!mFirstLoad)
mBackgroundMaterial->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName(chain->getCompositor ("gbufferFinalizer")->getTextureInstance ("no_mrt_output", 0)->getName());
mRectangle->setVisible(true);
{
//mBackgroundMaterial->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName(chain->getCompositor ("gbufferFinalizer")->getTextureInstance ("no_mrt_output", 0)->getName());
}
for (unsigned int i = 0; i<chain->getNumCompositors(); ++i)
{
@ -152,6 +144,9 @@ namespace MWGui
}
}
mRectangle->setVisible(hasCompositor || mFirstLoad);
std::cout << "rect vis? " << mRectangle->getVisible () << " first load? " << mFirstLoad << std::endl;
mBackgroundMaterial->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName("Splash/Splash_Bonelord.tga");
mWindow->update();
if (!hasCompositor)
@ -162,17 +157,24 @@ namespace MWGui
{
Ogre::CompositorManager::getSingleton().setCompositorEnabled(mWindow->getViewport(0), chain->getCompositor(i)->getCompositor()->getName(), true);
}
mRectangle->setVisible(false);
}
mRectangle->setVisible(false);
// resume 3d rendering
mSceneMgr->clearSpecialCaseRenderQueues();
mSceneMgr->setSpecialCaseRenderQueueMode(Ogre::SceneManager::SCRQM_EXCLUDE);
}
}
void LoadingScreen::loadingDone()
{
loadingOff();
}
void LoadingScreen::loadingOn()
{
std::cout << "loading on " <<std::endl;
setVisible(true);
mLoadingOn = true;
@ -204,10 +206,10 @@ namespace MWGui
void LoadingScreen::loadingOff()
{
std::cout << "loading off " << std::endl;
setVisible(false);
mLoadingOn = false;
mFirstLoad = false;
mRectangle->setVisible(false);
//mFirstLoad = false;
mWindowManager.removeGuiMode(GM_Loading);
mWindowManager.removeGuiMode(GM_LoadingWallpaper);

View file

@ -15,6 +15,7 @@ namespace MWGui
virtual ~LoadingScreen();
void setLoadingProgress (const std::string& stage, int depth, int current, int total);
void loadingDone();
void onResChange(int w, int h);

View file

@ -918,3 +918,8 @@ void WindowManager::setLoadingProgress (const std::string& stage, int depth, int
{
mLoadingScreen->setLoadingProgress (stage, depth, current, total);
}
void WindowManager::loadingDone ()
{
mLoadingScreen->loadingDone ();
}

View file

@ -197,6 +197,7 @@ namespace MWGui
virtual void executeInConsole (const std::string& path);
virtual void setLoadingProgress (const std::string& stage, int depth, int current, int total);
virtual void loadingDone();
private:
OEngine::GUI::MyGUIManager *mGuiManager;

View file

@ -11,9 +11,6 @@
#include <OgreBillboardSet.h>
#include <OgreEntity.h>
#include <OgreSubEntity.h>
#include <OgreOverlay.h>
#include <OgreOverlayManager.h>
#include <OgreOverlayContainer.h>
#include <boost/lexical_cast.hpp>

View file

@ -24,7 +24,6 @@ namespace Ogre
class Entity;
class BillboardSet;
class TextureUnitState;
class Overlay;
}
namespace MWRender

View file

@ -290,7 +290,6 @@ namespace MWWorld
mCurrentCell = *iter;
// adjust player
playerCellChange (mCurrentCell, position, adjustPlayerPos);
@ -300,6 +299,8 @@ namespace MWWorld
mRendering.switchToExterior();
mCellChanged = true;
MWBase::Environment::get().getWindowManager ()->loadingDone ();
}
//We need the ogre renderer and a scene node.
@ -369,6 +370,8 @@ namespace MWWorld
MWBase::Environment::get().getWorld()->adjustSky();
mCellChanged = true;
MWBase::Environment::get().getWindowManager ()->loadingDone ();
}
void Scene::changeToExteriorCell (const ESM::Position& position)