|
|
|
@ -128,28 +128,16 @@ void ESM4::Cell::load(ESM4::Reader& reader)
|
|
|
|
|
break;
|
|
|
|
|
case ESM4::SUB_DATA:
|
|
|
|
|
{
|
|
|
|
|
if (esmVer == ESM::VER_094 || esmVer == ESM::VER_170 || isFONV)
|
|
|
|
|
if (subHdr.dataSize == 2)
|
|
|
|
|
reader.get(mCellFlags);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (subHdr.dataSize != 1)
|
|
|
|
|
throw std::runtime_error("CELL unexpected DATA flag size");
|
|
|
|
|
std::uint8_t value = 0;
|
|
|
|
|
reader.get(value);
|
|
|
|
|
mCellFlags = value;
|
|
|
|
|
}
|
|
|
|
|
if (subHdr.dataSize == 2)
|
|
|
|
|
reader.get(mCellFlags);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (subHdr.dataSize != 1)
|
|
|
|
|
throw std::runtime_error("CELL unexpected DATA flag size");
|
|
|
|
|
std::uint8_t value = 0;
|
|
|
|
|
reader.get(value); // 8 bits in Obvlivion
|
|
|
|
|
reader.get(value);
|
|
|
|
|
mCellFlags = value;
|
|
|
|
|
}
|
|
|
|
|
#if 0
|
|
|
|
|
std::string padding;
|
|
|
|
|
padding.insert(0, reader.stackSize()*2, ' ');
|
|
|
|
|
std::cout << padding << "flags: " << std::hex << mCellFlags << std::endl;
|
|
|
|
|
#endif
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case ESM4::SUB_XCLR: // for exterior cells
|
|
|
|
@ -183,21 +171,28 @@ void ESM4::Cell::load(ESM4::Reader& reader)
|
|
|
|
|
break;
|
|
|
|
|
case ESM4::SUB_XCLL:
|
|
|
|
|
{
|
|
|
|
|
if (esmVer == ESM::VER_094 || esmVer == ESM::VER_170 || isFONV)
|
|
|
|
|
// TES4
|
|
|
|
|
if (subHdr.dataSize == 36)
|
|
|
|
|
reader.get(&mLighting, 36);
|
|
|
|
|
// FO3, FONV
|
|
|
|
|
else if (subHdr.dataSize == 40)
|
|
|
|
|
reader.get(mLighting);
|
|
|
|
|
// TES5
|
|
|
|
|
else if (subHdr.dataSize == 92)
|
|
|
|
|
{
|
|
|
|
|
if (subHdr.dataSize == 40) // FO3/FONV
|
|
|
|
|
reader.get(mLighting);
|
|
|
|
|
else if (subHdr.dataSize == 92) // TES5
|
|
|
|
|
{
|
|
|
|
|
reader.get(mLighting);
|
|
|
|
|
reader.skipSubRecordData(52); // FIXME
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
reader.skipSubRecordData();
|
|
|
|
|
reader.get(mLighting);
|
|
|
|
|
reader.skipSubRecordData(52); // FIXME
|
|
|
|
|
}
|
|
|
|
|
// FO4
|
|
|
|
|
else if (subHdr.dataSize == 136)
|
|
|
|
|
{
|
|
|
|
|
reader.get(mLighting);
|
|
|
|
|
reader.skipSubRecordData(96); // FIXME
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
reader.get(&mLighting, 36); // TES4
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
reader.skipSubRecordData();
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case ESM4::SUB_XCMT:
|
|
|
|
@ -227,9 +222,18 @@ void ESM4::Cell::load(ESM4::Reader& reader)
|
|
|
|
|
case ESM4::SUB_XEZN:
|
|
|
|
|
case ESM4::SUB_XWEM:
|
|
|
|
|
case ESM4::SUB_XILL:
|
|
|
|
|
case ESM4::SUB_XRNK: // Oblivion only?
|
|
|
|
|
case ESM4::SUB_XRNK:
|
|
|
|
|
case ESM4::SUB_XCET: // FO3
|
|
|
|
|
case ESM4::SUB_IMPF: // FO3 Zeta
|
|
|
|
|
case ESM4::SUB_CNAM: // FO4
|
|
|
|
|
case ESM4::SUB_PCMB: // FO4
|
|
|
|
|
case ESM4::SUB_RVIS: // FO4
|
|
|
|
|
case ESM4::SUB_VISI: // FO4
|
|
|
|
|
case ESM4::SUB_XGDR: // FO4
|
|
|
|
|
case ESM4::SUB_XILW: // FO4
|
|
|
|
|
case ESM4::SUB_XCRI: // FO4
|
|
|
|
|
case ESM4::SUB_XPRI: // FO4
|
|
|
|
|
case ESM4::SUB_ZNAM: // FO4
|
|
|
|
|
reader.skipSubRecordData();
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|