Frederic Bouvier:
Fix a memory leak, and brownian animation, if not motion. I have 2 new files : personality.[ch]xx . They store the personality data that would be deleted when the object is destroyed, instead of staying in the animation maps. I also manage the current animation step better and the towers are not flashing randomly now. Makefile.am is updated.
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "model.hxx"
|
||||
#include "animation.hxx"
|
||||
#include "personality.hxx"
|
||||
|
||||
#include "modellib.hxx"
|
||||
|
||||
@@ -61,15 +62,11 @@ SGModelLib::flush1()
|
||||
}
|
||||
}
|
||||
|
||||
struct SGPersonalityBranch : public ssgBranch {
|
||||
ssgBranch *_old_current;
|
||||
};
|
||||
|
||||
static int
|
||||
personality_pretrav_callback(ssgEntity * entity, int mask)
|
||||
{
|
||||
((SGPersonalityBranch *)entity)->_old_current = SGAnimation::current_object;
|
||||
SGAnimation::current_object = (ssgBranch *)entity;
|
||||
SGAnimation::current_object = (SGPersonalityBranch *)entity;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user