From 9487bd33c3057f5d3f55e2b23ee108fa62778995 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 19 Nov 2013 16:07:36 +0100 Subject: [PATCH] removed broken save function from ESMWriter --- apps/openmw/mwstate/statemanagerimp.cpp | 5 ++++- components/esm/esmwriter.cpp | 6 ------ components/esm/esmwriter.hpp | 3 --- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/apps/openmw/mwstate/statemanagerimp.cpp b/apps/openmw/mwstate/statemanagerimp.cpp index f068093a00..4b1d9e0f6e 100644 --- a/apps/openmw/mwstate/statemanagerimp.cpp +++ b/apps/openmw/mwstate/statemanagerimp.cpp @@ -67,10 +67,13 @@ void MWState::StateManager::saveGame (const Slot *slot) else slot = mCharacterManager.getCurrentCharacter()->updateSlot (slot, profile); + std::ofstream stream (slot->mPath.string().c_str()); ESM::ESMWriter writer; // writer.setFormat (); - writer.save (slot->mPath.string()); + writer.save (stream); + writer.startRecord ("SAVE"); slot->mProfile.save (writer); + writer.endRecord ("SAVE"); writer.close(); } diff --git a/components/esm/esmwriter.cpp b/components/esm/esmwriter.cpp index c9ef61b635..069d75c7bb 100644 --- a/components/esm/esmwriter.cpp +++ b/components/esm/esmwriter.cpp @@ -51,12 +51,6 @@ namespace ESM mHeader.mMaster.push_back(d); } - void ESMWriter::save(const std::string& file) - { - std::ofstream fs(file.c_str(), std::ios_base::out | std::ios_base::trunc); - save(fs); - } - void ESMWriter::save(std::ostream& file) { mRecordCount = 0; diff --git a/components/esm/esmwriter.hpp b/components/esm/esmwriter.hpp index 104f97f909..d6646471b8 100644 --- a/components/esm/esmwriter.hpp +++ b/components/esm/esmwriter.hpp @@ -36,9 +36,6 @@ class ESMWriter void addMaster(const std::string& name, uint64_t size); - void save(const std::string& file); - ///< Start saving a file by writing the TES3 header. - void save(std::ostream& file); ///< Start saving a file by writing the TES3 header.