Maybe load FO4 cell records

macos_ci_fix
Alexei Kotov 1 year ago
parent 2b1ca84cb2
commit 5a73b351e2

@ -128,28 +128,16 @@ void ESM4::Cell::load(ESM4::Reader& reader)
break; break;
case ESM4::SUB_DATA: case ESM4::SUB_DATA:
{ {
if (esmVer == ESM::VER_094 || esmVer == ESM::VER_170 || isFONV) if (subHdr.dataSize == 2)
if (subHdr.dataSize == 2) reader.get(mCellFlags);
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;
}
else else
{ {
if (subHdr.dataSize != 1)
throw std::runtime_error("CELL unexpected DATA flag size");
std::uint8_t value = 0; std::uint8_t value = 0;
reader.get(value); // 8 bits in Obvlivion reader.get(value);
mCellFlags = 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; break;
} }
case ESM4::SUB_XCLR: // for exterior cells case ESM4::SUB_XCLR: // for exterior cells
@ -183,21 +171,28 @@ void ESM4::Cell::load(ESM4::Reader& reader)
break; break;
case ESM4::SUB_XCLL: 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);
reader.get(mLighting); reader.skipSubRecordData(52); // FIXME
else if (subHdr.dataSize == 92) // TES5 }
{ // FO4
reader.get(mLighting); else if (subHdr.dataSize == 136)
reader.skipSubRecordData(52); // FIXME {
} reader.get(mLighting);
else reader.skipSubRecordData(96); // FIXME
reader.skipSubRecordData();
} }
else else
reader.get(&mLighting, 36); // TES4 {
reader.skipSubRecordData();
}
break; break;
} }
case ESM4::SUB_XCMT: case ESM4::SUB_XCMT:
@ -227,9 +222,18 @@ void ESM4::Cell::load(ESM4::Reader& reader)
case ESM4::SUB_XEZN: case ESM4::SUB_XEZN:
case ESM4::SUB_XWEM: case ESM4::SUB_XWEM:
case ESM4::SUB_XILL: case ESM4::SUB_XILL:
case ESM4::SUB_XRNK: // Oblivion only? case ESM4::SUB_XRNK:
case ESM4::SUB_XCET: // FO3 case ESM4::SUB_XCET: // FO3
case ESM4::SUB_IMPF: // FO3 Zeta 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(); reader.skipSubRecordData();
break; break;
default: default:

Loading…
Cancel
Save