forked from teamnwah/openmw-tes3coop
Use only Cell records for saving progress bar (Fixes #2259)
This commit is contained in:
parent
0ec018f7f1
commit
c3f3f8b3d0
18 changed files with 11 additions and 30 deletions
|
@ -104,6 +104,7 @@ namespace MWBase
|
||||||
virtual void clear() = 0;
|
virtual void clear() = 0;
|
||||||
|
|
||||||
virtual int countSavedGameRecords() const = 0;
|
virtual int countSavedGameRecords() const = 0;
|
||||||
|
virtual int countSavedGameCells() const = 0;
|
||||||
|
|
||||||
virtual void write (ESM::ESMWriter& writer, Loading::Listener& listener) const = 0;
|
virtual void write (ESM::ESMWriter& writer, Loading::Listener& listener) const = 0;
|
||||||
|
|
||||||
|
|
|
@ -645,7 +645,6 @@ namespace MWDialogue
|
||||||
writer.startRecord (ESM::REC_DIAS);
|
writer.startRecord (ESM::REC_DIAS);
|
||||||
state.save (writer);
|
state.save (writer);
|
||||||
writer.endRecord (ESM::REC_DIAS);
|
writer.endRecord (ESM::REC_DIAS);
|
||||||
progress.increaseProgress();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogueManager::readRecord (ESM::ESMReader& reader, int32_t type)
|
void DialogueManager::readRecord (ESM::ESMReader& reader, int32_t type)
|
||||||
|
|
|
@ -187,7 +187,6 @@ namespace MWDialogue
|
||||||
writer.startRecord (ESM::REC_QUES);
|
writer.startRecord (ESM::REC_QUES);
|
||||||
state.save (writer);
|
state.save (writer);
|
||||||
writer.endRecord (ESM::REC_QUES);
|
writer.endRecord (ESM::REC_QUES);
|
||||||
progress.increaseProgress();
|
|
||||||
|
|
||||||
for (Topic::TEntryIter iter (quest.begin()); iter!=quest.end(); ++iter)
|
for (Topic::TEntryIter iter (quest.begin()); iter!=quest.end(); ++iter)
|
||||||
{
|
{
|
||||||
|
@ -198,7 +197,6 @@ namespace MWDialogue
|
||||||
writer.startRecord (ESM::REC_JOUR);
|
writer.startRecord (ESM::REC_JOUR);
|
||||||
entry.save (writer);
|
entry.save (writer);
|
||||||
writer.endRecord (ESM::REC_JOUR);
|
writer.endRecord (ESM::REC_JOUR);
|
||||||
progress.increaseProgress();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,7 +208,6 @@ namespace MWDialogue
|
||||||
writer.startRecord (ESM::REC_JOUR);
|
writer.startRecord (ESM::REC_JOUR);
|
||||||
entry.save (writer);
|
entry.save (writer);
|
||||||
writer.endRecord (ESM::REC_JOUR);
|
writer.endRecord (ESM::REC_JOUR);
|
||||||
progress.increaseProgress();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (TTopicIter iter (mTopics.begin()); iter!=mTopics.end(); ++iter)
|
for (TTopicIter iter (mTopics.begin()); iter!=mTopics.end(); ++iter)
|
||||||
|
@ -226,7 +223,6 @@ namespace MWDialogue
|
||||||
writer.startRecord (ESM::REC_JOUR);
|
writer.startRecord (ESM::REC_JOUR);
|
||||||
entry.save (writer);
|
entry.save (writer);
|
||||||
writer.endRecord (ESM::REC_JOUR);
|
writer.endRecord (ESM::REC_JOUR);
|
||||||
progress.increaseProgress();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -903,7 +903,6 @@ namespace MWGui
|
||||||
writer.startRecord(ESM::REC_GMAP);
|
writer.startRecord(ESM::REC_GMAP);
|
||||||
map.save(writer);
|
map.save(writer);
|
||||||
writer.endRecord(ESM::REC_GMAP);
|
writer.endRecord(ESM::REC_GMAP);
|
||||||
progress.increaseProgress();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapWindow::readRecord(ESM::ESMReader &reader, int32_t type)
|
void MapWindow::readRecord(ESM::ESMReader &reader, int32_t type)
|
||||||
|
|
|
@ -1604,14 +1604,12 @@ namespace MWGui
|
||||||
mMap->write(writer, progress);
|
mMap->write(writer, progress);
|
||||||
|
|
||||||
mQuickKeysMenu->write(writer);
|
mQuickKeysMenu->write(writer);
|
||||||
progress.increaseProgress();
|
|
||||||
|
|
||||||
if (!mSelectedSpell.empty())
|
if (!mSelectedSpell.empty())
|
||||||
{
|
{
|
||||||
writer.startRecord(ESM::REC_ASPL);
|
writer.startRecord(ESM::REC_ASPL);
|
||||||
writer.writeHNString("ID__", mSelectedSpell);
|
writer.writeHNString("ID__", mSelectedSpell);
|
||||||
writer.endRecord(ESM::REC_ASPL);
|
writer.endRecord(ESM::REC_ASPL);
|
||||||
progress.increaseProgress();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (std::vector<CustomMarker>::const_iterator it = mCustomMarkers.begin(); it != mCustomMarkers.end(); ++it)
|
for (std::vector<CustomMarker>::const_iterator it = mCustomMarkers.begin(); it != mCustomMarkers.end(); ++it)
|
||||||
|
@ -1619,7 +1617,6 @@ namespace MWGui
|
||||||
writer.startRecord(ESM::REC_MARK);
|
writer.startRecord(ESM::REC_MARK);
|
||||||
(*it).save(writer);
|
(*it).save(writer);
|
||||||
writer.endRecord(ESM::REC_MARK);
|
writer.endRecord(ESM::REC_MARK);
|
||||||
progress.increaseProgress();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1460,8 +1460,6 @@ namespace MWMechanics
|
||||||
writer.writeHNT ("COUN", it->second);
|
writer.writeHNT ("COUN", it->second);
|
||||||
}
|
}
|
||||||
writer.endRecord(ESM::REC_DCOU);
|
writer.endRecord(ESM::REC_DCOU);
|
||||||
|
|
||||||
listener.increaseProgress(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Actors::readRecord (ESM::ESMReader& reader, int32_t type)
|
void Actors::readRecord (ESM::ESMReader& reader, int32_t type)
|
||||||
|
|
|
@ -157,7 +157,6 @@ namespace MWRender
|
||||||
data[texelY * mWidth * 3 + texelX * 3+2] = b;
|
data[texelY * mWidth * 3 + texelX * 3+2] = b;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
loadingListener->increaseProgress(1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -142,7 +142,6 @@ namespace MWScript
|
||||||
writer.startRecord (ESM::REC_GSCR);
|
writer.startRecord (ESM::REC_GSCR);
|
||||||
script.save (writer);
|
script.save (writer);
|
||||||
writer.endRecord (ESM::REC_GSCR);
|
writer.endRecord (ESM::REC_GSCR);
|
||||||
progress.increaseProgress();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -221,7 +221,8 @@ void MWState::StateManager::saveGame (const std::string& description, const Slot
|
||||||
writer.save (stream);
|
writer.save (stream);
|
||||||
|
|
||||||
Loading::Listener& listener = *MWBase::Environment::get().getWindowManager()->getLoadingScreen();
|
Loading::Listener& listener = *MWBase::Environment::get().getWindowManager()->getLoadingScreen();
|
||||||
listener.setProgressRange(recordCount);
|
// Using only Cells for progress information, since they typically have the largest records by far
|
||||||
|
listener.setProgressRange(MWBase::Environment::get().getWorld()->countSavedGameCells());
|
||||||
listener.setLabel("#{sNotifyMessage4}");
|
listener.setLabel("#{sNotifyMessage4}");
|
||||||
|
|
||||||
Loading::ScopedLoad load(&listener);
|
Loading::ScopedLoad load(&listener);
|
||||||
|
@ -229,7 +230,6 @@ void MWState::StateManager::saveGame (const std::string& description, const Slot
|
||||||
writer.startRecord (ESM::REC_SAVE);
|
writer.startRecord (ESM::REC_SAVE);
|
||||||
slot->mProfile.save (writer);
|
slot->mProfile.save (writer);
|
||||||
writer.endRecord (ESM::REC_SAVE);
|
writer.endRecord (ESM::REC_SAVE);
|
||||||
listener.increaseProgress();
|
|
||||||
|
|
||||||
MWBase::Environment::get().getJournal()->write (writer, listener);
|
MWBase::Environment::get().getJournal()->write (writer, listener);
|
||||||
MWBase::Environment::get().getDialogueManager()->write (writer, listener);
|
MWBase::Environment::get().getDialogueManager()->write (writer, listener);
|
||||||
|
|
|
@ -287,7 +287,7 @@ void MWWorld::Cells::write (ESM::ESMWriter& writer, Loading::Listener& progress)
|
||||||
if (iter->second.hasState())
|
if (iter->second.hasState())
|
||||||
{
|
{
|
||||||
writeCell (writer, iter->second);
|
writeCell (writer, iter->second);
|
||||||
progress.increaseProgress(); // Assumes that each cell writes one record
|
progress.increaseProgress();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (std::map<std::string, CellStore>::iterator iter (mInteriors.begin());
|
for (std::map<std::string, CellStore>::iterator iter (mInteriors.begin());
|
||||||
|
@ -295,7 +295,7 @@ void MWWorld::Cells::write (ESM::ESMWriter& writer, Loading::Listener& progress)
|
||||||
if (iter->second.hasState())
|
if (iter->second.hasState())
|
||||||
{
|
{
|
||||||
writeCell (writer, iter->second);
|
writeCell (writer, iter->second);
|
||||||
progress.increaseProgress(); // Assumes that each cell writes one record
|
progress.increaseProgress();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -161,7 +161,6 @@ void ESMStore::setUp()
|
||||||
writer.writeT(mDynamicCount);
|
writer.writeT(mDynamicCount);
|
||||||
writer.endRecord("COUN");
|
writer.endRecord("COUN");
|
||||||
writer.endRecord(ESM::REC_DYNA);
|
writer.endRecord(ESM::REC_DYNA);
|
||||||
progress.increaseProgress();
|
|
||||||
|
|
||||||
mPotions.write (writer, progress);
|
mPotions.write (writer, progress);
|
||||||
mArmors.write (writer, progress);
|
mArmors.write (writer, progress);
|
||||||
|
|
|
@ -85,7 +85,6 @@ namespace MWWorld
|
||||||
writer.writeHNString ("NAME", iter->first);
|
writer.writeHNString ("NAME", iter->first);
|
||||||
iter->second.write (writer, ESM::Variant::Format_Global);
|
iter->second.write (writer, ESM::Variant::Format_Global);
|
||||||
writer.endRecord (ESM::REC_GLOB);
|
writer.endRecord (ESM::REC_GLOB);
|
||||||
progress.increaseProgress();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -225,8 +225,6 @@ namespace MWWorld
|
||||||
writer.startRecord (ESM::REC_PLAY);
|
writer.startRecord (ESM::REC_PLAY);
|
||||||
player.save (writer);
|
player.save (writer);
|
||||||
writer.endRecord (ESM::REC_PLAY);
|
writer.endRecord (ESM::REC_PLAY);
|
||||||
|
|
||||||
progress.increaseProgress();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Player::readRecord (ESM::ESMReader& reader, int32_t type)
|
bool Player::readRecord (ESM::ESMReader& reader, int32_t type)
|
||||||
|
|
|
@ -318,8 +318,6 @@ namespace MWWorld
|
||||||
state.save(writer);
|
state.save(writer);
|
||||||
|
|
||||||
writer.endRecord(ESM::REC_PROJ);
|
writer.endRecord(ESM::REC_PROJ);
|
||||||
|
|
||||||
progress.increaseProgress();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (std::vector<MagicBoltState>::const_iterator it = mMagicBolts.begin(); it != mMagicBolts.end(); ++it)
|
for (std::vector<MagicBoltState>::const_iterator it = mMagicBolts.begin(); it != mMagicBolts.end(); ++it)
|
||||||
|
@ -342,8 +340,6 @@ namespace MWWorld
|
||||||
state.save(writer);
|
state.save(writer);
|
||||||
|
|
||||||
writer.endRecord(ESM::REC_MPRJ);
|
writer.endRecord(ESM::REC_MPRJ);
|
||||||
|
|
||||||
progress.increaseProgress();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -325,7 +325,6 @@ namespace MWWorld
|
||||||
writer.writeHNString ("NAME", iter->second.mId);
|
writer.writeHNString ("NAME", iter->second.mId);
|
||||||
iter->second.save (writer);
|
iter->second.save (writer);
|
||||||
writer.endRecord (T::sRecordId);
|
writer.endRecord (T::sRecordId);
|
||||||
progress.increaseProgress();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -760,7 +760,6 @@ void WeatherManager::write(ESM::ESMWriter& writer, Loading::Listener& progress)
|
||||||
writer.startRecord(ESM::REC_WTHR);
|
writer.startRecord(ESM::REC_WTHR);
|
||||||
state.save(writer);
|
state.save(writer);
|
||||||
writer.endRecord(ESM::REC_WTHR);
|
writer.endRecord(ESM::REC_WTHR);
|
||||||
progress.increaseProgress();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WeatherManager::readRecord(ESM::ESMReader& reader, int32_t type)
|
bool WeatherManager::readRecord(ESM::ESMReader& reader, int32_t type)
|
||||||
|
|
|
@ -309,6 +309,11 @@ namespace MWWorld
|
||||||
+1; // camera
|
+1; // camera
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int World::countSavedGameCells() const
|
||||||
|
{
|
||||||
|
return mCells.countSavedGameRecords();
|
||||||
|
}
|
||||||
|
|
||||||
void World::write (ESM::ESMWriter& writer, Loading::Listener& progress) const
|
void World::write (ESM::ESMWriter& writer, Loading::Listener& progress) const
|
||||||
{
|
{
|
||||||
// Active cells could have a dirty fog of war, sync it to the CellStore first
|
// Active cells could have a dirty fog of war, sync it to the CellStore first
|
||||||
|
@ -320,7 +325,6 @@ namespace MWWorld
|
||||||
}
|
}
|
||||||
|
|
||||||
MWMechanics::CreatureStats::writeActorIdCounter(writer);
|
MWMechanics::CreatureStats::writeActorIdCounter(writer);
|
||||||
progress.increaseProgress();
|
|
||||||
|
|
||||||
mStore.write (writer, progress); // dynamic Store must be written (and read) before Cells, so that
|
mStore.write (writer, progress); // dynamic Store must be written (and read) before Cells, so that
|
||||||
// references to custom made records will be recognized
|
// references to custom made records will be recognized
|
||||||
|
@ -334,12 +338,10 @@ namespace MWWorld
|
||||||
writer.writeHNT("TELE", mTeleportEnabled);
|
writer.writeHNT("TELE", mTeleportEnabled);
|
||||||
writer.writeHNT("LEVT", mLevitationEnabled);
|
writer.writeHNT("LEVT", mLevitationEnabled);
|
||||||
writer.endRecord(ESM::REC_ENAB);
|
writer.endRecord(ESM::REC_ENAB);
|
||||||
progress.increaseProgress();
|
|
||||||
|
|
||||||
writer.startRecord(ESM::REC_CAM_);
|
writer.startRecord(ESM::REC_CAM_);
|
||||||
writer.writeHNT("FIRS", isFirstPerson());
|
writer.writeHNT("FIRS", isFirstPerson());
|
||||||
writer.endRecord(ESM::REC_CAM_);
|
writer.endRecord(ESM::REC_CAM_);
|
||||||
progress.increaseProgress();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void World::readRecord (ESM::ESMReader& reader, int32_t type,
|
void World::readRecord (ESM::ESMReader& reader, int32_t type,
|
||||||
|
|
|
@ -166,6 +166,7 @@ namespace MWWorld
|
||||||
virtual void clear();
|
virtual void clear();
|
||||||
|
|
||||||
virtual int countSavedGameRecords() const;
|
virtual int countSavedGameRecords() const;
|
||||||
|
virtual int countSavedGameCells() const;
|
||||||
|
|
||||||
virtual void write (ESM::ESMWriter& writer, Loading::Listener& progress) const;
|
virtual void write (ESM::ESMWriter& writer, Loading::Listener& progress) const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue