History

Merge branch 'master' of https://github.com/worklist/hifi into 20224

Thijs Wenker committed 11 years ago

Commit 6bad7a62 parents 5de4f8f 4a2a9f965 files · +1690 −576Browse files

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

Unified · Split

interface/src/Application.cpp+56−14
@@ -339,6 +339,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 338 unmodified lines
339339 // use our MyAvatar position and quat for address manager path
340340 addressManager->setPositionGetter(getPositionForPath);
341341 addressManager->setOrientationGetter(getOrientationForPath);
342+
343+ connect(addressManager.data(), &AddressManager::rootPlaceNameChanged, this, &Application::updateWindowTitle);
342344
343345 _settings = new QSettings(this);
344346 _numChangedSettings = 0;
@@ -917,13 +919,6 @@ void Application::keyPressEvent(QKeyEvent* event) { · 572 unmodified lines
917919 Menu::getInstance()->triggerOption(MenuOption::Chat);
918920 break;
919921
920− case Qt::Key_N:
921− if (isMeta) {
922− Menu::getInstance()->triggerOption(MenuOption::NameLocation);
923− }
924−
925− break;
926−
927922 case Qt::Key_Up:
928923 if (_myCamera.getMode() == CAMERA_MODE_MIRROR) {
929924 if (!isShifted) {
@@ -2803,7 +2798,7 @@ void Application::displaySide(Camera& theCamera, bool selfAvatarOnly, RenderArgs · 1873 unmodified lines
28032798 }
28042799 glEnable(GL_LIGHTING);
28052800 glEnable(GL_DEPTH_TEST);
2806−
2801+
28072802 DependencyManager::get<DeferredLightingEffect>()->prepare();
28082803
28092804 if (!selfAvatarOnly) {
@@ -2854,6 +2849,8 @@ void Application::displaySide(Camera& theCamera, bool selfAvatarOnly, RenderArgs · 44 unmodified lines
28542849
28552850
28562851 {
2852+ DependencyManager::get<DeferredLightingEffect>()->setAmbientLightMode(getRenderAmbientLight());
2853+
28572854 PROFILE_RANGE("DeferredLighting");
28582855 PerformanceTimer perfTimer("lighting");
28592856 DependencyManager::get<DeferredLightingEffect>()->render();
@@ -3152,8 +3149,14 @@ void Application::updateWindowTitle(){ · 292 unmodified lines
31523149
31533150 QString connectionStatus = nodeList->getDomainHandler().isConnected() ? "" : " (NOT CONNECTED) ";
31543151 QString username = AccountManager::getInstance().getAccountInfo().getUsername();
3152+ QString currentPlaceName = DependencyManager::get<AddressManager>()->getRootPlaceName();
3153+
3154+ if (currentPlaceName.isEmpty()) {
3155+ currentPlaceName = nodeList->getDomainHandler().getHostname();
3156+ }
3157+
31553158 QString title = QString() + (!username.isEmpty() ? username + " @ " : QString())
3156− + DependencyManager::get<AddressManager>()->getCurrentDomain() + connectionStatus + buildVersion;
3159+ + currentPlaceName + connectionStatus + buildVersion;
31573160
31583161 #ifndef WIN32
31593162 // crashes with vs2013/win32
@@ -3165,23 +3168,34 @@ void Application::updateWindowTitle(){ · 5 unmodified lines
31653168 void Application::updateLocationInServer() {
31663169
31673170 AccountManager& accountManager = AccountManager::getInstance();
3171+ auto addressManager = DependencyManager::get<AddressManager>();
31683172 DomainHandler& domainHandler = DependencyManager::get<NodeList>()->getDomainHandler();
31693173
3170− if (accountManager.isLoggedIn() && domainHandler.isConnected() && !domainHandler.getUUID().isNull()) {
3174+ if (accountManager.isLoggedIn() && domainHandler.isConnected()
3175+ && (!addressManager->getRootPlaceID().isNull() || !domainHandler.getUUID().isNull())) {
31713176
31723177 // construct a QJsonObject given the user's current address information
31733178 QJsonObject rootObject;
31743179
31753180 QJsonObject locationObject;
31763181
3177− QString pathString = DependencyManager::get<AddressManager>()->currentPath();
3182+ QString pathString = addressManager->currentPath();
31783183
31793184 const QString LOCATION_KEY_IN_ROOT = "location";
3180− const QString PATH_KEY_IN_LOCATION = "path";
3181− const QString DOMAIN_ID_KEY_IN_LOCATION = "domain_id";
31823185
3186+ const QString PATH_KEY_IN_LOCATION = "path";
31833187 locationObject.insert(PATH_KEY_IN_LOCATION, pathString);
3184− locationObject.insert(DOMAIN_ID_KEY_IN_LOCATION, domainHandler.getUUID().toString());
3188+
3189+ if (!addressManager->getRootPlaceID().isNull()) {
3190+ const QString PLACE_ID_KEY_IN_LOCATION = "place_id";
3191+ locationObject.insert(PLACE_ID_KEY_IN_LOCATION,
3192+ uuidStringWithoutCurlyBraces(addressManager->getRootPlaceID()));
3193+
3194+ } else {
3195+ const QString DOMAIN_ID_KEY_IN_LOCATION = "domain_id";
3196+ locationObject.insert(DOMAIN_ID_KEY_IN_LOCATION,
3197+ uuidStringWithoutCurlyBraces(domainHandler.getUUID()));
3198+ }
31853199
31863200 rootObject.insert(LOCATION_KEY_IN_ROOT, locationObject);
31873201
@@ -3966,3 +3980,31 @@ float Application::getRenderResolutionScale() const { · 778 unmodified lines
39663980 return 1.0f;
39673981 }
39683982 }
3983+
3984+int Application::getRenderAmbientLight() const {
3985+ if (Menu::getInstance()->isOptionChecked(MenuOption::RenderAmbientLightGlobal)) {
3986+ return -1;
3987+ } else if (Menu::getInstance()->isOptionChecked(MenuOption::RenderAmbientLight0)) {
3988+ return 0;
3989+ } else if (Menu::getInstance()->isOptionChecked(MenuOption::RenderAmbientLight1)) {
3990+ return 1;
3991+ } else if (Menu::getInstance()->isOptionChecked(MenuOption::RenderAmbientLight2)) {
3992+ return 2;
3993+ } else if (Menu::getInstance()->isOptionChecked(MenuOption::RenderAmbientLight3)) {
3994+ return 3;
3995+ } else if (Menu::getInstance()->isOptionChecked(MenuOption::RenderAmbientLight4)) {
3996+ return 4;
3997+ } else if (Menu::getInstance()->isOptionChecked(MenuOption::RenderAmbientLight5)) {
3998+ return 5;
3999+ } else if (Menu::getInstance()->isOptionChecked(MenuOption::RenderAmbientLight6)) {
4000+ return 6;
4001+ } else if (Menu::getInstance()->isOptionChecked(MenuOption::RenderAmbientLight7)) {
4002+ return 7;
4003+ } else if (Menu::getInstance()->isOptionChecked(MenuOption::RenderAmbientLight8)) {
4004+ return 8;
4005+ } else if (Menu::getInstance()->isOptionChecked(MenuOption::RenderAmbientLight9)) {
4006+ return 9;
4007+ } else {
4008+ return -1;
4009+ }
4010+}

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