Move Win32 GetBatteryInfo into Windows and UWP platforms impl
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
#include "Engine/Platform/Platform.h"
|
||||
#include "Engine/Platform/MemoryStats.h"
|
||||
#include "Engine/Platform/CPUInfo.h"
|
||||
#include "Engine/Platform/BatteryInfo.h"
|
||||
#include "Engine/Core/Types/Guid.h"
|
||||
#include "Engine/Core/Types/String.h"
|
||||
#include "Engine/Core/Math/Math.h"
|
||||
@@ -341,21 +340,6 @@ bool Win32Platform::Is64BitPlatform()
|
||||
#endif
|
||||
}
|
||||
|
||||
BatteryInfo Win32Platform::GetBatteryInfo()
|
||||
{
|
||||
BatteryInfo info;
|
||||
SYSTEM_POWER_STATUS status;
|
||||
GetSystemPowerStatus(&status);
|
||||
info.BatteryLifePercent = (float)status.BatteryLifePercent / 255.0f;
|
||||
if (status.BatteryFlag & 8)
|
||||
info.State = BatteryInfo::States::BatteryCharging;
|
||||
else if (status.BatteryFlag & 1 || status.BatteryFlag & 2 || status.BatteryFlag & 4)
|
||||
info.State = BatteryInfo::States::BatteryDischarging;
|
||||
else if (status.ACLineStatus == 1 || status.BatteryFlag & 128)
|
||||
info.State = BatteryInfo::States::Connected;
|
||||
return info;
|
||||
}
|
||||
|
||||
CPUInfo Win32Platform::GetCPUInfo()
|
||||
{
|
||||
return CpuInfo;
|
||||
|
||||
Reference in New Issue
Block a user