Use only Cell records for saving progress bar (Fixes #2259)

openmw-35
scrawl 10 years ago
parent 0ec018f7f1
commit c3f3f8b3d0

@ -104,6 +104,7 @@ namespace MWBase
virtual void clear() = 0;
virtual int countSavedGameRecords() const = 0;
virtual int countSavedGameCells() const = 0;
virtual void write (ESM::ESMWriter& writer, Loading::Listener& listener) const = 0;

@ -645,7 +645,6 @@ namespace MWDialogue
writer.startRecord (ESM::REC_DIAS);
state.save (writer);
writer.endRecord (ESM::REC_DIAS);
progress.increaseProgress();
}
void DialogueManager::readRecord (ESM::ESMReader& reader, int32_t type)

@ -187,7 +187,6 @@ namespace MWDialogue
writer.startRecord (ESM::REC_QUES);
state.save (writer);
writer.endRecord (ESM::REC_QUES);
progress.increaseProgress();
for (Topic::TEntryIter iter (quest.begin()); iter!=quest.end(); ++iter)
{
@ -198,7 +197,6 @@ namespace MWDialogue
writer.startRecord (ESM::REC_JOUR);
entry.save (writer);
writer.endRecord (ESM::REC_JOUR);
progress.increaseProgress();
}
}
@ -210,7 +208,6 @@ namespace MWDialogue
writer.startRecord (ESM::REC_JOUR);
entry.save (writer);
writer.endRecord (ESM::REC_JOUR);
progress.increaseProgress();
}
for (TTopicIter iter (mTopics.begin()); iter!=mTopics.end(); ++iter)
@ -226,7 +223,6 @@ namespace MWDialogue
writer.startRecord (ESM::REC_JOUR);
entry.save (writer);
writer.endRecord (ESM::REC_JOUR);
progress.increaseProgress();
}
}
}

@ -903,7 +903,6 @@ namespace MWGui
writer.startRecord(ESM::REC_GMAP);
map.save(writer);
writer.endRecord(ESM::REC_GMAP);
progress.increaseProgress();
}
void MapWindow::readRecord(ESM::ESMReader &reader, int32_t type)

@ -1604,14 +1604,12 @@ namespace MWGui
mMap->write(writer, progress);
mQuickKeysMenu->write(writer);
progress.increaseProgress();
if (!mSelectedSpell.empty())
{
writer.startRecord(ESM::REC_ASPL);
writer.writeHNString("ID__", mSelectedSpell);
writer.endRecord(ESM::REC_ASPL);
progress.increaseProgress();
}
for (std::vector<CustomMarker>::const_iterator it = mCustomMarkers.begin(); it != mCustomMarkers.end(); ++it)
@ -1619,7 +1617,6 @@ namespace MWGui
writer.startRecord(ESM::REC_MARK);
(*it).save(writer);
writer.endRecord(ESM::REC_MARK);
progress.increaseProgress();
}
}

@ -1460,8 +1460,6 @@ namespace MWMechanics
writer.writeHNT ("COUN", it->second);
}
writer.endRecord(ESM::REC_DCOU);
listener.increaseProgress(1);
}
void Actors::readRecord (ESM::ESMReader& reader, int32_t type)

@ -157,7 +157,6 @@ namespace MWRender
data[texelY * mWidth * 3 + texelX * 3+2] = b;
}
}
loadingListener->increaseProgress(1);
}
}

@ -142,7 +142,6 @@ namespace MWScript
writer.startRecord (ESM::REC_GSCR);
script.save (writer);
writer.endRecord (ESM::REC_GSCR);
progress.increaseProgress();
}
}

@ -221,7 +221,8 @@ void MWState::StateManager::saveGame (const std::string& description, const Slot
writer.save (stream);
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}");
Loading::ScopedLoad load(&listener);
@ -229,7 +230,6 @@ void MWState::StateManager::saveGame (const std::string& description, const Slot
writer.startRecord (ESM::REC_SAVE);
slot->mProfile.save (writer);
writer.endRecord (ESM::REC_SAVE);
listener.increaseProgress();
MWBase::Environment::get().getJournal()->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())
{
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());
@ -295,7 +295,7 @@ void MWWorld::Cells::write (ESM::ESMWriter& writer, Loading::Listener& progress)
if (iter->second.hasState())
{
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.endRecord("COUN");
writer.endRecord(ESM::REC_DYNA);
progress.increaseProgress();
mPotions.write (writer, progress);
mArmors.write (writer, progress);

@ -85,7 +85,6 @@ namespace MWWorld
writer.writeHNString ("NAME", iter->first);
iter->second.write (writer, ESM::Variant::Format_Global);
writer.endRecord (ESM::REC_GLOB);
progress.increaseProgress();
}
}

@ -225,8 +225,6 @@ namespace MWWorld
writer.startRecord (ESM::REC_PLAY);
player.save (writer);
writer.endRecord (ESM::REC_PLAY);
progress.increaseProgress();
}
bool Player::readRecord (ESM::ESMReader& reader, int32_t type)

@ -318,8 +318,6 @@ namespace MWWorld
state.save(writer);
writer.endRecord(ESM::REC_PROJ);
progress.increaseProgress();
}
for (std::vector<MagicBoltState>::const_iterator it = mMagicBolts.begin(); it != mMagicBolts.end(); ++it)
@ -342,8 +340,6 @@ namespace MWWorld
state.save(writer);
writer.endRecord(ESM::REC_MPRJ);
progress.increaseProgress();
}
}

@ -325,7 +325,6 @@ namespace MWWorld
writer.writeHNString ("NAME", iter->second.mId);
iter->second.save (writer);
writer.endRecord (T::sRecordId);
progress.increaseProgress();
}
}

@ -760,7 +760,6 @@ void WeatherManager::write(ESM::ESMWriter& writer, Loading::Listener& progress)
writer.startRecord(ESM::REC_WTHR);
state.save(writer);
writer.endRecord(ESM::REC_WTHR);
progress.increaseProgress();
}
bool WeatherManager::readRecord(ESM::ESMReader& reader, int32_t type)

@ -309,6 +309,11 @@ namespace MWWorld
+1; // camera
}
int World::countSavedGameCells() const
{
return mCells.countSavedGameRecords();
}
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
@ -320,7 +325,6 @@ namespace MWWorld
}
MWMechanics::CreatureStats::writeActorIdCounter(writer);
progress.increaseProgress();
mStore.write (writer, progress); // dynamic Store must be written (and read) before Cells, so that
// references to custom made records will be recognized
@ -334,12 +338,10 @@ namespace MWWorld
writer.writeHNT("TELE", mTeleportEnabled);
writer.writeHNT("LEVT", mLevitationEnabled);
writer.endRecord(ESM::REC_ENAB);
progress.increaseProgress();
writer.startRecord(ESM::REC_CAM_);
writer.writeHNT("FIRS", isFirstPerson());
writer.endRecord(ESM::REC_CAM_);
progress.increaseProgress();
}
void World::readRecord (ESM::ESMReader& reader, int32_t type,

@ -166,6 +166,7 @@ namespace MWWorld
virtual void clear();
virtual int countSavedGameRecords() const;
virtual int countSavedGameCells() const;
virtual void write (ESM::ESMWriter& writer, Loading::Listener& progress) const;

Loading…
Cancel
Save