diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-01-20 15:14:38 -0500 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-01-20 15:14:38 -0500 |
commit | 40b6cb754122f613c1f3018786f095691ec382ff (patch) | |
tree | f8a8abbf32d25b43ef3e6cda4e939fd90dc16db0 /indra/newview/llappearancemgr.h | |
parent | f009fbcb03e7d4e87d41f60e2873ffcbcb02354b (diff) |
For EXT-4222: Switching outfits sometimes causes me to wear both, and show previous outfit as worn. Postpone appearance change until wearables have resolved.
Diffstat (limited to 'indra/newview/llappearancemgr.h')
-rw-r--r-- | indra/newview/llappearancemgr.h | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 20745b70e4..517face777 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -39,7 +39,7 @@ #include "llcallbacklist.h" class LLWearable; -struct LLWearableHoldingPattern; +class LLWearableHoldingPattern; class LLAppearanceManager: public LLSingleton<LLAppearanceManager> { @@ -168,4 +168,40 @@ void doOnIdle(T callable) gIdleCallbacks.addFunction(&OnIdleCallback<T>::onIdle,cb_functor); } +// Shim class and template function to allow arbitrary boost::bind +// expressions to be run as recurring idle callbacks. +template <typename T> +class OnIdleCallbackRepeating +{ +public: + OnIdleCallbackRepeating(T callable): + mCallable(callable) + { + } + // Will keep getting called until the callable returns false. + static void onIdle(void *data) + { + OnIdleCallbackRepeating<T>* self = reinterpret_cast<OnIdleCallbackRepeating<T>*>(data); + bool done = self->call(); + if (done) + { + gIdleCallbacks.deleteFunction(onIdle, data); + delete self; + } + } + bool call() + { + return mCallable(); + } +private: + T mCallable; +}; + +template <typename T> +void doOnIdleRepeating(T callable) +{ + OnIdleCallbackRepeating<T>* cb_functor = new OnIdleCallbackRepeating<T>(callable); + gIdleCallbacks.addFunction(&OnIdleCallbackRepeating<T>::onIdle,cb_functor); +} + #endif |