}
}
// Controller buttons
if (controllers) {
Controller c;
for (int i = 0; i < GAMEPAD_MAX; i++) {
c = Controllers.getController(i);
for (int j = 0; j < GAMEPAD_BUTTON_MAX[i]; j++) {
if (c.isButtonPressed(j)) {
if (aGButton[i][j] == RELEASED || aGButton[i][j] == JUST_RELEASED) {
aGButton[i][j] = JUST_PRESSED;
lastGButton[i] = j;
} else if (aGButton[i][j] == JUST_PRESSED) {
aGButton[i][j] = PRESSED;
}
} else {
if (aGButton[i][j] == PRESSED || aGButton[i][j] == JUST_PRESSED) {
aGButton[i][j] = JUST_RELEASED;
} else if (aGButton[i][j] == JUST_RELEASED) {
aGButton[i][j] = RELEASED;
}
}
}
for (int j = 0; j < GAMEPAD_AXIS_MAX[i]; j++) {
apGAxis[i][j] = aGAxis[i][j];
aGAxis[i][j] = c.getAxisValue(j);
if (apGAxis[i][j] < 0.75f && aGAxis[i][j] >= 0.75f) {
lastGAxis[i] = j;
lastGAxisPos[i] = true;
} else if (apGAxis[i][j] > -0.75f && aGAxis[i][j] <= -0.75f) {
lastGAxis[i] = j;