mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
SDL: Use SDL_GetPowerInfo
This commit is contained in:
+12
-4
@@ -549,9 +549,17 @@ int64_t System_GetPropertyInt(SystemProperty prop) {
|
||||
return g_DesktopWidth;
|
||||
case SYSPROP_DISPLAY_YRES:
|
||||
return g_DesktopHeight;
|
||||
#if PPSSPP_PLATFORM(MAC)
|
||||
case SYSPROP_BATTERY_PERCENTAGE:
|
||||
#if PPSSPP_PLATFORM(MAC)
|
||||
// Let's keep using the old code on Mac for safety. Evaluate later if to be deleted.
|
||||
return Apple_GetCurrentBatteryCapacity();
|
||||
#else
|
||||
{
|
||||
int seconds = 0;
|
||||
int percentage = 0;
|
||||
SDL_GetPowerInfo(&seconds, &percentage);
|
||||
return percentage;
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
return -1;
|
||||
@@ -614,8 +622,6 @@ bool System_GetPropertyBool(SystemProperty prop) {
|
||||
#if PPSSPP_PLATFORM(MAC)
|
||||
case SYSPROP_HAS_FOLDER_BROWSER:
|
||||
case SYSPROP_HAS_FILE_BROWSER:
|
||||
case SYSPROP_CAN_READ_BATTERY_PERCENTAGE:
|
||||
return true;
|
||||
#endif
|
||||
case SYSPROP_HAS_ACCELEROMETER:
|
||||
#if defined(MOBILE_DEVICE)
|
||||
@@ -623,7 +629,9 @@ bool System_GetPropertyBool(SystemProperty prop) {
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
default:
|
||||
case SYSPROP_CAN_READ_BATTERY_PERCENTAGE:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user