History

merge from upstream

Seth Alves committed 10 years ago

Commit b7ebe5b2 parents 3402585 6f50d9172 files · +2573 −4128Browse files

Showing the changes to interface/src/Application.cpp (1 of 72 files). Show all

Unified · Split

interface/src/Application.cpp+11−21
@@ -50,6 +50,7 @@ · 49 unmodified lines
5050 #include <AssetClient.h>
5151 #include <AssetUpload.h>
5252 #include <AutoUpdater.h>
53+#include <AudioInjectorManager.h>
5354 #include <CursorManager.h>
5455 #include <DeferredLightingEffect.h>
5556 #include <display-plugins/DisplayPlugin.h>
@@ -343,6 +344,7 @@ bool setupEssentials(int& argc, char** argv) { · 287 unmodified lines
343344 DependencyManager::set<PathUtils>();
344345 DependencyManager::set<InterfaceActionFactory>();
345346 DependencyManager::set<AssetClient>();
347+ DependencyManager::set<AudioInjectorManager>();
346348 DependencyManager::set<MessagesClient>();
347349 DependencyManager::set<UserInputMapper>();
348350 DependencyManager::set<controller::ScriptingInterface, ControllerScriptingInterface>();
@@ -898,6 +900,10 @@ void Application::cleanupBeforeQuit() { · 549 unmodified lines
898900
899901 // destroy the AudioClient so it and its thread have a chance to go down safely
900902 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>();
901907
902908 // Destroy third party processes after scripts have finished using them.
903909 #ifdef HAVE_DDE
@@ -2553,11 +2559,12 @@ void Application::init() { · 1649 unmodified lines
25532559 setAvatarUpdateThreading();
25542560 }
25552561
2562+const bool ENABLE_AVATAR_UPDATE_THREADING = false;
25562563 void Application::setAvatarUpdateThreading() {
2557− setAvatarUpdateThreading(Menu::getInstance()->isOptionChecked(MenuOption::EnableAvatarUpdateThreading));
2564+ setAvatarUpdateThreading(ENABLE_AVATAR_UPDATE_THREADING);
25582565 }
25592566 void Application::setRawAvatarUpdateThreading() {
2560− setRawAvatarUpdateThreading(Menu::getInstance()->isOptionChecked(MenuOption::EnableAvatarUpdateThreading));
2567+ setRawAvatarUpdateThreading(ENABLE_AVATAR_UPDATE_THREADING);
25612568 }
25622569 void Application::setRawAvatarUpdateThreading(bool isThreaded) {
25632570 if (_avatarUpdate) {
@@ -2575,17 +2582,11 @@ void Application::setAvatarUpdateThreading(bool isThreaded) { · 11 unmodified lines
25752582 }
25762583
25772584 auto myAvatar = getMyAvatar();
2578− bool isRigEnabled = myAvatar->getEnableRigAnimations();
2579− bool isGraphEnabled = myAvatar->getEnableAnimGraph();
25802585 if (_avatarUpdate) {
25812586 _avatarUpdate->terminate(); // Must be before we shutdown anim graph.
25822587 }
2583− myAvatar->setEnableRigAnimations(false);
2584− myAvatar->setEnableAnimGraph(false);
25852588 _avatarUpdate = new AvatarUpdate();
25862589 _avatarUpdate->initialize(isThreaded);
2587− myAvatar->setEnableRigAnimations(isRigEnabled);
2588− myAvatar->setEnableAnimGraph(isGraphEnabled);
25892590 }
25902591
25912592 void Application::updateLOD() {
@@ -2968,11 +2969,6 @@ void Application::update(float deltaTime) { · 376 unmodified lines
29682969 loadViewFrustum(_myCamera, _viewFrustum);
29692970 }
29702971
2971− // Update animation debug draw renderer
2972− {
2973− AnimDebugDraw::getInstance().update();
2974− }
2975−
29762972 quint64 now = usecTimestampNow();
29772973
29782974 // 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
35323528 myAvatar->preRender(renderArgs);
35333529 myAvatar->endRender();
35343530
3531+ // Update animation debug draw renderer
3532+ AnimDebugDraw::getInstance().update();
35353533
35363534 activeRenderingThread = QThread::currentThread();
35373535 PROFILE_RANGE(__FUNCTION__);
@@ -4363,10 +4361,6 @@ void Application::stopAllScripts(bool restart) { · 825 unmodified lines
43634361 it.value()->stop();
43644362 qCDebug(interfaceapp) << "stopping script..." << it.key();
43654363 }
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();
43704364 getMyAvatar()->clearScriptableSettings();
43714365 }
43724366
@@ -4382,10 +4376,6 @@ bool Application::stopScript(const QString& scriptHash, bool restart) { · 9 unmodified lines
43824376 scriptEngine->stop();
43834377 stoppedScript = true;
43844378 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();
43894379 }
43904380 if (_scriptEnginesHash.empty()) {
43914381 getMyAvatar()->clearScriptableSettings();