Added love.system.vibrate(time), which causes the phone to vibrate on Android. love.system.getOS() now returns "Android" on Android. Implemented love.system.openURL.

This commit is contained in:
Martin Felis
2015-08-13 19:48:25 -03:00
parent 637a3a9d62
commit 2ab69094e1
6 changed files with 37 additions and 1 deletions
+17
View File
@@ -26,6 +26,8 @@
#include <CoreServices/CoreServices.h>
#elif defined(LOVE_IOS)
#include "common/iOS.h"
#elif defined(LOVE_ANDROID)
#include "common/android.h"
#elif defined(LOVE_LINUX)
#include <spawn.h>
//#include <stdlib.h>
@@ -66,6 +68,8 @@ std::string System::getOS() const
return "iOS";
#elif defined(LOVE_WINDOWS)
return "Windows";
#elif defined(LOVE_ANDROID)
return "Android";
#elif defined(LOVE_LINUX)
return "Linux";
#else
@@ -98,6 +102,10 @@ bool System::openURL(const std::string &url) const
return love::ios::openURL(url);
#elif defined(LOVE_ANDROID)
return love::android::openURL(url);
#elif defined(LOVE_LINUX)
pid_t pid;
@@ -134,6 +142,15 @@ bool System::openURL(const std::string &url) const
#endif
}
void System::vibrate(double seconds) const
{
#ifdef LOVE_ANDROID
love::android::vibrate(seconds);
#else
LOVE_UNUSED(seconds);
#endif
}
bool System::getConstant(const char *in, System::PowerState &out)
{
return powerStates.find(in, out);