1 #ifndef OPENMW_ESM_LIGH_H
2 #define OPENMW_ESM_LIGH_H
3 
4 #include <string>
5 
6 namespace ESM
7 {
8 
9 class ESMReader;
10 class ESMWriter;
11 
12 /*
13  * Lights. Includes static light sources and also carryable candles
14  * and torches.
15  */
16 
17 struct Light
18 {
19     static unsigned int sRecordId;
20     /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
getRecordTypeESM::Light21     static std::string getRecordType() { return "Light"; }
22 
23     enum Flags
24     {
25         Dynamic     = 0x001,
26         Carry       = 0x002, // Can be carried
27         Negative    = 0x004, // Negative light - i.e. darkness
28         Flicker     = 0x008,
29         Fire        = 0x010,
30         OffDefault  = 0x020, // Off by default - does not burn while placed in a cell, but can burn when equipped by an NPC
31         FlickerSlow = 0x040,
32         Pulse       = 0x080,
33         PulseSlow   = 0x100
34     };
35 
36     struct LHDTstruct
37     {
38         float mWeight;
39         int mValue;
40         int mTime; // Duration
41         int mRadius;
42         unsigned int mColor; // 4-byte rgba value
43         int mFlags;
44     }; // Size = 24 bytes
45 
46     LHDTstruct mData;
47 
48     std::string mSound, mScript, mModel, mIcon, mName, mId;
49 
50     void load(ESMReader &esm, bool &isDeleted);
51     void save(ESMWriter &esm, bool isDeleted = false) const;
52 
53     void blank();
54     ///< Set record to default state (does not touch the ID).
55 };
56 }
57 #endif
58