History

Merge branch 'master' into out-of-body-experience

Anthony J. Thibault committed 10 years ago

Commit aab974e2 parents eccd01e 60aff4441 files · +1014 −356Browse files

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

Unified · Split

interface/src/Application.cpp+29−4
@@ -68,6 +68,7 @@ · 67 unmodified lines
6868 #include <InfoView.h>
6969 #include <input-plugins/InputPlugin.h>
7070 #include <controllers/UserInputMapper.h>
71+#include <controllers/ScriptingInterface.h>
7172 #include <controllers/StateController.h>
7273 #include <UserActivityLoggerScriptingInterface.h>
7374 #include <LogHandler.h>
@@ -814,7 +815,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 740 unmodified lines
814815 { "gl_version", glContextData["version"] },
815816 { "gl_vender", glContextData["vendor"] },
816817 { "gl_sl_version", glContextData["slVersion"] },
817− { "gl_renderer", glContextData["renderer"] }
818+ { "gl_renderer", glContextData["renderer"] },
819+ { "ideal_thread_count", QThread::idealThreadCount() }
818820 };
819821 auto macVersion = QSysInfo::macVersion();
820822 if (macVersion != QSysInfo::MV_None) {
@@ -824,6 +826,16 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 3 unmodified lines
824826 if (windowsVersion != QSysInfo::WV_None) {
825827 properties["os_win_version"] = QSysInfo::windowsVersion();
826828 }
829+
830+ ProcessorInfo procInfo;
831+ if (getProcessorInfo(procInfo)) {
832+ properties["processor_core_count"] = procInfo.numProcessorCores;
833+ properties["logical_processor_count"] = procInfo.numLogicalProcessors;
834+ properties["processor_l1_cache_count"] = procInfo.numProcessorCachesL1;
835+ properties["processor_l2_cache_count"] = procInfo.numProcessorCachesL2;
836+ properties["processor_l3_cache_count"] = procInfo.numProcessorCachesL3;
837+ }
838+
827839 UserActivityLogger::getInstance().logAction("launch", properties);
828840
829841 _connectionMonitor.init();
@@ -1122,6 +1134,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 292 unmodified lines
11221134 auto displayPlugin = qApp->getActiveDisplayPlugin();
11231135
11241136 properties["fps"] = _frameCounter.rate();
1137+ properties["target_frame_rate"] = getTargetFrameRate();
11251138 properties["present_rate"] = displayPlugin->presentRate();
11261139 properties["new_frame_present_rate"] = displayPlugin->newFramePresentRate();
11271140 properties["dropped_frame_rate"] = displayPlugin->droppedFrameRate();
@@ -1163,6 +1176,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 35 unmodified lines
11631176 properties["deleted_entity_cnt"] = entityActivityTracking.deletedEntityCount;
11641177 properties["edited_entity_cnt"] = entityActivityTracking.editedEntityCount;
11651178
1179+ properties["active_display_plugin"] = getActiveDisplayPlugin()->getName();
1180+ properties["using_hmd"] = isHMDMode();
1181+
11661182 auto hmdHeadPose = getHMDSensorPose();
11671183 properties["hmd_head_pose_changed"] = isHMDMode() && (hmdHeadPose != lastHMDHeadPose);
11681184 lastHMDHeadPose = hmdHeadPose;
@@ -2169,7 +2185,7 @@ bool Application::event(QEvent* event) { · 1000 unmodified lines
21692185 // handle custom URL
21702186 if (event->type() == QEvent::FileOpen) {
21712187
2172− QFileOpenEvent* fileEvent = static_cast<QFileOpenEvent*>(event);
2188+ QFileOpenEvent* fileEvent = static_cast<QFileOpenEvent*>(event);
21732189
21742190 QUrl url = fileEvent->url();
21752191
@@ -4353,8 +4369,13 @@ namespace render { · 2177 unmodified lines
43534369 auto scene = DependencyManager::get<SceneScriptingInterface>()->getStage();
43544370 auto sceneKeyLight = scene->getKeyLight();
43554371 auto defaultSkyboxAmbientTexture = qApp->getDefaultSkyboxAmbientTexture();
4356− sceneKeyLight->setAmbientSphere(defaultSkyboxAmbientTexture->getIrradiance());
4357− sceneKeyLight->setAmbientMap(defaultSkyboxAmbientTexture);
4372+ if (defaultSkyboxAmbientTexture) {
4373+ sceneKeyLight->setAmbientSphere(defaultSkyboxAmbientTexture->getIrradiance());
4374+ sceneKeyLight->setAmbientMap(defaultSkyboxAmbientTexture);
4375+ } else {
4376+ static QString repeatedMessage = LogHandler::getInstance().addRepeatedMessageRegex(
4377+ "Failed to get a valid Default Skybox Ambient Texture ? probably because it couldn't be find during initialization step");
4378+ }
43584379 // fall through: render defaults skybox
43594380 } else {
43604381 break;
@@ -4911,6 +4932,10 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scri · 550 unmodified lines
49114932 scriptEngine->registerGlobalObject("Users", DependencyManager::get<UsersScriptingInterface>().data());
49124933
49134934 scriptEngine->registerGlobalObject("Steam", new SteamScriptingInterface(scriptEngine));
4935+
4936+ auto scriptingInterface = DependencyManager::get<controller::ScriptingInterface>();
4937+ scriptEngine->registerGlobalObject("Controller", scriptingInterface.data());
4938+ UserInputMapper::registerControllerTypes(scriptEngine);
49144939 }
49154940
49164941 bool Application::canAcceptURL(const QString& urlString) const {