mirror of
https://github.com/love2d/love-android.git
synced 2026-08-19 20:20:25 +02:00
Using latest changeset 593639000823 of love-android
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2006-2014 LOVE Development Team
|
||||
* Copyright (c) 2006-2015 LOVE Development Team
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2006-2014 LOVE Development Team
|
||||
* Copyright (c) 2006-2015 LOVE Development Team
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2006-2014 LOVE Development Team
|
||||
* Copyright (c) 2006-2015 LOVE Development Team
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2006-2014 LOVE Development Team
|
||||
* Copyright (c) 2006-2015 LOVE Development Team
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2006-2014 LOVE Development Team
|
||||
* Copyright (c) 2006-2015 LOVE Development Team
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2006-2014 LOVE Development Team
|
||||
* Copyright (c) 2006-2015 LOVE Development Team
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
@@ -489,6 +489,10 @@ void JoystickModule::loadGamepadMappings(const std::string &mappings)
|
||||
if (mapping.empty())
|
||||
continue;
|
||||
|
||||
// Lines starting with "#" are comments.
|
||||
if (mapping[0] == '#')
|
||||
continue;
|
||||
|
||||
// Strip out and compare any "platform:XYZ," in the mapping.
|
||||
size_t pstartpos = mapping.find("platform:");
|
||||
if (pstartpos != std::string::npos)
|
||||
@@ -499,7 +503,11 @@ void JoystickModule::loadGamepadMappings(const std::string &mappings)
|
||||
std::string platform = mapping.substr(pstartpos, pendpos - pstartpos);
|
||||
|
||||
if (platform.compare(SDL_GetPlatform()) != 0)
|
||||
{
|
||||
// Ignore the mapping but still acknowledge that it is one.
|
||||
success = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
pstartpos -= strlen("platform:");
|
||||
mapping.erase(pstartpos, pendpos - pstartpos + 1);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2006-2014 LOVE Development Team
|
||||
* Copyright (c) 2006-2015 LOVE Development Team
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2006-2014 LOVE Development Team
|
||||
* Copyright (c) 2006-2015 LOVE Development Team
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2006-2014 LOVE Development Team
|
||||
* Copyright (c) 2006-2015 LOVE Development Team
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2006-2014 LOVE Development Team
|
||||
* Copyright (c) 2006-2015 LOVE Development Team
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
@@ -179,13 +179,17 @@ int w_getGamepadMapping(lua_State *L)
|
||||
|
||||
int w_loadGamepadMappings(lua_State *L)
|
||||
{
|
||||
lua_pushvalue(L, 1);
|
||||
luax_convobj(L, -1, "filesystem", "isFile");
|
||||
bool isfile = luax_toboolean(L, -1);
|
||||
lua_pop(L, 1);
|
||||
|
||||
bool isfile = true;
|
||||
std::string mappings;
|
||||
|
||||
if (lua_isstring(L, 1))
|
||||
{
|
||||
lua_pushvalue(L, 1);
|
||||
luax_convobj(L, -1, "filesystem", "isFile");
|
||||
isfile = luax_toboolean(L, -1);
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
|
||||
if (isfile)
|
||||
{
|
||||
love::filesystem::FileData *fd = love::filesystem::luax_getfiledata(L, 1);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2006-2014 LOVE Development Team
|
||||
* Copyright (c) 2006-2015 LOVE Development Team
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
|
||||
Reference in New Issue
Block a user