Changeset View
Changeset View
Standalone View
Standalone View
source/ps/Joystick.cpp
/* Copyright (C) 2014 Wildfire Games. | /* Copyright (C) 2021 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
Show All 18 Lines | |||||
CJoystick::CJoystick() : | CJoystick::CJoystick() : | ||||
m_Joystick(NULL), m_Deadzone(0) | m_Joystick(NULL), m_Deadzone(0) | ||||
{ | { | ||||
} | } | ||||
void CJoystick::Initialise() | void CJoystick::Initialise() | ||||
{ | { | ||||
bool joystickEnable = false; | bool joystickEnable = false; | ||||
if (!CConfigDB::IsInitialised()) | |||||
return; | |||||
CFG_GET_VAL("joystick.enable", joystickEnable); | CFG_GET_VAL("joystick.enable", joystickEnable); | ||||
if (!joystickEnable) | if (!joystickEnable) | ||||
return; | return; | ||||
CFG_GET_VAL("joystick.deadzone", m_Deadzone); | CFG_GET_VAL("joystick.deadzone", m_Deadzone); | ||||
if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) < 0) | if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) < 0) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator