X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fscene%2Fmodel%2Fpersonality.cxx;h=60b8a987cf7bfa0c2f57cb97e22d4877aa9b7983;hb=629a4a950e2e3215cab2acfacf05247d424480e4;hp=a1374165f003e9b7129bb1589169d8dce908897e;hpb=efac53b1212d3dd3456b7cada4262287c700ce34;p=simgear.git diff --git a/simgear/scene/model/personality.cxx b/simgear/scene/model/personality.cxx index a1374165..60b8a987 100755 --- a/simgear/scene/model/personality.cxx +++ b/simgear/scene/model/personality.cxx @@ -2,7 +2,34 @@ * $Id$ */ +#ifdef HAVE_CONFIG_H +# include +#endif + #include "personality.hxx" +#include "animation.hxx" + +static int +personality_pretrav_callback(ssgEntity * entity, int mask) +{ + ((SGPersonalityBranch *)entity)->_old_current = SGAnimation::current_object; + SGAnimation::current_object = (SGPersonalityBranch *)entity; + return 1; +} + +static int +personality_posttrav_callback(ssgEntity * entity, int mask) +{ + SGAnimation::current_object = ((SGPersonalityBranch *)entity)->_old_current; + ((SGPersonalityBranch *)entity)->_old_current = 0; + return 1; +} + +SGPersonalityBranch::SGPersonalityBranch() +{ + setTravCallback(SSG_CALLBACK_PRETRAV, personality_pretrav_callback); + setTravCallback(SSG_CALLBACK_POSTTRAV, personality_posttrav_callback); +} void SGPersonalityBranch::setDoubleValue( double value, SGAnimation *anim, int var_id, int var_num ) {