OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
defs.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_ESM_DEFS_H
2 #define OPENMW_ESM_DEFS_H
3 
4 #include <stdint.h>
5 
6 #include <osg/Vec3f>
7 
8 namespace ESM
9 {
10 
11 struct TimeStamp
12 {
13  float mHour;
14  int mDay;
15 };
16 
17 // Pixel color value. Standard four-byte rr,gg,bb,aa format.
18 typedef uint32_t Color;
19 
21 {
23  SPC_Magic = 1,
25 };
26 
28 {
29  RT_Self = 0,
30  RT_Touch = 1,
32 };
33 
34 #pragma pack(push)
35 #pragma pack(1)
36 
37 // Position and rotation
38 struct Position
39 {
40  float pos[3];
41 
42  // In radians
43  float rot[3];
44 
45  osg::Vec3f asVec3() const
46  {
47  return osg::Vec3f(pos[0], pos[1], pos[2]);
48  }
49 };
50 #pragma pack(pop)
51 
52 template <int a, int b, int c, int d>
53 struct FourCC
54 {
55  static const unsigned int value = (((((d << 8) | c) << 8) | b) << 8) | a;
56 };
57 
59 {
60  // format 0 / legacy
61  REC_ACTI = 0x49544341,
62  REC_ALCH = 0x48434c41,
63  REC_APPA = 0x41505041,
64  REC_ARMO = 0x4f4d5241,
65  REC_BODY = 0x59444f42,
66  REC_BOOK = 0x4b4f4f42,
67  REC_BSGN = 0x4e475342,
68  REC_CELL = 0x4c4c4543,
69  REC_CLAS = 0x53414c43,
70  REC_CLOT = 0x544f4c43,
71  REC_CNTC = 0x43544e43,
72  REC_CONT = 0x544e4f43,
73  REC_CREA = 0x41455243,
74  REC_CREC = 0x43455243,
75  REC_DIAL = 0x4c414944,
76  REC_DOOR = 0x524f4f44,
77  REC_ENCH = 0x48434e45,
78  REC_FACT = 0x54434146,
79  REC_GLOB = 0x424f4c47,
80  REC_GMST = 0x54534d47,
81  REC_INFO = 0x4f464e49,
82  REC_INGR = 0x52474e49,
83  REC_LAND = 0x444e414c,
84  REC_LEVC = 0x4356454c,
85  REC_LEVI = 0x4956454c,
86  REC_LIGH = 0x4847494c,
87  REC_LOCK = 0x4b434f4c,
88  REC_LTEX = 0x5845544c,
89  REC_MGEF = 0x4645474d,
90  REC_MISC = 0x4353494d,
91  REC_NPC_ = 0x5f43504e,
92  REC_NPCC = 0x4343504e,
93  REC_PGRD = 0x44524750,
94  REC_PROB = 0x424f5250,
95  REC_RACE = 0x45434152,
96  REC_REGN = 0x4e474552,
97  REC_REPA = 0x41504552,
98  REC_SCPT = 0x54504353,
99  REC_SKIL = 0x4c494b53,
100  REC_SNDG = 0x47444e53,
101  REC_SOUN = 0x4e554f53,
102  REC_SPEL = 0x4c455053,
103  REC_SSCR = 0x52435353,
104  REC_STAT = 0x54415453,
105  REC_WEAP = 0x50414557,
106 
107  // format 0 - saved games
109  REC_JOUR_LEGACY = FourCC<0xa4,'U','O','R'>::value, // "\xa4UOR", rather than "JOUR", little oversight when magic numbers were
110  // calculated by hand, needs to be supported for older files now
131 
132  // format 1
135 };
136 
139 {
142 };
143 
144 }
145 #endif
Definition: defs.hpp:64
Definition: defs.hpp:23
Definition: defs.hpp:140
Definition: defs.hpp:77
Definition: defs.hpp:121
Definition: defs.hpp:112
Definition: defs.hpp:128
Definition: defs.hpp:105
Definition: defs.hpp:115
float pos[3]
Definition: defs.hpp:40
Definition: defs.hpp:11
Definition: defs.hpp:133
Definition: defs.hpp:129
Definition: defs.hpp:103
Definition: defs.hpp:78
Definition: defs.hpp:85
Definition: defs.hpp:30
Definition: defs.hpp:123
Definition: defs.hpp:84
Definition: defs.hpp:90
static const unsigned int value
Definition: defs.hpp:55
Definition: defs.hpp:108
osg::Vec3f asVec3() const
Definition: defs.hpp:45
Definition: defs.hpp:93
Definition: defs.hpp:76
Definition: defs.hpp:130
Definition: defs.hpp:118
Definition: defs.hpp:22
Definition: defs.hpp:122
Definition: defs.hpp:74
Definition: defs.hpp:113
Definition: defs.hpp:117
Definition: defs.hpp:111
Definition: defs.hpp:67
Definition: defs.hpp:95
Definition: defs.hpp:80
Definition: defs.hpp:104
RangeType
Definition: defs.hpp:27
Definition: defs.hpp:119
Definition: defs.hpp:73
Definition: defs.hpp:109
Definition: defs.hpp:86
Definition: defs.hpp:126
Definition: defs.hpp:116
Definition: defs.hpp:124
Specialization
Definition: defs.hpp:20
RecNameInts
Definition: defs.hpp:58
Definition: defs.hpp:96
Definition: defs.hpp:101
Definition: defs.hpp:88
Definition: defs.hpp:83
Definition: defs.hpp:97
Definition: defs.hpp:63
Definition: defs.hpp:127
Definition: defs.hpp:69
float mHour
Definition: defs.hpp:13
only used in project files
Definition: defs.hpp:134
Definition: defs.hpp:102
Definition: defs.hpp:24
Definition: defs.hpp:65
Definition: defs.hpp:79
Definition: defs.hpp:114
Definition: defs.hpp:71
uint32_t Color
Definition: defs.hpp:18
Definition: defs.hpp:38
Definition: defs.hpp:82
Definition: defs.hpp:94
Definition: defs.hpp:100
Definition: defs.hpp:61
Definition: defs.hpp:81
Definition: defs.hpp:53
Definition: defs.hpp:89
Definition: defs.hpp:99
Definition: defs.hpp:98
Definition: defs.hpp:62
float rot[3]
Definition: defs.hpp:43
Definition: defs.hpp:66
Definition: defs.hpp:120
SubRecNameInts
Common subrecords.
Definition: defs.hpp:138
Definition: defs.hpp:68
Definition: defs.hpp:72
Definition: defs.hpp:31
Definition: defs.hpp:87
Definition: defs.hpp:91
Definition: defs.hpp:70
Definition: defs.hpp:92
Definition: defs.hpp:141
Definition: defs.hpp:75
Definition: defs.hpp:29
Definition: defs.hpp:125
int mDay
Definition: defs.hpp:14