mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
move most of the files from esm to esm3, keep common code in esm; this is make space for a future with esm4
esm typo esm typo
This commit is contained in:
parent
c263bbf0f6
commit
d1fb854521
448 changed files with 686 additions and 683 deletions
43
components/esm3/globalmap.cpp
Normal file
43
components/esm3/globalmap.cpp
Normal file
|
@ -0,0 +1,43 @@
|
|||
#include "globalmap.hpp"
|
||||
|
||||
#include "esmreader.hpp"
|
||||
#include "esmwriter.hpp"
|
||||
#include "components/esm/defs.hpp"
|
||||
|
||||
unsigned int ESM::GlobalMap::sRecordId = ESM::REC_GMAP;
|
||||
|
||||
void ESM::GlobalMap::load (ESMReader &esm)
|
||||
{
|
||||
esm.getHNT(mBounds, "BNDS");
|
||||
|
||||
esm.getSubNameIs("DATA");
|
||||
esm.getSubHeader();
|
||||
mImageData.resize(esm.getSubSize());
|
||||
esm.getExact(&mImageData[0], mImageData.size());
|
||||
|
||||
while (esm.isNextSub("MRK_"))
|
||||
{
|
||||
esm.getSubHeader();
|
||||
CellId cell;
|
||||
esm.getT(cell.first);
|
||||
esm.getT(cell.second);
|
||||
mMarkers.insert(cell);
|
||||
}
|
||||
}
|
||||
|
||||
void ESM::GlobalMap::save (ESMWriter &esm) const
|
||||
{
|
||||
esm.writeHNT("BNDS", mBounds);
|
||||
|
||||
esm.startSubRecord("DATA");
|
||||
esm.write(&mImageData[0], mImageData.size());
|
||||
esm.endRecord("DATA");
|
||||
|
||||
for (std::set<CellId>::const_iterator it = mMarkers.begin(); it != mMarkers.end(); ++it)
|
||||
{
|
||||
esm.startSubRecord("MRK_");
|
||||
esm.writeT(it->first);
|
||||
esm.writeT(it->second);
|
||||
esm.endRecord("MRK_");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue