History

Merge branch 'protocol' of https://github.com/birarda/hifi into protocol

Atlante45 committed 11 years ago

Commit bbb00b92 parents 81ad005 821c16c100 files · +2899 −1212Browse files

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

Unified · Split

interface/src/Application.cpp+15−14
@@ -394,6 +394,11 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 393 unmodified lines
394394 static_cast<NodeList*>(dependency)->deleteLater();
395395 });
396396
397+ // setup a timer for domain-server check ins
398+ QTimer* domainCheckInTimer = new QTimer(nodeList.data());
399+ connect(domainCheckInTimer, &QTimer::timeout, nodeList.data(), &NodeList::sendDomainServerCheckIn);
400+ domainCheckInTimer->start(DOMAIN_SERVER_CHECK_IN_MSECS);
401+
397402 // put the NodeList and datagram processing on the node thread
398403 nodeList->moveToThread(nodeThread);
399404
@@ -887,12 +892,6 @@ void Application::paintGL() { · 487 unmodified lines
887892
888893 {
889894 PerformanceTimer perfTimer("renderOverlay");
890− /*
891− gpu::Context context(new gpu::GLBackend());
892− RenderArgs renderArgs(&context, nullptr, getViewFrustum(), lodManager->getOctreeSizeScale(),
893− lodManager->getBoundaryLevelAdjust(), RenderArgs::DEFAULT_RENDER_MODE,
894− RenderArgs::MONO, RenderArgs::RENDER_DEBUG_NONE);
895− */
896895 _applicationOverlay.renderOverlay(&renderArgs);
897896 }
898897
@@ -968,6 +967,8 @@ void Application::paintGL() { · 69 unmodified lines
968967 } else if (TV3DManager::isConnected()) {
969968 TV3DManager::display(&renderArgs, _myCamera);
970969 } else {
970+ PROFILE_RANGE(__FUNCTION__ "/mainRender");
971+
971972 DependencyManager::get<GlowEffect>()->prepare(&renderArgs);
972973
973974 // Viewport is assigned to the size of the framebuffer
@@ -1002,6 +1003,7 @@ void Application::paintGL() { · 28 unmodified lines
10021003
10031004
10041005 if (!OculusManager::isConnected() || OculusManager::allowSwap()) {
1006+ PROFILE_RANGE(__FUNCTION__ "/bufferSwap");
10051007 _glWidget->swapBuffers();
10061008 }
10071009
@@ -1051,6 +1053,7 @@ void Application::resetCameras(Camera& camera, const glm::uvec2& size) { · 43 unmodified lines
10511053 }
10521054
10531055 void Application::resizeGL() {
1056+ PROFILE_RANGE(__FUNCTION__);
10541057 // Set the desired FBO texture size. If it hasn't changed, this does nothing.
10551058 // Otherwise, it must rebuild the FBOs
10561059 QSize renderSize;
@@ -1519,6 +1522,7 @@ void Application::focusOutEvent(QFocusEvent* event) { · 462 unmodified lines
15191522 }
15201523
15211524 void Application::mouseMoveEvent(QMouseEvent* event, unsigned int deviceID) {
1525+ PROFILE_RANGE(__FUNCTION__);
15221526 // Used by application overlay to determine how to draw cursor(s)
15231527 _lastMouseMoveWasSimulated = deviceID > 0;
15241528 if (!_lastMouseMoveWasSimulated) {
@@ -1785,9 +1789,6 @@ void Application::checkFPS() { · 260 unmodified lines
17851789 _frameCount = 0;
17861790 _datagramProcessor->resetCounters();
17871791 _timerStart.start();
1788−
1789− // ask the node list to check in with the domain server
1790− DependencyManager::get<NodeList>()->sendDomainServerCheckIn();
17911792 }
17921793
17931794 void Application::idle() {
@@ -1833,6 +1834,7 @@ void Application::idle() { · 39 unmodified lines
18331834 PerformanceTimer perfTimer("update");
18341835 PerformanceWarning warn(showWarnings, "Application::idle()... update()");
18351836 const float BIGGEST_DELTA_TIME_SECS = 0.25f;
1837+ PROFILE_RANGE(__FUNCTION__ "/idleUpdate");
18361838 update(glm::clamp((float)timeSinceLastUpdate / 1000.0f, 0.0f, BIGGEST_DELTA_TIME_SECS));
18371839 }
18381840 {
@@ -2934,6 +2936,7 @@ QRect Application::getDesirableApplicationGeometry() { · 1095 unmodified lines
29342936 // or the "myCamera".
29352937 //
29362938 void Application::loadViewFrustum(Camera& camera, ViewFrustum& viewFrustum) {
2939+ PROFILE_RANGE(__FUNCTION__);
29372940 // We will use these below, from either the camera or head vectors calculated above
29382941 viewFrustum.setProjection(camera.getProjection());
29392942
@@ -3438,9 +3441,8 @@ void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool se · 498 unmodified lines
34383441 // Assuming nothing get's rendered through that
34393442
34403443 if (!selfAvatarOnly) {
3441−
3442− // render models...
34433444 if (DependencyManager::get<SceneScriptingInterface>()->shouldRenderEntities()) {
3445+ // render models...
34443446 PerformanceTimer perfTimer("entities");
34453447 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
34463448 "Application::displaySide() ... entities...");
@@ -3448,11 +3450,11 @@ void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool se · 1 unmodified line
34483450 RenderArgs::DebugFlags renderDebugFlags = RenderArgs::RENDER_DEBUG_NONE;
34493451
34503452 if (Menu::getInstance()->isOptionChecked(MenuOption::PhysicsShowHulls)) {
3451− renderDebugFlags = (RenderArgs::DebugFlags) (renderDebugFlags | (int) RenderArgs::RENDER_DEBUG_HULLS);
3453+ renderDebugFlags = (RenderArgs::DebugFlags) (renderDebugFlags | (int)RenderArgs::RENDER_DEBUG_HULLS);
34523454 }
34533455 if (Menu::getInstance()->isOptionChecked(MenuOption::PhysicsShowOwned)) {
34543456 renderDebugFlags =
3455− (RenderArgs::DebugFlags) (renderDebugFlags | (int) RenderArgs::RENDER_DEBUG_SIMULATION_OWNERSHIP);
3457+ (RenderArgs::DebugFlags) (renderDebugFlags | (int)RenderArgs::RENDER_DEBUG_SIMULATION_OWNERSHIP);
34563458 }
34573459 renderArgs->_debugFlags = renderDebugFlags;
34583460 _entities.render(renderArgs);
@@ -4807,7 +4809,6 @@ mat4 Application::getEyeProjection(int eye) const { · 1348 unmodified lines
48074809 if (isHMDMode()) {
48084810 return OculusManager::getEyeProjection(eye);
48094811 }
4810−
48114812 return _viewFrustum.getProjection();
48124813 }
48134814