2013-03-12 08:16:03 +00:00
|
|
|
#ifndef COMPONENT_ESM_TES3_H
|
|
|
|
#define COMPONENT_ESM_TES3_H
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
2022-01-22 14:58:41 +00:00
|
|
|
#include "components/esm/esmcommon.hpp"
|
2023-02-10 12:16:52 +00:00
|
|
|
#include "components/esm3/formatversion.hpp"
|
2013-03-12 08:16:03 +00:00
|
|
|
|
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
class ESMReader;
|
|
|
|
class ESMWriter;
|
|
|
|
|
|
|
|
#pragma pack(push)
|
|
|
|
#pragma pack(1)
|
|
|
|
|
2018-01-22 04:25:54 +00:00
|
|
|
struct Data
|
|
|
|
{
|
|
|
|
/* File format version. This is actually a float, the supported
|
|
|
|
versions are 1.2 and 1.3. These correspond to:
|
|
|
|
1.2 = 0x3f99999a and 1.3 = 0x3fa66666
|
|
|
|
*/
|
|
|
|
unsigned int version;
|
|
|
|
int type; // 0=esp, 1=esm, 32=ess (unused)
|
2018-09-25 13:16:40 +00:00
|
|
|
std::string author; // Author's name
|
|
|
|
std::string desc; // File description
|
2018-01-22 04:25:54 +00:00
|
|
|
int records; // Number of records
|
|
|
|
};
|
|
|
|
|
|
|
|
struct GMDT
|
|
|
|
{
|
|
|
|
float mCurrentHealth;
|
|
|
|
float mMaximumHealth;
|
|
|
|
float mHour;
|
|
|
|
unsigned char unknown1[12];
|
|
|
|
NAME64 mCurrentCell;
|
|
|
|
unsigned char unknown2[4];
|
|
|
|
NAME32 mPlayerName;
|
|
|
|
};
|
|
|
|
|
|
|
|
#pragma pack(pop)
|
|
|
|
|
2013-03-12 08:16:03 +00:00
|
|
|
/// \brief File header record
|
|
|
|
struct Header
|
|
|
|
{
|
|
|
|
// Defines another files (esm or esp) that this file depends upon.
|
|
|
|
struct MasterData
|
|
|
|
{
|
|
|
|
std::string name;
|
|
|
|
uint64_t size;
|
|
|
|
};
|
|
|
|
|
2015-01-16 23:11:36 +00:00
|
|
|
GMDT mGameData; // Used in .ess savegames only
|
2015-02-12 03:56:05 +00:00
|
|
|
std::vector<unsigned char> mSCRD; // Used in .ess savegames only, unknown
|
|
|
|
std::vector<unsigned char> mSCRS; // Used in .ess savegames only, screenshot
|
2015-01-16 23:11:36 +00:00
|
|
|
|
2013-03-12 08:16:03 +00:00
|
|
|
Data mData;
|
2023-02-10 12:16:52 +00:00
|
|
|
FormatVersion mFormatVersion;
|
2013-03-12 08:16:03 +00:00
|
|
|
std::vector<MasterData> mMaster;
|
|
|
|
|
|
|
|
void blank();
|
|
|
|
|
|
|
|
void load(ESMReader& esm);
|
|
|
|
void save(ESMWriter& esm);
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-04-28 09:29:57 +00:00
|
|
|
#endif
|