History

Merge branch 'master' of https://github.com/highfidelity/hifi into spectator-camera

Zach Fox committed 9 years ago

Commit 87fca162 parents c780e32 0a864a7273 files · +9604 −3903Browse files

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

Unified · Split

interface/src/Application.cpp+94−142
@@ -11,6 +11,9 @@ · 10 unmodified lines
1111
1212 #include "Application.h"
1313
14+#include <chrono>
15+#include <thread>
16+
1417 #include <gl/Config.h>
1518 #include <glm/glm.hpp>
1619 #include <glm/gtx/component_wise.hpp>
@@ -145,6 +148,7 @@ · 128 unmodified lines
145148 #include "InterfaceLogging.h"
146149 #include "LODManager.h"
147150 #include "ModelPackager.h"
151+#include "networking/CloseEventSender.h"
148152 #include "networking/HFWebEngineProfile.h"
149153 #include "networking/HFTabletWebEngineProfile.h"
150154 #include "networking/FileTypeProfile.h"
@@ -432,11 +436,15 @@ static const QString STATE_ADVANCED_MOVEMENT_CONTROLS = "AdvancedMovement"; · 281 unmodified lines
432436 static const QString STATE_GROUNDED = "Grounded";
433437 static const QString STATE_NAV_FOCUSED = "NavigationFocused";
434438
435−bool setupEssentials(int& argc, char** argv) {
439+bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) {
436440 const char** constArgv = const_cast<const char**>(argv);
437441 const char* portStr = getCmdOption(argc, constArgv, "--listenPort");
438442 const int listenPort = portStr ? atoi(portStr) : INVALID_PORT;
439443
444+ static const auto SUPPRESS_SETTINGS_RESET = "--suppress-settings-reset";
445+ bool suppressPrompt = cmdOptionExists(argc, const_cast<const char**>(argv), SUPPRESS_SETTINGS_RESET);
446+ bool previousSessionCrashed = CrashHandler::checkForResetSettings(runningMarkerExisted, suppressPrompt);
447+
440448 Setting::init();
441449
442450 if (auto steamClient = PluginManager::getInstance()->getSteamClientPlugin()) {
@@ -457,10 +465,6 @@ bool setupEssentials(int& argc, char** argv) { · 14 unmodified lines
457465 QCoreApplication::addLibraryPath(audioDLLPath);
458466 #endif
459467
460− static const auto SUPPRESS_SETTINGS_RESET = "--suppress-settings-reset";
461− bool suppressPrompt = cmdOptionExists(argc, const_cast<const char**>(argv), SUPPRESS_SETTINGS_RESET);
462− bool previousSessionCrashed = CrashHandler::checkForResetSettings(suppressPrompt);
463−
464468 DependencyManager::registerInheritance<LimitedNodeList, NodeList>();
465469 DependencyManager::registerInheritance<AvatarHashMap, AvatarManager>();
466470 DependencyManager::registerInheritance<EntityDynamicFactoryInterface, InterfaceDynamicFactory>();
@@ -535,6 +539,7 @@ bool setupEssentials(int& argc, char** argv) { · 68 unmodified lines
535539 DependencyManager::set<AvatarBookmarks>();
536540 DependencyManager::set<LocationBookmarks>();
537541 DependencyManager::set<Snapshot>();
542+ DependencyManager::set<CloseEventSender>();
538543
539544 return previousSessionCrashed;
540545 }
@@ -564,11 +569,11 @@ const bool DEFAULT_DESKTOP_TABLET_BECOMES_TOOLBAR = true; · 23 unmodified lines
564569 const bool DEFAULT_HMD_TABLET_BECOMES_TOOLBAR = false;
565570 const bool DEFAULT_PREFER_AVATAR_FINGER_OVER_STYLUS = false;
566571
567−Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) :
572+Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bool runningMarkerExisted) :
568573 QApplication(argc, argv),
569574 _window(new MainWindow(desktop())),
570575 _sessionRunTimer(startupTimer),
571− _previousSessionCrashed(setupEssentials(argc, argv)),
576+ _previousSessionCrashed(setupEssentials(argc, argv, runningMarkerExisted)),
572577 _undoStackScriptingInterface(&_undoStack),
573578 _entitySimulation(new PhysicalEntitySimulation()),
574579 _physicsEngine(new PhysicsEngine(Vectors::ZERO)),
@@ -1341,8 +1346,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 766 unmodified lines
13411346
13421347 auto glInfo = getGLContextData();
13431348 properties["gl_info"] = glInfo;
1344− properties["gpu_used_memory"] = (int)BYTES_TO_MB(gpu::Context::getUsedGPUMemory());
1345− properties["gpu_free_memory"] = (int)BYTES_TO_MB(gpu::Context::getFreeGPUMemory());
1349+ properties["gpu_used_memory"] = (int)BYTES_TO_MB(gpu::Context::getUsedGPUMemSize());
1350+ properties["gpu_free_memory"] = (int)BYTES_TO_MB(gpu::Context::getFreeGPUMemSize());
13461351 properties["gpu_frame_time"] = (float)(qApp->getGPUContext()->getFrameTimerGPUAverage());
13471352 properties["batch_frame_time"] = (float)(qApp->getGPUContext()->getFrameTimerBatchAverage());
13481353 properties["ideal_thread_count"] = QThread::idealThreadCount();
@@ -1460,6 +1465,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 111 unmodified lines
14601465 updateSystemTabletMode();
14611466
14621467 connect(&_myCamera, &Camera::modeUpdated, this, &Application::cameraModeChanged);
1468+
1469+ qCDebug(interfaceapp) << "Metaverse session ID is" << uuidStringWithoutCurlyBraces(accountManager->getSessionID());
14631470 }
14641471
14651472 void Application::domainConnectionRefused(const QString& reasonMessage, int reasonCodeInt, const QString& extraInfo) {
@@ -1569,6 +1576,14 @@ void Application::aboutToQuit() { · 103 unmodified lines
15691576
15701577 getActiveDisplayPlugin()->deactivate();
15711578
1579+ // use the CloseEventSender via a QThread to send an event that says the user asked for the app to close
1580+ auto closeEventSender = DependencyManager::get<CloseEventSender>();
1581+ QThread* closureEventThread = new QThread(this);
1582+ closeEventSender->moveToThread(closureEventThread);
1583+ // sendQuitEventAsync will bail immediately if the UserActivityLogger is not enabled
1584+ connect(closureEventThread, &QThread::started, closeEventSender.data(), &CloseEventSender::sendQuitEventAsync);
1585+ closureEventThread->start();
1586+
15721587 // Hide Running Scripts dialog so that it gets destroyed in an orderly manner; prevents warnings at shutdown.
15731588 DependencyManager::get<OffscreenUi>()->hide("RunningScripts");
15741589
@@ -1623,7 +1638,6 @@ void Application::cleanupBeforeQuit() { · 48 unmodified lines
16231638 // Clear any queued processing (I/O, FBX/OBJ/Texture parsing)
16241639 QThreadPool::globalInstance()->clear();
16251640
1626− DependencyManager::get<ScriptEngines>()->saveScripts();
16271641 DependencyManager::get<ScriptEngines>()->shutdownScripting(); // stop all currently running global scripts
16281642 DependencyManager::destroy<ScriptEngines>();
16291643
@@ -1683,6 +1697,10 @@ Application::~Application() { · 53 unmodified lines
16831697
16841698 _physicsEngine->setCharacterController(nullptr);
16851699
1700+ // the _shapeManager should have zero references
1701+ _shapeManager.collectGarbage();
1702+ assert(_shapeManager.getNumShapes() == 0);
1703+
16861704 // shutdown render engine
16871705 _main3DScene = nullptr;
16881706 _renderEngine = nullptr;
@@ -1734,6 +1752,15 @@ Application::~Application() { · 45 unmodified lines
17341752
17351753 _window->deleteLater();
17361754
1755+ // make sure that the quit event has finished sending before we take the application down
1756+ auto closeEventSender = DependencyManager::get<CloseEventSender>();
1757+ while (!closeEventSender->hasFinishedQuitEvent() && !closeEventSender->hasTimedOutQuitEvent()) {
1758+ // sleep a little so we're not spinning at 100%
1759+ std::this_thread::sleep_for(std::chrono::milliseconds(10));
1760+ }
1761+ // quit the thread used by the closure event sender
1762+ closeEventSender->thread()->quit();
1763+
17371764 // Can't log to file passed this point, FileLogger about to be deleted
17381765 qInstallMessageHandler(LogHandler::verboseMessageHandler);
17391766 }
@@ -2395,15 +2422,16 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { · 655 unmodified lines
23952422
23962423 // Check HMD use (may be technically available without being in use)
23972424 bool hasHMD = PluginUtils::isHMDAvailable();
2398− bool isUsingHMD = hasHMD && hasHandControllers && _displayPlugin->isHmd();
2425+ bool isUsingHMD = _displayPlugin->isHmd();
2426+ bool isUsingHMDAndHandControllers = hasHMD && hasHandControllers && isUsingHMD;
23992427
24002428 Setting::Handle<bool> tutorialComplete{ "tutorialComplete", false };
24012429 Setting::Handle<bool> firstRun{ Settings::firstRun, true };
24022430
24032431 bool isTutorialComplete = tutorialComplete.get();
2404− bool shouldGoToTutorial = isUsingHMD && hasTutorialContent && !isTutorialComplete;
2432+ bool shouldGoToTutorial = isUsingHMDAndHandControllers && hasTutorialContent && !isTutorialComplete;
24052433
2406− qCDebug(interfaceapp) << "HMD:" << hasHMD << ", Hand Controllers: " << hasHandControllers << ", Using HMD: " << isUsingHMD;
2434+ qCDebug(interfaceapp) << "HMD:" << hasHMD << ", Hand Controllers: " << hasHandControllers << ", Using HMD: " << isUsingHMDAndHandControllers;
24072435 qCDebug(interfaceapp) << "Tutorial version:" << contentVersion << ", sufficient:" << hasTutorialContent <<
24082436 ", complete:" << isTutorialComplete << ", should go:" << shouldGoToTutorial;
24092437
@@ -2417,10 +2445,18 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { · 7 unmodified lines
24172445
24182446 const QString TUTORIAL_PATH = "/tutorial_begin";
24192447
2448+ static const QString SENT_TO_TUTORIAL = "tutorial";
2449+ static const QString SENT_TO_PREVIOUS_LOCATION = "previous_location";
2450+ static const QString SENT_TO_ENTRY = "entry";
2451+ static const QString SENT_TO_SANDBOX = "sandbox";
2452+
2453+ QString sentTo;
2454+
24202455 if (shouldGoToTutorial) {
24212456 if (sandboxIsRunning) {
24222457 qCDebug(interfaceapp) << "Home sandbox appears to be running, going to Home.";
24232458 DependencyManager::get<AddressManager>()->goToLocalSandbox(TUTORIAL_PATH);
2459+ sentTo = SENT_TO_TUTORIAL;
24242460 } else {
24252461 qCDebug(interfaceapp) << "Home sandbox does not appear to be running, going to Entry.";
24262462 if (firstRun.get()) {
@@ -2428,8 +2464,10 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { · 1 unmodified line
24282464 }
24292465 if (addressLookupString.isEmpty()) {
24302466 DependencyManager::get<AddressManager>()->goToEntry();
2467+ sentTo = SENT_TO_ENTRY;
24312468 } else {
24322469 DependencyManager::get<AddressManager>()->loadSettings(addressLookupString);
2470+ sentTo = SENT_TO_PREVIOUS_LOCATION;
24332471 }
24342472 }
24352473 } else {
@@ -2442,23 +2480,40 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { · 6 unmodified lines
24422480
24432481 // If this is a first run we short-circuit the address passed in
24442482 if (isFirstRun) {
2445− if (isUsingHMD) {
2483+ if (isUsingHMDAndHandControllers) {
24462484 if (sandboxIsRunning) {
24472485 qCDebug(interfaceapp) << "Home sandbox appears to be running, going to Home.";
24482486 DependencyManager::get<AddressManager>()->goToLocalSandbox();
2487+ sentTo = SENT_TO_SANDBOX;
24492488 } else {
24502489 qCDebug(interfaceapp) << "Home sandbox does not appear to be running, going to Entry.";
24512490 DependencyManager::get<AddressManager>()->goToEntry();
2491+ sentTo = SENT_TO_ENTRY;
24522492 }
24532493 } else {
24542494 DependencyManager::get<AddressManager>()->goToEntry();
2495+ sentTo = SENT_TO_ENTRY;
24552496 }
24562497 } else {
24572498 qCDebug(interfaceapp) << "Not first run... going to" << qPrintable(addressLookupString.isEmpty() ? QString("previous location") : addressLookupString);
24582499 DependencyManager::get<AddressManager>()->loadSettings(addressLookupString);
2500+ sentTo = SENT_TO_PREVIOUS_LOCATION;
24592501 }
24602502 }
24612503
2504+ UserActivityLogger::getInstance().logAction("startup_sent_to", {
2505+ { "sent_to", sentTo },
2506+ { "sandbox_is_running", sandboxIsRunning },
2507+ { "has_hmd", hasHMD },
2508+ { "has_hand_controllers", hasHandControllers },
2509+ { "is_using_hmd", isUsingHMD },
2510+ { "is_using_hmd_and_hand_controllers", isUsingHMDAndHandControllers },
2511+ { "content_version", contentVersion },
2512+ { "is_tutorial_complete", isTutorialComplete },
2513+ { "has_tutorial_content", hasTutorialContent },
2514+ { "should_go_to_tutorial", shouldGoToTutorial }
2515+ });
2516+
24622517 _connectionMonitor.init();
24632518
24642519 // After all of the constructor is completed, then set firstRun to false.
@@ -2787,6 +2842,17 @@ void Application::keyPressEvent(QKeyEvent* event) { · 322 unmodified lines
27872842 if (isShifted && isMeta && !isOption) {
27882843 Menu::getInstance()->triggerOption(MenuOption::SuppressShortTimings);
27892844 } else if (!isOption && !isShifted && isMeta) {
2845+ AudioInjectorOptions options;
2846+ options.localOnly = true;
2847+ options.stereo = true;
2848+
2849+ if (_snapshotSoundInjector) {
2850+ _snapshotSoundInjector->setOptions(options);
2851+ _snapshotSoundInjector->restart();
2852+ } else {
2853+ QByteArray samples = _snapshotSound->getByteArray();
2854+ _snapshotSoundInjector = AudioInjector::playSound(samples, options);
2855+ }
27902856 takeSnapshot(true);
27912857 }
27922858 break;
@@ -3613,10 +3679,6 @@ void Application::idle(float nsecsElapsed) { · 820 unmodified lines
36133679 _overlayConductor.update(secondsSinceLastUpdate);
36143680 }
36153681
3616−void Application::setLowVelocityFilter(bool lowVelocityFilter) {
3617− controller::InputDevice::setLowVelocityFilter(lowVelocityFilter);
3618−}
3619−
36203682 ivec2 Application::getMouse() const {
36213683 return getApplicationCompositor().getReticlePosition();
36223684 }
@@ -3988,7 +4050,7 @@ void Application::updateMyAvatarLookAtPosition() { · 365 unmodified lines
39884050 if (faceAngle < MAXIMUM_FACE_ANGLE) {
39894051 // Randomly look back and forth between look targets
39904052 eyeContactTarget target = Menu::getInstance()->isOptionChecked(MenuOption::FixGaze) ?
3991− LEFT_EYE : myAvatar->getEyeContactTarget();
4053+ LEFT_EYE : myAvatar->getEyeContactTarget();
39924054 switch (target) {
39934055 case LEFT_EYE:
39944056 lookAtSpot = lookingAtHead->getLeftEyePosition();
@@ -4380,7 +4442,11 @@ void Application::update(float deltaTime) { · 385 unmodified lines
43804442 myAvatar->getSpine2CalibrationMat(),
43814443 myAvatar->getHipsCalibrationMat(),
43824444 myAvatar->getLeftFootCalibrationMat(),
4383− myAvatar->getRightFootCalibrationMat()
4445+ myAvatar->getRightFootCalibrationMat(),
4446+ myAvatar->getRightArmCalibrationMat(),
4447+ myAvatar->getLeftArmCalibrationMat(),
4448+ myAvatar->getRightHandCalibrationMat(),
4449+ myAvatar->getLeftHandCalibrationMat()
43844450 };
43854451
43864452 InputPluginPointer keyboardMousePlugin;
@@ -4392,6 +4458,7 @@ void Application::update(float deltaTime) { · 5 unmodified lines
43924458 }
43934459 }
43944460
4461+ userInputMapper->setInputCalibrationData(calibrationData);
43954462 userInputMapper->update(deltaTime);
43964463
43974464 if (keyboardMousePlugin && keyboardMousePlugin->isActive()) {
@@ -4435,6 +4502,10 @@ void Application::update(float deltaTime) { · 37 unmodified lines
44354502 controller::Pose headPose = userInputMapper->getPoseState(controller::Action::HEAD);
44364503 myAvatar->setHeadControllerPoseInSensorFrame(headPose.transform(avatarToSensorMatrix));
44374504
4505+ controller::Pose leftArmPose = userInputMapper->getPoseState(controller::Action::LEFT_ARM);
4506+ controller::Pose rightArmPose = userInputMapper->getPoseState(controller::Action::RIGHT_ARM);
4507+ myAvatar->setArmControllerPosesInSensorFrame(leftArmPose.transform(avatarToSensorMatrix), rightArmPose.transform(avatarToSensorMatrix));
4508+
44384509 updateThreads(deltaTime); // If running non-threaded, then give the threads some time to process...
44394510 updateDialogs(deltaTime); // update various stats dialogs if present
44404511
@@ -4496,12 +4567,13 @@ void Application::update(float deltaTime) { · 55 unmodified lines
44964567
44974568 getEntities()->getTree()->withWriteLock([&] {
44984569 PerformanceTimer perfTimer("handleOutgoingChanges");
4499− const VectorOfMotionStates& deactivations = _physicsEngine->getDeactivatedMotionStates();
4500− _entitySimulation->handleDeactivatedMotionStates(deactivations);
45014570
45024571 const VectorOfMotionStates& outgoingChanges = _physicsEngine->getChangedMotionStates();
45034572 _entitySimulation->handleChangedMotionStates(outgoingChanges);
45044573 avatarManager->handleChangedMotionStates(outgoingChanges);
4574+
4575+ const VectorOfMotionStates& deactivations = _physicsEngine->getDeactivatedMotionStates();
4576+ _entitySimulation->handleDeactivatedMotionStates(deactivations);
45054577 });
45064578
45074579 if (!_aboutToQuit) {
@@ -4889,12 +4961,6 @@ QRect Application::getDesirableApplicationGeometry() const { · 381 unmodified lines
48894961 return applicationGeometry;
48904962 }
48914963
4892−glm::vec3 Application::getSunDirection() const {
4893− // Sun direction is in fact just the location of the sun relative to the origin
4894− auto skyStage = DependencyManager::get<SceneScriptingInterface>()->getSkyStage();
4895− return skyStage->getSunLight()->getDirection();
4896−}
4897−
48984964 // FIXME, preprocessor guard this check to occur only in DEBUG builds
48994965 static QThread * activeRenderingThread = nullptr;
49004966
@@ -4961,90 +5027,6 @@ namespace render { · 60 unmodified lines
49615027 }
49625028 }
49635029
4964−// Background Render Data & rendering functions
4965−class BackgroundRenderData {
4966−public:
4967− typedef render::Payload<BackgroundRenderData> Payload;
4968− typedef Payload::DataPointer Pointer;
4969−
4970− static render::ItemID _item; // unique WorldBoxRenderData
4971−};
4972−
4973−render::ItemID BackgroundRenderData::_item = 0;
4974−
4975−namespace render {
4976− template <> const ItemKey payloadGetKey(const BackgroundRenderData::Pointer& stuff) {
4977− return ItemKey::Builder::background();
4978− }
4979−
4980− template <> const Item::Bound payloadGetBound(const BackgroundRenderData::Pointer& stuff) {
4981− return Item::Bound();
4982− }
4983−
4984− template <> void payloadRender(const BackgroundRenderData::Pointer& background, RenderArgs* args) {
4985− Q_ASSERT(args->_batch);
4986− gpu::Batch& batch = *args->_batch;
4987−
4988− // Background rendering decision
4989− auto skyStage = DependencyManager::get<SceneScriptingInterface>()->getSkyStage();
4990− auto backgroundMode = skyStage->getBackgroundMode();
4991−
4992− switch (backgroundMode) {
4993− case model::SunSkyStage::SKY_DEFAULT: {
4994− auto scene = DependencyManager::get<SceneScriptingInterface>()->getStage();
4995− auto sceneKeyLight = scene->getKeyLight();
4996−
4997− scene->setSunModelEnable(false);
4998− sceneKeyLight->setColor(ColorUtils::toVec3(KeyLightPropertyGroup::DEFAULT_KEYLIGHT_COLOR));
4999− sceneKeyLight->setIntensity(KeyLightPropertyGroup::DEFAULT_KEYLIGHT_INTENSITY);
5000− sceneKeyLight->setAmbientIntensity(KeyLightPropertyGroup::DEFAULT_KEYLIGHT_AMBIENT_INTENSITY);
5001− sceneKeyLight->setDirection(KeyLightPropertyGroup::DEFAULT_KEYLIGHT_DIRECTION);
5002− // fall through: render a skybox (if available), or the defaults (if requested)
5003− }
5004−
5005− case model::SunSkyStage::SKY_BOX: {
5006− auto skybox = skyStage->getSkybox();
5007− if (!skybox->empty()) {
5008− PerformanceTimer perfTimer("skybox");
5009− skybox->render(batch, args->getViewFrustum());
5010− break;
5011− }
5012− // fall through: render defaults (if requested)
5013− }
5014−
5015− case model::SunSkyStage::SKY_DEFAULT_AMBIENT_TEXTURE: {
5016− if (Menu::getInstance()->isOptionChecked(MenuOption::DefaultSkybox)) {
5017− auto scene = DependencyManager::get<SceneScriptingInterface>()->getStage();
5018− auto sceneKeyLight = scene->getKeyLight();
5019− auto defaultSkyboxAmbientTexture = qApp->getDefaultSkyboxAmbientTexture();
5020− if (defaultSkyboxAmbientTexture) {
5021− sceneKeyLight->setAmbientSphere(defaultSkyboxAmbientTexture->getIrradiance());
5022− sceneKeyLight->setAmbientMap(defaultSkyboxAmbientTexture);
5023− } else {
5024− static QString repeatedMessage = LogHandler::getInstance().addRepeatedMessageRegex(
5025− "Failed to get a valid Default Skybox Ambient Texture ? probably because it couldn't be find during initialization step");
5026− }
5027− // fall through: render defaults skybox
5028− } else {
5029− break;
5030− }
5031− }
5032−
5033− case model::SunSkyStage::SKY_DEFAULT_TEXTURE:
5034− if (Menu::getInstance()->isOptionChecked(MenuOption::DefaultSkybox)) {
5035− qApp->getDefaultSkybox()->render(batch, args->getViewFrustum());
5036− }
5037− break;
5038−
5039− // Any other cases require no extra rendering
5040− case model::SunSkyStage::NO_BACKGROUND:
5041− default:
5042− break;
5043− }
5044− }
5045−}
5046−
5047−
50485030 void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool selfAvatarOnly) {
50495031
50505032 // FIXME: This preDisplayRender call is temporary until we create a separate render::scene for the mirror rendering.
@@ -5068,15 +5050,6 @@ void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool se · 17 unmodified lines
50685050 // The pending changes collecting the changes here
50695051 render::Transaction transaction;
50705052
5071− // FIXME: Move this out of here!, Background / skybox should be driven by the enityt content just like the other entities
5072− // Background rendering decision
5073− if (!render::Item::isValidID(BackgroundRenderData::_item)) {
5074− auto backgroundRenderData = make_shared<BackgroundRenderData>();
5075− auto backgroundRenderPayload = make_shared<BackgroundRenderData::Payload>(backgroundRenderData);
5076− BackgroundRenderData::_item = _main3DScene->allocateID();
5077− transaction.resetItem(BackgroundRenderData::_item, backgroundRenderPayload);
5078− }
5079−
50805053 // Assuming nothing gets rendered through that
50815054 if (!selfAvatarOnly) {
50825055 if (DependencyManager::get<SceneScriptingInterface>()->shouldRenderEntities()) {
@@ -5112,12 +5085,6 @@ void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool se · 29 unmodified lines
51125085 });
51135086 }
51145087
5115− // Setup the current Zone Entity lighting
5116− {
5117− auto stage = DependencyManager::get<SceneScriptingInterface>()->getSkyStage();
5118− DependencyManager::get<DeferredLightingEffect>()->setGlobalLight(stage->getSunLight());
5119− }
5120−
51215088 {
51225089 PerformanceTimer perfTimer("SceneProcessTransaction");
51235090 _main3DScene->enqueueTransaction(transaction);
@@ -6418,21 +6385,6 @@ void Application::loadAddAvatarBookmarkDialog() const { · 1294 unmodified lines
64186385 }
64196386
64206387 void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRatio) {
6421−
6422− //keep sound thread out of event loop scope
6423−
6424− AudioInjectorOptions options;
6425− options.localOnly = true;
6426− options.stereo = true;
6427−
6428− if (_snapshotSoundInjector) {
6429− _snapshotSoundInjector->setOptions(options);
6430− _snapshotSoundInjector->restart();
6431− } else {
6432− QByteArray samples = _snapshotSound->getByteArray();
6433− _snapshotSoundInjector = AudioInjector::playSound(samples, options);
6434− }
6435−
64366388 postLambdaEvent([notify, includeAnimated, aspectRatio, this] {
64376389 // Get a screenshot and save it
64386390 QString path = Snapshot::saveSnapshot(getActiveDisplayPlugin()->getScreenshot(aspectRatio));