1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 14:59:54 +00:00

esmtool: Print human-readable ESM4 file format version

This commit is contained in:
Alexei Kotov 2023-09-25 20:45:39 +03:00
parent 9f8f2dd925
commit 8d655054f1
2 changed files with 2 additions and 1 deletions

View file

@ -562,7 +562,7 @@ namespace EsmTool
{ {
std::cout << "Author: " << reader.getAuthor() << '\n' std::cout << "Author: " << reader.getAuthor() << '\n'
<< "Description: " << reader.getDesc() << '\n' << "Description: " << reader.getDesc() << '\n'
<< "File format version: " << reader.esmVersion() << '\n'; << "File format version: " << reader.esmVersionF() << '\n';
if (const std::vector<ESM::MasterData>& masterData = reader.getGameFiles(); !masterData.empty()) if (const std::vector<ESM::MasterData>& masterData = reader.getGameFiles(); !masterData.empty())
{ {

View file

@ -247,6 +247,7 @@ namespace ESM4
void setRecHeaderSize(const std::size_t size); void setRecHeaderSize(const std::size_t size);
inline unsigned int esmVersion() const { return mHeader.mData.version.ui; } inline unsigned int esmVersion() const { return mHeader.mData.version.ui; }
inline float esmVersionF() const { return mHeader.mData.version.f; }
inline unsigned int numRecords() const { return mHeader.mData.records; } inline unsigned int numRecords() const { return mHeader.mData.records; }
inline bool hasFormVersion() const { return mCtx.recHeaderSize == sizeof(RecordHeader); } inline bool hasFormVersion() const { return mCtx.recHeaderSize == sizeof(RecordHeader); }