Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
SDL: Use SDL_GetPowerInfo
  • Loading branch information
hrydgard committed Feb 11, 2025
commit 1ea14efcf9938ea9063cc59ea14406140baa8bc4
16 changes: 12 additions & 4 deletions SDL/SDLMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -614,16 +622,16 @@ 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)
return true;
#else
return false;
#endif
default:
case SYSPROP_CAN_READ_BATTERY_PERCENTAGE:
return true;
default:
return false;
}
}
Expand Down
Loading