Showing the changes to interface/src/Application.cpp (1 of 168 files). Show all
Unified · Split
| @@ -23,6 +23,7 @@ · 22 unmodified lines | ||
| 23 | 23 | // include this before QGLWidget, which includes an earlier version of OpenGL |
| 24 | 24 | #include "InterfaceConfig.h" |
| 25 | 25 | |
| 26 | +#include <QAbstractNativeEventFilter> | |
| 26 | 27 | #include <QActionGroup> |
| 27 | 28 | #include <QColorDialog> |
| 28 | 29 | #include <QDesktopWidget> |
| @@ -73,6 +74,7 @@ · 44 unmodified lines | ||
| 73 | 74 | #include <PhysicsEngine.h> |
| 74 | 75 | #include <ProgramObject.h> |
| 75 | 76 | #include <ResourceCache.h> |
| 77 | +#include <ScriptCache.h> | |
| 76 | 78 | #include <SettingHandle.h> |
| 77 | 79 | #include <SoundCache.h> |
| 78 | 80 | #include <TextRenderer.h> |
| @@ -80,13 +82,15 @@ · 1 unmodified line | ||
| 80 | 82 | #include <UUID.h> |
| 81 | 83 | |
| 82 | 84 | #include "Application.h" |
| 83 | −#include "Audio.h" | |
| 85 | +#include "AudioClient.h" | |
| 84 | 86 | #include "InterfaceVersion.h" |
| 85 | 87 | #include "LODManager.h" |
| 86 | 88 | #include "Menu.h" |
| 87 | 89 | #include "ModelUploader.h" |
| 88 | 90 | #include "Util.h" |
| 89 | 91 | |
| 92 | +#include "avatar/AvatarManager.h" | |
| 93 | + | |
| 90 | 94 | #include "audio/AudioToolBox.h" |
| 91 | 95 | #include "audio/AudioIOStatsRenderer.h" |
| 92 | 96 | #include "audio/AudioScope.h" |
| @@ -127,17 +131,12 @@ · 34 unmodified lines | ||
| 127 | 131 | #include "ui/StandAloneJSConsole.h" |
| 128 | 132 | #include "ui/Stats.h" |
| 129 | 133 | |
| 130 | − | |
| 131 | − | |
| 132 | 134 | using namespace std; |
| 133 | 135 | |
| 134 | 136 | // Starfield information |
| 135 | 137 | static unsigned STARFIELD_NUM_STARS = 50000; |
| 136 | 138 | static unsigned STARFIELD_SEED = 1; |
| 137 | 139 | |
| 138 | −static const int BANDWIDTH_METER_CLICK_MAX_DRAG_LENGTH = 6; // farther dragged clicks are ignored | |
| 139 | − | |
| 140 | − | |
| 141 | 140 | const qint64 MAXIMUM_CACHE_SIZE = 10737418240; // 10GB |
| 142 | 141 | |
| 143 | 142 | static QTimer* idleTimer = NULL; |
| @@ -147,6 +146,37 @@ const QString SKIP_FILENAME = QStandardPaths::writableLocation(QStandardPaths::D · 3 unmodified lines | ||
| 147 | 146 | |
| 148 | 147 | const QString DEFAULT_SCRIPTS_JS_URL = "http://s3.amazonaws.com/hifi-public/scripts/defaultScripts.js"; |
| 149 | 148 | |
| 149 | +#ifdef Q_OS_WIN | |
| 150 | +class MyNativeEventFilter : public QAbstractNativeEventFilter { | |
| 151 | +public: | |
| 152 | + static MyNativeEventFilter& getInstance() { | |
| 153 | + static MyNativeEventFilter staticInstance; | |
| 154 | + return staticInstance; | |
| 155 | + } | |
| 156 | + | |
| 157 | + bool nativeEventFilter(const QByteArray &eventType, void* msg, long* result) Q_DECL_OVERRIDE { | |
| 158 | + if (eventType == "windows_generic_MSG") { | |
| 159 | + MSG* message = (MSG*)msg; | |
| 160 | + if (message->message == UWM_IDENTIFY_INSTANCES) { | |
| 161 | + *result = UWM_IDENTIFY_INSTANCES; | |
| 162 | + return true; | |
| 163 | + } | |
| 164 | + if (message->message == WM_SHOWWINDOW) { | |
| 165 | + Application::getInstance()->getWindow()->showNormal(); | |
| 166 | + } | |
| 167 | + if (message->message == WM_COPYDATA) { | |
| 168 | + COPYDATASTRUCT* pcds = (COPYDATASTRUCT*)(message->lParam); | |
| 169 | + QUrl url = QUrl((const char*)(pcds->lpData)); | |
| 170 | + if (url.isValid() && url.scheme() == HIFI_URL_SCHEME) { | |
| 171 | + DependencyManager::get<AddressManager>()->handleLookupString(url.toString()); | |
| 172 | + } | |
| 173 | + } | |
| 174 | + } | |
| 175 | + return false; | |
| 176 | + } | |
| 177 | +}; | |
| 178 | +#endif | |
| 179 | + | |
| 150 | 180 | void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString& message) { |
| 151 | 181 | QString logMessage = LogHandler::getInstance().printMessage((LogMsgType) type, context, message); |
| 152 | 182 | |
| @@ -166,6 +196,7 @@ bool setupEssentials(int& argc, char** argv) { · 13 unmodified lines | ||
| 166 | 196 | QCoreApplication::setApplicationVersion(BUILD_VERSION); |
| 167 | 197 | |
| 168 | 198 | DependencyManager::registerInheritance<LimitedNodeList, NodeList>(); |
| 199 | + DependencyManager::registerInheritance<AvatarHashMap, AvatarManager>(); | |
| 169 | 200 | |
| 170 | 201 | // Set dependencies |
| 171 | 202 | auto glCanvas = DependencyManager::set<GLCanvas>(); |
| @@ -174,7 +205,7 @@ bool setupEssentials(int& argc, char** argv) { · 2 unmodified lines | ||
| 174 | 205 | auto geometryCache = DependencyManager::set<GeometryCache>(); |
| 175 | 206 | auto glowEffect = DependencyManager::set<GlowEffect>(); |
| 176 | 207 | auto faceshift = DependencyManager::set<Faceshift>(); |
| 177 | − auto audio = DependencyManager::set<Audio>(); | |
| 208 | + auto audio = DependencyManager::set<AudioClient>(); | |
| 178 | 209 | auto audioScope = DependencyManager::set<AudioScope>(); |
| 179 | 210 | auto audioIOStatsRenderer = DependencyManager::set<AudioIOStatsRenderer>(); |
| 180 | 211 | auto deferredLightingEffect = DependencyManager::set<DeferredLightingEffect>(); |
| @@ -185,10 +216,12 @@ bool setupEssentials(int& argc, char** argv) { · 4 unmodified lines | ||
| 185 | 216 | auto ddeFaceTracker = DependencyManager::set<DdeFaceTracker>(); |
| 186 | 217 | auto modelBlender = DependencyManager::set<ModelBlender>(); |
| 187 | 218 | auto audioToolBox = DependencyManager::set<AudioToolBox>(); |
| 219 | + auto avatarManager = DependencyManager::set<AvatarManager>(); | |
| 188 | 220 | auto lodManager = DependencyManager::set<LODManager>(); |
| 189 | 221 | auto jsConsole = DependencyManager::set<StandAloneJSConsole>(); |
| 190 | 222 | auto dialogsManager = DependencyManager::set<DialogsManager>(); |
| 191 | 223 | auto bandwidthRecorder = DependencyManager::set<BandwidthRecorder>(); |
| 224 | + auto resouceCacheSharedItems = DependencyManager::set<ResouceCacheSharedItems>(); | |
| 192 | 225 | #if defined(Q_OS_MAC) || defined(Q_OS_WIN) |
| 193 | 226 | auto speechRecognizer = DependencyManager::set<SpeechRecognizer>(); |
| 194 | 227 | #endif |
| @@ -224,6 +257,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 29 unmodified lines | ||
| 224 | 257 | _scaleMirror(1.0f), |
| 225 | 258 | _rotateMirror(0.0f), |
| 226 | 259 | _raiseMirror(0.0f), |
| 260 | + _cursorVisible(true), | |
| 227 | 261 | _lastMouseMove(usecTimestampNow()), |
| 228 | 262 | _lastMouseMoveWasSimulated(false), |
| 229 | 263 | _touchAvgX(0.0f), |
| @@ -243,9 +277,13 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 13 unmodified lines | ||
| 243 | 277 | _aboutToQuit(false), |
| 244 | 278 | _notifiedPacketVersionMismatchThisDomain(false) |
| 245 | 279 | { |
| 280 | +#ifdef Q_OS_WIN | |
| 281 | + installNativeEventFilter(&MyNativeEventFilter::getInstance()); | |
| 282 | +#endif | |
| 283 | + | |
| 246 | 284 | _logger = new FileLogger(this); // After setting organization name in order to get correct directory |
| 247 | 285 | qInstallMessageHandler(messageHandler); |
| 248 | − | |
| 286 | + | |
| 249 | 287 | QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "styles/Inconsolata.otf"); |
| 250 | 288 | _window->setWindowTitle("Interface"); |
| 251 | 289 | |
| @@ -254,7 +292,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 2 unmodified lines | ||
| 254 | 292 | auto glCanvas = DependencyManager::get<GLCanvas>(); |
| 255 | 293 | auto nodeList = DependencyManager::get<NodeList>(); |
| 256 | 294 | |
| 257 | − _myAvatar = _avatarManager.getMyAvatar(); | |
| 295 | + _myAvatar = DependencyManager::get<AvatarManager>()->getMyAvatar(); | |
| 258 | 296 | |
| 259 | 297 | _applicationStartupTime = startup_time; |
| 260 | 298 | |
| @@ -285,9 +323,13 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 24 unmodified lines | ||
| 285 | 323 | QThread* audioThread = new QThread(this); |
| 286 | 324 | audioThread->setObjectName("Audio Thread"); |
| 287 | 325 | |
| 288 | − auto audioIO = DependencyManager::get<Audio>(); | |
| 326 | + auto audioIO = DependencyManager::get<AudioClient>(); | |
| 327 | + | |
| 328 | + audioIO->setPositionGetter(getPositionForAudio); | |
| 329 | + audioIO->setOrientationGetter(getOrientationForAudio); | |
| 330 | + | |
| 289 | 331 | audioIO->moveToThread(audioThread); |
| 290 | − connect(audioThread, &QThread::started, audioIO.data(), &Audio::start); | |
| 332 | + connect(audioThread, &QThread::started, audioIO.data(), &AudioClient::start); | |
| 291 | 333 | connect(audioIO.data(), SIGNAL(muteToggled()), this, SLOT(audioMuteToggled())); |
| 292 | 334 | |
| 293 | 335 | audioThread->start(); |
| @@ -331,9 +373,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 37 unmodified lines | ||
| 331 | 373 | auto dialogsManager = DependencyManager::get<DialogsManager>(); |
| 332 | 374 | connect(&accountManager, &AccountManager::authRequired, dialogsManager.data(), &DialogsManager::showLoginDialog); |
| 333 | 375 | connect(&accountManager, &AccountManager::usernameChanged, this, &Application::updateWindowTitle); |
| 334 | − | |
| 335 | − // once we have a profile in account manager make sure we generate a new keypair | |
| 336 | − connect(&accountManager, &AccountManager::profileChanged, &accountManager, &AccountManager::generateNewKeypair); | |
| 337 | 376 | |
| 338 | 377 | // set the account manager's root URL and trigger a login request if we don't have the access token |
| 339 | 378 | accountManager.setAuthURL(DEFAULT_NODE_AUTH_URL); |
| @@ -498,7 +537,7 @@ Application::~Application() { · 158 unmodified lines | ||
| 498 | 537 | // kill any audio injectors that are still around |
| 499 | 538 | AudioScriptingInterface::getInstance().stopAllInjectors(); |
| 500 | 539 | |
| 501 | − auto audioIO = DependencyManager::get<Audio>(); | |
| 540 | + auto audioIO = DependencyManager::get<AudioClient>(); | |
| 502 | 541 | |
| 503 | 542 | // stop the audio process |
| 504 | 543 | QMetaObject::invokeMethod(audioIO.data(), "stop", Qt::BlockingQueuedConnection); |
| @@ -515,6 +554,11 @@ Application::~Application() { · 10 unmodified lines | ||
| 515 | 554 | _myAvatar = NULL; |
| 516 | 555 | |
| 517 | 556 | DependencyManager::destroy<GLCanvas>(); |
| 557 | + DependencyManager::destroy<AnimationCache>(); | |
| 558 | + DependencyManager::destroy<TextureCache>(); | |
| 559 | + DependencyManager::destroy<GeometryCache>(); | |
| 560 | + DependencyManager::destroy<ScriptCache>(); | |
| 561 | + DependencyManager::destroy<SoundCache>(); | |
| 518 | 562 | } |
| 519 | 563 | |
| 520 | 564 | void Application::initializeGL() { |
| @@ -702,7 +746,7 @@ void Application::runTests() { · 181 unmodified lines | ||
| 702 | 746 | void Application::audioMuteToggled() { |
| 703 | 747 | QAction* muteAction = Menu::getInstance()->getActionForOption(MenuOption::MuteAudio); |
| 704 | 748 | Q_CHECK_PTR(muteAction); |
| 705 | − muteAction->setChecked(DependencyManager::get<Audio>()->isMuted()); | |
| 749 | + muteAction->setChecked(DependencyManager::get<AudioClient>()->isMuted()); | |
| 706 | 750 | } |
| 707 | 751 | |
| 708 | 752 | void Application::aboutApp() { |
| @@ -1474,6 +1518,8 @@ void Application::setEnableVRMode(bool enableVRMode) { · 765 unmodified lines | ||
| 1474 | 1518 | |
| 1475 | 1519 | auto glCanvas = DependencyManager::get<GLCanvas>(); |
| 1476 | 1520 | resizeGL(glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight()); |
| 1521 | + | |
| 1522 | + updateCursorVisibility(); | |
| 1477 | 1523 | } |
| 1478 | 1524 | |
| 1479 | 1525 | void Application::setLowVelocityFilter(bool lowVelocityFilter) { |
| @@ -1560,13 +1606,16 @@ bool Application::exportEntities(const QString& filename, float x, float y, floa · 80 unmodified lines | ||
| 1560 | 1606 | } |
| 1561 | 1607 | |
| 1562 | 1608 | void Application::loadSettings() { |
| 1563 | − DependencyManager::get<Audio>()->loadSettings(); | |
| 1609 | + | |
| 1610 | + DependencyManager::get<AudioClient>()->loadSettings(); | |
| 1611 | + | |
| 1564 | 1612 | Menu::getInstance()->loadSettings(); |
| 1565 | 1613 | _myAvatar->loadData(); |
| 1566 | 1614 | } |
| 1567 | 1615 | |
| 1568 | 1616 | void Application::saveSettings() { |
| 1569 | − DependencyManager::get<Audio>()->saveSettings(); | |
| 1617 | + DependencyManager::get<AudioClient>()->saveSettings(); | |
| 1618 | + | |
| 1570 | 1619 | Menu::getInstance()->saveSettings(); |
| 1571 | 1620 | _myAvatar->saveData(); |
| 1572 | 1621 | } |
| @@ -1600,7 +1649,7 @@ void Application::init() { · 27 unmodified lines | ||
| 1600 | 1649 | DependencyManager::get<AmbientOcclusionEffect>()->init(this); |
| 1601 | 1650 | |
| 1602 | 1651 | // TODO: move _myAvatar out of Application. Move relevant code to MyAvataar or AvatarManager |
| 1603 | − _avatarManager.init(); | |
| 1652 | + DependencyManager::get<AvatarManager>()->init(); | |
| 1604 | 1653 | _myCamera.setMode(CAMERA_MODE_FIRST_PERSON); |
| 1605 | 1654 | |
| 1606 | 1655 | _mirrorCamera.setMode(CAMERA_MODE_MIRROR); |
| @@ -1941,35 +1990,22 @@ void Application::updateCursor(float deltaTime) { · 334 unmodified lines | ||
| 1941 | 1990 | |
| 1942 | 1991 | static QPoint lastMousePos = QPoint(); |
| 1943 | 1992 | _lastMouseMove = (lastMousePos == QCursor::pos()) ? _lastMouseMove : usecTimestampNow(); |
| 1944 | − bool hideMouse = false; | |
| 1945 | − bool underMouse = QGuiApplication::topLevelAt(QCursor::pos()) == | |
| 1946 | − Application::getInstance()->getWindow()->windowHandle(); | |
| 1947 | − | |
| 1948 | − static const int HIDE_CURSOR_TIMEOUT = 3 * USECS_PER_SECOND; // 3 second | |
| 1949 | − int elapsed = usecTimestampNow() - _lastMouseMove; | |
| 1950 | − if ((elapsed > HIDE_CURSOR_TIMEOUT) || | |
| 1951 | − (OculusManager::isConnected() && Menu::getInstance()->isOptionChecked(MenuOption::EnableVRMode))) { | |
| 1952 | − hideMouse = underMouse; | |
| 1953 | − } | |
| 1954 | − | |
| 1955 | − setCursorVisible(!hideMouse); | |
| 1956 | 1993 | lastMousePos = QCursor::pos(); |
| 1957 | 1994 | } |
| 1958 | 1995 | |
| 1959 | −void Application::setCursorVisible(bool visible) { | |
| 1960 | − if (visible) { | |
| 1961 | − if (overrideCursor() != NULL) { | |
| 1962 | − restoreOverrideCursor(); | |
| 1963 | − } | |
| 1996 | +void Application::updateCursorVisibility() { | |
| 1997 | + if (!_cursorVisible || Menu::getInstance()->isOptionChecked(MenuOption::EnableVRMode)) { | |
| 1998 | + DependencyManager::get<GLCanvas>()->setCursor(Qt::BlankCursor); | |
| 1964 | 1999 | } else { |
| 1965 | − if (overrideCursor() != NULL) { | |
| 1966 | − changeOverrideCursor(Qt::BlankCursor); | |
| 1967 | − } else { | |
| 1968 | − setOverrideCursor(Qt::BlankCursor); | |
| 1969 | − } | |
| 2000 | + DependencyManager::get<GLCanvas>()->unsetCursor(); | |
| 1970 | 2001 | } |
| 1971 | 2002 | } |
| 1972 | 2003 | |
| 2004 | +void Application::setCursorVisible(bool visible) { | |
| 2005 | + _cursorVisible = visible; | |
| 2006 | + updateCursorVisibility(); | |
| 2007 | +} | |
| 2008 | + | |
| 1973 | 2009 | void Application::update(float deltaTime) { |
| 1974 | 2010 | bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings); |
| 1975 | 2011 | PerformanceWarning warn(showWarnings, "Application::update()"); |
| @@ -1992,7 +2028,7 @@ void Application::update(float deltaTime) { · 16 unmodified lines | ||
| 1992 | 2028 | |
| 1993 | 2029 | updateThreads(deltaTime); // If running non-threaded, then give the threads some time to process... |
| 1994 | 2030 | |
| 1995 | − _avatarManager.updateOtherAvatars(deltaTime); //loop through all the other avatars and simulate them... | |
| 2031 | + DependencyManager::get<AvatarManager>()->updateOtherAvatars(deltaTime); //loop through all the other avatars and simulate them... | |
| 1996 | 2032 | |
| 1997 | 2033 | updateMetavoxels(deltaTime); // update metavoxels |
| 1998 | 2034 | updateCamera(deltaTime); // handle various camera tweaks like off axis projection |
| @@ -2019,7 +2055,7 @@ void Application::update(float deltaTime) { · 20 unmodified lines | ||
| 2019 | 2055 | { |
| 2020 | 2056 | PerformanceTimer perfTimer("myAvatar"); |
| 2021 | 2057 | updateMyAvatarLookAtPosition(); |
| 2022 | − updateMyAvatar(deltaTime); // Sample hardware, update view frustum if needed, and send avatar data to mixer/nodes | |
| 2058 | + DependencyManager::get<AvatarManager>()->updateMyAvatar(deltaTime); // Sample hardware, update view frustum if needed, and send avatar data to mixer/nodes | |
| 2023 | 2059 | } |
| 2024 | 2060 | |
| 2025 | 2061 | { |
| @@ -2076,31 +2112,11 @@ void Application::update(float deltaTime) { · 50 unmodified lines | ||
| 2076 | 2112 | if (sinceLastNack > TOO_LONG_SINCE_LAST_SEND_DOWNSTREAM_AUDIO_STATS) { |
| 2077 | 2113 | _lastSendDownstreamAudioStats = now; |
| 2078 | 2114 | |
| 2079 | − QMetaObject::invokeMethod(DependencyManager::get<Audio>().data(), "sendDownstreamAudioStatsPacket", Qt::QueuedConnection); | |
| 2115 | + QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(), "sendDownstreamAudioStatsPacket", Qt::QueuedConnection); | |
| 2080 | 2116 | } |
| 2081 | 2117 | } |
| 2082 | 2118 | } |
| 2083 | 2119 | |
| 2084 | −void Application::updateMyAvatar(float deltaTime) { | |
| 2085 | − bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings); | |
| 2086 | − PerformanceWarning warn(showWarnings, "Application::updateMyAvatar()"); | |
| 2087 | − | |
| 2088 | − _myAvatar->update(deltaTime); | |
| 2089 | − | |
| 2090 | − quint64 now = usecTimestampNow(); | |
| 2091 | − quint64 dt = now - _lastSendAvatarDataTime; | |
| 2092 | − | |
| 2093 | − if (dt > MIN_TIME_BETWEEN_MY_AVATAR_DATA_SENDS) { | |
| 2094 | − // send head/hand data to the avatar mixer and voxel server | |
| 2095 | − PerformanceTimer perfTimer("send"); | |
| 2096 | − QByteArray packet = byteArrayWithPopulatedHeader(PacketTypeAvatarData); | |
| 2097 | − packet.append(_myAvatar->toByteArray()); | |
| 2098 | − controlledBroadcastToNodes(packet, NodeSet() << NodeType::AvatarMixer); | |
| 2099 | − | |
| 2100 | − _lastSendAvatarDataTime = now; | |
| 2101 | − } | |
| 2102 | −} | |
| 2103 | − | |
| 2104 | 2120 | int Application::sendNackPackets() { |
| 2105 | 2121 | |
| 2106 | 2122 | if (Menu::getInstance()->isOptionChecked(MenuOption::DisableNackPackets)) { |
| @@ -2540,7 +2556,7 @@ void Application::updateShadowMap() { · 433 unmodified lines | ||
| 2540 | 2556 | |
| 2541 | 2557 | { |
| 2542 | 2558 | PerformanceTimer perfTimer("avatarManager"); |
| 2543 | − _avatarManager.renderAvatars(Avatar::SHADOW_RENDER_MODE); | |
| 2559 | + DependencyManager::get<AvatarManager>()->renderAvatars(Avatar::SHADOW_RENDER_MODE); | |
| 2544 | 2560 | } |
| 2545 | 2561 | |
| 2546 | 2562 | { |
| @@ -2792,7 +2808,7 @@ void Application::displaySide(Camera& theCamera, bool selfAvatarOnly, RenderArgs · 245 unmodified lines | ||
| 2792 | 2808 | bool mirrorMode = (theCamera.getMode() == CAMERA_MODE_MIRROR); |
| 2793 | 2809 | { |
| 2794 | 2810 | PerformanceTimer perfTimer("avatars"); |
| 2795 | − _avatarManager.renderAvatars(mirrorMode ? Avatar::MIRROR_RENDER_MODE : Avatar::NORMAL_RENDER_MODE, | |
| 2811 | + DependencyManager::get<AvatarManager>()->renderAvatars(mirrorMode ? Avatar::MIRROR_RENDER_MODE : Avatar::NORMAL_RENDER_MODE, | |
| 2796 | 2812 | false, selfAvatarOnly); |
| 2797 | 2813 | } |
| 2798 | 2814 | |
| @@ -2807,7 +2823,7 @@ void Application::displaySide(Camera& theCamera, bool selfAvatarOnly, RenderArgs · 8 unmodified lines | ||
| 2807 | 2823 | |
| 2808 | 2824 | { |
| 2809 | 2825 | PerformanceTimer perfTimer("avatarsPostLighting"); |
| 2810 | − _avatarManager.renderAvatars(mirrorMode ? Avatar::MIRROR_RENDER_MODE : Avatar::NORMAL_RENDER_MODE, | |
| 2826 | + DependencyManager::get<AvatarManager>()->renderAvatars(mirrorMode ? Avatar::MIRROR_RENDER_MODE : Avatar::NORMAL_RENDER_MODE, | |
| 2811 | 2827 | true, selfAvatarOnly); |
| 2812 | 2828 | } |
| 2813 | 2829 | |
| @@ -3071,7 +3087,7 @@ void Application::resetSensors() { · 257 unmodified lines | ||
| 3071 | 3087 | |
| 3072 | 3088 | _myAvatar->reset(); |
| 3073 | 3089 | |
| 3074 | − QMetaObject::invokeMethod(DependencyManager::get<Audio>().data(), "reset", Qt::QueuedConnection); | |
| 3090 | + QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(), "reset", Qt::QueuedConnection); | |
| 3075 | 3091 | } |
| 3076 | 3092 | |
| 3077 | 3093 | static void setShortcutsEnabled(QWidget* widget, bool enabled) { |
| @@ -3211,7 +3227,7 @@ void Application::nodeKilled(SharedNodePointer node) { · 133 unmodified lines | ||
| 3211 | 3227 | _entityEditSender.nodeKilled(node); |
| 3212 | 3228 | |
| 3213 | 3229 | if (node->getType() == NodeType::AudioMixer) { |
| 3214 | − QMetaObject::invokeMethod(DependencyManager::get<Audio>().data(), "audioMixerKilled"); | |
| 3230 | + QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(), "audioMixerKilled"); | |
| 3215 | 3231 | } |
| 3216 | 3232 | |
| 3217 | 3233 | if (node->getType() == NodeType::EntityServer) { |
| @@ -3254,7 +3270,7 @@ void Application::nodeKilled(SharedNodePointer node) { · 36 unmodified lines | ||
| 3254 | 3270 | |
| 3255 | 3271 | } else if (node->getType() == NodeType::AvatarMixer) { |
| 3256 | 3272 | // our avatar mixer has gone away - clear the hash of avatars |
| 3257 | − _avatarManager.clearOtherAvatars(); | |
| 3273 | + DependencyManager::get<AvatarManager>()->clearOtherAvatars(); | |
| 3258 | 3274 | } |
| 3259 | 3275 | } |
| 3260 | 3276 | |
| @@ -3403,7 +3419,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scri · 142 unmodified lines | ||
| 3403 | 3419 | |
| 3404 | 3420 | // hook our avatar and avatar hash map object into this script engine |
| 3405 | 3421 | scriptEngine->setAvatarData(_myAvatar, "MyAvatar"); // leave it as a MyAvatar class to expose thrust features |
| 3406 | − scriptEngine->setAvatarHashMap(&_avatarManager, "AvatarList"); | |
| 3422 | + scriptEngine->setAvatarHashMap(DependencyManager::get<AvatarManager>().data(), "AvatarList"); | |
| 3407 | 3423 | |
| 3408 | 3424 | scriptEngine->registerGlobalObject("Camera", &_myCamera); |
| 3409 | 3425 | |
| @@ -3444,7 +3460,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scri · 34 unmodified lines | ||
| 3444 | 3460 | scriptEngine->registerGlobalObject("GlobalServices", GlobalServicesScriptingInterface::getInstance()); |
| 3445 | 3461 | qScriptRegisterMetaType(scriptEngine, DownloadInfoResultToScriptValue, DownloadInfoResultFromScriptValue); |
| 3446 | 3462 | |
| 3447 | − scriptEngine->registerGlobalObject("AvatarManager", &_avatarManager); | |
| 3463 | + scriptEngine->registerGlobalObject("AvatarManager", DependencyManager::get<AvatarManager>().data()); | |
| 3448 | 3464 | |
| 3449 | 3465 | scriptEngine->registerGlobalObject("Joysticks", &JoystickScriptingInterface::getInstance()); |
| 3450 | 3466 | qScriptRegisterMetaType(scriptEngine, joystickToScriptValue, joystickFromScriptValue); |
| @@ -3746,10 +3762,6 @@ void Application::toggleLogDialog() { · 295 unmodified lines | ||
| 3746 | 3762 | } |
| 3747 | 3763 | } |
| 3748 | 3764 | |
| 3749 | −void Application::initAvatarAndViewFrustum() { | |
| 3750 | − updateMyAvatar(0.0f); | |
| 3751 | −} | |
| 3752 | − | |
| 3753 | 3765 | void Application::checkVersion() { |
| 3754 | 3766 | QNetworkRequest latestVersionRequest((QUrl(CHECK_VERSION_URL))); |
| 3755 | 3767 | latestVersionRequest.setHeader(QNetworkRequest::UserAgentHeader, HIGH_FIDELITY_USER_AGENT); |