mirror of https://github.com/OpenMW/openmw.git
store cell state in saved game files (no references yet)
parent
9ebe66e693
commit
22cb4784b5
@ -0,0 +1,17 @@
|
||||
|
||||
#include "cellstate.hpp"
|
||||
|
||||
#include "esmreader.hpp"
|
||||
#include "esmwriter.hpp"
|
||||
|
||||
void ESM::CellState::load (ESMReader &esm)
|
||||
{
|
||||
mWaterLevel = 0;
|
||||
esm.getHNOT (mWaterLevel, "WLVL");
|
||||
}
|
||||
|
||||
void ESM::CellState::save (ESMWriter &esm) const
|
||||
{
|
||||
if (!mId.mPaged)
|
||||
esm.writeHNT ("WLVL", mWaterLevel);
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
#ifndef OPENMW_ESM_CELLSTATE_H
|
||||
#define OPENMW_ESM_CELLSTATE_H
|
||||
|
||||
#include "cellid.hpp"
|
||||
|
||||
namespace ESM
|
||||
{
|
||||
class ESMReader;
|
||||
class ESMWriter;
|
||||
|
||||
// format 0, saved games only
|
||||
|
||||
/// \note Does not include references
|
||||
struct CellState
|
||||
{
|
||||
CellId mId;
|
||||
|
||||
float mWaterLevel;
|
||||
|
||||
void load (ESMReader &esm);
|
||||
void save (ESMWriter &esm) const;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue