diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp index d341e64523..f544457da8 100644 --- a/SDL/SDLMain.cpp +++ b/SDL/SDLMain.cpp @@ -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; } }