|
|
|
@ -2,6 +2,8 @@
|
|
|
|
|
#define OPENMW_ESM_COMMON_H
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include <cstring>
|
|
|
|
|
|
|
|
|
|
#include <libs/platform/stdint.h>
|
|
|
|
|
#include <libs/platform/string.h>
|
|
|
|
@ -43,6 +45,8 @@ union NAME_T
|
|
|
|
|
bool operator!=(int v) const { return v != val; }
|
|
|
|
|
|
|
|
|
|
std::string toString() const { return std::string(name, strnlen(name, LEN)); }
|
|
|
|
|
|
|
|
|
|
void assign (const std::string& value) { std::strncpy (name, value.c_str(), LEN); }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef NAME_T<4> NAME;
|
|
|
|
@ -53,27 +57,37 @@ typedef NAME_T<256> NAME256;
|
|
|
|
|
#pragma pack(push)
|
|
|
|
|
#pragma pack(1)
|
|
|
|
|
/// File header data for all ES files
|
|
|
|
|
struct HEDRstruct
|
|
|
|
|
struct Header
|
|
|
|
|
{
|
|
|
|
|
/* 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
|
|
|
|
|
*/
|
|
|
|
|
int version;
|
|
|
|
|
int type; // 0=esp, 1=esm, 32=ess (unused)
|
|
|
|
|
NAME32 author; // Author's name
|
|
|
|
|
NAME256 desc; // File description
|
|
|
|
|
int records; // Number of records? Not used.
|
|
|
|
|
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
|
|
|
|
|
*/
|
|
|
|
|
int version;
|
|
|
|
|
int type; // 0=esp, 1=esm, 32=ess (unused)
|
|
|
|
|
NAME32 author; // Author's name
|
|
|
|
|
NAME256 desc; // File description
|
|
|
|
|
int records; // Number of records? Not used.
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Defines another files (esm or esp) that this file depends upon.
|
|
|
|
|
struct MasterData
|
|
|
|
|
{
|
|
|
|
|
std::string name;
|
|
|
|
|
uint64_t size;
|
|
|
|
|
int index; // Position of the parent file in the global list of loaded files
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Data mData;
|
|
|
|
|
std::vector<MasterData> mMaster;
|
|
|
|
|
};
|
|
|
|
|
#pragma pack(pop)
|
|
|
|
|
|
|
|
|
|
// Defines another files (esm or esp) that this file depends upon.
|
|
|
|
|
struct MasterData
|
|
|
|
|
{
|
|
|
|
|
std::string name;
|
|
|
|
|
uint64_t size;
|
|
|
|
|
int index; // Position of the parent file in the global list of loaded files
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#pragma pack(push)
|
|
|
|
|
#pragma pack(1)
|
|
|
|
|
// Data that is only present in save game files
|
|
|
|
|
struct SaveData
|
|
|
|
|
{
|
|
|
|
@ -95,7 +109,7 @@ struct ESM_Context
|
|
|
|
|
uint32_t leftRec, leftSub;
|
|
|
|
|
size_t leftFile;
|
|
|
|
|
NAME recName, subName;
|
|
|
|
|
HEDRstruct header;
|
|
|
|
|
Header::Data header;
|
|
|
|
|
// When working with multiple esX files, we will generate lists of all files that
|
|
|
|
|
// actually contribute to a specific cell. Therefore, we need to store the index
|
|
|
|
|
// of the file belonging to this contest. See CellStore::(list/load)refs for details.
|
|
|
|
|