OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
loadregn.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_ESM_REGN_H
2 #define OPENMW_ESM_REGN_H
3 
4 #include <string>
5 #include <vector>
6 
7 #include "esmcommon.hpp"
8 
9 namespace ESM
10 {
11 
12 class ESMReader;
13 class ESMWriter;
14 
15 /*
16  * Region data
17  */
18 
19 struct Region
20 {
21  static unsigned int sRecordId;
23  static std::string getRecordType() { return "Region"; }
24 
25 #pragma pack(push)
26 #pragma pack(1)
27  struct WEATstruct
28  {
29  // These are probabilities that add up to 100
31  // Unknown weather, probably snow and something. Only
32  // present in file version 1.3.
33  // the engine uses mA as "snow" and mB as "blizard"
34  mA, mB;
35  }; // 10 bytes
36 
37  // Reference to a sound that is played randomly in this region
38  struct SoundRef
39  {
41  unsigned char mChance;
42  }; // 33 bytes
43 #pragma pack(pop)
44 
46  int mMapColor; // RGBA
47 
48  // sleepList refers to a leveled list of creatures you can meet if
49  // you sleep outside in this region.
50  std::string mId, mName, mSleepList;
51 
52  std::vector<SoundRef> mSoundList;
53 
54  void load(ESMReader &esm, bool &isDeleted);
55  void save(ESMWriter &esm, bool isDeleted = false) const;
56 
57  void blank();
59 };
60 }
61 #endif
WEATstruct mData
Definition: loadregn.hpp:45
std::string mName
Definition: loadregn.hpp:50
std::string mId
Definition: loadregn.hpp:50
Definition: esmreader.hpp:21
unsigned char mBlight
Definition: loadregn.hpp:30
Definition: loadregn.hpp:38
Definition: loadregn.hpp:27
unsigned char mA
Definition: loadregn.hpp:30
std::string mSleepList
Definition: loadregn.hpp:50
Definition: loadregn.hpp:19
unsigned char mThunder
Definition: loadregn.hpp:30
int mMapColor
Definition: loadregn.hpp:46
std::vector< SoundRef > mSoundList
Definition: loadregn.hpp:52
Definition: esmwriter.hpp:17
unsigned char mOvercast
Definition: loadregn.hpp:30
void load(ESMReader &esm, bool &isDeleted)
Definition: loadregn.cpp:11
unsigned char mAsh
Definition: loadregn.hpp:30
unsigned char mClear
Definition: loadregn.hpp:30
NAME32 mSound
Definition: loadregn.hpp:40
void save(ESMWriter &esm, bool isDeleted=false) const
Definition: loadregn.cpp:84
static std::string getRecordType()
Return a string descriptor for this record type. Currently used for debugging / error logs only...
Definition: loadregn.hpp:23
unsigned char mRain
Definition: loadregn.hpp:30
void blank()
Set record to default state (does not touch the ID/index).
Definition: loadregn.cpp:110
static unsigned int sRecordId
Definition: loadregn.hpp:21
unsigned char mB
Definition: loadregn.hpp:30
unsigned char mFoggy
Definition: loadregn.hpp:30
unsigned char mChance
Definition: loadregn.hpp:41
unsigned char mCloudy
Definition: loadregn.hpp:30