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 
16  struct Data
17  {
18  /* File format version. This is actually a float, the supported
19  versions are 1.2 and 1.3. These correspond to:
20  1.2 = 0x3f99999a and 1.3 = 0x3fa66666
21  */
22  unsigned int version;
23  int type; // 0=esp, 1=esm, 32=ess (unused)
24  std::string author; // Author's name
25  std::string desc; // File description
26  int records; // Number of records
27  };
28 
29  struct GMDT
30  {
33  float mHour;
34  unsigned char unknown1[12];
36  unsigned char unknown2[4];
38  };
39 
40 #pragma pack(pop)
41 
43  struct Header
44  {
45  static const int CurrentFormat = 0; // most recent known format
46 
47  // Defines another files (esm or esp) that this file depends upon.
48  struct MasterData
49  {
50  std::string name;
51  uint64_t size;
52  int index; // Position of the parent file in the global list of loaded files
53  };
54 
55  GMDT mGameData; // Used in .ess savegames only
56  std::vector<unsigned char> mSCRD; // Used in .ess savegames only, unknown
57  std::vector<unsigned char> mSCRS; // Used in .ess savegames only, screenshot
58 
60  int mFormat;
61  std::vector<MasterData> mMaster;
62 
63  void blank();
64 
65  void load (ESMReader &esm);
66  void save (ESMWriter &esm);
67  };
68 
69 }
70 
71 #endif
NAME64 mCurrentCell
Definition: loadtes3.hpp:35
std::vector< unsigned char > mSCRD
Definition: loadtes3.hpp:56
NAME32 mPlayerName
Definition: loadtes3.hpp:37
Definition: esmreader.hpp:21
GMDT mGameData
Definition: loadtes3.hpp:55
Definition: loadtes3.hpp:48
Data mData
Definition: loadtes3.hpp:59
int mFormat
Definition: loadtes3.hpp:60
Definition: esmwriter.hpp:17
std::vector< MasterData > mMaster
Definition: loadtes3.hpp:61
float mCurrentHealth
Definition: loadtes3.hpp:31
int index
Definition: loadtes3.hpp:52
void save(ESMWriter &esm)
Definition: loadtes3.cpp:68
std::string name
Definition: loadtes3.hpp:50
void load(ESMReader &esm)
Definition: loadtes3.cpp:19
std::string desc
Definition: loadtes3.hpp:25
void blank()
Definition: loadtes3.cpp:8
static const int CurrentFormat
Definition: loadtes3.hpp:45
float mMaximumHealth
Definition: loadtes3.hpp:32
File header record.
Definition: loadtes3.hpp:43
float mHour
Definition: loadtes3.hpp:33
uint64_t size
Definition: loadtes3.hpp:51
std::vector< unsigned char > mSCRS
Definition: loadtes3.hpp:57
Definition: loadtes3.hpp:29
int records
Definition: loadtes3.hpp:26
int type
Definition: loadtes3.hpp:23
std::string author
Definition: loadtes3.hpp:24
unsigned char unknown1[12]
Definition: loadtes3.hpp:34
unsigned int version
Definition: loadtes3.hpp:22
Definition: loadtes3.hpp:16
unsigned char unknown2[4]
Definition: loadtes3.hpp:36