Files
Gleb Mazovetskiy 16a6fc62e1 Deduplicate some of the MPQ handling
Reuse libmpq functions where possible instead of our own.
2023-09-10 02:16:15 +01:00

19 lines
415 B
C++

#include "mpq/mpq_common.hpp"
#include <string_view>
#include <libmpq/mpq.h>
namespace devilution {
#if !defined(UNPACKED_MPQS) || !defined(UNPACKED_SAVES)
MpqFileHash CalculateMpqFileHash(std::string_view filename)
{
MpqFileHash fileHash;
libmpq__file_hash_s(filename.data(), filename.size(), &fileHash[0], &fileHash[1], &fileHash[2]);
return fileHash;
}
#endif
} // namespace devilution