mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
SDL: Use SDL_GetPowerInfo
This commit is contained in:
parent
61aa231fe2
commit
1ea14efcf9
1 changed files with 12 additions and 4 deletions
|
@ -549,9 +549,17 @@ int64_t System_GetPropertyInt(SystemProperty prop) {
|
||||||
return g_DesktopWidth;
|
return g_DesktopWidth;
|
||||||
case SYSPROP_DISPLAY_YRES:
|
case SYSPROP_DISPLAY_YRES:
|
||||||
return g_DesktopHeight;
|
return g_DesktopHeight;
|
||||||
#if PPSSPP_PLATFORM(MAC)
|
|
||||||
case SYSPROP_BATTERY_PERCENTAGE:
|
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();
|
return Apple_GetCurrentBatteryCapacity();
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
int seconds = 0;
|
||||||
|
int percentage = 0;
|
||||||
|
SDL_GetPowerInfo(&seconds, &percentage);
|
||||||
|
return percentage;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -614,8 +622,6 @@ bool System_GetPropertyBool(SystemProperty prop) {
|
||||||
#if PPSSPP_PLATFORM(MAC)
|
#if PPSSPP_PLATFORM(MAC)
|
||||||
case SYSPROP_HAS_FOLDER_BROWSER:
|
case SYSPROP_HAS_FOLDER_BROWSER:
|
||||||
case SYSPROP_HAS_FILE_BROWSER:
|
case SYSPROP_HAS_FILE_BROWSER:
|
||||||
case SYSPROP_CAN_READ_BATTERY_PERCENTAGE:
|
|
||||||
return true;
|
|
||||||
#endif
|
#endif
|
||||||
case SYSPROP_HAS_ACCELEROMETER:
|
case SYSPROP_HAS_ACCELEROMETER:
|
||||||
#if defined(MOBILE_DEVICE)
|
#if defined(MOBILE_DEVICE)
|
||||||
|
@ -623,7 +629,9 @@ bool System_GetPropertyBool(SystemProperty prop) {
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
default:
|
case SYSPROP_CAN_READ_BATTERY_PERCENTAGE:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue