Compare commits

..

No commits in common. "a7c04018cf9af5808f2a3a8292223fb858b75777" and "c5f50ddb3261cca857f220440313df80010291bd" have entirely different histories.

3 changed files with 6 additions and 26 deletions

View File

@ -173,7 +173,6 @@ LTRIGGER
RTRIGGER
LJOY
RJOY
DPAD

View File

@ -57,7 +57,7 @@ const char *Steam_Apps::GetAvailableGameLanguages()
{
PRINT_DEBUG("GetAvailableGameLanguages\n");
//TODO?
return settings->get_language();
return "";
}

View File

@ -77,7 +77,6 @@ enum EXTRA_GAMEPAD_BUTTONS {
};
#define JOY_ID_START 10
#define STICK_DPAD 3
class Steam_Controller :
public ISteamController001,
@ -127,7 +126,6 @@ public ISteamInput
{"RTRIGGER", TRIGGER_RIGHT},
{"LJOY", STICK_LEFT + JOY_ID_START},
{"RJOY", STICK_RIGHT + JOY_ID_START},
{"DPAD", STICK_DPAD + JOY_ID_START},
};
std::map<std::string, enum EInputSourceMode> analog_input_modes = {
@ -617,8 +615,6 @@ ControllerAnalogActionHandle_t GetAnalogActionHandle( const char *pszActionName
ControllerAnalogActionData_t GetAnalogActionData( ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle )
{
PRINT_DEBUG("Steam_Controller::GetAnalogActionData %llu %llu\n", controllerHandle, analogActionHandle);
GAMEPAD_DEVICE device = (GAMEPAD_DEVICE)(controllerHandle - 1);
ControllerAnalogActionData_t data;
data.eMode = k_EInputSourceMode_None;
data.x = data.y = 0;
@ -636,24 +632,12 @@ ControllerAnalogActionData_t GetAnalogActionData( ControllerHandle_t controllerH
for (auto a : analog.first) {
if (a >= JOY_ID_START) {
int joystick_id = a - JOY_ID_START;
if (joystick_id == STICK_DPAD) {
int mov_y = (int)GamepadButtonDown(device, BUTTON_DPAD_UP) - (int)GamepadButtonDown(device, BUTTON_DPAD_DOWN);
int mov_x = (int)GamepadButtonDown(device, BUTTON_DPAD_RIGHT) - (int)GamepadButtonDown(device, BUTTON_DPAD_LEFT);
if (mov_y || mov_x) {
data.x = mov_x;
data.y = mov_y;
double length = 1.0 / std::sqrt(data.x * data.x + data.y * data.y);
data.x = data.x * length;
data.y = data.y * length;
}
} else {
GamepadStickNormXY(device, (GAMEPAD_STICK) joystick_id, &data.x, &data.y);
float length = GamepadStickLength(device, (GAMEPAD_STICK) joystick_id);
data.x = data.x * length;
data.y = data.y * length;
}
GamepadStickNormXY((GAMEPAD_DEVICE)(controllerHandle - 1), (GAMEPAD_STICK) joystick_id, &data.x, &data.y);
float length = GamepadStickLength((GAMEPAD_DEVICE)(controllerHandle - 1), (GAMEPAD_STICK) joystick_id);
data.x = data.x * length;
data.y = data.y * length;
} else {
data.x = GamepadTriggerLength(device, (GAMEPAD_TRIGGER) a);
data.x = GamepadTriggerLength((GAMEPAD_DEVICE)(controllerHandle - 1), (GAMEPAD_TRIGGER) a);
}
if (data.x || data.y) {
@ -706,9 +690,6 @@ int GetAnalogActionOrigins( InputHandle_t inputHandle, InputActionSetHandle_t ac
case STICK_RIGHT + JOY_ID_START:
originsOut[count] = k_EInputActionOrigin_XBox360_RightStick_Move;
break;
case STICK_DPAD + JOY_ID_START:
originsOut[count] = k_EInputActionOrigin_XBox360_DPad_Move;
break;
default:
originsOut[count] = k_EInputActionOrigin_None;
break;