|
|
|
@ -1,26 +1,3 @@
|
|
|
|
|
/*
|
|
|
|
|
OpenMW - The completely unofficial reimplementation of Morrowind
|
|
|
|
|
Copyright (C) 2008-2010 Nicolay Korslund
|
|
|
|
|
Email: < korslund@gmail.com >
|
|
|
|
|
WWW: https://openmw.org/
|
|
|
|
|
|
|
|
|
|
This file (extra.h) is part of the OpenMW package.
|
|
|
|
|
|
|
|
|
|
OpenMW is distributed as free software: you can redistribute it
|
|
|
|
|
and/or modify it under the terms of the GNU General Public License
|
|
|
|
|
version 3, as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful, but
|
|
|
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
version 3 along with this program. If not, see
|
|
|
|
|
https://www.gnu.org/licenses/ .
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef OPENMW_COMPONENTS_NIF_EXTRA_HPP
|
|
|
|
|
#define OPENMW_COMPONENTS_NIF_EXTRA_HPP
|
|
|
|
|
|
|
|
|
@ -29,94 +6,70 @@
|
|
|
|
|
namespace Nif
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
struct NiExtraData : public Extra
|
|
|
|
|
template <typename T>
|
|
|
|
|
struct TypedExtra : public Extra
|
|
|
|
|
{
|
|
|
|
|
std::vector<char> data;
|
|
|
|
|
|
|
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
|
};
|
|
|
|
|
T mData;
|
|
|
|
|
|
|
|
|
|
struct NiVertWeightsExtraData : public Extra
|
|
|
|
|
{
|
|
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct NiTextKeyExtraData : public Extra
|
|
|
|
|
{
|
|
|
|
|
struct TextKey
|
|
|
|
|
void read(NIFStream* nif) override
|
|
|
|
|
{
|
|
|
|
|
float time;
|
|
|
|
|
std::string text;
|
|
|
|
|
};
|
|
|
|
|
std::vector<TextKey> list;
|
|
|
|
|
|
|
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct NiStringExtraData : public Extra
|
|
|
|
|
{
|
|
|
|
|
/* Known meanings:
|
|
|
|
|
"MRK" - marker, only visible in the editor, not rendered in-game
|
|
|
|
|
"NCC" - no collision except with the camera
|
|
|
|
|
Anything else starting with "NC" - no collision
|
|
|
|
|
*/
|
|
|
|
|
std::string string;
|
|
|
|
|
Extra::read(nif);
|
|
|
|
|
|
|
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
|
nif->read(mData);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct NiIntegerExtraData : public Extra
|
|
|
|
|
template <typename T>
|
|
|
|
|
struct TypedVectorExtra : public Extra
|
|
|
|
|
{
|
|
|
|
|
unsigned int data;
|
|
|
|
|
|
|
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
|
};
|
|
|
|
|
std::vector<T> mData;
|
|
|
|
|
|
|
|
|
|
struct NiIntegersExtraData : public Extra
|
|
|
|
|
{
|
|
|
|
|
std::vector<unsigned int> data;
|
|
|
|
|
void read(NIFStream* nif) override
|
|
|
|
|
{
|
|
|
|
|
Extra::read(nif);
|
|
|
|
|
|
|
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
|
nif->readVector(mData, nif->get<uint32_t>());
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct NiBinaryExtraData : public Extra
|
|
|
|
|
{
|
|
|
|
|
std::vector<char> data;
|
|
|
|
|
using NiBooleanExtraData = TypedExtra<bool>;
|
|
|
|
|
using NiFloatExtraData = TypedExtra<float>;
|
|
|
|
|
using NiIntegerExtraData = TypedExtra<uint32_t>;
|
|
|
|
|
using NiStringExtraData = TypedExtra<std::string>;
|
|
|
|
|
using NiVectorExtraData = TypedExtra<osg::Vec4f>;
|
|
|
|
|
|
|
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
|
};
|
|
|
|
|
using NiBinaryExtraData = TypedVectorExtra<uint8_t>;
|
|
|
|
|
using NiFloatsExtraData = TypedVectorExtra<float>;
|
|
|
|
|
using NiIntegersExtraData = TypedVectorExtra<uint32_t>;
|
|
|
|
|
|
|
|
|
|
struct NiBooleanExtraData : public Extra
|
|
|
|
|
{
|
|
|
|
|
bool data;
|
|
|
|
|
|
|
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct NiVectorExtraData : public Extra
|
|
|
|
|
// Distinct from NiBinaryExtraData, uses mRecordSize as its size
|
|
|
|
|
struct NiExtraData : public Extra
|
|
|
|
|
{
|
|
|
|
|
osg::Vec4f data;
|
|
|
|
|
std::vector<uint8_t> mData;
|
|
|
|
|
|
|
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct NiFloatExtraData : public Extra
|
|
|
|
|
struct NiVertWeightsExtraData : public Extra
|
|
|
|
|
{
|
|
|
|
|
float data;
|
|
|
|
|
|
|
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct NiFloatsExtraData : public Extra
|
|
|
|
|
struct NiTextKeyExtraData : public Extra
|
|
|
|
|
{
|
|
|
|
|
std::vector<float> data;
|
|
|
|
|
struct TextKey
|
|
|
|
|
{
|
|
|
|
|
float mTime;
|
|
|
|
|
std::string mText;
|
|
|
|
|
};
|
|
|
|
|
std::vector<TextKey> mList;
|
|
|
|
|
|
|
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct BSBound : public Extra
|
|
|
|
|
{
|
|
|
|
|
osg::Vec3f center, halfExtents;
|
|
|
|
|
osg::Vec3f mCenter, mExtents;
|
|
|
|
|
|
|
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
|
};
|
|
|
|
@ -149,7 +102,7 @@ namespace Nif
|
|
|
|
|
struct BSInvMarker : public Extra
|
|
|
|
|
{
|
|
|
|
|
osg::Quat mRotation;
|
|
|
|
|
float mScale = 1.0f;
|
|
|
|
|
float mScale;
|
|
|
|
|
|
|
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
|
};
|
|
|
|
@ -162,5 +115,5 @@ namespace Nif
|
|
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // Namespace
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|