History

Merge branch 'team-teaching' of https://github.com/highfidelity/hifi into punk

Sam Gateau committed 11 years ago

Commit eef80772 parents dd9cafc fe9c28546 files · +1447 −875Browse files

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

Unified · Split

interface/src/Application.cpp+14−10
@@ -2199,6 +2199,9 @@ void Application::init() { · 2198 unmodified lines
21992199 // initialize the GlowEffect with our widget
22002200 bool glow = Menu::getInstance()->isOptionChecked(MenuOption::EnableGlowEffect);
22012201 DependencyManager::get<GlowEffect>()->init(glow);
2202+
2203+ // Make sure any new sounds are loaded as soon as know about them.
2204+ connect(tree, &EntityTree::newCollisionSoundURL, DependencyManager::get<SoundCache>().data(), &SoundCache::getSound);
22022205 }
22032206
22042207 void Application::closeMirrorView() {
@@ -2502,19 +2505,20 @@ void Application::update(float deltaTime) { · 297 unmodified lines
25022505 _entitySimulation.unlock();
25032506
25042507 avatarManager->handleOutgoingChanges(_physicsEngine.getOutgoingChanges());
2505− avatarManager->handleCollisionEvents(_physicsEngine.getCollisionEvents());
2508+ auto collisionEvents = _physicsEngine.getCollisionEvents();
2509+ avatarManager->handleCollisionEvents(collisionEvents);
25062510
25072511 _physicsEngine.dumpStatsIfNecessary();
2508− }
2509− }
25102512
2511− if (!_aboutToQuit) {
2512− PerformanceTimer perfTimer("entities");
2513− // Collision events (and their scripts) must not be handled when we're locked, above. (That would risk deadlock.)
2514− _entitySimulation.handleCollisionEvents(_physicsEngine.getCollisionEvents());
2515− // NOTE: the _entities.update() call below will wait for lock
2516− // and will simulate entity motion (the EntityTree has been given an EntitySimulation).
2517− _entities.update(); // update the models...
2513+ if (!_aboutToQuit) {
2514+ PerformanceTimer perfTimer("entities");
2515+ // Collision events (and their scripts) must not be handled when we're locked, above. (That would risk deadlock.)
2516+ _entitySimulation.handleCollisionEvents(collisionEvents);
2517+ // NOTE: the _entities.update() call below will wait for lock
2518+ // and will simulate entity motion (the EntityTree has been given an EntitySimulation).
2519+ _entities.update(); // update the models...
2520+ }
2521+ }
25182522 }
25192523
25202524 {