mirror of
https://github.com/love2d/love.git
synced 2026-08-13 17:10:54 +02:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user