Added love.joystick.loadGamepadMappings (resolves issue #842), and Joystick:saveGamepadMapping.

The latter returns a mapping string, and the former loads a newline-separated list of mapping strings.
This commit is contained in:
Alex Szpakowski
2014-06-04 15:50:06 -03:00
parent dfa319e01a
commit 79b453653a
14 changed files with 166 additions and 35 deletions
+4
View File
@@ -486,6 +486,10 @@ int luax_getfunction(lua_State *L, const char *mod, const char *fn)
int luax_convobj(lua_State *L, int idx, const char *mod, const char *fn)
{
// Convert to absolute index if necessary.
if (idx < 0 && idx > LUA_REGISTRYINDEX)
idx += lua_gettop(L) + 1;
// Convert string to a file.
luax_getfunction(L, mod, fn);
lua_pushvalue(L, idx); // The initial argument.