Use a key list for NiColorData

actorid
Chris Robinson 13 years ago
parent 3f11b6b1ae
commit 9995dff943

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

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

Loading…
Cancel
Save