mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Add support for displaying the battery percentage on Windows.
This commit is contained in:
parent
fcaf3daea9
commit
e98d481a63
1 changed files with 11 additions and 0 deletions
|
@ -339,6 +339,15 @@ int64_t System_GetPropertyInt(SystemProperty prop) {
|
|||
return KEYBOARD_LAYOUT_QWERTY;
|
||||
}
|
||||
}
|
||||
case SYSPROP_BATTERY_PERCENTAGE:
|
||||
{
|
||||
SYSTEM_POWER_STATUS status{};
|
||||
if (GetSystemPowerStatus(&status)) {
|
||||
return status.BatteryLifePercent < 255 ? status.BatteryLifePercent : 100;
|
||||
} else {
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
@ -395,6 +404,8 @@ bool System_GetPropertyBool(SystemProperty prop) {
|
|||
return IsDebuggerPresent();
|
||||
case SYSPROP_OK_BUTTON_LEFT:
|
||||
return true;
|
||||
case SYSPROP_CAN_READ_BATTERY_PERCENTAGE:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue