Example #1
0
void ESM::Header::load (ESMReader &esm)
{
    if (esm.isNextSub("HEDR"))
    {
        esm.getSubHeader();
        esm.getT(mData.version);
        esm.getT(mData.type);
        mData.author.assign(esm.getString(sizeof(mData.author.name)));
        mData.desc.assign(esm.getString(sizeof(mData.desc.name)));
        esm.getT(mData.records);
    }

    if (esm.isNextSub ("FORM"))
    {
        esm.getHT (mFormat);
        if (mFormat<0)
            esm.fail ("invalid format code");
    }
    else
        mFormat = 0;

    while (esm.isNextSub ("MAST"))
    {
        MasterData m;
        m.name = esm.getHString();
        m.size = esm.getHNLong ("DATA");
        mMaster.push_back (m);
    }
}
Example #2
0
void ESM::Header::load (ESMReader &esm)
{
    esm.getHNT (mData, "HEDR", 300);

    if (esm.isNextSub ("FORM"))
    {
        esm.getHT (mFormat);
        if (mFormat<0)
            esm.fail ("invalid format code");
    }
    else
        mFormat = 0;

    while (esm.isNextSub ("MAST"))
    {
        MasterData m;
        m.name = esm.getHString();
        m.size = esm.getHNLong ("DATA");
        mMaster.push_back (m);
    }
}