summaryrefslogtreecommitdiff
path: root/platform/iphone
AgeCommit message (Collapse)Author
2019-02-16New export options iOSBastiaan Olij
2019-02-12Platform: Ensure classes match their header filenameRémi Verschelde
Also drop some unused files. Renamed: - `platform/iphone/sem_iphone.h` -> `semaphore_iphone.h` (same for `osx`) - `platform/uwp/gl_context_egl.h` -> `context_egl_uwp.h` - in `platform/windows`: `context_gl_win.h`, `crash_handler_win.h`, `godot_win.cpp`, `joypad.h` and `key_mapping_win.h` all renamed to use `windows`. Some classes renamed accordingly too. - `EditorExportAndroid` and `EditorExportUWP` renamed to `EditorExportPlatformAndroid` and `EditorExportPlatformUWP` - `power_android` and `power_osx` renamed to `PowerAndroid` and `PowerOSX` - `OSUWP` renamed to `OS_UWP` Dropped: - `platform/windows/ctxgl_procaddr.h`
2019-01-21ExportDialog: Make error messages translatableRémi Verschelde
Also fix missing newlines that caused #24202.
2019-01-16SCons: Drop unused MPC_FIXED_POINT defineRémi Verschelde
2019-01-12Make export valid when setting custom packages for iOSvolzhs
even no templates installed. all others export work as this already.
2019-01-09Don't use -ffast-math or other unsafe math optimizationsHein-Pieter van Braam
Godot supports many different compilers and for production releases we have to support 3 currently: GCC8, Clang6, and MSVC2017. These compilers all do slightly different things with -ffast-math and it is causing issues now. See #24841, #24540, #10758, #10070. And probably other complaints about physics differences between release and release_debug builds. I've done some performance comparisons on Linux x86_64. All tests are ran 20 times. Bunnymark: (higher is better) (bunnies) min max stdev average fast-math 7332 7597 71 7432 this pr 7379 7779 108 7621 (102%) FPBench (gdscript port http://fpbench.org/) (lower is better) (ms) fast-math 15441 16127 192 15764 this pr 15671 16855 326 16001 (99%) Float_add (adding floats in a tight loop) (lower is better) (sec) fast-math 5.49 5.78 0.07 5.65 this pr 5.65 5.90 0.06 5.76 (98%) Float_div (dividing floats in a tight loop) (lower is better) (sec) fast-math 11.70 12.36 0.18 11.99 this pr 11.92 12.32 0.12 12.12 (99%) Float_mul (multiplying floats in a tight loop) (lower is better) (sec) fast-math 11.72 12.17 0.12 11.93 this pr 12.01 12.62 0.17 12.26 (97%) I have also looked at FPS numbers for tps-demo, 3d platformer, 2d platformer, and sponza and could not find any measurable difference. I believe that given the issues and oft-reported (physics) glitches on release builds I believe that the couple of percent of tight-loop floating point performance regression is well worth it. This fixes #24540 and fixes #24841
2019-01-01Update copyright statements to 2019Rémi Verschelde
Happy new year to the wonderful Godot community!
2018-12-30Merge pull request #24545 from akien-mga/osxcross-monoRémi Verschelde
SCons: Allow building Mono module with OSXCross
2018-12-27SCons: Drop ios_sim option forcing x86, simulator needs x86_64Rémi Verschelde
2018-12-22SCons: Allow building Mono module with OSXCrossRémi Verschelde
Improve the test logic to only assume that we're building for macOS if OSXCROSS_ROOT is defined *and* we requested p=osx. Supersedes #24480.
2018-12-20Core: Drop unused global_defaults logicRémi Verschelde
It used to be used for Android and iOS to specify platform-specific project settings overrides, but we now have feature tags for that.
2018-12-16Reduce String CoWHein-Pieter van Braam
By introducing an intermediate proxy class for the array subscript operator for String and CharString we can control better when CowData will actually CoW. This should improve performance of String usage for most cases.
2018-12-13Merge pull request #24285 from volzhs/support-gles2-iosRémi Verschelde
Support GLES2 for iOS
2018-12-12Bump minimum iOS version to 10Sam Green
2018-12-11Support GLES2 for iOSvolzhs
2018-12-05Merge pull request #24166 from volzhs/export-iosRémi Verschelde
Add checking required field for exporting iOS
2018-12-05Add checking required field for exporting iOSvolzhs
without specifying Identifier, it will cause `can not be parsed` error on Xcode
2018-12-04Fix iOS safe area insets to use pixels and not pointsRuslan Mustakov
2018-11-23Show error if required fields are not filled when exporting iOSvolzhs
2018-11-20Merge pull request #21339 from Placinta/masterRémi Verschelde
Fix regular macOS build by passing -isysroot to compiler so correct system headers are found
2018-11-02Merge pull request #23389 from marcelofg55/multiple_extRémi Verschelde
Export for OS X on OS X now lets you select .dmg or .zip
2018-11-01Fix init of VisualServerRasterRémi Verschelde
Contrarily to what #23434 assumed, this is not a memory leak, the VisualServerRaster instance is passed as a parameter to VisualServerWrapMT's constructor. Fixes #23437.
2018-11-01Fix initialization of visual server in all platformsGeorge Marques
Avoid leaking an extra instance when using threads. Also fix threaded loading issues on Android and iOS.
2018-11-01Export for OS X on OS X now lets you select .dmg or .zipMarcelo Fernandez
2018-10-27Dont use equality operators with None singleton in python fileslupoDharkael
2018-10-04Fix some OSX and iOS Clang warningsRémi Verschelde
Fixes the following XCode 9.4.1 warnings: ``` core/os/memory.cpp:175:13: warning: unused variable 's' [-Wunused-variable] drivers/coremidi/core_midi.cpp:68:14: warning: comparison between NULL and non-pointer ('MIDIEndpointRef' (aka 'unsigned int') and NULL) [-Wnull-arithmetic] drivers/gles2/rasterizer_gles2.cpp:77:24: warning: unused function '_gl_debug_print' [-Wunused-function,34] drivers/unix/thread_posix.cpp:106:12: warning: unused variable 'running_thread' [-Wunused-variable,34] modules/gdnative/nativescript/nativescript.h:371:16: warning: in-class initialization of non-static data member is a C++11 extension [-Wc++11-extensions] platform/iphone/gl_view.mm:56:14: warning: unused variable 'video_previous_volume' [-Wunused-variable,34] platform/iphone/gl_view.mm:251:12: warning: unused function 'get_first_id' [-Wunused-function,34] platform/iphone/main.m:45:15: warning: unused variable 'app' [-Wunused-variable,34] platform/osx/os_osx.mm:79:15: warning: unused function 'convertRectToBacking' [-Wunused-function] ```
2018-09-28SCons: Build thirdparty code in own env, disable warningsRémi Verschelde
Also remove unnecessary `Export('env')` in other SCsubs, Export should only be used when exporting *new* objects.
2018-09-27Fix warnings for comparison between signed and unsigned integers ↵Rémi Verschelde
[-Wsign-compare] Also turn off -Wsign-compare warnings in the future, we do not consider them important. Fixes the following GCC 5 warnings: ``` core/node_path.cpp:279:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] core/oa_hash_map.h:169:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] core/oa_hash_map.h:314:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] drivers/gles2/shader_gles2.cpp:985:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] drivers/gles3/rasterizer_storage_gles3.cpp:1075:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] drivers/pulseaudio/audio_driver_pulseaudio.cpp:343:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] editor/editor_plugin.cpp:525:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] editor/editor_properties_array_dict.cpp:747:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] editor/plugins/spatial_editor_plugin.cpp:2078:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] editor/plugins/spatial_editor_plugin.cpp:4096:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] editor/plugins/sprite_editor_plugin.cpp:100:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] modules/cvtt/image_compress_cvtt.cpp:122:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] modules/cvtt/image_compress_cvtt.cpp:134:77: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] modules/cvtt/image_compress_cvtt.cpp:339:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] modules/etc/image_etc.cpp:222:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] modules/gdnative/register_types.cpp:242:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] modules/gdnative/register_types.cpp:258:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] modules/opensimplex/simplex_noise.cpp:200:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] modules/opensimplex/simplex_noise.cpp:222:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] modules/opensimplex/simplex_noise.cpp:246:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] platform/android/export/export.cpp:1085:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] platform/android/export/export.cpp:1489:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] platform/android/export/export.cpp:1623:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] platform/iphone/export/export.cpp:206:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] platform/iphone/export/export.cpp:356:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] platform/iphone/export/export.cpp:406:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] platform/iphone/export/export.cpp:493:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] scene/3d/audio_stream_player_3d.cpp:420:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] scene/resources/audio_stream_sample.cpp:565:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] scene/resources/audio_stream_sample.cpp:571:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] servers/audio/audio_rb_resampler.cpp:156:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] ``` The following warnings were not fixed, as they implied casting for no gain: ``` core/io/packet_peer.cpp:228:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] core/io/resource_format_binary.cpp:109:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] drivers/gles2/rasterizer_scene_gles2.cpp:144:57: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] drivers/unix/file_access_unix.cpp:249:46: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] scene/3d/voxel_light_baker.cpp:889:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] scene/3d/voxel_light_baker.cpp:1020:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] scene/3d/voxel_light_baker.cpp:1154:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] scene/3d/voxel_light_baker.cpp:2255:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] scene/resources/bit_mask.cpp:336:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] servers/audio/audio_stream.cpp:141:49: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] servers/audio/audio_stream.cpp:150:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] servers/audio/audio_stream.cpp:154:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] servers/audio_server.cpp:86:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] servers/audio_server.cpp:89:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] ```
2018-09-12Make core/ includes absolute, remove subfolders from include pathRémi Verschelde
This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
2018-08-27Pass -isysroot to compiler / linker when doing a macOS buildAlexandru Croitor
Previously the compiler would use system headers located at /System/Library/Frameworks, which could result in compilation failures due to the headers not always being up-to-date in regards to the latest installed macOS SDK headers that come with Xcode. Fix the issue by passing the SDK path via the -isysroot option to the compiler and linker invocations. If no custom SDK path is given, the build system queries the SDK path via xcrun --show-sdk-path, which returns something similar to /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/ /Developer/SDKs/MacOSX.sdk/ Querying via xcrun is now also done for iphone (and simulator) platforms as well. Here is an example of a compilation failure message due to outdated headers: platform/osx/os_osx.mm:1421:41: error: use of undeclared identifier 'NSAppKitVersionNumber10_12'; did you mean 'NSAppKitVersionNumber'? if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_12) { ^~~~~~~~~~~~~~~~~~~~~~~~~~ NSAppKitVersionNumber /System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:26:28: note: 'NSAppKitVersionNumber' declared here
2018-08-26Fall back to GLES2 if GLES3 is not workingHein-Pieter van Braam
This adds a static is_viable() method to all rasterizers which has to be called before initializing the rasterizer. This allows us to check what rasterizer to use in OS::initialize together with the GL context initialization. This commit also adds a new project setting "rendering/quality/driver/driver_fallback" which allows the creator of a project to specify whether or not fallback to GLES2 is allowed. This setting is ignored for the editor so the editor will always open even if the project itself cannot run. This will hopefully reduce confusion for users downloading projects from the internet. We also no longer crash when GLES3 is not functioning on a platform. This fixes #15324
2018-08-24Make some debug prints verbose-only, remove othersRémi Verschelde
2018-08-23Fix file hintsMarcin Zawiejski
Fixes file hints so the file dialog actually displays the files with given extension (e.g. *.apk).
2018-08-21BPTC supportelasota
2018-08-20Add PROPERTY_HINT_PLACEHOLDER_TEXT for String propertiesRémi Verschelde
Use it to provide a better example for application identifiers on Android, iOS and macOS, where users thought they *had* to use this as a magic token.
2018-07-26Reduce unnecessary COW on Vector by make writing explicitHein-Pieter van Braam
This commit makes operator[] on Vector const and adds a write proxy to it. From now on writes to Vectors need to happen through the .write proxy. So for instance: Vector<int> vec; vec.push_back(10); std::cout << vec[0] << std::endl; vec.write[0] = 20; Failing to use the .write proxy will cause a compilation error. In addition COWable datatypes can now embed a CowData pointer to their data. This means that String, CharString, and VMap no longer use or derive from Vector. _ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug builds. This is a lot faster for Vector in the editor and while running tests. The reason why this difference used to exist is because force-inlined methods used to give a bad debugging experience. After extensive testing with modern compilers this is no longer the case.
2018-07-24Removed unnecessary assignmentsWilson E. Alvarez
2018-07-21-Fix disable_3d flagJuan Linietsky
-Add extra flag optimize=[size,speed] to be able to prioritize size
2018-07-20Fix build issues and typos after c69de2ba4Rémi Verschelde
2018-07-19-Project/Editor settings now use new inspectorJuan Linietsky
-Project/Editor settings now show tooltips properly -Settings thar require restart now will show a restart warning -Video driver is now visible all the time, can be changed easily -Added function to request current video driver
2018-07-18Style: Format code with clang-format 6.0.1Rémi Verschelde
2018-07-17Fix keep screen on property path for Android/iOS/UWPvolzhs
2018-07-01Respect window/handheld/orientation setting in iOSYasha Borevich
2018-06-28Optimize images losslessly using `oxipng -o6 --strip all --zopfli`Hugo Locurcio
2018-05-11Proper focus in/out handling on iOSRuslan Mustakov
PR #18675 (commit 96301e9) revealed a problem with how iOS lifecycle callbacks were handled by Godot. Before that PR it was possible to get NOTIFICATION_WM_FOCUS_IN callback without getting the corresponding NOTIFICATION_WM_FOCUS_OUT. That commit added a flag to ensure they are always coupled, but now there is an issue when, for example, you open a notification panel on iOS without moving the app to background. It resulted in view.stopAnimation being called without the corresponding startAnimation when the app moves to foreground again, so it looked like the game hanged. I changed focus out notification to be sent in applicationWillResignActive, because it makes more sense than to do it in applicationDidEnterBackground, because it is always called in pair with applicationDidBecomeActive, where focus in is sent. applicationDidEnterBackground may not come under circumstances that are now described as a comment in code.
2018-05-07Resume audio on iOS after phone call or alarmRuslan Mustakov
When a phone call or an alarm triggers on iOS, the application receives an "audio interruption" and it's up to the application to resume playback when the interruption ends. I added handling for audio interruptions same as if the game is focused out and then back in.
2018-05-02Merge pull request #17196 from RandomShaper/improve-gui-touchRémi Verschelde
Implement universal translation of touch to mouse (3.1)
2018-04-30Implement universal translation of touch to mousePedro J. Estébanez
Now generating mouse events from touch is optional (on by default) and it's performed by `InputDefault` instead of having each OS abstraction doing it. (*) The translation algorithm waits for a touch index to be pressed and tracks it translating its events to mouse events until it is raised, while ignoring other pointers. Furthermore, to avoid an stuck "touch mouse", since not all platforms may report touches raised when the window is unfocused, it checks if touches are still down by the time it's focused again and if so it resets the state of the emulated mouse. *: In the case of Windows, since it already provides touch-to-mouse translation by itself, "echo" mouse events are filtered out to have it working like the rest. On X11 a little hack has been needed to avoid a case of a spurious mouse motion event that is generated during touch interaction. Plus: Improve/fix tracking of current mouse position. ** Summary of changes to settings: ** - `display/window/handheld/emulate_touchscreen` becomes `input/pointing_devices/emulate_touch_from_mouse` - New setting: `input/pointing_devices/emulate_mouse_from_touch`
2018-04-19Provide error details when in-app purchase failsRuslan Mustakov
2018-04-11iPhone X support and iOS-related fixesRuslan Mustakov
Starting from April 2018 Apple no longer accepts apps that do not support iPhone X. For games this mainly means respecting the safe area, unobstructed by notch and virtual home button. UI controls must be placed within the safe area so that users can interact with them. This commit: - Adds OS::get_window_safe_area method that returns unobscured area of the window, where interactive controls should be rendered. - Reorganizes how launch screens are exported - the previous way was incorrect and modern iPhones did not pick up the correct screens and because of that used a non-native resolution to render the game. - Adds launch screen options for iPhone X. - Makes launch screens optional in the export template. If not specified, a white screen will be used. - Adds App Store icon (1024x1024) export option as it now has to be bundled with the app instead of being provided in iTunes Connect. - Fixes crash when launching games in iOS Simulator. It happened because controllerWasConnected callback came before the engine was initialized. Now in such case the controllers will be queued up and registered after initialization is done. - Fixes issue with the virtual keyboard where for some reason autocorrection panel would intersect with the keyboard itself and not allow you to use the top row of the keyboard. This is fixed by disabling autocorrection altogether. Closes #17358. Fixes #17428. Fixes #17331.