2012-09-23 18:11:08 +00:00
|
|
|
#ifndef OPENMW_ESM_REGN_H
|
|
|
|
#define OPENMW_ESM_REGN_H
|
2010-02-22 13:09:43 +00:00
|
|
|
|
2012-09-17 07:37:50 +00:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2012-09-23 18:41:41 +00:00
|
|
|
#include "esmcommon.hpp"
|
2010-02-22 13:09:43 +00:00
|
|
|
|
2011-04-08 13:58:21 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
2010-02-22 13:09:43 +00:00
|
|
|
|
2012-09-30 20:51:54 +00:00
|
|
|
class ESMReader;
|
|
|
|
class ESMWriter;
|
|
|
|
|
2010-02-22 13:09:43 +00:00
|
|
|
/*
|
|
|
|
* Region data
|
|
|
|
*/
|
|
|
|
|
2012-09-30 19:34:53 +00:00
|
|
|
struct Region
|
2010-02-22 13:09:43 +00:00
|
|
|
{
|
2013-09-24 11:17:28 +00:00
|
|
|
static unsigned int sRecordId;
|
2015-06-14 00:31:00 +00:00
|
|
|
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
|
|
|
|
static std::string getRecordType() { return "Region"; }
|
2013-09-24 11:17:28 +00:00
|
|
|
|
2010-05-21 12:30:24 +00:00
|
|
|
#pragma pack(push)
|
|
|
|
#pragma pack(1)
|
2011-04-08 13:58:21 +00:00
|
|
|
struct WEATstruct
|
|
|
|
{
|
2014-09-04 11:23:29 +00:00
|
|
|
// These are probabilities that add up to 100
|
|
|
|
unsigned char mClear, mCloudy, mFoggy, mOvercast, mRain, mThunder, mAsh, mBlight,
|
2011-04-08 13:58:21 +00:00
|
|
|
// Unknown weather, probably snow and something. Only
|
|
|
|
// present in file version 1.3.
|
2014-09-04 11:23:29 +00:00
|
|
|
// the engine uses mA as "snow" and mB as "blizard"
|
2012-09-17 07:37:50 +00:00
|
|
|
mA, mB;
|
2011-04-08 13:58:21 +00:00
|
|
|
}; // 10 bytes
|
2019-10-28 14:58:16 +00:00
|
|
|
#pragma pack(pop)
|
2011-04-08 13:58:21 +00:00
|
|
|
|
|
|
|
// Reference to a sound that is played randomly in this region
|
|
|
|
struct SoundRef
|
|
|
|
{
|
2019-10-10 09:29:25 +00:00
|
|
|
std::string mSound;
|
2014-09-04 11:23:29 +00:00
|
|
|
unsigned char mChance;
|
2019-10-28 14:58:16 +00:00
|
|
|
};
|
2010-02-22 13:09:43 +00:00
|
|
|
|
2012-09-17 07:37:50 +00:00
|
|
|
WEATstruct mData;
|
|
|
|
int mMapColor; // RGBA
|
2010-02-22 13:09:43 +00:00
|
|
|
|
2015-12-07 21:30:02 +00:00
|
|
|
// sleepList refers to a leveled list of creatures you can meet if
|
2011-04-08 13:58:21 +00:00
|
|
|
// you sleep outside in this region.
|
2012-10-07 17:24:47 +00:00
|
|
|
std::string mId, mName, mSleepList;
|
2010-02-22 13:09:43 +00:00
|
|
|
|
2012-09-17 07:37:50 +00:00
|
|
|
std::vector<SoundRef> mSoundList;
|
2010-02-22 13:09:43 +00:00
|
|
|
|
2015-07-20 14:23:14 +00:00
|
|
|
void load(ESMReader &esm, bool &isDeleted);
|
|
|
|
void save(ESMWriter &esm, bool isDeleted = false) const;
|
2013-04-07 14:32:06 +00:00
|
|
|
|
|
|
|
void blank();
|
|
|
|
///< Set record to default state (does not touch the ID/index).
|
2010-02-22 13:09:43 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|