From 2c616af7f3c1d9a74dd972779a902c495374f4d2 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 4 Jun 2010 14:10:13 +0200 Subject: [PATCH] Fixed: #961 Allow use of UAnimationSet without activate headers optimization --- code/nel/include/nel/3d/animation_set_user.h | 4 ++-- code/nel/include/nel/3d/driver_user.h | 2 +- code/nel/include/nel/3d/u_driver.h | 2 +- code/nel/src/3d/driver_user2.cpp | 9 ++++----- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/code/nel/include/nel/3d/animation_set_user.h b/code/nel/include/nel/3d/animation_set_user.h index f885eeb1e..3209956ec 100644 --- a/code/nel/include/nel/3d/animation_set_user.h +++ b/code/nel/include/nel/3d/animation_set_user.h @@ -54,7 +54,7 @@ private: public: /// Constructor - CAnimationSetUser(CDriverUser *owner) + CAnimationSetUser(CDriverUser *owner, bool headerOptim = true) { nlassert(owner); _Owner= owner; @@ -62,7 +62,7 @@ public: nlassert((uint)UAnimationSet::NotFound == (uint)CAnimationSet::NotFound ); // create a smartptred animation set. Allow header compression - _AnimationSet= new CAnimationSet(true); + _AnimationSet= new CAnimationSet(headerOptim); } /// Constructor diff --git a/code/nel/include/nel/3d/driver_user.h b/code/nel/include/nel/3d/driver_user.h index 7070b62f8..e5a662d9a 100644 --- a/code/nel/include/nel/3d/driver_user.h +++ b/code/nel/include/nel/3d/driver_user.h @@ -229,7 +229,7 @@ public: /// \name AnimationSet gestion. // @{ /// 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. virtual UAnimationSet *createAnimationSet(const std::string &animationSetFile); /// Delete a AnimationSet. diff --git a/code/nel/include/nel/3d/u_driver.h b/code/nel/include/nel/3d/u_driver.h index 02342bf54..4e3126c4b 100644 --- a/code/nel/include/nel/3d/u_driver.h +++ b/code/nel/include/nel/3d/u_driver.h @@ -294,7 +294,7 @@ public: /// \name AnimationSet gestion. // @{ /// 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. 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. diff --git a/code/nel/src/3d/driver_user2.cpp b/code/nel/src/3d/driver_user2.cpp index 7ab303f09..0999ef975 100644 --- a/code/nel/src/3d/driver_user2.cpp +++ b/code/nel/src/3d/driver_user2.cpp @@ -135,17 +135,16 @@ UMaterial CDriverUser::createMaterial() // *************************************************************************** void CDriverUser::deleteMaterial(UMaterial &umat) { - delete umat.getObjectPtr(); umat.detach(); } // *************************************************************************** -UAnimationSet *CDriverUser::createAnimationSet() +UAnimationSet *CDriverUser::createAnimationSet(bool headerOptim) { - - return _AnimationSets.insert(new CAnimationSetUser(this)); + return _AnimationSets.insert(new CAnimationSetUser(this, headerOptim)); } + // *************************************************************************** UAnimationSet *CDriverUser::createAnimationSet(const std::string &animationSetFile) { @@ -157,10 +156,10 @@ UAnimationSet *CDriverUser::createAnimationSet(const std::string &animationSet f.open(path); return _AnimationSets.insert(new CAnimationSetUser(this, f)); } + // *************************************************************************** void CDriverUser::deleteAnimationSet(UAnimationSet *animationSet) { - _AnimationSets.erase((CAnimationSetUser*)animationSet, "deleteAnimationSet(): Bad AnimationSet ptr"); }