shithub: cstory

Download patch

ref: b6398c58b476fd9577799c1b1695608fde0a36af
parent: ee1e7aed11f7c04f51a06d0942174f67734e8f9e
author: Clownacy <[email protected]>
date: Sat Apr 4 23:24:55 EDT 2020

Disable GLFW hats in <3.3

Doesn't exist - causes Travis to fail

--- a/src/Backends/GLFW3/Controller.cpp
+++ b/src/Backends/GLFW3/Controller.cpp
@@ -102,8 +102,10 @@
 	int total_axes;
 	const float *axes = glfwGetJoystickAxes(connected_joystick_id, &total_axes);
 
+#if GLFW_VERSION_MAJOR > 3 || (GLFW_VERSION_MAJOR == 3 && GLFW_VERSION_MINOR >= 3)
 	int total_hats;
 	const unsigned char *hats = glfwGetJoystickHats(connected_joystick_id, &total_hats);
+#endif
 
 	// Handle directional inputs
 	status->bLeft = axes[0] < axis_neutrals[0] - DEADZONE;
@@ -137,6 +139,7 @@
 			break;
 	}
 
+#if GLFW_VERSION_MAJOR > 3 || (GLFW_VERSION_MAJOR == 3 && GLFW_VERSION_MINOR >= 3)
 	// Then the joystick hats
 	for (int i = 0; i < total_axes; ++i)
 	{
@@ -160,6 +163,7 @@
 		if (++buttons_done >= button_limit)
 			break;
 	}
+#endif
 
 	// Blank any remaining buttons
 	for (size_t i = buttons_done; i < button_limit; ++i)