소스 검색

[3.x] Make OSIPhone::get_screen_refresh_rate respect iOS Low Power Mode

Zach Coleman 1 년 전
부모
커밋
f330bea7a0
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      platform/iphone/os_iphone.mm

+ 5 - 1
platform/iphone/os_iphone.mm

@@ -653,7 +653,11 @@ int OSIPhone::get_screen_dpi(int p_screen) const {
 }
 
 float OSIPhone::get_screen_refresh_rate(int p_screen) const {
-	return [UIScreen mainScreen].maximumFramesPerSecond;
+	float fps = [UIScreen mainScreen].maximumFramesPerSecond;
+	if ([NSProcessInfo processInfo].lowPowerModeEnabled) {
+		fps = 60;
+	}
+	return fps;
 }
 
 Rect2 OSIPhone::get_window_safe_area() const {