History

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

Stojce Slavkovski committed 12 years ago

Commit 550cf6b2 parents 27c2255 d84832659 files · +2148 −964Browse files

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

Unified · Split

interface/src/Application.cpp+44−1
@@ -356,6 +356,8 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 355 unmodified lines
356356 QMutexLocker locker(&_settingsMutex);
357357 _previousScriptLocation = _settings->value("LastScriptLocation", QVariant("")).toString();
358358 }
359+ //When -url in command line, teleport to location
360+ urlGoTo(argc, constArgv);
359361 }
360362
361363 Application::~Application() {
@@ -1679,8 +1681,12 @@ void Application::init() { · 1317 unmodified lines
16791681 _audioReflector.setMyAvatar(getAvatar());
16801682 _audioReflector.setVoxels(_voxels.getTree());
16811683 _audioReflector.setAudio(getAudio());
1684+ _audioReflector.setAvatarManager(&_avatarManager);
1685+
16821686 connect(getAudio(), &Audio::processInboundAudio, &_audioReflector, &AudioReflector::processInboundAudio,Qt::DirectConnection);
16831687 connect(getAudio(), &Audio::processLocalAudio, &_audioReflector, &AudioReflector::processLocalAudio,Qt::DirectConnection);
1688+ connect(getAudio(), &Audio::preProcessOriginalInboundAudio, &_audioReflector,
1689+ &AudioReflector::preProcessOriginalInboundAudio,Qt::DirectConnection);
16841690
16851691 // save settings when avatar changes
16861692 connect(_myAvatar, &MyAvatar::transformChanged, this, &Application::bumpSettings);
@@ -2728,7 +2734,7 @@ void Application::displayOverlay() { · 1041 unmodified lines
27282734 (Menu::getInstance()->isOptionChecked(MenuOption::Stats) &&
27292735 Menu::getInstance()->isOptionChecked(MenuOption::Bandwidth))
27302736 ? 80 : 20;
2731− drawText(_glWidget->width() - 100, _glWidget->height() - timerBottom, 0.30f, 1.0f, 0.f, frameTimer, WHITE_TEXT);
2737+ drawText(_glWidget->width() - 100, _glWidget->height() - timerBottom, 0.30f, 0.0f, 0, frameTimer, WHITE_TEXT);
27322738 }
27332739
27342740 _overlays.render2D();
@@ -3020,6 +3026,7 @@ void Application::resetSensors() { · 285 unmodified lines
30203026 _mouseX = _glWidget->width() / 2;
30213027 _mouseY = _glWidget->height() / 2;
30223028
3029+ _faceplus.reset();
30233030 _faceshift.reset();
30243031 _visage.reset();
30253032
@@ -3397,6 +3404,7 @@ void Application::loadScript(const QString& scriptName) { · 371 unmodified lines
33973404 scriptEngine->registerGlobalObject("Menu", MenuScriptingInterface::getInstance());
33983405 scriptEngine->registerGlobalObject("Settings", SettingsScriptingInterface::getInstance());
33993406 scriptEngine->registerGlobalObject("AudioDevice", AudioDeviceScriptingInterface::getInstance());
3407+ scriptEngine->registerGlobalObject("AnimationCache", &_animationCache);
34003408 scriptEngine->registerGlobalObject("AudioReflector", &_audioReflector);
34013409
34023410 QThread* workerThread = new QThread(this);
@@ -3570,3 +3578,38 @@ void Application::takeSnapshot() { · 167 unmodified lines
35703578 }
35713579 _snapshotShareDialog->exec();
35723580 }
3581+
3582+void Application::urlGoTo(int argc, const char * constArgv[]) {
3583+ //Gets the url (hifi://domain/destination/orientation)
3584+ QString customUrl = getCmdOption(argc, constArgv, "-url");
3585+
3586+ if (customUrl.startsWith("hifi://")) {
3587+ QStringList urlParts = customUrl.remove(0, CUSTOM_URL_SCHEME.length() + 2).split('/', QString::SkipEmptyParts);
3588+ if (urlParts.count() > 1) {
3589+ // if url has 2 or more parts, the first one is domain name
3590+ QString domain = urlParts[0];
3591+
3592+ // second part is either a destination coordinate or
3593+ // a place name
3594+ QString destination = urlParts[1];
3595+
3596+ // any third part is an avatar orientation.
3597+ QString orientation = urlParts.count() > 2 ? urlParts[2] : QString();
3598+
3599+ Menu::goToDomain(domain);
3600+
3601+ // goto either @user, #place, or x-xx,y-yy,z-zz
3602+ // style co-ordinate.
3603+ Menu::goTo(destination);
3604+
3605+ if (!orientation.isEmpty()) {
3606+ // location orientation
3607+ Menu::goToOrientation(orientation);
3608+ }
3609+ } else if (urlParts.count() == 1) {
3610+ // location coordinates or place name
3611+ QString destination = urlParts[0];
3612+ Menu::goTo(destination);
3613+ }
3614+ }
3615+}

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