Merge default into minor

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2017-07-28 19:14:54 -03:00
12 changed files with 116 additions and 0 deletions
+11
View File
@@ -158,6 +158,17 @@ void System::vibrate(double seconds) const
#endif
}
bool System::hasBackgroundMusic() const
{
#if defined(LOVE_ANDROID)
return love::android::hasBackgroundMusic();
#elif defined(LOVE_IOS)
return love::ios::hasBackgroundMusic();
#else
return false;
#endif
}
bool System::getConstant(const char *in, System::PowerState &out)
{
return powerStates.find(in, out);
+8
View File
@@ -106,6 +106,14 @@ public:
*/
virtual void vibrate(double seconds) const;
/**
* Gets if the user is playing music on background.
* Throws an exception on unsupported platforms.
*
* @return Whether a music is playing on background.
**/
bool hasBackgroundMusic() const;
static bool getConstant(const char *in, PowerState &out);
static bool getConstant(PowerState in, const char *&out);
+7
View File
@@ -95,6 +95,12 @@ int w_vibrate(lua_State *L)
return 0;
}
int w_hasBackgroundMusic(lua_State *L)
{
lua_pushboolean(L, instance()->hasBackgroundMusic());
return 1;
}
static const luaL_Reg functions[] =
{
{ "getOS", w_getOS },
@@ -104,6 +110,7 @@ static const luaL_Reg functions[] =
{ "getPowerInfo", w_getPowerInfo },
{ "openURL", w_openURL },
{ "vibrate", w_vibrate },
{ "hasBackgroundMusic", w_hasBackgroundMusic },
{ 0, 0 }
};