2011-04-08 13:58:21 +00:00
|
|
|
#include "loadligh.hpp"
|
|
|
|
|
2012-09-23 18:41:41 +00:00
|
|
|
#include "esmreader.hpp"
|
|
|
|
#include "esmwriter.hpp"
|
2013-09-24 11:17:28 +00:00
|
|
|
#include "defs.hpp"
|
2012-09-17 07:37:50 +00:00
|
|
|
|
2011-04-08 13:58:21 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
2013-09-24 11:17:28 +00:00
|
|
|
unsigned int Light::sRecordId = REC_LIGH;
|
2011-04-08 13:58:21 +00:00
|
|
|
|
|
|
|
void Light::load(ESMReader &esm)
|
|
|
|
{
|
2014-11-09 03:50:54 +00:00
|
|
|
mModel = esm.getHNOString("MODL");
|
2012-09-17 07:37:50 +00:00
|
|
|
mName = esm.getHNOString("FNAM");
|
|
|
|
mIcon = esm.getHNOString("ITEX");
|
|
|
|
assert(sizeof(mData) == 24);
|
|
|
|
esm.getHNT(mData, "LHDT", 24);
|
|
|
|
mScript = esm.getHNOString("SCRI");
|
|
|
|
mSound = esm.getHNOString("SNAM");
|
2011-04-08 13:58:21 +00:00
|
|
|
}
|
2013-09-16 10:32:35 +00:00
|
|
|
void Light::save(ESMWriter &esm) const
|
2012-04-06 19:04:30 +00:00
|
|
|
{
|
2012-09-17 07:37:50 +00:00
|
|
|
esm.writeHNCString("MODL", mModel);
|
|
|
|
esm.writeHNOCString("FNAM", mName);
|
|
|
|
esm.writeHNOCString("ITEX", mIcon);
|
|
|
|
esm.writeHNT("LHDT", mData, 24);
|
|
|
|
esm.writeHNOCString("SCRI", mScript);
|
|
|
|
esm.writeHNOCString("SNAM", mSound);
|
2011-04-08 13:58:21 +00:00
|
|
|
}
|
|
|
|
|
2013-05-06 12:10:43 +00:00
|
|
|
void Light::blank()
|
|
|
|
{
|
|
|
|
mData.mWeight = 0;
|
|
|
|
mData.mValue = 0;
|
|
|
|
mData.mTime = 0;
|
|
|
|
mData.mRadius = 0;
|
|
|
|
mData.mColor = 0;
|
|
|
|
mData.mFlags = 0;
|
|
|
|
mSound.clear();
|
|
|
|
mScript.clear();
|
|
|
|
mModel.clear();
|
|
|
|
mIcon.clear();
|
|
|
|
mName.clear();
|
|
|
|
}
|
2011-04-08 13:58:21 +00:00
|
|
|
}
|