Fixed: #961 Allow use of UAnimationSet without activate headers optimization

This commit is contained in:
kervala 2010-06-04 14:10:13 +02:00
parent f0236fc165
commit 2c616af7f3
4 changed files with 8 additions and 9 deletions

View file

@ -54,7 +54,7 @@ private:
public: public:
/// Constructor /// Constructor
CAnimationSetUser(CDriverUser *owner) CAnimationSetUser(CDriverUser *owner, bool headerOptim = true)
{ {
nlassert(owner); nlassert(owner);
_Owner= owner; _Owner= owner;
@ -62,7 +62,7 @@ public:
nlassert((uint)UAnimationSet::NotFound == (uint)CAnimationSet::NotFound ); nlassert((uint)UAnimationSet::NotFound == (uint)CAnimationSet::NotFound );
// create a smartptred animation set. Allow header compression // create a smartptred animation set. Allow header compression
_AnimationSet= new CAnimationSet(true); _AnimationSet= new CAnimationSet(headerOptim);
} }
/// Constructor /// Constructor

View file

@ -229,7 +229,7 @@ public:
/// \name AnimationSet gestion. /// \name AnimationSet gestion.
// @{ // @{
/// Create an empty AnimationSet. /// Create an empty AnimationSet.
virtual UAnimationSet *createAnimationSet(); virtual UAnimationSet *createAnimationSet(bool headerOptim = true);
/// Create a new AnimationSet, load it from a file. Use CPath to search the animation set. exception EPathNotFound if not found. /// Create a new AnimationSet, load it from a file. Use CPath to search the animation set. exception EPathNotFound if not found.
virtual UAnimationSet *createAnimationSet(const std::string &animationSetFile); virtual UAnimationSet *createAnimationSet(const std::string &animationSetFile);
/// Delete a AnimationSet. /// Delete a AnimationSet.

View file

@ -294,7 +294,7 @@ public:
/// \name AnimationSet gestion. /// \name AnimationSet gestion.
// @{ // @{
/// Create an empty AnimationSet. /// Create an empty AnimationSet.
virtual UAnimationSet *createAnimationSet() =0; virtual UAnimationSet *createAnimationSet(bool headerOptim = true) =0;
/// Create a new AnimationSet, load it from a file. Use CPath to search the animation set. exception EPathNotFound if not found. /// Create a new AnimationSet, load it from a file. Use CPath to search the animation set. exception EPathNotFound if not found.
virtual UAnimationSet *createAnimationSet(const std::string &animationSetFile) =0; virtual UAnimationSet *createAnimationSet(const std::string &animationSetFile) =0;
/// Delete a AnimationSet. NB: actually, this animation set is internally deleted only when no more UPlayList use it. /// Delete a AnimationSet. NB: actually, this animation set is internally deleted only when no more UPlayList use it.

View file

@ -135,17 +135,16 @@ UMaterial CDriverUser::createMaterial()
// *************************************************************************** // ***************************************************************************
void CDriverUser::deleteMaterial(UMaterial &umat) void CDriverUser::deleteMaterial(UMaterial &umat)
{ {
delete umat.getObjectPtr(); delete umat.getObjectPtr();
umat.detach(); umat.detach();
} }
// *************************************************************************** // ***************************************************************************
UAnimationSet *CDriverUser::createAnimationSet() UAnimationSet *CDriverUser::createAnimationSet(bool headerOptim)
{ {
return _AnimationSets.insert(new CAnimationSetUser(this, headerOptim));
return _AnimationSets.insert(new CAnimationSetUser(this));
} }
// *************************************************************************** // ***************************************************************************
UAnimationSet *CDriverUser::createAnimationSet(const std::string &animationSetFile) UAnimationSet *CDriverUser::createAnimationSet(const std::string &animationSetFile)
{ {
@ -157,10 +156,10 @@ UAnimationSet *CDriverUser::createAnimationSet(const std::string &animationSet
f.open(path); f.open(path);
return _AnimationSets.insert(new CAnimationSetUser(this, f)); return _AnimationSets.insert(new CAnimationSetUser(this, f));
} }
// *************************************************************************** // ***************************************************************************
void CDriverUser::deleteAnimationSet(UAnimationSet *animationSet) void CDriverUser::deleteAnimationSet(UAnimationSet *animationSet)
{ {
_AnimationSets.erase((CAnimationSetUser*)animationSet, "deleteAnimationSet(): Bad AnimationSet ptr"); _AnimationSets.erase((CAnimationSetUser*)animationSet, "deleteAnimationSet(): Bad AnimationSet ptr");
} }