mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-19 18:11:35 +00:00
Merge remote-tracking branch 'vorenon/master'
This commit is contained in:
commit
b84176761a
3 changed files with 22 additions and 13 deletions
|
@ -106,7 +106,7 @@ namespace MWGui
|
||||||
float progress = (float(mCurrentCellLoading)+refProgress) / float(mTotalCellsLoading);
|
float progress = (float(mCurrentCellLoading)+refProgress) / float(mTotalCellsLoading);
|
||||||
assert(progress <= 1 && progress >= 0);
|
assert(progress <= 1 && progress >= 0);
|
||||||
|
|
||||||
mLoadingText->setCaption(stage + "... ");
|
mLoadingText->setCaption(stage);
|
||||||
mProgressBar->setProgressPosition (static_cast<size_t>(progress * 1000));
|
mProgressBar->setProgressPosition (static_cast<size_t>(progress * 1000));
|
||||||
|
|
||||||
static float loadingScreenFps = 30.f;
|
static float loadingScreenFps = 30.f;
|
||||||
|
|
|
@ -27,13 +27,10 @@ namespace
|
||||||
{
|
{
|
||||||
const MWWorld::Class& class_ =
|
const MWWorld::Class& class_ =
|
||||||
MWWorld::Class::get (MWWorld::Ptr (&*cellRefList.mList.begin(), &cell));
|
MWWorld::Class::get (MWWorld::Ptr (&*cellRefList.mList.begin(), &cell));
|
||||||
|
|
||||||
size_t numRefs = cellRefList.mList.size();
|
|
||||||
int current = 0;
|
int current = 0;
|
||||||
for (typename T::List::iterator it = cellRefList.mList.begin();
|
for (typename T::List::iterator it = cellRefList.mList.begin();
|
||||||
it != cellRefList.mList.end(); it++)
|
it != cellRefList.mList.end(); it++)
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getWindowManager ()->setLoadingProgress ("Loading cells", 1, current, numRefs);
|
|
||||||
++current;
|
++current;
|
||||||
|
|
||||||
if (it->mData.getCount() || it->mData.isEnabled())
|
if (it->mData.getCount() || it->mData.isEnabled())
|
||||||
|
@ -55,10 +52,6 @@ namespace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
MWBase::Environment::get().getWindowManager ()->setLoadingProgress ("Loading cells", 1, 0, 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -176,12 +169,18 @@ 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)
|
||||||
{
|
{
|
||||||
Nif::NIFFile::CacheLock cachelock;
|
Nif::NIFFile::CacheLock cachelock;
|
||||||
|
const MWWorld::Store<ESM::GameSetting> &gmst =
|
||||||
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
||||||
|
|
||||||
mRendering.preCellChange(mCurrentCell);
|
mRendering.preCellChange(mCurrentCell);
|
||||||
|
|
||||||
// remove active
|
// remove active
|
||||||
MWBase::Environment::get().getMechanicsManager()->remove(MWBase::Environment::get().getWorld()->getPlayer().getPlayer());
|
MWBase::Environment::get().getMechanicsManager()->remove(MWBase::Environment::get().getWorld()->getPlayer().getPlayer());
|
||||||
|
|
||||||
|
std::string loadingExteriorText;
|
||||||
|
|
||||||
|
loadingExteriorText = gmst.find ("sLoadingMessage3")->getString();
|
||||||
|
|
||||||
CellStoreCollection::iterator active = mActiveCells.begin();
|
CellStoreCollection::iterator active = mActiveCells.begin();
|
||||||
|
|
||||||
// get the number of cells to unload
|
// get the number of cells to unload
|
||||||
|
@ -216,7 +215,6 @@ namespace MWWorld
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unloadCell (active++);
|
unloadCell (active++);
|
||||||
++current;
|
++current;
|
||||||
}
|
}
|
||||||
|
@ -265,7 +263,9 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
CellStore *cell = MWBase::Environment::get().getWorld()->getExterior(x, y);
|
CellStore *cell = MWBase::Environment::get().getWorld()->getExterior(x, y);
|
||||||
|
|
||||||
MWBase::Environment::get().getWindowManager ()->setLoadingProgress ("Loading cells", 0, current, numLoad);
|
//Loading Exterior loading text
|
||||||
|
MWBase::Environment::get().getWindowManager ()->setLoadingProgress (loadingExteriorText, 0, current, numLoad);
|
||||||
|
|
||||||
loadCell (cell);
|
loadCell (cell);
|
||||||
++current;
|
++current;
|
||||||
}
|
}
|
||||||
|
@ -324,6 +324,13 @@ namespace MWWorld
|
||||||
|
|
||||||
void Scene::changeToInteriorCell (const std::string& cellName, const ESM::Position& position)
|
void Scene::changeToInteriorCell (const std::string& cellName, const ESM::Position& position)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
const MWWorld::Store<ESM::GameSetting> &gmst =
|
||||||
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
||||||
|
|
||||||
|
std::string loadingInteriorText;
|
||||||
|
loadingInteriorText = gmst.find ("sLoadingMessage2")->getString();
|
||||||
|
|
||||||
CellStore *cell = MWBase::Environment::get().getWorld()->getInterior(cellName);
|
CellStore *cell = MWBase::Environment::get().getWorld()->getInterior(cellName);
|
||||||
bool loadcell = (mCurrentCell == NULL);
|
bool loadcell = (mCurrentCell == NULL);
|
||||||
if(!loadcell)
|
if(!loadcell)
|
||||||
|
@ -359,7 +366,6 @@ namespace MWWorld
|
||||||
active = mActiveCells.begin();
|
active = mActiveCells.begin();
|
||||||
while (active!=mActiveCells.end())
|
while (active!=mActiveCells.end())
|
||||||
{
|
{
|
||||||
|
|
||||||
unloadCell (active++);
|
unloadCell (active++);
|
||||||
++current;
|
++current;
|
||||||
}
|
}
|
||||||
|
@ -367,7 +373,9 @@ namespace MWWorld
|
||||||
// Load cell.
|
// Load cell.
|
||||||
std::cout << "cellName: " << cell->mCell->mName << std::endl;
|
std::cout << "cellName: " << cell->mCell->mName << std::endl;
|
||||||
|
|
||||||
MWBase::Environment::get().getWindowManager ()->setLoadingProgress ("Loading cells", 0, 0, 1);
|
//Loading Interior loading text
|
||||||
|
MWBase::Environment::get().getWindowManager ()->setLoadingProgress (loadingInteriorText, 0, 0, 1);
|
||||||
|
|
||||||
loadCell (cell);
|
loadCell (cell);
|
||||||
|
|
||||||
mCurrentCell = cell;
|
mCurrentCell = cell;
|
||||||
|
|
|
@ -8,7 +8,8 @@
|
||||||
|
|
||||||
<Widget type="Widget" skin="HUD_Box" position="0 200 300 60" align="Bottom HCenter">
|
<Widget type="Widget" skin="HUD_Box" position="0 200 300 60" align="Bottom HCenter">
|
||||||
|
|
||||||
<Widget type="AutoSizedTextBox" skin="SandText" position="20 12 260 24" name="LoadingText">
|
<Widget type="TextBox" skin="SandText" position="20 12 260 20" name="LoadingText">
|
||||||
|
<Property key="TextAlign" value="Center"/>
|
||||||
</Widget>
|
</Widget>
|
||||||
|
|
||||||
<Widget type="ProgressBar" skin="MW_Progress_Loading" position="20 36 260 8" name="ProgressBar">
|
<Widget type="ProgressBar" skin="MW_Progress_Loading" position="20 36 260 8" name="ProgressBar">
|
||||||
|
|
Loading…
Reference in a new issue