[Scummvm-git-logs] scummvm master -> c113dfa993dad065da068728b85ff646fb54b91f

larsamannen noreply at scummvm.org
Wed Oct 11 19:33:36 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c113dfa993 IOS7: Fix AppleTV OS build errors and warnings


Commit: c113dfa993dad065da068728b85ff646fb54b91f
    https://github.com/scummvm/scummvm/commit/c113dfa993dad065da068728b85ff646fb54b91f
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2023-10-11T21:33:32+02:00

Commit Message:
IOS7: Fix AppleTV OS build errors and warnings

The tap gestures for right/left click in the iOS port was not
protected by the TARGET_OS_IOS macro definition in the touchesMoved
method which is called when a touch is moved.
Touches are used in tvOS when controlling the mouse pointer using
the touch area on the Apple remote controller.

Fix some compiler warnings about unused variables and functions in
the tvOS port.

Changed paths:
    backends/platform/ios7/ios7_options.mm
    backends/platform/ios7/ios7_osys_video.mm
    backends/platform/ios7/ios7_video.mm


diff --git a/backends/platform/ios7/ios7_options.mm b/backends/platform/ios7/ios7_options.mm
index d9623c1aa08..19ee6e66772 100644
--- a/backends/platform/ios7/ios7_options.mm
+++ b/backends/platform/ios7/ios7_options.mm
@@ -94,8 +94,6 @@ private:
 IOS7OptionsWidget::IOS7OptionsWidget(GuiObject *boss, const Common::String &name, const Common::String &domain) :
 		OptionsContainerWidget(boss, name, "IOS7OptionsDialog", false, domain), _enabled(true) {
 
-	const bool inAppDomain = domain.equalsIgnoreCase(Common::ConfigManager::kApplicationDomain);
-
 	_gamepadControllerCheckbox = new GUI::CheckboxWidget(widgetsBoss(), "IOS7OptionsDialog.GamepadController", _("Show Gamepad Controller (iOS 15 and later)"));
 	_gamepadControllerOpacityDesc = new GUI::StaticTextWidget(widgetsBoss(), "IOS7OptionsDialog.GamepadControllerOpacity", _("Gamepad opacity"));
 	_gamepadControllerOpacitySlider = new GUI::SliderWidget(widgetsBoss(), "IOS7OptionsDialog.GamepadControllerOpacitySlider", _("Gamepad opacity"), kGamepadControllerOpacityChanged);
@@ -111,6 +109,9 @@ IOS7OptionsWidget::IOS7OptionsWidget(GuiObject *boss, const Common::String &name
 
 #if TARGET_OS_IOS
 	_preferredTouchModeDesc = new GUI::StaticTextWidget(widgetsBoss(), "IOS7OptionsDialog.PreferredTouchModeText", _("Choose the preferred touch mode:"));
+
+	const bool inAppDomain = domain.equalsIgnoreCase(Common::ConfigManager::kApplicationDomain);
+
 	if (inAppDomain) {
 		_preferredTouchModeMenusDesc = new GUI::StaticTextWidget(widgetsBoss(), "IOS7OptionsDialog.TouchModeMenusText", _("In menus"));
 		_preferredTouchModeMenusPopUp = new GUI::PopUpWidget(widgetsBoss(), "IOS7OptionsDialog.TouchModeMenus");
@@ -174,7 +175,6 @@ IOS7OptionsWidget::~IOS7OptionsWidget() {
 }
 
 void IOS7OptionsWidget::defineLayout(GUI::ThemeEval &layouts, const Common::String &layoutName, const Common::String &overlayedLayout) const {
-	const bool inAppDomain = _domain.equalsIgnoreCase(Common::ConfigManager::kApplicationDomain);
 
 	layouts.addDialog(layoutName, overlayedLayout)
 	        .addLayout(GUI::ThemeLayout::kLayoutVertical)
@@ -201,6 +201,9 @@ void IOS7OptionsWidget::defineLayout(GUI::ThemeEval &layouts, const Common::Stri
 
 #if TARGET_OS_IOS
 	layouts.addWidget("PreferredTouchModeText", "", -1, layouts.getVar("Globals.Line.Height"));
+
+	const bool inAppDomain = _domain.equalsIgnoreCase(Common::ConfigManager::kApplicationDomain);
+
 	if (inAppDomain) {
 		layouts.addLayout(GUI::ThemeLayout::kLayoutHorizontal)
 			.addPadding(0, 0, 0, 0)
@@ -408,7 +411,9 @@ void IOS7OptionsWidget::load() {
 }
 
 bool IOS7OptionsWidget::save() {
+#if TARGET_OS_IOS
 	const bool inAppDomain = _domain.equalsIgnoreCase(Common::ConfigManager::kApplicationDomain);
+#endif
 
 	if (_enabled) {
 		ConfMan.setBool("gamepad_controller", _gamepadControllerCheckbox->getState(), _domain);
@@ -476,7 +481,6 @@ bool IOS7OptionsWidget::hasKeys() {
 }
 
 void IOS7OptionsWidget::setEnabled(bool e) {
-	const bool inAppDomain = _domain.equalsIgnoreCase(Common::ConfigManager::kApplicationDomain);
 	_enabled = e;
 
 #if TARGET_OS_IOS
@@ -510,6 +514,8 @@ void IOS7OptionsWidget::setEnabled(bool e) {
 	_keyboardFnBarCheckbox->setEnabled(e);
 
 #if TARGET_OS_IOS
+	const bool inAppDomain = _domain.equalsIgnoreCase(Common::ConfigManager::kApplicationDomain);
+
 	if (inAppDomain) {
 		_preferredTouchModeMenusDesc->setEnabled(e);
 		_preferredTouchModeMenusPopUp->setEnabled(e);
diff --git a/backends/platform/ios7/ios7_osys_video.mm b/backends/platform/ios7/ios7_osys_video.mm
index 3ce3550efce..46282bc6793 100644
--- a/backends/platform/ios7/ios7_osys_video.mm
+++ b/backends/platform/ios7/ios7_osys_video.mm
@@ -152,9 +152,11 @@ void OSystem_iOS7::updateOutputSurface() {
 }
 
 void OSystem_iOS7::updateTouchMode() {
+#if TARGET_OS_IOS
 	execute_on_main_thread(^ {
 		[[iOS7AppDelegate iPhoneView] updateTouchMode];
 	});
+#endif
 }
 
 void OSystem_iOS7::virtualController(bool connect) {
diff --git a/backends/platform/ios7/ios7_video.mm b/backends/platform/ios7/ios7_video.mm
index 7687e995e05..ddc31c18f3a 100644
--- a/backends/platform/ios7/ios7_video.mm
+++ b/backends/platform/ios7/ios7_video.mm
@@ -456,9 +456,9 @@ bool iOS7_fetchEvent(InternalEvent *event) {
 	// available when running on iOS 11+ if it has been compiled on iOS 11+
 #ifdef __IPHONE_11_0
 	if ( @available(iOS 11, tvOS 11, *) ) {
-		CGRect screenSize = [[UIScreen mainScreen] bounds];
 		CGRect newFrame = self.frame;
 #if TARGET_OS_IOS
+		CGRect screenSize = [[UIScreen mainScreen] bounds];
 		UIEdgeInsets inset = [[[UIApplication sharedApplication] keyWindow] safeAreaInsets];
 		UIInterfaceOrientation orientation = [iOS7AppDelegate currentOrientation];
 
@@ -611,8 +611,10 @@ bool iOS7_fetchEvent(InternalEvent *event) {
 }
 
 - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
+#if TARGET_OS_IOS
 	[oneFingerTapGesture setState:UIGestureRecognizerStateCancelled];
 	[twoFingerTapGesture setState:UIGestureRecognizerStateCancelled];
+#endif
 	for (GameController *c : _controllers) {
 		if ([c isKindOfClass:TouchController.class]) {
 			[(TouchController *)c touchesMoved:touches withEvent:event];




More information about the Scummvm-git-logs mailing list