OpenMW
components/esm/loadligh.hpp
Go to the documentation of this file.
00001 #ifndef OPENMW_ESM_LIGH_H
00002 #define OPENMW_ESM_LIGH_H
00003 
00004 #include <string>
00005 
00006 namespace ESM
00007 {
00008 
00009 class ESMReader;
00010 class ESMWriter;
00011 
00012 /*
00013  * Lights. Includes static light sources and also carryable candles
00014  * and torches.
00015  */
00016 
00017 struct Light
00018 {
00019     static unsigned int sRecordId;
00020 
00021     enum Flags
00022     {
00023         Dynamic     = 0x001,
00024         Carry       = 0x002, // Can be carried
00025         Negative    = 0x004, // Negative light - i.e. darkness
00026         Flicker     = 0x008,
00027         Fire        = 0x010,
00028         OffDefault  = 0x020, // Off by default
00029         FlickerSlow = 0x040,
00030         Pulse       = 0x080,
00031         PulseSlow   = 0x100
00032     };
00033 
00034     struct LHDTstruct
00035     {
00036         float mWeight;
00037         int mValue;
00038         int mTime; // Duration
00039         int mRadius;
00040         int mColor; // 4-byte rgba value
00041         int mFlags;
00042     }; // Size = 24 bytes
00043 
00044     LHDTstruct mData;
00045 
00046     std::string mSound, mScript, mModel, mIcon, mName, mId;
00047 
00048     void load(ESMReader &esm);
00049     void save(ESMWriter &esm) const;
00050 
00051     void blank();
00053 };
00054 }
00055 #endif