OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
loadtes3.hpp
Go to the documentation of this file.
1 #ifndef COMPONENT_ESM_TES3_H
2 #define COMPONENT_ESM_TES3_H
3 
4 #include <vector>
5 
6 #include "esmcommon.hpp"
7 
8 namespace ESM
9 {
10  class ESMReader;
11  class ESMWriter;
12 
13 #pragma pack(push)
14 #pragma pack(1)
15 
17  struct Header
18  {
19  static const int CurrentFormat = 0; // most recent known format
20 
21  struct Data
22  {
23  /* File format version. This is actually a float, the supported
24  versions are 1.2 and 1.3. These correspond to:
25  1.2 = 0x3f99999a and 1.3 = 0x3fa66666
26  */
27  unsigned int version;
28  int type; // 0=esp, 1=esm, 32=ess (unused)
29  NAME32 author; // Author's name
30  NAME256 desc; // File description
31  int records; // Number of records
32  };
33 
34  // Defines another files (esm or esp) that this file depends upon.
35  struct MasterData
36  {
37  std::string name;
38  uint64_t size;
39  int index; // Position of the parent file in the global list of loaded files
40  };
41 
42  struct GMDT
43  {
46  float mHour;
47  unsigned char unknown1[12];
49  unsigned char unknown2[4];
51  };
52  GMDT mGameData; // Used in .ess savegames only
53  std::vector<unsigned char> mSCRD; // Used in .ess savegames only, unknown
54  std::vector<unsigned char> mSCRS; // Used in .ess savegames only, screenshot
55 
57  int mFormat;
58  std::vector<MasterData> mMaster;
59 
60  void blank();
61 
62  void load (ESMReader &esm);
63  void save (ESMWriter &esm);
64  };
65 #pragma pack(pop)
66 
67 }
68 
69 #endif
NAME32 mPlayerName
Definition: loadtes3.hpp:50
float mHour
Definition: loadtes3.hpp:46
NAME64 mCurrentCell
Definition: loadtes3.hpp:48
std::vector< unsigned char > mSCRD
Definition: loadtes3.hpp:53
float mMaximumHealth
Definition: loadtes3.hpp:45
Definition: loadtes3.hpp:42
Definition: esmreader.hpp:21
unsigned int version
Definition: loadtes3.hpp:27
GMDT mGameData
Definition: loadtes3.hpp:52
Definition: loadtes3.hpp:35
NAME32 author
Definition: loadtes3.hpp:29
Data mData
Definition: loadtes3.hpp:56
Definition: loadtes3.hpp:21
int mFormat
Definition: loadtes3.hpp:57
unsigned char unknown2[4]
Definition: loadtes3.hpp:49
Definition: esmwriter.hpp:17
std::vector< MasterData > mMaster
Definition: loadtes3.hpp:58
NAME256 desc
Definition: loadtes3.hpp:30
int index
Definition: loadtes3.hpp:39
void save(ESMWriter &esm)
Definition: loadtes3.cpp:68
int records
Definition: loadtes3.hpp:31
std::string name
Definition: loadtes3.hpp:37
void load(ESMReader &esm)
Definition: loadtes3.cpp:19
void blank()
Definition: loadtes3.cpp:8
static const int CurrentFormat
Definition: loadtes3.hpp:19
File header record.
Definition: loadtes3.hpp:17
unsigned char unknown1[12]
Definition: loadtes3.hpp:47
int type
Definition: loadtes3.hpp:28
uint64_t size
Definition: loadtes3.hpp:38
std::vector< unsigned char > mSCRS
Definition: loadtes3.hpp:54
float mCurrentHealth
Definition: loadtes3.hpp:44