[Scummvm-git-logs] scummvm master -> 46d6a76b8ea36998665edf01a1e6fc989f255514
larsamannen
noreply at scummvm.org
Tue May 2 06:02:19 UTC 2023
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
d66538a133 CREATE_PROJECT: Set bitcode as disabled as default in Xcode
50b67d97c4 IOS7: Implement use of Timer Dispatch Sources to drive timeHandler
46d6a76b8e IOS7: Implement new delegate methods replacing deprecated ones
Commit: d66538a133cdd44dbd5a4a1c062b27382e1ef826
https://github.com/scummvm/scummvm/commit/d66538a133cdd44dbd5a4a1c062b27382e1ef826
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2023-05-02T08:02:12+02:00
Commit Message:
CREATE_PROJECT: Set bitcode as disabled as default in Xcode
Apple never required bitcode to be enabled and with Xcode 14
bitcode is deprecated.
Set bitcode to disabled for iOS and tvOS projects. Else it will
be default on and give a build error due to the libraries in
scummvm-ios7-libs-v3 doesn't include bitcode.
Changed paths:
devtools/create_project/xcode.cpp
diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp
index 6f68c51749c..a644c5bb6e3 100644
--- a/devtools/create_project/xcode.cpp
+++ b/devtools/create_project/xcode.cpp
@@ -1352,6 +1352,7 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
ADD_SETTING_QUOTE_VAR(iPhone_Debug, "CODE_SIGN_IDENTITY[sdk=iphoneos*]", "iPhone Developer");
ADD_SETTING(iPhone_Debug, "COPY_PHASE_STRIP", "NO");
ADD_SETTING_QUOTE(iPhone_Debug, "DEBUG_INFORMATION_FORMAT", "dwarf");
+ ADD_SETTING(iPhone_Debug, "ENABLE_BITCODE", "NO");
ValueList iPhone_FrameworkSearchPaths;
iPhone_FrameworkSearchPaths.push_back("$(inherited)");
iPhone_FrameworkSearchPaths.push_back("\"$(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"");
@@ -1511,6 +1512,7 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
ADD_SETTING_QUOTE_VAR(tvOS_Debug, "CODE_SIGN_IDENTITY[sdk=appletvos*]", "iPhone Developer");
ADD_SETTING(tvOS_Debug, "COPY_PHASE_STRIP", "NO");
ADD_SETTING_QUOTE(tvOS_Debug, "DEBUG_INFORMATION_FORMAT", "dwarf");
+ ADD_SETTING(tvOS_Debug, "ENABLE_BITCODE", "NO");
ValueList tvOS_FrameworkSearchPaths;
tvOS_FrameworkSearchPaths.push_back("$(inherited)");
tvOS_FrameworkSearchPaths.push_back("\"$(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"");
Commit: 50b67d97c49431d2ae4d79a5ad03b2f89d60a741
https://github.com/scummvm/scummvm/commit/50b67d97c49431d2ae4d79a5ad03b2f89d60a741
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2023-05-02T08:02:12+02:00
Commit Message:
IOS7: Implement use of Timer Dispatch Sources to drive timeHandler
The timeHandler was driven by calls to the pollEvent callback function.
Each time pollEvent was called the timeHandler called the TimeManager
handle function to advance in time and make sure scheduled tasks were
triggered.
This worked good for most game engines but some, e.g. the Hypno engine
was using the TimeManager to schedule tasks without calling pollEvent
since it was expecting nor handling events at the specific point in
time.
Since iOS have threads the timerHandler can be called from a separate
thread and not rely on pollEvent.
Implement timerHandler to use a Timer Dispatch Source which and make
it operate on a background thread rather than the main thread.
Read more on Dispatch Sources here:
https://developer.apple.com/library/archive/documentation/General/
Conceptual/ConcurrencyProgrammingGuide/GCDWorkQueues/GCDWorkQueues.html
Changed paths:
backends/platform/ios7/ios7_osys_events.cpp
backends/platform/ios7/ios7_osys_main.cpp
backends/platform/ios7/ios7_osys_main.h
diff --git a/backends/platform/ios7/ios7_osys_events.cpp b/backends/platform/ios7/ios7_osys_events.cpp
index 290a84b63e7..9880ade53ab 100644
--- a/backends/platform/ios7/ios7_osys_events.cpp
+++ b/backends/platform/ios7/ios7_osys_events.cpp
@@ -34,11 +34,6 @@ bool OSystem_iOS7::pollEvent(Common::Event &event) {
long curTime = getMillis();
- if (_timerCallback && (curTime >= _timerCallbackNext)) {
- _timerCallback(_timerCallbackTimer);
- _timerCallbackNext = curTime + _timerCallbackTimer;
- }
-
if (_queuedInputEvent.type != Common::EVENT_INVALID && curTime >= _queuedEventTime) {
event = _queuedInputEvent;
_queuedInputEvent.type = Common::EVENT_INVALID;
diff --git a/backends/platform/ios7/ios7_osys_main.cpp b/backends/platform/ios7/ios7_osys_main.cpp
index 3511ed83b16..d769cb4b325 100644
--- a/backends/platform/ios7/ios7_osys_main.cpp
+++ b/backends/platform/ios7/ios7_osys_main.cpp
@@ -303,13 +303,15 @@ void OSystem_iOS7::delayMillis(uint msecs) {
void OSystem_iOS7::setTimerCallback(TimerProc callback, int interval) {
//printf("setTimerCallback()\n");
-
- if (callback != NULL) {
- _timerCallbackTimer = interval;
- _timerCallbackNext = getMillis() + interval;
- _timerCallback = callback;
- } else
- _timerCallback = NULL;
+ dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
+ dispatch_source_t timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue);
+
+ if (timer)
+ {
+ dispatch_source_set_timer(timer, dispatch_walltime(NULL, 0), interval * NSEC_PER_MSEC, interval * NSEC_PER_MSEC / 10);
+ dispatch_source_set_event_handler(timer, ^{ callback(interval); });
+ dispatch_resume(timer);
+ }
}
Common::MutexInternal *OSystem_iOS7::createMutex() {
diff --git a/backends/platform/ios7/ios7_osys_main.h b/backends/platform/ios7/ios7_osys_main.h
index 01f83a1e5e4..91fbefffe58 100644
--- a/backends/platform/ios7/ios7_osys_main.h
+++ b/backends/platform/ios7/ios7_osys_main.h
@@ -95,10 +95,6 @@ protected:
int _lastDragPosX;
int _lastDragPosY;
- int _timerCallbackNext;
- int _timerCallbackTimer;
- TimerProc _timerCallback;
-
Common::Array<Common::Rect> _dirtyRects;
Common::Array<Common::Rect> _dirtyOverlayRects;
ScreenOrientation _screenOrientation;
Commit: 46d6a76b8ea36998665edf01a1e6fc989f255514
https://github.com/scummvm/scummvm/commit/46d6a76b8ea36998665edf01a1e6fc989f255514
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2023-05-02T08:02:12+02:00
Commit Message:
IOS7: Implement new delegate methods replacing deprecated ones
The delegate methods application:shouldRestoreApplicationState
is replaced with application:shouldRestoreSecureApplicationState
and the method application:shouldSaveApplicationState with
application:shouldSaveSecureApplicationState.
To support older versions of iOS, put them in a version check
macro.
Changed paths:
backends/platform/ios7/ios7_app_delegate.mm
diff --git a/backends/platform/ios7/ios7_app_delegate.mm b/backends/platform/ios7/ios7_app_delegate.mm
index 517e509e96c..af682585205 100644
--- a/backends/platform/ios7/ios7_app_delegate.mm
+++ b/backends/platform/ios7/ios7_app_delegate.mm
@@ -110,11 +110,19 @@
[_view saveApplicationState];
}
+#ifdef __IPHONE_13_2
+- (BOOL)application:(UIApplication *)application shouldSaveSecureApplicationState:(NSCoder *)coder {
+#else
- (BOOL)application:(UIApplication *)application shouldSaveApplicationState:(NSCoder *)coder {
+#endif
return YES;
}
+#ifdef __IPHONE_13_2
+- (BOOL)application:(UIApplication *)application shouldRestoreSecureApplicationState:(NSCoder *)coder {
+#else
- (BOOL)application:(UIApplication *)application shouldRestoreApplicationState:(NSCoder *)coder {
+#endif
return YES;
}
More information about the Scummvm-git-logs
mailing list