@@ -42,7 +42,6 @@ import Control.Monad.Trans.Maybe (runMaybeT)
4242import Data.Data (Data )
4343import Data.Int
4444import Data.Text (Text )
45- import Data.Traversable (for )
4645import Data.Typeable
4746import Data.Word
4847import Foreign.C (withCString )
@@ -85,10 +84,10 @@ data ControllerDevice = ControllerDevice
8584 See @<https://wiki.libsdl.org/SDL2/SDL_IsGameController SDL_IsGameController>@ for C documentation.
8685-}
8786isGameController :: MonadIO m => JoystickIndex -> m Bool
88- isGameController = Raw. isGameController . fromIntegral
87+ isGameController = Raw. isGameController
8988
90- {- | Create a 'ControllerDevice' from a 'Raw.JoystickID '. Returns 'Nothing' if
91- the 'Raw.JoystickID ' does not support the game controller interface.
89+ {- | Create a 'ControllerDevice' from a 'JoystickIndex '. Returns 'Nothing' if
90+ the 'JoystickIndex ' does not support the game controller interface.
9291-}
9392mkControllerDevice :: MonadIO m => JoystickIndex -> m (Maybe ControllerDevice )
9493mkControllerDevice i = runMaybeT $ do
@@ -102,7 +101,7 @@ mkControllerDevice i = runMaybeT $ do
102101mkControllerDevice' :: MonadIO m => JoystickIndex -> m ControllerDevice
103102mkControllerDevice' i = do
104103 cstr <- liftIO $
105- throwIfNull " SDL.Input.Controller.availableGameControllers " " SDL_GameControllerNameForIndex" $
104+ throwIfNull " SDL.Input.GameController.mkControllerDevice' " " SDL_GameControllerNameForIndex" $
106105 Raw. gameControllerNameForIndex (fromIntegral i)
107106 name <- liftIO $ Text. decodeUtf8 <$> BS. packCString cstr
108107 return (ControllerDevice name i)
0 commit comments