1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 20:53:50 +00:00

Use a key list for NiColorData

This commit is contained in:
Chris Robinson 2012-07-12 14:33:50 -07:00
parent 3f11b6b1ae
commit 9995dff943
2 changed files with 4 additions and 10 deletions

View file

@ -275,19 +275,11 @@ public:
class NiColorData : public Record
{
public:
struct ColorData
{
float time;
Ogre::Vector4 rgba;
};
Vector4KeyList mKeyList;
void read(NIFFile *nif)
{
int count = nif->getInt();
nif->getInt(); // always 1
// Skip the data
nif->skip(count * 5*sizeof(float));
mKeyList.read(nif);
}
};

View file

@ -223,6 +223,7 @@ struct KeyT {
};
typedef KeyT<float> FloatKey;
typedef KeyT<Ogre::Vector3> Vector3Key;
typedef KeyT<Ogre::Vector4> Vector4Key;
typedef KeyT<Ogre::Quaternion> QuaternionKey;
template<typename T, T (NIFFile::*getValue)()>
@ -281,6 +282,7 @@ struct KeyListT {
};
typedef KeyListT<float,&NIFFile::getFloat> FloatKeyList;
typedef KeyListT<Ogre::Vector3,&NIFFile::getVector3> Vector3KeyList;
typedef KeyListT<Ogre::Vector4,&NIFFile::getVector4> Vector4KeyList;
typedef KeyListT<Ogre::Quaternion,&NIFFile::getQuaternion> QuaternionKeyList;
} // Namespace