History

resolve conflicts on merge with upstream master

Stephen Birarda committed 11 years ago

Commit 7beb3a72 parents a99589f 1617d79145 files · +1207 −907Browse files

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

Unified · Split

interface/src/Application.cpp+105−66
@@ -54,20 +54,27 @@ · 53 unmodified lines
5454
5555 #include <AddressManager.h>
5656 #include <AccountManager.h>
57+#include <AmbientOcclusionEffect.h>
5758 #include <AudioInjector.h>
59+#include <DeferredLightingEffect.h>
5860 #include <DependencyManager.h>
5961 #include <EntityScriptingInterface.h>
62+#include <GlowEffect.h>
6063 #include <HFActionEvent.h>
6164 #include <HFBackEvent.h>
6265 #include <LocalVoxelsList.h>
6366 #include <LogHandler.h>
67+#include <MainWindow.h>
6468 #include <NetworkAccessManager.h>
6569 #include <OctalCode.h>
6670 #include <OctreeSceneStats.h>
6771 #include <PacketHeaders.h>
72+#include <PathUtils.h>
6873 #include <PerfStat.h>
74+#include <ProgramObject.h>
6975 #include <ResourceCache.h>
7076 #include <SoundCache.h>
77+#include <TextRenderer.h>
7178 #include <UserActivityLogger.h>
7279 #include <UUID.h>
7380
@@ -87,10 +94,10 @@ · 13 unmodified lines
8794 #include "devices/TV3DManager.h"
8895 #include "devices/Visage.h"
8996
90−#include "renderer/ProgramObject.h"
9197 #include "gpu/Batch.h"
9298 #include "gpu/GLBackend.h"
9399
100+
94101 #include "scripting/AccountScriptingInterface.h"
95102 #include "scripting/AudioDeviceScriptingInterface.h"
96103 #include "scripting/ClipboardScriptingInterface.h"
@@ -106,7 +113,7 @@ · 9 unmodified lines
106113 #include "ui/InfoView.h"
107114 #include "ui/Snapshot.h"
108115 #include "ui/Stats.h"
109−#include "ui/TextRenderer.h"
116+
110117
111118
112119 using namespace std;
@@ -135,19 +142,9 @@ void messageHandler(QtMsgType type, const QMessageLogContext& context, const QSt · 22 unmodified lines
135142 }
136143 }
137144
138−QString& Application::resourcesPath() {
139−#ifdef Q_OS_MAC
140− static QString staticResourcePath = QCoreApplication::applicationDirPath() + "/../Resources/";
141−#else
142− static QString staticResourcePath = QCoreApplication::applicationDirPath() + "/resources/";
143−#endif
144− return staticResourcePath;
145−}
146−
147145 Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
148146 QApplication(argc, argv),
149147 _window(new MainWindow(desktop())),
150− _glWidget(new GLCanvas()),
151148 _toolWindow(NULL),
152149 _nodeThread(new QThread(this)),
153150 _datagramProcessor(),
@@ -160,9 +157,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 6 unmodified lines
160157 _voxelImporter(),
161158 _importSucceded(false),
162159 _sharedVoxelSystem(TREE_SCALE, DEFAULT_MAX_VOXELS_PER_SYSTEM, &_clipboard),
163− _entities(true),
160+ _entities(true, this, this),
164161 _entityCollisionSystem(),
165− _entityClipboardRenderer(false),
162+ _entityClipboardRenderer(false, this, this),
166163 _entityClipboard(),
167164 _wantToKillLocalVoxels(false),
168165 _viewFrustum(),
@@ -195,8 +192,11 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 26 unmodified lines
195192 _isVSyncOn(true),
196193 _aboutToQuit(false)
197194 {
195+ GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>();
196+ Model::setAbstractViewStateInterface(this); // The model class will sometimes need to know view state details from us
197+
198198 // read the ApplicationInfo.ini file for Name/Version/Domain information
199− QSettings applicationInfo(Application::resourcesPath() + "info/ApplicationInfo.ini", QSettings::IniFormat);
199+ QSettings applicationInfo(PathUtils::resourcesPath() + "info/ApplicationInfo.ini", QSettings::IniFormat);
200200
201201 // set the associated application properties
202202 applicationInfo.beginGroup("INFO");
@@ -214,7 +214,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 11 unmodified lines
214214
215215 _applicationStartupTime = startup_time;
216216
217− QFontDatabase::addApplicationFont(Application::resourcesPath() + "styles/Inconsolata.otf");
217+ QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "styles/Inconsolata.otf");
218218 _window->setWindowTitle("Interface");
219219
220220 qInstallMessageHandler(messageHandler);
@@ -251,7 +251,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 30 unmodified lines
251251 // put the audio processing on a separate thread
252252 QThread* audioThread = new QThread(this);
253253
254− Audio* audioIO = DependencyManager::get<Audio>();
254+ Audio::Pointer audioIO = DependencyManager::get<Audio>();
255255 audioIO->moveToThread(audioThread);
256256 connect(audioThread, &QThread::started, audioIO, &Audio::start);
257257
@@ -365,16 +365,16 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 107 unmodified lines
365365
366366 ResourceCache::setRequestLimit(3);
367367
368− _window->setCentralWidget(_glWidget);
368+ _window->setCentralWidget(glCanvas.data());
369369
370370 restoreSizeAndPosition();
371371
372372 _window->setVisible(true);
373− _glWidget->setFocusPolicy(Qt::StrongFocus);
374− _glWidget->setFocus();
373+ glCanvas->setFocusPolicy(Qt::StrongFocus);
374+ glCanvas->setFocus();
375375
376376 // enable mouse tracking; otherwise, we only get drag events
377− _glWidget->setMouseTracking(true);
377+ glCanvas->setMouseTracking(true);
378378
379379 _toolWindow = new ToolWindow();
380380 _toolWindow->setWindowFlags(_toolWindow->windowFlags() | Qt::WindowStaysOnTopHint);
@@ -393,7 +393,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 12 unmodified lines
393393
394394 checkVersion();
395395
396− _overlays.init(_glWidget); // do this before scripts load
396+ _overlays.init(glCanvas.data()); // do this before scripts load
397397
398398 LocalVoxelsList::getInstance()->addPersistantTree(DOMAIN_TREE_NAME, _voxels.getTree());
399399 LocalVoxelsList::getInstance()->addPersistantTree(CLIPBOARD_TREE_NAME, &_clipboard);
@@ -442,6 +442,7 @@ void Application::aboutToQuit() { · 42 unmodified lines
442442 }
443443
444444 Application::~Application() {
445+
445446 _entities.getTree()->setSimulation(NULL);
446447 qInstallMessageHandler(NULL);
447448
@@ -485,8 +486,6 @@ Application::~Application() { · 37 unmodified lines
485486 Menu::getInstance()->deleteLater();
486487
487488 _myAvatar = NULL;
488−
489− delete _glWidget;
490489 }
491490
492491 void Application::saveSettings() {
@@ -626,7 +625,7 @@ void Application::paintGL() { · 133 unmodified lines
626625 if (OculusManager::isConnected()) {
627626 DependencyManager::get<TextureCache>()->setFrameBufferSize(OculusManager::getRenderTargetSize());
628627 } else {
629− QSize fbSize = _glWidget->getDeviceSize() * getRenderResolutionScale();
628+ QSize fbSize = DependencyManager::get<GLCanvas>()->getDeviceSize() * getRenderResolutionScale();
630629 DependencyManager::get<TextureCache>()->setFrameBufferSize(fbSize);
631630 }
632631
@@ -714,7 +713,7 @@ void Application::paintGL() { · 81 unmodified lines
714713 TV3DManager::display(*whichCamera);
715714
716715 } else {
717− _glowEffect.prepare();
716+ DependencyManager::get<GlowEffect>()->prepare();
718717
719718 // Viewport is assigned to the size of the framebuffer
720719 QSize size = DependencyManager::get<TextureCache>()->getPrimaryFramebufferObject()->size();
@@ -733,7 +732,7 @@ void Application::paintGL() { · 12 unmodified lines
733732 renderRearViewMirror(_mirrorViewRect);
734733 }
735734
736− _glowEffect.render();
735+ DependencyManager::get<GlowEffect>()->render();
737736
738737 {
739738 PerformanceTimer perfTimer("renderOverlay");
@@ -1050,7 +1049,8 @@ void Application::keyPressEvent(QKeyEvent* event) { · 310 unmodified lines
10501049 if (isShifted) {
10511050 _viewFrustum.setFocalLength(_viewFrustum.getFocalLength() - 0.1f);
10521051 if (TV3DManager::isConnected()) {
1053− TV3DManager::configureCamera(_myCamera, _glWidget->getDeviceWidth(), _glWidget->getDeviceHeight());
1052+ GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>();
1053+ TV3DManager::configureCamera(_myCamera, glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight());
10541054 }
10551055 } else {
10561056 _myCamera.setEyeOffsetPosition(_myCamera.getEyeOffsetPosition() + glm::vec3(-0.001, 0, 0));
@@ -1062,7 +1062,8 @@ void Application::keyPressEvent(QKeyEvent* event) { · 5 unmodified lines
10621062 if (isShifted) {
10631063 _viewFrustum.setFocalLength(_viewFrustum.getFocalLength() + 0.1f);
10641064 if (TV3DManager::isConnected()) {
1065− TV3DManager::configureCamera(_myCamera, _glWidget->getDeviceWidth(), _glWidget->getDeviceHeight());
1065+ GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>();
1066+ TV3DManager::configureCamera(_myCamera, glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight());
10661067 }
10671068
10681069 } else {
@@ -1508,7 +1509,7 @@ void Application::idle() { · 439 unmodified lines
15081509 {
15091510 PerformanceTimer perfTimer("updateGL");
15101511 PerformanceWarning warn(showWarnings, "Application::idle()... updateGL()");
1511− _glWidget->updateGL();
1512+ DependencyManager::get<GLCanvas>()->updateGL();
15121513 }
15131514 {
15141515 PerformanceTimer perfTimer("rest");
@@ -1534,13 +1535,14 @@ void Application::idle() { · 19 unmodified lines
15341535
15351536 void Application::checkBandwidthMeterClick() {
15361537 // ... to be called upon button release
1538+ GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>();
15371539 if (Menu::getInstance()->isOptionChecked(MenuOption::Bandwidth) &&
15381540 Menu::getInstance()->isOptionChecked(MenuOption::Stats) &&
15391541 Menu::getInstance()->isOptionChecked(MenuOption::UserInterface) &&
15401542 glm::compMax(glm::abs(glm::ivec2(getMouseX() - getMouseDragStartedX(),
15411543 getMouseY() - getMouseDragStartedY())))
15421544 <= BANDWIDTH_METER_CLICK_MAX_DRAG_LENGTH
1543− && _bandwidthMeter.isWithinArea(getMouseX(), getMouseY(), _glWidget->width(), _glWidget->height())) {
1545+ && _bandwidthMeter.isWithinArea(getMouseX(), getMouseY(), glCanvas->width(), glCanvas->height())) {
15441546
15451547 // The bandwidth meter is visible, the click didn't get dragged too far and
15461548 // we actually hit the bandwidth meter
@@ -1569,7 +1571,8 @@ void Application::setFullscreen(bool fullscreen) { · 22 unmodified lines
15691571 }
15701572
15711573 void Application::setEnable3DTVMode(bool enable3DTVMode) {
1572− resizeGL(_glWidget->getDeviceWidth(),_glWidget->getDeviceHeight());
1574+ GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>();
1575+ resizeGL(glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight());
15731576 }
15741577
15751578 void Application::setEnableVRMode(bool enableVRMode) {
@@ -1594,7 +1597,8 @@ void Application::setEnableVRMode(bool enableVRMode) { · 18 unmodified lines
15941597 _myCamera.setHmdRotation(glm::quat());
15951598 }
15961599
1597− resizeGL(_glWidget->getDeviceWidth(), _glWidget->getDeviceHeight());
1600+ GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>();
1601+ resizeGL(glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight());
15981602 }
15991603
16001604 void Application::setRenderVoxels(bool voxelRender) {
@@ -1656,8 +1660,9 @@ glm::vec3 Application::getMouseVoxelWorldCoordinates(const VoxelDetail& mouseVox · 55 unmodified lines
16561660
16571661 bool Application::mouseOnScreen() const {
16581662 if (OculusManager::isConnected()) {
1659− return getMouseX() >= 0 && getMouseX() <= _glWidget->getDeviceWidth() &&
1660− getMouseY() >= 0 && getMouseY() <= _glWidget->getDeviceHeight();
1663+ GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>();
1664+ return getMouseX() >= 0 && getMouseX() <= glCanvas->getDeviceWidth() &&
1665+ getMouseY() >= 0 && getMouseY() <= glCanvas->getDeviceHeight();
16611666 }
16621667 return true;
16631668 }
@@ -1697,13 +1702,13 @@ int Application::getMouseDragStartedY() const { · 33 unmodified lines
16971702 }
16981703
16991704 FaceTracker* Application::getActiveFaceTracker() {
1700− Faceshift* faceshift = DependencyManager::get<Faceshift>();
1701− Visage* visage = DependencyManager::get<Visage>();
1702− DdeFaceTracker* dde = DependencyManager::get<DdeFaceTracker>();
1705+ Faceshift::SharedPointer faceshift = DependencyManager::get<Faceshift>();
1706+ Visage::SharedPointer visage = DependencyManager::get<Visage>();
1707+ DdeFaceTracker::SharedPointer dde = DependencyManager::get<DdeFaceTracker>();
17031708
1704− return (dde->isActive() ? static_cast<FaceTracker*>(dde) :
1705− (faceshift->isActive() ? static_cast<FaceTracker*>(faceshift) :
1706− (visage->isActive() ? static_cast<FaceTracker*>(visage) : NULL)));
1709+ return (dde->isActive() ? static_cast<FaceTracker*>(dde.data()) :
1710+ (faceshift->isActive() ? static_cast<FaceTracker*>(faceshift.data()) :
1711+ (visage->isActive() ? static_cast<FaceTracker*>(visage.data()) : NULL)));
17071712 }
17081713
17091714 struct SendVoxelsOperationArgs {
@@ -1776,7 +1781,8 @@ void Application::exportVoxels(const VoxelDetail& sourceVoxel) { · 66 unmodified lines
17761781 QString desktopLocation = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
17771782 QString suggestedName = desktopLocation.append("/voxels.svo");
17781783
1779− QString fileNameString = QFileDialog::getSaveFileName(_glWidget, tr("Export Voxels"), suggestedName,
1784+ QString fileNameString = QFileDialog::getSaveFileName(DependencyManager::get<GLCanvas>().data(),
1785+ tr("Export Voxels"), suggestedName,
17801786 tr("Sparse Voxel Octree Files (*.svo)"));
17811787 QByteArray fileNameAscii = fileNameString.toLocal8Bit();
17821788 const char* fileName = fileNameAscii.data();
@@ -1924,9 +1930,8 @@ void Application::init() { · 141 unmodified lines
19241930
19251931 _environment.init();
19261932
1927− _deferredLightingEffect.init();
1928− _glowEffect.init();
1929− _ambientOcclusionEffect.init();
1933+ DependencyManager::get<DeferredLightingEffect>()->init(this);
1934+ DependencyManager::get<AmbientOcclusionEffect>()->init(this);
19301935
19311936 // TODO: move _myAvatar out of Application. Move relevant code to MyAvataar or AvatarManager
19321937 _avatarManager.init();
@@ -2020,8 +2025,9 @@ void Application::init() { · 87 unmodified lines
20202025 _entityClipboardRenderer.setTree(&_entityClipboard);
20212026
20222027 _metavoxels.init();
2023−
2024− _rearMirrorTools = new RearMirrorTools(_glWidget, _mirrorViewRect, _settings);
2028+
2029+ GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>();
2030+ _rearMirrorTools = new RearMirrorTools(glCanvas.data(), _mirrorViewRect, _settings);
20252031
20262032 connect(_rearMirrorTools, SIGNAL(closeView()), SLOT(closeMirrorView()));
20272033 connect(_rearMirrorTools, SIGNAL(restoreView()), SLOT(restoreMirrorView()));
@@ -2031,8 +2037,12 @@ void Application::init() { · 3 unmodified lines
20312037 // save settings when avatar changes
20322038 connect(_myAvatar, &MyAvatar::transformChanged, this, &Application::bumpSettings);
20332039
2034− // make sure our texture cache knows about window size changes
2035− DependencyManager::get<TextureCache>()->associateWithWidget(getGLWidget());
2040+ // make sure our texture cache knows about window size changes
2041+ DependencyManager::get<TextureCache>()->associateWithWidget(glCanvas.data());
2042+
2043+ // initialize the GlowEffect with our widget
2044+ DependencyManager::get<GlowEffect>()->init(glCanvas.data(),
2045+ Menu::getInstance()->isOptionChecked(MenuOption::EnableGlowEffect));
20362046 }
20372047
20382048 void Application::closeMirrorView() {
@@ -2100,7 +2110,7 @@ void Application::updateMouseRay() { · 61 unmodified lines
21002110 void Application::updateFaceshift() {
21012111 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
21022112 PerformanceWarning warn(showWarnings, "Application::updateFaceshift()");
2103− Faceshift* faceshift = DependencyManager::get<Faceshift>();
2113+ Faceshift::SharedPointer faceshift = DependencyManager::get<Faceshift>();
21042114 // Update faceshift
21052115 faceshift->update();
21062116
@@ -2903,8 +2913,9 @@ void Application::updateShadowMap() { · 796 unmodified lines
29032913 }
29042914
29052915 fbo->release();
2906−
2907− glViewport(0, 0, _glWidget->getDeviceWidth(), _glWidget->getDeviceHeight());
2916+
2917+ GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>();
2918+ glViewport(0, 0, glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight());
29082919 }
29092920
29102921 const GLfloat WORLD_AMBIENT_COLOR[] = { 0.525f, 0.525f, 0.6f };
@@ -2927,6 +2938,22 @@ void Application::setupWorldLight() { · 16 unmodified lines
29272938 glMateriali(GL_FRONT, GL_SHININESS, 96);
29282939 }
29292940
2941+bool Application::shouldRenderMesh(float largestDimension, float distanceToCamera) {
2942+ return Menu::getInstance()->shouldRenderMesh(largestDimension, distanceToCamera);
2943+}
2944+
2945+float Application::getSizeScale() const {
2946+ return Menu::getInstance()->getVoxelSizeScale();
2947+}
2948+
2949+int Application::getBoundaryLevelAdjust() const {
2950+ return Menu::getInstance()->getBoundaryLevelAdjust();
2951+}
2952+
2953+PickRay Application::computePickRay(float x, float y) {
2954+ return getCamera()->computePickRay(x, y);
2955+}
2956+
29302957 QImage Application::renderAvatarBillboard() {
29312958 DependencyManager::get<TextureCache>()->getPrimaryFramebufferObject()->bind();
29322959
@@ -2934,7 +2961,9 @@ QImage Application::renderAvatarBillboard() { · 1 unmodified line
29342961 Glower glower;
29352962
29362963 const int BILLBOARD_SIZE = 64;
2937− renderRearViewMirror(QRect(0, _glWidget->getDeviceHeight() - BILLBOARD_SIZE, BILLBOARD_SIZE, BILLBOARD_SIZE), true);
2964+ renderRearViewMirror(QRect(0, DependencyManager::get<GLCanvas>()->getDeviceHeight() - BILLBOARD_SIZE,
2965+ BILLBOARD_SIZE, BILLBOARD_SIZE),
2966+ true);
29382967
29392968 QImage image(BILLBOARD_SIZE, BILLBOARD_SIZE, QImage::Format_ARGB32);
29402969 glReadPixels(0, 0, BILLBOARD_SIZE, BILLBOARD_SIZE, GL_BGRA, GL_UNSIGNED_BYTE, image.bits());
@@ -3063,7 +3092,7 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly, RenderAr · 122 unmodified lines
30633092 glEnable(GL_LIGHTING);
30643093 glEnable(GL_DEPTH_TEST);
30653094
3066− _deferredLightingEffect.prepare();
3095+ DependencyManager::get<DeferredLightingEffect>()->prepare();
30673096
30683097 if (!selfAvatarOnly) {
30693098 // draw a red sphere
@@ -3106,7 +3135,7 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly, RenderAr · 36 unmodified lines
31063135 PerformanceTimer perfTimer("ambientOcclusion");
31073136 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
31083137 "Application::displaySide() ... AmbientOcclusion...");
3109− _ambientOcclusionEffect.render();
3138+ DependencyManager::get<AmbientOcclusionEffect>()->render();
31103139 }
31113140 }
31123141
@@ -3123,7 +3152,7 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly, RenderAr · 10 unmodified lines
31233152 {
31243153 PROFILE_RANGE("DeferredLighting");
31253154 PerformanceTimer perfTimer("lighting");
3126− _deferredLightingEffect.render();
3155+ DependencyManager::get<DeferredLightingEffect>()->render();
31273156 }
31283157
31293158 {
@@ -3228,9 +3257,18 @@ void Application::computeOffAxisFrustum(float& left, float& right, float& bottom · 98 unmodified lines
32283257 }
32293258 }
32303259
3260+bool Application::getShadowsEnabled() {
3261+ return Menu::getInstance()->getShadowsEnabled();
3262+}
3263+
3264+bool Application::getCascadeShadowsEnabled() {
3265+ return Menu::getInstance()->isOptionChecked(MenuOption::CascadedShadows);
3266+}
3267+
32313268 glm::vec2 Application::getScaledScreenPoint(glm::vec2 projectedPoint) {
3232− float horizontalScale = _glWidget->getDeviceWidth() / 2.0f;
3233− float verticalScale = _glWidget->getDeviceHeight() / 2.0f;
3269+ GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>();
3270+ float horizontalScale = glCanvas->getDeviceWidth() / 2.0f;
3271+ float verticalScale = glCanvas->getDeviceHeight() / 2.0f;
32343272
32353273 // -1,-1 is 0,windowHeight
32363274 // 1,1 is windowWidth,0
@@ -3249,7 +3287,7 @@ glm::vec2 Application::getScaledScreenPoint(glm::vec2 projectedPoint) { · 12 unmodified lines
32493287 // -1,-1 1,-1
32503288
32513289 glm::vec2 screenPoint((projectedPoint.x + 1.0) * horizontalScale,
3252− ((projectedPoint.y + 1.0) * -verticalScale) + _glWidget->getDeviceHeight());
3290+ ((projectedPoint.y + 1.0) * -verticalScale) + glCanvas->getDeviceHeight());
32533291
32543292 return screenPoint;
32553293 }
@@ -3560,7 +3598,7 @@ void Application::resetSensors() { · 304 unmodified lines
35603598 QScreen* currentScreen = _window->windowHandle()->screen();
35613599 QWindow* mainWindow = _window->windowHandle();
35623600 QPoint windowCenter = mainWindow->geometry().center();
3563− _glWidget->cursor().setPos(currentScreen, windowCenter);
3601+ DependencyManager::get<GLCanvas>()->cursor().setPos(currentScreen, windowCenter);
35643602
35653603 _myAvatar->reset();
35663604
@@ -3996,7 +4034,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scri · 429 unmodified lines
39964034 scriptEngine->registerGlobalObject("Menu", MenuScriptingInterface::getInstance());
39974035 scriptEngine->registerGlobalObject("Settings", SettingsScriptingInterface::getInstance());
39984036 scriptEngine->registerGlobalObject("AudioDevice", AudioDeviceScriptingInterface::getInstance());
3999− scriptEngine->registerGlobalObject("AnimationCache", &_animationCache);
4037+ scriptEngine->registerGlobalObject("AnimationCache", DependencyManager::get<AnimationCache>().data());
40004038 scriptEngine->registerGlobalObject("SoundCache", &SoundCache::getInstance());
40014039 scriptEngine->registerGlobalObject("Account", AccountScriptingInterface::getInstance());
40024040 scriptEngine->registerGlobalObject("Metavoxels", &_metavoxels);
@@ -4241,7 +4279,8 @@ void Application::setPreviousScriptLocation(const QString& previousScriptLocatio · 238 unmodified lines
42414279
42424280 void Application::loadDialog() {
42434281
4244− QString fileNameString = QFileDialog::getOpenFileName(_glWidget, tr("Open Script"),
4282+ QString fileNameString = QFileDialog::getOpenFileName(DependencyManager::get<GLCanvas>().data(),
4283+ tr("Open Script"),
42454284 getPreviousScriptLocation(),
42464285 tr("JavaScript Files (*.js)"));
42474286 if (!fileNameString.isEmpty()) {
@@ -4277,7 +4316,7 @@ void Application::loadScriptURLDialog() { · 29 unmodified lines
42774316
42784317 void Application::toggleLogDialog() {
42794318 if (! _logDialog) {
4280− _logDialog = new LogDialog(_glWidget, getLogger());
4319+ _logDialog = new LogDialog(DependencyManager::get<GLCanvas>().data(), getLogger());
42814320 }
42824321
42834322 if (_logDialog->isVisible()) {
@@ -4337,7 +4376,7 @@ void Application::parseVersionXml() { · 53 unmodified lines
43374376 }
43384377
43394378 if (!shouldSkipVersion(latestVersion) && applicationVersion() != latestVersion) {
4340− new UpdateDialog(_glWidget, releaseNotes, latestVersion, downloadUrl);
4379+ new UpdateDialog(DependencyManager::get<GLCanvas>().data(), releaseNotes, latestVersion, downloadUrl);
43414380 }
43424381 sender->deleteLater();
43434382 }
@@ -4358,7 +4397,7 @@ void Application::skipVersion(QString latestVersion) { · 14 unmodified lines
43584397
43594398 void Application::takeSnapshot() {
43604399 QMediaPlayer* player = new QMediaPlayer();
4361− QFileInfo inf = QFileInfo(Application::resourcesPath() + "sounds/snap.wav");
4400+ QFileInfo inf = QFileInfo(PathUtils::resourcesPath() + "sounds/snap.wav");
43624401 player->setMedia(QUrl::fromLocalFile(inf.absoluteFilePath()));
43634402 player->play();
43644403
@@ -4370,7 +4409,7 @@ void Application::takeSnapshot() { · 5 unmodified lines
43704409 }
43714410
43724411 if (!_snapshotShareDialog) {
4373− _snapshotShareDialog = new SnapshotShareDialog(fileName, _glWidget);
4412+ _snapshotShareDialog = new SnapshotShareDialog(fileName, DependencyManager::get<GLCanvas>().data());
43744413 }
43754414 _snapshotShareDialog->show();
43764415 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t