From f66fd46b2da630962302cb5da7a5de006337a1b7 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Thu, 14 May 2020 07:51:08 +0000 Subject: Merged in SL-12090 (pull request #105) SL-12090 Initialize the joystick only when required * SL-12090 Initialize the joystick only when required Approved-by: Andrey Kleshchev --- indra/newview/llappviewer.cpp | 5 ++++- indra/newview/llfloaterjoystick.cpp | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 9382a367f7..79c0a8c8eb 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1131,7 +1131,10 @@ bool LLAppViewer::init() gSimLastTime = gRenderStartTime.getElapsedTimeF32(); gSimFrames = (F32)gFrameCount; - LLViewerJoystick::getInstance()->init(false); + if (gSavedSettings.getBOOL("JoystickEnabled")) + { + LLViewerJoystick::getInstance()->init(false); + } try { initializeSecHandler(); diff --git a/indra/newview/llfloaterjoystick.cpp b/indra/newview/llfloaterjoystick.cpp index ee3d633dd0..2b672bc890 100644 --- a/indra/newview/llfloaterjoystick.cpp +++ b/indra/newview/llfloaterjoystick.cpp @@ -61,6 +61,11 @@ static LLTrace::SampleStatHandle<>* sJoystickAxes[6] = LLFloaterJoystick::LLFloaterJoystick(const LLSD& data) : LLFloater(data) { + if (!LLViewerJoystick::getInstance()->isJoystickInitialized()) + { + LLViewerJoystick::getInstance()->init(false); + } + initFromSettings(); } -- cgit v1.2.3