Replace mpqapi.h with the MpqWriter class

This is a cleanup, heading in the direction of allowing us to reuse
some of the code between reading and writing MPQs.
This commit is contained in:
Gleb Mazovetskiy 2021-11-03 11:44:18 +00:00
commit 23406b6fc5
8 changed files with 646 additions and 634 deletions

View file

@ -23,11 +23,11 @@
#include "inv.h"
#include "lighting.h"
#include "missiles.h"
#include "mpqapi.h"
#include "pfile.h"
#include "stores.h"
#include "utils/endian.hpp"
#include "utils/language.h"
#include "utils/mpq_writer.hpp"
namespace devilution {
@ -203,7 +203,7 @@ public:
const auto encodedLen = codec_get_encoded_len(m_cur_);
const char *const password = pfile_get_password();
codec_encode(m_buffer_.get(), m_cur_, encodedLen, password);
mpqapi_write_file(m_szFileName_, m_buffer_.get(), encodedLen);
CurrentSaveArchive().WriteFile(m_szFileName_, m_buffer_.get(), encodedLen);
}
};