Make screen_get_refresh_rate() respect iOS Low Power Mode

(cherry picked from commit 6a8f6bae4c)
This commit is contained in:
Zach Coleman 2023-11-17 08:32:54 -05:00 committed by Yuri Sizov
parent 93fd5da49c
commit 9609df181d
1 changed files with 5 additions and 1 deletions

View File

@ -443,7 +443,11 @@ int DisplayServerIOS::screen_get_dpi(int p_screen) const {
}
float DisplayServerIOS::screen_get_refresh_rate(int p_screen) const {
return [UIScreen mainScreen].maximumFramesPerSecond;
float fps = [UIScreen mainScreen].maximumFramesPerSecond;
if ([NSProcessInfo processInfo].lowPowerModeEnabled) {
fps = 60;
}
return fps;
}
float DisplayServerIOS::screen_get_scale(int p_screen) const {