diff options
Diffstat (limited to 'source/30-game/Ires.cpp')
-rw-r--r-- | source/30-game/Ires.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/30-game/Ires.cpp b/source/30-game/Ires.cpp index bfa4cdf..4f8da85 100644 --- a/source/30-game/Ires.cpp +++ b/source/30-game/Ires.cpp @@ -393,10 +393,20 @@ void IresManager::Save(IresObject* ires, const fs::path& filePath) { char writerBuffer[65536]; rapidjson::FileWriteStream stream(file, writerBuffer, sizeof(writerBuffer)); rapidjson::PrettyWriter<rapidjson::FileWriteStream> writer(stream); - writer.SetFormatOptions(rapidjson::PrettyFormatOptions::kFormatSingleLineArray); + // We no longer need this after disabling BRUSSEL_Uid_WRITE_USE_ARRAY +// writer.SetFormatOptions(rapidjson::PrettyFormatOptions::kFormatSingleLineArray); +#if BRUSSEL_Uid_WRITE_USE_ARRAY +# warning "Writing Uid in array format but single line formatting isn't enabled, this might cause excessively long ires files." +#endif root.Accept(writer); } +void IresManager::OverwriteAllToDisk() { + for (const auto& [DISCARD, ires] : mObjByUid) { + Save(ires.Get()); + } +} + IresObject* IresManager::FindIres(const Uid& uid) const { auto iter = mObjByUid.find(uid); if (iter != mObjByUid.end()) { |