Exemplo n.º 1
0
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);
}
Exemplo n.º 2
0
void ESM::GlobalMap::save (ESMWriter &esm) const
{
    esm.writeHNT("BNDS", mBounds);

    esm.startSubRecord("DATA");
    esm.write(&mImageData[0], mImageData.size());
    esm.endRecord("DATA");
}
Exemplo n.º 3
0
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_");
    }
}