|
|
|
@ -35,8 +35,6 @@ void ESM4::LandTexture::load(ESM4::Reader& reader)
|
|
|
|
|
{
|
|
|
|
|
mId = reader.getFormIdFromHeader();
|
|
|
|
|
mFlags = reader.hdr().record.flags;
|
|
|
|
|
std::uint32_t esmVer = reader.esmVersion();
|
|
|
|
|
bool isFONV = esmVer == ESM::VER_132 || esmVer == ESM::VER_133 || esmVer == ESM::VER_134;
|
|
|
|
|
|
|
|
|
|
while (reader.getSubRecordHeader())
|
|
|
|
|
{
|
|
|
|
@ -48,26 +46,23 @@ void ESM4::LandTexture::load(ESM4::Reader& reader)
|
|
|
|
|
break;
|
|
|
|
|
case ESM4::SUB_HNAM:
|
|
|
|
|
{
|
|
|
|
|
if (isFONV)
|
|
|
|
|
{
|
|
|
|
|
reader.skipSubRecordData(); // FIXME: skip FONV for now
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((reader.esmVersion() == ESM::VER_094 || reader.esmVersion() == ESM::VER_170)
|
|
|
|
|
&& subHdr.dataSize == 2) // FO3 is VER_094 but dataSize 3
|
|
|
|
|
// TES5+
|
|
|
|
|
if (subHdr.dataSize == 2)
|
|
|
|
|
{
|
|
|
|
|
reader.get(mHavokFriction);
|
|
|
|
|
reader.get(mHavokRestitution);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
// TES4, FO3, FNV
|
|
|
|
|
else if (subHdr.dataSize == 3)
|
|
|
|
|
{
|
|
|
|
|
if (subHdr.dataSize != 3)
|
|
|
|
|
throw std::runtime_error("LTEX unexpected HNAM size, expected 3");
|
|
|
|
|
reader.get(mHavokMaterial);
|
|
|
|
|
reader.get(mHavokFriction);
|
|
|
|
|
reader.get(mHavokRestitution);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
reader.skipSubRecordData();
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case ESM4::SUB_ICON:
|
|
|
|
@ -77,14 +72,14 @@ void ESM4::LandTexture::load(ESM4::Reader& reader)
|
|
|
|
|
reader.get(mTextureSpecular);
|
|
|
|
|
break;
|
|
|
|
|
case ESM4::SUB_GNAM:
|
|
|
|
|
reader.getFormId(mGrass);
|
|
|
|
|
reader.getFormId(mGrass.emplace_back());
|
|
|
|
|
break;
|
|
|
|
|
case ESM4::SUB_TNAM:
|
|
|
|
|
reader.getFormId(mTexture);
|
|
|
|
|
break; // TES5 only
|
|
|
|
|
break; // TES5, FO4
|
|
|
|
|
case ESM4::SUB_MNAM:
|
|
|
|
|
reader.getFormId(mMaterial);
|
|
|
|
|
break; // TES5 only
|
|
|
|
|
break; // TES5, FO4
|
|
|
|
|
default:
|
|
|
|
|
throw std::runtime_error("ESM4::LTEX::load - Unknown subrecord " + ESM::printName(subHdr.typeId));
|
|
|
|
|
}
|
|
|
|
|