void Pathgrid::save(ESMWriter &esm) { esm.writeHNT("DATA", mData, 12); esm.writeHNCString("NAME", mCell); if (!mPoints.empty()) { esm.startSubRecord("PGRP"); for (PointList::iterator it = mPoints.begin(); it != mPoints.end(); ++it) { esm.writeT(*it); } esm.endRecord("PGRP"); } if (!mEdges.empty()) { esm.startSubRecord("PGRC"); for (std::vector<Edge>::iterator it = mEdges.begin(); it != mEdges.end(); ++it) { esm.writeT(it->mV1); } esm.endRecord("PGRC"); } }
void Script::save(ESMWriter &esm) const { std::string varNameString; if (!mVarNames.empty()) for (std::vector<std::string>::const_iterator it = mVarNames.begin(); it != mVarNames.end(); ++it) varNameString.append(*it); SCHD data; memset(&data, 0, sizeof(data)); data.mData = mData; memcpy(data.mName.name, mId.c_str(), mId.size()); esm.writeHNT("SCHD", data, 52); if (!mVarNames.empty()) { esm.startSubRecord("SCVR"); for (std::vector<std::string>::const_iterator it = mVarNames.begin(); it != mVarNames.end(); ++it) { esm.writeHCString(*it); } esm.endRecord("SCVR"); } esm.startSubRecord("SCDT"); esm.write(reinterpret_cast<const char * >(&mScriptData[0]), mData.mScriptDataSize); esm.endRecord("SCDT"); esm.writeHNOString("SCTX", mScriptText); }
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::vector<CellId>::const_iterator it = mMarkers.begin(); it != mMarkers.end(); ++it) { esm.startSubRecord("MRK_"); esm.writeT(it->first); esm.writeT(it->second); esm.endRecord("MRK_"); } }
void ESM::GlobalMap::save (ESMWriter &esm) const { esm.writeHNT("BNDS", mBounds); esm.startSubRecord("DATA"); esm.write(&mImageData[0], mImageData.size()); esm.endRecord("DATA"); }
void Land::save(ESMWriter &esm) const { esm.startSubRecord("INTV"); esm.writeT(mX); esm.writeT(mY); esm.endRecord("INTV"); esm.writeHNT("DATA", mFlags); }
void Land::save(ESMWriter &esm, bool isDeleted) const { esm.startSubRecord("INTV"); esm.writeT(mX); esm.writeT(mY); esm.endRecord("INTV"); esm.writeHNT("DATA", mFlags); if (isDeleted) { esm.writeHNCString("DELE", ""); return; } if (mLandData) { mLandData->save(esm); } }
void ESM::Header::save (ESMWriter &esm) { if (mFormat>0) esm.writeHNT ("FORM", mFormat); esm.startSubRecord("HEDR"); esm.writeT(mData.version); esm.writeT(mData.type); esm.writeFixedSizeString(mData.author.toString(), 32); esm.writeFixedSizeString(mData.desc.toString(), 256); esm.writeT(mData.records); esm.endRecord("HEDR"); for (std::vector<Header::MasterData>::iterator iter = mMaster.begin(); iter != mMaster.end(); ++iter) { esm.writeHNCString ("MAST", iter->name); esm.writeHNT ("DATA", iter->size); } }