1.1 --- a/include/SDL_gamecontroller.h Mon Dec 02 23:54:35 2013 -0800
1.2 +++ b/include/SDL_gamecontroller.h Tue Dec 03 12:01:28 2013 -0300
1.3 @@ -109,12 +109,21 @@
1.4 */
1.5
1.6 /**
1.7 - * Load a set of mappings from a file, filtered by the current SDL_GetPlatform()
1.8 + * Load a set of mappings from a seekable SDL data stream (memory or file), filtered by the current SDL_GetPlatform()
1.9 * A community sourced database of controllers is available at https://raw.github.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt
1.10 *
1.11 + * If \c freerw is non-zero, the stream will be closed after being read.
1.12 + *
1.13 * \return number of mappings added, -1 on error
1.14 */
1.15 -extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromFile( const char* mapDB );
1.16 +extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW( SDL_RWops * rw, int freerw );
1.17 +
1.18 +/**
1.19 + * Load a set of mappings from a file, filtered by the current SDL_GetPlatform()
1.20 + *
1.21 + * Convenience macro.
1.22 + */
1.23 +#define SDL_GameControllerAddMappingsFromFile(file) SDL_GameControllerAddMappingsFromRW(SDL_RWFromFile(file, "rb"), 1)
1.24
1.25 /**
1.26 * Add or update an existing mapping configuration