Add Android support to hasBackgroundMusic

This commit is contained in:
Tiago Koji Castro Shibata
2017-07-13 23:54:37 -03:00
parent 74c35358bb
commit 4e9212b152
6 changed files with 51 additions and 11 deletions
+14
View File
@@ -93,6 +93,19 @@ int w_vibrate(lua_State *L)
return 0;
}
int w_hasBackgroundMusic(lua_State *L)
{
try
{
lua_pushboolean(L, instance()->hasBackgroundMusic());
}
catch (love::Exception &)
{
lua_pushnil(L);
}
return 1;
}
static const luaL_Reg functions[] =
{
{ "getOS", w_getOS },
@@ -102,6 +115,7 @@ static const luaL_Reg functions[] =
{ "getPowerInfo", w_getPowerInfo },
{ "openURL", w_openURL },
{ "vibrate", w_vibrate },
{ "hasBackgroundMusic", w_hasBackgroundMusic },
{ 0, 0 }
};