Showing the changes to interface/src/Application.cpp (1 of 18 files). Show all
Unified · Split
| @@ -90,9 +90,10 @@ · 89 unmodified lines | ||
| 90 | 90 | #include <PerfStat.h> |
| 91 | 91 | #include <PhysicsEngine.h> |
| 92 | 92 | #include <PhysicsHelpers.h> |
| 93 | +#include <plugins/CodecPlugin.h> | |
| 93 | 94 | #include <plugins/PluginManager.h> |
| 94 | 95 | #include <plugins/PluginUtils.h> |
| 95 | −#include <plugins/CodecPlugin.h> | |
| 96 | +#include <plugins/SteamClientPlugin.h> | |
| 96 | 97 | #include <RecordingScriptingInterface.h> |
| 97 | 98 | #include <RenderableWebEntityItem.h> |
| 98 | 99 | #include <RenderShadowTask.h> |
| @@ -103,7 +104,6 @@ · 4 unmodified lines | ||
| 103 | 104 | #include <ScriptEngines.h> |
| 104 | 105 | #include <ScriptCache.h> |
| 105 | 106 | #include <SoundCache.h> |
| 106 | −#include <steamworks-wrapper/SteamClient.h> | |
| 107 | 107 | #include <Tooltip.h> |
| 108 | 108 | #include <udt/PacketHeaders.h> |
| 109 | 109 | #include <UserActivityLogger.h> |
| @@ -421,6 +421,10 @@ bool setupEssentials(int& argc, char** argv) { · 311 unmodified lines | ||
| 421 | 421 | |
| 422 | 422 | Setting::preInit(); |
| 423 | 423 | |
| 424 | + if (auto steamClient = PluginManager::getInstance()->getSteamClientPlugin()) { | |
| 425 | + steamClient->init(); | |
| 426 | + } | |
| 427 | + | |
| 424 | 428 | #if defined(Q_OS_WIN) |
| 425 | 429 | // Select appropriate audio DLL |
| 426 | 430 | QString audioDLLPath = QCoreApplication::applicationDirPath(); |
| @@ -551,7 +555,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 124 unmodified lines | ||
| 551 | 555 | _maxOctreePPS(maxOctreePacketsPerSecond.get()), |
| 552 | 556 | _lastFaceTrackerUpdate(0) |
| 553 | 557 | { |
| 554 | − setProperty(hifi::properties::STEAM, SteamClient::isRunning()); | |
| 558 | + auto steamClient = PluginManager::getInstance()->getSteamClientPlugin(); | |
| 559 | + setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning())); | |
| 555 | 560 | setProperty(hifi::properties::CRASHED, _previousSessionCrashed); |
| 556 | 561 | |
| 557 | 562 | { |
| @@ -606,7 +611,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 48 unmodified lines | ||
| 606 | 611 | _deadlockWatchdogThread = new DeadlockWatchdogThread(); |
| 607 | 612 | _deadlockWatchdogThread->start(); |
| 608 | 613 | |
| 609 | − qCDebug(interfaceapp) << "[VERSION] SteamVR buildID:" << SteamClient::getSteamVRBuildID(); | |
| 614 | + if (steamClient) { | |
| 615 | + qCDebug(interfaceapp) << "[VERSION] SteamVR buildID:" << steamClient->getSteamVRBuildID(); | |
| 616 | + } | |
| 610 | 617 | qCDebug(interfaceapp) << "[VERSION] Build sequence:" << qPrintable(applicationVersion()); |
| 611 | 618 | qCDebug(interfaceapp) << "[VERSION] MODIFIED_ORGANIZATION:" << BuildInfo::MODIFIED_ORGANIZATION; |
| 612 | 619 | qCDebug(interfaceapp) << "[VERSION] VERSION:" << BuildInfo::VERSION; |
| @@ -1695,6 +1702,10 @@ Application::~Application() { · 1082 unmodified lines | ||
| 1695 | 1702 | |
| 1696 | 1703 | Leapmotion::destroy(); |
| 1697 | 1704 | |
| 1705 | + if (auto steamClient = PluginManager::getInstance()->getSteamClientPlugin()) { | |
| 1706 | + steamClient->shutdown(); | |
| 1707 | + } | |
| 1708 | + | |
| 1698 | 1709 | #if 0 |
| 1699 | 1710 | ConnexionClient::getInstance().destroy(); |
| 1700 | 1711 | #endif |
| @@ -1874,8 +1885,10 @@ void Application::initializeUi() { · 173 unmodified lines | ||
| 1874 | 1885 | |
| 1875 | 1886 | rootContext->setContextProperty("ApplicationCompositor", &getApplicationCompositor()); |
| 1876 | 1887 | |
| 1877 | − rootContext->setContextProperty("Steam", new SteamScriptingInterface(engine)); | |
| 1878 | − | |
| 1888 | + if (auto steamClient = PluginManager::getInstance()->getSteamClientPlugin()) { | |
| 1889 | + rootContext->setContextProperty("Steam", new SteamScriptingInterface(engine, steamClient.get())); | |
| 1890 | + } | |
| 1891 | + | |
| 1879 | 1892 | |
| 1880 | 1893 | _glWidget->installEventFilter(offscreenUi.data()); |
| 1881 | 1894 | offscreenUi->setMouseTranslator([=](const QPointF& pt) { |
| @@ -3201,7 +3214,9 @@ void Application::idle(float nsecsElapsed) { · 1319 unmodified lines | ||
| 3201 | 3214 | |
| 3202 | 3215 | PROFILE_RANGE(__FUNCTION__); |
| 3203 | 3216 | |
| 3204 | − SteamClient::runCallbacks(); | |
| 3217 | + if (auto steamClient = PluginManager::getInstance()->getSteamClientPlugin()) { | |
| 3218 | + steamClient->runCallbacks(); | |
| 3219 | + } | |
| 3205 | 3220 | |
| 3206 | 3221 | float secondsSinceLastUpdate = nsecsElapsed / NSECS_PER_MSEC / MSECS_PER_SECOND; |
| 3207 | 3222 | |
| @@ -3533,12 +3548,16 @@ void Application::init() { · 325 unmodified lines | ||
| 3533 | 3548 | |
| 3534 | 3549 | _timerStart.start(); |
| 3535 | 3550 | _lastTimeUpdated.start(); |
| 3536 | − // when +connect_lobby in command line, join steam lobby | |
| 3537 | − const QString STEAM_LOBBY_COMMAND_LINE_KEY = "+connect_lobby"; | |
| 3538 | − int lobbyIndex = arguments().indexOf(STEAM_LOBBY_COMMAND_LINE_KEY); | |
| 3539 | − if (lobbyIndex != -1) { | |
| 3540 | − QString lobbyId = arguments().value(lobbyIndex + 1); | |
| 3541 | − SteamClient::joinLobby(lobbyId); | |
| 3551 | + | |
| 3552 | + | |
| 3553 | + if (auto steamClient = PluginManager::getInstance()->getSteamClientPlugin()) { | |
| 3554 | + // when +connect_lobby in command line, join steam lobby | |
| 3555 | + const QString STEAM_LOBBY_COMMAND_LINE_KEY = "+connect_lobby"; | |
| 3556 | + int lobbyIndex = arguments().indexOf(STEAM_LOBBY_COMMAND_LINE_KEY); | |
| 3557 | + if (lobbyIndex != -1) { | |
| 3558 | + QString lobbyId = arguments().value(lobbyIndex + 1); | |
| 3559 | + steamClient->joinLobby(lobbyId); | |
| 3560 | + } | |
| 3542 | 3561 | } |
| 3543 | 3562 | |
| 3544 | 3563 | |
| @@ -5193,8 +5212,9 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scri · 1648 unmodified lines | ||
| 5193 | 5212 | scriptEngine->registerGlobalObject("UserActivityLogger", DependencyManager::get<UserActivityLoggerScriptingInterface>().data()); |
| 5194 | 5213 | scriptEngine->registerGlobalObject("Users", DependencyManager::get<UsersScriptingInterface>().data()); |
| 5195 | 5214 | |
| 5196 | − scriptEngine->registerGlobalObject("Steam", new SteamScriptingInterface(scriptEngine)); | |
| 5197 | − | |
| 5215 | + if (auto steamClient = PluginManager::getInstance()->getSteamClientPlugin()) { | |
| 5216 | + scriptEngine->registerGlobalObject("Steam", new SteamScriptingInterface(scriptEngine, steamClient.get())); | |
| 5217 | + } | |
| 5198 | 5218 | auto scriptingInterface = DependencyManager::get<controller::ScriptingInterface>(); |
| 5199 | 5219 | scriptEngine->registerGlobalObject("Controller", scriptingInterface.data()); |
| 5200 | 5220 | UserInputMapper::registerControllerTypes(scriptEngine); |