OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
loadligh.hpp
Go to the documentation of this file.
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;
21  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 
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();
55 };
56 }
57 #endif
Definition: loadligh.hpp:30
Definition: loadligh.hpp:29
unsigned int mColor
Definition: loadligh.hpp:42
LHDTstruct mData
Definition: loadligh.hpp:46
Definition: loadligh.hpp:36
int mFlags
Definition: loadligh.hpp:43
std::string mModel
Definition: loadligh.hpp:48
Definition: esmreader.hpp:21
Definition: loadligh.hpp:26
int mValue
Definition: loadligh.hpp:39
static unsigned int sRecordId
Definition: loadligh.hpp:19
std::string mId
Definition: loadligh.hpp:48
float mWeight
Definition: loadligh.hpp:38
Definition: loadligh.hpp:33
Definition: esmwriter.hpp:17
std::string mSound
Definition: loadligh.hpp:48
std::string mName
Definition: loadligh.hpp:48
Definition: loadligh.hpp:25
std::string mIcon
Definition: loadligh.hpp:48
Definition: loadligh.hpp:28
Definition: loadligh.hpp:32
int mTime
Definition: loadligh.hpp:40
void load(ESMReader &esm, bool &isDeleted)
Definition: loadligh.cpp:11
void save(ESMWriter &esm, bool isDeleted=false) const
Definition: loadligh.cpp:60
void blank()
Set record to default state (does not touch the ID).
Definition: loadligh.cpp:78
int mRadius
Definition: loadligh.hpp:41
static std::string getRecordType()
Return a string descriptor for this record type. Currently used for debugging / error logs only...
Definition: loadligh.hpp:21
std::string mScript
Definition: loadligh.hpp:48
Flags
Definition: loadligh.hpp:23
Definition: loadligh.hpp:17
Definition: loadligh.hpp:27
Definition: loadligh.hpp:31