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
meow-7.2.2
Andrey Lihatskiy 2020-05-14 07:51:08 +00:00 committed by Andrey Kleshchev
parent 8bc8b1cfd6
commit f66fd46b2d
2 changed files with 9 additions and 1 deletions

View File

@ -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();

View File

@ -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();
}