Showing the changes to interface/src/Application.cpp (1 of 78 files). Show all
Unified · Split
| @@ -64,6 +64,7 @@ · 63 unmodified lines | ||
| 64 | 64 | #include <HFBackEvent.h> |
| 65 | 65 | #include <LocalVoxelsList.h> |
| 66 | 66 | #include <LogHandler.h> |
| 67 | +#include <MainWindow.h> | |
| 67 | 68 | #include <NetworkAccessManager.h> |
| 68 | 69 | #include <OctalCode.h> |
| 69 | 70 | #include <OctreeSceneStats.h> |
| @@ -73,6 +74,7 @@ · 3 unmodified lines | ||
| 73 | 74 | #include <ProgramObject.h> |
| 74 | 75 | #include <ResourceCache.h> |
| 75 | 76 | #include <SoundCache.h> |
| 77 | +#include <TextRenderer.h> | |
| 76 | 78 | #include <UserActivityLogger.h> |
| 77 | 79 | #include <UUID.h> |
| 78 | 80 | |
| @@ -109,7 +111,6 @@ · 30 unmodified lines | ||
| 109 | 111 | #include "ui/InfoView.h" |
| 110 | 112 | #include "ui/Snapshot.h" |
| 111 | 113 | #include "ui/Stats.h" |
| 112 | −#include "ui/TextRenderer.h" | |
| 113 | 114 | |
| 114 | 115 | |
| 115 | 116 | |
| @@ -142,7 +143,6 @@ void messageHandler(QtMsgType type, const QMessageLogContext& context, const QSt · 26 unmodified lines | ||
| 142 | 143 | Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : |
| 143 | 144 | QApplication(argc, argv), |
| 144 | 145 | _window(new MainWindow(desktop())), |
| 145 | − _glWidget(new GLCanvas()), | |
| 146 | 146 | _toolWindow(NULL), |
| 147 | 147 | _nodeThread(new QThread(this)), |
| 148 | 148 | _datagramProcessor(), |
| @@ -155,9 +155,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 6 unmodified lines | ||
| 155 | 155 | _voxelImporter(), |
| 156 | 156 | _importSucceded(false), |
| 157 | 157 | _sharedVoxelSystem(TREE_SCALE, DEFAULT_MAX_VOXELS_PER_SYSTEM, &_clipboard), |
| 158 | − _entities(true), | |
| 158 | + _entities(true, this, this), | |
| 159 | 159 | _entityCollisionSystem(), |
| 160 | − _entityClipboardRenderer(false), | |
| 160 | + _entityClipboardRenderer(false, this, this), | |
| 161 | 161 | _entityClipboard(), |
| 162 | 162 | _wantToKillLocalVoxels(false), |
| 163 | 163 | _viewFrustum(), |
| @@ -191,8 +191,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 27 unmodified lines | ||
| 191 | 191 | _isVSyncOn(true), |
| 192 | 192 | _aboutToQuit(false) |
| 193 | 193 | { |
| 194 | − Model::setViewStateInterface(this); // The model class will sometimes need to know view state details from us | |
| 195 | − | |
| 194 | + GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>(); | |
| 195 | + Model::setAbstractViewStateInterface(this); // The model class will sometimes need to know view state details from us | |
| 196 | + | |
| 196 | 197 | // read the ApplicationInfo.ini file for Name/Version/Domain information |
| 197 | 198 | QSettings applicationInfo(PathUtils::resourcesPath() + "info/ApplicationInfo.ini", QSettings::IniFormat); |
| 198 | 199 | |
| @@ -362,16 +363,16 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 163 unmodified lines | ||
| 362 | 363 | |
| 363 | 364 | ResourceCache::setRequestLimit(3); |
| 364 | 365 | |
| 365 | − _window->setCentralWidget(_glWidget); | |
| 366 | + _window->setCentralWidget(glCanvas.data()); | |
| 366 | 367 | |
| 367 | 368 | restoreSizeAndPosition(); |
| 368 | 369 | |
| 369 | 370 | _window->setVisible(true); |
| 370 | − _glWidget->setFocusPolicy(Qt::StrongFocus); | |
| 371 | − _glWidget->setFocus(); | |
| 371 | + glCanvas->setFocusPolicy(Qt::StrongFocus); | |
| 372 | + glCanvas->setFocus(); | |
| 372 | 373 | |
| 373 | 374 | // enable mouse tracking; otherwise, we only get drag events |
| 374 | − _glWidget->setMouseTracking(true); | |
| 375 | + glCanvas->setMouseTracking(true); | |
| 375 | 376 | |
| 376 | 377 | _toolWindow = new ToolWindow(); |
| 377 | 378 | _toolWindow->setWindowFlags(_toolWindow->windowFlags() | Qt::WindowStaysOnTopHint); |
| @@ -390,7 +391,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 12 unmodified lines | ||
| 390 | 391 | |
| 391 | 392 | checkVersion(); |
| 392 | 393 | |
| 393 | − _overlays.init(_glWidget); // do this before scripts load | |
| 394 | + _overlays.init(glCanvas.data()); // do this before scripts load | |
| 394 | 395 | |
| 395 | 396 | LocalVoxelsList::getInstance()->addPersistantTree(DOMAIN_TREE_NAME, _voxels.getTree()); |
| 396 | 397 | LocalVoxelsList::getInstance()->addPersistantTree(CLIPBOARD_TREE_NAME, &_clipboard); |
| @@ -439,6 +440,7 @@ void Application::aboutToQuit() { · 42 unmodified lines | ||
| 439 | 440 | } |
| 440 | 441 | |
| 441 | 442 | Application::~Application() { |
| 443 | + | |
| 442 | 444 | _entities.getTree()->setSimulation(NULL); |
| 443 | 445 | qInstallMessageHandler(NULL); |
| 444 | 446 | |
| @@ -480,8 +482,6 @@ Application::~Application() { · 35 unmodified lines | ||
| 480 | 482 | Menu::getInstance()->deleteLater(); |
| 481 | 483 | |
| 482 | 484 | _myAvatar = NULL; |
| 483 | − | |
| 484 | − delete _glWidget; | |
| 485 | 485 | } |
| 486 | 486 | |
| 487 | 487 | void Application::saveSettings() { |
| @@ -621,7 +621,7 @@ void Application::paintGL() { · 133 unmodified lines | ||
| 621 | 621 | if (OculusManager::isConnected()) { |
| 622 | 622 | DependencyManager::get<TextureCache>()->setFrameBufferSize(OculusManager::getRenderTargetSize()); |
| 623 | 623 | } else { |
| 624 | − QSize fbSize = _glWidget->getDeviceSize() * getRenderResolutionScale(); | |
| 624 | + QSize fbSize = DependencyManager::get<GLCanvas>()->getDeviceSize() * getRenderResolutionScale(); | |
| 625 | 625 | DependencyManager::get<TextureCache>()->setFrameBufferSize(fbSize); |
| 626 | 626 | } |
| 627 | 627 | |
| @@ -1045,7 +1045,8 @@ void Application::keyPressEvent(QKeyEvent* event) { · 417 unmodified lines | ||
| 1045 | 1045 | if (isShifted) { |
| 1046 | 1046 | _viewFrustum.setFocalLength(_viewFrustum.getFocalLength() - 0.1f); |
| 1047 | 1047 | if (TV3DManager::isConnected()) { |
| 1048 | − TV3DManager::configureCamera(_myCamera, _glWidget->getDeviceWidth(), _glWidget->getDeviceHeight()); | |
| 1048 | + GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>(); | |
| 1049 | + TV3DManager::configureCamera(_myCamera, glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight()); | |
| 1049 | 1050 | } |
| 1050 | 1051 | } else { |
| 1051 | 1052 | _myCamera.setEyeOffsetPosition(_myCamera.getEyeOffsetPosition() + glm::vec3(-0.001, 0, 0)); |
| @@ -1057,7 +1058,8 @@ void Application::keyPressEvent(QKeyEvent* event) { · 5 unmodified lines | ||
| 1057 | 1058 | if (isShifted) { |
| 1058 | 1059 | _viewFrustum.setFocalLength(_viewFrustum.getFocalLength() + 0.1f); |
| 1059 | 1060 | if (TV3DManager::isConnected()) { |
| 1060 | − TV3DManager::configureCamera(_myCamera, _glWidget->getDeviceWidth(), _glWidget->getDeviceHeight()); | |
| 1061 | + GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>(); | |
| 1062 | + TV3DManager::configureCamera(_myCamera, glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight()); | |
| 1061 | 1063 | } |
| 1062 | 1064 | |
| 1063 | 1065 | } else { |
| @@ -1503,7 +1505,7 @@ void Application::idle() { · 439 unmodified lines | ||
| 1503 | 1505 | { |
| 1504 | 1506 | PerformanceTimer perfTimer("updateGL"); |
| 1505 | 1507 | PerformanceWarning warn(showWarnings, "Application::idle()... updateGL()"); |
| 1506 | − _glWidget->updateGL(); | |
| 1508 | + DependencyManager::get<GLCanvas>()->updateGL(); | |
| 1507 | 1509 | } |
| 1508 | 1510 | { |
| 1509 | 1511 | PerformanceTimer perfTimer("rest"); |
| @@ -1529,13 +1531,14 @@ void Application::idle() { · 19 unmodified lines | ||
| 1529 | 1531 | |
| 1530 | 1532 | void Application::checkBandwidthMeterClick() { |
| 1531 | 1533 | // ... to be called upon button release |
| 1534 | + GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>(); | |
| 1532 | 1535 | if (Menu::getInstance()->isOptionChecked(MenuOption::Bandwidth) && |
| 1533 | 1536 | Menu::getInstance()->isOptionChecked(MenuOption::Stats) && |
| 1534 | 1537 | Menu::getInstance()->isOptionChecked(MenuOption::UserInterface) && |
| 1535 | 1538 | glm::compMax(glm::abs(glm::ivec2(getMouseX() - getMouseDragStartedX(), |
| 1536 | 1539 | getMouseY() - getMouseDragStartedY()))) |
| 1537 | 1540 | <= BANDWIDTH_METER_CLICK_MAX_DRAG_LENGTH |
| 1538 | − && _bandwidthMeter.isWithinArea(getMouseX(), getMouseY(), _glWidget->width(), _glWidget->height())) { | |
| 1541 | + && _bandwidthMeter.isWithinArea(getMouseX(), getMouseY(), glCanvas->width(), glCanvas->height())) { | |
| 1539 | 1542 | |
| 1540 | 1543 | // The bandwidth meter is visible, the click didn't get dragged too far and |
| 1541 | 1544 | // we actually hit the bandwidth meter |
| @@ -1564,7 +1567,8 @@ void Application::setFullscreen(bool fullscreen) { · 22 unmodified lines | ||
| 1564 | 1567 | } |
| 1565 | 1568 | |
| 1566 | 1569 | void Application::setEnable3DTVMode(bool enable3DTVMode) { |
| 1567 | − resizeGL(_glWidget->getDeviceWidth(),_glWidget->getDeviceHeight()); | |
| 1570 | + GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>(); | |
| 1571 | + resizeGL(glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight()); | |
| 1568 | 1572 | } |
| 1569 | 1573 | |
| 1570 | 1574 | void Application::setEnableVRMode(bool enableVRMode) { |
| @@ -1589,7 +1593,8 @@ void Application::setEnableVRMode(bool enableVRMode) { · 18 unmodified lines | ||
| 1589 | 1593 | _myCamera.setHmdRotation(glm::quat()); |
| 1590 | 1594 | } |
| 1591 | 1595 | |
| 1592 | − resizeGL(_glWidget->getDeviceWidth(), _glWidget->getDeviceHeight()); | |
| 1596 | + GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>(); | |
| 1597 | + resizeGL(glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight()); | |
| 1593 | 1598 | } |
| 1594 | 1599 | |
| 1595 | 1600 | void Application::setRenderVoxels(bool voxelRender) { |
| @@ -1651,8 +1656,9 @@ glm::vec3 Application::getMouseVoxelWorldCoordinates(const VoxelDetail& mouseVox · 55 unmodified lines | ||
| 1651 | 1656 | |
| 1652 | 1657 | bool Application::mouseOnScreen() const { |
| 1653 | 1658 | if (OculusManager::isConnected()) { |
| 1654 | − return getMouseX() >= 0 && getMouseX() <= _glWidget->getDeviceWidth() && | |
| 1655 | − getMouseY() >= 0 && getMouseY() <= _glWidget->getDeviceHeight(); | |
| 1659 | + GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>(); | |
| 1660 | + return getMouseX() >= 0 && getMouseX() <= glCanvas->getDeviceWidth() && | |
| 1661 | + getMouseY() >= 0 && getMouseY() <= glCanvas->getDeviceHeight(); | |
| 1656 | 1662 | } |
| 1657 | 1663 | return true; |
| 1658 | 1664 | } |
| @@ -1692,13 +1698,13 @@ int Application::getMouseDragStartedY() const { · 33 unmodified lines | ||
| 1692 | 1698 | } |
| 1693 | 1699 | |
| 1694 | 1700 | FaceTracker* Application::getActiveFaceTracker() { |
| 1695 | − Faceshift* faceshift = DependencyManager::get<Faceshift>(); | |
| 1696 | − Visage* visage = DependencyManager::get<Visage>(); | |
| 1697 | − DdeFaceTracker* dde = DependencyManager::get<DdeFaceTracker>(); | |
| 1701 | + Faceshift::SharedPointer faceshift = DependencyManager::get<Faceshift>(); | |
| 1702 | + Visage::SharedPointer visage = DependencyManager::get<Visage>(); | |
| 1703 | + DdeFaceTracker::SharedPointer dde = DependencyManager::get<DdeFaceTracker>(); | |
| 1698 | 1704 | |
| 1699 | − return (dde->isActive() ? static_cast<FaceTracker*>(dde) : | |
| 1700 | − (faceshift->isActive() ? static_cast<FaceTracker*>(faceshift) : | |
| 1701 | − (visage->isActive() ? static_cast<FaceTracker*>(visage) : NULL))); | |
| 1705 | + return (dde->isActive() ? static_cast<FaceTracker*>(dde.data()) : | |
| 1706 | + (faceshift->isActive() ? static_cast<FaceTracker*>(faceshift.data()) : | |
| 1707 | + (visage->isActive() ? static_cast<FaceTracker*>(visage.data()) : NULL))); | |
| 1702 | 1708 | } |
| 1703 | 1709 | |
| 1704 | 1710 | struct SendVoxelsOperationArgs { |
| @@ -1771,7 +1777,8 @@ void Application::exportVoxels(const VoxelDetail& sourceVoxel) { · 66 unmodified lines | ||
| 1771 | 1777 | QString desktopLocation = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation); |
| 1772 | 1778 | QString suggestedName = desktopLocation.append("/voxels.svo"); |
| 1773 | 1779 | |
| 1774 | − QString fileNameString = QFileDialog::getSaveFileName(_glWidget, tr("Export Voxels"), suggestedName, | |
| 1780 | + QString fileNameString = QFileDialog::getSaveFileName(DependencyManager::get<GLCanvas>().data(), | |
| 1781 | + tr("Export Voxels"), suggestedName, | |
| 1775 | 1782 | tr("Sparse Voxel Octree Files (*.svo)")); |
| 1776 | 1783 | QByteArray fileNameAscii = fileNameString.toLocal8Bit(); |
| 1777 | 1784 | const char* fileName = fileNameAscii.data(); |
| @@ -2025,9 +2032,9 @@ void Application::init() { · 247 unmodified lines | ||
| 2025 | 2032 | |
| 2026 | 2033 | _metavoxels.init(); |
| 2027 | 2034 | |
| 2028 | − _audio.init(_glWidget); | |
| 2029 | − | |
| 2030 | − _rearMirrorTools = new RearMirrorTools(_glWidget, _mirrorViewRect, _settings); | |
| 2035 | + GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>(); | |
| 2036 | + _audio.init(glCanvas.data()); | |
| 2037 | + _rearMirrorTools = new RearMirrorTools(glCanvas.data(), _mirrorViewRect, _settings); | |
| 2031 | 2038 | |
| 2032 | 2039 | connect(_rearMirrorTools, SIGNAL(closeView()), SLOT(closeMirrorView())); |
| 2033 | 2040 | connect(_rearMirrorTools, SIGNAL(restoreView()), SLOT(restoreMirrorView())); |
| @@ -2040,11 +2047,12 @@ void Application::init() { · 6 unmodified lines | ||
| 2040 | 2047 | // save settings when avatar changes |
| 2041 | 2048 | connect(_myAvatar, &MyAvatar::transformChanged, this, &Application::bumpSettings); |
| 2042 | 2049 | |
| 2043 | − // make sure our texture cache knows about window size changes | |
| 2044 | − DependencyManager::get<TextureCache>()->associateWithWidget(getGLWidget()); | |
| 2050 | + // make sure our texture cache knows about window size changes | |
| 2051 | + DependencyManager::get<TextureCache>()->associateWithWidget(glCanvas.data()); | |
| 2045 | 2052 | |
| 2046 | 2053 | // initialize the GlowEffect with our widget |
| 2047 | − DependencyManager::get<GlowEffect>()->init(getGLWidget(), Menu::getInstance()->isOptionChecked(MenuOption::EnableGlowEffect)); | |
| 2054 | + DependencyManager::get<GlowEffect>()->init(glCanvas.data(), | |
| 2055 | + Menu::getInstance()->isOptionChecked(MenuOption::EnableGlowEffect)); | |
| 2048 | 2056 | } |
| 2049 | 2057 | |
| 2050 | 2058 | void Application::closeMirrorView() { |
| @@ -2112,7 +2120,7 @@ void Application::updateMouseRay() { · 61 unmodified lines | ||
| 2112 | 2120 | void Application::updateFaceshift() { |
| 2113 | 2121 | bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings); |
| 2114 | 2122 | PerformanceWarning warn(showWarnings, "Application::updateFaceshift()"); |
| 2115 | − Faceshift* faceshift = DependencyManager::get<Faceshift>(); | |
| 2123 | + Faceshift::SharedPointer faceshift = DependencyManager::get<Faceshift>(); | |
| 2116 | 2124 | // Update faceshift |
| 2117 | 2125 | faceshift->update(); |
| 2118 | 2126 | |
| @@ -2916,8 +2924,9 @@ void Application::updateShadowMap() { · 797 unmodified lines | ||
| 2916 | 2924 | } |
| 2917 | 2925 | |
| 2918 | 2926 | fbo->release(); |
| 2919 | − | |
| 2920 | − glViewport(0, 0, _glWidget->getDeviceWidth(), _glWidget->getDeviceHeight()); | |
| 2927 | + | |
| 2928 | + GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>(); | |
| 2929 | + glViewport(0, 0, glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight()); | |
| 2921 | 2930 | } |
| 2922 | 2931 | |
| 2923 | 2932 | const GLfloat WORLD_AMBIENT_COLOR[] = { 0.525f, 0.525f, 0.6f }; |
| @@ -2944,6 +2953,18 @@ bool Application::shouldRenderMesh(float largestDimension, float distanceToCamer · 20 unmodified lines | ||
| 2944 | 2953 | return Menu::getInstance()->shouldRenderMesh(largestDimension, distanceToCamera); |
| 2945 | 2954 | } |
| 2946 | 2955 | |
| 2956 | +float Application::getSizeScale() const { | |
| 2957 | + return Menu::getInstance()->getVoxelSizeScale(); | |
| 2958 | +} | |
| 2959 | + | |
| 2960 | +int Application::getBoundaryLevelAdjust() const { | |
| 2961 | + return Menu::getInstance()->getBoundaryLevelAdjust(); | |
| 2962 | +} | |
| 2963 | + | |
| 2964 | +PickRay Application::computePickRay(float x, float y) { | |
| 2965 | + return getCamera()->computePickRay(x, y); | |
| 2966 | +} | |
| 2967 | + | |
| 2947 | 2968 | QImage Application::renderAvatarBillboard() { |
| 2948 | 2969 | DependencyManager::get<TextureCache>()->getPrimaryFramebufferObject()->bind(); |
| 2949 | 2970 | |
| @@ -2951,7 +2972,9 @@ QImage Application::renderAvatarBillboard() { · 1 unmodified line | ||
| 2951 | 2972 | Glower glower; |
| 2952 | 2973 | |
| 2953 | 2974 | const int BILLBOARD_SIZE = 64; |
| 2954 | − renderRearViewMirror(QRect(0, _glWidget->getDeviceHeight() - BILLBOARD_SIZE, BILLBOARD_SIZE, BILLBOARD_SIZE), true); | |
| 2975 | + renderRearViewMirror(QRect(0, DependencyManager::get<GLCanvas>()->getDeviceHeight() - BILLBOARD_SIZE, | |
| 2976 | + BILLBOARD_SIZE, BILLBOARD_SIZE), | |
| 2977 | + true); | |
| 2955 | 2978 | |
| 2956 | 2979 | QImage image(BILLBOARD_SIZE, BILLBOARD_SIZE, QImage::Format_ARGB32); |
| 2957 | 2980 | glReadPixels(0, 0, BILLBOARD_SIZE, BILLBOARD_SIZE, GL_BGRA, GL_UNSIGNED_BYTE, image.bits()); |
| @@ -3254,8 +3277,9 @@ bool Application::getCascadeShadowsEnabled() { · 296 unmodified lines | ||
| 3254 | 3277 | } |
| 3255 | 3278 | |
| 3256 | 3279 | glm::vec2 Application::getScaledScreenPoint(glm::vec2 projectedPoint) { |
| 3257 | − float horizontalScale = _glWidget->getDeviceWidth() / 2.0f; | |
| 3258 | − float verticalScale = _glWidget->getDeviceHeight() / 2.0f; | |
| 3280 | + GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>(); | |
| 3281 | + float horizontalScale = glCanvas->getDeviceWidth() / 2.0f; | |
| 3282 | + float verticalScale = glCanvas->getDeviceHeight() / 2.0f; | |
| 3259 | 3283 | |
| 3260 | 3284 | // -1,-1 is 0,windowHeight |
| 3261 | 3285 | // 1,1 is windowWidth,0 |
| @@ -3274,7 +3298,7 @@ glm::vec2 Application::getScaledScreenPoint(glm::vec2 projectedPoint) { · 12 unmodified lines | ||
| 3274 | 3298 | // -1,-1 1,-1 |
| 3275 | 3299 | |
| 3276 | 3300 | glm::vec2 screenPoint((projectedPoint.x + 1.0) * horizontalScale, |
| 3277 | − ((projectedPoint.y + 1.0) * -verticalScale) + _glWidget->getDeviceHeight()); | |
| 3301 | + ((projectedPoint.y + 1.0) * -verticalScale) + glCanvas->getDeviceHeight()); | |
| 3278 | 3302 | |
| 3279 | 3303 | return screenPoint; |
| 3280 | 3304 | } |
| @@ -3585,7 +3609,7 @@ void Application::resetSensors() { · 304 unmodified lines | ||
| 3585 | 3609 | QScreen* currentScreen = _window->windowHandle()->screen(); |
| 3586 | 3610 | QWindow* mainWindow = _window->windowHandle(); |
| 3587 | 3611 | QPoint windowCenter = mainWindow->geometry().center(); |
| 3588 | − _glWidget->cursor().setPos(currentScreen, windowCenter); | |
| 3612 | + DependencyManager::get<GLCanvas>()->cursor().setPos(currentScreen, windowCenter); | |
| 3589 | 3613 | |
| 3590 | 3614 | _myAvatar->reset(); |
| 3591 | 3615 | |
| @@ -4021,7 +4045,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scri · 429 unmodified lines | ||
| 4021 | 4045 | scriptEngine->registerGlobalObject("Menu", MenuScriptingInterface::getInstance()); |
| 4022 | 4046 | scriptEngine->registerGlobalObject("Settings", SettingsScriptingInterface::getInstance()); |
| 4023 | 4047 | scriptEngine->registerGlobalObject("AudioDevice", AudioDeviceScriptingInterface::getInstance()); |
| 4024 | − scriptEngine->registerGlobalObject("AnimationCache", DependencyManager::get<AnimationCache>()); | |
| 4048 | + scriptEngine->registerGlobalObject("AnimationCache", DependencyManager::get<AnimationCache>().data()); | |
| 4025 | 4049 | scriptEngine->registerGlobalObject("SoundCache", &SoundCache::getInstance()); |
| 4026 | 4050 | scriptEngine->registerGlobalObject("Account", AccountScriptingInterface::getInstance()); |
| 4027 | 4051 | scriptEngine->registerGlobalObject("Metavoxels", &_metavoxels); |
| @@ -4266,7 +4290,8 @@ void Application::setPreviousScriptLocation(const QString& previousScriptLocatio · 238 unmodified lines | ||
| 4266 | 4290 | |
| 4267 | 4291 | void Application::loadDialog() { |
| 4268 | 4292 | |
| 4269 | − QString fileNameString = QFileDialog::getOpenFileName(_glWidget, tr("Open Script"), | |
| 4293 | + QString fileNameString = QFileDialog::getOpenFileName(DependencyManager::get<GLCanvas>().data(), | |
| 4294 | + tr("Open Script"), | |
| 4270 | 4295 | getPreviousScriptLocation(), |
| 4271 | 4296 | tr("JavaScript Files (*.js)")); |
| 4272 | 4297 | if (!fileNameString.isEmpty()) { |
| @@ -4302,7 +4327,7 @@ void Application::loadScriptURLDialog() { · 29 unmodified lines | ||
| 4302 | 4327 | |
| 4303 | 4328 | void Application::toggleLogDialog() { |
| 4304 | 4329 | if (! _logDialog) { |
| 4305 | − _logDialog = new LogDialog(_glWidget, getLogger()); | |
| 4330 | + _logDialog = new LogDialog(DependencyManager::get<GLCanvas>().data(), getLogger()); | |
| 4306 | 4331 | } |
| 4307 | 4332 | |
| 4308 | 4333 | if (_logDialog->isVisible()) { |
| @@ -4362,7 +4387,7 @@ void Application::parseVersionXml() { · 53 unmodified lines | ||
| 4362 | 4387 | } |
| 4363 | 4388 | |
| 4364 | 4389 | if (!shouldSkipVersion(latestVersion) && applicationVersion() != latestVersion) { |
| 4365 | − new UpdateDialog(_glWidget, releaseNotes, latestVersion, downloadUrl); | |
| 4390 | + new UpdateDialog(DependencyManager::get<GLCanvas>().data(), releaseNotes, latestVersion, downloadUrl); | |
| 4366 | 4391 | } |
| 4367 | 4392 | sender->deleteLater(); |
| 4368 | 4393 | } |
| @@ -4395,7 +4420,7 @@ void Application::takeSnapshot() { · 26 unmodified lines | ||
| 4395 | 4420 | } |
| 4396 | 4421 | |
| 4397 | 4422 | if (!_snapshotShareDialog) { |
| 4398 | − _snapshotShareDialog = new SnapshotShareDialog(fileName, _glWidget); | |
| 4423 | + _snapshotShareDialog = new SnapshotShareDialog(fileName, DependencyManager::get<GLCanvas>().data()); | |
| 4399 | 4424 | } |
| 4400 | 4425 | _snapshotShareDialog->show(); |
| 4401 | 4426 | } |