2015-02-23 20:06:10 +00:00
|
|
|
#include "extra.hpp"
|
|
|
|
|
|
|
|
namespace Nif
|
|
|
|
{
|
|
|
|
|
2021-07-27 04:58:57 +00:00
|
|
|
void NiExtraData::read(NIFStream* nif)
|
|
|
|
{
|
|
|
|
Extra::read(nif);
|
2015-02-23 20:06:10 +00:00
|
|
|
|
2023-08-31 21:58:23 +00:00
|
|
|
nif->readVector(mData, mRecordSize);
|
2015-02-23 20:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void NiTextKeyExtraData::read(NIFStream* nif)
|
|
|
|
{
|
|
|
|
Extra::read(nif);
|
2022-09-22 18:26:05 +00:00
|
|
|
|
2023-08-31 21:58:23 +00:00
|
|
|
uint32_t numKeys;
|
|
|
|
nif->read(numKeys);
|
|
|
|
mList.resize(numKeys);
|
|
|
|
for (TextKey& key : mList)
|
2022-09-22 18:26:05 +00:00
|
|
|
{
|
2023-08-31 21:58:23 +00:00
|
|
|
nif->read(key.mTime);
|
|
|
|
nif->read(key.mText);
|
2022-09-22 18:26:05 +00:00
|
|
|
}
|
|
|
|
}
|
2015-02-23 20:06:10 +00:00
|
|
|
|
2019-09-13 16:54:19 +00:00
|
|
|
void NiVertWeightsExtraData::read(NIFStream* nif)
|
2022-09-22 18:26:05 +00:00
|
|
|
{
|
2019-09-13 16:54:19 +00:00
|
|
|
Extra::read(nif);
|
2015-02-23 20:06:10 +00:00
|
|
|
|
2023-08-31 21:58:23 +00:00
|
|
|
nif->skip(nif->get<uint16_t>() * sizeof(float)); // vertex weights I guess
|
2020-11-08 21:19:35 +00:00
|
|
|
}
|
2015-02-23 20:06:10 +00:00
|
|
|
|
2021-11-10 16:21:07 +00:00
|
|
|
void BSBound::read(NIFStream* nif)
|
2022-09-22 18:26:05 +00:00
|
|
|
{
|
2021-11-10 16:21:07 +00:00
|
|
|
Extra::read(nif);
|
2023-08-31 21:58:23 +00:00
|
|
|
|
|
|
|
nif->read(mCenter);
|
|
|
|
nif->read(mExtents);
|
2021-11-10 16:21:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void BSFurnitureMarker::LegacyFurniturePosition::read(NIFStream* nif)
|
|
|
|
{
|
2023-08-31 21:58:23 +00:00
|
|
|
nif->read(mOffset);
|
|
|
|
nif->read(mOrientation);
|
|
|
|
nif->read(mPositionRef);
|
2021-11-10 19:50:01 +00:00
|
|
|
nif->skip(1); // Position ref 2
|
2021-11-10 16:21:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void BSFurnitureMarker::FurniturePosition::read(NIFStream* nif)
|
|
|
|
{
|
2023-08-31 21:58:23 +00:00
|
|
|
nif->read(mOffset);
|
|
|
|
nif->read(mHeading);
|
|
|
|
nif->read(mType);
|
|
|
|
nif->read(mEntryPoint);
|
2021-11-10 16:21:07 +00:00
|
|
|
}
|
2022-09-22 18:26:05 +00:00
|
|
|
|
2015-02-23 20:06:10 +00:00
|
|
|
void BSFurnitureMarker::read(NIFStream* nif)
|
2021-11-10 16:21:07 +00:00
|
|
|
{
|
|
|
|
Extra::read(nif);
|
2023-08-31 21:58:23 +00:00
|
|
|
|
|
|
|
uint32_t num;
|
|
|
|
nif->read(num);
|
2021-11-10 16:21:07 +00:00
|
|
|
if (nif->getBethVersion() <= NIFFile::BethVersion::BETHVER_FO3)
|
2022-09-22 18:26:05 +00:00
|
|
|
{
|
2021-11-10 19:50:01 +00:00
|
|
|
mLegacyMarkers.resize(num);
|
|
|
|
for (auto& marker : mLegacyMarkers)
|
2021-11-10 16:21:07 +00:00
|
|
|
marker.read(nif);
|
2022-09-22 18:26:05 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-11-10 19:50:01 +00:00
|
|
|
mMarkers.resize(num);
|
|
|
|
for (auto& marker : mMarkers)
|
2021-11-10 16:21:07 +00:00
|
|
|
marker.read(nif);
|
2022-09-22 18:26:05 +00:00
|
|
|
}
|
2021-11-10 16:21:07 +00:00
|
|
|
}
|
|
|
|
|
2023-06-01 20:27:42 +00:00
|
|
|
void BSInvMarker::read(NIFStream* nif)
|
|
|
|
{
|
|
|
|
Extra::read(nif);
|
|
|
|
|
2023-08-31 21:58:23 +00:00
|
|
|
float rotX = nif->get<uint16_t>() / 1000.f;
|
|
|
|
float rotY = nif->get<uint16_t>() / 1000.f;
|
|
|
|
float rotZ = nif->get<uint16_t>() / 1000.f;
|
2023-06-01 20:27:42 +00:00
|
|
|
mRotation = osg::Quat(rotX, osg::X_AXIS, rotY, osg::Y_AXIS, rotZ, osg::Z_AXIS);
|
2023-08-31 21:58:23 +00:00
|
|
|
nif->read(mScale);
|
2023-06-01 20:27:42 +00:00
|
|
|
}
|
2023-07-20 00:38:15 +00:00
|
|
|
|
|
|
|
void BSBehaviorGraphExtraData::read(NIFStream* nif)
|
|
|
|
{
|
|
|
|
Extra::read(nif);
|
2023-08-31 21:58:23 +00:00
|
|
|
|
|
|
|
nif->read(mFile);
|
|
|
|
nif->read(mControlsBaseSkeleton);
|
2023-07-20 00:38:15 +00:00
|
|
|
}
|
|
|
|
|
2015-02-23 20:06:10 +00:00
|
|
|
}
|