Showing the changes to interface/src/Application.cpp (1 of 72 files). Show all
Unified · Split
| @@ -50,6 +50,7 @@ · 49 unmodified lines | |||
| 50 | #include <AssetClient.h> | 50 | #include <AssetClient.h> |
| 51 | #include <AssetUpload.h> | 51 | #include <AssetUpload.h> |
| 52 | #include <AutoUpdater.h> | 52 | #include <AutoUpdater.h> |
| 53 | #include <AudioInjectorManager.h> | ||
| 53 | #include <CursorManager.h> | 54 | #include <CursorManager.h> |
| 54 | #include <DeferredLightingEffect.h> | 55 | #include <DeferredLightingEffect.h> |
| 55 | #include <display-plugins/DisplayPlugin.h> | 56 | #include <display-plugins/DisplayPlugin.h> |
| @@ -343,6 +344,7 @@ bool setupEssentials(int& argc, char** argv) { · 287 unmodified lines | |||
| 343 | DependencyManager::set<PathUtils>(); | 344 | DependencyManager::set<PathUtils>(); |
| 344 | DependencyManager::set<InterfaceActionFactory>(); | 345 | DependencyManager::set<InterfaceActionFactory>(); |
| 345 | DependencyManager::set<AssetClient>(); | 346 | DependencyManager::set<AssetClient>(); |
| 347 | DependencyManager::set<AudioInjectorManager>(); | ||
| 346 | DependencyManager::set<MessagesClient>(); | 348 | DependencyManager::set<MessagesClient>(); |
| 347 | DependencyManager::set<UserInputMapper>(); | 349 | DependencyManager::set<UserInputMapper>(); |
| 348 | DependencyManager::set<controller::ScriptingInterface, ControllerScriptingInterface>(); | 350 | DependencyManager::set<controller::ScriptingInterface, ControllerScriptingInterface>(); |
| @@ -898,6 +900,10 @@ void Application::cleanupBeforeQuit() { · 549 unmodified lines | |||
| 898 | 900 | ||
| 899 | // destroy the AudioClient so it and its thread have a chance to go down safely | 901 | // destroy the AudioClient so it and its thread have a chance to go down safely |
| 900 | DependencyManager::destroy<AudioClient>(); | 902 | DependencyManager::destroy<AudioClient>(); |
| 903 | |||
| 904 | // destroy the AudioInjectorManager so it and its thread have a chance to go down safely | ||
| 905 | // this will also stop any ongoing network injectors | ||
| 906 | DependencyManager::destroy<AudioInjectorManager>(); | ||
| 901 | 907 | ||
| 902 | // Destroy third party processes after scripts have finished using them. | 908 | // Destroy third party processes after scripts have finished using them. |
| 903 | #ifdef HAVE_DDE | 909 | #ifdef HAVE_DDE |
| @@ -2553,11 +2559,12 @@ void Application::init() { · 1649 unmodified lines | |||
| 2553 | setAvatarUpdateThreading(); | 2559 | setAvatarUpdateThreading(); |
| 2554 | } | 2560 | } |
| 2555 | 2561 | ||
| 2562 | const bool ENABLE_AVATAR_UPDATE_THREADING = false; | ||
| 2556 | void Application::setAvatarUpdateThreading() { | 2563 | void Application::setAvatarUpdateThreading() { |
| 2557 | setAvatarUpdateThreading(Menu::getInstance()->isOptionChecked(MenuOption::EnableAvatarUpdateThreading)); | 2564 | setAvatarUpdateThreading(ENABLE_AVATAR_UPDATE_THREADING); |
| 2558 | } | 2565 | } |
| 2559 | void Application::setRawAvatarUpdateThreading() { | 2566 | void Application::setRawAvatarUpdateThreading() { |
| 2560 | setRawAvatarUpdateThreading(Menu::getInstance()->isOptionChecked(MenuOption::EnableAvatarUpdateThreading)); | 2567 | setRawAvatarUpdateThreading(ENABLE_AVATAR_UPDATE_THREADING); |
| 2561 | } | 2568 | } |
| 2562 | void Application::setRawAvatarUpdateThreading(bool isThreaded) { | 2569 | void Application::setRawAvatarUpdateThreading(bool isThreaded) { |
| 2563 | if (_avatarUpdate) { | 2570 | if (_avatarUpdate) { |
| @@ -2575,17 +2582,11 @@ void Application::setAvatarUpdateThreading(bool isThreaded) { · 11 unmodified lines | |||
| 2575 | } | 2582 | } |
| 2576 | 2583 | ||
| 2577 | auto myAvatar = getMyAvatar(); | 2584 | auto myAvatar = getMyAvatar(); |
| 2578 | bool isRigEnabled = myAvatar->getEnableRigAnimations(); | ||
| 2579 | bool isGraphEnabled = myAvatar->getEnableAnimGraph(); | ||
| 2580 | if (_avatarUpdate) { | 2585 | if (_avatarUpdate) { |
| 2581 | _avatarUpdate->terminate(); // Must be before we shutdown anim graph. | 2586 | _avatarUpdate->terminate(); // Must be before we shutdown anim graph. |
| 2582 | } | 2587 | } |
| 2583 | myAvatar->setEnableRigAnimations(false); | ||
| 2584 | myAvatar->setEnableAnimGraph(false); | ||
| 2585 | _avatarUpdate = new AvatarUpdate(); | 2588 | _avatarUpdate = new AvatarUpdate(); |
| 2586 | _avatarUpdate->initialize(isThreaded); | 2589 | _avatarUpdate->initialize(isThreaded); |
| 2587 | myAvatar->setEnableRigAnimations(isRigEnabled); | ||
| 2588 | myAvatar->setEnableAnimGraph(isGraphEnabled); | ||
| 2589 | } | 2590 | } |
| 2590 | 2591 | ||
| 2591 | void Application::updateLOD() { | 2592 | void Application::updateLOD() { |
| @@ -2968,11 +2969,6 @@ void Application::update(float deltaTime) { · 376 unmodified lines | |||
| 2968 | loadViewFrustum(_myCamera, _viewFrustum); | 2969 | loadViewFrustum(_myCamera, _viewFrustum); |
| 2969 | } | 2970 | } |
| 2970 | 2971 | ||
| 2971 | // Update animation debug draw renderer | ||
| 2972 | { | ||
| 2973 | AnimDebugDraw::getInstance().update(); | ||
| 2974 | } | ||
| 2975 | |||
| 2976 | quint64 now = usecTimestampNow(); | 2972 | quint64 now = usecTimestampNow(); |
| 2977 | 2973 | ||
| 2978 | // Update my voxel servers with my current voxel query... | 2974 | // Update my voxel servers with my current voxel query... |
| @@ -3532,6 +3528,8 @@ void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool se · 553 unmodified lines | |||
| 3532 | myAvatar->preRender(renderArgs); | 3528 | myAvatar->preRender(renderArgs); |
| 3533 | myAvatar->endRender(); | 3529 | myAvatar->endRender(); |
| 3534 | 3530 | ||
| 3531 | // Update animation debug draw renderer | ||
| 3532 | AnimDebugDraw::getInstance().update(); | ||
| 3535 | 3533 | ||
| 3536 | activeRenderingThread = QThread::currentThread(); | 3534 | activeRenderingThread = QThread::currentThread(); |
| 3537 | PROFILE_RANGE(__FUNCTION__); | 3535 | PROFILE_RANGE(__FUNCTION__); |
| @@ -4363,10 +4361,6 @@ void Application::stopAllScripts(bool restart) { · 825 unmodified lines | |||
| 4363 | it.value()->stop(); | 4361 | it.value()->stop(); |
| 4364 | qCDebug(interfaceapp) << "stopping script..." << it.key(); | 4362 | qCDebug(interfaceapp) << "stopping script..." << it.key(); |
| 4365 | } | 4363 | } |
| 4366 | // HACK: ATM scripts cannot set/get their animation priorities, so we clear priorities | ||
| 4367 | // whenever a script stops in case it happened to have been setting joint rotations. | ||
| 4368 | // TODO: expose animation priorities and provide a layered animation control system. | ||
| 4369 | getMyAvatar()->clearJointAnimationPriorities(); | ||
| 4370 | getMyAvatar()->clearScriptableSettings(); | 4364 | getMyAvatar()->clearScriptableSettings(); |
| 4371 | } | 4365 | } |
| 4372 | 4366 | ||
| @@ -4382,10 +4376,6 @@ bool Application::stopScript(const QString& scriptHash, bool restart) { · 9 unmodified lines | |||
| 4382 | scriptEngine->stop(); | 4376 | scriptEngine->stop(); |
| 4383 | stoppedScript = true; | 4377 | stoppedScript = true; |
| 4384 | qCDebug(interfaceapp) << "stopping script..." << scriptHash; | 4378 | qCDebug(interfaceapp) << "stopping script..." << scriptHash; |
| 4385 | // HACK: ATM scripts cannot set/get their animation priorities, so we clear priorities | ||
| 4386 | // whenever a script stops in case it happened to have been setting joint rotations. | ||
| 4387 | // TODO: expose animation priorities and provide a layered animation control system. | ||
| 4388 | getMyAvatar()->clearJointAnimationPriorities(); | ||
| 4389 | } | 4379 | } |
| 4390 | if (_scriptEnginesHash.empty()) { | 4380 | if (_scriptEnginesHash.empty()) { |
| 4391 | getMyAvatar()->clearScriptableSettings(); | 4381 | getMyAvatar()->clearScriptableSettings(); |