瀏覽代碼

Fix off by one bug with GetGamepadAxisCount on PLATFORM_DESKTOP (#1715)

- Found testing core_input_gamepad. The last axis was not drawn.
- GLFW_GAMEPAD_AXIS_LAST is defined to the last axis which is 5
not the total number which is 6.
pull/1717/head
Chris 3 年之前
committed by GitHub
父節點
當前提交
3cdac3e11e
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. +1
    -1
      src/core.c

+ 1
- 1
src/core.c 查看文件

@ -4735,7 +4735,7 @@ static void PollInputEvents(void)
CORE.Input.Gamepad.currentState[i][GAMEPAD_BUTTON_LEFT_TRIGGER_2] = (char)(CORE.Input.Gamepad.axisState[i][GAMEPAD_AXIS_LEFT_TRIGGER] > 0.1);
CORE.Input.Gamepad.currentState[i][GAMEPAD_BUTTON_RIGHT_TRIGGER_2] = (char)(CORE.Input.Gamepad.axisState[i][GAMEPAD_AXIS_RIGHT_TRIGGER] > 0.1);
CORE.Input.Gamepad.axisCount = GLFW_GAMEPAD_AXIS_LAST;
CORE.Input.Gamepad.axisCount = GLFW_GAMEPAD_AXIS_LAST + 1;
}
}

Loading…
取消
儲存