@@ -225,6 +225,11 @@ InputDevice* InputManager::touch()
return _touch;
}
+uint8_t InputManager::num_joypads()
+{
+ return CE_COUNTOF(_joypad);
+}
+
InputDevice* InputManager::joypad(uint8_t i)
{
CE_ASSERT(i < CROWN_MAX_JOYPADS, "Index out of bounds");
@@ -31,6 +31,9 @@ public:
/// Returns the default touch input device.
InputDevice* touch();
+ /// Returns the number of joypads.
+ uint8_t num_joypads();
/// Returns the joypad @a i.
InputDevice* joypad(uint8_t i);