forked from mirror/openmw-tes3mp
ESSImport: convert custom map markers, not working for interiors yet
parent
19ed047dec
commit
f9cf31fcd5
@ -0,0 +1,26 @@
|
||||
#include "custommarkerstate.hpp"
|
||||
|
||||
#include "esmwriter.hpp"
|
||||
#include "esmreader.hpp"
|
||||
|
||||
namespace ESM
|
||||
{
|
||||
|
||||
void CustomMarker::save(ESM::ESMWriter &esm) const
|
||||
{
|
||||
esm.writeHNT("POSX", mWorldX);
|
||||
esm.writeHNT("POSY", mWorldY);
|
||||
mCell.save(esm);
|
||||
if (!mNote.empty())
|
||||
esm.writeHNString("NOTE", mNote);
|
||||
}
|
||||
|
||||
void CustomMarker::load(ESM::ESMReader &esm)
|
||||
{
|
||||
esm.getHNT(mWorldX, "POSX");
|
||||
esm.getHNT(mWorldY, "POSY");
|
||||
mCell.load(esm);
|
||||
mNote = esm.getHNOString("NOTE");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
#ifndef OPENMW_ESM_CUSTOMMARKERSTATE_H
|
||||
#define OPENMW_ESM_CUSTOMMARKERSTATE_H
|
||||
|
||||
#include "cellid.hpp"
|
||||
|
||||
namespace ESM
|
||||
{
|
||||
|
||||
// format 0, saved games only
|
||||
struct CustomMarker
|
||||
{
|
||||
float mWorldX;
|
||||
float mWorldY;
|
||||
|
||||
ESM::CellId mCell;
|
||||
|
||||
std::string mNote;
|
||||
|
||||
bool operator == (const CustomMarker& other)
|
||||
{
|
||||
return mNote == other.mNote && mCell == other.mCell && mWorldX == other.mWorldX && mWorldY == other.mWorldY;
|
||||
}
|
||||
|
||||
void load (ESM::ESMReader& reader);
|
||||
void save (ESM::ESMWriter& writer) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue